-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.php
140 lines (121 loc) · 5.47 KB
/
main.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php
/*******************************************************
* main.php
*
* Called from index.php
* Calls: many pages, depending on which button is pressed
*
* This is the main landing page after one has logged on
* Other possibilities are: PAC page and patron page
* Options visible vary depending on the access level of the user (admin or staff)
*
********************************************************/
session_start();
require_once('common.php');
/********** Check permissions for page access ***********/
$allowed = array("ADMIN","STAFF");
if (false === array_search($userdata['authlevel'],$allowed)) {
$_SESSION['notify'] = array("type"=>"info", "message"=>"You do not have permission to access this information - Staff information");
header("location:logout.php");
exit;
}
/********************************************************/
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title><?=$institution?> Library Database</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="resources/bootstrap5.min.css" >
<script src="resources/bootstrap.bundle.min.js"></script>
<!-- our project just needs Font Awesome Solid + Brands -->
<!-- <link href="resources/fontawesome-6.4.2/css/fontawesome.min.css" rel="stylesheet"> -->
<link href="resources/fontawesome6.min.css" rel="stylesheet">
<link href="resources/fontawesome-6.4.2/css/brands.min.css" rel="stylesheet">
<link href="resources/fontawesome-6.4.2/css/solid.min.css" rel="stylesheet">
<link href="resources/library.css" rel="stylesheet">
<script src="resources/library.js"></script>
<script>
document.addEventListener("DOMContentLoaded", () => {
let text = (new Date()).toDateString();
document.getElementById("date").textContent = text;
});
</script>
<style>
button.dropdown-item {
display:block;
width:100%;
/*! padding:var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x); */
clear:both;
font-weight:400;
/*! color:var(--bs-dropdown-link-color); */
text-align:inherit;
text-decoration:none;
white-space:nowrap;
background-color:var(--bs-btn-bg);
border:1px solid gray;
border-radius:var(--bs-btn-border-radius);
}
</style>
</head>
<body>
<!-- this page has a special header, not the normal one that other pages use -->
<div class="container-md mt-2">
<span class="float-end px-2 pt-1" style="background-color: rgba(255,255,255,0.35);"><img width=200 height=170 src="images/logoBG.png"></span>
<h2 class="bg-warning text-center rounded py-3">The <?=$institution?> Public Libary</h2>
<div class="row">
<div class="col-md-8 p-0">
<div class="card border border-primary p-2">
<div class="alert alert-warning mb-0">Welcome "<b><?=$userdata['fullname']?></b>"</div>
</div>
</div>
<div class="col">
<?php
if ($userdata['authlevel'] === "ADMIN") {
echo '<span class="float-end"> <a class="d-block btn btn-danger" href="admin.php"><i class="fa fa-cogs"></i> Administer</a> </span>';
}
?>
</div>
</div>
<div class="card border border-secondary alert alert-warning">
<div class="card-body">
<div class="ml-3">
<a href="patronList.php"><button type="button" class="btn btn-success mt-1">Search Patrons</button></a>
<a href="bibSearch.php" class="px-2"><button type="button" class="btn btn-primary mt-1">Books</button></a>
<div class="dropdown d-inline-block">
<button class="btn btn-warning dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> Circulation </button>
<ul class="dropdown-menu" style="background-color:var(--bs-warning-bg-subtle)">
<li><button type="button" class="dropdown-item btn btn-warning" onclick="window.document.location='checkin.php'">Checkin</button></li>
<li><button type="button" class="dropdown-item btn btn-warning" onclick="window.document.location='checkout.php'">Checkout</button></li>
</ul>
</div>
<a href="" class="px-2"><button type="button" class="btn btn-outline-primary mt-1">Fines</button></a>
<a href="" class="px-2"><button type="button" class="btn btn-outline-primary mt-1">Reports</button></a>
<span class="float-end"><a href="userChangePWD.php"><button type="button" class="btn btn-outline-secondary mt-1">Change Password</button></a>
<a href="logout.php"><button type="button" class="btn btn-secondary mt-1">Logout</button></a></span>
</div>
</div><!-- /card-body -->
</div><!-- /card -->
<!-- ******** Anchor for Javascript and PHP notification popups ********** -->
<div id="notif_container"></div>
<?php if ($notify["message"] != "") echo "<script> displayNotification(\"{$notify['type']}\", \"{$notify['message']}\")</script>"; ?>
<!-- ********************************************************************* -->
<div class="card border border-secondary alert alert-warning mt-4">
<div class="card-body">
<p class="float-end"><span class="border-bottom border-end border-warning p-1">Today is <span id="date"></span></span></p>
<h3>Staff Announcements</h3>
<ul>
<li><i class="fa fa-crown"></i> Reminder: <b>the royal family</b> is coming for a visit in two weeks
<li><i class="fa fa-book"></i> We just received <b>$10,000</b> to buy new aooks
<li><i class="fa fa-mug-saucer"></i> Jane bought a <b>coffee maker</b> for us, it's in the staff lounge.
<li><i class="fa fa-jet-fighter"></i> This weekend is our <b>jet fighter ride</b> bonding experience!
</ul>
</div><!-- /card-body -->
</div><!-- /card -->
</div>
</body>
</html>