This repository has been archived by the owner on Nov 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
navbar.php
210 lines (143 loc) · 8.62 KB
/
navbar.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<?php
session_start();
if (isset($_SESSION['name'])==false){
header("location: ../");
}
if(isset($_SESSION['status'])==false){
$_SESSION['status'] ="all";
}
if(isset($_SESSION['page_no'])==false){
$_SESSION['page_no'] ="1";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Students Home</title>
<link rel="stylesheet" href="Navbar.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<link href="sidebar.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous">
</script>
<style>
a :hover {
color: rgb(50, 50, 155);
}
</style>
</head>
<body>
<div class="d-flex" id="wrapper">
<!-- Sidebar -->
<div class="bg-light border-right" id="sidebar-wrapper">
<div class="sidebar-heading text-center">
<a class="navbar-brand" href="#"><img src="logoH.png" alt="logo" height="100" width="100"></a>
</div>
<div class="list-group list-group-flush">
<br><br><br><br>
<button onclick="location.href = '../student_send_request';" class="btn btn-success btn-md ml-4 mr-4"><i
class="fa fa-plus text-white"></i> Add Request</button><br><br><br>
<a href="../Student's_home/all.php" class="list-group-item list-group-item-action bg-light">All</a>
<a href="../Student's_home/pending.php"
class="list-group-item list-group-item-action bg-light">Pending</a>
<a href="../Student's_home/accepted.php"
class="list-group-item list-group-item-action bg-light">Accepted</a>
<a href="../Student's_home/decilined.php"
class="list-group-item list-group-item-action bg-light">Declined</a>
</div>
</div>
<!-- Page Content -->
<div id="page-content-wrapper">
<!--Navigation bar-->
<nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom navbar-icon-top">
<button class="btn btn-sm btn-warning" id="menu-toggle"> <i class="fa fa-exchange"></i></button>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="#"><i class="fa fa-home"></i></a>
</li>
</ul>
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<?php echo $_SESSION['name']; ?>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="../Student's_home/edit_prof.php">Edit Profile</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="../Student's_home/change_pw.php">Change Password</a>
</div>
</li>
<?php
$sql2 = "SELECT time, request_to, request_type, detail FROM request WHERE reqiest_from ='{$_SESSION['name']}' and is_read='unread'";
$sql = "SELECT time, id,request_to, request_type, detail FROM request WHERE reqiest_from ='{$_SESSION['name']}' and is_read='unread' ORDER BY time DESC, is_read DESC LIMIT 5 ";
include '../db_config.php';
$result = $db->query($sql2);
$num_of_noti = $result->num_rows;
?>
<!--bell-->
<li class="nav-item dropdown bell">
<a class="nav-link text-light" href="#" id="navbarDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-bell">
<span class="badge" style="color: red;"><?php echo $num_of_noti;?></span>
</i>
</a>
<ul class="dropdown-menu bell">
<li class="head text-light bg-dark">
<div class="container">
<span>Notifications (<?php echo $num_of_noti;?>)</span>
</li>
<?php
$result = $db->query($sql);
if ($result->num_rows > 0) {
$i=0;
// output data of each row
while($row = $result->fetch_assoc()) {
$i++;
?>
<li class="notification-box <?php if($i%2==0){ echo'bg-light';}?>">
<div class="container">
<a href="request_view.php?id=<?php echo $row['id'];?>"> <strong class="text-dark"><?php echo $row['request_to'];?> -
<?php echo $row['request_type'];?></strong></a>
<div>
</div>
<br>
<small
class="text-info"><?php echo date_format(date_create($row['time']),"d/m/Y | h:i A");?></small>
</div>
</li>
<?php
}
} else {
echo "No mails to display";
}
?>
<li class="footer bg-dark text-center">
<a href="all.php" class="text-light">View All</a>
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="#"><i class="fa fa-question-circle"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" href="log_out.php"><i class="fa fa-sign-out"></i></i></a>
</li>
</ul>
</div>
</nav>
<!--Body content-->