Submissions.php: better code format.

Bug430-Eden2
Lan Hui 2023-08-26 20:12:46 +08:00
parent ad32a71cd9
commit a2f2c9c30f
1 changed files with 20 additions and 32 deletions

View File

@ -191,26 +191,22 @@ where Lab_Report_ID=$id and lab_report_submissions.Status='Pending' order by Sub
<?php <?php
if ($Report_Type == "Group") { if ($Report_Type == "Group") {
$result = mysqli_query($con, "SELECT `Submission_ID`,Visibility, `Submission_Date`, lab_report_submissions.Lab_Report_ID, $result = mysqli_query($con, "SELECT Submission_ID, Visibility, Submission_Date, lab_report_submissions.Lab_Report_ID, lab_report_submissions.Course_Group_id, Attachment1, Notes, Attachment2, Attachment3, Attachment4, Marks, lab_report_submissions.Status, Title, course_groups_table.Group_Name
lab_report_submissions.Course_Group_id, `Attachment1`, FROM lab_report_submissions
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status, LEFT JOIN course_groups_table ON course_groups_table.Course_Group_id=lab_report_submissions.Course_Group_id
`Title`,course_groups_table.Group_Name WHERE Lab_Report_ID=$id and lab_report_submissions.Status='Marked'");
FROM `lab_report_submissions`
left JOIN course_groups_table on course_groups_table.Course_Group_id=lab_report_submissions.Course_Group_id
where Lab_Report_ID=$id and lab_report_submissions.Status='Marked'");
} else { } else {
$result = mysqli_query($con, "SELECT `Submission_ID`,Visibility, `Submission_Date`, lab_report_submissions.Lab_Report_ID, $result = mysqli_query($con, "SELECT Submission_ID, Visibility, Submission_Date, lab_report_submissions.Lab_Report_ID, lab_report_submissions.Student_id sub_std, lab_report_submissions.Course_Group_id, Attachment1, Notes, Attachment2, Attachment3, Attachment4, Marks, lab_report_submissions.Status, Title, users_table.Full_Name, course_group_members_table.Student_ID
lab_report_submissions.Student_id sub_std, lab_report_submissions.Course_Group_id, `Attachment1`, FROM lab_report_submissions
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status, LEFT JOIN users_table ON users_table.Student_ID=lab_report_submissions.Student_id
`Title`,users_table.Full_Name,course_group_members_table.Student_ID LEFT JOIN course_group_members_table ON course_group_members_table.Course_Group_id=lab_report_submissions.Course_Group_id
FROM `lab_report_submissions` WHERE Lab_Report_ID=$id AND lab_report_submissions.Status='Marked' ORDER BY lab_report_submissions.Student_id Desc");
Left JOIN users_table on users_table.Student_ID=lab_report_submissions.Student_id
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.Status='Marked' Order by lab_report_submissions.Student_id Desc");
} }
if (mysqli_num_rows($result) == 0) { if (mysqli_num_rows($result) == 0) {
echo "No marked submissions."; echo "No marked submissions.";
} else { } else {
echo "<h3><a href='~\..\Script.php?exportgrade=true&lab=$id&lab_name=$Report_Title'><i class='fa fa-book'></i> Export grades</a></h3>"; echo "<h3><a href='~\..\Script.php?exportgrade=true&lab=$id&lab_name=$Report_Title'><i class='fa fa-book'></i> Export grades</a></h3>";
@ -278,24 +274,16 @@ where Lab_Report_ID=$id and lab_report_submissions.Status='Marked' Order by lab
<?php <?php
if ($Report_Type == "Group") { if ($Report_Type == "Group") {
$resulty = mysqli_query($con, "SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID, $resulty = mysqli_query($con, "SELECT Submission_ID, Submission_Date, lab_report_submissions.Lab_Report_ID, lab_report_submissions.Course_Group_id, Attachment1, Notes, Attachment2, Attachment3, Attachment4, lab_report_submissions.Marks, lab_report_submissions.Status, Title, course_groups_table.Group_Name
lab_report_submissions.Course_Group_id, `Attachment1`, FROM lab_report_submissions
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, lab_report_submissions.Marks, lab_report_submissions.Status, LEFT JOIN course_groups_table ON course_groups_table.Course_Group_id=lab_report_submissions.Course_Group_id
`Title`,course_groups_table.Group_Name WHERE Lab_Report_ID=$id AND lab_report_submissions.Status='Remarking'");
FROM `lab_report_submissions`
left JOIN course_groups_table on course_groups_table.Course_Group_id=lab_report_submissions.Course_Group_id
where Lab_Report_ID=$id and lab_report_submissions.Status='Remarking'");
} else { } else {
$resulty = mysqli_query($con, "SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID, $resulty = mysqli_query($con, "SELECT Submission_ID, Submission_Date, lab_report_submissions.Lab_Report_ID, lab_report_submissions.Remarking_Reason, lab_report_submissions.Student_id sub_std, lab_report_submissions.Course_Group_id, Attachment1, Notes, Attachment2, Attachment3, Attachment4, lab_report_submissions.Marks, lab_report_submissions.Status, Title, users_table.Full_Name, course_group_members_table.Student_ID
lab_report_submissions.Remarking_Reason, FROM lab_report_submissions
lab_report_submissions.Student_id sub_std, lab_report_submissions.Course_Group_id, `Attachment1`, LEFT JOIN users_table ON users_table.Student_ID=lab_report_submissions.Student_id
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, lab_report_submissions.Marks, lab_report_submissions.Status, LEFT JOIN course_group_members_table ON course_group_members_table.Course_Group_id=lab_report_submissions.Course_Group_id
`Title`,users_table.Full_Name,course_group_members_table.Student_ID WHERE Lab_Report_ID=$id AND lab_report_submissions.Status='Remarking'");
FROM `lab_report_submissions`
Left JOIN users_table on users_table.Student_ID=lab_report_submissions.Student_id
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.Status='Remarking'");
} }
if (mysqli_num_rows($resulty) == 0) { if (mysqli_num_rows($resulty) == 0) {