Upgrade to Bootstrap 5. TODO: nav tab does not work in Admin.php.

Bug430-Eden2
Lan Hui 2023-08-06 17:43:36 +08:00
parent 7d28f987d2
commit 9c529e0022
6 changed files with 207 additions and 269 deletions

View File

@ -15,54 +15,37 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
} }
?> ?>
<div class="container">
<br> <br>
<div style="width: 80%;margin: auto;"> <div>
<h2> Administration panel </h2> <h2> Administration panel </h2>
</div> </div>
<hr> <hr>
<div class="row" style="width: 80%;margin: auto;"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<!-- <?php
if ($_SESSION['user_type'] == "Lecturer") {
echo " <h4> TA Account Management </h4> <hr> " ;
echo "<b>TA Accounts </b><br>" ;
}
else if($_SESSION['user_type'] == "Admin"){
echo " <h4> Lecturer Account Management </h4>
<hr> ";
echo "<b>Lecturer Accounts </b><br>";
}
?> -->
<div class="container">
<!-- Nav tabs --> <!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist"> <ul class="nav nav-tabs">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#home">Create TA account</a> <a class="nav-link active" id="home" href="#home">Create TA account</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu1" id="batch_tab">Batch create student accounts</a> <a class="nav-link" href="#menu1" id="batch_tab">Batch create student accounts</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#menu2" id="existing_accounts_tab">Existing accounts</a> <a class="nav-link" href="#menu2" id="existing_accounts_tab">Existing accounts</a>
</li> </li>
</ul> </ul>
<!-- Tab panes --> <!-- Tab panes -->
<div class="tab-content"> <div class="tab-content">
<div id="home" class="container tab-pane active"><br> <div id="home" class="tab-pane active"><br>
<?php <?php
if ($_SESSION['user_type'] == "Lecturer") { if ($_SESSION['user_type'] == "Lecturer") {
@ -125,7 +108,7 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
<!-- code contributed by Xu Xiaopeng (https://github.com/xxp1999) --> <!-- code contributed by Xu Xiaopeng (https://github.com/xxp1999) -->
<div id="menu1" class="container tab-pane fade" style="margin-top:10px"> <div id="menu1" class="tab-pane fade" style="margin-top:10px">
<b>Separate two student numbers with a space</b><br> <b>Separate two student numbers with a space</b><br>
<form action="batch_insert.php" method="post" id="batch_form"> <form action="batch_insert.php" method="post" id="batch_form">
<p> <p>
@ -136,7 +119,7 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
</div> </div>
<div id="menu2" class="container tab-pane fade"><br> <div id="menu2" class="tab-pane fade"><br>
<table class="table-bordered" style="font-size: 10pt;"> <table class="table-bordered" style="font-size: 10pt;">
<tr style="font-size:10pt;"> <tr style="font-size:10pt;">
@ -179,24 +162,19 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
} }
?> ?>
</table> </table>
</div> </div>
</div> </div>
</div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="container">
<ul class="nav nav-tabs" role="tablist"> <ul class="nav nav-tabs" role="tablist">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#menu3" id="existing_courses">Existing courses</a> <a class="nav-link active" href="#menu3" id="existing_courses">Existing courses</a>
</li> </li>
</ul> </ul>
</div>
<div id="menu3" class="container tab-pane active"><br> <div id="menu3" class="container tab-pane active"><br>
@ -256,6 +234,7 @@ if ($_SESSION['user_type'] != "Lecturer" && $_SESSION['user_type'] != "Admin") {
</div> </div>
</div>
</div> </div>
<script> <script>

View File

@ -21,8 +21,6 @@ if( $_SESSION['user_type']=="Lecturer" || $_SESSION['user_type']=="TA")
<div class="row" style="width:80%;margin:auto; text-align:left;"> <div class="row" style="width:80%;margin:auto; text-align:left;">
<script src="./css/jquery-1.11.1.min.js"></script> <script src="./css/jquery-1.11.1.min.js"></script>
<script src="./css/jquery-ui.min.js"></script> <script src="./css/jquery-ui.min.js"></script>
<link rel="stylesheet" href="./css/jquery-ui.css" /> <link rel="stylesheet" href="./css/jquery-ui.css" />
@ -473,7 +471,7 @@ WHERE Lecturer_User_ID=$lecturer_id and course_students_table.Status='Pending'"
<input type="radio" name="verify" value="1"> Yes <input type="radio" name="verify" value="1"> Yes
<input type="radio" name="verify" value="0" checked=""> No <input type="radio" name="verify" value="0" checked=""> No
<br> <br><br>
<input type="submit" class="btn btn-primary" value="Create"><br> <input type="submit" class="btn btn-primary" value="Create"><br>
</form> </form>

View File

@ -14,12 +14,13 @@ if (mysqli_connect_errno()) {
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="en-US">
<head> <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Lab Report Repository</title> <title>Lab Report Repository</title>
<link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href=" https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.0.1/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.
@ -28,7 +29,8 @@ if (mysqli_connect_errno()) {
--> -->
<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="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> <script src="./css/jquery.datetimepicker.min.js" type="text/javascript"></script>
@ -113,20 +115,6 @@ if (mysqli_connect_errno()) {
width:100%; width:100%;
} }
.txt1 {
font-family: Poppins-Regular;
font-size: 18px;
line-height: 1.5;
color: #666666;
}
.txt2 {
font-family: Poppins-Regular;
font-size: 19px;
line-height: 1.5;
color: #2471A3;
}
.form-control{ .form-control{
padding-top: 1px; padding-top: 1px;
padding-bottom:1px; padding-bottom:1px;
@ -142,8 +130,8 @@ if (mysqli_connect_errno()) {
<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" 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;" 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"> <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>
@ -159,7 +147,7 @@ if (mysqli_connect_errno()) {
</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">
Welcome &nbsp; Welcome &nbsp;
<b> <?php echo $_SESSION['user_fullname']; ?> </b> <b> <?php echo $_SESSION['user_fullname']; ?> </b>
&nbsp; &nbsp;
@ -174,18 +162,18 @@ if (mysqli_connect_errno()) {
<?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\"> </i>";
echo "&nbsp;<a style='color:#fff !important' href=\"~\..\Admin.php\" id=\"admin_tab\">Admin</a>"; echo "&nbsp;<a 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"> </i>
&nbsp;<a href="#" style='color:#fff !important' onclick="updatePass(<?php echo $_SESSION['user_id']; ?>)">Update password</a> &nbsp;<a href="#" 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"> </i>
&nbsp;<a style='color:#fff !important' href="~\..\logout.php">Logout </a> &nbsp;<a href="~\..\logout.php">Logout </a>
<?php <?php
} // Confusing. What is this for? } // Confusing. What is this for?

View File

@ -15,42 +15,35 @@ if (isset($_SESSION["user_fullname"])) {
<br><br><br> <br><br><br>
<div class="row" style="width:85%;margin:auto;"> <div class="container">
<div class="col-md-4">
<div class="row">
<div class="col">
<img src="logo.png" style="width:32%; position:relative; right:-95px; top:1px;" alt="LRR Logo">
<br><br> <br><br>
<img src="logo.png" style="width:40%; position:relative; right:-95px; top:1px;"> <div style="width:32%; position:relative; right:-90px; font-family: Poppins-Regular;">
<br><br>
<div style="width:20%; position:relative; right:-90px; font-family: Poppins-Regular;">
<h1>Lab Report Repository</h1> <h1>Lab Report Repository</h1>
</div> </div>
</div> </div>
<div style = "position:relative; left:240px; top:-2px;"> <div class="col">
<h4 class="list-group-item active" style="font-weight:normal;font-family: Poppins-Regular;"> Sign in </h4>
<div class="list-group-item">
<div class="panel-body">
<form method="post" action="Script.php" name="frm_login"> <form method="post" action="Script.php" name="frm_login">
<input type="hidden" name="frm_login" value="true"/> <input type="hidden" name="frm_login" value="true"/>
Account name <label for="user_name" class="form-label">Account name</label>
<input type="text" name="user" placeholder="Student Number / Email address" class="form-control" required="required" id="user_name" /> <input type="text" name="user" placeholder="Student Number / Email address" class="form-control" required="required" id="user_name" />
<br> <br>
Password <label for="user_password" class="form-label">Password</label>
<input type="password" class="form-control" name="password" placeholder="password" required="required" id="user_password" /> <input type="password" class="form-control" name="password" placeholder="password" required="required" id="user_password" />
<div class="text-left"> <br>
<br><input type="submit" class="btn-primary" value="Login" id="login_btn"> <button type="submit" class="btn btn-primary" id="login_btn">Sign in</button>
</div>
<br>
<label class="form-text">Don't have an account yet?</label> <a href="signup.php" id="signup_link">Sign up</a>
<br>
<label class="form-text">Forget your password?</label> <a href="recover_password.php">Recover</a>
<div class="text-left">
<span class="txt1">Don't have an account yet?</span>
<a class="txt2" href="signup.php" style="font-weight:normal" id="signup_link">Sign Up</a>
</div>
<div class="text-left">
<span class="txt1">Forget your password?</span>
<a class="txt2" href="recover_password.php" style="font-weight:normal">Reset my password</a>
</div>
<?php <?php
error_reporting(E_ALL); error_reporting(E_ALL);
@ -74,13 +67,10 @@ if (isset($_SESSION["user_fullname"])) {
} }
?> ?>
</form> </form>
</div>
</div> </div>
</div> </div>
</div> </div>
<div id="footer"> <div id="footer">
LRR was originally developed as a <a href="http://lanlab.org/course/2018f/se/homepage.html" style="color:white;">software engineering course project</a> by Mohamed Nor and Elmahdi Houzi. Please submit your suggestions or bug reports to Mr Lan. <a href="./homepage" style="color:white;">More information ...</a> LRR was originally developed as a <a href="http://lanlab.org/course/2018f/se/homepage.html" style="color:white;">software engineering course project</a> by Mohamed Nor and Elmahdi Houzi. Please submit your suggestions or bug reports to Mr Lan. <a href="./homepage" style="color:white;">More information ...</a>
</div> </div>

View File

@ -7,25 +7,19 @@ include 'Header.php';
?> ?>
<div class="row"> <div class="container">
<div class="row justify-content-md-center">
<div class="col-md-4 list-group" style="margin:auto;"> <div class="col-md-auto">
<br>
<h4 class="list-group-item active"> Recover password </h4>
<div class="list-group-item">
<div class="panel-body">
<form method="post" action="Script.php"> <form method="post" action="Script.php">
<input type="hidden" name="frm_recover_password" value="true"/> <input type="hidden" name="frm_recover_password" value="true"/>
Student number <input type="text" name="sno" placeholder="Enter your student number" class="form-control" required="required" value="<?php echo htmlspecialchars($_SESSION['student_number']); ?>"> Student number <input type="text" name="sno" placeholder="Enter your student number" class="form-control" required="required" value="<?php echo htmlspecialchars($_SESSION['student_number']); ?>">
<br/> <br/>
Email <input type="text" name="email" placeholder="Enter your email address" class="form-control" required="required" value="<?php echo htmlspecialchars($_SESSION['user_email']); ?>"> Email <input type="text" name="email" placeholder="Enter your email address" class="form-control" required="required" value="<?php echo htmlspecialchars($_SESSION['user_email']); ?>">
<br/> <br/>
<input type="submit" class="btn-primary" value="Recover"> <button type="submit" class="btn btn-primary">Recover</button>
</form> </form>
</div>
</div>
<?php <?php
if(isset($_SESSION['info_recover_password'])) { if(isset($_SESSION['info_recover_password'])) {
@ -34,10 +28,5 @@ include 'Header.php';
} }
?> ?>
</div>
</div>
</div>
</div> </div>

View File

@ -6,18 +6,13 @@ include 'NoDirectPhpAcess.php';
include 'Header.php'; include 'Header.php';
?> ?>
<div class="row"> <div class="container">
<div class="col-md-4 list-group" style="margin:auto;"> <div class="row justify-content-md-center">
<div class="col-md-auto">
<br>
<h4 class="list-group-item active"> Please fill in each field below </h4>
<div class="list-group-item">
<div class="panel-body">
<form method="post" action="Script.php" id="signup_form"> <form method="post" action="Script.php" id="signup_form">
<input type="hidden" name="form_signup" value="true" /> <input type="hidden" name="form_signup" value="true" />
Full Name Full Name
<input type="text" name="fullname" placeholder="Your full name" class="form-control" value="<?php echo $_SESSION['user_fullname']; ?>" required="required" id="full_name"/> <input type="text" name="fullname" placeholder="Your full name" class="form-control" value="<?php echo $_SESSION['user_fullname']; ?>" required="required" id="full_name"/>
@ -28,13 +23,13 @@ include 'Header.php';
Email Email
<input type="text" name="email" placeholder="Email" class="form-control" value="<?php echo $_SESSION['user_email']; ?>" required="required" id="email" /> <input type="text" name="email" placeholder="Email" class="form-control" value="<?php echo $_SESSION['user_email']; ?>" required="required" id="email" />
Password (<i>must include uppercase and lowercase letters, digits and special characters</i>) Password <label class="form-text">must include uppercase and lowercase letters, digits and special characters</label>
<input type="password" class="form-control" name="password" placeholder="Enter password" required="required" id="password1" /> <input type="password" class="form-control" name="password" placeholder="Enter password" required="required" id="password1" />
Confirm Password Confirm Password
<input type="password" class="form-control" name="confirmpassword" placeholder="Confirm password" required="required" id="password2" /> <input type="password" class="form-control" name="confirmpassword" placeholder="Confirm password" required="required" id="password2" />
<br> <br>
<input type="submit" class="btn-primary" value="Sign up" id="signup_btn"> <button type="submit" class="btn btn-primary" id="signup_btn">Sign up</button>
<?php <?php
error_reporting(E_ALL); error_reporting(E_ALL);
if (isset($_SESSION['info_signup'])) { if (isset($_SESSION['info_signup'])) {
@ -42,9 +37,8 @@ include 'Header.php';
$_SESSION['info_signup'] = null; $_SESSION['info_signup'] = null;
} }
?> ?>
</form>
</div> </form>
</div> </div>
</div> </div>
</div> </div>