Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions Courses.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,19 @@ function extend_deadline(id) {
$type = $_POST["type"];
$Deadline = $deadlinedate." ".$deadlinetime;
$date = date("Y-m-d H:i");
$targetfile="";
$targetfile2="";
$targetfile3="";
$targetfile4="";
if($_FILES['attachment1']['name']!=""){ $targetfile = "/".$title."/".$_FILES['attachment1']['name']; }
if($_FILES['attachment2']['name']!=""){ $targetfile2 = "/".$title."/".$_FILES['attachment2']['name']; }
if($_FILES['attachment3']['name']!=""){ $targetfile3 = "/".$title."/".$_FILES['attachment3']['name']; }
if($_FILES['attachment4']['name']!=""){ $targetfile4 = "/".$title."/".$_FILES['attachment4']['name']; }
Comment on lines +134 to +137
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jeannick94

Where will the attachment be stored on the server/computer?

-Hui

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spm2020spring

Happy new year Sir,

On the computer/server, the attachment will be stored in the "Lab_Report_Assignments" folder, and for more details, you can open the following attachments:
LRR3
LRR4

-Jeannick U.


$sql = "UPDATE `lab_reports_table` SET `Deadline` = ('" . $Deadline . "'), `Instructions` = ('" . $instructions . "'), `Title` = ('" . $title . "'), `Marks` = ('" . $marks . "'), `Type` = ('" . $type . "') WHERE `lab_reports_table`.`Lab_Report_ID` = '$getid'";
$sql = "UPDATE `lab_reports_table` SET `Deadline` = ('" . $Deadline . "'), `Instructions` = ('" . $instructions . "'), `Title` = ('" . $title . "'),
`Attachment_link_1` = ('" . $targetfile . "'), `Attachment_link_2` = ('" . $targetfile2 . "'), `Attachment_link_3` = ('" . $targetfile3 . "'),
`Attachment_link_4` = ('" . $targetfile4 . "'), `Marks` = ('" . $marks . "'), `Type` = ('" . $type . "') WHERE `lab_reports_table`.`Lab_Report_ID` = '$getid'";

if ($con->query($sql) === TRUE) {
$_SESSION["info_Updated"]="Assignment information updated successfully.";

Expand Down Expand Up @@ -166,17 +177,20 @@ function extend_deadline(id) {
Marks
<input type='text' name='marks' placeholder='Marks' class='form-control' required='' value="<?php echo isset($_GET['act']) && $_GET['act']=="edit" ? $Marks : ""; ?>">
Attachment 1
<input type='file' name='attachment1' placeholder='Attachment 1' class='form-control'>
<input type='file' name='attachment1' placeholder='Attachment 1' class='form-control' value="<?php echo isset($_GET['act']) && $_GET['act']=="edit" ? $targetfile : ""; ?>">

Attachment 2
<input type='file' name='attachment2' placeholder='Attachment 1' class='form-control'>
<input type='file' name='attachment2' placeholder='Attachment 1' class='form-control' value=" <?php echo isset($_GET['act']) && $_GET['act']=="edit" ? $targetfile2 : ""; ?>">


Attachment 3
<input type='file' name='attachment3' placeholder='Attachment 1' class='form-control' >
<input type='file' name='attachment3' placeholder='Attachment 1' class='form-control' value=" <?php echo isset($_GET['act']) && $_GET['act']=="edit" ? $targetfile3 : ""; ?>">



Attachment 4
<input type='file' name='attachment4' placeholder='Attachment 4' class='form-control' >
<input type='file' name='attachment4' placeholder='Attachment 4' class='form-control' value=" <?php echo isset($_GET['act']) && $_GET['act']=="edit" ? $targetfile4 : ""; ?>">

<br>

<?php
Expand Down