Bug34-Lamashevskyi #47

Open
mrlan wants to merge 7 commits from Bug34-Lamashevskyi into master
10 changed files with 844 additions and 791 deletions

View File

@ -200,19 +200,24 @@ where course_ta.Course_ID=$c_id");
} }
echo " echo "
<tr> <td>$code - $name</td> <td>$faculty </td> <td>$lecturer</td><td>$ta</td> <td><form method='get' action='Script.php'> <select name='ta' class=''>"; <tr> <td>$code - $name</td> <td>$faculty </td> <td>$lecturer</td><td>$ta</td> <td>";
$resultx = mysqli_query($con, "SELECT * FROM Users_Table WHERE UserType='TA'"); $resultx = mysqli_query($con, "SELECT * FROM Users_Table WHERE UserType='TA' AND User_ID NOT IN (SELECT `TA` FROM `course_ta`
INNER JOIN users_table on users_table.User_ID=course_ta.TA
where course_ta.Course_ID=$c_id);");
if (mysqli_num_rows($resultx) == 0) { if (mysqli_num_rows($resultx) == 0) {
echo "No free TA";
} else { } else {
echo "<form method='get' action='Script.php'> <select name='ta' class=''>";
while ($row = mysqli_fetch_assoc($resultx)) { while ($row = mysqli_fetch_assoc($resultx)) {
$id = $row['User_ID']; $id = $row['User_ID'];
$name = $row['Full_Name']; $name = $row['Full_Name'];
echo "<option value='$id'> $name </option>"; echo "<option value='$id'> $name </option>";
} }
echo "</select> <input type='hidden' name='assignTA' value='true'> <input type='hidden' name='id' value='$c_id'> <input type='submit' value='assign'></form>";
} }
echo "</select> <input type='hidden' name='assignTA' value='true'> <input type='hidden' name='id' value='$c_id'> <input type='submit' value='assign'></form> </td></tr> echo " </td></tr>
"; ";
} }
} ?> } ?>

View File

