include_once 'classes/Authentication.php';
include_once 'classes/Database.php';
include_once 'classes/User.php';
$db = Database::getDatabase();
Authentication::sec_session_start();
if (Authentication::login_check($db->getMysqli()) == true && $_SESSION['admin'] == true) {
    ?>

<?php 
} else {
    header('Location: access-error.php');
}
?>
  <?php 
$userExams = User::getExams($_SESSION['username'], $_SESSION['auth']);
?>
  <link rel="stylesheet" type="text/css" href="css/sortable_table.css">
  <div class="facultyScheduleExamFormContainer">
      <table id="stops_table" class="sortable_table">
        <tbody>
          <tr>
            <th sort_expression="From">From</th>
            <th sort_expression="To">To</th>
            <th sort_expression="Available">Available</th>
          </tr>
          <?php 
foreach ($userExams as $exam) {
    ?>
                  <tr>
                    <td><?php 
include_once 'classes/Authentication.php';
include_once 'classes/Database.php';
include_once 'classes/User.php';
$db = Database::getDatabase();
Authentication::sec_session_start();
if (Authentication::login_check($db->getMysqli()) == true && $_SESSION['faculty'] == true) {
    ?>

<?php 
} else {
    header('Location: access-error.php');
}
?>
  <?php 
$userExams = User::getExams($_SESSION['netid'], $_SESSION['faculty']);
?>
  <link rel="stylesheet" type="text/css" href="css/sortable_table.css">
  <div class="facultyScheduleExamFormContainer">
      <table id="stops_table" class="sortable_table">
        <tbody>
          <tr>
            <th sort_expression="ClassID">ClassID</th>
            <th sort_expression="ExamStartDate">ExamStartDate</th>
            <th sort_expression="ExamEndDate">ExamEndDate</th>
            <th sort_expression="ExamDuration">ExamDuration</th>
            <th sort_expression="Processed">Processed</th>
            <th sort_expression="ExamID">ExamID</th>
            <th sort_expression="Functions">Functions</th>
          </tr>
          <?php 
include_once 'classes/Authentication.php';
include_once 'classes/Database.php';
include_once 'classes/User.php';
$db = Database::getDatabase();
Authentication::sec_session_start();
if (Authentication::login_check($db->getMysqli()) == true && $_SESSION['student'] == true) {
    ?>

<?php 
} else {
    header('Location: access-error.php');
}
?>
  <?php 
$userExams = User::getExams($_SESSION['netid'], $_SESSION['student']);
?>
  <link rel="stylesheet" type="text/css" href="css/sortable_table.css">
  <div class="facultyScheduleExamFormContainer">
      <table id="student_exams_container" class="sortable_table">
        <tbody>
          <tr>
            <th sort_expression="ClassID">CourseName</th>
              <th sort_expression="ClassID">CourseNumber</th>
            <th sort_expression="ExamStartDate">ExamStartDate</th>
            <th sort_expression="ExamEndDate">ExamEndDate</th>
            <th sort_expression="ExamDuration">ExamStartTime</th>
            <th sort_expression="ExamDuration">ExamEndTime</th>
            <th sort_expression="ExamDuration">ExamDuration</th>
          </tr>
          <?php