37259-vm/index.php
2026-01-04 09:27:56 +00:00

87 lines
3.3 KiB
PHP

<?php
require_once 'auth.php';
check_auth();
include 'partials/header.php';
include 'partials/sidebar.php';
$role = $_SESSION['role'] ?? 'guest';
$welcome_message = "Welcome to your dashboard!";
$cards = [];
if ($role === 'accountant') {
$cards = [
'Total Fees Expected' => ['value' => '$1,250,000', 'icon' => 'bi-cash-stack', 'color' => 'success'],
'Total Fees Collected' => ['value' => '$980,000', 'icon' => 'bi-check-circle', 'color' => 'info'],
'Outstanding Balances' => ['value' => '$270,000', 'icon' => 'bi-exclamation-triangle', 'color' => 'warning'],
'Term Expenses' => ['value' => '$150,000', 'icon' => 'bi-wallet2', 'color' => 'danger'],
];
} elseif ($role === 'secretary') {
$cards = [
'Total Students' => ['value' => '1,520', 'icon' => 'bi-people-fill', 'color' => 'primary'],
'Total Staff' => ['value' => '85', 'icon' => 'bi-person-badge', 'color' => 'info'],
'Attendance Today' => ['value' => '98%', 'icon' => 'bi-calendar-check', 'color' => 'success'],
'Pending Admissions' => ['value' => '12', 'icon' => 'bi-person-plus', 'color' => 'warning'],
];
} elseif ($role === 'headteacher') {
$cards = [
'Total Students' => ['value' => '1,520', 'icon' => 'bi-people-fill', 'color' => 'primary'],
'Total Staff' => ['value' => '85', 'icon' => 'bi-person-badge', 'color' => 'info'],
'Financial Snapshot' => ['value' => 'On Track', 'icon' => 'bi-pie-chart', 'color' => 'success'],
'Academic Performance' => ['value' => 'Excelling', 'icon' => 'bi-graph-up', 'color' => 'secondary'],
];
}
?>
<div class="row g-3 my-2">
<?php foreach ($cards as $title => $data): ?>
<div class="col-md-3">
<div class="p-3 bg-white shadow-sm d-flex justify-content-around align-items-center rounded">
<div>
<h3 class="fs-2"><?php echo $data['value']; ?></h3>
<p class="fs-5"><?php echo $title; ?></p>
</div>
<i class="<?php echo $data['icon']; ?> fs-1 text-<?php echo $data['color']; ?>"></i>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="row my-5">
<h3 class="fs-4 mb-3">Recent Activity (Placeholder)</h3>
<div class="col">
<table class="table bg-white rounded shadow-sm table-hover">
<thead>
<tr>
<th scope="col" width="50">#</th>
<th scope="col">Item</th>
<th scope="col">Details</th>
<th scope="col">Date</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Sample Item 1</td>
<td>Details about the item go here.</td>
<td>01/04/2026</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Sample Item 2</td>
<td>Details about the item go here.</td>
<td>01/04/2026</td>
</tr>
<tr>
<th scope="row">3</th>
<td>Sample Item 3</td>
<td>Details about the item go here.</td>
<td>01/04/2026</td>
</tr>
</tbody>
</table>
</div>
</div>
<?php include 'partials/footer.php'; ?>