Add Appointment
@if ($successMessage) @endif {{-- include full form --}} @include('livewire.client.appointment.modal._form')
@if($expand || $showPatientForm || !empty($visitChain))
@if(!$showPatientForm )
Clinic Appointments
@endif
@if($showPatientForm)
➕ Add New Patient
@error('new_patient_name') {{ $message }} @enderror
@error('new_patient_phone') {{ $message }} @enderror
@error('new_patient_age') {{ $message }} @enderror
@endif @if(!empty($reservedSlots)) @php // التأكد من شكل الـ array إذا كانت Grouped by clinic or not $isGroupedByClinic = false; $first = collect($reservedSlots)->first(); if (is_array($first)) { $firstInner = reset($first); // نحاول نجيب أول عنصر داخلي $isGroupedByClinic = is_array($firstInner) && isset($firstInner[0]['time']); } @endphp
Appointments
@if($isGroupedByClinic) {{-- ✅ Grouped by Clinic → Date --}} @foreach($reservedSlots as $clinic => $dates)
{{ $clinic }}
@foreach($dates as $date => $slots)
{{ \Carbon\Carbon::parse($date)->translatedFormat('l, d M Y') }}
@foreach($slots as $slot) @if(is_array($slot) && isset($slot['time'], $slot['patient']))
{{ \Carbon\Carbon::parse($slot['time'])->format('h:i A') }} {{ $slot['patient'] }}
@endif @endforeach
@endforeach
@endforeach @else {{-- ✅ Grouped by Date Only --}} @foreach($reservedSlots as $date => $slots)
{{ \Carbon\Carbon::parse($date)->translatedFormat('l, d M Y') }}
@foreach($slots as $slot) @if(is_array($slot) && isset($slot['patient']))
@if($slot['time']) {{ \Carbon\Carbon::parse($slot['time'])->format('h:i A') }} @else No time @endif {{ $slot['patient'] }}
@endif @endforeach
@endforeach @endif
@elseif(empty($reservedSlots) && !$showPatientForm ) {{-- ✅ No Appointments Found --}}
No appointments found.
@endif {{-- @if(!empty($visitChain))--}} {{--
--}} {{--
🔗 Visit chain
--}} {{--
    --}} {{-- @foreach($visitChain as $index => $visit)--}} {{--
  • --}} {{-- @if($index == 0)--}} {{-- 🟢 Original Visit:--}} {{-- @else--}} {{-- 🔁 Follow Up No. {{ $index }}:--}} {{-- @endif--}} {{-- {{ $visit->code }} | {{ $visit->date }} - {{ $visit->time }}--}} {{--
  • --}} {{-- @endforeach--}} {{--
--}} {{--
--}} {{-- @endif--}}
@endif
@push('js') @endpush @push('style') @endpush