@extends('layouts.staff') @section('content')
{{-- BACK BUTTON --}} Back to List
{{-- LEFT COLUMN: PROFILE & LOYALTY ROAD --}}
{{-- 1. CUSTOMER PROFILE CARD --}}
{{ substr($customer->fullName, 0, 1) }}

{{ $customer->fullName }}

{{ $customer->email }}

{{ $loyalty->tier }} Member ID: #{{ $customer->customerID }}
{{ number_format($loyalty->points) }}

Current Points

{{-- 2. LOYALTY ROAD PROGRESS (NEW!) --}}

Loyalty Road

Tracking qualified bookings (>9 hours).

{{ $currentInCycle }} / 12
{{-- Progress Bar --}}
{{-- Milestones Indicators --}}
Step 3 Step 6 Step 9 Step 12
Next Milestone Reward: @if($currentInCycle < 3) 20% OFF (at Step 3) @elseif($currentInCycle < 6) 50% OFF (at Step 6) @elseif($currentInCycle < 9) 70% OFF (at Step 9) @else Free Half Day (at Step 12) @endif
{{-- 3. QUICK STATS --}}

Total Spent

RM {{ number_format($totalSpent) }}

Total Trips

{{ $bookingCount }}

{{-- RIGHT COLUMN: HISTORY & VOUCHERS --}}
{{-- VOUCHERS LIST --}}

Assigned Vouchers

{{ $vouchers->count() }} Total
@forelse($vouchers as $voucher)
{{ $voucher->code }} {{ $voucher->isUsed ? 'Used' : 'Active' }}
{{ $voucher->voucherType }} @if($voucher->discount_percent > 0) {{ $voucher->discount_percent }}% OFF @elseif($voucher->voucherAmount > 0) RM {{ $voucher->voucherAmount }} OFF @endif

Exp: {{ $voucher->validUntil?->format('d M Y') ?? 'N/A' }}

{{ $voucher->conditions ?? 'No conditions' }}

@empty

No vouchers assigned yet.

@endforelse
{{-- HISTORY LOG --}}

Points History

@forelse($history as $record) @empty @endforelse
Activity Date Points

{{ $record->reason }}

{{ $record->created_at->format('d M Y, H:i') }} {{ $record->points_change > 0 ? '+' : '' }}{{ number_format($record->points_change) }}
No history records found.
@endsection