Admin.php: Admin user can see all courses.
parent
11a35b326d
commit
44f478107f
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue