@extends('layouts.admin') @section('content')
{{-- Header --}}
Command Hub

Medicare Dashboard

System: Operational
{{-- Stats Row --}}
LIVE BOOKINGS

{{ $stats['active_bookings'] }}

TOTAL FLEET

{{ $stats['total_ambulances'] }}

TOTAL PATIENTS

{{ $stats['total_patients'] }}

MOBILE USERS

{{ $stats['mobile_users'] }}

{{-- Live Dispatch Table --}}
Active Dispatch Feed
View All
{{-- --}} @forelse($recentBookings as $booking) {{-- --}} @empty @endforelse
Patient & IncidentAssigned UnitDestination Status
{{-- Uses patient_name column from your patients table --}} {{ $booking->patient->patient_name ?? 'Walk-in / Unknown' }} {{ $booking->patient->health_issue ?? 'Emergency' }}
{{ $booking->ambulance->vehicle_number ?? 'PENDING' }}
ID: #{{ $booking->ambulance_id ?? 'N/A' }}
{{ $booking->pickup_address ?? 'Not Set' }}
long: {{ $booking->pickup_lat ?? '0.00' }} | lat: {{ $booking->pickup_long ?? '0.00' }}
{{-- Status styling based on your booking status --}} @php $statusClass = match ($booking->status) { 'pending' => 'status-critical', 'completed' => 'status-ready', default => 'status-active', }; @endphp {{ strtoupper($booking->status) }}
No recent bookings found in the dispatch feed.
{{-- Quick Readiness List --}}
Available Units
@foreach ($readyAmbulances as $amb)
{{ $amb->vehicle_number }}
{{ $amb->type->name ?? 'Standard' }}
READY
@endforeach {{-- New Dispatch --}}
@endsection