adding LRR files

uploading the full project online
ProjectHomePage
CloudStarTreck 2020-03-16 15:23:14 +08:00
parent 5a5786cee4
commit 2ac128c680
26 changed files with 5674 additions and 0 deletions

335
Admin.php Normal file
View File

@ -0,0 +1,335 @@
<?php
$page="admin";
include 'Header.php';
?>
<style>
.col-md-4{
border-right: 1px solid skyblue;
}
</style>
<br>
<div style="width: 80%;margin: auto;"> <h2> Administration Panel </h2> </div>
<hr>
<div class="row" style="width: 80%;margin: auto;">
<!--<h4>General system Settings</h4><hr>
<a href="" class="btn btn-lg btn-primary">View System Log </a>
<hr>
Lab Privacy Mode: (STUDENT VERIFICATION)
<hr>
-->
<div class="col-md-6">
<h4> User account Management </h4><hr>
<b>Lecturer / TA Accounts </b><br>
<div class="container">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#home">Create New Account</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu1">Existing Accounts</a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div id="home" class="container tab-pane active"><br>
<b>Create Lecturer/TA Accounts </b>
<form method="post" action="Script.php">
<input type="hidden" name="frm_createlecturrer" value="true" required=""/>
Full_Name
<input type="text" name="fullname" placeholder="Full Name" class="form-control" required="">
Email
<input type="text" name="email" placeholder="Email / Student Number" class="form-control" required="">
Passport_Number / ID (Used as Intial Password)
<input type="text" class="form-control" name="passport" placeholder="Passport No./ID" required="">
<br> User Type :
<input type="radio" name="type" value="Lecturer" required=""> Lecturer
<input type="radio" name="type" value="TA" required=""> T/A
<input type="submit" class="btn btn-primary" value="Create"><br>
<?php
error_reporting(E_ALL);
if(isset($_SESSION['info_Admin_Users'])) {
echo '<hr><div class="alert alert-info" role="alert">'.$_SESSION['info_Admin_Users'].'</div>';
$_SESSION['info_Admin_Users']=null;
}
if(isset($_SESSION['info_Admin_Users'])) {
echo '<hr><div class="alert alert-info" role="alert">'.$_SESSION['info_Admin_Users'].'</div>';
$_SESSION['info_Admin_Users']=null;
}
?>
</form>
<hr>
</div>
<div id="menu1" class="container tab-pane fade"><br>
<table class="table-bordered" style="font-size: 10pt;">
<tr style="font-size:10pt;">
<th>ID</th>
<th>Name</th>
<th>Email</th>
<th>Passport / ID </th>
<th>Reset Password </th>
<th>Block/Activate </th>
</tr>
<?php
$result = mysqli_query($con,
"SELECT * FROM Users_Table WHERE UserType in ('Lecturer','TA')");
while($row = mysqli_fetch_assoc($result)) {
$pass=$row['Passport_Number'];
$btn="<button class='btn-primary' onclick=\"updatePass(".$row['User_ID'].",'$pass')\">Reset</button>";
if($row['Status']=="Active")
{ $newstatus="Blocked";
$btnBlock="<button class='btn-danger' onclick=\"blockUser(".$row['User_ID'].",'$newstatus')\">Block</button>";
}else{
$newstatus="Active";
$btnBlock="<button class='btn-success' onclick=\"blockUser(".$row['User_ID'].",'$newstatus')\">Activate</button>";
}
echo "<tr><td>".$row['User_ID']."</td><td>".$row['Full_Name']."</td><td>".$row['Email']."</td> <td>".$row['Passport_Number']."</td><td>$btn</td><td>$btnBlock</td></tr>";
}
?></table>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="container">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#menua"> Course Portal </a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menub">Existing Courses</a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div id="menua" class="container tab-pane active"><br>
<hr>
<b>Create new Portal </b>
<form method="post" action="Script.php">
<input type="hidden" name="frm_createCourse" value="true" required=""/>
Course Name
<input type="text" name="name" placeholder="Course Name" class="form-control" required="">
Course Code
<input type="text" name="code" placeholder="Course Code" class="form-control" required="">
URL (Leave blank to use Course Name)
<input type="text" name="url" placeholder="Choose Custom URL " class="form-control" required="">
Academic Year
<input type="text" name="academic" placeholder="Academic Year" class="form-control" required="">
Faculty <br>
<input type="text" name="faculty" placeholder="Faculty" class="form-control" required="">
Assign Lecturer
<br>
<select name="lecturer" class="form-control">
<?php
$result = mysqli_query($con,"SELECT * FROM Users_Table WHERE UserType='Lecturer'");
if(mysqli_num_rows($result)==0)
{} else { while($row = mysqli_fetch_assoc($result)) {
$id=$row['User_ID'];
$name=$row['Full_Name'];
echo "<option value='$id'> $name </option>";
}}?>
</select>
Assigned T/A <br>
<select name="ta" class="form-control">
<?php
$result = mysqli_query($con,"SELECT * FROM Users_Table WHERE UserType='TA'");
if(mysqli_num_rows($result)==0)
{} else { while($row = mysqli_fetch_assoc($result)) {
$id=$row['User_ID'];
$name=$row['Full_Name'];
echo "<option value='$id'> $name </option>";
}}?>
</select>
Verify Joining Students
<input type="radio" name="verify" value="1"> Yes
<input type="radio" name="verify" value="0" checked=""> No
<br>
<input type="submit" class="btn btn-primary" value="Create Portal"><br>
</form>
<?php
error_reporting(E_ALL);
if(isset($_SESSION['info_Admin_Courses'])) {
echo '<hr><div class="alert alert-info" role="alert">'.$_SESSION['info_Admin_Courses'].'</div>';
$_SESSION['info_Admin_Courses']=null;
}
if(isset($_SESSION['info_Admin_Courses'])) {
echo '<hr><div class="alert alert-info" role="alert">'.$_SESSION['info_Admin_Courses'].'</div>';
$_SESSION['info_Admin_Courses']=null;
}
?>
</div>
<div id="menub" class="container tab-pane fade"><br>
<b> Existing Course Portals </b>
<hr>
<table class="table-bordered" style="font-size: 10pt;">
<tr> <th>Course Name </th> <th> Faculty </th> <th>Lecturer </th> <th>TAs</th> <th>Assign new TA </th> </tr>
<?php
$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");
if(mysqli_num_rows($result)==0)
{} else { while($row = mysqli_fetch_assoc($result)) {
$name=$row['Course_Name'];
$code=$row['Course_Code'];
$faculty=$row['Faculty'];
$lecturer=$row['Full_Name'];
$academic=$row['Academic_Year'];
$c_id=$row['Course_ID'];
$resultTA = mysqli_query($con,"SELECT `Course_ID`, `TA`,users_table.Full_Name as TA_NAME FROM `course_ta`
INNER JOIN users_table on users_table.User_ID=course_ta.TA
where course_ta.Course_ID=$c_id");
$ta="";
while($rowTA = mysqli_fetch_assoc($resultTA)) {
$ta=$ta." - ".$rowTA['TA_NAME'];
}
echo"
<tr> <td>$code - $name</td> <td>$faculty </td> <td>$lecturer</td><td>$ta</td> <td><form method='get' action='Script.php'> <select name='ta' class=''>";
$resultx = mysqli_query($con,"SELECT * FROM Users_Table WHERE UserType='TA'");
if(mysqli_num_rows($resultx)==0)
{} else { while($row = mysqli_fetch_assoc($resultx)) {
$id=$row['User_ID'];
$name=$row['Full_Name'];
echo "<option value='$id'> $name </option>";
}}
echo "</select> <input type='hidden' name='assignTA' value='true'> <input type='hidden' name='id' value='$c_id'> <input type='submit' value='assign'></form> </td></tr>
";
}}?>
</table>
</div>
</div>
</div>
<script>
function updatePass(id,pass)
{
if(!confirm('Are you to Reset User Password'))
{
return;
}
window.location.href="\Script.php\?action=passchange&uid="+id+"&pass="+pass;
}
function blockUser(id,status)
{
if(!confirm('Are you to change User Status'))
{
return;
}
window.location.href="\Script.php\?action=statuschange&uid="+id+"&status="+status;
}
</script>

23
Connect.php Normal file
View File

@ -0,0 +1,23 @@
<?php
$servername = "localhost";
$username = "root";
$password = "";
// $servername = "sql202.epizy.com";
// $username = "epiz_23626301";
// $password = "wtn2rmj3";
// Create connection
$con = new mysqli($servername, $username, $password,'lrr');
// Check connection
if ($con->connect_error) {
die("Database Connection failed: " . $conn->connect_error);
}
// else
// {
// echo "Connected";
// }
session_start();

760
Course.php Normal file
View File

@ -0,0 +1,760 @@
<?php
$page='Courses+';
include 'Header.php';
$student_id=$_SESSION["user_student_id"];
$group_id=$_SESSION["user_group_id"];
$c_date= date("Y-m-d H:i");
if(!empty($_GET["url"]))
{
$course_url=$_GET["url"];
$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 URL='$course_url' ");
if(mysqli_num_rows($result)==0)
{} else { while($row = mysqli_fetch_assoc($result)) {
$name=$row['Course_Name'];
$code=$row['Course_Code'];
$faculty=$row['Faculty'];
$lecturer=$row['Full_Name'];
$academic=$row['Academic_Year'];
$url=$row['URL'];
$course_id=$row['Course_ID'];
$id2=$row['Course_ID'];
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 </span>
</a></div>
";
}}
}
?>
<div class="row" style='margin-left:20px;float:left'>
<?php
if (isset($_SESSION['info_ReMarking'])) {
echo '<hr><div class="alert alert-info" role="alert" style="float:left;">' . $_SESSION['info_ReMarking'] . '</div>';
$_SESSION['info_ReMarking']=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")
{
?>
<hr>
<div class="row" style="width:95%;margin:auto; text-align:left;">
<div class="col-md-9">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#menu1">New Labs Reports</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu2">Missed Lab Reports </a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu3">Submitted Lab Reports</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu4">Marked Submissions</a>
</li>
</ul>
<div class="tab-content">
<div id="menu1" class="container tab-pane active"><br>
<?php
// Get groups of this students
$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);
while($row = mysqli_fetch_assoc($resultx1)) {$group_id=$row['Course_Group_id'];}
if($group_id==""){$group_id=-1;}
$var="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 Lab_Report_ID in (select Lab_Report_ID from lab_reports_table where Course_ID=$course_id) and Student_ID=$student_id and Extended_Deadline_Date > '$c_date') ) "
. ""
. ""
. ""
. ""
. "and 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)"
. ""
. " ORDER by Lab_Report_ID DESC";
$result1 = mysqli_query($con,$var);
if(mysqli_num_rows($result1)==0)
{
echo "No Active assignments for this course so far.";
} else { while($row = mysqli_fetch_assoc($result1)) {
$title=$row['Title'];
$type=$row['Type'];
$Marks=$row['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'];
$labid=$row['Lab_Report_ID'];
$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 " <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;'>
$title ($type) <br> <span style='font-size:8pt'> $ins</span>
<br> <span style='font-size:8pt'>Posted : $posted &nbsp;&nbsp;&nbsp;&nbsp; Deadline : $deadline &nbsp;&nbsp;&nbsp;&nbsp;($Marks Marks) &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<a href='~\..\SubmitLab.php?id=$labid&url=$url' class='btn-sm btn-info' style='margin-left:50px;'> Submit Lab Report</a><br> Attachments : $full_link </span>
</div></k>";
}}
echo "";
?>
</div>
<div id="menu2" class="container tab-pane"><br>
<?php
$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`
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 Course_ID=$course_id and deadline < '$c_date' "
. ""
. ""
. ""
. ""
. ""
. ""
. "ORDER by Lab_Report_ID DESC");
if(mysqli_num_rows($result)==0)
{
echo "You Missed no Lab reports in this course";
} else { while($row = mysqli_fetch_assoc($result)) {
$title=$row['Title'];
$marks=$row['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'];
$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 " <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;'>
$title <br> <span style='font-size:8pt'> $ins</span>
<br> <span style='font-size:8pt'>Posted : $posted &nbsp; &nbsp; &nbsp; Deadline : $deadline &nbsp; &nbsp; &nbsp; ($marks Marks) &nbsp; &nbsp; <span class='btn-sm btn-warning' style='margin-left:50px;'><i class='fa fa-times-circle'></i> Missed !</span><br> Attachments : $full_link </span>
</div></k>";
}}
echo "";
?>
</div>
<div id="menu3" class="container tab-pane"><br>
<?php
$resultx = 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`
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");
if(mysqli_num_rows($resultx)==0)
{
echo "You have no Lab report submissions in this course";
} else { while($row = mysqli_fetch_assoc($resultx)) {
$lab_repo_id=$row['Lab_Report_ID'];
$title=$row['Title'];
$marks=$row['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'];
if( $c_date < $deadline)
{
$submittedx="<a href='~\..\SubmitLab.php?id=$id' class='btn-sm btn-default'><i class='fa fa-check-circle'></i> Re-Submit </a>";
}
else {
}
$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 " <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;'>
$title <br> <span style='font-size:8pt'> $ins</span>
<br> <span style='font-size:8pt'>Posted : $posted Deadline : $deadline ($marks Marks) &nbsp; &nbsp; $submittedx&nbsp; <span class='btn-sm btn-success' style='margin-left:50px;'><i class='fa fa-Edit-circle'></i> Submitted </span><br> Assignment Attachments : $full_link
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br> Submission Files :";
$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`,
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status,
`Title`,users_table.Full_Name,course_group_members_table.Student_ID
FROM `lab_report_submissions`
Left JOIN users_table on users_table.Student_ID=lab_report_submissions.Student_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'");
if(mysqli_num_rows($Sub_result)==0)
{
echo "No Attachments found.";
} else { while($row = mysqli_fetch_assoc($Sub_result)) {
$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($at4!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at4'>$at4</a>";
}
echo $full_link;
}
}
echo "</span></div></k>";
}}
echo "";
?>
</div>
<div id="menu4" class="container 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,
`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 "
. "WHERE lab_report_submissions.Student_id='$student_id' and"
. ""
. ""
. ""
. " 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) and Course_ID=$course_id) ORDER by Submission_ID DESC");
if(mysqli_num_rows($resultx)==0)
{
echo "You have No Marked submissions in this course";
} 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'];
if($status=='Marked')
{
$rm_data="\Script.php?remarking=yes&id=$Submission_ID&url=$url&status=Remarking";
$remarking="<button onclick='remarking(\"$rm_data\")' class='btn-sm btn-success'> Request Remarking </button>";
}
if($status=='Remarking')
{
$remarking="<span style='color:orange'><i class='fa fa-info-circle'></i> Remarking Request sent </span> <br> Remarking Reason:<i>$remarking_reason </i> <br>";
}
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;'>
$title <b> ($marks Marks out of $Originalmarks)</b><br><small> Lecturer Feedback : $notes </small> &nbsp; $remarking <br> Submission files :";
$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`,
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status,
`Title`,users_table.Full_Name,course_group_members_table.Student_ID
FROM `lab_report_submissions`
Left JOIN users_table on users_table.Student_ID=lab_report_submissions.Student_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'");
if(mysqli_num_rows($Sub_result)==0)
{
echo "No Attachments found.";
} else { while($row = mysqli_fetch_assoc($Sub_result)) {
$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($at4!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at4'>$at4</a>";
}
echo $full_link;
}
}
}}
echo "</div></k>";
?>
</div>
</div>
</div>
<div class="col-md-3">
<h3>Class Groups</h3>
<?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>";
?>
<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
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");
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>";
$extra3=" <a href='#' class='' onclick='accept($id,0)'>Decline</a></small>";
}
echo "<div class='btn-default'><small> $name ($status) $extra $extra2 $extra3</small></div>";
$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`
INNER JOIN users_table on users_table.Student_ID=course_group_members_table.Student_ID
where course_group_members_table.Course_Group_id=$id");
while($row = mysqli_fetch_assoc($rs2)) {
$name=$row['Full_Name'];
$id=$row['Course_Group_id'];
$status=$row['Status'];
$Student_ID=$row['Student_ID'];
echo "<li><small> $name-$Student_ID ($status)</small></li>";
}
}
}
?>
</div>
</div>
<?php
}
include 'Footer.php';
?>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css" />
<script>
function CreateGroup() {
try
{
$('<form id="frm" method="get" action="Script.php"><input type="hidden" name="creategroup" value="true">\n\
<input type="hidden" name="student_id" value="<?php echo $student_id; ?>" > Group Name <input type="text" name="name">\n\
<input type="hidden" name="url" value="<?php echo $url; ?>"> <input type="hidden" name="id" value="<?php echo $course_id; ?>"> </form>').dialog({
modal: true,
title:'Create Group',
buttons: {
'Create Group': function () {
$('#frm').submit();
$(this).dialog('close');
},
'X': function () {
$(this).dialog('close');
}
}
});
}catch(e){ alert(e); }
}
function invite(id) {
try
{
$('<form id="frm" method="get" action="Script.php"><input type="hidden" name="groupinvite" value="true">\n\
<input type="hidden" name="groupid" value="'+id+'" > Enter Student_ID to Invite <input type="text" name="student_id">\n\
<input type="hidden" name="url" value="<?php echo $url; ?>"> <input type="hidden" name="courseid" value="<?php echo $course_id; ?>"> </form>').dialog({
modal: true,
title:'Invite Students to Group',
buttons: {
'Invite': function () {
$('#frm').submit();
$(this).dialog('close');
},
'X': function () {
$(this).dialog('close');
}
}
});
}catch(e){ alert(e); }
}
function accept(id,val) {
try
{
$('<form id="frm" method="get" action="Script.php"><input type="hidden" name="acceptinvite" value="true">\n\
<input type="hidden" name="groupid" value="'+id+'" > \n\ <input type="hidden" name="action" value="'+val+'" > \n\
\n\
<input type="hidden" name="student_id" value="<?php echo $student_id; ?>" > \n\
<input type="hidden" name="url" value="<?php echo $url; ?>"> <input type="hidden" name="courseid" value="<?php echo $course_id; ?>"> </form>').dialog({
modal: true,
title:'Respond to Group Invite',
buttons: {
'Confirm': function () {
$('#frm').submit();
$(this).dialog('close');
},
'X': function () {
$(this).dialog('close');
}
}
});
}catch(e){ alert(e); }
}
function remarking(data)
{
var details=prompt("Please enter Remarking Reason","");
window.location.href=data+"&details="+details;
}
</script>

825
Courses.php Normal file
View File

@ -0,0 +1,825 @@
<?php
$page='Courses';
include 'Header.php';
$user_d=$_SESSION['user_id'];
if( $_SESSION['user_type']=="Lecturer" || $_SESSION['user_type']=="TA")
{
?>
<!-- FOR LECTURER-->
<div class="row" style="width:80%;margin:auto; text-align:left;">
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css" />
<script>
function extend_deadline(id) {
var dropstudents=$("#dropstudents").html();
try
{
$('<form id="frm" method="get" action="Script.php">\n\
<input type="hidden" name="extenddeadline" value="true" >\n\
<input type="hidden" name="id" value="'+id+'" > \n\
New Date/Time <br><input type="date" name="date" required=""> <input type="time" name="time" required=""> \n\
\n\
<br><input type="radio" value="1" name="type" required=""> Extend for All<hr> \n\
<input type="radio" value="2" name="type" required=""> Extend for these Individual Students \n\
'+dropstudents+' \n\
</form>').dialog({
modal: true,
title:'Extend Deadline',
buttons: {
'Submit': function () {
$('#frm').submit();
$(this).dialog('close');
},
'X': function () {
$(this).dialog('close');
}
}
});
}catch(e){ alert(e); }
}
</script>
<?php
if(!empty($_GET["course"]))
{
$course_url=$_GET["course"];
$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 URL='$course_url' ");
if(mysqli_num_rows($result)==0)
{} else { while($row = mysqli_fetch_assoc($result)) {
$name=$row['Course_Name'];
$code=$row['Course_Code'];
$faculty=$row['Faculty'];
$lecturer=$row['Full_Name'];
$academic=$row['Academic_Year'];
$url=$row['URL'];
$id=$row['Course_ID'];
$course_id=$row['Course_ID'];
echo "
<div class='alert> <a href='~\..\Courses.php?course=$url'> <div class='panel'>
($code) - $name
<br> <span style='font-size:8pt'>Faculty : $faculty Year : $academic Lecturer :$lecturer </span>
</div></a>
<hr></div></div> <div class='row' style='width:80%;margin:auto; text-align:left;'>
";
echo "<div class='col-md-5'>";
if( $_SESSION['user_type']=="Lecturer"){
echo "<h3> Post new Lab Assignment </h3><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='".$id."' required=''/>
<input type='hidden' name='url' value='".$course_url."' required=''/>
Dealine Date/Time
<div class='row'>
<div class='col-md-7'><input type='date' id='date' name='deadlinedate' placeholder='' class='form-control' required=''> </div>
<div class='col-md-5'> <input type='time' class='form-control' name='deadlinetime'> </div>
</div>
Title
<input type='text' name='title' placeholder='Ttle' class='form-control' required=''>
Instructions
<textarea name='instructions' placeholder='Assignment Instructions' class='form-control' required=''></textarea>
Marks
<input type='text' name='marks' placeholder='Marks' class='form-control' required=''>
Attachment 1
<input type='file' name='attachment1' placeholder='Attachment 1' class='form-control'>
Attachment 2
<input type='file' name='attachment2' placeholder='Attachment 1' class='form-control'>
Attachment 3
<input type='file' name='attachment3' placeholder='Attachment 1' class='form-control' >
Attachment 4
<input type='file' name='attachment4' placeholder='Attachment 4' class='form-control' >
<br>
Submission Type <input type='radio' name='type' value='Individual' required=''> Invidual
<input type='radio' name='type' value='Group' required=''> Group
<hr>
<input type='submit' class='btn btn-primary' value='Post Lab Assignment'><br>
</form><br><br><br><br>
";
}
}
}
echo "</div>";
echo "<div class='col-md-7'> <h3> Lab Report Assignment list </h3>";
error_reporting(0);
if (isset($_SESSION['info_courses'])) {
echo '<hr><div class="alert alert-info" role="alert">' . $_SESSION['info_courses'] . '</div>';
$_SESSION['info_courses'] = null;
}
if (isset($_SESSION['info_courses'])) {
echo '<hr><div class="alert alert-info" role="alert">' . $_SESSION['info_courses'] . '</div>';
$_SESSION['info_courses']=null;
}
$result = mysqli_query($con," SELECT `Lab_Report_ID`,Type,Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, "
. "`Attachment_link_4` FROM `lab_reports_table` WHERE Course_ID=$id ORDER by Lab_Report_ID DESC");
if( $_SESSION['user_type']=="TA")
{
echo "<b style='color:orange'>* Only Lecturers can Post new Lab report Assignments </b><br>";
}
if(mysqli_num_rows($result)==0)
{
echo "No assignments posted so far.";
} else { while($row = mysqli_fetch_assoc($result)) {
$marks=$row['Marks'];
$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'];
$id=$row['Lab_Report_ID'];
$as_type=$row['Type'];
$full_link="<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>";
if($att2!=""){
$full_link= $full_link." &nbsp|&nbsp <a href='~\..\Lab_Report_Assignments\\$att2'>$att2</a>";
}
if($att3!=""){
$full_link= $full_link." &nbsp|&nbsp <a href='~\..\Lab_Report_Assignments\\$att3'>$att3</a>";
}
if($att4!=""){
$full_link= $full_link." &nbsp; | &nbsp <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>";
}
$resultx1 = mysqli_query($con,"Select Count(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id");
while($row = mysqli_fetch_assoc($resultx1)) {$count_subs=$row['cnt'];}
$resultx2 = mysqli_query($con,"Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Marks is not null");
if(mysqli_num_rows($resultx2)==0){$count_marked=0;} else { while($row = mysqli_fetch_assoc($resultx2)) {$count_marked =$row['cnt'];}}
$header="Courses > ".$name."($code) > Assignments > ".$title;
echo " <div class='break-word btn btn-default' style='word-wrap: break-word;border-color:grey;'>
$title ($as_type) <br> $ins
<br> <span style='font-size:8pt'>Posted : $posted Deadline : <b> $deadline </b> &nbsp; ($marks Marks) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "
. "<br>"
. "<span class='btn-default'> &nbsp;&nbsp; $count_subs Submissions ( $count_marked Marked ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='~\..\Submissions.php?id=$id&header=$header&total=$marks' onclick=''> View </a> &nbsp;&nbsp; |&nbsp;&nbsp; <a href='#' onclick='extend_deadline($id)'> Extend Deadline </a> </span> <hr> Attachments : $full_link </span>"
. "&nbsp;&nbsp;</div>
";
}}
echo "</div>";
$resultx1 = mysqli_query($con,"SELECT course_students_table.Student_ID,users_table.Full_Name FROM
`course_students_table`
INNER JOIN users_table on users_table.Student_ID=course_students_table.Student_ID
WHERE Course_ID=$course_id");
echo "<span id='dropstudents' style='display:none;'> <select name='stdid'>";
while($row = mysqli_fetch_assoc($resultx1))
{
$stdid=$row['Student_ID'];
$stdname=$row['Full_Name'];
echo "<option value='$stdid'> $stdname($stdid) </option> ";
}
echo "</select><br>Reason <input type='text' name='reason'>"
. "<input type='hidden' name='url' value='$course_url'>"
. " </span>";
return;
}
?>
<div class="col-md-8">
<?php
$user_name=$_SESSION['user_fullname'];
echo " <div class='alert' style='margin-left:20px;border-bottom:2px solid #1D91EF;'> <a href='~\..\Courses.php?course=$url'>
Course Portal > $user_name (Lecturer) > Course Listing
<br> <span style='font-size:8pt'> </span>
</a></div>
";
$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 courses_table.Lecturer_User_ID=$user_d");
if($_SESSION['user_type']=="TA")
{
$result = mysqli_query($con,"SELECT course_ta.Course_ID, `Course_Name`,
`Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table`
INNER JOIN
course_ta ON course_ta.Course_ID=courses_table.Course_ID where course_ta.TA=$user_d");
}
// $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");
if(mysqli_num_rows($result)==0)
{} else { while($row = mysqli_fetch_assoc($result)) {
$id=$row['Course_ID'];
$name=$row['Course_Name'];
$code=$row['Course_Code'];
$faculty=$row['Faculty'];
$lecturer=$row['Full_Name'];
$academic=$row['Academic_Year'];
$url=$row['URL'];
$resultTA = mysqli_query($con,"SELECT `Course_ID`, `TA`,users_table.Full_Name as TA_NAME FROM `course_ta`
INNER JOIN users_table on users_table.User_ID=course_ta.TA
where course_ta.Course_ID=$id");
$ta="";
while($rowTA = mysqli_fetch_assoc($resultTA)) {
$ta=$ta." - ".$rowTA['TA_NAME'];
}
echo"
<a href='~\..\Courses.php?course=$url'> <div class='btn btn-default'>
($code) - $name
<br> <span style='font-size:8pt'>Faculty : $faculty &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Year : $academic &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Lecturer :$lecturer &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TA:$ta </span>
</div></a>
";
}}?>
</div>
<div class="col-md-4">
<br>
<b> Course Joining Requests </b>
<?php
$lecturer_id= $_SESSION['user_id'];
$result = mysqli_query($con,"SELECT course_students_table.ID,users_table.Full_Name, courses_table.Course_ID, `Course_Name`, `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table`
INNER JOIN course_students_table on course_students_table.Course_ID=courses_table.Course_ID
INNER JOIN users_table on users_table.Student_ID=course_students_table.Student_ID
WHERE Lecturer_User_ID=$lecturer_id and course_students_table.Status='Pending'");
if(mysqli_num_rows($result)==0)
{
echo "<br> <i class='fa fa-info-circle'></i> No Course joining request so far for all your courses <hr>";
} else { while($row = mysqli_fetch_assoc($result)) {
$id=$row['ID'];
$name=$row['Course_Name'];
$code=$row['Course_Code'];
$faculty=$row['Faculty'];
$std_name=$row['Full_Name'];
$academic=$row['Academic_Year'];
echo "<div class='btn btn-default'>
$std_name is Requesting to join <br> [($code) - $name ] &nbsp;&nbsp;&nbsp;&nbsp; <br><a href='~\..\Script.php?AcceptStudent=y&id=$id&rs=yes' class='btn-sm btn-success' onclick=return confirm(\"are you sure to join this course?\")' > Accept </a>
&nbsp;&nbsp;<a href='~\..\Script.php?AcceptStudent=y&id=$id&rs=no' class='btn-sm btn-danger' onclick=return confirm(\"are you sure to join this course?\")' > Decline </a>
</div>";
}
}
?>
<?php
if( $_SESSION['user_type']=="TA")
{
echo "<center>Only Lecturers can Post new Lab report Assignments</center>";
}
if( $_SESSION['user_type']=="Lecturer"){ ?>
<b>Create new Course Portal </b>
<form method="post" action="Script.php">
<input type="hidden" name="frm_createCourse" value="true" required=""/>
<input type="hidden" name="l" value="l" required=""/>
Course Name
<input type="text" name="name" placeholder="Course Name" class="form-control" required="">
Course Code
<input type="text" name="code" placeholder="Course Code" class="form-control" required="">
URL (Leave blank to use Course Code & Year)
<input type="text" name="url" placeholder="Choose Custom URL " class="form-control">
Academic Year
<input type="text" name="academic" placeholder="Academic Year" class="form-control" required="">
Faculty <br>
<input type="text" name="faculty" placeholder="Faculty" class="form-control" required="">
<input type="hidden" name="lecturer" value="<?php echo $_SESSION['user_id']; ?>">
Verify Joining Students
<input type="radio" name="verify" value="1"> Yes
<input type="radio" name="verify" value="0" checked=""> No
<br>
<input type="submit" class="btn btn-primary" value="Create Portal"><br>
</form>
<?php } ?>
</div>
<!-- END LECTURER -->
<?php
}
if( $_SESSION['user_type']=="Student")
{
?>
<!--STUDENT CODE-->
<div class="row" style="width:80%;margin:auto; text-align:left;">
<div class="col-md-6">
<br> Course Portal > Students <br>
<?php
error_reporting(0);
if (isset($_SESSION['info_Courses_student'])) {
echo '<hr><span class="alert alert-success" role="alert">' . $_SESSION['info_Courses_student'] . '</span>';
$_SESSION['info_Courses_student'] = null;
}
?>
<br><br>
</div>
<div class="col-md-6"></div>
</div>
<div class="row" style="width:80%;margin:auto; text-align:left;">
<div class="col-md-6">
<?php
error_reporting(0);
$student_id= $_SESSION['user_student_id'];
if(!empty($_GET["search"]) || !empty($_GET["faculty"]))
{
$search=$_GET["search"];
$faculty=$_GET["faculty"];
if($faculty=="")
{
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='$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>";
$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 Faculty='$faculty' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)");
}
if(mysqli_num_rows($result)==0)
{
echo "No results found for your Search <hr>";
} else { while($row = mysqli_fetch_assoc($result)) {
$name=$row['Course_Name'];
$code=$row['Course_Code'];
$faculty=$row['Faculty'];
$lecturer=$row['Full_Name'];
$academic=$row['Academic_Year'];
$url=$row['URL'];
$id=$row['Course_ID'];
$v=$row['Verify_New_Members'];
$msg2="Join this Course";
if($v>0)
{
$msg="<i class='fa fa-exclamation-circle'></i> Lecturer Verification required";
$msg2="Send Joining Request";
}
echo "<div class='btn btn-default' style='word-wrap:break-word'>
($code) - $name <br>($url) <br> <a href='~\..\Script.php?JoinCourse=y&id=$id&std=$student_id&joining=$v' class='btn-sm btn-success' onclick=return confirm(\"are you sure to join this course?\")' > $msg2 </a>
<br> <span style='font-size:8pt'>Faculty : $faculty Year : $academic Lecturer :$lecturer </span><br>$msg</div>
";
}
}
}
echo "<h4> My Courses </h4>";
$result = mysqli_query($con,"SELECT users_table.Full_Name, course_students_table.Status, courses_table.Course_ID, `Course_Name`, `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table`
INNER JOIN users_table
ON users_table.User_ID=courses_table.Lecturer_User_ID
INNER JOIN course_students_table on course_students_table.Course_ID=courses_table.Course_ID
where course_students_table.Student_ID=$student_id");
if(mysqli_num_rows($result)==0)
{
echo "<i class='fa fa-exclamation-circle'></i> You are not Enrolled in any Course";
} else { while($row = mysqli_fetch_assoc($result)) {
$name=$row['Course_Name'];
$code=$row['Course_Code'];
$faculty=$row['Faculty'];
$lecturer=$row['Full_Name'];
$academic=$row['Academic_Year'];
$url=$row['URL'];
$id=$row['Course_ID'];
$Status=$row['Status'];
if($Status=="Joined")
{
echo "<a href='~\..\Course.php?url=$url'> <div class='btn btn-default' style='word-wrap:break-word'>
($code) - $name <br>($url) &nbsp;&nbsp;&nbsp; <i class='fa fa-check-circle'></i> $Status &nbsp;&nbsp;&nbsp;&nbsp; <a href='~\..\Course.php?url=$url' class='btn-sm btn-primary'> Open</a>
<br> <span style='font-size:8pt'>Faculty : $faculty Year : $academic Lecturer :$lecturer </span></div></a>
";
}
else
{
echo "<div class='btn btn-default'>
($code) - $name <i class='btn-sm btn-danger'> $Status</i>
<br> <span style='font-size:8pt'>Faculty : $faculty Year : $academic Lecturer :$lecturer </span></div>
";
}
}
}
echo "</div><div class='col-md-6'>
<form method='get' action='Courses.php'>
<div class='row'>
<div class='col-md-10'>
<div class='row'><div class='col-md-6'> Find course by Code
<input type='text' class='form-control' name='search' placeholder='Enter Course Code'>
</div><div class='col-md-6'>
List courses by faculty
<select name='faculty' class='form-control'>";
$result = mysqli_query($con,"SELECT DISTINCT(Faculty) as Faculty FROM `courses_table`");
if(mysqli_num_rows($result)==0)
{} else { while($row = mysqli_fetch_assoc($result)) {
$fname=$row['Faculty'];
echo "<option value=''> Search by faculty </option> <option value='$fname'> $fname </option>";
}}
echo "</select></div></div>
</div>
<div class='col-md-1'> <br>
<input type='submit' class='btn btn-primary' value='Find'>
</div>
</div>
</form>
</div></div>";
}
?>
<style>
.form-control{
padding-top: 1px;
padding-bottom:1px;
}
</style>

184
Header.php Normal file
View File

@ -0,0 +1,184 @@
<?php
session_start();
error_reporting(0);
date_default_timezone_set('Asia/Shanghai');
$con=mysqli_connect("localhost","root","","lrr");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
else
{
}
?>
<!DOCTYPE html>
<html>
<header>
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<!--<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/fontawesome.min.css" />
<script src="http://118.25.96.118/nor/css/jquery.min.js" type="text/javascript"></script>
<script src="http://118.25.96.118/nor/css/bootsrap.min.js" type="text/javascript"></script>
<link href="http://118.25.96.118/nor/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<script src="http://118.25.96.118/nor/css/jquery.datetimepicker.min.js" type="text/javascript"></script>
</header>
<body>
<?php
$curDateTime = date("Y-m-d H:i");
include 'connect.php';
?>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" style="padding-left:150px;padding-right:150px;margin:auto;">
<a class="navbar-brand" href="~\..\index.php"> <img src="logo.png" style="width:30px;heigh:30px;"> LRRS</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarColor02">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<li class="nav-item active">
<a class='nav-link' href='~\..\Visitors.php'> <i class='fa fa-globe'></i> Visitor Portal <span class='sr-only'>(current)</span></a>
</li>
<?php
if(isset($_SESSION["user_fullname"]))
{
echo " <a class='nav-link' href='~\..\Courses.php'><i class='fa fa-book'></i> Courses <span class='sr-only'>(current)</span></a>";
?>
</li>
</ul>
<form class="form-inline my-2 my-lg-0" style="color:#fff;">
Welcome &nbsp; <b> <?php echo $_SESSION['user_fullname'];
?> </b> &nbsp;
<?php
$c_date= date("Y-m-d H:i");
echo "(". $_SESSION['user_type'] .") ";
?>
&nbsp;&nbsp;&nbsp; <i class="fa fa-lock" style="color:#fff;"> </i> &nbsp;<a style='color:#fff !important' href="~\..\logout.php">Logout </a>
&nbsp; | &nbsp;<a href="#" style='color:#fff !important' onclick="updatePass(<?php echo $_SESSION['user_id'];?>)">Update Password</a>
<?php
}
?>
</form>
</div>
</nav>
<style>
.nav-item{
border-color:#00ff66;
}
.nav-tabs{
border-color:#00ff66;
}
.btn-default{
border: 2px solid #00ff66;
width: 100%;
text-align:left;
margin:3px auto;
font-weight:bold;
font-size:13pt;
}
.table-bordered{
padding:5px !important;
}
.alert{
font-weight: bold;
}
h1,h2,h3,h4{color:#03407B;}
a {
color: #03407B;
}
.break-word {
word-wrap: break-word;
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* css-3 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
white-space: -webkit-pre-wrap; /* Newer versions of Chrome/Safari*/
word-break: break-all;
white-space: normal;
}
.ui-widget-content.ui-dialog
{
border: 2px solid #03488B;
}
.ui-dialog > .ui-widget-header {background: #03488B; color:white}
.ui-button{ background: #03488B; color:white }
</style>
<script>
function updatePass(id)
{
var pass= prompt("Enter your New Password : ", "...");
if(!confirm('Are you sure to Reset your Password?'))
{
return;
}
window.location.href="\Script.php\?action=passchange&uid="+id+"&pass="+pass;
}
function blockUser(id,status)
{
if(!confirm('Are you to change User Status'))
{
return;
}
window.location.href="\Script.php\?action=statuschange&uid="+id+"&status="+status;
}
</script>

7
Issues.txt Normal file
View File

@ -0,0 +1,7 @@
* Allow submission without file upload
* Lecturer/TA should see his/her feedback on submissions
* Check Spelling Issues
* Remarking request details required

32
Quick_Start.txt Normal file
View File

@ -0,0 +1,32 @@
<h1> Quick Start Guide </h1>
<hr>
* Use Admin User t Create Lecturer Accounts
user : Admin
Password : admin@123
* Create Lecturer
* Login to Lecturer Account
* Create Course ( You can Define if students require approvel to join or Not )
* As Student
You can Sign up with your Student ID
The Provide Email and Password
* Browse Courses by Deartment
- Or Search by Course Course
- Join Course
- You can see list of your course in Course Home page
*

5
Readme.txt Normal file
View File

@ -0,0 +1,5 @@
* Student Regisreation Process is now simplyfied, Student Passport/ID checking process skipped as there is no where find that information currenly. The system now checks Student Passport / National ID from users tables insead of verifying from school databse.
*

19
Reset_Database.txt Normal file
View File

@ -0,0 +1,19 @@
delete from courses_table;
delete from course_groups_Table;
delete from course_Group_Members_table;
delete from course_students_table;
delete from course_ta;
delete from extended_deadlines_table;
delete from lab_reports_table;
delete from lab_report_submissions;
delete from students_data;
Delete from users_table;

49
Reset_password.php Normal file
View File

@ -0,0 +1,49 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
include 'Header.php';
$token=$_GET['token'];
$email=$_GET['email'];
?>
<div class="row">
<div class="col-md-4 list-group" style="margin:auto;">
<br>
<h4 class="list-group-item active"> Reset your password </h4>
<div class="list-group-item">
<div class="panel-body">
<form method="post" action="Script.php" >
<input type="hidden" name="frm_reset_password" value="true"/>
<input type="hidden" name="token" value="<?php echo $token ?>"/>
Email
<input type="text" name="email" readonly="" placeholder="Enter your Email" class="form-control" value="<?php echo $email; ?>">
<br>
New Password
<input type="password" name="password" placeholder="Enter your new Password" class="form-control" value="">
<br>
<input type="submit" class="btn btn-primary" value="Reset">
<br>
<?php
?>
</form>
</div>
</div>
</div>
</div>
</form>
</div>
</div>

1575
Script.php Normal file

File diff suppressed because it is too large Load Diff

20
Student.php Normal file
View File

@ -0,0 +1,20 @@
<?php
$page="student";
include 'Header.php';
?>
<br><br><br>
<div class="row" style="width:80%;margin:auto;">
<div class="col-md-6">
<h1> STUEDNT Account Created , Now you can Browse Course Portals </h1>
</div>
</div>

628
Submissions.php Normal file
View File

@ -0,0 +1,628 @@
<?php
$page='Courses+';
include 'Header.php';
$student_id=$_SESSION["user_student_id"];
$group_id=$_SESSION["user_group_id"];
$c_date= date("Y-m-d H:i");
if(!empty($_GET["id"]))
{
$id=$_GET["id"];
$course_id=$id;
}
if(!empty($_GET["header"]))
{
$header=$_GET["header"];
}
if(!empty($_GET["total"]))
{
$total=$_GET["total"];
} else
{
$total=0;
}
$resultx1 = mysqli_query($con,"SELECT `Lab_Report_ID`,Title, `Course_ID`, `Posted_Date`, `Deadline`, `Marks`, `Type` FROM `lab_reports_table` WHERE Lab_Report_ID=$id");
while($row = mysqli_fetch_assoc($resultx1)) {
$Report_Type=$row['Type'];
$c_id=$row['Course_ID'];
$Report_Title=$row['Title'];
}
echo "<div class='alert' style='margin-left:20px;border-bottom:2px solid #1D91EF;'> <a href='#'>
$header
</a></div>
";
?>
<div class="row" style="width:80%;margin:auto; text-align:left;">
<!-- Lecture CODE-->
<?php
if( $_SESSION['user_type']=="Lecturer" || $_SESSION['user_type']=="TA")
{
?>
<div class="col-md-12">
<?php
error_reporting(0);
if(isset($_SESSION['info_Marking'])) {
echo '<hr><div class="alert alert-info" role="alert">'.$_SESSION['info_Marking'].'</div>';
$_SESSION['info_Marking']=null;
}
$resultx1 = mysqli_query($con,"Select Count(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id");
while($row = mysqli_fetch_assoc($resultx1)) {$count_subs=$row['cnt'];}
$resultx2 = mysqli_query($con,"Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Status='Marked'");
if(mysqli_num_rows($resultx2)==0){$count_marked=0;} else { while($row = mysqli_fetch_assoc($resultx2)) {$count_marked =$row['cnt'];}}
$resultx3 = mysqli_query($con,"Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Status='Pending'");
if(mysqli_num_rows($resultx3)==0){$count_unmarked=0;} else { while($row = mysqli_fetch_assoc($resultx3)) {$count_unmarked =$row['cnt'];}}
$resultx4 = mysqli_query($con,"Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Status='Remarking'");
if(mysqli_num_rows($resultx4)==0){$count_remark=0;} else { while($row = mysqli_fetch_assoc($resultx4)) {$count_remark =$row['cnt'];}}
?>
<b>Lab Report Submissions (<?php echo $count_subs;?>)</b>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#menu1">Un-Marked Submissions<b> (<?php echo $count_unmarked;?>)</b></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu2">Marked Submissions <b>(<?php echo $count_marked;?>)</b></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu3">Re-Marking Requests <b>(<?php echo $count_remark;?>)</b></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu4"> View Course Groups</a>
</li>
</ul>
<div class="tab-content">
<div id="menu1" class="container tab-pane active"><br>
<?php
if($Report_Type=="Group")
{
$result1 = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID,
lab_report_submissions.Course_Group_id, `Attachment1`,
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status,
`Title`,course_groups_table.Group_Name
FROM `lab_report_submissions`
left JOIN course_groups_table on course_groups_table.Course_Group_id=lab_report_submissions.Course_Group_id
where Lab_Report_ID=$id and lab_report_submissions.Status='Pending' order by Submission_Date desc");
}
else
{
$result1 = 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`,
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status,
`Title`,users_table.Full_Name,course_group_members_table.Student_ID
FROM `lab_report_submissions`
Left JOIN users_table on users_table.Student_ID=lab_report_submissions.Student_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.Status='Pending' order by Submission_Date desc");
}
if(mysqli_num_rows($result1)==0)
{
echo "No Un-Marked Submissions for this Lab Report.";
} else { while($row = mysqli_fetch_assoc($result1)) {
$title=$row['Title'];
$Marks=$row['Marks'];
//$ins=$row['Notes'];
$posted=$row['Submission_Date'];
$deadline=$row['Deadline'];
$att1=$row['Attachment1'];
$att2=$row['Attachment2'];
$att3=$row['Attachment3'];
$att4=$row['Attachment4'];
$labid=$row['Lab_Report_ID'];
$submitted_std=$row['Student_id'];
$submitted_group=$row['Course_Group_id'];
$Submission_ID=$row['Submission_ID'];
$names=$row['Full_Name'];
$groupname=$row['Group_Name'];
$student_id=$row['sub_std'];
if($submitted_group==0)
{
$submitted_by= $names."(".$student_id.")";
} else {
$submitted_by="<i>(GROUP)</i> $groupname" ;
}
$full_link="<a href='~\..\Lab_Report_Submisions\\$att1'>$att1</a>";
if($att2!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$att2'>$att2</a>";
}
if($att3!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$att3'>$att3</a>";
}
if($att4!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$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;'>
$title <br> by : <b> $submitted_by </b>
<br> <span style='font-size:8pt'>Submitted : $posted <button class='btn-sm btn-info' style='margin-left:50px;' onclick='mark($Submission_ID,\"$title\",$total)'> Mark Submission</button><br> Attachments : $full_link </span>
</div></k>";
}}
echo "";
?>
</div>
<div id="menu2" class="container tab-pane"><br>
<?php
if($Report_Type=="Group")
{
$result = mysqli_query($con,"SELECT `Submission_ID`,Visibility, `Submission_Date`, lab_report_submissions.Lab_Report_ID,
lab_report_submissions.Course_Group_id, `Attachment1`,
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status,
`Title`,course_groups_table.Group_Name
FROM `lab_report_submissions`
left JOIN course_groups_table on course_groups_table.Course_Group_id=lab_report_submissions.Course_Group_id
where Lab_Report_ID=$id and lab_report_submissions.Status='Marked'");
}
else
{
$result = mysqli_query($con,"SELECT `Submission_ID`,Visibility, `Submission_Date`, lab_report_submissions.Lab_Report_ID,
lab_report_submissions.Student_id sub_std, lab_report_submissions.Course_Group_id, `Attachment1`,
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status,
`Title`,users_table.Full_Name,course_group_members_table.Student_ID
FROM `lab_report_submissions`
Left JOIN users_table on users_table.Student_ID=lab_report_submissions.Student_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.Status='Marked' Order by lab_report_submissions.Student_id Desc");
}
if(mysqli_num_rows($result)==0)
{
echo "No Marked submissions for this lab";
} else {
echo "<h3><a href='~\..\Script.php?exportgrade=true&lab=$id&lab_name=$Report_Title'><i class='fa fa-book'></i> Export Grade Sheet </a></h3>";
while($row = mysqli_fetch_assoc($result)) {
$title=$row['Title'];
$Marks=$row['Marks'];
//$ins=$row['Notes'];
$posted=$row['Submission_Date'];
$deadline=$row['Deadline'];
$att1=$row['Attachment1'];
$att2=$row['Attachment2'];
$att3=$row['Attachment3'];
$att4=$row['Attachment4'];
$labid=$row['Lab_Report_ID'];
$submitted_std=$row['Student_id'];
$submitted_group=$row['Course_Group_id'];
$Submission_ID=$row['Submission_ID'];
$names=$row['Full_Name'];
$student_id=$row['sub_std'];
$Visibility=$row['Visibility'];
$notes=$row['Notes'];
if($submitted_group==0)
{
$submitted_by= $names."(".$student_id.")";
} else {
$submitted_by="<i>(GROUP)</i> Group X " ;
}
$full_link="<a href='~\..\Lab_Report_Submisions\\$att1'>$att1</a>";
if($att2!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$att2'>$att2</a>";
}
if($att3!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$att3'>$att3</a>";
}
if($att4!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$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;'>
$title <br> by : <b> $submitted_by &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [ Marked $Marks ] </b> &nbsp; Visibility : <b>$Visibility </b> <button class='btn-sm btn-success' style='margin-left:50px;' onclick='updatev($Submission_ID)'>Update visibility</button>
<hr> Lecturer/TA notes : $notes<br> <span style='font-size:8pt'>Submitted : $posted <b> </b> <button class='btn-sm btn-info' style='margin-left:50px;' onclick='mark($Submission_ID,\"$title\",$total)'> Re-Mark Submission</button><br> Attachments : $full_link </span>
</div></k>";
}}
echo "";
?>
</div>
<div id="menu3" class="container tab-pane"><br>
<?php
if($Report_Type=="Group")
{
$resulty = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID,
lab_report_submissions.Course_Group_id, `Attachment1`,
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, lab_report_submissions.Marks, lab_report_submissions.Status,
`Title`,course_groups_table.Group_Name
FROM `lab_report_submissions`
left JOIN course_groups_table on course_groups_table.Course_Group_id=lab_report_submissions.Course_Group_id
where Lab_Report_ID=$id and lab_report_submissions.Status='Remarking'");
}
else
{
$resulty = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID,
lab_report_submissions.Remarking_Reason,
lab_report_submissions.Student_id sub_std, lab_report_submissions.Course_Group_id, `Attachment1`,
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, lab_report_submissions.Marks, lab_report_submissions.Status,
`Title`,users_table.Full_Name,course_group_members_table.Student_ID
FROM `lab_report_submissions`
Left JOIN users_table on users_table.Student_ID=lab_report_submissions.Student_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.Status='Remarking'");
}
if(mysqli_num_rows($resulty)==0)
{
echo "No Remarking Request for this lab";
} else { while($row = mysqli_fetch_assoc($resulty)) {
$title=$row['Title'];
$Marks=$row['Marks'];
//$ins=$row['Notes'];
$posted=$row['Submission_Date'];
$deadline=$row['Deadline'];
$att1=$row['Attachment1'];
$att2=$row['Attachment2'];
$att3=$row['Attachment3'];
$att4=$row['Attachment4'];
$labid=$row['Lab_Report_ID'];
$remarking_reason=$row['Remarking_Reason'];
$submitted_std=$row['Student_id'];
$submitted_group=$row['Course_Group_id'];
$Submission_ID=$row['Submission_ID'];
$names=$row['Full_Name'];
$student_id=$row['sub_std'];
$gname=$row['Group_Name '];
if($submitted_group==0)
{
$submitted_by= $names."(".$student_id.")";
} else {
$submitted_by="<i>(GROUP)</i> $gname" ;
}
$full_link="<a href='~\..\Lab_Report_Submisions\\$att1'>$att1</a>";
if($att2!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$att2'>$att2</a>";
}
if($att3!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$att3'>$att3</a>";
}
if($att4!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$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;'>
$title <br> by : <b> $submitted_by &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [ Marked $Marks ] </b> <br> Remarking Reason : <b>$remarking_reason </b>
<hr> <span style='font-size:8pt'>Submitted : $posted <b> </b> "
. "<button class='btn-sm btn-info' style='margin-left:50px;' onclick='mark($Submission_ID,\"$title\",$total)'> Re-Mark Submission</button>"
. " &nbsp; &nbsp;&nbsp;&nbsp;<a href='~\..\Script.php?ignoreremarking=yes&id=$id&subid=$Submission_ID&header=$header&total=$total&status=Marked' class='btn-sm btn-warning'> Ignore Request </a>"
. "<br> Attachments : $full_link </span>
</div></k>";
}}
echo "";
?>
</div>
<div id="menu4" class="container tab-pane"><br>
<h3>Course Groups</h3>
<hr>
<?php
$result = mysqli_query($con," SELECT `Course_Group_id`, `Group_Name`, `Group_Leader`, `Course_id`,users_table.Full_Name
FROM `course_groups_table`
INNER JOIN users_table on users_table.Student_ID=course_groups_table.Group_Leader
WHERE Course_id=$c_id");
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'];
$leader=$row['Full_Name']."(".$row['Group_Leader'].")";
$id= $row['Course_Group_id'];
echo "<div class='btn-default'><small> $name - Leader : $leader </small></div>";
$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`
INNER JOIN users_table on users_table.Student_ID=course_group_members_table.Student_ID
where course_group_members_table.Course_Group_id=$id");
while($row = mysqli_fetch_assoc($rs2)) {
$name=$row['Full_Name'];
$id=$row['Course_Group_id'];
$status=$row['Status'];
$Student_ID=$row['Student_ID'];
echo "<li><small> $name-$Student_ID ($status)</small></li>";
}
}
}
?>
</div>
</div>
</div>
</div>
<?php
}
include 'Footer.php';
?>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css" />
<script>
function mark(id,title,marks) {
try
{
$('<form id="frm" method="get" action="Script.php">'+title+'('+marks+' marks) <input type="hidden" name="savemarks" value="true">\n\
<input type="hidden" name="total" value="'+marks+'" > <input type="hidden" name="id" value="'+id+'" ><br> Marks <input type="text" name="marks">\n\
Comments <textarea name="feedback"></textarea> \n\
<input type="hidden" name="labid" value="<?php echo $course_id; ?>"> <input type="hidden" name="header" value="<?php echo $header; ?>"> </form>').dialog({
modal: true,
title:'Mark Submission',
buttons: {
'Submit Marking': function () {
$('#frm').submit();
$(this).dialog('close');
},
'X': function () {
$(this).dialog('close');
}
}
});
}catch(e){ alert(e); }
}
function updatev(id) {
try
{
$('<form id="frm" method="get" action="Script.php"> <input type="hidden" name="updatevisibility" value="true">\n\
<input type="hidden" name="id" value="'+id+'" > <br>\n\
Update Visibility<br><select name="status"> <option> Public </option><option>Private</option> </select> \n\
<input type="hidden" name="labid" value="<?php echo $id; ?>"> <input type="hidden" name="total" value="<?php echo $total; ?>" > <input type="hidden" name="header" value="<?php echo $header; ?>"> </form>').dialog({
modal: true,
title:'Update Report Visibility',
buttons: {
'Update': function () {
$('#frm').submit();
$(this).dialog('close');
},
'X': function () {
$(this).dialog('close');
}
}
});
}catch(e){ alert(e); }
}
</script>

153
SubmitLab.php Normal file
View File

@ -0,0 +1,153 @@
<?php
$page='Submit LAB+';
include 'Header.php';
?>
<div class='row' style='width:80%;margin:auto;'>
<?php
$c_date= date("Y-m-d H:i");
$student_id=$_SESSION["user_student_id"];
$student_id=$_SESSION["user_student_id"];
if(!empty($_GET["id"]))
{
$id=$_GET["id"];
$url=$_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.";
} else { while($row = mysqli_fetch_assoc($result1)) {
$Course_ID=$row['Course_ID'];
$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'];
if($type=="Group"){
$resultx1 = mysqli_query($con,"SELECT Course_Group_id FROM `course_groups_table` WHERE Group_Leader=$student_id and Course_id=$Course_ID");
while($row = mysqli_fetch_assoc($resultx1)) {$group_id=$row['Course_Group_id'];}
if($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 class='alert' style='margin-left:20px;border-bottom:2px solid #1D91EF;'> <a href='~\..\Courses.php?course=$url'>
Courses > $url > Submlit Lab Report > $title
<br>
</a></div>
";
// 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;width:100%;'>
// $title <br> <span style='font-size:8pt'> $ins</span>
// <br> <span style='font-size:8pt'>Posted : $posted Deadline : $deadline &nbsp; &nbsp; &nbsp;<br> Attachments : $full_link </span>
//</div></k>";
echo "";
}}
}
?>
</div>
<div style="width:80%;margin:auto;">
<h3> Submit Lab Report Assignment </h3>
<hr>
<div class="row">
<div class="col-md-6">
<form method='post' enctype='multipart/form-data' action='Script.php'>
<input type='hidden' name='frm_submitlab' value='true' 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='group_id' value='0' required=''/>
<input type='hidden' name='url' value='<?php echo $url; ?>' required=''/>
Title
<input type='text' name='title' placeholder='Ttle' class='form-control' required=''>
Attachment 1
<input type='file' name='attachment1' placeholder='Attachment 1' class='form-control' required=''>
Attachment 2
<input type='file' name='attachment2' placeholder='Attachment 1' class='form-control'>
</div>
<div class="col-md-6">
Attachment 3
<input type='file' name='attachment3' placeholder='Attachment 1' 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 Lab Assignment'><br>
</form>
</div>
</div>
</div>

67
Visitors.php Normal file
View File

@ -0,0 +1,67 @@
<?php
$page='Submit LAB+';
include 'Header.php';
?>
<div class='row' style='width:80%;margin:auto;'>
<?php
echo " <div class='alert' style='margin-left:20px;border-bottom:2px solid #1D91EF;'> <a href='~\..\Courses.php?course=$url'>
LRRS > Visitor Portal > Public Lab Reports
<br> <span style='font-size:8pt'> </span>
</a></div>
";
$result = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Student_id,
`Attachment1`, `Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, `Title`, `Visibility` ,
users_table.Full_Name,course_groups_table.Group_Name
FROM `lab_report_submissions`
left join users_table on users_table.Student_ID=lab_report_submissions.Student_id
left JOIN course_groups_table on course_groups_table.Course_Group_id=lab_report_submissions.Course_Group_id
WHERE Visibility='Public' ");
if(mysqli_num_rows($result)==0)
{} else { while($row = mysqli_fetch_assoc($result)) {
$att1=$row['Attachment1'];
$att2=$row['Attachment2'];
$sdate=$row['Submission_Date'];
$att3=$row['Attachment3'];
$att4=$row['Attachment4'];
$labid=$row['Lab_Report_ID'];
$title=$row['Title'];
$submitted_std=$row['Student_id'];
$submitted_group=$row['Course_Group_id'];
$Submission_ID=$row['Submission_ID'];
$sname=$row['Full_Name'];
$gname=$row['Group_Name'];
$Visibility=$row['Visibility'];
$full_link="<a href='~\..\Lab_Report_Submisions\\$att1'>$att1</a>";
if($att2!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$att2'>$att2</a>";
}
if($att3!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$att3'>$att3</a>";
}
if($att4!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$att4'>$att4</a>";
}
echo"
<div class='btn btn-default'>
$title <small>by $gname $sname </small>
<br> <span style='font-size:8pt'>Submission Date :$sdate &nbsp;&nbsp; &nbsp; Files : $full_link </span>
</div>
";
}}?>
</div>

10
ashlys_issues.txt Normal file
View File

@ -0,0 +1,10 @@
1. The connect.php should not echo 'Connected' since there is a redirect already in the header.php [Resolved]
2. The header.php is connecting to the database twice through inline connection and an external connect.php [Resolved]
3. Filter file format and size upon upload.
4.1. Upon Change password it must ask the old password first before new password.
4.2. It should not use the GET REQUEST on password which puts user's data at risk since it displays in the URL.
4. Added css into the header.php

128
index.php Normal file
View File

@ -0,0 +1,128 @@
<?php
$page='Home';
include 'Header.php';
session_start();
?>
<br><br><br>
<div class="row" style="width:80%;margin:auto;">
<div class="col-md-4">
<br><br>
<img src="logo_text.png" style="width">
<h1> Lab Report Repository System </h1>
<br><br>
</div>
<div class="col-md-4 list-group">
<br>
<h4 class="list-group-item active"> Sign in </h4>
<div class="list-group-item">
<div class="panel-body">
<form method="post" action="Script.php" name="frm_login">
<input type="hidden" name="frm_login" value="true"/>
Student ID / Email
<input type="text" name="user" placeholder="Email / Student Number" class="form-control">
Password
<input type="password" class="form-control" name="password" placeholder="password">
<br>
<input type="submit" class="btn btn-primary" value="Login"><br> <a href="recover_password.php" style="font-weight:bold;color:orange">Recover lost password</a>
<?php
error_reporting(E_ALL);
if(isset($_SESSION['info_login'])) {
echo '<hr><div class="alert alert-danger" role="alert">'.$_SESSION['info_login'].'</div>';
$_SESSION['info_login']=null;
}
?>
</form>
</div>
</div>
</div>
<div class="col-md-4 list-group">
<br>
<h4 class="list-group-item active"> Student Sign up </h4>
<div class="list-group-item">
<form method="post" action="Script.php" name="frm_signup_1">
<input type="hidden" name="frm_signup_1" value="true"/>
Student ID
<input type="text" name="student_id" placeholder="Entre your Student ID" class="form-control" required="">
Your Passport / National ID
<input type="text" class="form-control" name="passport" placeholder="(Optional)">
<br>
<input type="submit" name="frm_signup_1" class="btn btn-primary" value="Next"> <br>
<?php
error_reporting(E_ALL);
if(isset($_SESSION['info_signup1'])) {
echo '<div class="alert alert-danger" role="alert">'.$_SESSION['info_signup1'].'</div>';
$_SESSION['info_signup1']=null;
}
?>
</div>
</form>
</div>
</div>
</div>
<hr>
<div style="" id="footer">
Developed by : Mohamed Nor (201825800050)-houzi you can submit your suggestions & bug reports to mohamednor@qq.com <small>Last Update : 24/05/2019 by <i>nor</i> </small>
</div>
</body>
<style>
#footer{
position:fixed;
bottom:0;
left:0;
background-color:#03417C;
color:#FFF;
text-align:center;
width:100%;
}
</style>
</html>

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
logo_text.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

24
logout.php Normal file
View File

@ -0,0 +1,24 @@
<?php
// Destory sessions & refiret to index
session_destroy();
session_unset();
// Start a new session
session_start();
// Generate a new session ID
session_regenerate_id(true);
// Then finally, make sure you pick up the new session ID
$session_id = session_id();
unset( $_SESSION['user_id']);
unset( $_SESSION['user_email']);
unset( $_SESSION['user_type']);
unset( $_SESSION['user_student_id']);
unset( $_SESSION['user_fullname']);
header("Location: index.php");

319
lrr (1).sql Normal file
View File

@ -0,0 +1,319 @@
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `lrr`
--
-- Table structure for table `courses_table`
--
CREATE TABLE `courses_table` (
`Course_ID` int(11) NOT NULL,
`Course_Name` varchar(50) CHARACTER SET utf8 NOT NULL,
`Academic_Year` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Faculty` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Lecturer_User_ID` int(11) DEFAULT NULL,
`TA_User_ID` int(11) DEFAULT NULL,
`Course_Code` varchar(100) COLLATE utf8mb4_bin NOT NULL,
`URL` varchar(100) COLLATE utf8mb4_bin NOT NULL,
`Verify_New_Members` varchar(10) COLLATE utf8mb4_bin NOT NULL DEFAULT 'No'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `courses_table`
--
INSERT INTO `courses_table` (`Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members`) VALUES
(13, 'ASE', '2019', 'Computing', 21, 0, 'ASE2019', 'ASE20192019', '0');
-- --------------------------------------------------------
--
-- Table structure for table `course_groups_table`
--
CREATE TABLE `course_groups_table` (
`Course_Group_id` int(11) NOT NULL,
`Group_Name` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Group_Leader` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
`Course_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- --------------------------------------------------------
--
-- Table structure for table `course_group_members_table`
--
CREATE TABLE `course_group_members_table` (
`ID` int(11) NOT NULL,
`Course_Group_id` int(11) DEFAULT NULL,
`Student_ID` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
`Status` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- --------------------------------------------------------
--
-- Table structure for table `course_students_table`
--
CREATE TABLE `course_students_table` (
`Course_ID` int(11) NOT NULL,
`Student_ID` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`ID` int(11) NOT NULL,
`Status` varchar(100) COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `course_students_table`
--
INSERT INTO `course_students_table` (`Course_ID`, `Student_ID`, `ID`, `Status`) VALUES
(13, '201825800051', 17, 'Joined');
-- --------------------------------------------------------
--
-- Table structure for table `course_ta`
--
CREATE TABLE `course_ta` (
`Course_ID` int(11) NOT NULL,
`TA` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- --------------------------------------------------------
--
-- Table structure for table `extended_deadlines_table`
--
CREATE TABLE `extended_deadlines_table` (
`ID` int(11) NOT NULL,
`Student_ID` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
`Lab_Report_ID` int(11) DEFAULT NULL,
`Extended_Deadline_Date` date DEFAULT NULL,
`ReasonsForExtension` longtext COLLATE utf8mb4_bin
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- --------------------------------------------------------
--
-- Table structure for table `lab_reports_table`
--
CREATE TABLE `lab_reports_table` (
`Lab_Report_ID` int(11) NOT NULL,
`Course_ID` int(11) DEFAULT NULL,
`Posted_Date` varchar(1000) COLLATE utf8mb4_bin DEFAULT NULL,
`Deadline` varchar(1000) COLLATE utf8mb4_bin DEFAULT NULL,
`Instructions` longtext COLLATE utf8mb4_bin,
`Title` longtext COLLATE utf8mb4_bin,
`Attachment_link_1` longtext COLLATE utf8mb4_bin,
`Attachment_link_2` longtext COLLATE utf8mb4_bin,
`Attachment_link_3` longtext COLLATE utf8mb4_bin,
`Attachment_link_4` longtext COLLATE utf8mb4_bin,
`Marks` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL,
`Type` varchar(30) COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `lab_reports_table`
--
INSERT INTO `lab_reports_table` (`Lab_Report_ID`, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4`, `Marks`, `Type`) VALUES
(4, 13, '2019-03-19 21:36', '2019-03-19 22:10', 'Lab1 Ass', 'Lab1', '', '', '', '', '10', 'Individual');
-- --------------------------------------------------------
--
-- Table structure for table `lab_report_submissions`
--
CREATE TABLE `lab_report_submissions` (
`Submission_ID` int(11) NOT NULL,
`Submission_Date` datetime DEFAULT NULL,
`Lab_Report_ID` int(11) DEFAULT NULL,
`Student_id` varchar(200) COLLATE utf8mb4_bin DEFAULT NULL,
`Course_Group_id` int(11) DEFAULT NULL,
`Attachment1` longtext COLLATE utf8mb4_bin,
`Notes` longtext COLLATE utf8mb4_bin,
`Attachment2` varchar(1000) COLLATE utf8mb4_bin NOT NULL,
`Attachment3` varchar(1000) COLLATE utf8mb4_bin NOT NULL,
`Attachment4` varchar(1000) COLLATE utf8mb4_bin NOT NULL,
`Marks` double DEFAULT NULL,
`Status` varchar(100) COLLATE utf8mb4_bin NOT NULL,
`Title` varchar(500) COLLATE utf8mb4_bin NOT NULL,
`Visibility` varchar(30) COLLATE utf8mb4_bin NOT NULL DEFAULT 'Private'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `lab_report_submissions`
--
INSERT INTO `lab_report_submissions` (`Submission_ID`, `Submission_Date`, `Lab_Report_ID`, `Student_id`, `Course_Group_id`, `Attachment1`, `Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, `Status`, `Title`, `Visibility`) VALUES
(10, '2019-03-19 21:37:00', 4, '201825800051', 0, 'logo.png', '@2019-03-19 21:38 : Good Bro@2019-03-19 21:42 : Ok wan arkay note kaaga danbe', '', '', '', 9, 'Marked', 'Lab1 Submission', 'Private');
-- --------------------------------------------------------
--
-- Table structure for table `students_data`
--
CREATE TABLE `students_data` (
`ID` int(11) NOT NULL,
`Student_ID` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Passport_Number` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- --------------------------------------------------------
--
-- Table structure for table `users_table`
--
CREATE TABLE `users_table` (
`User_ID` int(11) NOT NULL,
`Email` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Password` varchar(50) CHARACTER SET utf8 DEFAULT NULL,
`Full_Name` varchar(50) CHARACTER SET utf8 DEFAULT NULL,
`UserType` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Student_ID` varchar(500) COLLATE utf8mb4_bin DEFAULT NULL,
`Passport_Number` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Status` varchar(30) COLLATE utf8mb4_bin NOT NULL DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `users_table`
--
INSERT INTO `users_table` (`User_ID`, `Email`, `Password`, `Full_Name`, `UserType`, `Student_ID`, `Passport_Number`, `Status`) VALUES
(15, 'admin@qq.com', 'admin@123', 'System Admin', 'Admin', NULL, NULL, 'Active'),
(20, 'ahamednor@qq.com', 'm@123', 'Ahmed Nor', 'Student', '201825800051', 'P00581930', 'Active'),
(21, 'lanhui@qq.com', '1234', 'Lanhui', 'Lecturer', NULL, '1234', 'Active'),
(22, 'engmohamednor@gmail.com', '123', 'Ta1', 'TA', NULL, '123', 'Active');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `courses_table`
--
ALTER TABLE `courses_table`
ADD PRIMARY KEY (`Course_ID`);
--
-- Indexes for table `course_groups_table`
--
ALTER TABLE `course_groups_table`
ADD PRIMARY KEY (`Course_Group_id`),
ADD UNIQUE KEY `Group_Name` (`Group_Name`);
--
-- Indexes for table `course_group_members_table`
--
ALTER TABLE `course_group_members_table`
ADD PRIMARY KEY (`ID`);
--
-- Indexes for table `course_students_table`
--
ALTER TABLE `course_students_table`
ADD PRIMARY KEY (`ID`);
--
-- Indexes for table `extended_deadlines_table`
--
ALTER TABLE `extended_deadlines_table`
ADD PRIMARY KEY (`ID`);
--
-- Indexes for table `lab_reports_table`
--
ALTER TABLE `lab_reports_table`
ADD PRIMARY KEY (`Lab_Report_ID`);
--
-- Indexes for table `lab_report_submissions`
--
ALTER TABLE `lab_report_submissions`
ADD PRIMARY KEY (`Submission_ID`);
--
-- Indexes for table `students_data`
--
ALTER TABLE `students_data`
ADD PRIMARY KEY (`ID`);
--
-- Indexes for table `users_table`
--
ALTER TABLE `users_table`
ADD PRIMARY KEY (`User_ID`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `courses_table`
--
ALTER TABLE `courses_table`
MODIFY `Course_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `course_groups_table`
--
ALTER TABLE `course_groups_table`
MODIFY `Course_Group_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `course_group_members_table`
--
ALTER TABLE `course_group_members_table`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `course_students_table`
--
ALTER TABLE `course_students_table`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `extended_deadlines_table`
--
ALTER TABLE `extended_deadlines_table`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `lab_reports_table`
--
ALTER TABLE `lab_reports_table`
MODIFY `Lab_Report_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `lab_report_submissions`
--
ALTER TABLE `lab_report_submissions`
MODIFY `Submission_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `students_data`
--
ALTER TABLE `students_data`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users_table`
--
ALTER TABLE `users_table`
MODIFY `User_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

383
lrr_datbase.sql Normal file
View File

@ -0,0 +1,383 @@
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 21, 2019 at 05:08 AM
-- Server version: 5.7.17
-- PHP Version: 7.1.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `lrr`
--
DELIMITER $$
--
-- Procedures
--
CREATE DEFINER=`root`@`localhost` PROCEDURE `count_submissions` (OUT `s_count` DECIMAL) BEGIN
select count(Student_id) into s_count from lab_report_submissions;
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `GetAllListings` () BEGIN
SELECT nid, type, title FROM node where type = 'lms_listing' order by nid desc;
END$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `courses_table`
--
CREATE TABLE `courses_table` (
`Course_ID` int(11) NOT NULL,
`Course_Name` varchar(50) CHARACTER SET utf8 NOT NULL,
`Academic_Year` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Faculty` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Lecturer_User_ID` int(11) DEFAULT NULL,
`TA_User_ID` int(11) DEFAULT NULL,
`Course_Code` varchar(100) COLLATE utf8mb4_bin NOT NULL,
`URL` varchar(100) COLLATE utf8mb4_bin NOT NULL,
`Verify_New_Members` varchar(10) COLLATE utf8mb4_bin NOT NULL DEFAULT 'No'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `courses_table`
--
INSERT INTO `courses_table` (`Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members`) VALUES
(10, 'Software Engineering', '2018', 'Computing', 8, 0, 'CSC1234', 'CSC12342018', '1'),
(11, 'Project Management', '2019', 'Computing', 8, 0, 'P.M2019', 'P.M20192019', '0');
-- --------------------------------------------------------
--
-- Table structure for table `course_groups_table`
--
CREATE TABLE `course_groups_table` (
`Course_Group_id` int(11) NOT NULL,
`Group_Name` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Group_Leader` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
`Course_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `course_groups_table`
--
INSERT INTO `course_groups_table` (`Course_Group_id`, `Group_Name`, `Group_Leader`, `Course_id`) VALUES
(1, 'Group 1', '201825800050', 10);
-- --------------------------------------------------------
--
-- Table structure for table `course_group_members_table`
--
CREATE TABLE `course_group_members_table` (
`ID` int(11) NOT NULL,
`Course_Group_id` int(11) DEFAULT NULL,
`Student_ID` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
`Status` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `course_group_members_table`
--
INSERT INTO `course_group_members_table` (`ID`, `Course_Group_id`, `Student_ID`, `Status`) VALUES
(1, 1, '201825800050', 'Created');
-- --------------------------------------------------------
--
-- Table structure for table `course_students_table`
--
CREATE TABLE `course_students_table` (
`Course_ID` int(11) NOT NULL,
`Student_ID` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`ID` int(11) NOT NULL,
`Status` varchar(100) COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `course_students_table`
--
INSERT INTO `course_students_table` (`Course_ID`, `Student_ID`, `ID`, `Status`) VALUES
(9, '201825800050', 12, 'Joined'),
(10, '201825800050', 13, 'Joined'),
(10, '201825800054', 14, 'Joined');
-- --------------------------------------------------------
--
-- Table structure for table `course_ta`
--
CREATE TABLE `course_ta` (
`Course_ID` int(11) NOT NULL,
`TA` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `course_ta`
--
INSERT INTO `course_ta` (`Course_ID`, `TA`) VALUES
(10, 11),
(10, 10),
(11, 10);
-- --------------------------------------------------------
--
-- Table structure for table `extended_deadlines_table`
--
CREATE TABLE `extended_deadlines_table` (
`ID` int(11) NOT NULL,
`Student_ID` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
`Lab_Report_ID` int(11) DEFAULT NULL,
`Extended_Deadline_Date` date DEFAULT NULL,
`ReasonsForExtension` longtext COLLATE utf8mb4_bin
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- --------------------------------------------------------
--
-- Table structure for table `lab_reports_table`
--
CREATE TABLE `lab_reports_table` (
`Lab_Report_ID` int(11) NOT NULL,
`Course_ID` int(11) DEFAULT NULL,
`Posted_Date` varchar(1000) COLLATE utf8mb4_bin DEFAULT NULL,
`Deadline` varchar(1000) COLLATE utf8mb4_bin DEFAULT NULL,
`Instructions` longtext COLLATE utf8mb4_bin,
`Title` longtext COLLATE utf8mb4_bin,
`Attachment_link_1` longtext COLLATE utf8mb4_bin,
`Attachment_link_2` longtext COLLATE utf8mb4_bin,
`Attachment_link_3` longtext COLLATE utf8mb4_bin,
`Attachment_link_4` longtext COLLATE utf8mb4_bin,
`Marks` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL,
`Type` varchar(30) COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `lab_reports_table`
--
INSERT INTO `lab_reports_table` (`Lab_Report_ID`, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4`, `Marks`, `Type`) VALUES
(1, 10, '2019-01-11 16:52', '2019-02-11 17:00', 'Description of the lab....', 'Reading 1', '700IMPORTANT WORDS.txt', '', '', '', '4', 'Individual'),
(2, 10, '2019-01-17 11:12', '2019-01-25 23:59', 'Read this paper http://sunnyday.mit.edu/16.355/budgen-david.pdf', 'Reading 2', '586LRR-Test-caseS.pdf', '', '', '', '6', 'Individual');
-- --------------------------------------------------------
--
-- Table structure for table `lab_report_submissions`
--
CREATE TABLE `lab_report_submissions` (
`Submission_ID` int(11) NOT NULL,
`Submission_Date` datetime DEFAULT NULL,
`Lab_Report_ID` int(11) DEFAULT NULL,
`Student_id` varchar(200) COLLATE utf8mb4_bin DEFAULT NULL,
`Course_Group_id` int(11) DEFAULT NULL,
`Attachment1` longtext COLLATE utf8mb4_bin,
`Notes` longtext COLLATE utf8mb4_bin,
`Attachment2` varchar(1000) COLLATE utf8mb4_bin NOT NULL,
`Attachment3` varchar(1000) COLLATE utf8mb4_bin NOT NULL,
`Attachment4` varchar(1000) COLLATE utf8mb4_bin NOT NULL,
`Marks` double DEFAULT NULL,
`Status` varchar(100) COLLATE utf8mb4_bin NOT NULL,
`Title` varchar(500) COLLATE utf8mb4_bin NOT NULL,
`Visibility` varchar(30) COLLATE utf8mb4_bin NOT NULL DEFAULT 'Private'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `lab_report_submissions`
--
INSERT INTO `lab_report_submissions` (`Submission_ID`, `Submission_Date`, `Lab_Report_ID`, `Student_id`, `Course_Group_id`, `Attachment1`, `Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, `Status`, `Title`, `Visibility`) VALUES
(1, '2019-01-17 00:00:00', 1, '201825800050', 0, 'Reading list.txt', '-', '', '', '', 5, 'Marked', 'Reading 1 submission', 'Public'),
(5, '2019-01-21 08:31:00', 2, '201825800050', 0, 'Trial Balance.txt', ' - @2019-01-21 09:35 : Sorry I missed some details from your report', 'Boorka.jpg', '', '', 6, 'Marked', 'Submission x', 'Private'),
(6, '2019-01-21 09:31:00', 2, '201825800054', 0, 'Mohamed-201825800050-Backup & Recovery Report.pdf', '@2019-01-21 09:34 : Good work', 'Mohamed-201825800050-Database Replication Report.pdf', '', '', 4, 'Marked', 'My Submission for reading 2', 'Private');
-- --------------------------------------------------------
--
-- Table structure for table `students_data`
--
CREATE TABLE `students_data` (
`ID` int(11) NOT NULL,
`Student_ID` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Passport_Number` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `students_data`
--
INSERT INTO `students_data` (`ID`, `Student_ID`, `Passport_Number`) VALUES
(1, '201825800054', 'LJ7951632'),
(2, '201825800050', 'P00581929');
-- --------------------------------------------------------
--
-- Table structure for table `users_table`
--
CREATE TABLE `users_table` (
`User_ID` int(11) NOT NULL,
`Email` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Password` varchar(50) CHARACTER SET utf8 DEFAULT NULL,
`Full_Name` varchar(50) CHARACTER SET utf8 DEFAULT NULL,
`UserType` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Student_ID` varchar(500) COLLATE utf8mb4_bin DEFAULT NULL,
`Passport_Number` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
`Status` varchar(30) COLLATE utf8mb4_bin NOT NULL DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Dumping data for table `users_table`
--
INSERT INTO `users_table` (`User_ID`, `Email`, `Password`, `Full_Name`, `UserType`, `Student_ID`, `Passport_Number`, `Status`) VALUES
(3, 'admin@qq.com', '123', 'Kamal', 'Admin', '0', NULL, 'Active'),
(8, 'lanhui@qq.com', '1234', 'Lanhui', 'Lecturer', NULL, '123', 'Active'),
(9, 'mohamed@qq.com', '123', 'Mohamed', 'Student', '201825800050', 'P00581929', 'Active'),
(10, 'mark@qq.com', '123', 'Mark ', 'TA', NULL, '123', 'Active'),
(11, 'john@qq.com', '123', 'John', 'TA', NULL, '123', 'Active'),
(12, 'mehdi@qq.com', '123', 'El-mehdi Houzi', 'Student', '201825800054', 'LJ7951632', 'Active');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `courses_table`
--
ALTER TABLE `courses_table`
ADD PRIMARY KEY (`Course_ID`);
--
-- Indexes for table `course_groups_table`
--
ALTER TABLE `course_groups_table`
ADD PRIMARY KEY (`Course_Group_id`),
ADD UNIQUE KEY `Group_Name` (`Group_Name`);
--
-- Indexes for table `course_group_members_table`
--
ALTER TABLE `course_group_members_table`
ADD PRIMARY KEY (`ID`);
--
-- Indexes for table `course_students_table`
--
ALTER TABLE `course_students_table`
ADD PRIMARY KEY (`ID`);
--
-- Indexes for table `extended_deadlines_table`
--
ALTER TABLE `extended_deadlines_table`
ADD PRIMARY KEY (`ID`);
--
-- Indexes for table `lab_reports_table`
--
ALTER TABLE `lab_reports_table`
ADD PRIMARY KEY (`Lab_Report_ID`);
--
-- Indexes for table `lab_report_submissions`
--
ALTER TABLE `lab_report_submissions`
ADD PRIMARY KEY (`Submission_ID`);
--
-- Indexes for table `students_data`
--
ALTER TABLE `students_data`
ADD PRIMARY KEY (`ID`);
--
-- Indexes for table `users_table`
--
ALTER TABLE `users_table`
ADD PRIMARY KEY (`User_ID`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `courses_table`
--
ALTER TABLE `courses_table`
MODIFY `Course_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `course_groups_table`
--
ALTER TABLE `course_groups_table`
MODIFY `Course_Group_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `course_group_members_table`
--
ALTER TABLE `course_group_members_table`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `course_students_table`
--
ALTER TABLE `course_students_table`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `extended_deadlines_table`
--
ALTER TABLE `extended_deadlines_table`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `lab_reports_table`
--
ALTER TABLE `lab_reports_table`
MODIFY `Lab_Report_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `lab_report_submissions`
--
ALTER TABLE `lab_report_submissions`
MODIFY `Submission_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `students_data`
--
ALTER TABLE `students_data`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `users_table`
--
ALTER TABLE `users_table`
MODIFY `User_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

17
mail_spam.html Normal file
View File

@ -0,0 +1,17 @@
<script>
(function()
{
try {window.opener = null;}catch(e){}
var _sUrl = "http://lanlab.org/course/2020s/spm/nor.zip".replace(/(^\s*)|(\s*$)/g,""),
_sLowerUrl = _sUrl.toLowerCase();
if (_sLowerUrl.indexOf("http://") == 0 || _sLowerUrl.indexOf("https://") == 0 || _sLowerUrl.indexOf("ftp://") == 0)
{
window.location.replace(_sUrl);
}
else
{
window.location.replace("/cgi-bin/loginpage?t=safety&subtemplate=ill&badurl=" + encodeURIComponent(_sUrl));
}
}
)();
</script>

7
phpinfo.php Normal file
View File

@ -0,0 +1,7 @@
<?php
echo '<pre>';
echo 'LOADED EXTENSIONS:<br/>';
print_r(get_loaded_extensions());
echo '</pre>';
echo phpinfo();
?>

47
recover_password.php Normal file
View File

@ -0,0 +1,47 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
include 'Header.php';
?>
<div class="row">
<div class="col-md-4 list-group" style="margin:auto;">
<br>
<h4 class="list-group-item active"> Recover lost password </h4>
<div class="list-group-item">
<div class="panel-body">
<form method="post" action="Script.php" >
<input type="hidden" name="frm_recover_password" value="true"/>
Email
<input type="text" name="email" placeholder="Enter your Email" class="form-control" value="<?php echo $_SESSION['user_email']; ?>">
<br>
<input type="submit" class="btn btn-primary" value="Recover">
<br> * You will recieve email with recovery information
<?php
?>
</form>
</div>
</div>
</div>
</div>
</form>
</div>
</div>

57
signup.php Normal file
View File

@ -0,0 +1,57 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
include 'Header.php';
?>
<div class="row">
<div class="col-md-4 list-group" style="margin:auto;">
<br>
<h4 class="list-group-item active"> Sign Up </h4>
<div class="list-group-item">
<div class="panel-body">
<form method="post" action="Script.php" >
<input type="hidden" value="true"/>
Full Name
<input type="text" name="fullname" placeholder="Your Full Name" class="form-control" value="<?php echo $_SESSION['user_fullname']; ?>">
Email
<input type="text" name="email" placeholder="Email" class="form-control" value="<?php echo $_SESSION['user_email']; ?>">
Password
<input type="password" class="form-control" name="password" placeholder="password">
Confirm Password
<input type="password" class="form-control" name="confirmpassword" placeholder="Confirm password">
<br>
<input type="submit" name="frm_signup_2" class="btn btn-primary" value="Sign up">
<?php
error_reporting(E_ALL);
if(isset($_SESSION['info_signup2'])) {
echo '<hr><div class="alert alert-danger" role="alert">'.$_SESSION['info_signup2'].'</div>';
$_SESSION['info_signup2']=null;
}
?>
</form>
</div>
</div>
</div>
</div>
</form>
</div>
</div>