@extends('layouts.clinic-admin') @section('title', 'Appointments Management') @section('content')

Appointments Management

View and manage all clinic appointments

{{ $clinic->name }}

{{ $date->format('l, M d, Y') }}

Total

{{ $stats['total'] }}

Confirmed

{{ $stats['confirmed'] }}

Completed

{{ $stats['completed'] }}

Cancelled

{{ $stats['cancelled'] }}

Export Reports

Download PDF reports for daily, weekly, or monthly appointments

@if($searchTerm) @endif
Clear All
@php $currentPeriod = null; @endphp @foreach($timeSlots as $slot => $data) @if($currentPeriod !== $data['period']) @php $currentPeriod = $data['period']; @endphp
@if($currentPeriod === 'Morning') @elseif($currentPeriod === 'Afternoon') @else @endif {{ $currentPeriod }} Session
@endif

{{ $slot }}

{{ $data['period'] }} Session

{{ count($data['appointments']) }} {{ count($data['appointments']) == 1 ? 'Patient' : 'Patients' }}
@if(count($data['appointments']) > 0)
@foreach($data['appointments'] as $appointment)
@php $avatarUrl = null; if ($appointment->mother->expectantMother && $appointment->mother->expectantMother->avatar_url) { $avatarUrl = asset('storage/' . $appointment->mother->expectantMother->avatar_url); } elseif ($appointment->mother->profile_picture) { $avatarUrl = asset('storage/' . $appointment->mother->profile_picture); } else { $avatarUrl = 'https://ui-avatars.com/api/?name=' . urlencode($appointment->mother->name) . '&background=FB97AE&color=fff&size=200'; } @endphp {{ $appointment->mother->name }}

{{ $appointment->mother->name }}

{{ $appointment->mother->expectantMother->ic_number ?? 'N/A' }} {{ $appointment->mother->expectantMother->phone_number ?? $appointment->mother->phone_number ?? 'N/A' }} @if($appointment->assignedNurse) {{ $appointment->assignedNurse->name }} @endif
@if($appointment->status === 'confirmed') @elseif($appointment->status === 'completed') @else @endif {{ ucfirst($appointment->status) }}
@endforeach
@else

No appointments for this time slot

@endif
@endforeach
@if($appointments->isEmpty())

No Appointments Found

There are no appointments for the selected date and filters.

View All Appointments
@endif
@endsection