From 16235b175ace1537554bcc2610d5b3c9cab931fc Mon Sep 17 00:00:00 2001 From: Lan Hui Date: Fri, 1 Sep 2023 18:52:45 +0800 Subject: [PATCH] SubmitLab.php: better spacing --- SubmitLab.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/SubmitLab.php b/SubmitLab.php index c8ba525..639eea4 100644 --- a/SubmitLab.php +++ b/SubmitLab.php @@ -30,14 +30,10 @@ include 'Header.php'; $result1 = mysqli_query($con, "SELECT Type, Lab_Report_ID, Course_ID, Posted_Date, Deadline, Instructions, Title, Attachment_link_1, Attachment_link_2, Attachment_link_3, Attachment_link_4 FROM lab_reports_table WHERE Lab_Report_ID=$id AND Deadline>'$c_date' ORDER BY Lab_Report_ID DESC"); - if(mysqli_num_rows($result1) == 0) - { + if(mysqli_num_rows($result1) == 0) { echo "No active assignments for this course so far."; - } else { - while($row = mysqli_fetch_assoc($result1)) { - $Course_ID = $row['Course_ID']; $title = $row['Title']; $ins = $row['Instructions']; @@ -51,14 +47,13 @@ include 'Header.php'; $type = $row['Type']; // Giving both the Group Admin and Group Members same priviledges to submit assignment - if($type=="Group"){ + if ($type == "Group") { $resultx1 = mysqli_query($con,"SELECT Course_Group_id FROM `course_groups_table` WHERE (Course_id=$Course_ID) and ((Group_Member=$student_id ) or (Group_Member2=$student_id ) or (Group_Member3=$student_id ) or (Group_Member4=$student_id ) or (Group_Leader=$student_id))"); - while($row = mysqli_fetch_assoc($resultx1)) { + while ($row = mysqli_fetch_assoc($resultx1)) { $_SESSION["Group_ID"] = $row['Course_Group_id']; } - if($_SESSION["Group_ID"] < 1) - { + if ($_SESSION["Group_ID"] < 1) { echo"

This Lab report can only be submitted by Group Admin

"; return; } @@ -67,19 +62,19 @@ include 'Header.php'; $full_link="$att1"; - if($att2!=""){ + if ($att2 != ""){ $full_link = $full_link."| $att2"; } - if($att3!=""){ + + if ($att3 != ""){ $full_link = $full_link."| $att3"; } - if($att4!=""){ + if ($att4 != ""){ $full_link = $full_link."| $att4"; } echo "
Courses > ($url) $course_name > $title
"; - } } }