@extends('layouts.master') @section('title',$company->name." | ".trans('app.chances.chances')) @section('content')
@include('companies.sidebar', ['company_id' => $company->id])
@if(session('message'))
{{session('message')}}
@endif

{{trans('app.chances.posted')}}

{{($company->chances()->whereNotIn('status', [3,5])->count())}}

{{trans('app.chances.provided_offers')}}

{{$chances_offer_count}}

{{trans('app.chances.downloads')}}

{{$chances_downloads_count}}
@foreach($chances as $chance) @if($chance->status!=3&&$chance->status!=5) @else @endif @if(($count=($chance->offers()->count()))>0) @else @endif @php $is_approved= DB::table('chances_offers_files')->where([['chance_id', $chance->id],['approved', 1]])->count()?true:false; @endphp @endforeach
{{trans('app.chances.chance_name')}} {{trans('app.chances.downloads')}} {{trans('app.chances.provided_offers')}} {{trans('app.chances.accepted')}} {{trans('app.chances.created_at')}} {{trans('app.chances.status')}}
{{$chance->name}}{{$chance->name}}{{$chance->downloads}}{{$count}} {{$count}}{{$is_approved ? trans('app.chances.approved') : trans('app.chances.not_approved')}} {{$chance->created_at}} @if(in_array($chance->status,[2,0])&&!$is_approved) {{$chance->status==2? trans('app.chances.active') : trans('app.chances.declined')}} @endif @if(in_array($chance->status,[3,5])&&!$is_approved) {{trans('chances::chances.status.'.$chance->status)}}
{{trans('app.edit')}} @endif @if($is_approved || $chance->status==4) {{trans('app.chances.approved_done')}} @endif
@endsection @push('scripts') @endpush