<?php
session_start();
require_once '../config/database.php';

if (!isset($_SESSION['user_id'])) {
    header('Location: ../login.php');
    exit();
}

$success_message = '';
$error_message   = '';
$exam_id         = $_GET['exam_id']      ?? '';
$view            = $_GET['view']         ?? 'table';
$center_text     = $_GET['center_text']  ?? '';
$note_text       = $_GET['note_text']    ?? '';
$card_heading    = $_GET['card_heading'] ?? '';

function bn_weekday($dateStr) {
    $map = ['Saturday'=>'শনিবার','Sunday'=>'রবিবার','Monday'=>'সোমবার',
            'Tuesday'=>'মঙ্গলবার','Wednesday'=>'বুধবার','Thursday'=>'বৃহস্পতিবার','Friday'=>'শুক্রবার'];
    return $map[date('l', strtotime($dateStr))] ?? date('l', strtotime($dateStr));
}

$exam_details  = null;
$exam_subjects = [];
$students      = [];

if ($exam_id) {
    $stmt = $pdo->prepare("SELECT e.*, c.name as class_name, c.section FROM exams e JOIN classes c ON e.class_id = c.id WHERE e.id = ?");
    $stmt->execute([$exam_id]);
    $exam_details = $stmt->fetch();

    if ($exam_details) {
        $stmt = $pdo->prepare("SELECT es.*, s.name as subject_name, s.code as subject_code FROM exam_subjects es JOIN subjects s ON es.subject_id = s.id WHERE es.exam_id = ? ORDER BY es.exam_date, es.start_time");
        $stmt->execute([$exam_id]);
        $exam_subjects = $stmt->fetchAll();
    }
}

if ($exam_id && $exam_details) {
    $stmt = $pdo->prepare("SELECT s.id, s.student_id, s.first_name, s.last_name, s.roll_number FROM students s WHERE s.class_id = ? AND s.session = ? AND s.status = 'active' ORDER BY s.roll_number");
    $stmt->execute([$exam_details['class_id'], $exam_details['session']]);
    $students = $stmt->fetchAll();

    foreach ($students as &$student) {
        $stmt = $pdo->prepare("SELECT COUNT(*) as absent_count FROM exam_attendance ea JOIN exam_subjects es ON ea.exam_id = es.exam_id AND ea.subject_id = es.subject_id WHERE ea.exam_id = ? AND ea.student_id = ? AND ea.attendance_status = 'absent'");
        $stmt->execute([$exam_id, $student['id']]);
        $result = $stmt->fetch();
        $student['absent_count']       = $result['absent_count'] ?? 0;
        $student['attendance_status']  = ($student['absent_count'] > 0) ? 'absent' : 'present';
    }
    unset($student);
}

if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['save_attendance'])) {
    $exam_id         = $_POST['exam_id'];
    $attendance_data = $_POST['attendance'] ?? [];
    try {
        $pdo->beginTransaction();
        $stmt = $pdo->prepare("SELECT subject_id FROM exam_subjects WHERE exam_id = ?");
        $stmt->execute([$exam_id]);
        $subjects = $stmt->fetchAll();

        foreach ($attendance_data as $student_id => $data) {
            $status  = $data['status']  ?? 'present';
            $remarks = $data['remarks'] ?? '';
            foreach ($subjects as $subject) {
                $subject_id = $subject['subject_id'];
                $stmt = $pdo->prepare("SELECT exam_date FROM exam_subjects WHERE exam_id = ? AND subject_id = ?");
                $stmt->execute([$exam_id, $subject_id]);
                $sd = $stmt->fetch();
                $exam_date = $sd['exam_date'] ?? date('Y-m-d');
                $stmt = $pdo->prepare("INSERT INTO exam_attendance (exam_id, subject_id, student_id, attendance_status, exam_date, remarks) VALUES (?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE attendance_status=VALUES(attendance_status), remarks=VALUES(remarks), updated_at=CURRENT_TIMESTAMP");
                $stmt->execute([$exam_id, $subject_id, $student_id, $status, $exam_date, $remarks]);
            }
        }
        $pdo->commit();
        header("Location: attendance.php?exam_id=$exam_id");
        exit();
    } catch (Exception $e) {
        $pdo->rollBack();
        $error_message = "ত্রুটি: " . $e->getMessage();
    }
}

