diff --git a/Course.php b/Course.php index 05b3e1f..c469163 100644 --- a/Course.php +++ b/Course.php @@ -152,7 +152,7 @@ include 'Header.php'; $att3 = $row['Attachment_link_3']; $att4 = $row['Attachment_link_4']; $labid = $row['Lab_Report_ID']; - $days_remaining = date_diff(date_create($deadline), date_create())->format('%a days, %h hours, %i minutes'); + $days_remaining = "Days remaining: ".date_diff(date_create($deadline), date_create())->format('%a days, %h hours, %i minutes'); $full_link = "$att1"; if($att2 != "") { @@ -165,6 +165,11 @@ include 'Header.php'; $full_link = $full_link."| $att4"; } + // check if the student has already submitted the assignment + $query_result = mysqli_query($con, "SELECT * FROM lab_report_submissions WHERE Student_id=$student_id AND Lab_Report_ID=$labid"); + if (mysqli_num_rows($query_result) > 0) + $days_remaining = 'You have already submitted this assignment.'; + echo "
$ins
Attachments: $full_link
Posted: $posted Deadline: $deadline
-