@extends('layouts.clinic') @section('title', 'لوحة الحجوزات — '.config('app.name')) @section('content') @php $appointmentsByDaySlot = $appointments->groupBy(function ($a) { $time = substr((string) $a->start_time, 0, 5); return $a->appointment_date->format('Y-m-d').'|'.$time; }); $paymentMethodOptions = [ ['value' => 'cash', 'label' => 'نقدي — الخزينة'], ['value' => 'bank', 'label' => 'بنك / شبكة'], ]; @endphp
@if(session('success'))
{{ session('success') }}
@endif @if(session('receipt_appointment_id'))
تم التحصيل بنجاح. طباعة الإيصال PDF
@endif @if($errors->any())
@endif

لوحة الحجوزات

{{ $viewMode === 'day' ? 'عرض يومي' : 'عرض أسبوعي' }} — {{ $anchor->translatedFormat('F Y') }}

يوم أسبوع
@foreach($days as $day) @endforeach @foreach($timeSlots as $slot) @foreach($days as $day) @php $key = $day->format('Y-m-d').'|'.$slot; $cellAppts = $appointmentsByDaySlot->get($key, collect()); @endphp @endforeach @endforeach
الوقت
{{ $day->translatedFormat('D') }}
{{ $day->format('d/m') }}
{{ $slot }} @foreach($cellAppts as $appt) @php $rxUrl = route('clinic.prescriptions.create', [ 'patient_id' => $appt->patient_id, 'appointment_id' => $appt->id, 'doctor_employee_id' => $appt->doctor_employee_id, 'return_to' => 'appointments', ]); $collectUrl = route('clinic.appointments.status', $appt); $rescheduleUrl = route('clinic.appointments.status', $appt); $cancelUrl = route('clinic.appointments.status', $appt); $receiptUrl = $appt->isPaid() ? route('clinic.appointments.receipt.pdf', $appt) : null; $apptDate = $appt->appointment_date?->format('Y-m-d'); $apptTime = substr((string) $appt->start_time, 0, 5); @endphp
{{ $appt->patient?->name }}
{{ $appt->doctor?->name ?? '—' }}
{{ $appt->appointment_number }}
@if(! $appt->isCancelled())
@if($appt->isPending() && ($canCollect ?? true)) @elseif($appt->isPaid()) {{ erp_money($appt->fee_amount) }} @if($receiptUrl) 🧾 @endif @endif @if($appt->isPending()) @endif @if(! $appt->isCancelled() && ($canClinical ?? true)) @endif @if(! $appt->isCancelled()) @endif
@endif
@endforeach
{{-- Quick Add Modal --}} {{-- Collection Modal --}} {{-- Reschedule Modal --}} {{-- Cancel Modal --}}
@endsection @push('scripts') @endpush