{{ trans('dashboard.dashboard_page.screen_location') }}

@php($i=1) @if(!empty($contents) && !$contents->isEmpty()) @foreach($contents as $content) @php($screen_ids = \App\Models\ContentScreen::where('content_id', $content->id)->pluck('screen_id')->toArray()) @php($content_venue_ids = \App\Models\ContentScreen::where('content_id', $content->id)->with('getScreen')->get()->pluck('getScreen.venue_id')->toArray()) @php($venues = \App\Models\Venue::whereIn('id', $content_venue_ids)->with(['venuScreens' => function($q) use($screen_ids) { $q->whereIn('id', $screen_ids); }])->get()) @foreach($venues as $venue) @endforeach
@if($venue->thumbnail) @else @endif {{ $venue->getCityName->name }} {{ count($venue->venuScreens) }} {{ count($venue->venuScreens) > 1 ? trans('dashboard.dashboard_page.screens') : trans('dashboard.dashboard_page.screen') }}
@php($i++) @endforeach @else

{{ trans('dashboard.dashboard_page.no_data') }}

@endif
@php($total_viewers=0) @php($total_slot=0) @php($slot_count=0) @php($video_ext = Config('global.video_extensions')) @php($image_ext = Config('global.image_extensions'))

{{ trans('dashboard.dashboard_page.my_content') }}

@php($i=1) @php($viewers = 0) @if(!empty($contents) && !$contents->isEmpty()) @foreach($contents as $content) @php($media_ids = \App\Models\ContentMedia::withTrashed()->where('content_id', $content->id)->pluck('media_id')->toArray()) @php($medias = \App\Models\Media::withTrashed()->whereIn('id', $media_ids)->get()) @php($content_screens = \App\Models\ContentScreen::where('content_id', $content->id)->pluck('screen_id')->toArray()) @php($video_ext = Config('global.video_extensions')) @php($image_ext = Config('global.image_extensions')) @php($j) @php($viewers = DB::table('screens')->whereIn('id', $content_screens)->sum('viewer')) @if(!$medias->isEmpty()) @foreach($medias as $media) @php($info = new \SplFileInfo($media->path)) @php($ext = $info->getExtension()) @if(in_array($ext,$video_ext)) @php($getID3 = new \getID3) @php($file = $getID3->analyze(public_path('uploads/items/video/'.$media->path))) @php($duration = seconds_from_time(date('H:i:s', $file['playtime_seconds']))) @php($duration_actual = (date('H:i:s', $file['playtime_seconds']))) @php($_slot_count = $duration/15) @php($slot_count += ceil($_slot_count)) @elseif(in_array($ext,$image_ext)) @php($slot_count += 1) @endif {{-- @php($info = new \SplFileInfo($media->path)) --}} {{-- @php($ext = $info->getExtension()) --}} {{-- --}} @endforeach @else

{{ trans('dashboard.dashboard_page.no_data') }}

@endif
@if(in_array($ext,$image_ext))@elseif(in_array($ext,$video_ext))@endif {{ $media->title }}  {{ !empty($viewers) ? thousandsCurrencyFormat($viewers) : 0 }}
@php($i++) @php($total_viewers+=$viewers) @endforeach @php($total_slot += $slot_count) @else

{{ trans('dashboard.dashboard_page.no_data') }}

@endif
@if(!empty($contents)) @php($content_ids = $contents->pluck('id')->toArray()) @php($screen_ids = \App\Models\ContentScreen::whereIn('content_id', $content_ids)->groupBy('screen_id')->pluck('screen_id')->toArray()) @php($total_price = $contents->sum('price')) @php($content_screens = \App\Models\ContentScreen::whereIn('content_id', $content_ids)->pluck('screen_id')->toArray()) @php($viewers = $total_viewers) @if($total_price > 0) @php($average_cost_per_view = $viewers/$total_price) @else @php($average_cost_per_view = 0) @endif @php($content_venue_ids = \App\Models\ContentScreen::whereIn('content_id', $content_ids)->with('getScreen')->get()->pluck('getScreen.venue_id')->toArray()) @php($venues = \App\Models\Venue::whereIn('id', $content_venue_ids)->with(['venuScreens' => function($q) use($screen_ids) { $q->whereIn('id', $screen_ids); }])->count()) @php($venue_screens = \App\Models\Venue::whereIn('id', $content_venue_ids)->with(['venuScreens' => function($q) use($screen_ids) { $q->whereIn('id', $screen_ids); }])->count()) @php($average_cost_per_location = $total_price/$venues) @php($total_repetition_per_campaign = !empty($total_slot) ? 50400/($total_slot*15) : 0) @php($average_repetition_per_location = !empty($total_repetition_per_campaign) ? $total_repetition_per_campaign/count($screen_ids) : 0)
  • {{ trans('dashboard.overall_data.total_estimated_views') }}

    {{ !empty($viewers) ? thousandsCurrencyFormat($viewers) : 0 }}

  • {{ trans('dashboard.overall_data.total_repetition_per_campaign') }}

    {{ number_format($total_repetition_per_campaign, 0) }}

  • {{ trans('dashboard.overall_data.average_repetition_per_location') }}

    {{ number_format($average_repetition_per_location, 0) }}

  • {{ trans('dashboard.overall_data.total_cost') }}

    {{ trans('dashboard.overall_data.sar') }}{{ number_format($total_price, 0) }}

  • {{ trans('dashboard.overall_data.average_cost_per_view') }}

    Sar{{ number_format($average_cost_per_view, 0) }}

  • {{ trans('dashboard.overall_data.average_cost_per_location') }}

    Sar{{ number_format($average_cost_per_location, 0) }}

  • {{ trans('dashboard.overall_data.total_locations') }}

    {{ thousandsCurrencyFormat($venues) }}

  • {{ trans('dashboard.overall_data.total_screens') }}

    {{ thousandsCurrencyFormat(count($screen_ids)) }}

@else
  • 0

    {{ trans('dashboard.overall_data.total_estimated_views') }}

  • {{ trans('dashboard.overall_data.total_estimated_views') }}

    0

  • {{ trans('dashboard.overall_data.total_repetition_per_campaign') }}

    0

  • {{ trans('dashboard.overall_data.average_repetition_per_location') }}

    0

  • {{ trans('dashboard.overall_data.sar') }}0

    {{ trans('dashboard.overall_data.total_cost') }}

  • {{ trans('dashboard.overall_data.total_cost') }}

    {{ trans('dashboard.overall_data.sar') }}0

  • {{ trans('dashboard.overall_data.average_cost_per_view') }}

    Sar0

  • {{ trans('dashboard.overall_data.average_cost_per_location') }}

    Sar0

  • 0

    {{ trans('dashboard.overall_data.total_locations') }}

  • {{ trans('dashboard.overall_data.total_locations') }}

    0

  • {{ trans('dashboard.overall_data.total_screens') }}

    0

@endif