-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudent_dashboard.php
71 lines (63 loc) · 3.12 KB
/
student_dashboard.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
include "./includes/student_nav.inc.php";
include "./includes/config.inc.php";
if (isset($_COOKIE['lms_student'])) {
$studentId = $_COOKIE['lms_student'];
} else {
$message = "You need to login first";
echo "<script>alert(\"$message\")</script>";
echo "<script>window.location.href = '../index.php';</script>";
}
// number of listed book
$sql_book = "select * from `books`";
$result_book = mysqli_query($conn, $sql_book);
if ($result_book) {
$num_book = mysqli_num_rows($result_book);
}
// number of not return book
$sql_book_not = "select * from `issuedbook` where returnDate='Not Return Yet' and studentId='$studentId'";
$result_book_not = mysqli_query($conn, $sql_book_not);
if ($result_book_not) {
$num_book_not = mysqli_num_rows($result_book_not);
}
// register user
$sql_student = "select * from `issuedbook` where studentId='$studentId'";
$result_student = mysqli_query($conn, $sql_student);
if ($result_student) {
$num_student = mysqli_num_rows($result_student);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.rtl.min.css" integrity="sha384-T5m5WERuXcjgzF8DAb7tRkByEZQGcpraRTinjpywg37AO96WoYN9+hrhDVoM6CaT" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<title>Student Dashboard</title>
</head>
<body>
<div class="container h-100 w-100 m-5 d-flex flex-column justify-content-center w-100">
<h2>Student Dashboard</h2>
<div style="width: 100%;" class="d-flex pt-3 gap-3 flex-wrap px-4">
<div style="width: 15em;" class="card d-flex flex-column align-items-center p-3">
<img height="100" width="100" src="https://res.cloudinary.com/dreamlist/image/upload/v1682708369/Library-Management-System/books_k2ywoa.svg" alt="book">
<h4><?php echo $num_book ?></h4>
<h5>Listed Books</h5>
</div>
<div style="width: 15em;" class="card d-flex flex-column align-items-center p-3">
<img height="100" width="100" src="https://res.cloudinary.com/dreamlist/image/upload/v1682708368/Library-Management-System/renew_fz91gm.svg" alt="not yet return">
<h4><?php echo $num_book_not ?></h4>
<h5>Books not return yet</h5>
</div>
<div style="width: 15em;" class="card d-flex flex-column align-items-center p-3">
<img height="100" width="100" src="https://res.cloudinary.com/dreamlist/image/upload/v1682998642/Library-Management-System/book2_uki4b9.svg" alt="Issued Book">
<h4><?php echo $num_student ?></h4>
<h5>Issued Book</h5>
</div>
</div>
</div>
</body>
</html>