Make Header.php look better

Bug430-Eden2
Lan Hui 2023-07-31 17:10:53 +08:00
parent 24ed22e5b8
commit 443d76b639
1 changed files with 163 additions and 164 deletions

View File

@ -8,215 +8,214 @@ $con = mysqli_connect("localhost", $mysql_username, $mysql_password, "lrr");
// Check database connection // Check database connection
if (mysqli_connect_errno()) { if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error(); echo "Failed to connect to MySQL: " . mysqli_connect_error();
} }
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>LRR - Lab Report Repository</title> <title>LRR - Lab Report Repository</title>
<link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <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 href="./font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<!-- *this css file can be used across all the websites <!-- *this css file can be used across all the websites
and any new css class can be added there. and any new css class can be added there.
* The reason is to make the css code reusable. * The reason is to make the css code reusable.
* the css file is used by submissions.php * the css file is used by submissions.php
--> -->
<link href = "./css/main.css" rel = "stylesheet" type = "text/css" /> <link href = "./css/main.css" rel = "stylesheet" type = "text/css" />
<script src="./css/jquery.min.js" type="text/javascript"></script> <script src="./css/jquery.min.js" type="text/javascript"></script>
<script src="./css/bootsrap.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> <script src="./css/jquery.datetimepicker.min.js" type="text/javascript"></script>
<style> <style>
.nav-item { .nav-item {
border-color: #00ff66; border-color: #00ff66;
} }
.nav-tabs { .nav-tabs {
border-color: #00ff66; border-color: #00ff66;
} }
.btn-default { .btn-default {
border: 2px solid #00ff66; border: 2px solid #00ff66;
width: 100%; width: 100%;
text-align: left; text-align: left;
margin: 3px auto; margin: 3px auto;
font-weight: bold; font-weight: bold;
font-size: 13pt; font-size: 13pt;
} }
.table-bordered { .table-bordered {
padding: 5px !important; padding: 5px !important;
} }
.alert { .alert {
font-weight: bold; font-weight: bold;
} }
h1, h1,
h2, h2,
h3, h3,
h4 { h4 {
color: #03407B; color: #03407B;
} }
a { a {
color: #03407B; color: #03407B;
} }
.break-word { .break-word {
word-wrap: break-word; word-wrap: break-word;
white-space: -moz-pre-wrap !important; white-space: -moz-pre-wrap !important;
/* Mozilla, since 1999 */ /* Mozilla, since 1999 */
white-space: -pre-wrap; white-space: -pre-wrap;
/* Opera 4-6 */ /* Opera 4-6 */
white-space: -o-pre-wrap; white-space: -o-pre-wrap;
/* Opera 7 */ /* Opera 7 */
white-space: pre-wrap; white-space: pre-wrap;
/* css-3 */ /* css-3 */
word-wrap: break-word; word-wrap: break-word;
/* Internet Explorer 5.5+ */ /* Internet Explorer 5.5+ */
white-space: -webkit-pre-wrap; white-space: -webkit-pre-wrap;
/* Newer versions of Chrome/Safari*/ /* Newer versions of Chrome/Safari*/
word-break: break-all; word-break: break-all;
white-space: normal; white-space: normal;
} }
.ui-widget-content.ui-dialog { .ui-widget-content.ui-dialog {
border: 2px solid #03488B; border: 2px solid #03488B;
} }
.ui-dialog>.ui-widget-header { .ui-dialog>.ui-widget-header {
background: #03488B; background: #03488B;
color: white color: white
} }
.ui-button { .ui-button {
background: #03488B; background: #03488B;
color: white color: white
} }
/* [ Login Button ]*/ /* [ Login Button ]*/
.btn-primary { .btn-primary {
color: white; color: white;
border-radius: 5px; border-radius: 5px;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
background: rgb(75, 184, 240); background: rgb(75, 184, 240);
padding:5px 100px; padding:5px 100px;
font-family: Poppins-Regular; font-family: Poppins-Regular;
font-size: 23px; font-size: 23px;
line-height: 1.5; line-height: 1.5;
} }
#footer{ #footer{
position:fixed; position:fixed;
bottom:0; bottom:0;
left:0; left:0;
background-color:#03417C; background-color:#03417C;
color:#FFF; color:#FFF;
text-align:center; text-align:center;
width:100%; width:100%;
} }
.txt1 { .txt1 {
font-family: Poppins-Regular; font-family: Poppins-Regular;
font-size: 18px; font-size: 18px;
line-height: 1.5; line-height: 1.5;
color: #666666; color: #666666;
} }
.txt2 { .txt2 {
font-family: Poppins-Regular; font-family: Poppins-Regular;
font-size: 19px; font-size: 19px;
line-height: 1.5; line-height: 1.5;
color: #2471A3; color: #2471A3;
} }
</style> </style>
</head> </head>
<body> <body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" style="padding-left:150px;padding-right:150px;margin:auto;"> <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;height:30px;"> LRR </a> <a class="navbar-brand" href="~\..\index.php"> <img src="logo.png" style="width:30px;height:30px;"> LRR </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation"> <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> <span class="navbar-toggler-icon"></span>
</button> </button>
<div class="collapse navbar-collapse" id="navbarColor02"> <div class="collapse navbar-collapse" id="navbarColor02">
<ul class="navbar-nav mr-auto"> <ul class="navbar-nav mr-auto">
<li class="nav-item active"> <li class="nav-item active">
<?php <?php
if (isset($_SESSION["user_fullname"])) { 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> Courses <span class='sr-only'>(current)</span></a>";
?> ?>
</li> </li>
</ul> </ul>
<form class="form-inline my-2 my-lg-0" style="color:#fff;"> <form class="form-inline my-2 my-lg-0" style="color:#fff;">
Welcome &nbsp; Welcome &nbsp;
<b> <?php echo $_SESSION['user_fullname']; ?> </b> <b> <?php echo $_SESSION['user_fullname']; ?> </b>
&nbsp; &nbsp;
<?php <?php
$c_date = date("Y-m-d H:i"); $c_date = date("Y-m-d H:i");
if (isset($_SESSION['user_student_id'])) if (isset($_SESSION['user_student_id']))
echo "(" . $_SESSION['user_type'] . " - " . $_SESSION['user_student_id'] . ") "; echo "(" . $_SESSION['user_type'] . " - " . $_SESSION['user_student_id'] . ") ";
else else
echo "(" . $_SESSION['user_type'] . ") "; echo "(" . $_SESSION['user_type'] . ") ";
?> ?>
<?php <?php
if ($_SESSION['user_type'] == "Lecturer") { // Show Admin link if ($_SESSION['user_type'] == "Lecturer") { // Show Admin link
echo "&nbsp;&nbsp;&nbsp; <i class=\"fa fa-cog\" style=\"color:#fff;\"> </i>"; echo "&nbsp;&nbsp;&nbsp; <i class=\"fa fa-cog\" style=\"color:#fff;\"> </i>";
echo "&nbsp;<a style='color:#fff !important' href=\"~\..\Admin.php\" id=\"admin_tab\">Admin</a>"; echo "&nbsp;<a style='color:#fff !important' href=\"~\..\Admin.php\" id=\"admin_tab\">Admin</a>";
} }
?> ?>
&nbsp;&nbsp;&nbsp; <i class="fa fa-user" style="color:#fff;"> </i> &nbsp;&nbsp;&nbsp; <i class="fa fa-user" style="color:#fff;"> </i>
&nbsp;<a href="#" style='color:#fff !important' onclick="updatePass(<?php echo $_SESSION['user_id']; ?>)">Update password</a> &nbsp;<a href="#" style='color:#fff !important' onclick="updatePass(<?php echo $_SESSION['user_id']; ?>)">Update password</a>
&nbsp;&nbsp;&nbsp; <i class="fa fa-lock" style="color:#fff;"> </i> &nbsp;&nbsp;&nbsp; <i class="fa fa-lock" style="color:#fff;"> </i>
&nbsp;<a style='color:#fff !important' href="~\..\logout.php">Logout </a> &nbsp;<a style='color:#fff !important' href="~\..\logout.php">Logout </a>
<?php <?php
} // Confusing. What is this for? } // Confusing. What is this for?
?> ?>
</form> </form>
</div> </div>
</nav> </nav>
<script> <script>
function updatePass(id) { function updatePass(id) {
var pass = prompt("Enter your new password : ", "Enter a strong password"); const pass = prompt("Enter your new password : ", "Enter a strong password");
if (!confirm('Are you sure you want to reset your password?')) { if (!confirm('Are you sure you want to reset your password?')) {
return; return;
} }
window.location.href = "\Script.php\?action=passchange&uid=" + id + "&pass=" + pass; window.location.href = "\Script.php\?action=passchange&uid=" + id + "&pass=" + pass;
} }
function blockUser(id, status) { function blockUser(id, status) {
if (!confirm('Are you sure you want to change user status?')) { if (!confirm('Are you sure you want to change user status?')) {
return; return;
} }
window.location.href = "\Script.php\?action=statuschange&uid=" + id + "&status=" + status; window.location.href = "\Script.php\?action=statuschange&uid=" + id + "&status=" + status;
} }
</script> </script>