<META NAME="robots" CONTENT="noindex,nofollow">


<?php
include '../helpers/helpers.php';
checkLogin('admin');
include '../config/config.php';
$result = $conn->query("SELECT * FROM leave_requests ORDER BY id DESC");
?>
<html>
    <head><link rel="stylesheet" href="../assets/css/style.css"></head>
    <body>
        <div class="card">
<h2>Admin Dashboard</h2>
<table border=1><tr><th>ID</th><th>Student Name</th><th>Class</th><th>Roll</th><th>Subject</th><th>Status</th><th>Parents Informed</th><th>Action</th></tr>
<?php while($r = $result->fetch_assoc()): ?>
<tr>
<td><?= $r['id'] ?></td><td><?= $r['student_name'] ?></td><td><?= $r['class'] ?></td><td><?= $r['roll_no'] ?></td><td><?= $r['subject'] ?></td><td><?= $r['status'] ?></td><td><?= $r['informed_parents'] ?></td>
<td><a href="approve.php?id=<?= $r['id'] ?>&status=Approved">Approve</a> <a href="approve.php?id=<?= $r['id'] ?>&status=Rejected">Reject</a></td>
</tr>
<?php endwhile; ?></table>
<a h