Admin.php: Admin user can see all courses.

Bug430-Eden2
Lan Hui 2023-08-21 19:34:34 +08:00
parent 11a35b326d
commit 44f478107f
1 changed files with 5 additions and 1 deletions

View File

@ -173,7 +173,11 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
<?php
$user_id = $_SESSION['user_id'];
if ($_SESSION['user_type'] == 'Lecturer') {
$result = mysqli_query($con, "SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`, `TA_User_ID`, `Course_Code`, `Full_Name` FROM courses_table INNER JOIN users_table ON users_table.User_ID=courses_table.Lecturer_User_ID WHERE User_ID=$user_id ORDER BY Academic_Year DESC;");
} else if ($_SESSION['user_type'] == 'Admin') {
$result = mysqli_query($con, "SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`, `TA_User_ID`, `Course_Code`, `Full_Name` FROM courses_table INNER JOIN users_table ON users_table.User_ID=courses_table.Lecturer_User_ID ORDER BY Academic_Year DESC;");
}
if (mysqli_num_rows($result) != 0) {
$counter = 0;
while ($row = mysqli_fetch_assoc($result)) {