@extends('coach.layouts.contentNavbarLayout') @section('title', 'Dashboard') @section('vendor-style') @endsection @section('vendor-script') @endsection @section('page-script') @endsection @section('content')

Welcome, {{ auth()->user()->name }}! 👋

Here's what's happening with your appointments today.

Today: {{ now()->format('l, F d, Y') }}

{{ now()->format('h:i A') }}

Total Appointments

{{ $totalAppointments }}

Completed

{{ $statusStats['completed'] ?? 0 }}

Upcoming

{{ ($statusStats['booked'] ?? 0) + ($statusStats['confirmed'] ?? 0) }}

Cancelled

{{ $statusStats['cancelled'] ?? 0 }}

Monthly Appointments ({{ now()->year }})
Status Distribution
Today's Appointments
{{ $todayAppointments->count() }}
@if($todayAppointments->count() > 0)
@foreach($todayAppointments 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)) }}
Today
{{ date('h:i A', strtotime($appointment->time_start)) }} - {{ date('h:i A', strtotime($appointment->time_end)) }}
@php $now = \Carbon\Carbon::now(); $appointmentStart = \Carbon\Carbon::parse($appointment->appointment_date->format('Y-m-d') . ' ' . $appointment->time_start); $timeUntilStart = $now->diffInMinutes($appointmentStart, false); @endphp @if($timeUntilStart > 0 && $timeUntilStart <= 60) In {{ $timeUntilStart }} min @elseif($timeUntilStart > 60) In {{ ceil($timeUntilStart / 60) }} hr @elseif($timeUntilStart > -60 && $timeUntilStart <= 0) Now @else {{ abs(ceil($timeUntilStart / 60)) }} hr ago @endif
Call Type:

{{ $callType }}

Employee:

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

Speciality:

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

@endforeach
@else @endif
Tomorrow's Appointments
{{ $tomorrowAppointments->count() }}
@if($tomorrowAppointments->count() > 0)
@foreach($tomorrowAppointments 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)) }}
Tomorrow
{{ date('h:i A', strtotime($appointment->time_start)) }} - {{ date('h:i A', strtotime($appointment->time_end)) }}
Call Type:

{{ $callType }}

Employee:

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

Speciality:

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

@endforeach
@else @endif
@if($upcomingAppointments->count() > 0)
Upcoming Appointments
View All
@foreach($upcomingAppointments as $appointment) @endforeach
Appointment # Date Time Employee Type Status
{{ $appointment->appointment_number }} {{ $appointment->appointment_date->format('M d, Y') }} {{ date('h:i A', strtotime($appointment->time_start)) }} {{ $appointment->employee->name }} @if(isset($appointment->appointment_type)) @if($appointment->appointment_type == 0) Audio @else Video @endif @else N/A @endif @php $statusClass = $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' : 'secondary'))))); @endphp {{ ucfirst(str_replace('_', ' ', $appointment->status)) }}
@endif
@endsection