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

Reschedule Booking

Move a student to a different batch.

Back
{{-- LEFT COLUMN: Search & Select --}}
{{-- 1. SEARCH CARD --}}
Find Existing Booking
@if ($selectedBooking) @endif
@if (!$selectedBooking)
@if (count($searchResults) > 0)
@foreach ($searchResults as $result)
{{ $result->student->name ?? 'Unknown' }}
{{ $result->booking_code }} • {{ $result->course->name ?? 'N/A' }}
{{ $result->payment_status }}
@endforeach
@elseif(strlen($search) > 2)
No confirmed course bookings found.
@endif
@else {{-- Selected Booking Display --}}
{{ substr($selectedBooking->student->name, 0, 1) }}
{{ $selectedBooking->student->name }}
Code: {{ $selectedBooking->booking_code }} • Phone: {{ $selectedBooking->student->phone }}
@endif
{{-- 2. BATCH SELECTION --}} @if ($selectedBooking)
Select New Batch
@if (count($availableBatches) > 0) @else
No other upcoming open batches found for this course.
@endif
@endif
{{-- RIGHT COLUMN: SUMMARY --}}
Swap Summary
@if ($selectedBooking)
{{-- FROM --}}
Moving From
{{ $selectedBooking->courseBatch->batch_code }}
{{ \Carbon\Carbon::parse($selectedBooking->courseBatch->start_date)->format('d M, Y') }}
{{-- TO --}}
Moving To
@if ($newBatchId) @php $nb = $availableBatches->find($newBatchId); @endphp
{{ $nb->batch_code }}
{{ \Carbon\Carbon::parse($nb->start_date)->format('d M, Y') }}
@else
Select a batch...
@endif

@else
Find a booking to begin
@endif
{{-- SweetAlert Scripts --}} @push('scripts') @endpush