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
31 changes: 22 additions & 9 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']; }


$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 All @@ -148,7 +159,7 @@ function extend_deadline(id) {

echo " <h3><a href='Courses.php?course=".$url."'> Editing Lab Assignment </a></h3>";
?>
<form method='post' enctype='multipart/form-data' action=''>
<form method='post' enctype='multipart/form-data' action='Script.php'>
<input type='hidden' name='frm_uploadlab' value='true' required=''/>
<input type='hidden' name='course_id' value='<?php echo "$id" ?>' required=''/>
<input type='hidden' name='url' value='<?php echo ".$course_url." ?>' required=''/>
Expand All @@ -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 Expand Up @@ -560,13 +574,12 @@ function extend_deadline(id) {

if($faculty=="")
{
echo "<h4> Search Results for Course Code $search</h4><hr>";
echo "<h4> Search Results for Code : $search</h4><hr>";
$result = mysqli_query($con,"SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`,"
. " `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` "
. " , users_table.Full_Name FROM `courses_table` INNER JOIN users_table"
. " ON users_table.User_ID=courses_table.Lecturer_User_ID where Course_Code like '%{$search}%' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)");
. " ON users_table.User_ID=courses_table.Lecturer_User_ID where Course_Code='$search' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)");
}

else
{
echo "<h3> Find Courses under faculty $faculty</h3>";
Expand Down