<?php
session_start();
if (!isset($_SESSION['admin_id'])) { header("Location: login.php"); exit(); }
include '../include/config.php';
$totalPatients = $conn->query("SELECT COUNT(*) as cnt FROM patients")->fetch_assoc()['cnt'];
$totalDoctors = $conn->query("SELECT COUNT(*) as cnt FROM doctors")->fetch_assoc()['cnt'];
$totalAppointments = $conn->query("SELECT COUNT(*) as cnt FROM appointments")->fetch_assoc()['cnt'];
?>
<!DOCTYPE html>
<html><head><title>Reports</title><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"></head>
<body><div class="container mt-4"><h2>System Reports</h2><ul><li>Patients: <?= $totalPatients ?></li><li>Doctors: <?= $totalDoctors ?></li><li>Appointments: <?= $totalAppointments ?></li></ul></div></body>
</html>