{{ __('Purchase History') }}

{{-- Session Messages --}} @if (session('success')) @endif @if (session('error')) @endif {{-- activeLayout is now fixed to 'table' as there is no card view --}}
{{-- Tabs Navigation --}}
{{-- Search Bar --}}
{{-- These hidden inputs ensure that the sorting and tab parameters are maintained during a search --}} @if (request('search')) {{ __('Clear') }} @endif
{{-- Tab Content: Season Pass --}}

Season Pass Purchases

@php $sortBy = request('sort_by', 'created_at'); $sortDirection = request('sort_direction', 'desc'); $otherSortDirection = $sortDirection === 'asc' ? 'desc' : 'asc'; @endphp
@forelse ($seasonPasses as $purchase) {{-- Action Column in Season/Reserve Table --}} @empty @endforelse
ID @if ($sortBy === 'id') @if ($sortDirection === 'asc') @else @endif @else @endif Pass Name Vehicle Plate @if ($sortBy === 'vehicle_no') @if ($sortDirection === 'asc') @else @endif @else @endif Date Range Amount @if ($sortBy === 'amount') @if ($sortDirection === 'asc') @else @endif @else @endif Status Purchased On @if ($sortBy === 'created_at') @if ($sortDirection === 'asc') @else @endif @else @endif Action
{{ $purchase->id }} {{ $purchase->seasonPass->pass_name ?? 'N/A' }} {{ $purchase->vehicle_no ?? 'N/A' }} {{ $purchase->start_date?->format('d/m') ?? 'N/A' }} - {{ $purchase->end_date?->format('d/m/Y') ?? 'N/A' }} RM {{ number_format($purchase->amount, 2) }} {{ ucfirst($purchase->status ?? 'N/A') }} {{ $purchase->created_at?->format('d/m/Y') ?? 'N/A' }} {{-- Edit button --}} {{-- Delete button --}}
No Season Pass purchases found.
{{ $seasonPasses->appends(request()->except('season_page'))->links() }}
{{-- Tab Content: Reserved Lot --}}

Reserved Lot Purchases

@php $sortBy = request('sort_by', 'created_at'); $sortDirection = request('sort_direction', 'desc'); $otherSortDirection = $sortDirection === 'asc' ? 'desc' : 'asc'; @endphp
@forelse ($reservedLots as $purchase) {{-- Action Column in Season/Reserve Table --}} @empty @endforelse
ID @if ($sortBy === 'id') @if ($sortDirection === 'asc') @else @endif @else @endif Vehicle Plate @if ($sortBy === 'vehicle_no') @if ($sortDirection === 'asc') @else @endif @else @endif Lot Number @if ($sortBy === 'lot_no') @if ($sortDirection === 'asc') @else @endif @else @endif Date Range Amount @if ($sortBy === 'price') @if ($sortDirection === 'asc') @else @endif @else @endif Status @if ($sortBy === 'status') @if ($sortDirection === 'asc') @else @endif @else @endif Purchased On @if ($sortBy === 'created_at') @if ($sortDirection === 'asc') @else @endif @else @endif Action
{{ $purchase->id }} {{ $purchase->vehicle_no ?? 'N/A' }} {{ $purchase->lot_no ?? 'N/A' }} {{ $purchase->start_date?->format('d/m') ?? 'N/A' }} - {{ $purchase->end_date?->format('d/m/Y') ?? 'N/A' }} RM {{ number_format($purchase->amount, 2) }} {{ ucfirst($purchase->status ?? 'N/A') }} {{ $purchase->created_at?->format('d/m/Y') ?? 'N/A' }} {{-- Edit button --}} {{-- Delete button --}}
No Reserved Lot purchases found.
{{ $reservedLots->appends(request()->except('reserve_page'))->links() }}
{{-- Tab Content: Compound --}}

Compound Payments

@php $sortBy = request('sort_by', 'created_at'); $sortDirection = request('sort_direction', 'desc'); $otherSortDirection = $sortDirection === 'asc' ? 'desc' : 'asc'; @endphp
@forelse ($compounds as $purchase) @empty @endforelse
ID @if ($sortBy === 'id') @if ($sortDirection === 'asc') @else @endif @else @endif Compound No. @if ($sortBy === 'compound_no') @if ($sortDirection === 'asc') @else @endif @else @endif Vehicle Plate @if ($sortBy === 'vehicle_no') @if ($sortDirection === 'asc') @else @endif @else @endif Offence @if ($sortBy === 'offence') @if ($sortDirection === 'asc') @else @endif @else @endif Date & Time @if ($sortBy === 'datetime') @if ($sortDirection === 'asc') @else @endif @else @endif Amount @if ($sortBy === 'amount') @if ($sortDirection === 'asc') @else @endif @else @endif Status @if ($sortBy === 'status') @if ($sortDirection === 'asc') @else @endif @else @endif Purchased On @if ($sortBy === 'created_at') @if ($sortDirection === 'asc') @else @endif @else @endif Actions
{{ $purchase->id }} {{ $purchase->compound_no ?? 'N/A' }} {{ $purchase->vehicle_no ?? 'N/A' }} @php $words = explode(' ', $purchase->offence ?? 'N/A'); $truncatedOffence = count($words) > 6 ? implode(' ', array_slice($words, 0, 6)) . '...' : $purchase->offence; @endphp {{ $truncatedOffence }} {{ $purchase->datetime?->format('d/m/Y') ?? 'N/A' }} RM {{ number_format($purchase->amount, 2) }} {{ ucfirst($purchase->status ?? 'N/A') }} {{ $purchase->created_at?->format('d/m/Y') ?? 'N/A' }}
No Compound payments found.
{{ $compounds->appends(request()->except('compound_page'))->links() }}
{{-- Edit Pass Modal --}}
{{-- Close Button --}} {{-- Modal Title --}}

Edit Purchase

@csrf @method('PUT') {{-- Payment Type --}}
{{-- Action Buttons --}}
{{-- Delete Pass / Compound Modal --}}

Confirm Delete

Are you sure you want to delete this record? This action cannot be undone.

@csrf @method('DELETE')