query("SELECT COUNT(*) FROM participants")->fetchColumn(); $worker_count = db()->query("SELECT COUNT(*) FROM support_workers")->fetchColumn(); $service_log_count = db()->query("SELECT COUNT(*) FROM service_logs")->fetchColumn(); // Fetch upcoming compliance alerts (e.g., expiring in 90 days) $ninety_days_from_now = date('Y-m-d', strtotime('+90 days')); $compliance_alerts = db()->query("SELECT COUNT(*) FROM participants WHERE ndis_plan_end_date <= '$ninety_days_from_now'")->fetchColumn(); $worker_alerts = db()->query("SELECT COUNT(*) FROM support_workers WHERE ndis_worker_screening_expiry <= '$ninety_days_from_now' OR first_aid_expiry <= '$ninety_days_from_now'")->fetchColumn(); $total_alerts = $compliance_alerts + $worker_alerts; // Chart Data // Participants per month $participants_per_month_q = db()->query("SELECT DATE_FORMAT(created_at, '%Y-%m') as month, COUNT(*) as count FROM participants GROUP BY month ORDER BY month"); $participants_per_month = $participants_per_month_q->fetchAll(PDO::FETCH_ASSOC); $participant_months = json_encode(array_column($participants_per_month, 'month')); $participant_counts = json_encode(array_column($participants_per_month, 'count')); // Services per month $services_per_month_q = db()->query("SELECT DATE_FORMAT(service_date, '%Y-%m') as month, COUNT(*) as count FROM service_logs GROUP BY month ORDER BY month"); $services_per_month = $services_per_month_q->fetchAll(PDO::FETCH_ASSOC); $service_months = json_encode(array_column($services_per_month, 'month')); $service_counts = json_encode(array_column($services_per_month, 'count')); // Billing status $billing_status_q = db()->query("SELECT billing_status, COUNT(*) as count FROM service_logs GROUP BY billing_status"); $billing_status = $billing_status_q->fetchAll(PDO::FETCH_ASSOC); $billing_status_labels = json_encode(array_column($billing_status, 'billing_status')); $billing_status_counts = json_encode(array_column($billing_status, 'count')); ?>

Dashboard

Log a New Service

Total Participants

Manage Participants →

Total Support Workers

Manage Workers →

Services Logged

View Service Logs →

Compliance Alerts

View Alerts →

Participants Added Per Month

Services Provided Per Month

Service Billing Status