@ -95,10 +95,6 @@ if ($_SESSION['user_type'] == "Student") {
<!----------Delete Course Button-----------> <!----------Delete Course Button----------->
<li> <li>
<html>
<body>
<div class="modal fade" id="delcourse"> <div class="modal fade" id="delcourse">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
@ -121,6 +117,7 @@ if ($_SESSION['user_type'] == "Student") {
</div> </div>
</div> </div>
</div> </div>
</li>
</div> </div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,9 @@
<br><br><br><br><br><br><br><br><br>
<div style="background-color:white;width:100%di">
</div> <footer class="footer bg-primary">
<div class="container text-light">
<p >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 lanhui _at_ zjnu.edu.cn. Last updated on 18/04/2020 by Ashly. <a href="./homepage" style="color:white;">More information ...</a></p>
<small>© 2018 Copyright: <a href="http://lanlab.org/">lanlab.org</a></small>
</div>
</footer>

View File

@ -19,137 +19,42 @@ if (mysqli_connect_errno()) {
<head> <head>
<link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<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" /><!-- Font-awesome CSS -->
<link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"><!-- Bootstrap CSS -->
<link href="./css/Styles.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://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script src="./css/jquery.datetimepicker.min.js" type="text/javascript"></script> <script src="./css/jquery.datetimepicker.min.js" type="text/javascript"></script>
<script src="./js/CustomDropdown.js" type="text/javascript"></script>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
</head> <script src="https://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
<body> <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css" />
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" style="padding-left:150px;padding-right:150px;margin:auto;"> <style>
<a class="navbar-brand" href="~\..\index.php"> <img src="logo.png" style="width:30px;height:30px;"> LRR </a> .bd-placeholder-img {
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation"> font-size: 1.125rem;
<span class="navbar-toggler-icon"></span> text-anchor: middle;
</button> -webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
<div class="collapse navbar-collapse" id="navbarColor02"> /*Rule to include a block of CSS properties only if a certain condition is true.*/
<ul class="navbar-nav mr-auto"> /*https://www.w3schools.com/css/css_rwd_mediaqueries.asp*/
<li class="nav-item active"> @media (min-width: 768px) {
.bd-placeholder-img-lg {
<li class="nav-item active"> font-size: 3.5rem;
<!-- <a class='nav-link' href='~\..\Visitors.php'> <i class='fa fa-globe'></i> Visitor Portal <span class='sr-only'>(current)</span></a> -->
</li>
<?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>";
?>
</li>
</ul>
<form class="form-inline my-2 my-lg-0" style="color:#fff;">
Welcome &nbsp; <b> <?php echo $_SESSION['user_fullname']; ?> </b> &nbsp;
<?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") {
echo "&nbsp;&nbsp;&nbsp; <i class=\"fa fa-cog\" style=\"color:#fff;\"> </i> &nbsp;<a style='color:#fff !important' href=\"~\..\Admin.php\">Admin </a>";
}
?>
&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;&nbsp;&nbsp; <i class="fa fa-lock" style="color:#fff;"> </i> &nbsp;<a style='color:#fff !important' href="~\..\logout.php">Logout </a>
<?php
} }
?> }
</form> </style>
</div>
</nav>
<style>
.nav-item {
border-color: #00ff66;
}
.nav-tabs {
border-color: #00ff66;
}
.btn-default {
border: 2px solid #00ff66;
width: 100%;
text-align: left;
margin: 3px auto;
font-weight: bold;
font-size: 13pt;
}
.table-bordered {
padding: 5px !important;
}
.alert {
font-weight: bold;
}
h1,
h2,
h3,
h4 {
color: #03407B;
}
a {
color: #03407B;
}
.break-word {
word-wrap: break-word;
white-space: -moz-pre-wrap !important;
/* Mozilla, since 1999 */
white-space: -pre-wrap;
/* Opera 4-6 */
white-space: -o-pre-wrap;
/* Opera 7 */
white-space: pre-wrap;
/* css-3 */
word-wrap: break-word;
/* Internet Explorer 5.5+ */
white-space: -webkit-pre-wrap;
/* Newer versions of Chrome/Safari*/
word-break: break-all;
white-space: normal;
}
.ui-widget-content.ui-dialog {
border: 2px solid #03488B;
}
.ui-dialog>.ui-widget-header {
background: #03488B;
color: white
}
.ui-button {
background: #03488B;
color: white
}
</style>
<script> <script>
function updatePass(id) { function updatePass(id) {
@ -169,3 +74,72 @@ if (mysqli_connect_errno()) {
window.location.href = "\Script.php\?action=statuschange&uid=" + id + "&status=" + status; window.location.href = "\Script.php\?action=statuschange&uid=" + id + "&status=" + status;
} }
</script> </script>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-primary sticky-top">
<div class="container-fluid">
<a class="navbar-brand" href="~\..\index.php"> <img src="logo.png" width="30" height="30"> LRR </a>
<?php
if (isset($_SESSION["user_fullname"]))
{
?>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive">
<span class="navbar-toggler-icon"></span>
</button>
<?php
}
?>
<div class="collapse navbar-collapse" id="navbarResponsive">
<?php
if (isset($_SESSION["user_fullname"])) {
echo "<ul class=\"navbar-nav mr-auto\">";
echo "<li class=\"nav-item active\">";
echo "<a class='nav-link' href='~\..\Courses.php'><i class='fa fa-book'></i> Courses</a>";
echo "</li></ul>";
?>
<ul class="nav navbar-nav navbar-right">
<li class="nav-item">
<a class="nav-link text-light" href="#">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'] . ") ";
?>
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-light" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Menu </a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a href="#" class="dropdown-item" onclick="updatePass(<?php echo $_SESSION['user_id']; ?>)"><i class="fa fa-user ">Update passwor</i></a>
<?php
if ($_SESSION['user_type'] == "Lecturer") {
echo "<a class=\"dropdown-item\" href=\"~\..\Admin.php\"><i class=\"fa fa-cog\" >Admin</i> </a>";
}
?>
</div>
</li>
<li class="nav-item">
<a class="nav-link text-light" href="~\..\logout.php"><i class="fa fa-lock" > Logout</i> </a>
</li>
</ul>
<?php
}
?>
</div>
</div>
</nav>

View File

@ -370,12 +370,13 @@ WHERE Course_id=$c_id");
if (mysqli_num_rows($result) == 0) { if (mysqli_num_rows($result) == 0) {
echo "You have no Group in this Course"; echo "You have no Group in this Course";
} else { } else {
echo "<div class=\"container\">";
while ($row = mysqli_fetch_assoc($result)) { while ($row = mysqli_fetch_assoc($result)) {
$name = $row['Group_Name']; $name = $row['Group_Name'];
$leader = $row['Full_Name'] . "(" . $row['Group_Leader'] . ")"; $leader = $row['Full_Name'] . "(" . $row['Group_Leader'] . ")";
$id = $row['Course_Group_id']; $id = $row['Course_Group_id'];
echo "<div class=\"card\" ><div class=\"card-body\">
echo "<div class='btn-default'><small> $name - Leader : $leader </small></div>"; <h5 class=\"card-title\">$name - Leader : $leader </h5> <ul class=\"list-group list-group-flush\">";
$rs2 = mysqli_query($con, "SELECT `ID`, `Course_Group_id`, course_group_members_table.Student_ID, $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` course_group_members_table.`Status`,users_table.Full_Name FROM `course_group_members_table`
@ -388,9 +389,12 @@ where course_group_members_table.Course_Group_id=$id");
$status = $row['Status']; $status = $row['Status'];
$Student_ID = $row['Student_ID']; $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></div></div>";
} }
echo "</div>";
} }
?> ?>

15
css/Styles.css Normal file
View File

@ -0,0 +1,15 @@
/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 100px; /* Margin bottom by footer height */
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 100px; /* Set the fixed height of the footer here */
}

161
index.php
View File

@ -1,7 +1,7 @@
<?php <?php
$page='Home'; $page='Home';
require 'Header.php'; require 'Header.php';
session_start(); session_start();
?> ?>
<?php <?php
@ -10,119 +10,78 @@ if (isset($_SESSION["user_fullname"])) {
header("Location: Courses.php"); header("Location: Courses.php");
} }
?> ?>
<div class="album py-5 bg-white">
<div class="container bg-white">
<br><br><br> <div class="row align-items-center">
<div class="row" style="width:85%;margin:auto;"> <div class="col-md-6">
<div class="col-md-4"> <div class="mb-6 box-shadow">
<br><br> <img class="mx-auto d-block" src="logo.png" />
<img src="logo.png" style="width:40%; position:relative; right:-95px; top:1px;"> <div class="card-body">
<br><br> <h1 style="font-family: Poppins-Regular;">Lab Report Repository</h1>
<div style="width:20%; position:relative; right:-90px; font-family: Poppins-Regular;"> </div>
<h1>Lab Report Repository</h1> </div>
<br><br> </div>
</div>
</div>
<br>
<div style = "position:relative; left:240px; top:-2px;">
<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"> <div class="col-md-6">
<div class="card mb-6 box-shadow">
<div class="card-header bg-primary" >
<h4 class="list-group-item active" style="font-weight:normal;font-family: Poppins-Regular;"> Sign in </h4>
</div>
<div class="card-body">
<form method="post" action="Script.php" name="frm_login">
<input type="hidden" name="frm_login" value="true"/>
<p>Student ID / Instructor Email</p>
<input type="text" name="user" placeholder="Email / Student Number" class="form-control" required="required" />
<br>
<p>Password</p>
<input type="password" class="form-control" name="password" placeholder="Password" required="required" />
<div class="text-center">
<br><input type="submit" class="btn btn-primary my-2 btn-lg btn-block" value="Login">
</div>
<br> <a href="recover_password.php">Reset my password</a>
<div class="text-center">
<br><span >Don't have an account?</span>
<a href="signup.php" >Sign Up</a>
</div>
<form method="post" action="Script.php" name="frm_login"> <?php
<input type="hidden" name="frm_login" value="true"/>
Student ID / Instructor Email
<input type="text" name="user" placeholder="Email / Student Number" class="form-control" required="required" />
<br>
Password
<input type="password" class="form-control" name="password" placeholder="password" required="required" />
<div class="text-center">
<br><input type="submit" class="btn-primary" value="Login">
</div>
<br> <a href="recover_password.php" style="font-weight:normal;color:#2471A3; font-family: Poppins-Regular;
font-size: 17px;">Reset my password</a>
<div class="text-center">
<br><span class="txt1">Don't have an account?</span>
<a class="txt2" href="signup.php" style="font-weight:normal">Sign Up</a>
</a>
</div>
<?php error_reporting(E_ALL);
error_reporting(E_ALL); if(isset($_SESSION['info_login'])) {
echo '<hr><div class="alert alert-danger" role="alert">'.$_SESSION['info_login'].'</div>';
if(isset($_SESSION['info_login'])) { $_SESSION['info_login']=null;
echo '<hr><div class="alert alert-danger" role="alert">'.$_SESSION['info_login'].'</div>'; }
$_SESSION['info_login']=null;
}
// wrong pass // wrong pass
if(isset($_SESSION['wrong_pass'])) { if(isset($_SESSION['wrong_pass'])) {
echo '<hr><div class="alert alert-danger" role="alert">'.$_SESSION['wrong_pass'].'</div>'; echo '<hr><div class="alert alert-danger" role="alert">'.$_SESSION['wrong_pass'].'</div>';
$_SESSION['wrong_pass']=null; $_SESSION['wrong_pass']=null;
} }
if(isset($_SESSION['infoChangePassword'])) { if(isset($_SESSION['infoChangePassword'])) {
echo '<hr><div class="alert alert-danger" role="alert">'.$_SESSION['infoChangePassword'].'</div>'; echo '<hr><div class="alert alert-danger" role="alert">'.$_SESSION['infoChangePassword'].'</div>';
$_SESSION['infoChangePassword']=null; $_SESSION['infoChangePassword']=null;
} }
?> ?>
</div> </form>
</form> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> <?php
require 'Footer.php';
?>
<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 lanhui _at_ zjnu.edu.cn. Last updated on 18/04/2020 by Ashly. <a href="./homepage" style="color:white;">More information ...</a>
</div>
</body> </body>
<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 100px;
font-family: Poppins-Regular;
font-size: 23px;
line-height: 1.5;
}
#footer{
position:fixed;
bottom:0;
left:0;
background-color:#03417C;
color:#FFF;
text-align:center;
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;
}
</style>
</html> </html>

