@extends('coach.layouts.contentNavbarLayout') @section('title', 'Appointments') @section('content')
@if(request('search')) @endif
@if(request()->anyFilled(['search', 'status', 'date_filter']))
Clear All Filters
Filtering by: @if(request('search')) Search: {{ request('search') }} @endif @if(request('status')) Status: {{ ucfirst(str_replace('_', ' ', request('status'))) }} @endif @if(request('date_filter')) Date: @if(request('date_filter') == 'custom') {{ request('start_date') }} to {{ request('end_date') }} @else {{ ucfirst(str_replace('_', ' ', request('date_filter'))) }} @endif @endif
@endif
APPOINTMENTS
Total: {{ $appointments->total() }} appointments
@if($appointments->count() > 0)
@foreach($appointments as $appointment) @php //status color class $statusColor = $appointment->status === 'completed' ? 'success' : ($appointment->status === 'cancelled' ? 'danger' : ($appointment->status === 'booked' ? 'primary' : ($appointment->status === 'confirmed' ? 'info' : ($appointment->status === 'in_progress' ? 'warning' : ($appointment->status === 'not_attended' ? 'dark' : ($appointment->status === 'rescheduled' ? 'secondary' : 'light')))))); //call type $callType = isset($appointment->appointment_type) ? ($appointment->appointment_type == 0 ? 'Audio Call' : 'Video Call') : 'N/A'; $callTypeIcon = $appointment->appointment_type == 0 ? 'mdi-phone' : 'mdi-video'; @endphp
{{ $appointment->appointment_number }}
{{ ucfirst(str_replace('_', ' ', $appointment->status)) }}
{{ $appointment->appointment_date->format('D, M d, Y') }}
{{ date('h:i A', strtotime($appointment->time_start)) }} - {{ date('h:i A', strtotime($appointment->time_end)) }}
@php $today = \Carbon\Carbon::today(); $appointmentDate = \Carbon\Carbon::parse($appointment->appointment_date); $daysRemaining = $today->diffInDays($appointmentDate, false); @endphp @if($daysRemaining > 0) In {{ $daysRemaining }} days @elseif($daysRemaining == 0) Today @else {{ abs($daysRemaining) }} days ago @endif
Call Type:

{{ $callType }}

Speciality:

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

@if($appointment->final_price)
Price:

{{ $appointment->final_price }}

@endif @if($appointment->status === 'cancelled')
Cancelled
@endif
@endforeach
{{ $appointments->links() }}
@else @endif
@endsection @section('page-script') @endsection