$all_exams = $pdo->query("SELECT e.id, e.name, c.name as class_name, c.section, e.session, e.group_name FROM exams e JOIN classes c ON e.class_id = c.id ORDER BY e.created_at DESC")->fetchAll();

// Stats
$total    = count($students);
$present  = count(array_filter($students, fn($s) => ($s['attendance_status'] ?? 'present') === 'present'));
$absent   = $total - $present;
?>
<!DOCTYPE html>
<html lang="bn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>পরীক্ষার হাজিরা পত্র</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
*,*::before,*::after{font-family:'Hind Siliguri',sans-serif!important}
i[class*="fa-"],i[class*="fa-"]::before{font-family:'Font Awesome 6 Free','FontAwesome'!important;font-weight:900!important}
:root{--navy:#1a1a2e;--purple:#7209b7;--teal:#06d6a0;--orange:#fb8500;--pink:#e63946;--green:#006747;--blue:#4361ee;--gold:#ffd700}
body{background:#f0f2f8;color:#1a1a2e;min-height:100vh}

/* TOP BAR */
.top-bar{background:linear-gradient(135deg,var(--navy),#16213e);padding:11px 24px;display:flex;align-items:center;justify-content:space-between;box-shadow:0 4px 20px rgba(0,0,0,.25)}
.top-bar .brand{color:#fff;font-size:1.05rem;font-weight:700;text-decoration:none;display:flex;align-items:center;gap:9px}
.top-bar .brand i{color:var(--gold)}
.top-bar .nav-links{display:flex;gap:5px;flex-wrap:wrap}
.top-bar .nav-links a{color:rgba(255,255,255,.8);text-decoration:none;padding:5px 11px;border-radius:20px;font-size:.8rem;transition:all .2s}
.top-bar .nav-links a:hover{background:rgba(255,255,255,.15);color:#fff}

/* FILTER CARD */
.filter-card{background:#fff;border-radius:16px;box-shadow:0 6px 24px rgba(0,0,0,.08);overflow:hidden;margin-bottom:20px}
.filter-card-header{background:linear-gradient(135deg,var(--blue),var(--purple));padding:13px 20px;color:#fff;display:flex;align-items:center;gap:10px}
.filter-card-header h5{margin:0;font-size:.98rem;font-weight:700}
.filter-card-body{padding:18px 20px}
.form-label{font-size:.78rem;font-weight:700;color:#555;margin-bottom:3px}
.form-control,.form-select{border-radius:10px!important;border:1.5px solid #e0e0e0;font-size:.86rem;padding:7px 11px;transition:border-color .2s,box-shadow .2s}
.form-control:focus,.form-select:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(67,97,238,.12)}

/* BUTTONS */
.btn-load{background:linear-gradient(135deg,var(--blue),var(--purple));color:#fff;border:none;border-radius:10px;padding:8px 22px;font-weight:700;font-size:.88rem;transition:all .2s}
.btn-load:hover{opacity:.88;transform:translateY(-1px);color:#fff}
.btn-save{background:linear-gradient(135deg,var(--green),#004d35);color:#fff;border:none;border-radius:10px;padding:8px 22px;font-weight:700;font-size:.88rem;transition:all .2s}
.btn-save:hover{opacity:.88;color:#fff}
.btn-print{background:linear-gradient(135deg,var(--orange),#c96a00);color:#fff;border:none;border-radius:10px;padding:8px 20px;font-weight:700;font-size:.88rem;transition:all .2s}
.btn-print:hover{opacity:.88;color:#fff}
.btn-reset{background:#f0f0f0;color:#555;border:none;border-radius:10px;padding:8px 14px;font-size:.86rem;transition:all .2s}
.btn-reset:hover{background:#e0e0e0}

/* STATS */
.stats-row{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.stat-pill{background:#fff;border-radius:50px;padding:7px 16px;font-size:.82rem;font-weight:700;box-shadow:0 2px 8px rgba(0,0,0,.07);display:flex;align-items:center;gap:6px}

/* MAIN CARD */
.main-card{background:#fff;border-radius:16px;box-shadow:0 6px 24px rgba(0,0,0,.08);overflow:hidden}
.main-card-header{background:linear-gradient(135deg,var(--navy),#16213e);padding:14px 20px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}
.main-card-header .title{color:#fff;font-size:1rem;font-weight:700;display:flex;align-items:center;gap:8px}
.main-card-header .meta-badges{display:flex;gap:6px;flex-wrap:wrap}
.meta-badge{background:rgba(255,255,255,.15);color:#fff;border-radius:20px;padding:3px 12px;font-size:.76rem;font-weight:600}
.meta-badge.gold{background:linear-gradient(135deg,var(--gold),#e6b800);color:var(--navy)}
.main-card-body{padding:0}

/* ATTENDANCE TABLE */
.att-wrap{overflow-x:auto}
table.att-tbl{width:100%;border-collapse:collapse;font-size:.85rem}
table.att-tbl thead tr{background:linear-gradient(90deg,var(--navy),#16213e)}
table.att-tbl thead th{color:#fff;padding:11px 12px;font-weight:700;font-size:.78rem;text-transform:uppercase;letter-spacing:.4px;border:none;white-space:nowrap}
table.att-tbl tbody tr{border-bottom:1px solid #f0f0f0;transition:background .15s}
table.att-tbl tbody tr:hover{background:#f8f9ff}
table.att-tbl tbody tr:nth-child(even){background:#fafafa}
table.att-tbl tbody tr:nth-child(even):hover{background:#f0f4ff}
table.att-tbl tbody td{padding:9px 12px;vertical-align:middle}
.serial-num{color:#aaa;font-size:.78rem;font-weight:600}
.roll-num{font-weight:800;color:var(--blue);font-size:.9rem}
.stu-name{font-weight:700;color:var(--navy)}
.stu-id{font-size:.75rem;color:#888}

/* Status select */
.status-select{border-radius:8px!important;border:1.5px solid #e0e0e0;font-size:.82rem;padding:5px 8px;min-width:110px}
.status-select.present{border-color:#06d6a0;background:#f0faf5;color:#028a5b}
.status-select.absent{border-color:#e63946;background:#fef0f1;color:#c0392b}

/* Remarks input */
.remarks-inp{border-radius:8px!important;border:1.5px solid #e0e0e0;font-size:.82rem;padding:5px 8px;width:100%;min-width:120px}
.remarks-inp:focus{border-color:var(--blue);outline:none;box-shadow:0 0 0 2px rgba(67,97,238,.1)}

/* Sig cell */
.sig-cell{min-width:80px;height:38px;border-left:1px dashed #ddd}

/* Status badge (print) */
.badge-present{background:#d4f5e9;color:#028a5b;border-radius:20px;padding:3px 10px;font-size:.76rem;font-weight:700}
.badge-absent{background:#fde8e8;color:#c0392b;border-radius:20px;padding:3px 10px;font-size:.76rem;font-weight:700}

/* Footer bar */
.table-footer{padding:12px 20px;display:flex;align-items:center;justify-content:space-between;border-top:1px solid #f0f0f0;flex-wrap:wrap;gap:10px}

/* Alert */
.alert-success-custom{background:linear-gradient(135deg,#d4f5e9,#c3f0e0);border:none;border-left:4px solid var(--teal);border-radius:10px;color:#028a5b;padding:10px 16px;font-size:.88rem;font-weight:600}

/* Empty state */
.empty-state{text-align:center;padding:60px 20px;color:#aaa}
.empty-state i{font-size:3.5rem;margin-bottom:14px;display:block;opacity:.3}

/* PRINT */
@media print{
  .no-print{display:none!important}
  .print-only{display:block!important}
  body{background:#fff;font-size:10px;-webkit-print-color-adjust:exact;color-adjust:exact}
  .main-card{box-shadow:none;border:1px solid #ccc;border-radius:0}
  .main-card-header{-webkit-print-color-adjust:exact;color-adjust:exact;padding:8px 12px}
  table.att-tbl thead tr{-webkit-print-color-adjust:exact;color-adjust:exact}
  table.att-tbl thead th{padding:6px 8px;font-size:.72rem}
  table.att-tbl tbody td{padding:6px 8px;font-size:.78rem}
  .sig-cell{height:32px}
  .print-sig-section{display:block!important}
}
.print-only{display:none}
.print-sig-section{display:none}
</style>
</head>
<body>

<!-- TOP BAR -->
<div class="top-bar no-print">
  <a href="../index.php" class="brand"><i class="fas fa-graduation-cap"></i> স্কুল ম্যানেজমেন্ট সিস্টেম</a>
  <div class="nav-links">
    <a href="../index.php"><i class="fas fa-home"></i> হোম</a>
    <a href="routine.php"><i class="fas fa-calendar"></i> রুটিন</a>
    <a href="absence_list.php"><i class="fas fa-user-times"></i> অনুপস্থিতি</a>
    <a href="attendance_certificate.php"><i class="fas fa-file-alt"></i> হাজিরা পত্র</a>
    <a href="bulk_attendance_certificate.php"><i class="fas fa-copy"></i> বাল্ক হাজিরা</a>
  </div>
</div>

<div class="container-fluid py-4 px-4">

<!-- FILTER CARD -->
<div class="filter-card no-print">
  <div class="filter-card-header">
    <i class="fas fa-clipboard-check fa-lg"></i>
    <h5>পরীক্ষার হাজিরা পত্র</h5>
  </div>
  <div class="filter-card-body">
    <form method="GET" action="">
      <div class="row g-3 align-items-end">
        <div class="col-md-4">
          <label class="form-label"><i class="fas fa-clipboard-list me-1" style="color:var(--blue)"></i>পরীক্ষা নির্বাচন</label>
          <select class="form-select" id="exam_id" name="exam_id" required>
            <option value="">— পরীক্ষা নির্বাচন করুন —</option>
            <?php foreach ($all_exams as $ex): ?>
              <option value="<?php echo $ex['id']; ?>" <?php echo ($exam_id == $ex['id']) ? 'selected' : ''; ?>>
                <?php echo htmlspecialchars($ex['name'].' — '.$ex['class_name'].' ('.$ex['section'].')'); ?>
                <?php if ($ex['group_name']): ?> · <?php echo htmlspecialchars($ex['group_name']); ?><?php endif; ?>
              </option>
            <?php endforeach; ?>
          </select>
        </div>
        <div class="col-md-3">
          <label class="form-label"><i class="fas fa-building me-1" style="color:var(--teal)"></i>পরীক্ষাকেন্দ্র</label>
          <input type="text" class="form-control" name="center_text" value="<?php echo htmlspecialchars($center_text); ?>" placeholder="যেমন: হল-২">
        </div>
        <div class="col-md-2">
          <label class="form-label"><i class="fas fa-sticky-note me-1" style="color:var(--orange)"></i>নোট</label>
          <input type="text" class="form-control" name="note_text" value="<?php echo htmlspecialchars($note_text); ?>" placeholder="প্রিন্টে দেখাবে">
        </div>
        <div class="col-md-2">
          <label class="form-label"><i class="fas fa-heading me-1" style="color:var(--purple)"></i>কার্ড হেডিং</label>
          <input type="text" class="form-control" name="card_heading" value="<?php echo htmlspecialchars($card_heading); ?>" placeholder="হাজিরা পত্র">
        </div>
        <div class="col-md-1 d-flex gap-2">
          <button type="submit" class="btn-load flex-fill"><i class="fas fa-search"></i></button>
          <a href="attendance.php" class="btn-reset"><i class="fas fa-redo"></i></a>
        </div>
      </div>
    </form>
  </div>
</div>

<?php if ($success_message): ?>
  <div class="alert-success-custom no-print mb-3"><i class="fas fa-check-circle me-2"></i><?php echo $success_message; ?></div>
<?php endif; ?>
<?php if ($error_message): ?>
  <div class="alert alert-danger no-print mb-3" style="border-radius:10px"><?php echo $error_message; ?></div>
<?php endif; ?>

<?php if ($exam_details && !empty($students)): ?>

<!-- STATS -->
<div class="stats-row no-print">
  <div class="stat-pill" style="color:var(--blue)"><i class="fas fa-users"></i> মোট: <strong><?php echo $total; ?></strong></div>
  <div class="stat-pill" style="color:var(--green)"><i class="fas fa-check-circle"></i> উপস্থিত: <strong><?php echo $present; ?></strong></div>
  <div class="stat-pill" style="color:var(--pink)"><i class="fas fa-times-circle"></i> অনুপস্থিত: <strong><?php echo $absent; ?></strong></div>
  <?php if ($total > 0): ?>
    <div class="stat-pill" style="color:var(--purple)"><i class="fas fa-percent"></i> উপস্থিতি: <strong><?php echo round($present/$total*100); ?>%</strong></div>
  <?php endif; ?>
</div>

<!-- PRINT HEADER (only in print) -->
<div class="print-only text-center mb-3">
  <h3 style="font-size:1.3rem;font-weight:800"><?php echo $card_heading ?: 'পরীক্ষার হাজিরা পত্র'; ?></h3>
  <h4 style="font-size:1.1rem"><?php echo htmlspecialchars($exam_details['name']); ?></h4>
  <p style="font-size:.85rem">
    <strong>ক্লাস:</strong> <?php echo htmlspecialchars($exam_details['class_name'].' - '.$exam_details['section']); ?> &nbsp;|&nbsp;
    <strong>সেশন:</strong> <?php echo htmlspecialchars($exam_details['session']); ?>
    <?php if ($exam_details['group_name']): ?> &nbsp;|&nbsp; <strong>গ্রুপ:</strong> <?php echo htmlspecialchars($exam_details['group_name']); ?><?php endif; ?>
    <?php if ($center_text): ?> &nbsp;|&nbsp; <strong>কেন্দ্র:</strong> <?php echo htmlspecialchars($center_text); ?><?php endif; ?>
  </p>
  <?php if ($note_text): ?><p style="font-size:.8rem;color:#555"><?php echo htmlspecialchars($note_text); ?></p><?php endif; ?>
</div>

<!-- MAIN CARD -->
<div class="main-card">
  <div class="main-card-header no-print">
    <div class="title">
      <i class="fas fa-clipboard-check"></i>
      <?php echo htmlspecialchars($exam_details['name']); ?> — হাজিরা পত্র
    </div>
    <div class="meta-badges">
      <span class="meta-badge"><?php echo htmlspecialchars($exam_details['class_name'].' '.$exam_details['section']); ?></span>
      <span class="meta-badge"><?php echo htmlspecialchars($exam_details['session']); ?></span>
      <?php if ($exam_details['group_name']): ?>
        <span class="meta-badge gold"><?php echo htmlspecialchars($exam_details['group_name']); ?></span>
      <?php endif; ?>
    </div>
  </div>

  <!-- SCREEN FORM -->
  <form method="POST" action="" class="no-print">
    <input type="hidden" name="save_attendance" value="1">
    <input type="hidden" name="exam_id" value="<?php echo $exam_id; ?>">
    <div class="att-wrap">
      <table class="att-tbl">
        <thead>
          <tr>
            <th style="width:4%">#</th>
            <th style="width:8%">রোল</th>
            <th style="width:13%">আইডি</th>
            <th style="width:25%">নাম</th>
            <th style="width:14%">হাজিরা</th>
            <th style="width:22%">মন্তব্য</th>
            <th style="width:14%">স্বাক্ষর</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach ($students as $i => $s): ?>
          <tr>
            <td class="serial-num"><?php echo $i+1; ?></td>
            <td><span class="roll-num"><?php echo htmlspecialchars($s['roll_number']); ?></span></td>
            <td class="stu-id"><?php echo htmlspecialchars($s['student_id']); ?></td>
            <td class="stu-name"><?php echo htmlspecialchars($s['first_name'].' '.$s['last_name']); ?></td>
            <td>
              <select class="status-select <?php echo ($s['attendance_status'] ?? 'present') === 'absent' ? 'absent' : 'present'; ?>"
                      name="attendance[<?php echo $s['id']; ?>][status]"
                      onchange="this.className='status-select '+(this.value==='absent'?'absent':'present')">
                <option value="present" <?php echo ($s['attendance_status'] ?? 'present') === 'present' ? 'selected' : ''; ?>>✓ উপস্থিত</option>
                <option value="absent"  <?php echo ($s['attendance_status'] ?? '') === 'absent'  ? 'selected' : ''; ?>>✗ অনুপস্থিত</option>
              </select>
            </td>
            <td><input type="text" class="remarks-inp" name="attendance[<?php echo $s['id']; ?>][remarks]" placeholder="মন্তব্য..."></td>
            <td class="sig-cell"></td>
          </tr>
          <?php endforeach; ?>
        </tbody>
      </table>
    </div>
    <div class="table-footer">
      <div style="font-size:.82rem;color:#888">মোট <strong><?php echo $total; ?></strong> জন শিক্ষার্থী</div>
      <div class="d-flex gap-2">
        <button type="button" class="btn-print" onclick="window.print()"><i class="fas fa-print me-1"></i>প্রিন্ট</button>
        <button type="submit" class="btn-save"><i class="fas fa-save me-1"></i>হাজিরা সেভ করুন</button>
      </div>
    </div>
  </form>

  <!-- PRINT TABLE -->
  <div class="print-only">
    <div class="att-wrap">
      <table class="att-tbl">
        <thead>
          <tr>
            <th style="width:4%">#</th>
            <th style="width:8%">রোল</th>
            <th style="width:13%">আইডি</th>
            <th style="width:28%">নাম</th>
            <th style="width:12%">হাজিরা</th>
            <th style="width:35%">স্বাক্ষর</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach ($students as $i => $s):
            $st = $s['attendance_status'] ?? 'present';
          ?>
          <tr style="height:38px">
            <td class="serial-num"><?php echo $i+1; ?></td>
            <td><span class="roll-num"><?php echo htmlspecialchars($s['roll_number']); ?></span></td>
            <td class="stu-id"><?php echo htmlspecialchars($s['student_id']); ?></td>
            <td class="stu-name"><?php echo htmlspecialchars($s['first_name'].' '.$s['last_name']); ?></td>
            <td>
              <?php if ($st === 'absent'): ?>
                <span class="badge-absent">অনুপস্থিত</span>
              <?php else: ?>
                <span class="badge-present">উপস্থিত</span>
              <?php endif; ?>
            </td>
            <td class="sig-cell"></td>
          </tr>
          <?php endforeach; ?>
        </tbody>
      </table>
    </div>

    <!-- Print signature section -->
    <div class="print-sig-section" style="margin-top:24px;display:grid;grid-template-columns:1fr 1fr;gap:30px;font-size:.82rem">
      <div style="text-align:center">
        <div style="border-top:1px solid #000;margin:30px auto 4px;width:70%"></div>
        <p>পরীক্ষকের স্বাক্ষর</p>
      </div>
      <div style="text-align:center">
        <div style="border-top:1px solid #000;margin:30px auto 4px;width:70%"></div>
        <p>প্রধান শিক্ষকের স্বাক্ষর</p>
      </div>
    </div>
    <div style="text-align:center;margin-top:10px;font-size:.78rem;color:#555">
      মোট শিক্ষার্থী: <?php echo $total; ?> জন &nbsp;|&nbsp; উপস্থিত: <?php echo $present; ?> &nbsp;|&nbsp; অনুপস্থিত: <?php echo $absent; ?>
    </div>
  </div>

</div><!-- /main-card -->

<?php elseif ($exam_id): ?>
<div class="empty-state no-print">
  <i class="fas fa-user-slash" style="color:var(--blue)"></i>
  <p class="fw-bold fs-5">এই পরীক্ষার জন্য কোনো শিক্ষার্থী পাওয়া যায়নি</p>
  <small>পরীক্ষার ক্লাস ও সেশন চেক করুন</small>
</div>
<?php else: ?>
<div class="empty-state no-print">
  <i class="fas fa-clipboard-check" style="color:var(--blue)"></i>
  <p class="fw-bold fs-5">পরীক্ষা নির্বাচন করুন</p>
  <small>উপরের ফিল্টার থেকে পরীক্ষা বেছে নিন</small>
</div>
<?php endif; ?>

</div><!-- /container-fluid -->

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
