{{-- Dashboard Main View (Casual, Season & Summary) --}}
{{-- Custom Styles for Segmented Control & Modern KPI Cards (matching Season Passes Management) --}} {{-- 1. Top Segmented Navigation --}} {{-- Pending Approval Alert Banner --}} @if ($this->seasonStats['pending_count'] > 0) @endif {{-- 2. Top KPI Cards Container (Modern Season-Management Style, matching Image 2) --}} @php // Dynamic card metrics by active tab if ($activeTab === 'casual') { $cards = [ [ 'icon' => 'visitor', 'watermark' => 'visitor', 'value' => data_get($this->totalVisitor, 'quantity', 0), 'label' => 'Casual Visitors', 'badge' => 'Today • Total Inflow', 'badge_class' => 'bg-light text-secondary border', 'value_class' => 'text-dark', 'icon_bg' => 'linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%)', 'icon_shadow' => 'rgba(37, 99, 235, 0.32)', 'btn_icon' => 'eye', 'btn_class' => 'text-primary', 'link' => null, ], [ 'icon' => 'money', 'watermark' => 'money', 'value' => 'RM ' . number_format(data_get($this->totalRevenue, 'amount', 0), 2), 'label' => 'Casual Collection', 'badge' => 'Today\'s Revenue', 'badge_class' => 'bg-success-subtle text-success border border-success-subtle', 'value_class' => 'text-success', 'icon_bg' => 'linear-gradient(135deg, #10b981 0%, #059669 100%)', 'icon_shadow' => 'rgba(16, 185, 129, 0.32)', 'btn_icon' => 'report', 'btn_class' => 'text-success', 'link' => null, ], [ 'icon' => 'clock', 'watermark' => 'clock', 'value' => data_get($this->totalVisitor, 'total_out', 0), 'label' => 'Total Exit Vehicles', 'badge' => 'Completed visits today', 'badge_class' => 'bg-light text-muted', 'value_class' => 'text-dark', 'icon_bg' => 'linear-gradient(135deg, #f59e0b 0%, #d97706 100%)', 'icon_shadow' => 'rgba(245, 158, 11, 0.32)', 'btn_icon' => 'eye', 'btn_class' => 'text-warning', 'link' => null, ], ]; } elseif ($activeTab === 'season') { $cards = [ [ 'icon' => 'pass', 'watermark' => 'pass', 'value' => $this->isSeasonSupported ? $this->seasonStats['active_passes'] : 0, 'label' => 'Active Passes', 'badge' => $this->isSeasonSupported ? $this->seasonStats['active_bays'] . ' allocated bays' : 'No Season Module', 'badge_class' => 'bg-light text-secondary border', 'value_class' => 'text-dark', 'icon_bg' => 'linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%)', 'icon_shadow' => 'rgba(37, 99, 235, 0.32)', 'btn_icon' => 'eye', 'btn_class' => 'text-primary', 'link' => route('season.passes.index'), ], [ 'icon' => 'clock', 'watermark' => 'clock', 'value' => $this->isSeasonSupported ? $this->seasonStats['action_required'] : 0, 'label' => 'Expiring (7 Days)', 'badge' => $this->isSeasonSupported && $this->seasonStats['action_required'] > 0 ? 'Requires renewal' : 'All active & healthy', 'badge_class' => $this->isSeasonSupported && $this->seasonStats['action_required'] > 0 ? 'bg-danger-subtle text-danger border border-danger-subtle' : 'bg-light text-muted', 'value_class' => $this->isSeasonSupported && $this->seasonStats['action_required'] > 0 ? 'text-danger' : 'text-dark', 'icon_bg' => 'linear-gradient(135deg, #ef4444 0%, #dc2626 100%)', 'icon_shadow' => 'rgba(239, 68, 68, 0.32)', 'btn_icon' => 'eye', 'btn_class' => 'text-danger', 'link' => route('season.passes.index'), ], [ 'icon' => 'money', 'watermark' => 'money', 'value' => 'RM ' . number_format($this->isSeasonSupported ? $this->seasonStats['monthly_revenue'] : 0, 2), 'label' => 'Season Collection', 'badge' => 'MTD • ' . now()->format('M Y'), 'badge_class' => 'bg-success-subtle text-success border border-success-subtle', 'value_class' => 'text-success', 'icon_bg' => 'linear-gradient(135deg, #10b981 0%, #059669 100%)', 'icon_shadow' => 'rgba(16, 185, 129, 0.32)', 'btn_icon' => 'report', 'btn_class' => 'text-success', 'link' => route('report.season-transaction'), ], ]; } else { $cards = [ [ 'icon' => 'money', 'watermark' => 'money', 'value' => 'RM ' . number_format($this->summaryStats['total_collection'], 2), 'label' => 'Combined Revenue', 'badge' => 'Casual + Season Passes', 'badge_class' => 'bg-success-subtle text-success border border-success-subtle', 'value_class' => 'text-success', 'icon_bg' => 'linear-gradient(135deg, #10b981 0%, #059669 100%)', 'icon_shadow' => 'rgba(16, 185, 129, 0.32)', 'btn_icon' => 'report', 'btn_class' => 'text-success', 'link' => null, ], [ 'icon' => 'pass', 'watermark' => 'pass', 'value' => $this->isSeasonSupported ? $this->summaryStats['season_passes'] : 0, 'label' => 'Active Season Passes', 'badge' => $this->isSeasonSupported ? ($this->summaryStats['active_bays'] ?? 0) . ' allocated bays' : 'No Season Module', 'badge_class' => 'bg-light text-secondary border', 'value_class' => 'text-dark', 'icon_bg' => 'linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%)', 'icon_shadow' => 'rgba(37, 99, 235, 0.32)', 'btn_icon' => 'eye', 'btn_class' => 'text-primary', 'link' => route('season.passes.index'), ], [ 'icon' => 'site', 'watermark' => 'site', 'value' => $this->summaryStats['season_enabled_sites'] . ' / ' . $this->summaryStats['total_sites'], 'label' => 'Season-Enabled Sites', 'badge' => 'Active car parks', 'badge_class' => 'bg-light text-muted', 'value_class' => 'text-dark', 'icon_bg' => 'linear-gradient(135deg, #f59e0b 0%, #d97706 100%)', 'icon_shadow' => 'rgba(245, 158, 11, 0.32)', 'btn_icon' => 'eye', 'btn_class' => 'text-warning', 'link' => null, ], ]; } @endphp
{{-- Ambient Background Glow Accents --}}
{{-- 3 Dynamic KPI Cards --}} @foreach ($cards as $c)
{{-- Watermark SVG --}}
@if ($c['watermark'] === 'pass') @elseif($c['watermark'] === 'clock') @elseif($c['watermark'] === 'money') @elseif($c['watermark'] === 'site') @else @endif
@if ($c['icon'] === 'pass') @elseif($c['icon'] === 'clock') @elseif($c['icon'] === 'money') @elseif($c['icon'] === 'site') @else @endif

