<?php
include '../../includes/functions.php';
// Start session if not started
if (session_status() == PHP_SESSION_NONE) {
    session_start();
}


// You can use $pageTitle to set dynamic page titles
if (!isset($pageTitle)) {
    $pageTitle = "BCA | CBE";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><?= htmlspecialchars($pageTitle) ?></title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body { padding-top: 70px; }
    </style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top">
    <div class="container-fluid">
        <a class="navbar-brand" href="../../index.php">Exam Management System</a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav ms-auto">
                    <?php if (hasRole('teacher')): ?>
                        <li class="nav-item">
                            <a class="nav-link" href="../../teacher.php">Dashboard</a>
                        </li>
                    <?php elseif (hasRole('admin')): ?>
                        <li class="nav-item">
                            <a class="nav-link" href="../../admin.php">Dashboard</a>
                        </li>
                        <!--<li class="nav-item">
                            <a class="nav-link" href="../admin/monitoring.php">Monitor Exam</a>
                        </li>-->
                    <?php elseif (hasRole('student')): ?>
                        <li class="nav-item">
                            <a class="nav-link" href="../../students.php">Dashboard</a>
                        </li>
                    <?php endif; ?>
                    <?php if (hasRole('teacher')): ?>
                        <li class="nav-item"><a class="nav-link" href="../teacher/manage_exams.php">Manage Exams</a></li>
                    <?php elseif (hasRole('student')): ?>
                        <li class="nav-item"><a class="nav-link" href="../student/available_exams.php">Available Exams</a></li>
                    <?php elseif (hasRole('admin')): ?>
                        <li class="nav-item"><a class="nav-link" href="../admin/manage_exam.php">Manage Exams</a></li>
                    <?php endif; ?>
                    <?php if (hasRole('teacher')): ?>
                        <li class="nav-item"><a class="nav-link" href="../teacher/exam_report.php">Exam Report</a></li>
                    <?php endif; ?>
            </ul>
        </div>
    </div>
</nav>
<div class="container">


