@extends('layouts.admin') @php $routeName = request()->route()->getName(); $baseRoute = 'admin.data-config.advertisements'; @endphp @section('content')

{{ __('Advertisement Management') }}

{{ __('Manage ad materials and machine playback settings') }}

@if(auth()->user()->isSystemAdmin()) @endif @forelse($advertisements as $ad) @if(auth()->user()->isSystemAdmin()) @endif @empty @endforelse
{{ __('Preview') }} {{ __('Name') }}{{ __('Company Name') }}{{ __('Type') }} {{ __('Duration') }} {{ __('Schedule') }} {{ __('Status') }} {{ __('Actions') }}
@if($ad->type === 'image') @else
@endif
{{ $ad->name }} {{ $ad->company->name ?? __('System Default') }} {{ __($ad->type) }} {{ $ad->duration }}s
{{ __('From') }}: {{ $ad->start_at?->format('Y-m-d H:i') ?? __('Immediate') }} {{ __('To') }}: {{ $ad->end_at?->format('Y-m-d H:i') ?? __('Indefinite') }}
@php $now = now(); $isStarted = !$ad->start_at || $ad->start_at <= $now; $isExpired = $ad->end_at && $ad->end_at < $now; $isPlaying = $ad->is_active && $isStarted && !$isExpired; @endphp
@if(!$ad->is_active) {{ __('Disabled') }} @elseif($isExpired) {{ __('Expired') }} @elseif(!$isStarted) {{ __('Waiting') }} @else {{ __('Ongoing') }} @endif
{{ __('No advertisements found.') }}
{{ $advertisements->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