{{-- Custom Styles Matching System Theme --}} @php $today = now()->startOfDay(); $endDate = $pass->end_date ? $pass->end_date->startOfDay() : null; $isExpired = $pass->status === 'expired' || ($endDate && $endDate->lt($today)); $isExpiringSoon = !$isExpired && $endDate && $endDate->diffInDays($today, false) >= -14 && $endDate->diffInDays($today, false) <= 0; if ($pass->status === 'terminated' || $pass->status === 'cancelled') { $statusLabel = 'Terminated'; $statusBadge = 'bg-dark text-white'; } elseif ($pass->status === 'pending_approval') { $statusLabel = 'Pending Approval'; $statusBadge = 'bg-warning text-dark'; } elseif ($pass->status === 'approved') { $statusLabel = 'Approved (Pending Payment)'; $statusBadge = 'bg-info text-white'; } elseif ($pass->status === 'payment_submitted') { $statusLabel = 'Payment Submitted'; $statusBadge = 'bg-primary text-white'; } elseif ($pass->status === 'rejected') { $statusLabel = 'Rejected'; $statusBadge = 'bg-secondary text-white'; } elseif ($isExpired) { $statusLabel = 'Expired'; $statusBadge = 'bg-danger text-white'; } elseif ($isExpiringSoon) { $statusLabel = 'Expiring Soon'; $statusBadge = 'bg-warning text-dark'; } else { $statusLabel = 'Active'; $statusBadge = 'bg-success text-white'; } $plates = array_filter([ 1 => $pass->vehicle_no_1, 2 => $pass->vehicle_no_2, 3 => $pass->vehicle_no_3, 4 => $pass->vehicle_no_4, ]); @endphp {{-- Breadcrumbs & Top Header Bar --}}

Season Pass: {{ $pass->external_season_id }}

@if ($pass->status === 'terminated') @else @endif Back to Season Passes View Payments
{{-- Flash Alerts --}} @if (session()->has('success')) @endif @if (session()->has('warning')) @endif @if (session()->has('error')) @endif {{-- Terminated Banner Card --}} @if ($pass->status === 'terminated')
Season Pass Terminated / Deactivated
LPR Access Blocked

Deactivated on {{ $pass->terminated_at ? $pass->terminated_at->format('d/m/Y H:i') : '-' }} by {{ $pass->terminated_by ?: 'Admin' }}. @if ($pass->termination_reason) • Reason: {{ $pass->termination_reason }} @endif @if ($pass->termination_effective_date) • Effective Date: {{ $pass->termination_effective_date->format('d/m/Y') }} @endif

@if ($pass->termination_remarks)
"{{ $pass->termination_remarks }}"
@endif
@endif {{-- Pending Approval Action Card --}} @if ($pass->status === 'pending_approval')
New Season Pass Application Pending Approval

This application was submitted by a customer and requires your approval before a payment link is sent to the customer's email.

@if ($pass->proof_of_employment) View Proof of Employment ↗ @endif
@elseif ($pass->status === 'approved')
Application Approved • Awaiting Customer Payment

Payment link was sent to {{ $pass->email }} on {{ $pass->approved_at ? $pass->approved_at->format('d/m/Y H:i') : '' }}.

Open Customer Payment Portal →
@endif {{-- Overview Hero Card --}}

{{ $pass->customer_name }}

