2020-03-16 15:23:14 +08:00
|
|
|
<?php
|
|
|
|
session_start();
|
|
|
|
error_reporting(0);
|
2020-10-02 17:02:20 +08:00
|
|
|
date_default_timezone_set('Asia/Shanghai');
|
2020-03-16 15:23:14 +08:00
|
|
|
|
2020-10-02 23:02:27 +08:00
|
|
|
include "get_mysql_credentials.php";
|
2022-12-19 12:12:25 +08:00
|
|
|
$con = mysqli_connect("localhost", "root", "", "lrr");
|
2020-03-16 15:23:14 +08:00
|
|
|
|
2020-10-02 17:02:20 +08:00
|
|
|
// Check database connection
|
|
|
|
if (mysqli_connect_errno()) {
|
2020-03-16 15:23:14 +08:00
|
|
|
echo "Failed to connect to MySQL: " . mysqli_connect_error();
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
|
|
|
<html>
|
2020-10-02 17:02:20 +08:00
|
|
|
|
2021-07-22 22:10:23 +08:00
|
|
|
<head>
|
|
|
|
|
2022-12-24 16:51:19 +08:00
|
|
|
<link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
|
|
|
|
<link href=" https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"/>
|
2022-12-19 17:24:33 +08:00
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css">
|
|
|
|
<link href = "./css/main.css" rel = "stylesheet" type = "text/css" />
|
|
|
|
<script src="./css/jquery-1.11.1.min.js"></script>
|
2022-12-24 16:51:19 +08:00
|
|
|
<script src="./css/jquery-ui.min.js"></script>
|
2022-12-19 17:24:33 +08:00
|
|
|
<link rel="stylesheet" href="./css/jquery-ui.css"/>
|
2021-10-18 23:34:13 +08:00
|
|
|
<script src="./css/jquery.min.js" type="text/javascript"></script>
|
|
|
|
<script src="./css/bootsrap.min.js" type="text/javascript"></script>
|
|
|
|
<script src="./css/jquery.datetimepicker.min.js" type="text/javascript"></script>
|
2020-03-16 15:23:14 +08:00
|
|
|
|
2021-07-22 22:10:23 +08:00
|
|
|
</head>
|
2020-03-16 15:23:14 +08:00
|
|
|
|
|
|
|
<body>
|
|
|
|
|
2022-12-19 17:24:33 +08:00
|
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
|
|
<a class="navbar-brand" href="#">
|
|
|
|
<label>LRR</label>
|
|
|
|
<img src="logo.png" class = "navlogoimage"style="width:30px;height:30px; padding-left: 6px" alt="LRR Logo"> </a>
|
2021-10-18 23:34:13 +08:00
|
|
|
<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>
|
2020-03-16 15:23:14 +08:00
|
|
|
<?php
|
2021-10-18 23:34:13 +08:00
|
|
|
if (isset($_SESSION["user_fullname"])) {
|
|
|
|
|
2022-12-19 17:24:33 +08:00
|
|
|
echo " <a class='nav-link' href='~\..\Courses.php'><i class='bi bi-book-fill'></i> Courses <span class='sr-only'>(current)</span></a>";
|
2020-03-16 15:23:14 +08:00
|
|
|
?>
|
2021-10-18 23:34:13 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<form class="form-inline my-2 my-lg-0" style="color:#fff;">
|
|
|
|
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") {
|
2022-12-19 17:24:33 +08:00
|
|
|
echo " <i class=\"bi bi-gear-fill\" style=\"color:#fff;\"> </i> <a style='color:#fff !important' href=\"~\..\Admin.php\" id=\"admin_tab\">Admin </a>";
|
2020-10-02 17:02:20 +08:00
|
|
|
}
|
2021-10-18 23:34:13 +08:00
|
|
|
?>
|
|
|
|
|
2022-12-19 17:24:33 +08:00
|
|
|
<i class="bi bi-person-fill" style="color:#fff;"> </i>
|
2021-10-18 23:34:13 +08:00
|
|
|
<a href="#" style='color:#fff !important' onclick="updatePass(<?php echo $_SESSION['user_id']; ?>)">Update password</a>
|
2022-12-19 17:24:33 +08:00
|
|
|
<i class="bi bi-lock-fill" style="color:#fff;"> </i> <a style='color:#fff !important' href="~\..\logout.php">Logout </a>
|
2021-10-18 23:34:13 +08:00
|
|
|
|
|
|
|
<?php
|
2020-03-16 15:23:14 +08:00
|
|
|
}
|
2021-10-18 23:34:13 +08:00
|
|
|
?>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
function updatePass(id) {
|
|
|
|
|
|
|
|
var pass = prompt("Enter your new password : ", "Enter a strong password");
|
|
|
|
|
|
|
|
if (!confirm('Are you sure you want to reset your password?')) {
|
|
|
|
return;
|
2020-03-16 15:23:14 +08:00
|
|
|
}
|
|
|
|
|
2021-10-18 23:34:13 +08:00
|
|
|
window.location.href = "\Script.php\?action=passchange&uid=" + id + "&pass=" + pass;
|
2020-03-16 15:23:14 +08:00
|
|
|
}
|
2021-10-18 23:34:13 +08:00
|
|
|
|
|
|
|
function blockUser(id, status) {
|
|
|
|
if (!confirm('Are you sure you want to change user status?')) {
|
|
|
|
return;
|
2020-03-16 15:23:14 +08:00
|
|
|
}
|
2021-10-18 23:34:13 +08:00
|
|
|
window.location.href = "\Script.php\?action=statuschange&uid=" + id + "&status=" + status;
|
|
|
|
}
|
|
|
|
</script>
|