(1) Make php files look better; (2) Removed Visitors.php and Reset_password.php because they are no longer used; (3) TODO: review Submissions.php, Script.php, Course.php and Courses.php.
parent
975cdfec63
commit
a56b4c00dd
99
Admin.php
99
Admin.php
|
@ -16,33 +16,20 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
?>
|
||||
|
||||
|
||||
<style>
|
||||
.col-md-4 {
|
||||
border-right: 1px solid skyblue;
|
||||
}
|
||||
</style>
|
||||
|
||||
<br>
|
||||
<div style="width: 80%;margin: auto;">
|
||||
<h2> Administration Panel </h2>
|
||||
<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">
|
||||
|
||||
<?php
|
||||
<!-- <?php
|
||||
if ($_SESSION['user_type'] == "Lecturer") {
|
||||
|
||||
echo " <h4> TA Account Management </h4>
|
||||
<hr> " ;
|
||||
echo " <h4> TA Account Management </h4> <hr> " ;
|
||||
echo "<b>TA Accounts </b><br>" ;
|
||||
}
|
||||
else if($_SESSION['user_type'] == "Admin"){
|
||||
|
@ -51,7 +38,7 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
echo "<b>Lecturer Accounts </b><br>";
|
||||
}
|
||||
|
||||
?>
|
||||
?> -->
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
@ -59,15 +46,15 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
<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>
|
||||
<a class="nav-link active" data-toggle="tab" href="#home">Create TA account</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#menu2" id="batch_tab">Batch Create New Student Accounts</a>
|
||||
<a class="nav-link" data-toggle="tab" href="#menu1" id="batch_tab">Batch create student accounts</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#menu1" id="existing_accounts_tab">Existing Accounts</a>
|
||||
<a class="nav-link" data-toggle="tab" href="#menu2" id="existing_accounts_tab">Existing accounts</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -136,7 +123,20 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
|
||||
</div>
|
||||
|
||||
<div id="menu1" class="container tab-pane fade"><br>
|
||||
|
||||
<!-- code contributed by Xu Xiaopeng (https://github.com/xxp1999) -->
|
||||
<div id="menu1" class="container tab-pane fade" style="margin-top:10px">
|
||||
<b>Separate two student numbers with a space</b><br>
|
||||
<form action="batch_insert.php" method="post" id="batch_form">
|
||||
<p>
|
||||
<textarea cols="70" rows="16" name="users" required=""></textarea>
|
||||
</p>
|
||||
<input type="submit" class="btn btn-primary" value="Register students" id="register_btn"><br>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="menu2" class="container tab-pane fade"><br>
|
||||
|
||||
<table class="table-bordered" style="font-size: 10pt;">
|
||||
<tr style="font-size:10pt;">
|
||||
|
@ -144,7 +144,7 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Passport / ID </th>
|
||||
<th>Reset Password </th>
|
||||
<th>Reset password </th>
|
||||
<th>Block/Activate </th>
|
||||
</tr>
|
||||
<?php
|
||||
|
@ -153,20 +153,20 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
|
||||
$result = mysqli_query(
|
||||
$con,
|
||||
"SELECT * FROM Users_Table WHERE UserType in ('TA')"
|
||||
"SELECT * FROM users_table WHERE UserType in ('TA')"
|
||||
);
|
||||
}
|
||||
|
||||
else if($_SESSION['user_type'] == "Admin"){
|
||||
else if ($_SESSION['user_type'] == "Admin"){
|
||||
$result = mysqli_query(
|
||||
$con,
|
||||
"SELECT * FROM Users_Table WHERE UserType in ('Lecturer')"
|
||||
"SELECT * FROM users_table WHERE UserType in ('Lecturer')"
|
||||
);
|
||||
}
|
||||
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
$pass = $row['Passport_Number'];
|
||||
$btn = "<button class='btn-primary' onclick=\"updatePass(" . $row['User_ID'] . ",'$pass')\">Reset</button>";
|
||||
$btn = "<button class='btn-warning' 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')\" id=\"block_account_1\">Block</button>";
|
||||
|
@ -182,18 +182,6 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
|
||||
</div>
|
||||
|
||||
<!-- code contributed by Xu Xiaopeng (https://github.com/xxp1999) -->
|
||||
|
||||
<div id="menu2" class="container tab-pane fade" style="margin-top:10px">
|
||||
<b>Separate two student numbers with a space.</b><br>
|
||||
<form action="batch_insert.php" method="post" id="batch_form">
|
||||
<p>
|
||||
<textarea cols="80" rows="16" name="users" required=""></textarea>
|
||||
</p>
|
||||
<input type="submit" class="btn btn-primary" value="Register Students" id="register_btn"><br>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -202,32 +190,29 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
<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="#menub" id="existing_courses">Existing Courses</a>
|
||||
<a class="nav-link active" data-toggle="tab" href="#menu3" id="existing_courses">Existing courses</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- Tab panes -->
|
||||
|
||||
</div>
|
||||
|
||||
<div id="menub" class="container tab-pane active"><br>
|
||||
<div id="menu3" class="container tab-pane active"><br>
|
||||
|
||||
<b> Existing Course Portals </b>
|
||||
<b> Past courses </b>
|
||||
<hr>
|
||||
<table class="table-bordered" style="font-size: 10pt;">
|
||||
<tr>
|
||||
<th>Course Name </th>
|
||||
<th> Faculty </th>
|
||||
<th>Lecturer </th>
|
||||
<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");
|
||||
$user_id = $_SESSION['user_id'];
|
||||
$result = mysqli_query($con, "SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`, `TA_User_ID`, `Course_Code`, `Full_Name` FROM courses_table INNER JOIN users_table ON users_table.User_ID=courses_table.Lecturer_User_ID WHERE User_ID=$user_id ORDER BY Academic_Year DESC;");
|
||||
if (mysqli_num_rows($result) == 0) {
|
||||
} else {
|
||||
$counter = 0;
|
||||
|
@ -240,9 +225,7 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
$c_id = $row['Course_ID'];
|
||||
$counter += 1;
|
||||
|
||||
$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");
|
||||
$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)) {
|
||||
|
@ -252,7 +235,7 @@ where course_ta.Course_ID=$c_id");
|
|||
echo "
|
||||
<tr> <td>$code - $name</td> <td>$faculty </td> <td>$lecturer</td><td>$ta</td> <td><form method='get' action='Script.php' id='drop_menu_form_$counter'> <select name='ta' class=''>";
|
||||
|
||||
$resultx = mysqli_query($con, "SELECT * FROM Users_Table WHERE UserType='TA'");
|
||||
$resultx = mysqli_query($con, "SELECT * FROM users_table WHERE UserType='TA'");
|
||||
if (mysqli_num_rows($resultx) == 0) {
|
||||
} else {
|
||||
while ($row = mysqli_fetch_assoc($resultx)) {
|
||||
|
@ -273,11 +256,11 @@ where course_ta.Course_ID=$c_id");
|
|||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
function updatePass(id, pass) {
|
||||
if (!confirm('Are you to Reset User Password')) {
|
||||
if (!confirm('Are you sure to reset user password?')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -285,9 +268,9 @@ where course_ta.Course_ID=$c_id");
|
|||
}
|
||||
|
||||
function blockUser(id, status) {
|
||||
if (!confirm('Are you to change User Status')) {
|
||||
if (!confirm('Are you sure to change user status?')) {
|
||||
return;
|
||||
}
|
||||
window.location.href = "\Script.php\?action=statuschange&uid=" + id + "&status=" + status;
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
|
70
Course.php
70
Course.php
|
@ -55,18 +55,18 @@ if(!empty($_GET["url"]))
|
|||
|
||||
<div class="row" style='margin-left:20px;float:left'>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
if (isset($_SESSION['info_general'])) {
|
||||
if (isset($_SESSION['info_general'])) {
|
||||
echo '<hr><div class="alert alert-info" role="alert" style="float:left;">' . $_SESSION['info_general'] . '</div>';
|
||||
$_SESSION['info_general']=null;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_SESSION['info_courses'])) {
|
||||
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>
|
||||
|
||||
|
@ -77,7 +77,7 @@ if (isset($_SESSION['info_courses'])) {
|
|||
if( $_SESSION['user_type'] == "Student")
|
||||
{
|
||||
|
||||
?>
|
||||
?>
|
||||
<hr>
|
||||
|
||||
<div class="row" style="width:95%;margin:auto; text-align:left;">
|
||||
|
@ -104,7 +104,7 @@ if( $_SESSION['user_type'] == "Student")
|
|||
<div class="tab-content">
|
||||
<div id="menu1" class="container tab-pane active"><br>
|
||||
|
||||
<?php
|
||||
<?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";
|
||||
|
@ -168,7 +168,7 @@ if( $_SESSION['user_type'] == "Student")
|
|||
}
|
||||
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 Deadline : $deadline ($Marks Marks) <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>
|
||||
<br> <span style='font-size:8pt'>Posted : $posted Deadline : $deadline ($Marks Marks) <a href='~\..\SubmitLab.php?id=$labid&url=$url' class='btn-sm btn-info' style='margin-left:50px;'>Submit</a><br> Attachments : $full_link </span>
|
||||
</div></k>";
|
||||
|
||||
}}
|
||||
|
@ -182,7 +182,7 @@ if( $_SESSION['user_type'] == "Student")
|
|||
|
||||
<div id="menu2" class="container tab-pane"><br>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
$group_id=$_SESSION['group_id'];
|
||||
if($group_id == ""){$group_id = -1;} // Individual assignment does not require the student to have a group id. Therefore, the group is an empty string. To make the following SQL statement work properly, initialize the group id to -1.
|
||||
$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`
|
||||
|
@ -246,7 +246,7 @@ Lab_Report_ID not in (select Lab_Report_ID from lab_report_submissions where (St
|
|||
|
||||
|
||||
<div id="menu3" class="container tab-pane"><br>
|
||||
<?php
|
||||
<?php
|
||||
|
||||
|
||||
$group_id = $_SESSION['group_id'];
|
||||
|
@ -363,7 +363,7 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
|
|||
|
||||
|
||||
|
||||
<?php
|
||||
<?php
|
||||
$sqli=mysqli_query($con, "SELECT * from course_groups_table WHERE Course_Group_id=$group_id and Course_id=$course_id");
|
||||
while($row = mysqli_fetch_assoc($sqli))
|
||||
{ $Group_Leader=$row['Group_Leader'];
|
||||
|
@ -377,7 +377,7 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
|
|||
|
||||
|
||||
<div id="menu4" class="container tab-pane"><br>
|
||||
<?php
|
||||
<?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,
|
||||
|
@ -493,19 +493,19 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
|
|||
<div class="col-md-3">
|
||||
<h3>Class Groups</h3>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
$resultx1 = mysqli_query($con,"SELECT `Course_Group_id` FROM `course_groups_table` WHERE Course_id=$course_id");
|
||||
while($row = mysqli_fetch_assoc($resultx1)) {$count_groups=$row['Course_Group_id'];}
|
||||
|
||||
|
||||
echo " <button onclick='CreateGroup()' class='btn btn-primary'> Create Group</button>";
|
||||
echo " <button onclick='CreateGroup()' class='btn btn-primary'>Create group</button>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<?php
|
||||
<?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
|
||||
|
@ -514,7 +514,7 @@ course_groups_table.Course_Group_id=course_group_members_table.Course_Group_id W
|
|||
|
||||
if(mysqli_num_rows($result)==0)
|
||||
{
|
||||
echo "You have no Group in this Course";
|
||||
echo "You have no group in this course.";
|
||||
} else { while($row = mysqli_fetch_assoc($result)) {
|
||||
$name=$row['Group_Name'];
|
||||
$id=$row['Course_Group_id'];
|
||||
|
@ -596,7 +596,7 @@ include 'Footer.php';
|
|||
|
||||
<script>
|
||||
|
||||
function CreateGroup() {
|
||||
function CreateGroup() {
|
||||
|
||||
|
||||
try
|
||||
|
@ -620,15 +620,15 @@ function CreateGroup() {
|
|||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
} catch(e){ alert(e); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function invite(id) {
|
||||
function invite(id) {
|
||||
|
||||
|
||||
try
|
||||
|
@ -652,10 +652,10 @@ function invite(id) {
|
|||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
} catch(e){ alert(e); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -664,7 +664,7 @@ function invite(id) {
|
|||
|
||||
|
||||
|
||||
function accept(id,val) {
|
||||
function accept(id,val) {
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -689,22 +689,22 @@ function accept(id,val) {
|
|||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
} catch(e){ alert(e); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function remarking(data)
|
||||
{
|
||||
function remarking(data)
|
||||
{
|
||||
|
||||
var details = prompt("Please enter your remarking reasons","");
|
||||
|
||||
window.location.href = data+"&details="+details;
|
||||
}
|
||||
}
|
||||
|
||||
function remove_member(student_id, group_id) {
|
||||
function remove_member(student_id, group_id) {
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -728,12 +728,12 @@ function remove_member(student_id, group_id) {
|
|||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
} catch(e){ alert(e); }
|
||||
}
|
||||
}
|
||||
|
||||
function delete_group(id) {
|
||||
function delete_group(id) {
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -756,10 +756,10 @@ function delete_group(id) {
|
|||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
} catch(e){ alert(e); }
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
|
34
Courses.php
34
Courses.php
|
@ -203,7 +203,7 @@ New Date/Time <br><input type="date" name="date" required=""> <input type="time"
|
|||
|
||||
?>
|
||||
|
||||
<h3> Post new Lab Assignment </a></h3>
|
||||
<h3>New an assignment</h3>
|
||||
|
||||
<form method='post' enctype='multipart/form-data' action='Script.php'>
|
||||
<?php
|
||||
|
@ -213,7 +213,7 @@ New Date/Time <br><input type="date" name="date" required=""> <input type="time"
|
|||
<input type='hidden' name='course_id' value='<?php echo "$id" ?>' required=''/>
|
||||
<input type='hidden' name='url' value='<?php echo ".$course_url." ?>' required=''/>
|
||||
|
||||
Deadline Date/Time
|
||||
Deadline (date and time)
|
||||
<div class='row'>
|
||||
<div class='col-md-7'><input type='date' id='date' name='deadlinedate' placeholder='' class='form-control' required='' value=""> </div>
|
||||
<div class='col-md-5'> <input type='time' class='form-control' name='deadlinetime' value=""> </div>
|
||||
|
@ -221,9 +221,9 @@ New Date/Time <br><input type="date" name="date" required=""> <input type="time"
|
|||
|
||||
Title
|
||||
<input type='text' name='title' placeholder='Title' class='form-control' required='' value="">
|
||||
Instructions
|
||||
Instruction
|
||||
<textarea name='instructions' placeholder='Assignment Instructions' class='form-control' required='' value=""></textarea>
|
||||
Marks
|
||||
Mark
|
||||
<input type='text' name='marks' placeholder='Marks' class='form-control' required='' value="">
|
||||
Attachment 1
|
||||
<input type='file' name='attachment1' placeholder='Attachment 1' class='form-control'>
|
||||
|
@ -238,11 +238,11 @@ New Date/Time <br><input type="date" name="date" required=""> <input type="time"
|
|||
Attachment 4
|
||||
<input type='file' name='attachment4' placeholder='Attachment 4' class='form-control' >
|
||||
<br>
|
||||
Submission Type <input type='radio' name='type' value='Individual' required=''> Individual
|
||||
Submission type: <input type='radio' name='type' value='Individual' required=''> Individual
|
||||
|
||||
<input type='radio' name='type' value='Group' required=''> Group
|
||||
<hr>
|
||||
<input type='submit' class='btn btn-primary' value='Post Lab Assignment'><br>
|
||||
<input type='submit' class='btn btn-primary' value='Post'><br>
|
||||
</form><br><br><br><br>
|
||||
<?php
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ New Date/Time <br><input type="date" name="date" required=""> <input type="time"
|
|||
}
|
||||
echo "</div>";
|
||||
|
||||
echo "<div class='col-md-7'> <h3> Lab Report Assignment list </h3>";
|
||||
echo "<div class='col-md-7'><h3>Assignment list</h3>";
|
||||
|
||||
error_reporting(0);
|
||||
if(isset($_SESSION["info_Updated"])){
|
||||
|
@ -276,7 +276,7 @@ New Date/Time <br><input type="date" name="date" required=""> <input type="time"
|
|||
|
||||
if( $_SESSION['user_type']=="TA")
|
||||
{
|
||||
echo "<b style='color:gray'>*Only Lecturer can post a new lab report assignment</b><br>";
|
||||
echo "<b style='color:gray'>Only Lecturer can post assignments.</b><br>";
|
||||
}
|
||||
if(mysqli_num_rows($result)==0)
|
||||
{
|
||||
|
@ -441,7 +441,7 @@ 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>";
|
||||
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'];
|
||||
|
||||
|
@ -464,7 +464,7 @@ WHERE Lecturer_User_ID=$lecturer_id and course_students_table.Status='Pending'"
|
|||
<?php
|
||||
if( $_SESSION['user_type']=="TA")
|
||||
{
|
||||
echo "<center>Only Lecturers can Post new Lab report Assignments</center>";
|
||||
echo "<center>Only Lecturer can post assignments</center>";
|
||||
}
|
||||
if( $_SESSION['user_type']=="Lecturer"){ ?>
|
||||
|
||||
|
@ -473,16 +473,16 @@ WHERE Lecturer_User_ID=$lecturer_id and course_students_table.Status='Pending'"
|
|||
<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
|
||||
Course name
|
||||
<input type="text" name="name" placeholder="Course Name" class="form-control" required="">
|
||||
|
||||
Course Code
|
||||
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
|
||||
Academic year
|
||||
<input type="text" name="academic" placeholder="Academic Year" class="form-control" required="">
|
||||
|
||||
Faculty <br>
|
||||
|
@ -492,7 +492,7 @@ WHERE Lecturer_User_ID=$lecturer_id and course_students_table.Status='Pending'"
|
|||
<input type="hidden" name="lecturer" value="<?php echo $_SESSION['user_id']; ?>">
|
||||
|
||||
|
||||
Verify Joining Students
|
||||
Verify joining students?
|
||||
<input type="radio" name="verify" value="1"> Yes
|
||||
<input type="radio" name="verify" value="0" checked=""> No
|
||||
|
||||
|
@ -570,7 +570,7 @@ if( $_SESSION['user_type']=="Student")
|
|||
|
||||
if(mysqli_num_rows($result)==0)
|
||||
{
|
||||
echo "No results found for your Search <hr>";
|
||||
echo "No results found ... <hr>";
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -643,9 +643,9 @@ INNER JOIN course_students_table on course_students_table.Course_ID=courses_tabl
|
|||
<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
|
||||
<div class='row'><div class='col-md-5'> Find course by course code
|
||||
<input type='text' class='form-control' name='search' maxlength='11' placeholder='Enter Course Code'>
|
||||
</div><div class='col-md-6'>
|
||||
</div><div class='col-md-5'>
|
||||
List courses by faculty
|
||||
|
||||
<select name='faculty' class='form-control'>";
|
||||
|
|
|
@ -144,6 +144,10 @@ if (mysqli_connect_errno()) {
|
|||
padding-bottom:1px;
|
||||
}
|
||||
|
||||
.col-md-4 {
|
||||
border-right: 1px solid skyblue;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
// https://stackoverflow.com/questions/33999475/prevent-direct-url-access-to-php-file
|
||||
if (!isset($_SERVER['HTTP_REFERER']) ) {
|
||||
// https://stackoverflow.com/questions/33999475/prevent-direct-url-access-to-php-file
|
||||
if (!isset($_SERVER['HTTP_REFERER']) ) {
|
||||
/* choose the appropriate page to redirect users */
|
||||
die( header( 'location: logout.php' ) );
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
<?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 = htmlspecialchars($_GET['token']);
|
||||
$email = htmlspecialchars($_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>
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
$page = "student";
|
||||
include 'Header.php';
|
||||
|
||||
?>
|
||||
|
||||
<br><br><br>
|
||||
|
@ -9,7 +8,7 @@ include 'Header.php';
|
|||
<div class="row" style="width:80%;margin:auto;">
|
||||
|
||||
<div class="col-md-6">
|
||||
<h1> Student Account Created. Now you can Browse Course Portals </h1>
|
||||
<h1> Student account created. Now you can browse the course portal. </h1>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -10,13 +10,13 @@ include 'Header.php';
|
|||
<div class='row' style='width:80%;margin:auto;'>
|
||||
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
$c_date = date("Y-m-d H:i");
|
||||
$student_id = $_SESSION["user_student_id"];
|
||||
$c_date = date("Y-m-d H:i");
|
||||
$student_id = $_SESSION["user_student_id"];
|
||||
|
||||
if(!empty($_GET["id"]))
|
||||
{
|
||||
if(!empty($_GET["id"]))
|
||||
{
|
||||
$id = mysqli_real_escape_string($con, $_GET["id"]);
|
||||
$url = mysqli_real_escape_string($con, $_GET["url"]);
|
||||
|
||||
|
@ -78,20 +78,18 @@ if(!empty($_GET["id"]))
|
|||
echo "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$Group_ID = $_SESSION["Group_ID"];
|
||||
$Group_ID = $_SESSION["Group_ID"];
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div style="width:80%;margin:auto;">
|
||||
|
||||
<h3> Submit Lab Report Assignment </h3>
|
||||
<h3>Submit assignment</h3>
|
||||
<hr>
|
||||
<div class="row">
|
||||
|
||||
|
@ -114,9 +112,6 @@ $Group_ID = $_SESSION["Group_ID"];
|
|||
Attachment 2
|
||||
<input type='file' name='attachment2' placeholder='Attachment 2' class='form-control'>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
Attachment 3
|
||||
<input type='file' name='attachment3' placeholder='Attachment 3' class='form-control' >
|
||||
|
@ -125,7 +120,7 @@ $Group_ID = $_SESSION["Group_ID"];
|
|||
<input type='file' name='attachment4' placeholder='Attachment 4' class='form-control' >
|
||||
<br>
|
||||
|
||||
<input type='submit' class='btn btn-primary' value='Submit Lab Assignment'><br>
|
||||
<input type='submit' class='btn btn-primary' value='Submit'><br>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
|
63
Visitors.php
63
Visitors.php
|
@ -1,63 +0,0 @@
|
|||
<?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 Files : $full_link </span>
|
||||
</div>
|
||||
";
|
||||
}
|
||||
} ?>
|
||||
</div>
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
// Start a new session
|
||||
session_start();
|
||||
|
||||
// Destory sessions & redirect to index
|
||||
session_destroy();
|
||||
session_unset();
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<?php
|
||||
echo '<pre>';
|
||||
echo 'LOADED EXTENSIONS:<br/>';
|
||||
print_r(get_loaded_extensions());
|
||||
echo '</pre>';
|
||||
echo phpinfo();
|
||||
?>
|
|
@ -1,17 +1,9 @@
|
|||
<?php
|
||||
include 'NoDirectPhpAcess.php';
|
||||
include 'NoDirectPhpAcess.php';
|
||||
?>
|
||||
|
||||
<?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';
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
@ -21,7 +13,7 @@ include 'Header.php';
|
|||
|
||||
<br>
|
||||
|
||||
<h4 class="list-group-item active"> Reset my password </h4>
|
||||
<h4 class="list-group-item active"> Reset password </h4>
|
||||
<div class="list-group-item">
|
||||
|
||||
<div class="panel-body">
|
||||
|
@ -32,29 +24,20 @@ include 'Header.php';
|
|||
Email <input type="text" name="email" placeholder="Enter your email address" class="form-control" required="required" value="<?php echo htmlspecialchars($_SESSION['user_email']); ?>">
|
||||
<br/>
|
||||
<input type="submit" class="btn-primary" value="Recover">
|
||||
</form>
|
||||
|
||||
</form>
|
||||
<?php
|
||||
|
||||
<?php
|
||||
|
||||
if(isset($_SESSION['info_recover_password'])) {
|
||||
if(isset($_SESSION['info_recover_password'])) {
|
||||
echo '<hr><div class="alert alert-danger" role="alert">'.htmlspecialchars($_SESSION['info_recover_password']).'</div>';
|
||||
$_SESSION['info_recover_password']=null;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<style>
|
||||
/*------------------------------------------------------------------
|
||||
[ Login Button ]*/
|
||||
.btn-primary {
|
||||
color: white;
|
||||
border-radius: 5px;
|
||||
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||
background: rgb(75, 184, 240);
|
||||
padding:5px 102px;
|
||||
font-family: Poppins-Regular;
|
||||
font-size: 23px;
|
||||
line-height: 1.5;
|
||||
$_SESSION['info_recover_password'] = null;
|
||||
}
|
||||
</style>
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
14
signup.php
14
signup.php
|
@ -48,17 +48,3 @@ include 'Header.php';
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
/*------------------------------------------------------------------
|
||||
[ Login Button ]*/
|
||||
.btn-primary {
|
||||
color: white;
|
||||
border-radius: 5px;
|
||||
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||
background: rgb(75, 184, 240);
|
||||
padding: 5px 105px;
|
||||
font-family: Poppins-Regular;
|
||||
font-size: 23px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue