@extends('layouts/contentNavbarLayout') @section('title', 'Appointment Details') @section('content')
@if(session('success')) @endif @if(session('error')) @endif @if($errors->any()) @endif

Appointment Details

Appointment #{{ $appointment->appointment_number }}

Back to List
Appointment Information
Appointment Number:

{{ $appointment->appointment_number }}

Status:

@php $statusColors = [ 'booked' => 'primary', 'confirmed' => 'info', 'in_progress' => 'warning', 'completed' => 'success', 'not_attended' => 'dark', 'rescheduled' => 'secondary', 'cancelled' => 'danger' ]; $statusColor = $statusColors[$appointment->status] ?? 'secondary'; @endphp {{ ucfirst(str_replace('_', ' ', $appointment->status)) }}

Appointment Date:

{{ $appointment->appointment_date ? $appointment->appointment_date->format('l, F d, Y') : 'N/A' }}

Time:

@if($appointment->time_start && $appointment->time_end) {{ date('h:i A', strtotime($appointment->time_start)) }} - {{ date('h:i A', strtotime($appointment->time_end)) }} @elseif($appointment->time_start) {{ date('h:i A', strtotime($appointment->time_start)) }} @else N/A @endif

Payment Status:

@if($appointment->payment_status == 1) Paid @else Pending @endif

Payment Type:

{{ $appointment->payment_type ?? 'N/A' }}

@if($appointment->status == 'cancelled')
Cancelled By:

{{ ucfirst($appointment->cancelled_by ?? 'N/A') }}

Cancelled At:

{{ $appointment->cancelled_at ? $appointment->cancelled_at->format('M d, Y h:i A') : 'N/A' }}

@if($appointment->cancellation_reason)
Cancellation Reason:

{{ $appointment->cancellation_reason }}

@endif @endif
Participants
Coach
@if($appointment->coach)

{{ $appointment->coach->name }}

{{ $appointment->coach->email }}

@if($appointment->coach->phone)

{{ $appointment->coach->phone }}

@endif @else

N/A

@endif
Employee
@if($appointment->employee)

{{ $appointment->employee->name }}

{{ $appointment->employee->email }}

@if($appointment->employee->phone)

{{ $appointment->employee->phone }}

@endif @else

N/A

@endif
@if($appointment->speciality)
Speciality

{{ $appointment->speciality->name_ar ?? $appointment->speciality->name_en }}

@endif
@if($appointment->call_started_at || $appointment->call_ended_at)
Call Information
Call Started:

{{ $appointment->call_started_at ? $appointment->call_started_at->format('M d, Y h:i A') : 'N/A' }}

Call Ended:

{{ $appointment->call_ended_at ? $appointment->call_ended_at->format('M d, Y h:i A') : 'N/A' }}

@if($appointment->call_duration)
Call Duration:

{{ gmdate('H:i:s', $appointment->call_duration) }}

@endif
Coach Joined:

@if($appointment->coach_joined) Yes @else No @endif

Employee Joined:

@if($appointment->employee_joined) Yes @else No @endif

@endif @if($appointment->reviews && $appointment->reviews->count() > 0)
Reviews
@foreach($appointment->reviews as $review)
{{ $review->user->name ?? 'Anonymous' }} {{ $review->created_at->format('M d, Y') }}
@if($review->rating)
@for($i = 1; $i <= 5; $i++) @endfor
@endif @if($review->comment)

{{ $review->comment }}

@endif
@endforeach
@endif
Financial Information
Price:

{{ number_format($appointment->price ?? 0, 2) }} SAR

@if($appointment->discount > 0)
Discount:

-{{ number_format($appointment->discount, 2) }} SAR

@endif @if($appointment->commission > 0)
Commission:

{{ number_format($appointment->commission, 2) }} SAR

@endif
Final Price:

{{ number_format($appointment->final_price ?? 0, 2) }} SAR

@if($appointment->required_points > 0)
Required Points:

{{ number_format($appointment->required_points) }} points

@endif @if($appointment->promo_code)
Promo Code:

{{ $appointment->promo_code }}

@endif @if($appointment->voucher)
Voucher:

{{ $appointment->voucher->code ?? 'N/A' }}

@endif
Edit Appointment Details
@csrf @method('PUT')
Calculated automatically (Price - Discount)
Quick Actions
@if($appointment->status !== 'cancelled' && $appointment->status !== 'completed')
@csrf @method('PUT')
@csrf
@endif
@csrf @method('PUT')
Additional Information
Created At:

{{ $appointment->created_at->format('M d, Y h:i A') }}

Updated At:

{{ $appointment->updated_at->format('M d, Y h:i A') }}

@if($appointment->notification_sent)
Notification:

Sent

@endif @if($appointment->rescheduled_from)
Rescheduled From:

Appointment #{{ $appointment->rescheduled_from }}

@endif
@section('scripts') @endsection @endsection