9
js/CustomDropdown.js Normal file
View File

@ -0,0 +1,9 @@
$(document).ready(function(e){
$('.search-panel .dropdown-menu').find('a').click(function(e) {
e.preventDefault();
var param = $(this).attr("href").replace("#","");
var concept = $(this).text();
$('.search-panel span#search_concept').text(concept);
$('.input-group #search_param').val(param);
});
});

View File

@ -6,35 +6,37 @@ include 'NoDirectPhpAcess.php';
include 'Header.php'; include 'Header.php';
?> ?>
<div class="row"> <div class="album py-5 bg-white">
<div class="container bg-white">
<div class="col-md-4 list-group" style="margin:auto;"> <div class="col-md-6 panel panel-primary" >
<br> <br>
<h4 class="list-group-item active"> Please fill in each field below </h4> <h4 class="list-group-item active"> Please fill in each field below </h4>
<div class="list-group-item"> <div class="list-group-item">
<div class="panel-body"> <div class="panel panel-primary">
<form method="post" action="Script.php"> <form method="post" action="Script.php">
<input type="hidden" name="frm_signup_2" value="true" /> <input type="hidden" name="frm_signup_2" value="true" />
Full Name <p>Full Name</p>
<input type="text" name="fullname" placeholder="Your full name" class="form-control" value="<?php echo $_SESSION['user_fullname']; ?>" required="required" /> <input type="text" name="fullname" placeholder="Your full name" class="form-control" value="<?php echo $_SESSION['user_fullname']; ?>" required="required" />
Student ID <p>Student ID</p>
<input type="text" name="user_student_id" placeholder="Entre your student ID" class="form-control" value="<?php echo $_SESSION['user_student_id']; ?>" required="required"> <input type="text" name="user_student_id" placeholder="Entre your student ID" class="form-control" value="<?php echo $_SESSION['user_student_id']; ?>" required="required">
Email <p>Email</p>
<input type="text" name="email" placeholder="Email" class="form-control" value="<?php echo $_SESSION['user_email']; ?>" required="required" /> <input type="text" name="email" placeholder="Email" class="form-control" value="<?php echo $_SESSION['user_email']; ?>" required="required" />
Password (<i>must include uppercase and lowercase letters, digits and special characters</i>) <p>Password (<i>must include uppercase and lowercase letters, digits and special characters</i>)</p>
<input type="password" class="form-control" name="password" placeholder="Enter password" required="required" /> <input id="password" type="password" pattern="^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{4,}$" title="Password must have at least characters that include lowercase letters, uppercase letters, numbers and sepcial characters (e.g., !?.,*^)." class="form-control" name="password" placeholder="Enter password" required="required" onchange="if(this.checkValidity()) form.password_two.pattern = this.value;" />
Confirm Password <p>Confirm Password</p>
<input type="password" class="form-control" name="confirmpassword" placeholder="Confirm password" required="required" /> <input id="password_two" type="password" pattern="^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{4,}$" title="Password must have at least characters that include lowercase letters, uppercase letters, numbers and sepcial characters" class="form-control" name="confirmpassword" placeholder="Confirm password" required="required" onchange="this.setCustomValidity(this.validity.patternMismatch ? 'Please enter the same Password as above' : '');" />
<br> <br>
<input type="submit" class="btn-primary" value="Sign up">
<input type="submit" class="btn btn-primary" value="Sign up">
<?php <?php
error_reporting(E_ALL); error_reporting(E_ALL);
if (isset($_SESSION['info_signup2'])) { if (isset($_SESSION['info_signup2'])) {
@ -48,17 +50,5 @@ include 'Header.php';
</div> </div>
</div> </div>
</div> </div>
<style> </div>
/*------------------------------------------------------------------
[ 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>