@extends('layouts.admin') @section('title', 'Dashboard') @section('page', 'dashboard') @section('content') @php $cur = config('clinic.currency.symbol'); $maxRev = max(1, ...array_values($revenue ?: [1])); @endphp

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

Here's what's happening at Dr Dutta Skin Hair Dental Clinic today.

{{ now()->format('l, j F Y') }}{{ now()->format('h:i A') }}
Total Patients
{{ number_format($stats['patients']) }}
Registered
Today's Appointments
{{ $stats['today_appts'] }}
Scheduled today
Today's Revenue
{{ $cur }} {{ number_format($stats['today_rev']) }}
Collected today
Pending Payments
{{ $cur }} {{ number_format($stats['outstanding']) }}
Outstanding
Active Doctors
{{ $stats['doctors'] }}
Available
Appointments Overview
BookedCompletedCancelled
Revenue Overview
Total (7 days)
{{ $cur }} {{ number_format(array_sum($revenue)) }}
@foreach($revenue as $label => $val)
{{ $val >= 1000 ? round($val/1000,1).'K' : round($val) }}
{{ $label }}
@endforeach
Today's Schedule
View All
{{ now()->format('F Y') }}
{{ $stats['today_appts'] }} Appointments Today
{{ $apptByStatus['confirmed'] ?? 0 }} Confirmed
{{ $apptByStatus['in_consultation'] ?? 0 }} In Consultation
{{ $apptByStatus['completed'] ?? 0 }} Completed
{{ $apptByStatus['cancelled'] ?? 0 }} Cancelled
@forelse($today->take(6) as $a)
{{ $a->appointment_time ? \Illuminate\Support\Carbon::parse($a->appointment_time)->format('h:i A') : '—' }} · {{ $a->patient->full_name }}{{ $a->doctor?->name ?? '—' }}
@empty
No appointments today.
@endforelse

Patient Treatment Procedures Breakdown

Distribution of treatments by Clinical Disease / Diagnosis

@forelse($breakdown as $b) @php $bmax = max(1, $breakdown->max('count')); @endphp
{{ $b['name'] }}{{ $b['count'] }} · {{ $cur }}{{ number_format($b['rev'],0) }}
@empty

No treatments recorded yet.

@endforelse

Patient Activity by Core Service

Appointments by department

@forelse($byDept as $d)
{{ $d['name'] }}{{ $d['count'] }}
@empty

No activity yet.

@endforelse
@endsection