From 0e22600816bead3d85e30c22d4c39180ac24732d Mon Sep 17 00:00:00 2001 From: Lan Hui Date: Wed, 6 Sep 2023 19:50:32 +0800 Subject: [PATCH] Courses.php: indent code --- Courses.php | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/Courses.php b/Courses.php index 617c01a..5b66bc0 100644 --- a/Courses.php +++ b/Courses.php @@ -365,36 +365,36 @@ include 'Header.php'; WHERE course_ta.TA=$user_id"); } - if(mysqli_num_rows($result) != 0) - { - while($row = mysqli_fetch_assoc($result)) { - $id = $row['Course_ID']; - $name = $row['Course_Name']; - $code = $row['Course_Code']; - $faculty = $row['Faculty']; - $lecturer = $row['Full_Name']; - $academic = $row['Academic_Year']; - $url = $row['URL']; + if (mysqli_num_rows($result) != 0) { + while ($row = mysqli_fetch_assoc($result)) { + $id = $row['Course_ID']; + $name = $row['Course_Name']; + $code = $row['Course_Code']; + $faculty = $row['Faculty']; + $lecturer = $row['Full_Name']; + $academic = $row['Academic_Year']; + $url = $row['URL']; + $resultTA = mysqli_query($con, "SELECT Course_ID, TA, users_table.Full_Name AS TA_NAME + FROM course_ta + INNER JOIN users_table ON users_table.User_ID=course_ta.TA + WHERE course_ta.Course_ID=$id"); + $ta = ""; - $resultTA = mysqli_query($con,"SELECT `Course_ID`, `TA`,users_table.Full_Name as TA_NAME FROM `course_ta` INNER JOIN users_table on users_table.User_ID=course_ta.TA where course_ta.Course_ID=$id"); + while ($rowTA = mysqli_fetch_assoc($resultTA)) { + $ta = $ta." ".$rowTA['TA_NAME']; + } - $ta = ""; - while($rowTA = mysqli_fetch_assoc($resultTA)) { - $ta = $ta." ".$rowTA['TA_NAME']; - } - - if ($ta == "") { - $ta = " None"; - } + if ($ta == "") { + $ta = " None"; + } - echo" + echo"
($code) - $name

Faculty: $faculty        Year: $academic        Lecturer: $lecturer        TA:$ta

-
"; - + "; } } ?> @@ -404,11 +404,9 @@ include 'Header.php';
Course joining requests - -