-
Notifications
You must be signed in to change notification settings - Fork 0
/
bookAddition.php
138 lines (117 loc) · 5.35 KB
/
bookAddition.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>Booking List</title>
<link rel="stylesheet" type="text/css" href="css/mainpage.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="//apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script>
/* When the user clicks on the button, toggle between hiding and showing the dropdown content */
function showdropdown(id) {
document.getElementById(id).classList.toggle("show");
}
// Close the dropdown if the user clicks outside of it
window.onclick = function (e) { //drop on off
if (!e.target.matches('.dropbtn')) {
var CategoryDropdown = document.getElementById("CategoryDropdown");
var MenuDropdown = document.getElementById("MenuDropdown");
var DDDropdown = document.getElementById("DDDropdown");
if (CategoryDropdown.classList.contains('show')) {
CategoryDropdown.classList.remove('show');
}
if (MenuDropdown.classList.contains('show')) {
MenuDropdown.classList.remove('show');
}
if (DDDropdown.classList.contains('show')) {
DDDropdown.classList.remove('show');
}
}
}
function logoutAlert(msg) { //logout alert
var r = confirm(msg);
if (r == true) {
window.location.href = "main.php";
}
}
$(document).ready(function () {
$(window).scroll(function () {
var top = $("#myBtn");
if ($('body').height() <= ($(window).height() + $(window).scrollTop() + 200)) {
top.animate({
"margin-left": "0px"
}, 1500);
} else {
top.animate({
"margin-left": "-100%"
}, 1500);
}
});
$("#myBtn").on('click', function () {
$("html, body").animate({
scrollTop: 0
}, 400);
});
});
window.onscroll = function () {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("myBtn").style.display = "block";
} else {
document.getElementById("myBtn").style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>
</head>
<body style="background-color: #AEF2FB;">
<div class="navbar">
<a href="student.php">Home</a>
<a href="#news">News</a>
<a href="bookRoomPage.php">Study Room Booking</a>
<div class="dropdown">
<button class="dropbtn" onclick="showdropdown('DDDropdown')" style="width:200px;">Learning Resources
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content" id="DDDropdown" style="width:200px;">
<a href="#">Exam Past Paper</a>
<a href="#">Programme Materials</a>
</div>
</div>
<!--end of dropdown class-->
<div class="dropdown">
<button class="dropbtn" onclick="showdropdown('CategoryDropdown')" style="width:120px;">Category
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content" id="CategoryDropdown" style="width:120px;">
<a href="#">Books</a>
<a href="#">Software</a>
<a href="#">Magazines</a>
</div>
</div>
<div class="dropdown" style="float:right">
<button class="dropbtn" onclick="showdropdown('MenuDropdown')" style="width:115px;">Menu
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content" id="MenuDropdown" style="width:115px;">
<a href="#"><img src="images/profile.png" style="float:left; width:20px; height=20px; ">Profile</a>
<a href="studentDiscovery.php"><img src="images/requests.png" style="float:left; width:20px; height=20px; ">Requests</a>
<a href="#"><img src="images/setting.png" style="float:left; width:20px; height=20px; ">Setting</a>
<a href="#" onclick="logoutAlert('Do you want to logout?');"><img src="images/logout.png" style="float:left; width:20px; height=20px; ">Logout</a>
</div>
</div>
<a style="float:right">Student Name: Yip Yiu Cheung</a>
<img src="images/studentIcon.png" style="float:right; width:45px; height:45px;">
</div> <!-- end of navbar -->
<img src="arrow.png" id="myBtn" title="Go to top" style="width:25px; height=25px ">
</body>
</html>