@php $patientName = $patient['full_name'] ?? 'Unknown Patient'; $initial = strtoupper(substr($patientName, 0, 1)); $upsiId = $patient['upsi_id'] ?? '-'; $ref = $appointment['reference_no'] ?? 'PKU-' . substr($appointment['id'] ?? '', 0, 8); $treatment = $appointment['reason'] ?? 'Dental Appointment'; $date = !empty($appointment['appointment_date']) ? date('l, d M Y', strtotime($appointment['appointment_date'])) : '-'; $time = !empty($appointment['appointment_time']) ? date('g:i A', strtotime($appointment['appointment_time'])) : '-'; $roomName = $room['room_name'] ?? '-'; $cancelReason = $appointment['cancellation_reason'] ?? 'No reason provided.'; $appointmentDateTime = strtotime(($appointment['appointment_date'] ?? '') . ' ' . ($appointment['appointment_time'] ?? '')); $hoursBefore = $appointmentDateTime ? round(($appointmentDateTime - time()) / 3600) : 0; $policyOk = $hoursBefore >= 48; @endphp Cancellation Details

Cancellation Details

{{ now()->format('D, d M Y') }}
← Cancellation Requests

Cancellation Details

Pending Review
Cancellation Request

{{ $ref }}

{{ $initial }}

{{ $patientName }}

Student ID: {{ $upsiId }}

Treatment{{ $treatment }}
Date{{ $date }}
Time{{ $time }}
Room{{ $roomName }}
Request Date{{ !empty($appointment['updated_at']) ? date('d M Y, g:i A', strtotime($appointment['updated_at'])) : '-' }}
Hours Before{{ $hoursBefore }} hours
Patient Reason

“{{ $cancelReason }}”

Policy Check

{{ $policyOk ? '✓ Policy Compliant' : '⚠ Policy Review Needed' }}

Request made {{ $hoursBefore }} hours before. Policy requires admin review.

@csrf
@csrf