@push('styles') @endpush
{{-- Header --}}

Cancel Booking

Cancel enrollment and release seats.

Back
{{-- LEFT COLUMN: Search & Reason --}}
{{-- 1. SEARCH CARD --}}
Find Booking to Cancel
@if ($selectedBooking) @endif
@if (!$selectedBooking)
@if (count($searchResults) > 0)
@foreach ($searchResults as $result)
{{ $result->student->name ?? 'Unknown' }}
{{ $result->booking_code }} • {{ $result->course->name ?? 'Package' }}
{{ $result->status }}
@endforeach
@elseif(strlen($search) > 2)
No active bookings found.
@endif
@else {{-- Selected Info --}}
{{ substr($selectedBooking->student->name, 0, 1) }}
{{ $selectedBooking->student->name }}
Booking: {{ $selectedBooking->booking_code }} • Phone: {{ $selectedBooking->student->phone }}
@endif
{{-- 2. CANCELLATION REASON (Only if selected) --}} @if ($selectedBooking)
Cancellation Details
Warning: This action is irreversible. The seat will be released immediately and the booking status will change to "Cancelled".
@endif
{{-- RIGHT COLUMN: SUMMARY --}}
Summary
@if ($selectedBooking)
Item {{ $selectedBooking->course->name ?? ($selectedBooking->package->package_name ?? 'Item') }}
Paid Amount ₹{{ number_format($selectedBooking->paid_amount) }}
Balance Due ₹{{ number_format($selectedBooking->due_amount) }}

@else
Select a booking to cancel
@endif
{{-- AJAX Script --}} @push('scripts') @endpush