Course.php: make downloading attachment work & indent code.

Bug430-Eden2
Lan Hui 2023-08-30 20:21:35 +08:00
parent 0e3e5aec8d
commit 63c4da74f8
1 changed files with 25 additions and 24 deletions

View File

@ -417,37 +417,38 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
$remarking = "<br> <span style='color:orange'><i class='fa fa-info-circle'></i> Remarking request sent </span> Reasons for remarking: <i>$remarking_reason </i> <br>"; $remarking = "<br> <span style='color:orange'><i class='fa fa-info-circle'></i> Remarking request sent </span> Reasons for remarking: <i>$remarking_reason </i> <br>";
} }
echo "<div class='card mt-md-2' style='word-wrap:break-word;'> <div class='card-body'> echo "<div class='card mt-md-2' style='word-wrap:break-word;'>
<h5 class='card-title'>$title</h5> <h5 class='card-subtitle'>($marks marks out of $original_marks)</h6><br> <p class='card-text'>Lecturer feedback $notes &nbsp;&nbsp; $remarking</p> <small>Submitted files: "; <div class='card-body'>
$Sub_result = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID, <h5 class='card-title'>$title</h5>
lab_report_submissions.Student_id sub_std, lab_report_submissions.Course_Group_id, `Attachment1`, <h6 class='card-subtitle'>($marks marks out of $original_marks)</h6><br>
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status, <p class='card-text'>Lecturer feedback $notes &nbsp;&nbsp; $remarking</p>
`Title`,users_table.Full_Name,course_group_members_table.Student_ID <small>Submitted files: ";
FROM `lab_report_submissions` $sub_result = mysqli_query($con,"SELECT Submission_ID, 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
Left JOIN users_table on users_table.Student_ID=lab_report_submissions.Student_id FROM lab_report_submissions
left JOIN course_group_members_table on course_group_members_table.Course_Group_id=lab_report_submissions.Course_Group_id LEFT JOIN users_table ON users_table.Student_ID=lab_report_submissions.Student_id
where Lab_Report_ID=$id and lab_report_submissions.Student_id='$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.Student_id='$student_id'");
if (mysqli_num_rows($Sub_result) == 0) { if (mysqli_num_rows($sub_result) == 0) {
echo "No Attachments found."; echo "None.";
} else { } else {
while($row = mysqli_fetch_assoc($Sub_result)) { while($row = mysqli_fetch_assoc($sub_result)) {
$at1 = $row['Attachment1']; $att1 = $row['Attachment1'];
$at2 = $row['Attachment2']; $att2 = $row['Attachment2'];
$at3 = $row['Attachment3']; $att3 = $row['Attachment3'];
$at4 = $row['Attachment4']; $att4 = $row['Attachment4'];
$full_link = "<a href='~\..\Lab_Report_Submisions\\$at1'>$at1</a>"; $full_link = "<a href='~\..\Download.php?file=$att1'>$att1</a>";
if($at2 != "") { if($att2 != "") {
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at2'>$at2</a>"; $full_link = $full_link."| <a href='~\..\Download.php?file=$att2'>$att2</a>";
} }
if($at3 != "") { if($att3 != "") {
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at3'>$at3</a>"; $full_link = $full_link."| <a href='~\..\Download.php?file=$att3'>$att3</a>";
} }
if($at4 != "") { if($att4 != "") {
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at4'>$at4</a>"; $full_link = $full_link."| <a href='~\..\Download.php?file=$att4'>$att4</a>";
} }
echo $full_link; echo $full_link;