Make nav tabs work, and make buttons look better.
parent
9c529e0022
commit
0e4a49fb3d
103
Admin.php
103
Admin.php
|
@ -28,64 +28,62 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
<div class="col-md-6">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs">
|
||||
<ul class="nav nav-tabs" id="myTab">
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="home" href="#home">Create TA account</a>
|
||||
<a class="nav-link active" href="#tab-student-accounts" id="batch_tab">Create student accounts</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#menu1" id="batch_tab">Batch create student accounts</a>
|
||||
<a class="nav-link" href="#tab-ins-accounts">Create instructor account</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#menu2" id="existing_accounts_tab">Existing accounts</a>
|
||||
<a class="nav-link" href="#tab-existing-accounts" id="existing_accounts_tab">Existing accounts</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content">
|
||||
|
||||
<div id="home" class="tab-pane active"><br>
|
||||
<!-- code contributed by Xu Xiaopeng (https://github.com/xxp1999) -->
|
||||
<div id="tab-student-accounts" class="tab-pane active" style="margin-top:5px">
|
||||
<p class="text-muted">Copy & paste student number to the following box, and separate two student numbers with a space.</p>
|
||||
<form action="batch_insert.php" method="post" id="batch_form">
|
||||
<textarea cols="60" rows="16" name="users" required=""></textarea>
|
||||
<button type="submit" class="btn btn-primary" id="register_btn">Register students</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="tab-ins-accounts" class="tab-pane"><br>
|
||||
|
||||
<?php
|
||||
if ($_SESSION['user_type'] == "Lecturer") {
|
||||
|
||||
echo "<b>Create TA Accounts </b>";
|
||||
|
||||
echo "<p class=\"text-muted\">Create TA Accounts</p>";
|
||||
}
|
||||
else if($_SESSION['user_type'] == "Admin"){
|
||||
echo "<b>Create Lecturer Accounts </b>";
|
||||
echo "<p class=\"text-muted\">Create Lecturer Accounts</p>";
|
||||
}
|
||||
|
||||
?>
|
||||
<form method="post" action="Script.php" id="create_account_form">
|
||||
<input type="hidden" name="frm_createlecturrer" value="true" required="" />
|
||||
Full name
|
||||
<input type="text" name="fullname" placeholder="Full Name" class="form-control" required="">
|
||||
<input type="text" name="fullname" placeholder="Full Name" class="form-control" required=""> <br>
|
||||
Email
|
||||
<input type="text" name="email" placeholder="Email / Student Number" class="form-control" required="">
|
||||
|
||||
<input type="text" name="email" placeholder="Email / Student Number" class="form-control" required=""> <br>
|
||||
Passport number/ID (used as the initial password)
|
||||
<input type="text" class="form-control" name="passport" placeholder="Passport No./ID" required="">
|
||||
<br> User type:
|
||||
|
||||
<input type="text" class="form-control" name="passport" placeholder="Passport No./ID" required=""> <br>
|
||||
User type:
|
||||
<?php
|
||||
|
||||
if ($_SESSION['user_type'] == "Lecturer") {
|
||||
|
||||
echo ' <input type="radio" name="type" value="TA" required="" id="role_TA"> TA (Teaching Assistant) ';
|
||||
|
||||
}
|
||||
else if($_SESSION['user_type'] == "Admin"){
|
||||
|
||||
} else if ($_SESSION['user_type'] == "Admin"){
|
||||
echo " <input type='radio' name = 'type' value = 'Lecturer' required = '' id='role_lecturer' > Lecturer ";
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<input type="submit" class="btn btn-primary" value="Create" id="create_btn"><br>
|
||||
|
||||
<br>
|
||||
<button type="submit" class="btn btn-primary" id="create_btn">Create</button>
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
@ -107,21 +105,9 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
</div>
|
||||
|
||||
|
||||
<!-- code contributed by Xu Xiaopeng (https://github.com/xxp1999) -->
|
||||
<div id="menu1" class="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="tab-existing-accounts" class="tab-pane"><br>
|
||||
|
||||
|
||||
<div id="menu2" class="tab-pane fade"><br>
|
||||
|
||||
<table class="table-bordered" style="font-size: 10pt;">
|
||||
<table class="table" style="font-size: 10pt;">
|
||||
<tr style="font-size:10pt;">
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
|
@ -149,13 +135,13 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
$pass = $row['Passport_Number'];
|
||||
$btn = "<button class='btn-warning' onclick=\"updatePass(" . $row['User_ID'] . ",'$pass')\">Reset</button>";
|
||||
$btn = "<button class='btn 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>";
|
||||
$btnBlock = "<button class='btn btn-danger' onclick=\"blockUser(" . $row['User_ID'] . ",'$newstatus')\" id=\"block_account_1\">Block</button>";
|
||||
} else {
|
||||
$newstatus = "Active";
|
||||
$btnBlock = "<button class='btn-success' onclick=\"blockUser(" . $row['User_ID'] . ",'$newstatus')\" id=\"activate_account_1\">Activate</button>";
|
||||
$btnBlock = "<button class='btn btn-success' onclick=\"blockUser(" . $row['User_ID'] . ",'$newstatus')\" id=\"activate_account_1\">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>";
|
||||
|
@ -170,23 +156,23 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
|
||||
<div class="col-md-6">
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<ul class="nav nav-tabs" id="myTab">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#menu3" id="existing_courses">Existing courses</a>
|
||||
<a class="nav-link active" href="#tab-existing-courses" id="existing_courses">Existing courses</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="menu3" class="container tab-pane active"><br>
|
||||
<div id="tab-existing-courses" class="tab-pane active"><br>
|
||||
|
||||
<b> Past courses </b>
|
||||
<hr>
|
||||
<table class="table-bordered" style="font-size: 10pt;">
|
||||
<p class="text-muted"> Past courses </p>
|
||||
|
||||
<table class="table" style="font-size: 10pt;">
|
||||
<tr>
|
||||
<th>Course Name</th>
|
||||
<th>Course name</th>
|
||||
<th>Faculty</th>
|
||||
<th>Lecturer</th>
|
||||
<th>TAs</th>
|
||||
<th>Assign new TA </th>
|
||||
<th>Assign a new TA </th>
|
||||
</tr>
|
||||
<?php
|
||||
$user_id = $_SESSION['user_id'];
|
||||
|
@ -207,7 +193,7 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
|
||||
$ta = "";
|
||||
while ($rowTA = mysqli_fetch_assoc($resultTA)) {
|
||||
$ta = $ta . " - " . $rowTA['TA_NAME'];
|
||||
$ta = $ta . " " . $rowTA['TA_NAME'];
|
||||
}
|
||||
|
||||
echo "
|
||||
|
@ -223,7 +209,7 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
}
|
||||
}
|
||||
|
||||
echo "</select> <input type='hidden' name='assignTA' value='true'> <input type='hidden' name='id' value='$c_id'> <input type='submit' value='assign' id='assign_btn_$counter'></form> </td></tr>
|
||||
echo "</select> <input type='hidden' name='assignTA' value='true'> <input type='hidden' name='id' value='$c_id'> <button class='btn btn-outline-secondary btn-sm' type='submit' id='assign_btn_$counter'>assign</button></form> </td></tr>
|
||||
";
|
||||
}
|
||||
} ?>
|
||||
|
@ -252,4 +238,15 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
|
|||
}
|
||||
window.location.href = "\Script.php\?action=statuschange&uid=" + id + "&status=" + status;
|
||||
}
|
||||
|
||||
/* For tabs to work */
|
||||
const triggerTabList = document.querySelectorAll('#myTab a')
|
||||
triggerTabList.forEach(triggerEl => {
|
||||
const tabTrigger = new bootstrap.Tab(triggerEl)
|
||||
triggerEl.addEventListener('click', event => {
|
||||
event.preventDefault()
|
||||
tabTrigger.show()
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
|
|
43
Course.php
43
Course.php
|
@ -86,23 +86,23 @@ if( $_SESSION['user_type'] == "Student")
|
|||
|
||||
<!-- Nav tabs -->
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<ul class="nav nav-tabs" id="myTab">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#menu1">New</a>
|
||||
<a class="nav-link active" href="#menu1">New</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#menu2">Missed</a>
|
||||
<a class="nav-link" href="#menu2">Missed</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#menu3">Submitted</a>
|
||||
<a class="nav-link" href="#menu3">Submitted</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#menu4">Marked</a>
|
||||
<a class="nav-link" href="#menu4">Marked</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div id="menu1" class="container tab-pane active"><br>
|
||||
<div id="menu1" class="tab-pane active"><br>
|
||||
|
||||
<?php
|
||||
|
||||
|
@ -138,7 +138,7 @@ if( $_SESSION['user_type'] == "Student")
|
|||
|
||||
if(mysqli_num_rows($result1)==0)
|
||||
{
|
||||
echo "No active assignments for this course now.";
|
||||
echo "<div class='alert alert-info'>No active assignments now.</div>";
|
||||
} else {
|
||||
|
||||
while($row = mysqli_fetch_assoc($result1)) {
|
||||
|
@ -169,7 +169,7 @@ if( $_SESSION['user_type'] == "Student")
|
|||
echo "<div class='btn btn-default break-word' style='dislay:block; word-wrap: break-word; border-left:4px solid #e6f2ff;'>
|
||||
<div class='alert alert-warning'>Time left: $days_remaining</div>
|
||||
$title ($Marks Marks, $type) <br> <span style='font-size:8pt'> $ins</span>
|
||||
<br> <span style='font-size:10pt'>Posted:$posted Deadline:$deadline <a href='~\..\SubmitLab.php?id=$labid&url=$url' class='btn-sm btn-info' style='margin-left:50px;'>Submit</a><br> Attachments : $full_link </span>
|
||||
<br> <span style='font-size:10pt'>Posted:$posted Deadline:$deadline <a href='~\..\SubmitLab.php?id=$labid&url=$url' class='btn btn-sm btn-primary' style='margin-left:50px;'>Submit</a><br> Attachments : $full_link </span>
|
||||
</div>";
|
||||
|
||||
}}
|
||||
|
@ -180,7 +180,7 @@ if( $_SESSION['user_type'] == "Student")
|
|||
|
||||
|
||||
|
||||
<div id="menu2" class="container tab-pane"><br>
|
||||
<div id="menu2" class="tab-pane"><br>
|
||||
|
||||
<?php
|
||||
$group_id=$_SESSION['group_id'];
|
||||
|
@ -228,7 +228,7 @@ Lab_Report_ID not in (select Lab_Report_ID from lab_report_submissions where (St
|
|||
}
|
||||
;
|
||||
|
||||
echo "<div class='btn btn-default break-word' style='dislay:block; word-wrap: break-word; border: 1px solid #F0F0F0;border-left: 4px solid #03407B;'><span class='btn-sm btn-warning' style='margin-left:0px;'>MISSED</span> $title ($marks Marks) <br> <span style='font-size:8pt'> $ins</span>
|
||||
echo "<div class='btn btn-default break-word' style='dislay:block; word-wrap: break-word; border: 1px solid #F0F0F0;border-left: 4px solid #03407B;'><span class='btn btn-sm btn-outline-danger' style='margin-left:0px;'>MISSED</span> $title ($marks Marks) <br> <span style='font-size:8pt'> $ins</span>
|
||||
<br> <span style='font-size:8pt'>Posted: $posted<br> Deadline: $deadline <br> Attachments : $full_link </span>
|
||||
</div>";
|
||||
|
||||
|
@ -240,7 +240,7 @@ Lab_Report_ID not in (select Lab_Report_ID from lab_report_submissions where (St
|
|||
|
||||
|
||||
|
||||
<div id="menu3" class="container tab-pane"><br>
|
||||
<div id="menu3" class="tab-pane"><br>
|
||||
<?php
|
||||
|
||||
|
||||
|
@ -275,7 +275,7 @@ Lab_Report_ID not in (select Lab_Report_ID from lab_report_submissions where (St
|
|||
$id = $row['Lab_Report_ID'];
|
||||
if( $c_date < $deadline)
|
||||
{
|
||||
$submittedx="<a href='~\..\SubmitLab.php?id=$id&url=$url' class='btn-sm btn-info'>Re-submit</a>";
|
||||
$submittedx="<a href='~\..\SubmitLab.php?id=$id&url=$url' class='btn btn-sm btn-light'>Re-submit</a>";
|
||||
}
|
||||
|
||||
$full_link = "<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>";
|
||||
|
@ -360,7 +360,7 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
|
|||
?>
|
||||
|
||||
|
||||
<div id="menu4" class="container tab-pane"><br>
|
||||
<div id="menu4" class="tab-pane"><br>
|
||||
<?php
|
||||
$resultx = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_reports_table.`Lab_Report_ID`, `Student_id`, "
|
||||
. "`Course_Group_id`, `Notes`, lab_report_submissions.`Marks`,
|
||||
|
@ -403,7 +403,7 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
|
|||
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-light'>Request remarking</button>";
|
||||
$remarking="<button onclick='remarking(\"$rm_data\")' class='btn btn-sm btn-light'>Request remarking</button>";
|
||||
}
|
||||
if($status=='Remarking')
|
||||
{
|
||||
|
@ -502,7 +502,7 @@ course_groups_table.Course_Group_id=course_group_members_table.Course_Group_id W
|
|||
}
|
||||
|
||||
# Add "delete group" button and allow only group creator to delete it
|
||||
$extra4 = "<button onclick='deleteGroup($id)' class='btn btn-danger' style='height: 25px; width: 95px; line-height: 12px; font-size: 12px'>Delete group</button>";
|
||||
$extra4 = "<button onclick='deleteGroup($id)' class='btn btn-sm btn-danger'>Delete group</button>";
|
||||
|
||||
echo "<div class='btn-default'><small> $name ($status) $extra $extra2 $extra3" .
|
||||
(($status == "Created")? "$extra4": "")
|
||||
|
@ -526,7 +526,7 @@ where course_group_members_table.Course_Group_id=$id");
|
|||
#Show group members + remove button next to each member except the creator of the group
|
||||
if($flag){
|
||||
echo "<li>$name - $Student_ID ($status) ".(($status != "Created")?"<button onclick='removeMember($Student_ID, $id)'
|
||||
class='btn btn-warning' style='line-height: 12px; font-size: 12px'>Kick out</button>":"")."</li>";
|
||||
class='btn btn-sm btn-warning'>Kick out</button>":"")."</li>";
|
||||
}else{
|
||||
echo "<li><small> $name - $Student_ID ($status)</small>";
|
||||
}
|
||||
|
@ -689,4 +689,15 @@ where course_group_members_table.Course_Group_id=$id");
|
|||
} catch(e){ alert(e); }
|
||||
}
|
||||
|
||||
|
||||
/* For tabs to work */
|
||||
const triggerTabList = document.querySelectorAll('#myTab a')
|
||||
triggerTabList.forEach(triggerEl => {
|
||||
const tabTrigger = new bootstrap.Tab(triggerEl)
|
||||
triggerEl.addEventListener('click', event => {
|
||||
event.preventDefault()
|
||||
tabTrigger.show()
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
|
|
|
@ -427,8 +427,8 @@ WHERE Lecturer_User_ID=$lecturer_id and course_students_table.Status='Pending'"
|
|||
$academic=$row['Academic_Year'];
|
||||
|
||||
echo "<div class='btn btn-default'>
|
||||
$std_name is Requesting to join <br> [($code) - $name ] <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>
|
||||
<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>
|
||||
$std_name is Requesting to join <br> [($code) - $name ] <br><a href='~\..\Script.php?AcceptStudent=y&id=$id&rs=yes' class='btn btn-sm btn-success' onclick=return confirm(\"are you sure to join this course?\")' > Accept </a>
|
||||
<a href='~\..\Script.php?AcceptStudent=y&id=$id&rs=no' class='btn btn-sm btn-danger' onclick=return confirm(\"are you sure to join this course?\")' > Decline </a>
|
||||
</div>";
|
||||
|
||||
}
|
||||
|
@ -566,7 +566,7 @@ if( $_SESSION['user_type']=="Student")
|
|||
}
|
||||
|
||||
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?\")' >Join</a>
|
||||
($code) $name <br>($url) <br> <a href='~\..\Script.php?JoinCourse=y&id=$id&std=$student_id&joining=$v' class='btn btn-sm btn-success' onclick=return confirm(\"Are you sure to join this course?\")' >Join</a>
|
||||
<br> <span style='font-size:10pt'>Faculty: $faculty Year: $academic Lecturer: $lecturer </span><br>$msg</div>
|
||||
";
|
||||
}
|
||||
|
@ -606,7 +606,7 @@ INNER JOIN course_students_table on course_students_table.Course_ID=courses_tabl
|
|||
else
|
||||
{
|
||||
echo "<div class='btn btn-default'>
|
||||
($code) - $name <i class='btn-sm btn-danger'> $Status</i>
|
||||
($code) - $name <i class='btn btn-sm btn-danger'> $Status</i>
|
||||
<br> <span style='font-size:8pt'>Faculty: $faculty Year: $academic Lecturer: $lecturer </span></div>
|
||||
";
|
||||
}
|
||||
|
|
94
Header.php
94
Header.php
|
@ -17,10 +17,13 @@ if (mysqli_connect_errno()) {
|
|||
<html lang="en-US">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Lab Report Repository</title>
|
||||
<link href=" https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.0.1/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm" crossorigin="anonymous"></script>
|
||||
|
||||
<link href="./font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
|
||||
<!-- *this css file can be used across all the websites
|
||||
and any new css class can be added there.
|
||||
|
@ -29,11 +32,8 @@ if (mysqli_connect_errno()) {
|
|||
-->
|
||||
<link href = "./css/main.css" rel="stylesheet" type="text/css" />
|
||||
<script src="./css/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.0.1/js/bootstrap.min.js"></script>
|
||||
<script src=">https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.0.1/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="./css/jquery.datetimepicker.min.js" type="text/javascript"></script>
|
||||
|
||||
|
||||
<style>
|
||||
.nav-item {
|
||||
border-color: #00ff66;
|
||||
|
@ -130,56 +130,60 @@ if (mysqli_connect_errno()) {
|
|||
|
||||
<body>
|
||||
|
||||
<nav class="navbar navbar-expand-lg" style="padding-left:150px;padding-right:150px;margin:auto;">
|
||||
<a class="navbar-brand" href="~\..\index.php"> <img src="logo.png" style="width:30px;height:30px;" alt="LRR Logo"> LRR </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>
|
||||
<nav class="navbar navbar-expand-lg bg-body-tertiary" style="padding-left:180px;padding-right:150px;margin:auto;">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarColor02">
|
||||
<a class="navbar-brand" href="~\..\index.php"> <img src="logo.png" style="width:30px;height:30px;" alt="LRR Logo"> LRR </a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
|
||||
<div class="navbar-nav">
|
||||
|
||||
<a class="nav-link" href="#">
|
||||
<?php
|
||||
if (isset($_SESSION["user_fullname"])) {
|
||||
echo $_SESSION['user_fullname'];
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
$c_date = date("Y-m-d H:i");
|
||||
if (isset($_SESSION['user_student_id']))
|
||||
echo "(" . $_SESSION['user_type'] . " - " . $_SESSION['user_student_id'] . ") ";
|
||||
elseif (isset($_SESSION['user_type']))
|
||||
echo "(" . $_SESSION['user_type'] . ") ";
|
||||
?>
|
||||
</a>
|
||||
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item active">
|
||||
<?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>";
|
||||
echo "<a class='nav-link' href='~\..\Courses.php'><i class='fa fa-book'></i> My courses </a>";
|
||||
?>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<form class="form-inline my-2 my-lg-0">
|
||||
Welcome
|
||||
<b> <?php echo $_SESSION['user_fullname']; ?> </b>
|
||||
|
||||
|
||||
<?php
|
||||
$c_date = date("Y-m-d H:i");
|
||||
if (isset($_SESSION['user_student_id']))
|
||||
echo "(" . $_SESSION['user_type'] . " - " . $_SESSION['user_student_id'] . ") ";
|
||||
else
|
||||
echo "(" . $_SESSION['user_type'] . ") ";
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ($_SESSION['user_type'] == "Lecturer") { // Show Admin link
|
||||
echo " <i class=\"fa fa-cog\"> </i>";
|
||||
echo " <a href=\"~\..\Admin.php\" id=\"admin_tab\">Admin</a>";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<i class="fa fa-user"> </i>
|
||||
<a href="#" onclick="updatePass(<?php echo $_SESSION['user_id']; ?>)">Update password</a>
|
||||
|
||||
|
||||
<i class="fa fa-lock"> </i>
|
||||
<a href="~\..\logout.php">Logout </a>
|
||||
|
||||
<?php
|
||||
} // Confusing. What is this for?
|
||||
if ($_SESSION['user_type'] == "Lecturer") { // Show Admin link
|
||||
echo " <a class='nav-link' href=\"~\..\Admin.php\" id=\"admin_tab\"><i class='fa fa-cog'></i>Admin</a>";
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
|
||||
<a class="nav-link" href="#" onclick="updatePass(<?php echo $_SESSION['user_id']; ?>)"><i class="fa fa-user"> </i> Update password</a>
|
||||
|
||||
|
||||
<a class="nav-link" href="~\..\logout.php"><i class="fa fa-lock"> </i> Logout</a>
|
||||
|
||||
<?php
|
||||
} // Closing this conditional test block: if (isset($_SESSION["user_fullname"])) { ...
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
|
|
@ -93,26 +93,26 @@ echo "<div class='alert' style='margin-left:20px;border-bottom:2px solid #1D91EF
|
|||
|
||||
?>
|
||||
|
||||
<b>Assignment submissions (<?php echo $count_subs; ?>)</b>
|
||||
<p class="text-muted">Assignment submissions (<?php echo $count_subs; ?>)</p>
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<ul class="nav nav-tabs" id="myTab">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#menu1">Unmarked submissions<b> (<?php echo $count_unmarked; ?>)</b></a>
|
||||
<a class="nav-link active" href="#menu1">Unmarked 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>
|
||||
<a class="nav-link" 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">Remarking requests <b>(<?php echo $count_remark; ?>)</b></a>
|
||||
<a class="nav-link" href="#menu3">Remarking requests <b>(<?php echo $count_remark; ?>)</b></a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#menu4">Course groups</a>
|
||||
<a class="nav-link" href="#menu4">Course groups</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="menu1" class="container tab-pane active"><br>
|
||||
<div id="menu1" class="tab-pane active"><br>
|
||||
|
||||
<?php
|
||||
|
||||
|
@ -182,10 +182,10 @@ where Lab_Report_ID=$id and lab_report_submissions.Status='Pending' order by Sub
|
|||
$full_link = $full_link . " | <a href='~\..\Download.php?file=$att4&attachment=4'>$base_att4</a>";
|
||||
}
|
||||
|
||||
echo " <k href='#'> <div class='btn btn-default break-word' style='dislay:block; word-wrap: break-word; border: 1px solid #F0F0F0;border-left: 4px solid #03407B;'>
|
||||
echo "<div class='btn btn-default break-word' style='dislay:block; word-wrap: break-word; border: 1px solid #F0F0F0;border-left: 4px solid #03407B;'>
|
||||
$title <br> by: <b> <span class = 'text-selectable'>$submitted_by </span> </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</button><br> Attachments : $full_link </span>
|
||||
</div></k>";
|
||||
<br> <span style='font-size:8pt'>Submitted : $posted <button class='btn btn-sm btn-info' style='margin-left:50px;' onclick='mark($Submission_ID,\"$title\",$total)'> Mark</button><br> Attachments : $full_link </span>
|
||||
</div>";
|
||||
}
|
||||
}
|
||||
echo "";
|
||||
|
@ -193,7 +193,7 @@ where Lab_Report_ID=$id and lab_report_submissions.Status='Pending' order by Sub
|
|||
|
||||
</div>
|
||||
|
||||
<div id="menu2" class="container tab-pane"><br>
|
||||
<div id="menu2" class="tab-pane"><br>
|
||||
|
||||
<?php
|
||||
|
||||
|
@ -217,7 +217,7 @@ where Lab_Report_ID=$id and lab_report_submissions.Status='Marked' Order by lab
|
|||
}
|
||||
|
||||
if (mysqli_num_rows($result) == 0) {
|
||||
echo "No Marked submissions for this lab";
|
||||
echo "No marked submissions.";
|
||||
} else {
|
||||
|
||||
echo "<h3><a href='~\..\Script.php?exportgrade=true&lab=$id&lab_name=$Report_Title'><i class='fa fa-book'></i> Export grades</a></h3>";
|
||||
|
@ -267,10 +267,10 @@ where Lab_Report_ID=$id and lab_report_submissions.Status='Marked' Order by lab
|
|||
// if you want to use text-selectable class on whole div, just call the css class
|
||||
|
||||
|
||||
echo " <k href='#'> <div class='btn btn-default break-word ' style='dislay:block; word-wrap: break-word; border: 1px solid #F0F0F0;border-left: 4px solid #03407B;'>
|
||||
echo "<div class='btn btn-default break-word ' style='dislay:block; word-wrap: break-word; border: 1px solid #F0F0F0;border-left: 4px solid #03407B;'>
|
||||
$title <br> by : <b> <span class = 'text-selectable'>$submitted_by </span> [ Marks: $Marks ] </b>
|
||||
<hr> Marking 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)'>Remark</button><br> Attachments : $full_link </span>
|
||||
</div></k>";
|
||||
<hr> Marking notes: $notes<br> <span style='font-size:8pt'>Submitted : $posted <b> </b> <button class='btn btn-light btn-sm' style='margin-left:50px;' onclick='mark($Submission_ID,\"$title\",$total)'>Remark</button><br> Attachments : $full_link </span>
|
||||
</div>";
|
||||
}
|
||||
}
|
||||
echo "";
|
||||
|
@ -278,7 +278,7 @@ where Lab_Report_ID=$id and lab_report_submissions.Status='Marked' Order by lab
|
|||
|
||||
</div>
|
||||
|
||||
<div id="menu3" class="container tab-pane"><br>
|
||||
<div id="menu3" class="tab-pane"><br>
|
||||
|
||||
<?php
|
||||
|
||||
|
@ -349,8 +349,8 @@ where Lab_Report_ID=$id and lab_report_submissions.Status='Remarking'");
|
|||
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> <span class = 'text-selectable'>$submitted_by </span> [ 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)'>Remark</button>"
|
||||
. " <a href='~\..\Script.php?ignoreremarking=yes&id=$id&subid=$Submission_ID&header=$header&total=$total&status=Marked' class='btn-sm btn-secondary'>Ignore request</a>"
|
||||
. "<button class='btn btn-secondary btn-sm' style='margin-left:50px;' onclick='mark($Submission_ID,\"$title\",$total)'>Remark</button>"
|
||||
. " <a href='~\..\Script.php?ignoreremarking=yes&id=$id&subid=$Submission_ID&header=$header&total=$total&status=Marked' class='btn btn-sm btn-light'>Ignore request</a>"
|
||||
. "<br> Attachments : $full_link </span>
|
||||
</div></k>";
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ where Lab_Report_ID=$id and lab_report_submissions.Status='Remarking'");
|
|||
|
||||
</div>
|
||||
|
||||
<div id="menu4" class="container tab-pane"><br>
|
||||
<div id="menu4" class="tab-pane"><br>
|
||||
|
||||
<h3>Course groups</h3>
|
||||
|
||||
|
@ -377,10 +377,10 @@ WHERE Course_id=$c_id");
|
|||
} else {
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
$name = $row['Group_Name'];
|
||||
$leader = $row['Full_Name'] . "(" . $row['Group_Leader'] . ")";
|
||||
$leader = $row['Full_Name'] . " (" . $row['Group_Leader'] . ")";
|
||||
$id = $row['Course_Group_id'];
|
||||
|
||||
echo "<div class='btn-default'><small> $name - Leader : $leader </small></div>";
|
||||
echo "<ul class='list-group'>$name, Leader: $leader";
|
||||
|
||||
$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`
|
||||
|
@ -393,8 +393,9 @@ where course_group_members_table.Course_Group_id=$id");
|
|||
$status = $row['Status'];
|
||||
$Student_ID = $row['Student_ID'];
|
||||
|
||||
echo "<li><small> $name-$Student_ID ($status)</small></li>";
|
||||
echo "<li class='list-group-item'>$name ($Student_ID) - $status</li>";
|
||||
}
|
||||
echo "</ul><br>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -450,4 +451,14 @@ where course_group_members_table.Course_Group_id=$id");
|
|||
}
|
||||
}
|
||||
|
||||
/* For tabs to work */
|
||||
const triggerTabList = document.querySelectorAll('#myTab a')
|
||||
triggerTabList.forEach(triggerEl => {
|
||||
const tabTrigger = new bootstrap.Tab(triggerEl)
|
||||
triggerEl.addEventListener('click', event => {
|
||||
event.preventDefault()
|
||||
tabTrigger.show()
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
|
|
|
@ -7,8 +7,7 @@ session_start();
|
|||
<?php
|
||||
// if the user has already logged in, then clicking the LRRS icon should not display the login page (i.e., index.php).
|
||||
if (isset($_SESSION["user_fullname"])) {
|
||||
echo '<div class="alert alert-info"> You\'ve already logged in.</div>';
|
||||
header("Location: Courses.php");
|
||||
echo '<div class="container alert alert-info"> You\'ve already logged in.</div>';
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue