Make student's interface look better.

Bug430-Eden2
Lan Hui 2023-08-09 16:40:26 +08:00
parent a4a413f700
commit 89395dbb98
3 changed files with 576 additions and 595 deletions

View File

@ -10,168 +10,160 @@ include 'Header.php';
<div class="container"> <div class="container">
<?php <?php
$student_id = $_SESSION["user_student_id"]; $student_id = $_SESSION["user_student_id"];
$group_id = $_SESSION["user_group_id"]; $group_id = $_SESSION["user_group_id"];
$c_date = date("Y-m-d H:i"); $c_date = date("Y-m-d H:i");
if(!empty($_GET["url"])) if(!empty($_GET["url"]))
{ {
$course_url = mysqli_real_escape_string($con, $_GET["url"]); $course_url = mysqli_real_escape_string($con, $_GET["url"]);
$result = mysqli_query($con,"SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`," $result = mysqli_query($con,"SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`,"
. " `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` " . " `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` "
. " , users_table.Full_Name FROM `courses_table` INNER JOIN users_table" . " , users_table.Full_Name FROM `courses_table` INNER JOIN users_table"
. " ON users_table.User_ID=courses_table.Lecturer_User_ID where URL='$course_url' "); . " ON users_table.User_ID=courses_table.Lecturer_User_ID where URL='$course_url' ");
if(mysqli_num_rows($result)==0) { if(mysqli_num_rows($result)==0) {
echo "No course matching the given course URL: ".$course_url; echo "No course matching the given course URL: ".$course_url;
} else { } else {
while($row = mysqli_fetch_assoc($result)) { while($row = mysqli_fetch_assoc($result)) {
$name = $row['Course_Name']; $name = $row['Course_Name'];
$code = $row['Course_Code']; $code = $row['Course_Code'];
$faculty = $row['Faculty']; $faculty = $row['Faculty'];
$lecturer = $row['Full_Name']; $lecturer = $row['Full_Name'];
$academic = $row['Academic_Year']; $academic = $row['Academic_Year'];
$url = $row['URL']; $url = $row['URL'];
$course_id = $row['Course_ID']; $course_id = $row['Course_ID'];
// also get teaching assistant names(if any) // also get teaching assistant names(if any)
$ta_result = mysqli_query($con, "SELECT Full_Name FROM users_table where User_ID in (select TA from course_ta where Course_ID='$course_id');"); $ta_result = mysqli_query($con, "SELECT Full_Name FROM users_table where User_ID in (select TA from course_ta where Course_ID='$course_id');");
if (mysqli_num_rows($ta_result) == 0) { if (mysqli_num_rows($ta_result) == 0) {
echo " <div class='alert' style='margin-left:20px;border-bottom:2px solid #1D91EF;'> <a href='~\..\Courses.php?course=$url'> echo " <div class='alert' style='margin-left:20px;border-bottom:2px solid #1D91EF;'> <a href='~\..\Courses.php?course=$url'>
Courses </a> > ($code) $name > Assignments <br> <span style='font-size:8pt'>Faculty: $faculty &nbsp; Year: $academic &nbsp; Lecturer: $lecturer </span> Courses </a> > ($code) $name > Assignments <br> <span style='font-size:8pt'>Faculty: $faculty &nbsp; Year: $academic &nbsp; Lecturer: $lecturer </span></div> ";
</div> "; } else {
} else { $ta_name = "";
$ta_name = ""; while ($row = mysqli_fetch_assoc($ta_result)) {
while ($row = mysqli_fetch_assoc($ta_result)) { $ta_name = $ta_name.$row['Full_Name']." ";
$ta_name = $ta_name.$row['Full_Name']." "; }
} $ta_name = trim ($ta_name);
$ta_name = trim ($ta_name); echo " <div class='alert' style='margin-left:20px;border-bottom:2px solid #1D91EF;'> <a href='~\..\Courses.php?course=$url'>
echo " <div class='alert' style='margin-left:20px;border-bottom:2px solid #1D91EF;'> <a href='~\..\Courses.php?course=$url'>
Courses > $name ($code) > Lab Reports <br> <span style='font-size:8pt'>Faculty: $faculty | Year: $academic | Lecturer: $lecturer | Teaching Assistant: $ta_name </span> Courses > $name ($code) > Lab Reports <br> <span style='font-size:8pt'>Faculty: $faculty | Year: $academic | Lecturer: $lecturer | Teaching Assistant: $ta_name </span>
</a></div> "; </a></div> ";
}
} }
} }
}
}
?>
<div class="row" style='margin-left:20px;float:left'>
<?php
if (isset($_SESSION['info_general'])) {
echo '<hr><div class="alert alert-info" role="alert" style="float:left;">' . $_SESSION['info_general'] . '</div>';
$_SESSION['info_general']=null;
}
if (isset($_SESSION['info_courses'])) {
echo '<hr><div class="alert alert-info" role="alert" style="float:left;">' . $_SESSION['info_courses'] . '</div>';
$_SESSION['info_courses']=null;
} }
?> ?>
</div>
<?php
if( $_SESSION['user_type'] == "Student")
{
?>
<?php <div class="row">
if( $_SESSION['user_type'] == "Student") <div class="col-9">
{
?> <?php
<hr>
<div class="row" style="width:95%;margin:auto; text-align:left;"> if (isset($_SESSION['info_general'])) {
echo '<hr><div class="alert alert-info" role="alert" style="float:left;">' . $_SESSION['info_general'] . '</div>';
$_SESSION['info_general']=null;
}
<div class="col-md-9"> if (isset($_SESSION['info_courses'])) {
echo '<hr><div class="alert alert-info" role="alert" style="float:left;">' . $_SESSION['info_courses'] . '</div>';
$_SESSION['info_courses']=null;
}
?>
<!-- Nav tabs --> <!-- Nav tabs -->
<ul class="nav nav-tabs" id="myTab"> <ul class="nav nav-tabs" id="myTab">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link active" href="#menu1">New</a> <a class="nav-link active" href="#menu1">New</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="#menu2">Missed</a> <a class="nav-link" href="#menu2">Missed</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="#menu3">Submitted</a> <a class="nav-link" href="#menu3">Submitted</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="#menu4">Marked</a> <a class="nav-link" href="#menu4">Marked</a>
</li> </li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div id="menu1" class="tab-pane active"><br>
<?php <div id="menu1" class="tab-pane active">
// Get groups of this students <?php
$sql="SELECT course_group_members_table.Course_Group_id FROM course_group_members_table INNER JOIN course_groups_table ON course_group_members_table.Course_Group_id = course_groups_table.Course_Group_id WHERE course_group_members_table.Student_ID=$student_id and course_groups_table.Course_id=$course_id";
$resultx1 = mysqli_query($con, $sql); // Get groups of this students
while($row = mysqli_fetch_assoc($resultx1)) $sql="SELECT course_group_members_table.Course_Group_id FROM course_group_members_table INNER JOIN course_groups_table ON course_group_members_table.Course_Group_id = course_groups_table.Course_Group_id WHERE course_group_members_table.Student_ID=$student_id and course_groups_table.Course_id=$course_id";
{
$_SESSION['group_id'] = $row['Course_Group_id'];
}
$group_id = $_SESSION['group_id']; $resultx1 = mysqli_query($con, $sql);
while($row = mysqli_fetch_assoc($resultx1))
{
$_SESSION['group_id'] = $row['Course_Group_id'];
}
if($group_id == "") $group_id = $_SESSION['group_id'];
{
$group_id = 0; // no group. If the student has a group, the group number should be greater than 0.
}
// Show the assignment iff the following conditions are met: (1) if($group_id == "")
// Before the deadline (2) Before the students' extended deadline (if any) {
// (3) none of the student's group members have already submitted $group_id = 0; // no group. If the student has a group, the group number should be greater than 0.
// the assignment. }
$sql_stmt = "SELECT Type, Lab_Report_ID, Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, lab_reports_table.Title, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4`". // Show the assignment iff the following conditions are met: (1)
" FROM `lab_reports_table`". // Before the deadline (2) Before the students' extended deadline (if any)
" WHERE Course_ID=$course_id". // (3) none of the student's group members have already submitted
" AND (Deadline > '$c_date' OR Lab_Report_ID IN (SELECT `Lab_Report_ID` FROM `extended_deadlines_table` WHERE Student_ID=$student_id AND Extended_Deadline_Date > '$c_date' AND Lab_Report_ID IN (SELECT Lab_Report_ID FROM lab_reports_table WHERE Course_ID=$course_id)))". // the assignment.
" AND Lab_Report_ID NOT IN (SELECT Lab_Report_ID FROM lab_report_submissions WHERE Course_Group_id IN (SELECT Course_Group_id FROM course_group_members_table WHERE Student_ID=$student_id))".
" ORDER BY Lab_Report_ID DESC";
$result1 = mysqli_query($con, $sql_stmt); $sql_stmt = "SELECT Type, Lab_Report_ID, Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, lab_reports_table.Title, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4`".
" FROM `lab_reports_table`".
" WHERE Course_ID=$course_id".
" AND (Deadline > '$c_date' OR Lab_Report_ID IN (SELECT `Lab_Report_ID` FROM `extended_deadlines_table` WHERE Student_ID=$student_id AND Extended_Deadline_Date > '$c_date' AND Lab_Report_ID IN (SELECT Lab_Report_ID FROM lab_reports_table WHERE Course_ID=$course_id)))".
" AND Lab_Report_ID NOT IN (SELECT Lab_Report_ID FROM lab_report_submissions WHERE Course_Group_id IN (SELECT Course_Group_id FROM course_group_members_table WHERE Student_ID=$student_id))".
" ORDER BY Lab_Report_ID DESC";
if(mysqli_num_rows($result1)==0) $result1 = mysqli_query($con, $sql_stmt);
{
echo "<div class='alert alert-info'>No active assignments now.</div>";
} else {
while($row = mysqli_fetch_assoc($result1)) { if(mysqli_num_rows($result1)==0)
$title=$row['Title']; {
$type=$row['Type']; echo "<div class='alert alert-info'>No active assignments now.</div>";
$Marks=$row['Marks']; } else {
$ins=$row['Instructions'];
$posted=$row['Posted_Date'];
$deadline=$row['Deadline'];
$att1=$row['Attachment_link_1'];
$att2=$row['Attachment_link_2'];
$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');
$full_link = "<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>";
if($att2!=""){ while($row = mysqli_fetch_assoc($result1)) {
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att2'>$att2</a>"; $title=$row['Title'];
} $type=$row['Type'];
if($att3!=""){ $Marks=$row['Marks'];
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att3'>$att3</a>"; $ins=$row['Instructions'];
} $posted=$row['Posted_Date'];
$deadline=$row['Deadline'];
$att1=$row['Attachment_link_1'];
$att2=$row['Attachment_link_2'];
$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');
$full_link = "<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>";
if($att4!=""){ if($att2!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>"; $full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att2'>$att2</a>";
} }
echo "<div class='card' style='word-wrap: break-word;'><div class='card-body'> if($att3!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att3'>$att3</a>";
}
if($att4!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>";
}
echo "<div class='card' style='word-wrap: break-word;'><div class='card-body'>
<h5 class='card-title'>$title</h5> <h6 class='card-subtitle''>($Marks Marks, $type)</h6> <br> <p class='card-text'> $ins </p> <h5 class='card-title'>$title</h5> <h6 class='card-subtitle''>($Marks Marks, $type)</h6> <br> <p class='card-text'> $ins </p>
<p> <small>Attachments</small>: $full_link </p> <p> <small>Attachments</small>: $full_link </p>
<p class='card-text'> <small> Posted: $posted &nbsp;&nbsp; Deadline: $deadline </small> </p> <p class='card-text'> <small> Posted: $posted &nbsp;&nbsp; Deadline: $deadline </small> </p>
@ -179,131 +171,130 @@ if( $_SESSION['user_type'] == "Student")
<p><a href='~\..\SubmitLab.php?id=$labid&url=$url' class='btn btn-primary'>Submit</a></p> <p><a href='~\..\SubmitLab.php?id=$labid&url=$url' class='btn btn-primary'>Submit</a></p>
</div></div>"; </div></div>";
}} }}
echo ""; echo "";
?> ?>
</div> </div>
<div id="menu2" class="tab-pane"><br> <div id="menu2" class="tab-pane">
<?php <?php
$group_id=$_SESSION['group_id']; $group_id=$_SESSION['group_id'];
if($group_id == ""){$group_id = -1;} // Individual assignment does not require the student to have a group id. Therefore, the group is an empty string. To make the following SQL statement work properly, initialize the group id to -1. if($group_id == ""){$group_id = -1;} // Individual assignment does not require the student to have a group id. Therefore, the group is an empty string. To make the following SQL statement work properly, initialize the group id to -1.
$result = mysqli_query($con,"SELECT Lab_Report_ID,Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, lab_reports_table.Title, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4` $result = mysqli_query($con,"SELECT Lab_Report_ID,Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, lab_reports_table.Title, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4`
FROM `lab_reports_table` FROM `lab_reports_table`
WHERE WHERE
Lab_Report_ID not in (select Lab_Report_ID from lab_report_submissions where (Student_id=$student_id or Course_Group_id=$group_id)) and Course_ID=$course_id and Deadline < '$c_date'" Lab_Report_ID not in (select Lab_Report_ID from lab_report_submissions where (Student_id=$student_id or Course_Group_id=$group_id)) and Course_ID=$course_id and Deadline < '$c_date'"
. "" . ""
. "" . ""
. "" . ""
. "" . ""
. "" . ""
. "" . ""
. "ORDER by Lab_Report_ID DESC"); . "ORDER by Lab_Report_ID DESC");
if(mysqli_num_rows($result)==0) if(mysqli_num_rows($result)==0)
{ {
echo '<div class="alert alert-info">You missed no lab reports.</div>'; echo '<div class="alert alert-info">You missed no lab reports.</div>';
} else { } else {
while($row = mysqli_fetch_assoc($result)) { while($row = mysqli_fetch_assoc($result)) {
$title=$row['Title']; $title=$row['Title'];
$marks=$row['Marks']; $marks=$row['Marks'];
$ins=$row['Instructions']; $ins=$row['Instructions'];
$posted=$row['Posted_Date']; $posted=$row['Posted_Date'];
$deadline=$row['Deadline']; $deadline=$row['Deadline'];
$att1=$row['Attachment_link_1']; $att1=$row['Attachment_link_1'];
$att2=$row['Attachment_link_2']; $att2=$row['Attachment_link_2'];
$att3=$row['Attachment_link_3']; $att3=$row['Attachment_link_3'];
$att4=$row['Attachment_link_4']; $att4=$row['Attachment_link_4'];
$id=$row['Lab_Report_ID']; $id=$row['Lab_Report_ID'];
$full_link="<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>"; $full_link="<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>";
if($att2!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att2'>$att2</a>";
}
if($att3!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att3'>$att3</a>";
}
if($att4!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>";
}
echo "<div class='card' style='word-wrap: break-word;'> <div class='card-body'> <span class='btn btn-sm btn-outline-danger'>MISSED</span> <h5 class='card-title'>$title</h5> <h6 class='card-subtitle'>($marks Marks)</h6> <br/> <p class='card-text'> $ins</p>
<br> <p class='card-text'> <small> Posted: $posted &nbsp;&nbsp;&nbsp; Deadline: $deadline &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br> Attachments: $full_link </small></p>
</div></div><br>";
if($att2!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att2'>$att2</a>";
}
if($att3!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att3'>$att3</a>";
} }
}
?>
if($att4!=""){ </div>
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>";
}
;
echo "<div class='btn btn-default break-word' style='dislay:block; word-wrap: break-word; border: 1px solid #F0F0F0;border-left: 4px solid #03407B;'><span class='btn btn-sm btn-outline-danger' style='margin-left:0px;'>MISSED</span> $title ($marks Marks) <br> <span style='font-size:8pt'> $ins</span>
<br> <span style='font-size:8pt'>Posted: $posted<br> Deadline: $deadline &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br> Attachments : $full_link </span>
</div>";
}}
echo "";
?>
</div>
<div id="menu3" class="tab-pane"><br> <div id="menu3" class="tab-pane">
<?php <?php
$group_id = $_SESSION['group_id']; $group_id = $_SESSION['group_id'];
if($group_id==""){$group_id=-1;} // This fixes "Submitted report not shown" http://118.25.96.118/bugzilla/show_bug.cgi?id=176 if($group_id==""){$group_id=-1;} // This fixes "Submitted report not shown" http://118.25.96.118/bugzilla/show_bug.cgi?id=176
$sql_stmt = "SELECT Lab_Report_ID, Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, lab_reports_table.Title, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4` $sql_stmt = "SELECT Lab_Report_ID, Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, lab_reports_table.Title, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4`
FROM `lab_reports_table` FROM `lab_reports_table`
WHERE Lab_Report_ID in (select Lab_Report_ID from lab_report_submissions" WHERE Lab_Report_ID in (select Lab_Report_ID from lab_report_submissions"
. " where Status='Pending' and (Student_id=$student_id or Course_Group_id=$group_id) and Course_ID=$course_id) ORDER by Lab_Report_ID DESC"; . " where Status='Pending' and (Student_id=$student_id or Course_Group_id=$group_id) and Course_ID=$course_id) ORDER by Lab_Report_ID DESC";
$resultx = mysqli_query($con, $sql_stmt); $resultx = mysqli_query($con, $sql_stmt);
if(mysqli_num_rows($resultx)==0) if(mysqli_num_rows($resultx)==0)
{ {
echo '<div class="alert alert-info">You have no unmarked submissions. Check the Marked tab for your marked submissions (if any).</div>'; echo '<div class="alert alert-info">You have no unmarked submissions. Check the Marked tab for your marked submissions (if any).</div>';
} else { } else {
while($row = mysqli_fetch_assoc($resultx)) { while($row = mysqli_fetch_assoc($resultx)) {
$lab_repo_id=$row['Lab_Report_ID']; $lab_repo_id=$row['Lab_Report_ID'];
$title=$row['Title']; $title=$row['Title'];
$marks=$row['Marks']; $marks=$row['Marks'];
$ins=$row['Instructions']; $ins=$row['Instructions'];
$posted=$row['Posted_Date']; $posted=$row['Posted_Date'];
$deadline=$row['Deadline']; $deadline=$row['Deadline'];
$att1=$row['Attachment_link_1']; $att1=$row['Attachment_link_1'];
$att2=$row['Attachment_link_2']; $att2=$row['Attachment_link_2'];
$att3=$row['Attachment_link_3']; $att3=$row['Attachment_link_3'];
$att4=$row['Attachment_link_4']; $att4=$row['Attachment_link_4'];
$id = $row['Lab_Report_ID']; $id = $row['Lab_Report_ID'];
if( $c_date < $deadline) if( $c_date < $deadline)
{ {
$submittedx="<a href='~\..\SubmitLab.php?id=$id&url=$url' class='btn btn-sm btn-light'>Re-submit</a>"; $submittedx="<a href='~\..\SubmitLab.php?id=$id&url=$url' class='btn btn-sm btn-light'>Re-submit</a>";
} }
$full_link = "<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>"; $full_link = "<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>";
if($att2!=""){ if($att2!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att2'>$att2</a>"; $full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att2'>$att2</a>";
} }
if($att3!=""){ if($att3!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att3'>$att3</a>"; $full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att3'>$att3</a>";
} }
if($att4!=""){ if($att4!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>"; $full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>";
} }
echo " <k href='#'> <div class='btn btn-default break-word' style='dislay:block; word-wrap: break-word; border: 1px solid #F0F0F0;border-left: 4px solid #03407B;'> echo "<div class='btn btn-default break-word' style='dislay:block; word-wrap: break-word; border: 1px solid #F0F0F0;border-left: 4px solid #03407B;'>
$title ($marks Marks) <i class='fa fa-check-circle'></i> Submitted <br> <span style='font-size:8pt'> $ins</span> $title ($marks Marks) <i class='fa fa-check-circle'></i> Submitted <br> <span style='font-size:8pt'> $ins</span>
<br> <span style='font-size:9pt'>Posted:$posted &nbsp; Deadline:$deadline</span> &nbsp; &nbsp; &nbsp; $submittedx &nbsp; <br> <span style='font-size:9pt'>Posted: $posted &nbsp; Deadline: $deadline</span> &nbsp; &nbsp; &nbsp; $submittedx &nbsp;
<br> <span style='font-size:9pt'>Submitted files: "; <br> <span style='font-size:9pt'>Submitted files: ";
$Sub_result = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID, $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`, lab_report_submissions.Student_id sub_std, lab_report_submissions.Course_Group_id, `Attachment1`,
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status, `Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status,
`Title`,users_table.Full_Name,course_group_members_table.Student_ID `Title`,users_table.Full_Name,course_group_members_table.Student_ID
@ -312,116 +303,114 @@ Left JOIN users_table on users_table.Student_ID=lab_report_submissions.Student_
left JOIN course_group_members_table on course_group_members_table.Course_Group_id=lab_report_submissions.Course_Group_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=$lab_repo_id and (lab_report_submissions.Student_id='$student_id')"); where Lab_Report_ID=$lab_repo_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 "No Attachments found.";
} else { } else {
while($row = mysqli_fetch_assoc($Sub_result)) { while($row = mysqli_fetch_assoc($Sub_result)) {
$at1=$row['Attachment1']; $at1=$row['Attachment1'];
$at2=$row['Attachment2']; $at2=$row['Attachment2'];
$at3=$row['Attachment3']; $at3=$row['Attachment3'];
$at4=$row['Attachment4']; $at4=$row['Attachment4'];
$base_at1 = basename($at1); $base_at1 = basename($at1);
$base_at2 = basename($at2); $base_at2 = basename($at2);
$base_at3 = basename($at3); $base_at3 = basename($at3);
$base_at4 = basename($at4); $base_at4 = basename($at4);
$full_link = "<a href='~\..\Download.php?file=$at1&attachment=1'>$base_at1</a>"; // prevent students from directly accessing their classmates' submissions $full_link = "<a href='~\..\Download.php?file=$at1&attachment=1'>$base_at1</a>"; // prevent students from directly accessing their classmates' submissions
if($at2!=""){
$full_link= $full_link." | <a href='~\..\Download.php?file=$at2&attachment=2'>$base_at2</a>";
}
if($at3!=""){
$full_link= $full_link." | <a href='~\..\Download.php?file=$at3&attachment=3'>$base_at3</a>";
}
if($at4!=""){
$full_link= $full_link." | <a href='~\..\Download.php?file=$at4&attachment=4'>$base_at4</a>";
}
echo $full_link;
if($at2!=""){
$full_link= $full_link." | <a href='~\..\Download.php?file=$at2&attachment=2'>$base_at2</a>";
} }
if($at3!=""){
$full_link= $full_link." | <a href='~\..\Download.php?file=$at3&attachment=3'>$base_at3</a>";
}
if($at4!=""){
$full_link= $full_link." | <a href='~\..\Download.php?file=$at4&attachment=4'>$base_at4</a>";
}
echo $full_link;
} }
}
echo "</span></div></k>"; echo "</span></div>";
}} }}
echo ""; echo "";
?>
</div>
<?php
$sqli=mysqli_query($con, "SELECT * from course_groups_table WHERE Course_Group_id=$group_id and Course_id=$course_id");
while($row = mysqli_fetch_assoc($sqli)) { $Group_Leader=$row['Group_Leader'];
$Group_Member=$row['Group_Member'];
$Group_Member2=$row['Group_Member2'];
$Group_Member3=$row['Group_Member3'];
$Group_Member4=$row['Group_Member4'];
}
?> ?>
</div>
<div id="menu4" class="tab-pane">
<?php
<?php $resultx = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_reports_table.`Lab_Report_ID`, `Student_id`, "
$sqli=mysqli_query($con, "SELECT * from course_groups_table WHERE Course_Group_id=$group_id and Course_id=$course_id"); . "`Course_Group_id`, `Notes`, lab_report_submissions.`Marks`,
while($row = mysqli_fetch_assoc($sqli))
{ $Group_Leader=$row['Group_Leader'];
$Group_Member=$row['Group_Member'];
$Group_Member2=$row['Group_Member2'];
$Group_Member3=$row['Group_Member3'];
$Group_Member4=$row['Group_Member4'];
}
?>
<div id="menu4" class="tab-pane"><br>
<?php
$resultx = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_reports_table.`Lab_Report_ID`, `Student_id`, "
. "`Course_Group_id`, `Notes`, lab_report_submissions.`Marks`,
lab_report_submissions.Remarking_Reason, lab_report_submissions.Remarking_Reason,
`Status`, lab_reports_table.Title Lab_Title,lab_reports_table.Marks Original_marks FROM `lab_report_submissions` " `Status`, lab_reports_table.Title Lab_Title,lab_reports_table.Marks Original_marks FROM `lab_report_submissions` "
. "INNER JOIN lab_reports_table on lab_reports_table.Lab_Report_ID=lab_report_submissions.Lab_Report_ID " . "INNER JOIN lab_reports_table on lab_reports_table.Lab_Report_ID=lab_report_submissions.Lab_Report_ID "
. "WHERE (lab_report_submissions.Student_id='$student_id' . "WHERE (lab_report_submissions.Student_id='$student_id'
or (lab_report_submissions.Student_id='$Group_Leader' and lab_report_submissions.Course_Group_id='$group_id') or (lab_report_submissions.Student_id='$Group_Leader' and lab_report_submissions.Course_Group_id='$group_id')
or (lab_report_submissions.Student_id='$Group_Member' and lab_report_submissions.Course_Group_id='$group_id') or (lab_report_submissions.Student_id='$Group_Member' and lab_report_submissions.Course_Group_id='$group_id')
or (lab_report_submissions.Student_id='$Group_Member2' and lab_report_submissions.Course_Group_id='$group_id') or (lab_report_submissions.Student_id='$Group_Member2' and lab_report_submissions.Course_Group_id='$group_id')
or (lab_report_submissions.Student_id='$Group_Member3' and lab_report_submissions.Course_Group_id='$group_id') or (lab_report_submissions.Student_id='$Group_Member3' and lab_report_submissions.Course_Group_id='$group_id')
or (lab_report_submissions.Student_id='$Group_Member4' and lab_report_submissions.Course_Group_id='$group_id') or (lab_report_submissions.Student_id='$Group_Member4' and lab_report_submissions.Course_Group_id='$group_id')
)and" )and"
. "" . ""
. "" . ""
. "" . ""
. " lab_reports_table.Lab_Report_ID in (select Lab_Report_ID from lab_report_submissions" . " lab_reports_table.Lab_Report_ID in (select Lab_Report_ID from lab_report_submissions"
. " where (Status='Marked' or Status='Remarking') and (Student_id=$student_id or Course_Group_id=$group_id) and Course_ID=$course_id) ORDER by Submission_ID DESC"); . " where (Status='Marked' or Status='Remarking') and (Student_id=$student_id or Course_Group_id=$group_id) and Course_ID=$course_id) ORDER by Submission_ID DESC");
if(mysqli_num_rows($resultx)==0) if(mysqli_num_rows($resultx)==0) {
{ echo '<div class="alert alert-info">You have no marked submissions.</div>';
echo '<div class="alert alert-info">You have no marked submissions.</div>'; } else {
while($row = mysqli_fetch_assoc($resultx)) {
$title=$row['Lab_Title'];
$marks=$row['Marks'];
$Originalmarks=$row['Original_marks'];
$ins=$row['Instructions'];
$posted=$row['Posted_Date'];
$deadline=$row['Deadline'];
$att1=$row['Attachment_link_1'];
$att2=$row['Attachment_link_2'];
$att3=$row['Attachment_link_3'];
$att4=$row['Attachment_link_4'];
$id=$row['Lab_Report_ID'];
$Submission_ID=$row['Submission_ID'];
$notes=$row['Notes'];
$status= $row['Status'];
$remarking_reason=$row['Remarking_Reason'];
} else { while($row = mysqli_fetch_assoc($resultx)) { if($status=='Marked') {
$title=$row['Lab_Title']; $rm_data="\Script.php?remarking=yes&id=$Submission_ID&url=$url&status=Remarking";
$marks=$row['Marks']; $remarking="<button onclick='remarking(\"$rm_data\")' class='btn btn-sm btn-light'>Request remarking</button>";
$Originalmarks=$row['Original_marks']; }
$ins=$row['Instructions'];
$posted=$row['Posted_Date'];
$deadline=$row['Deadline'];
$att1=$row['Attachment_link_1'];
$att2=$row['Attachment_link_2'];
$att3=$row['Attachment_link_3'];
$att4=$row['Attachment_link_4'];
$id=$row['Lab_Report_ID'];
$Submission_ID=$row['Submission_ID'];
$notes=$row['Notes'];
$status= $row['Status'];
$remarking_reason=$row['Remarking_Reason'];
if($status=='Marked')
{
$rm_data="\Script.php?remarking=yes&id=$Submission_ID&url=$url&status=Remarking";
$remarking="<button onclick='remarking(\"$rm_data\")' class='btn btn-sm btn-light'>Request remarking</button>";
}
if($status=='Remarking')
{
$remarking="<span style='color:orange'><i class='fa fa-info-circle'></i> Remarking request sent </span> <br> Reasons for remarking: <i>$remarking_reason </i> <br>";
} if($status=='Remarking') {
$remarking="<span style='color:orange'><i class='fa fa-info-circle'></i> Remarking request sent </span> <br> Reasons for remarking: <i>$remarking_reason </i> <br>";
}
echo "<div class='card' style='word-wrap:break-word;'> <div class='card-body'> echo "<div class='card' style='word-wrap:break-word;'> <div class='card-body'>
<h5 class='card-title'>$title</h5> <h5 class='card-subtitle'>($marks marks out of $Originalmarks)</h6><br> <p class='card-text'>Lecturer feedback $notes &nbsp;&nbsp; $remarking</p> <small>Submitted files: "; <h5 class='card-title'>$title</h5> <h5 class='card-subtitle'>($marks marks out of $Originalmarks)</h6><br> <p class='card-text'>Lecturer feedback $notes &nbsp;&nbsp; $remarking</p> <small>Submitted files: ";
$Sub_result = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID, $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`, lab_report_submissions.Student_id sub_std, lab_report_submissions.Course_Group_id, `Attachment1`,
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status, `Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status,
`Title`,users_table.Full_Name,course_group_members_table.Student_ID `Title`,users_table.Full_Name,course_group_members_table.Student_ID
@ -430,131 +419,127 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
left JOIN course_group_members_table on course_group_members_table.Course_Group_id=lab_report_submissions.Course_Group_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'"); 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 "No Attachments found."; } else {
while($row = mysqli_fetch_assoc($Sub_result)) {
$at1=$row['Attachment1'];
$at2=$row['Attachment2'];
$at3=$row['Attachment3'];
$at4=$row['Attachment4'];
} else { while($row = mysqli_fetch_assoc($Sub_result)) { $full_link="<a href='~\..\Lab_Report_Submisions\\$at1'>$at1</a>";
$at1=$row['Attachment1'];
$at2=$row['Attachment2'];
$at3=$row['Attachment3'];
$at4=$row['Attachment4'];
$full_link="<a href='~\..\Lab_Report_Submisions\\$at1'>$at1</a>"; if($at2!="") {
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at2'>$at2</a>";
}
if($at3!="") {
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at3'>$at3</a>";
}
if($at2!=""){ if($at4!="") {
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at2'>$at2</a>"; $full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at4'>$at4</a>";
}
echo $full_link;
}
}
echo "</small></div></div>"; // This statement's position must be correct. Otherwise, the "My groups" part won't be placed correctly.
} }
if($at3!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at3'>$at3</a>";
}
if($at4!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at4'>$at4</a>";
}
echo $full_link;
}
} }
?>
}} </div> <!-- Closing menu4 -->
echo "</small></div></div>"; </div> <!-- Closing tab-content -->
?> </div> <!-- Closing col-9 -->
</div> <div class="col-3">
</div> <h1 class="display-6">My groups</h1>
</div> <?php
$resultx1 = mysqli_query($con,"SELECT `Course_Group_id` FROM `course_groups_table` WHERE Course_id=$course_id");
while($row = mysqli_fetch_assoc($resultx1)) {$count_groups=$row['Course_Group_id'];}
echo " <button onclick='createGroup()' class='btn btn-primary'>Create group</button>";
?>
<br><br><br><br><br><br><br><br><br> <hr>
<div class="col-md-3">
<h3>My groups</h3>
<?php <?php
$resultx1 = mysqli_query($con,"SELECT `Course_Group_id` FROM `course_groups_table` WHERE Course_id=$course_id");
while($row = mysqli_fetch_assoc($resultx1)) {$count_groups=$row['Course_Group_id'];}
$result = mysqli_query($con," SELECT `ID`, course_group_members_table.Course_Group_id, `Student_ID`,
echo " <button onclick='createGroup()' class='btn btn-primary'>Create group</button>";
?>
<hr>
<?php
$result = mysqli_query($con," SELECT `ID`, course_group_members_table.Course_Group_id, `Student_ID`,
`Status`,course_groups_table.Group_Name,course_groups_table.Course_id `Status`,course_groups_table.Group_Name,course_groups_table.Course_id
FROM `course_group_members_table` INNER JOIN course_groups_table on FROM `course_group_members_table` INNER JOIN course_groups_table on
course_groups_table.Course_Group_id=course_group_members_table.Course_Group_id WHERE Student_id=$student_id and course_groups_table.Course_id=$course_id"); course_groups_table.Course_Group_id=course_group_members_table.Course_Group_id WHERE Student_id=$student_id and course_groups_table.Course_id=$course_id");
if(mysqli_num_rows($result)==0) if(mysqli_num_rows($result)==0)
{
echo "You have no group in this course.";
} else { while($row = mysqli_fetch_assoc($result)) {
$name=$row['Group_Name'];
$id=$row['Course_Group_id'];
$status=$row['Status'];
$extra=" - <a href='#' class='' onclick='invite($id)'> Invite Others</a></small>";
if($status=="Invited")
{ {
$extra2=" <a href='#' class='' onclick='accept($id,1)'>Accept</a></small>"; echo "You have no group in this course.";
$extra3=" <a href='#' class='' onclick='accept($id,0)'>Decline</a></small>"; } else {
while($row = mysqli_fetch_assoc($result)) {
$name=$row['Group_Name'];
$id=$row['Course_Group_id'];
$status=$row['Status'];
}
# Add "delete group" button and allow only group creator to delete it $extra=" - <a href='#' class='' onclick='invite($id)'> Invite Others</a></small>";
$extra4 = "<button onclick='deleteGroup($id)' class='btn btn-sm btn-danger'>Delete group</button>";
echo "<div class='btn-default'><small> $name ($status) $extra $extra2 $extra3" . if($status=="Invited")
(($status == "Created")? "$extra4": "") {
."</small></div>"; $extra2=" <a href='#' class='' onclick='accept($id,1)'>Accept</a></small>";
$extra3=" <a href='#' class='' onclick='accept($id,0)'>Decline</a></small>";
$rs2=mysqli_query($con,"SELECT `ID`, `Course_Group_id`, course_group_members_table.Student_ID, }
# Add "delete group" button and allow only group creator to delete it
$extra4 = "<button onclick='deleteGroup($id)' class='btn btn-sm btn-danger'>Delete group</button>";
echo "<ul class='list-group'>";
echo "<li class='list-group-item'><b>$name</b> ($status) $extra $extra2 $extra3" .
(($status == "Created")? "$extra4": "")
."</li>";
$rs2=mysqli_query($con,"SELECT `ID`, `Course_Group_id`, course_group_members_table.Student_ID,
course_group_members_table.`Status`,users_table.Full_Name FROM `course_group_members_table` course_group_members_table.`Status`,users_table.Full_Name FROM `course_group_members_table`
INNER JOIN users_table on users_table.Student_ID=course_group_members_table.Student_ID INNER JOIN users_table on users_table.Student_ID=course_group_members_table.Student_ID
where course_group_members_table.Course_Group_id=$id"); where course_group_members_table.Course_Group_id=$id");
#Check whether the current user in session is the creator of the group #Check whether the current user in session is the creator of the group
$rs3 = mysqli_query($con, "SELECT `Status` from course_group_members_table where Student_ID = $student_id"); $rs3 = mysqli_query($con, "SELECT `Status` from course_group_members_table where Student_ID = $student_id");
$flag = mysqli_fetch_assoc($rs3)['Status'] == "Created"; $flag = mysqli_fetch_assoc($rs3)['Status'] == "Created";
while($row = mysqli_fetch_assoc($rs2)) { while($row = mysqli_fetch_assoc($rs2)) {
$name=$row['Full_Name']; $name=$row['Full_Name'];
$id=$row['Course_Group_id']; $id=$row['Course_Group_id'];
$status=$row['Status']; $status=$row['Status'];
$Student_ID=$row['Student_ID']; $Student_ID=$row['Student_ID'];
#Show group members + remove button next to each member except the creator of the group #Show group members + remove button next to each member except the creator of the group
if($flag){ if($flag){
echo "<li>$name - $Student_ID ($status)&nbsp;".(($status != "Created")?"<button onclick='removeMember($Student_ID, $id)' echo "<li class='list-group-item'>$name - $Student_ID ($status)&nbsp;".(($status != "Created")?"<button onclick='removeMember($Student_ID, $id)'
class='btn btn-sm btn-warning'>Kick out</button>":"")."</li>"; class='btn btn-sm btn-warning'>Kick out</button>":"")."</li>";
}else{ } else{
echo "<li><small> $name - $Student_ID ($status)</small>"; echo "<li class='list-group-item'><small> $name - $Student_ID ($status)</small>";
} }
}
echo "<ul>";
}
} }
?>
} </div>
}
?>
</div> </div>
</div> <?php
}
<?php ?>
}
?>
</div> </div>
<script src="./css/jquery-1.11.1.min.js"></script> <script src="./css/jquery-1.11.1.min.js"></script>
<script src="./css/jquery-ui.min.js"></script> <script src="./css/jquery-ui.min.js"></script>
<link rel="stylesheet" href="./css/jquery-ui.css" /> <link rel="stylesheet" href="./css/jquery-ui.css" />
@ -570,11 +555,11 @@ where course_group_members_table.Course_Group_id=$id");
title:'Create a group', title:'Create a group',
buttons: { buttons: {
'Create': function () { 'Create': function () {
$('#frm').submit(); $('#frm').submit();
$(this).dialog('close'); $(this).dialog('close');
}, },
'Cancel': function () { 'Cancel': function () {
$(this).dialog('close'); $(this).dialog('close');
} }
} }
@ -596,13 +581,13 @@ where course_group_members_table.Course_Group_id=$id");
title:'Invite Students to Group', title:'Invite Students to Group',
buttons: { buttons: {
'Invite': function () { 'Invite': function () {
$('#frm').submit(); $('#frm').submit();
$(this).dialog('close'); $(this).dialog('close');
}, },
'Cancel': function () { 'Cancel': function () {
$(this).dialog('close'); $(this).dialog('close');
} }
} }
@ -625,13 +610,13 @@ where course_group_members_table.Course_Group_id=$id");
title:'Respond to Group Invite', title:'Respond to Group Invite',
buttons: { buttons: {
'Confirm': function () { 'Confirm': function () {
$('#frm').submit(); $('#frm').submit();
$(this).dialog('close'); $(this).dialog('close');
}, },
'Cancel': function () { 'Cancel': function () {
$(this).dialog('close'); $(this).dialog('close');
} }
} }
@ -662,11 +647,11 @@ where course_group_members_table.Course_Group_id=$id");
title:'Kick out '+student_id+'?', title:'Kick out '+student_id+'?',
buttons: { buttons: {
'Yes': function () { 'Yes': function () {
$('#frm').submit(); $('#frm').submit();
$(this).dialog('close'); $(this).dialog('close');
}, },
'No': function () { 'No': function () {
$(this).dialog('close'); $(this).dialog('close');
} }
} }
@ -687,11 +672,11 @@ where course_group_members_table.Course_Group_id=$id");
title:'Delete this group?', title:'Delete this group?',
buttons: { buttons: {
'Yes': function () { 'Yes': function () {
$('#frm').submit(); $('#frm').submit();
$(this).dialog('close'); $(this).dialog('close');
}, },
'No': function () { 'No': function () {
$(this).dialog('close'); $(this).dialog('close');
} }
} }

View File

@ -639,7 +639,7 @@ INNER JOIN course_students_table on course_students_table.Course_ID=courses_tabl
</div> </div>
<div class='col-md-2'> <br> <div class='col-md-2'> <br>
<input type='submit' class='btn btn-primary' value='Find'> <button type='submit' class='btn btn-primary'>Find</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -9,121 +9,117 @@ include 'Header.php';
<div class="container"> <div class="container">
<div class='row'> <div class='row'>
<?php <?php
$c_date = date("Y-m-d H:i"); $c_date = date("Y-m-d H:i");
$student_id = $_SESSION["user_student_id"]; $student_id = $_SESSION["user_student_id"];
if(!empty($_GET["id"])) if(!empty($_GET["id"]))
{
$id = mysqli_real_escape_string($con, $_GET["id"]);
$url = mysqli_real_escape_string($con, $_GET["url"]);
$result1 = mysqli_query($con," SELECT `Type`, `Lab_Report_ID`, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4` FROM `lab_reports_table` WHERE Lab_Report_ID=$id and Deadline > '$c_date' ORDER by Lab_Report_ID DESC");
if(mysqli_num_rows($result1) == 0)
{ {
echo "No active assignments for this course so far."; $id = mysqli_real_escape_string($con, $_GET["id"]);
$url = mysqli_real_escape_string($con, $_GET["url"]);
} else { $result1 = mysqli_query($con," SELECT `Type`, `Lab_Report_ID`, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4` FROM `lab_reports_table` WHERE Lab_Report_ID=$id and Deadline > '$c_date' ORDER by Lab_Report_ID DESC");
if(mysqli_num_rows($result1) == 0)
{
echo "No active assignments for this course so far.";
while($row = mysqli_fetch_assoc($result1)) { } else {
$Course_ID = $row['Course_ID']; while($row = mysqli_fetch_assoc($result1)) {
$title = $row['Title'];
$ins = $row['Instructions'];
$posted = $row['Posted_Date'];
$deadline = $row['Deadline'];
$att1 = $row['Attachment_link_1'];
$att2 = $row['Attachment_link_2'];
$att3 = $row['Attachment_link_3'];
$att4 = $row['Attachment_link_4'];
$labid = $row['Lab_Report_ID'];
$type = $row['Type'];
//----------------------------------Giving both the Group Admin and Group Members same priviledges to submit assignment-------------------------------------- $Course_ID = $row['Course_ID'];
if($type=="Group"){ $title = $row['Title'];
$resultx1 = mysqli_query($con,"SELECT Course_Group_id FROM `course_groups_table` WHERE (Course_id=$Course_ID) and ((Group_Member=$student_id ) or (Group_Member2=$student_id ) or (Group_Member3=$student_id ) or (Group_Member4=$student_id ) or (Group_Leader=$student_id))"); $ins = $row['Instructions'];
while($row = mysqli_fetch_assoc($resultx1)) { $posted = $row['Posted_Date'];
$_SESSION["Group_ID"] = $row['Course_Group_id']; $deadline = $row['Deadline'];
} $att1 = $row['Attachment_link_1'];
$att2 = $row['Attachment_link_2'];
$att3 = $row['Attachment_link_3'];
$att4 = $row['Attachment_link_4'];
$labid = $row['Lab_Report_ID'];
$type = $row['Type'];
//----------------------------------Giving both the Group Admin and Group Members same priviledges to submit assignment--------------------------------------
if($type=="Group"){
$resultx1 = mysqli_query($con,"SELECT Course_Group_id FROM `course_groups_table` WHERE (Course_id=$Course_ID) and ((Group_Member=$student_id ) or (Group_Member2=$student_id ) or (Group_Member3=$student_id ) or (Group_Member4=$student_id ) or (Group_Leader=$student_id))");
while($row = mysqli_fetch_assoc($resultx1)) {
$_SESSION["Group_ID"] = $row['Course_Group_id'];
}
if($_SESSION["Group_ID"] < 1)
{
echo" <center><h3> This Lab report can only be submitted by Group Admin </h3> </center> ";
return;
}
}
$full_link="<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>";
if($att2!=""){
$full_link = $full_link."| <a href='~\..\Lab_Report_Assignments\\$att2'>$att2</a>";
}
if($att3!=""){
$full_link = $full_link."| <a href='~\..\Lab_Report_Assignments\\$att3'>$att3</a>";
}
if($att4!=""){
$full_link = $full_link."| <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>";
}
echo "<div><a href='~\..\Courses.php?course=$url'> Courses > $url > Submit > $title </a></div>";
if($_SESSION["Group_ID"] < 1)
{
echo" <center><h3> This Lab report can only be submitted by Group Admin </h3> </center> ";
return;
}
} }
}
$full_link="<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>";
if($att2!=""){
$full_link = $full_link."| <a href='~\..\Lab_Report_Assignments\\$att2'>$att2</a>";
}
if($att3!=""){
$full_link = $full_link."| <a href='~\..\Lab_Report_Assignments\\$att3'>$att3</a>";
}
if($att4!=""){
$full_link = $full_link."| <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>";
}
echo "<div><a href='~\..\Courses.php?course=$url'> Courses > $url > Submit > $title </a></div>";
}
} }
}
$Group_ID = $_SESSION["Group_ID"]; $Group_ID = $_SESSION["Group_ID"];
?> ?>
</div> </div>
<div> <div>
<h3>Submit assignment</h3> <h1 class="display-6">Submit assignment</h1>
<hr> <hr>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<form method='post' enctype='multipart/form-data' action='Script.php'> <form method='post' enctype='multipart/form-data' action='Script.php'>
<input type='hidden' name='frm_submitlab' value='true' required=''/> <input type='hidden' name='frm_submitlab' value='true' required=''/>
<input type='hidden' name='lab_id' value='<?php echo $id; ?>' required=''/> <input type='hidden' name='lab_id' value='<?php echo $id; ?>' required=''/>
<input type='hidden' name='student_id' value='<?php echo $student_id; ?>' required=''/> <input type='hidden' name='student_id' value='<?php echo $student_id; ?>' required=''/>
<input type='hidden' name='group_id' value='<?php echo $Group_ID; ?>' required=''/> <input type='hidden' name='group_id' value='<?php echo $Group_ID; ?>' required=''/>
<input type='hidden' name='url' value='<?php echo $url; ?>' required=''/> <input type='hidden' name='url' value='<?php echo $url; ?>' required=''/>
<div class='mb-3'>
<label class='form-label'>Title</label>
<input type='text' name='title' placeholder='Assignment submission title' class='form-control' required=''>
</div>
<div class='mb-3'>
<label class='form-label'>Attachment 1</label>
<input type='file' name='attachment1' placeholder='Attachment 1' class='form-control' required=''>
<label class='form-label'>Attachment 2</label>
<input type='file' name='attachment2' placeholder='Attachment 2' class='form-control'>
<label class='form-label'>Attachment 3</label>
<input type='file' name='attachment3' placeholder='Attachment 3' class='form-control' >
<label class='form-label'>Attachment 4</label>
<input type='file' name='attachment4' placeholder='Attachment 4' class='form-control' >
</div>
<button type='submit' class='btn btn-primary'>Submit</button>
</form>
Title </div>
<input type='text' name='title' placeholder='Ttle' class='form-control' required=''>
Attachment 1 </div>
<input type='file' name='attachment1' placeholder='Attachment 1' class='form-control' required=''>
Attachment 2
<input type='file' name='attachment2' placeholder='Attachment 2' class='form-control'>
Attachment 3
<input type='file' name='attachment3' placeholder='Attachment 3' class='form-control' >
Attachment 4
<input type='file' name='attachment4' placeholder='Attachment 4' class='form-control' >
<br>
<input type='submit' class='btn btn-primary' value='Submit'><br>
</form>
</div>
</div> </div>
</div> </div>
</div>