<?php if(session_status()==PHP_SESSION_NONE){session_start();} ?>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary mb-4">
  <div class="container-fluid">
    <a class="navbar-brand" href="admin_dashboard.php">YPDO -Admin Panel</a>
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" 
      aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarNav">
      <ul class="navbar-nav ms-auto">
        <?php if(isset($_SESSION['admin_logged_in'])&&$_SESSION['admin_logged_in']===true): ?>
          <li class="nav-item"><a class="nav-link" href="admin_dashboard.php">Dashboard</a></li>
          <li class="nav-item"><a class="nav-link" href="create_exam.php">Create Exam</a></li>
          <li class="nav-item"><a class="nav-link" href="manage_students.php">Manage Students</a></li>
          <li class="nav-item"><a class="nav-link" href="admin_all_students.php">All Students</a></li>
          <li class="nav-item"><a class="nav-link" href="admin_batches.php">Manage Batches</a></li>
          <li class="nav-item"><a class="nav-link" href="admin_batch_enrollments.php">Batch Enrollments</a></li>
          <li class="nav-item"><a class="nav-link" href="admin_attendance.php">Manage Attendance</a></li>
                <li class="nav-item"><a class="nav-link" href="admin_attendance_progress.php">Attandance Progress</a></li>
          
          <li class="nav-item"><a class="nav-link" href="admin_logout.php">Logout</a></li>
        <?php elseif(isset($_SESSION['student_id'])): ?>
          <li class="nav-item"><a class="nav-link" href="take_exam.php">Take Exam</a></li>
          <li class="nav-item"><a class="nav-link" href="student_logout.php">Logout</a></li>
        <?php else: ?>
          <li class="nav-item"><a class="nav-link" href="admin_login.php">Admin Login</a></li>
          <li class="nav-item"><a class="nav-link" href="student_login.php">Student Login</a></li>
        <?php endif; ?>
      </ul>
    </div>
  </div>
</nav>
