echo '<thead>';
 echo '<tr>';
 echo '<th>No.</th>';
 echo '<th>Exercise Title</th>';
 echo '<th>Lab Title</th>';
 echo '<th>Actions</th>';
 echo '</tr>';
 echo '</thead>';
 //End of table header
 //Beginning of table body
 echo '<tbody>';
 foreach ($pdo->query($sql1) as $row) {
     echo '<tr>';
     echo '<td width=1>' . $no . '.' . '</td>';
     echo '<td>' . $row['Exercise_Title'] . '</td>';
     echo '<td>' . $api->Lab_Title($row['Lab_No'], $pdo) . '</td>';
     echo '<td width=230 class="text-center">';
     echo '<a class="btn btn-info" href="manageForumsAdmin.php?page=view&forumId=' . $row['Exercise_Id'] . '">View</a>';
     echo ' ';
     echo '<a class="btn btn-success" href="manageForumsAdmin.php?page=confirm&forumId=' . $row['Exercise_Id'] . '">Accept</a>';
     echo ' ';
     echo '<a class="btn btn-warning" href="manageForumsAdmin.php?page=ignore&forumId=' . $row['Exercise_Id'] . '">Ignore</a>';
     echo '</td>';
     echo '</tr>';
     $no++;
 }
 echo '</tbody>';
 //End of table body
 echo '</table>';
 //End of table
 //Pagination
     //The End Of Table Body
     echo '</table>';
     //The End Of The Table
     //Pagination
     if ($count > $startrow + 5) {
         echo '<a class="btn btn-info" href="' . $_SERVER['PHP_SELF'] . '?startrow=' . ($startrow + 5) . '&page=' . $pagenate . '">Next</a>';
     }
     echo '  ';
     $prev = $startrow - 5;
     if ($prev >= 0) {
         echo '<a class="btn btn-success" href="' . $_SERVER['PHP_SELF'] . '?startrow=' . $prev . '&page=' . $pagenate . '">Previous</a>';
     }
 } else {
     if ($page == 'videos') {
         $no = 1;
         echo '<h4>All videos for ' . $api->Lab_Title($labNo, $pdo) . '</h4><br />';
         //The Beginning of table
         echo '<table class="table table-striped table-bordered">';
         //The Beginning of table header
         echo '<thead>';
         echo '<tr>';
         echo '<th>No.</th>';
         echo '<th>Video Title</th>';
         echo '<th>Video Status</th>';
         echo '<th>Upload Time</th>';
         echo '<th>Actions</th>';
         echo '</tr>';
         echo '</thead>';
         //End of table header
         //Beginning of table body
         echo '<tbody>';
    echo '</table>';
    //End of table
    //Pagination
    if ($count > $startrow + 5) {
        echo '<a class="btn btn-info" href="' . $_SERVER['PHP_SELF'] . '?startrow=' . ($startrow + 5) . '&page=labs">Next</a>';
    }
    echo '  ';
    $prev = $startrow - 5;
    if ($prev >= 0) {
        echo '<a class="btn btn-success" href="' . $_SERVER['PHP_SELF'] . '?startrow=' . $prev . '&page=labs">Previous</a>';
    }
    //End of pagination
} else {
    if ($page == 'videos') {
        $no = 1;
        echo '<h4>All videos for ' . $api->Lab_Title($labNo, $pdo) . '</h4><br />';
        //The Beginning of table
        echo '<table class="table table-striped table-bordered">';
        //The Beginning of table header
        echo '<thead>';
        echo '<tr>';
        echo '<th>No.</th>';
        echo '<th>Video Title</th>';
        echo '<th>Uploaded By</th>';
        echo '<th>Upload Time</th>';
        echo '<th>Watch Video</th>';
        echo '</tr>';
        echo '</thead>';
        //End of table header
        //Beginning of table body
        echo '<tbody>';
    //The End Of Table Body
    echo '</table>';
    //The End Of The Table
    //Pagination
    if ($count > $startrow + 5) {
        echo '<a class="btn btn-info" href="' . $_SERVER['PHP_SELF'] . '?startrow=' . ($startrow + 5) . '&page=confirmed">Next</a>';
    }
    echo '  ';
    $prev = $startrow - 5;
    if ($prev >= 0) {
        echo '<a class="btn btn-success" href="' . $_SERVER['PHP_SELF'] . '?startrow=' . $prev . '&page=confirmed">Previous</a>';
    }
} else {
    if ($page == 'viewExercises') {
        $no = 1;
        echo '<h4>All exercises for ' . $api->Lab_Title($labNo, $pdo) . '</h4><br />';
        //the Beginning Of The Table
        echo '<table class="table table-striped table-bordered">';
        //The Beginning Of The Table Header
        echo '<thead>';
        echo '<tr>';
        echo '<th>No.</th>';
        echo '<th>Title</th>';
        echo '<th>Lab Number</th>';
        echo '<th>Grade Level</th>';
        echo '<th>Status</th>';
        echo '<th>Actions</th>';
        echo '</tr>';
        echo '</thead>';
        //The End Of The Table Header
        //The Beginning Of Table Body