@extends('layout') @push('styles') @endpush @section('content') @if (session('success'))
×

{{ __('Success!') }}

{{ session('success') }}

@endif @if (session('error'))
×

{{ __('Error!') }}

{{ session('error') }}

@endif

{{ __('Overview') }}

@php $currentStatus = request('order_status', 'all'); @endphp
{{-- Filters Row (search, sort, date) --}}
{{-- Search --}} {{-- Order Status --}} {{-- --}} {{-- Payment Status --}} {{-- Event (select by title, send event_id) --}} {{-- Date (Created At) --}} {{-- --}} {{-- Sort --}} {{-- Direction --}} {{-- Buttons --}}
{{ __('Reset') }}
{{-- Press Enter in search to submit --}}
@forelse ($orders as $order) @empty @endforelse
{{ __('Booking ID') }} {{ __('Attendee Info') }} {{ __('Event/attend date') }} {{ __('Tickets Type/count') }} {{ __('total price') }} {{ __('Status') }}

BK-{{ $order->id }}

user

{{ $order->first_name }} {{ $order->last_name }} {{ $order->phone }}

{{ optional($order->event)->title ?? 'N/A' }} {{ optional($order->event)->start_date->format('d M, Y') }} at {{ optional($order->event)->start_time->format('h:i A') }}

@php $ticketCount = $order->eventTickets->sum('pivot.quantity'); $ticketType = $order->eventTickets ->pluck('pivot.ticket_type_title') ->unique() ->implode(', '); @endphp

{{ $ticketType ?: '-' }} {{ $ticketCount }} {{ __('Tickets') }}

{{ $ticketCurrency }}{{ number_format($order->total) }} {{ $order->payment_method }} {{ $order->card_number ? '****' . substr($order->card_number, -4) : '-' }} @php // Normalize payment status $validStatuses = [ \App\Enums\PaymentStatus::Pending->value, \App\Enums\PaymentStatus::Paid->value, \App\Enums\PaymentStatus::Failed->value, ]; // Determine CSS class: fallback to 'failed' if invalid $statusValue = $order->payment_status; $statusClass = in_array($statusValue, $validStatuses) ? strtolower(str_replace(' ', '', $statusValue)) : 'failed'; @endphp {{ __($statusValue) }}
@php $statusValue = $order->order_status; // Default CSS class: lowercase and remove spaces $statusClass = strtolower(str_replace(' ', '', $statusValue)); // Handle special cases if ($statusValue === 'Checked-In') { $statusClass = 'checkin'; } elseif ($statusValue === 'Refunded') { $statusClass = 'cancelled'; } @endphp {{ __($statusValue) }}
{{-- Action Trigger --}} {{-- Dropdown Menu --}}
{{-- icon Edit --}} @can('bookings.destroy')
@csrf @method('DELETE')
@endcan

{{ __('Are you sure?') }}

{{ __('This action cannot be undone.') }}

{{ __('No bookings found.') }}
{{-- Items per page dropdown --}}
@foreach (request()->except('per_page') as $key => $value) @endforeach
{{-- Pagination Display --}}

{{ __('Page') }} {{ $orders->currentPage() }} {{ __('of') }} {{ $orders->lastPage() }}

{{-- Previous --}} @if ($orders->onFirstPage()) @else icon @endif {{-- Next --}} @if ($orders->currentPage() == $orders->lastPage()) @else icon @endif
{{-- Press Enter in search to submit --}} {{-- Keep original delete modal JS --}} @endsection