@extends('layouts/contentNavbarLayout') @section('title', 'Appointments Management') @section('content')

Appointments Management

Manage and monitor all appointments

Total: {{ $appointments->total() }} appointments
{{ number_format($stats['total']) }}
Total
{{ number_format($stats['booked']) }}
Booked
{{ number_format($stats['confirmed']) }}
Confirmed
{{ number_format($stats['in_progress']) }}
In Progress
{{ number_format($stats['completed']) }}
Completed
{{ number_format($stats['not_attended']) }}
Not Attended
{{ number_format($stats['rescheduled']) }}
Rescheduled
{{ number_format($stats['cancelled']) }}
Cancelled
{{ number_format($stats['pending_payment']) }}
Pending Payment
{{ number_format($stats['paid']) }}
Paid
Clear
@if(request()->anyFilled(['search', 'status', 'payment_status', 'coach_id', 'employee_id', 'speciality_id', 'date_filter']))
Active filters: @if(request('search')) Search: {{ request('search') }} @endif @if(request('status')) Status: {{ ucfirst(str_replace('_', ' ', request('status'))) }} @endif @if(request('payment_status')) Payment: {{ request('payment_status') == '1' ? 'Paid' : 'Pending' }} @endif @if(request('coach_id')) Coach: {{ $coaches->find(request('coach_id'))->name ?? 'N/A' }} @endif @if(request('employee_id')) Employee: {{ $employees->find(request('employee_id'))->name ?? 'N/A' }} @endif @if(request('speciality_id')) Speciality: {{ $specialities->find(request('speciality_id'))->name_ar ?? 'N/A' }} @endif @if(request('date_filter')) Date: {{ ucfirst(str_replace('_', ' ', request('date_filter'))) }} @if(request('date_filter') == 'custom' && request('start_date') && request('end_date')) ({{ request('start_date') }} to {{ request('end_date') }}) @endif @endif
@endif
@if($appointments->count() > 0)
@foreach($appointments as $appointment) @php $statusColors = [ 'booked' => 'primary', 'confirmed' => 'info', 'in_progress' => 'warning', 'completed' => 'success', 'not_attended' => 'dark', 'rescheduled' => 'secondary', 'cancelled' => 'danger' ]; $statusColor = $statusColors[$appointment->status] ?? 'secondary'; @endphp @endforeach
Appointment # Date & Time Coach Employee Speciality Status Payment Price Actions
{{ $appointment->appointment_number }}
{{ $appointment->appointment_date ? $appointment->appointment_date->format('M d, Y') : 'N/A' }}
{{ $appointment->time_start ? date('h:i A', strtotime($appointment->time_start)) : 'N/A' }} @if($appointment->time_end) - {{ date('h:i A', strtotime($appointment->time_end)) }} @endif
@if($appointment->coach)
{{ $appointment->coach->name }}
{{ $appointment->coach->email }} @else N/A @endif
@if($appointment->employee)
{{ $appointment->employee->name }}
{{ $appointment->employee->email }} @else N/A @endif
{{ $appointment->speciality ? ($appointment->speciality->name_ar ?? $appointment->speciality->name_en) : 'N/A' }} {{ ucfirst(str_replace('_', ' ', $appointment->status)) }} @if($appointment->payment_status == 1) Paid @else Pending @endif {{ number_format($appointment->final_price ?? 0, 2) }} SAR @if($appointment->discount > 0)
Discount: {{ number_format($appointment->discount, 2) }}
@endif
@if($appointments->hasPages())
{{ $appointments->appends(request()->query())->links() }}
@endif @else
No appointments found matching your criteria.
@endif
@push('scripts') @endpush @endsection