@extends('layouts.admin') @php $routeName = request()->route()->getName(); $baseRoute = 'admin.data-config.advertisements'; @endphp @section('content')
{{-- Tab Navigation --}} {{-- Tab Contents --}} {{-- List Tab --}}
@if(auth()->user()->isSystemAdmin())
@endif
@if($advertisements->isNotEmpty())
@foreach($advertisements as $ad) @php $now = now(); $isExpired = $ad->end_at && $ad->end_at < $now; $isWaiting=$ad->start_at && $ad->start_at > $now; if (!$ad->is_active) { $status = 'disabled'; $statusLabel = __('Disabled'); } elseif ($isExpired) { $status = 'inactive'; $statusLabel = __('Expired'); } elseif ($isWaiting) { $status = 'pending'; $statusLabel = __('Waiting'); } else { $status = 'active'; $statusLabel = __('Ongoing'); } @endphp
{{-- Card Header --}}
@if($ad->type === 'image') preview @else @endif

{{ $ad->name }}

{{ $ad->company ? $ad->company->name : __('System') }}

{{-- Info Grid --}}

{{ __('Type') }}

{{ $ad->type === 'video' ? __('Video') : __('Image') }}

{{ __('Duration') }}

{{ $ad->duration }} {{ __('sec') }}

{{-- Action Buttons --}}
@endforeach
@endif
{{ $advertisements->appends(request()->query())->links('vendor.pagination.luxury') }}
@foreach(['vending', 'visit_gift', 'standby'] as $pos)

{{ __($pos) }}

@endforeach
{{ __('Please select a machine to view and manage its advertisements.') }}
@include('admin.ads.partials.ad-modal') @include('admin.ads.partials.assign-modal')

@endsection @section('scripts') @endsection