Fix bug 195.
parent
1f602e3db2
commit
07ba57eebb
|
@ -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 = "<a href='~\..\Download.php?file=$att1'>$att1</a>";
|
||||
|
||||
if($att2 != "") {
|
||||
|
@ -165,6 +165,11 @@ include 'Header.php';
|
|||
$full_link = $full_link."| <a href='~\..\Download.php?file=$att4'>$att4</a>";
|
||||
}
|
||||
|
||||
// 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 "<div class='card mt-md-2' style='word-wrap: break-word;'>
|
||||
<div class='card-body'>
|
||||
<h5 class='card-title'>$title</h5>
|
||||
|
@ -172,7 +177,7 @@ include 'Header.php';
|
|||
<p class='card-text'> $ins </p>
|
||||
<p> <small>Attachments</small>: $full_link </p>
|
||||
<p class='card-text'> <small> Posted: $posted Deadline: $deadline </small> </p>
|
||||
<div class='alert alert-warning'>Time left: $days_remaining</div>
|
||||
<div class='alert alert-warning'>$days_remaining</div>
|
||||
<p><a href='~\..\SubmitLab.php?id=$labid&url=$url' class='btn btn-primary'>Submit</a></p>
|
||||
</div>
|
||||
</div>";
|
||||
|
|
Loading…
Reference in New Issue