@extends('layouts.app') @section('content')

Admin Dashboard

@if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
{{ collect($errors->all())->first() }}
@endif
Patients (pt_configs)
{{ number_format($stats['patients'] ?? 0) }}
Updated: {{ $stats['pt_configs_updated_at'] ?? '—' }}
Follow-ups (art_followups)
{{ number_format($stats['followups'] ?? 0) }}
Latest visit: {{ $stats['last_followup_date'] ?? '—' }}
Follow-ups Updated
{{ $stats['followups_updated_at'] ?? '—' }}
Connection Status
@php($c = $stats['connections'] ?? [])
    @foreach($c as $name => $info)
  • {{ $name }} @if(($info['ok'] ?? false) === true) OK @else FAIL @endif
  • @endforeach
@if(isset($c['MAM_NAP_tables']) && ($c['MAM_NAP_tables']['ok'] ?? false) !== true)
Missing tables on MAM_NAP: {{ implode(', ', $c['MAM_NAP_tables']['missing'] ?? []) }}
@endif
Top Clinics (pt_configs)
@forelse($perClinic as $row) @empty @endforelse
Clinic Patients
{{ $row->clinic_id ?? '—' }} {{ number_format((int) ($row->total ?? 0)) }}
No data (or DB not reachable).
@endsection