From 027c4fada6d2409d900797ce66c5348e31fa0ca2 Mon Sep 17 00:00:00 2001 From: Lan Hui Date: Wed, 23 Aug 2023 20:43:37 +0800 Subject: [PATCH] Course.php: better code spacing. --- Course.php | 127 ++++++++++++++++++++++++++--------------------------- 1 file changed, 62 insertions(+), 65 deletions(-) diff --git a/Course.php b/Course.php index 7c1b15d..07e2675 100644 --- a/Course.php +++ b/Course.php @@ -68,12 +68,12 @@ include 'Header.php'; if (isset($_SESSION['info_general'])) { echo '
'; - $_SESSION['info_general']=null; + $_SESSION['info_general'] = null; } if (isset($_SESSION['info_courses'])) { echo '
'; - $_SESSION['info_courses']=null; + $_SESSION['info_courses'] = null; } ?> @@ -100,8 +100,8 @@ include 'Header.php'; No active assignments now."; } else { - while($row = mysqli_fetch_assoc($result1)) { $title=$row['Title']; $type=$row['Type']; @@ -168,7 +166,8 @@ include 'Header.php';

Submit

"; - }} + } + } echo ""; ?> @@ -238,9 +237,10 @@ include 'Header.php'; '; - } else { while($row = mysqli_fetch_assoc($resultx)) { $lab_repo_id=$row['Lab_Report_ID']; @@ -268,21 +264,21 @@ include 'Header.php'; $att3=$row['Attachment_link_3']; $att4=$row['Attachment_link_4']; $id = $row['Lab_Report_ID']; - if( $c_date < $deadline) - { + + if( $c_date < $deadline) { $submittedx="Re-submit"; } $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"; } @@ -300,10 +296,8 @@ Left JOIN users_table on users_table.Student_ID=lab_report_submissions.Student_ left JOIN course_group_members_table on course_group_members_table.Course_Group_id=lab_report_submissions.Course_Group_id where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$student_id')"); - if(mysqli_num_rows($Sub_result) == 0) - { + if(mysqli_num_rows($Sub_result) == 0) { echo "No Attachments found."; - } else { while($row = mysqli_fetch_assoc($Sub_result)) { $at1=$row['Attachment1']; @@ -335,8 +329,8 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen } echo ""; - - }} + } + } echo ""; ?> @@ -344,19 +338,21 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen '; } else { while($row = mysqli_fetch_assoc($resultx)) { - $title=$row['Lab_Title']; - $marks=$row['Marks']; - $Originalmarks=$row['Original_marks']; - $ins=$row['Instructions']; - $posted=$row['Posted_Date']; - $deadline=$row['Deadline']; - $att1=$row['Attachment_link_1']; - $att2=$row['Attachment_link_2']; - $att3=$row['Attachment_link_3']; - $att4=$row['Attachment_link_4']; - $id=$row['Lab_Report_ID']; - $Submission_ID=$row['Submission_ID']; - $notes=$row['Notes']; - $status= $row['Status']; - $remarking_reason=$row['Remarking_Reason']; + $title = $row['Lab_Title']; + $marks = $row['Marks']; + $Originalmarks = $row['Original_marks']; + $ins = $row['Instructions']; + $posted = $row['Posted_Date']; + $deadline = $row['Deadline']; + $att1 = $row['Attachment_link_1']; + $att2 = $row['Attachment_link_2']; + $att3 = $row['Attachment_link_3']; + $att4 = $row['Attachment_link_4']; + $id = $row['Lab_Report_ID']; + $Submission_ID = $row['Submission_ID']; + $notes = $row['Notes']; + $status = $row['Status']; + $remarking_reason = $row['Remarking_Reason']; - if($status=='Marked') { - $rm_data="\Script.php?remarking=yes&id=$Submission_ID&url=$url&status=Remarking"; - $remarking=""; + if ($status == 'Marked') { + $rm_data = "\Script.php?remarking=yes&id=$Submission_ID&url=$url&status=Remarking"; + $remarking = ""; } - if($status=='Remarking') { - $remarking=" Remarking request sent
Reasons for remarking: $remarking_reason
"; + if ($status=='Remarking') { + $remarking = " Remarking request sent
Reasons for remarking: $remarking_reason
"; } - echo "
$title
($marks marks out of $Originalmarks)

Lecturer feedback $notes    $remarking

Submitted files: "; $Sub_result = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID, @@ -416,25 +411,25 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen left JOIN course_group_members_table on course_group_members_table.Course_Group_id=lab_report_submissions.Course_Group_id where Lab_Report_ID=$id and lab_report_submissions.Student_id='$student_id'"); - if(mysqli_num_rows($Sub_result)==0) { + if (mysqli_num_rows($Sub_result) == 0) { echo "No Attachments found."; } else { while($row = mysqli_fetch_assoc($Sub_result)) { - $at1=$row['Attachment1']; - $at2=$row['Attachment2']; - $at3=$row['Attachment3']; - $at4=$row['Attachment4']; + $at1 = $row['Attachment1']; + $at2 = $row['Attachment2']; + $at3 = $row['Attachment3']; + $at4 = $row['Attachment4']; - $full_link="$at1"; + $full_link = "$at1"; - if($at2!="") { + if($at2 != "") { $full_link= $full_link."| $at2"; } - if($at3!="") { + if($at3 != "") { $full_link= $full_link."| $at3"; } - if($at4!="") { + if($at4 != "") { $full_link= $full_link."| $at4"; } @@ -458,7 +453,9 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen Create group"; ?>