diff --git a/Course.php b/Course.php index 75fec1c..0042079 100644 --- a/Course.php +++ b/Course.php @@ -16,8 +16,7 @@ include 'Header.php'; $c_date = date("Y-m-d H:i"); - if(!empty($_GET["url"])) - { + if(!empty($_GET["url"])) { $course_url = mysqli_real_escape_string($con, $_GET["url"]); $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 @@ -29,7 +28,7 @@ include 'Header.php'; echo "No course matching the given course URL: ".$course_url; } else { - while($row = mysqli_fetch_assoc($result)) { + while ($row = mysqli_fetch_assoc($result)) { $name = $row['Course_Name']; $code = $row['Course_Code']; $faculty = $row['Faculty']; @@ -38,16 +37,22 @@ include 'Header.php'; $url = $row['URL']; $course_id = $row['Course_ID']; // also get teaching assistant names (if any) - $ta_result = mysqli_query($con, "SELECT Full_Name FROM users_table where User_ID in (select TA from course_ta where Course_ID='$course_id');"); + $ta_result = mysqli_query($con, "SELECT Full_Name FROM users_table WHERE User_ID IN (SELECT TA FROM course_ta WHERE Course_ID='$course_id');"); if (mysqli_num_rows($ta_result) == 0) { - echo "
Courses > ($code) $name > Assignments
Faculty: $faculty   Year: $academic   Lecturer: $lecturer
"; + echo "
+ Courses > ($code) $name > Assignments
+ Faculty: $faculty   Year: $academic   Lecturer: $lecturer +
"; } else { $ta_name = ""; while ($row = mysqli_fetch_assoc($ta_result)) { $ta_name = $ta_name.$row['Full_Name']." "; } - $ta_name = trim ($ta_name); - echo "
Courses > ($code) $name > Assignments
Faculty: $faculty   Year: $academic   Lecturer: $lecturer   Teaching Assistant: $ta_name
"; + $ta_name = trim($ta_name); + echo "
+ Courses > ($code) $name > Assignments
+ Faculty: $faculty   Year: $academic   Lecturer: $lecturer   Teaching Assistant: $ta_name +
"; } } }