@if ($pass->customer_type === 'corporate') Corporate @else Individual @endif {{ $statusLabel }}
Pass ID: {{ $pass->external_season_id }} • Site: {{ $pass->site->site_name ?? 'Site #' . $pass->site_id }} @if ($pass->carpark_name) • Carpark: {{ $pass->carpark_name }} @endif @if ($pass->customer_id) • Acc ID: {{ $pass->customer_id }} @endif
Monthly Subscription Rate
@if ((float)$pass->monthly_rate <= 0)
FREE (RM 0.00)
Complimentary / VIP Pass @else
RM {{ number_format($pass->monthly_rate, 2) }}
Base: RM {{ number_format($pass->base_rate, 2) }} + Tax: RM {{ number_format($pass->tax_amount, 2) }}
@endif
{{-- Left Column: Customer Profile & Contact Details --}}
Customer Information
Customer Name {{ $pass->customer_name }}
Customer Type {{ ucfirst($pass->customer_type) }}
Customer ID / Account {{ $pass->customer_id ?: '-' }}
Reg No / IC {{ $pass->registration_no ?: '-' }}
Email Address @if ($pass->email) {{ $pass->email }} @else - @endif
Phone Number @if ($pass->phone) {{ $pass->phone }} @else - @endif
Proof of Employment @if ($pass->proof_of_employment) @else No document attached @endif
{{-- Right Column: Pass & Allocation Details --}}
Pass & Bay Allocation
External Season ID {{ $pass->external_season_id }}
Parking Site {{ $pass->site->site_name ?? 'Site #' . $pass->site_id }} ({{ $pass->site_id }})
Carpark Location {{ $pass->carpark_name ?: '-' }}
Allocated Bays {{ $pass->no_of_bays ?? 1 }} {{ ($pass->no_of_bays ?? 1) > 1 ? 'Bays' : 'Bay' }}
Validity Schedule
{{ $pass->start_date ? $pass->start_date->format('d M Y') : '-' }} → {{ $pass->end_date ? $pass->end_date->format('d M Y') : '-' }}
@if ($pass->end_date) @if ($isExpired) Pass has expired @else @php $daysLeft = (int) $today->diffInDays($endDate, false); @endphp {{ $daysLeft }} {{ $daysLeft === 1 ? 'day' : 'days' }} remaining @endif @endif
@if ($pass->status !== 'terminated') @endif
Last Synced {{ $pass->last_synced_at ? $pass->last_synced_at->format('d/m/Y H:i') : ($pass->updated_at ? $pass->updated_at->format('d/m/Y H:i') : '-') }}
{{-- Registered Vehicles Section (Grouped by Bay or Single Bay) --}} @php $hasBayVehicles = !empty($pass->vehicles_data) && is_array($pass->vehicles_data); $totalBays = max((int)($pass->no_of_bays ?: 1), $hasBayVehicles ? count($pass->vehicles_data) : 1); @endphp
Vehicle Plates by Bay ({{ $totalBays }} {{ $totalBays > 1 ? 'Bays' : 'Bay' }})
1 Bay = 1 Primary Plate + Up to 3 Alternate Vehicle Plates.
@if (!$isEditingVehicles)
@if (!empty($plateSearch)) @endif
@else
@endif
@if ($isEditingVehicles) {{-- Edit Mode: Compact Spreadsheet Table --}}
Plate Edit Mode: Slot #1 is primary for each bay. Slots 2 to 4 are optional alternate vehicles.
{{ $totalBays }} Bay(s)
@for ($b = 1; $b <= $totalBays; $b++) @endfor
Bay / Unique ID Primary Plate * Plate #2 (Alt) Plate #3 (Alt) Plate #4 (Alt)
Access Level
@php $siteLevels = is_array($pass->site?->access_levels) ? $pass->site->access_levels : []; @endphp @if(!empty($siteLevels) && $totalBays > 1)
@endif
Antipassback
#{{ $b }} @php $bObj = $pass->bays->firstWhere('bay_number', $b); $bCode = $bObj ? $bObj->bay_code : \App\Models\SeasonBay::generateBayCode($pass, $b); @endphp
{{ $bCode }}
@error('editBayVehicles.' . $b . '.1')
{{ $message }}
@enderror
@php $siteLevels = is_array($pass->site?->access_levels) ? $pass->site->access_levels : []; $currentVal = $editBayAccessLevel[$b] ?? ''; @endphp
@else {{-- View Mode: Compact Spreadsheet Table --}}
@php $searchClean = strtoupper(str_replace([' ', '-', '_'], '', trim($plateSearch ?? ''))); $matchedBays = 0; @endphp @for ($b = 1; $b <= $totalBays; $b++) @php $bayPlates = $pass->vehicles_data[$b] ?? []; if (empty($bayPlates) && $b === 1) { $bayPlates = [ 1 => $pass->vehicle_no_1, 2 => $pass->vehicle_no_2, 3 => $pass->vehicle_no_3, 4 => $pass->vehicle_no_4, ]; } $bayMatches = empty($searchClean); if (!$bayMatches) { for ($s = 1; $s <= 4; $s++) { if (!empty($bayPlates[$s])) { $pClean = strtoupper(str_replace([' ', '-', '_'], '', (string)$bayPlates[$s])); if (str_contains($pClean, $searchClean)) { $bayMatches = true; break; } } } } @endphp @if (!$bayMatches) @continue @endif @php $matchedBays++; @endphp @endfor @if ($matchedBays === 0 && !empty($searchClean)) @endif
Bay / Unique ID Primary Plate (Slot #1) Plate #2 (Alt) Plate #3 (Alt) Plate #4 (Alt) Access Level Antipassback
#{{ $b }} @php $bObj = $pass->bays->firstWhere('bay_number', $b); $bCode = $bObj ? $bObj->bay_code : \App\Models\SeasonBay::generateBayCode($pass, $b); @endphp
{{ $bCode }}
@if (!empty($bayPlates[1])) @php $p1Clean = strtoupper(str_replace([' ', '-', '_'], '', (string)$bayPlates[1])); $p1Match = !empty($searchClean) && str_contains($p1Clean, $searchClean); @endphp {{ $bayPlates[1] }} ✓ Registered @else No Vehicle @endif @if (!empty($bayPlates[2])) @php $p2Clean = strtoupper(str_replace([' ', '-', '_'], '', (string)$bayPlates[2])); $p2Match = !empty($searchClean) && str_contains($p2Clean, $searchClean); @endphp {{ $bayPlates[2] }} @else — @endif @if (!empty($bayPlates[3])) @php $p3Clean = strtoupper(str_replace([' ', '-', '_'], '', (string)$bayPlates[3])); $p3Match = !empty($searchClean) && str_contains($p3Clean, $searchClean); @endphp {{ $bayPlates[3] }} @else — @endif @if (!empty($bayPlates[4])) @php $p4Clean = strtoupper(str_replace([' ', '-', '_'], '', (string)$bayPlates[4])); $p4Match = !empty($searchClean) && str_contains($p4Clean, $searchClean); @endphp {{ $bayPlates[4] }} @else — @endif @php $bObj = $pass->bays->firstWhere('bay_number', $b); $lvl = $bObj?->access_level ?: $pass->access_level; $siteLevels = is_array($pass->site?->access_levels) ? $pass->site->access_levels : []; $lvlDisplayName = $lvl; foreach ($siteLevels as $opt) { $optCode = is_array($opt) ? ($opt['code'] ?? $opt['id'] ?? '') : $opt; $optName = is_array($opt) ? ($opt['name'] ?? $optCode) : $opt; if ($optCode === $lvl || $optName === $lvl) { $lvlDisplayName = $optName; break; } } @endphp @if (!empty($lvl)) {{ $lvlDisplayName }} @else — @endif @php $bObj = $pass->bays->firstWhere('bay_number', $b); $isApb = $bObj ? (bool) $bObj->anti_passback : true; @endphp
No vehicle plates matching "{{ $plateSearch }}" found in this pass.
@endif
{{-- Renewal Exemption & Leave Records (Dedicated Audit Table) --}}
Renewal Exemption & Leave Records

Audit history of all renewal date exemptions, maternity leaves, and medical waivers granted for this pass.

Total Records: {{ $pass->exemptions->count() }} @if ($pass->renewal_start_override_date) @endif
@if ($pass->exemptions->count() > 0)
@foreach ($pass->exemptions as $ex) @endforeach
Exemption Start Date Skipped Period Reason / Remarks Supporting Document Approved By Status
{{ $ex->start_date ? $ex->start_date->format('d/m/Y') : '-' }} {{ str_replace('Oktober', 'October', $ex->skipped_period ?: '-') }} {{ $ex->reason }} @if ($ex->document_path) View Document @else - @endif {{ $ex->approved_by ?: 'Admin' }}
{{ $ex->created_at->format('d/m/Y H:i') }}
@if ($ex->status === 'renewed') ✓ Renewed @elseif ($ex->status === 'active') Active (Pending) @else Cancelled @endif
@else
No renewal exemptions or waivers recorded for this pass.
@endif
{{-- Payment & Transaction History Section --}}
Payment & Transaction History

Record of all payments submitted or synced for this season pass.

Total Records: {{ $pass->transactions->count() }}
@forelse($pass->transactions as $txn) @php $st = strtolower($txn->payment_status); $stBadge = match ($st) { 'approved', 'success', 'paid' => 'bg-success text-white', 'pending', 'pending_approval' => 'bg-warning text-dark', 'failed', 'rejected' => 'bg-danger text-white', default => 'bg-secondary text-white', }; @endphp @empty @endforelse
Invoice / Transaction ID Reference No Payment Method Amount Submitted Date Status Action
{{ $txn->invoice_no ?: $txn->external_transaction_id }} @if ($txn->period_start && $txn->period_end)
{{ $txn->period_start->format('d/m/Y') }} – {{ $txn->period_end->format('d/m/Y') }} @if ($txn->period_start->format('Y-m') === $txn->period_end->format('Y-m')) {{ $txn->period_start->format('M Y') }} @else {{ $txn->period_start->format('M Y') }} - {{ $txn->period_end->format('M Y') }} @endif
@elseif ($txn->billing_month)
{{ \Carbon\Carbon::parse($txn->billing_month)->format('F Y') }}
@endif
{{ $txn->reference_no ?: '-' }} {{ ucwords(str_replace('_', ' ', $txn->payment_method)) }} RM {{ number_format($txn->amount, 2) }} {{ $txn->submitted_at ? $txn->submitted_at->format('d/m/Y H:i') : ($txn->created_at ? $txn->created_at->format('d/m/Y H:i') : '-') }} {{ ucwords(str_replace('_', ' ', $st)) }} @if (in_array($st, ['approved', 'paid', 'success'])) @endif View Payment
@if ((float)$pass->monthly_rate <= 0)
🎁 Complimentary / Free Access Pass

This pass is granted as free of charge. No payment records or invoices are generated.

@else

No payment transactions found for this season pass.

@endif
{{-- Renewal Exemption Start Date Override Modal (Option 1) --}} @if ($showOverrideModal) @endif {{-- Exemption History Details Modal --}} @if ($showExemptionHistoryModal) @endif {{-- Edit Pass Validity Schedule Modal --}} @if ($showEditValidityModal) @endif {{-- Change Rate / Set Complimentary Modal --}} @if ($showChangeRateModal) @endif {{-- Pass Termination / Deactivation Modal --}} @if ($showTerminateModal) @endif {{-- Pass Reactivation Confirmation Modal --}} @if ($showReactivateModal) @endif
@push('local-js') @endpush