Courses.php: format SQL code
parent
ae707cffca
commit
6f689a2296
20
Courses.php
20
Courses.php
|
@ -11,7 +11,7 @@ include 'Header.php';
|
|||
<div class="container">
|
||||
|
||||
<?php
|
||||
$user_d = $_SESSION['user_id'];
|
||||
$user_id = $_SESSION['user_id'];
|
||||
if( $_SESSION['user_type']=="Lecturer" || $_SESSION['user_type']=="TA")
|
||||
{
|
||||
?>
|
||||
|
@ -352,15 +352,17 @@ include 'Header.php';
|
|||
|
||||
echo "<h1 class='display-6'>My courses</h1>";
|
||||
|
||||
$result = mysqli_query($con,"SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members`, users_table.Full_Name FROM `courses_table` INNER JOIN users_table ON users_table.User_ID=courses_table.Lecturer_User_ID where courses_table.Lecturer_User_ID=$user_d ORDER BY Academic_Year DESC, URL ASC");
|
||||
|
||||
if($_SESSION['user_type']=="TA")
|
||||
{
|
||||
$result = mysqli_query($con,"SELECT course_ta.Course_ID, `Course_Name`,
|
||||
`Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table`
|
||||
INNER JOIN
|
||||
course_ta ON course_ta.Course_ID=courses_table.Course_ID where course_ta.TA=$user_d");
|
||||
$result = mysqli_query($con, "SELECT Course_ID, Course_Name, Academic_Year, Faculty, Lecturer_User_ID, TA_User_ID, Course_Code, URL, Verify_New_Members, users_table.Full_Name
|
||||
FROM courses_table
|
||||
INNER JOIN users_table ON users_table.User_ID=courses_table.Lecturer_User_ID
|
||||
WHERE courses_table.Lecturer_User_ID=$user_id
|
||||
ORDER BY Academic_Year DESC, URL ASC");
|
||||
|
||||
if ($_SESSION['user_type'] == "TA") {
|
||||
$result = mysqli_query($con, "SELECT course_ta.Course_ID, Course_Name, Academic_Year, Faculty, Lecturer_User_ID, TA_User_ID, Course_Code, URL, Verify_New_Members
|
||||
FROM courses_table
|
||||
INNER JOIN course_ta ON course_ta.Course_ID=courses_table.Course_ID
|
||||
WHERE course_ta.TA=$user_id");
|
||||
}
|
||||
|
||||
if(mysqli_num_rows($result) != 0)
|
||||
|
|
Loading…
Reference in New Issue