{{ $c['value'] }}

{{ $c['label'] }} @if (!empty($c['badge']))
{{ $c['badge'] }}
@endif
{{-- Right Action Icon Button (matching Image 2) --}}
@if (!empty($c['link'])) @if (($c['btn_icon'] ?? 'eye') === 'report') @else @endif @else @if (($c['btn_icon'] ?? 'eye') === 'report') @else @endif @endif
@endforeach {{-- 4th Card: Site Selector Dropdown (matches exact style & dimensions of KPI cards) --}}
{{-- Watermark SVG --}}
Parking Site Location
{{-- 3. Tab Content Section --}} {{-- TAB A: CASUAL PARKING --}} @if ($activeTab === 'casual')
{{-- Visitor Analytics Chart --}}

Casual Visitor Analytics

Hourly vehicle entry & exit traffic trends

Loading...
{{-- Vehicle Classification Donut --}}

Vehicle Classification

Daily vehicle breakdown by category

Motorcycle

{{ data_get($this->pieChartData, 'data.1', 0) }}

Car

{{ data_get($this->pieChartData, 'data.0', 0) }}

Others

{{ data_get($this->pieChartData, 'data.2', 0) }}
{{-- TAB B: SEASON PASS --}} @elseif($activeTab === 'season') {{-- Case 1: Site has NO season support --}} @if (!$this->isSeasonSupported && $selectedSite && $selectedSite !== 'all') @php $firstSeasonSite = $this->site->first(fn($s) => (bool) ($s->is_season ?? false)); @endphp

No Season Pass Module for this Site

Site "{{ $this->selectedSiteData->site_name ?? 'Selected Location' }}" is not enabled for Season Parking (is_season = 0). This location operates 100% under Casual Parking.

@if ($firstSeasonSite) @endif
{{-- Case 2: Site has season support or All Sites selected --}} @else
{{-- Season Monthly Chart --}}

Monthly Season Pass Collection

Approved & paid subscription revenue (Year {{ $this->seasonChartData['year'] }})

YTD Collected: RM {{ number_format($this->seasonChartData['ytd_total'], 2) }}
@if ($this->seasonStats['pending_count'] > 0)
Pending Approval: RM {{ number_format($this->seasonStats['pending_amount'], 2) }} ({{ $this->seasonStats['pending_count'] }})
@endif
{{-- Season Category Donut --}}

Pass Category Breakdown

Season pass distribution by customer segment

Corporate / Tenant

{{ $this->seasonChartData['corporate_passes'] }} passes ({{ $this->seasonChartData['corporate_bays'] }} bays)

Public / Individual

{{ $this->seasonChartData['individual_passes'] }} passes ({{ $this->seasonChartData['individual_bays'] }} bays)

Expired / Inactive

{{ $this->seasonChartData['inactive_passes'] }} passes ({{ $this->seasonChartData['inactive_bays'] }} bays)
{{-- Season Passes Table (from season_passes) --}}

Season Passes & Subscription Status

Registered corporate & individual passes from season_passes

{{ $this->seasonStats['action_required'] }} Passes Require Renewal / Action
@forelse($this->seasonPassesList as $pass) @empty @endforelse
Season ID Vehicle Plate(s) Holder / Company Name Customer Type CarparkZone Bays Expiry Date Monthly Rate Pass Status
{{ $pass['external_season_id'] }} {{ $pass['plate_no'] }} @if ($pass['extra_vehicles'] > 0) +{{ $pass['extra_vehicles'] }} @endif
{{ $pass['holder_name'] }}
{{ $pass['site_name'] }}
{{ $pass['pass_type'] }} {{ $pass['carpark_name'] }} {{ $pass['no_of_bays'] }} {{ $pass['expiry_date'] }} RM{{ number_format($pass['amount'], 2) }} {{ $pass['status_label'] }}
No season passes found for the selected site.
{{-- Recent Season Transactions Table (from season_transactions) --}}

Recent Season Payment Transactions

Billing & payment records from season_transactions

View All Payments & Approvals {{ count($this->seasonTransactionsList) }} Recent Records
{{-- --}} {{-- --}} @forelse($this->seasonTransactionsList as $txn) {{-- --}} {{-- --}} @empty @endforelse
Invoice NoSeason IDCustomer Name Billing MonthCoverage PeriodPayment Method Amount (RM) Payment Date Status Action
{{ $txn['invoice_no'] }}
Ref: {{ $txn['reference_no'] }}
{{ $txn['season_code'] }}
{{ $txn['customer_name'] }}
{{ $txn['site_name'] }}
{{ $txn['billing_month'] }} {{ $txn['period_start'] }} → {{ $txn['period_end'] }} {{ $txn['payment_method'] }} RM{{ number_format($txn['amount'], 2) }} {{ $txn['payment_date'] }} {{ $txn['status_label'] }} @if ($txn['payment_status'] === 'pending_approval' && $txn['is_manual'])
@elseif($txn['payment_status'] === 'pending_approval') Auto Gateway @else — @endif
No season payment transactions found for the selected site.
@endif {{-- TAB C: SUMMARY (BOTH) --}} @elseif($activeTab === 'summary')
{{-- Alert for casual-only site --}} @if (!$this->isSeasonSupported && $selectedSite && $selectedSite !== 'all')
@endif {{-- Revenue Comparison Bar Chart --}}

Revenue Comparison: Casual vs Season

Monthly collection comparison between casual parking and season passes (Last 6 Months)

6-Month Total: RM {{ number_format($this->summaryChartData['combined_6m'], 2) }}
{{-- Revenue Share Donut --}}

Revenue Contribution Share

6-month proportion of revenue by parking stream

Season Pass (Recurring)

RM{{ number_format($this->summaryChartData['season_total_6m'], 2) }} ({{ $this->summaryChartData['season_share_pct'] }}%)

Casual Parking (Daily)

RM{{ number_format($this->summaryChartData['casual_total_6m'], 2) }} ({{ $this->summaryChartData['casual_share_pct'] }}%)
{{-- Site Matrix Table --}}

Site Revenue Performance Matrix (MTD)

Current month breakdown of Casual and Season revenue across your assigned sites

{{ count($this->siteMatrix) }} Assigned Sites
@forelse($this->siteMatrix as $matrix) @empty @endforelse
Site Name Season Status Casual Revenue (MTD) Season Revenue (MTD) Total Revenue (MTD) Primary Stream
{{ $matrix['name'] }} @if ($matrix['has_season']) Enabled ({{ $matrix['active_passes'] }} Passes / {{ $matrix['season_bays'] }} Bays) @else Casual Only @endif RM{{ number_format($matrix['casual_rev'], 2) }} RM{{ number_format($matrix['season_rev'], 2) }} RM{{ number_format($matrix['total_rev'], 2) }} @if ($matrix['total_rev'] <= 0) No MTD Collection @elseif($matrix['season_pct'] >= 50) Season Dominant ({{ $matrix['season_pct'] }}%) @else Casual Dominant ({{ 100 - $matrix['season_pct'] }}%) @endif
No sites available.
@endif
{{-- 4. Admin Review & Approval Modal for Manual Season Transactions --}} @if ($approvingTxnId) @php $targetTxn = \App\Models\SeasonTransaction::with(['seasonPass', 'site'])->find($approvingTxnId); @endphp @if ($targetTxn) @endif @endif
{{-- 5. JavaScript & ApexCharts Module --}} @push('local-js') @endpush