-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
459 lines (422 loc) · 17.6 KB
/
index.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
<?php
include('server.php');
// session_start();
if (!isset($_SESSION['username'])) {
$_SESSION['msg'] = "You must log in first";
header('location: login.php');
}
if (isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['username']);
header("location: login.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dedan Kimathi Clearance System</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">
<meta content="" name="description">
<!-- Favicons -->
<link href="img/favicon.png" rel="icon">
<link href="img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" rel="stylesheet">
<!-- Bootstrap CSS File -->
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Libraries CSS Files -->
<link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="lib/animate/animate.min.css" rel="stylesheet">
<link href="lib/ionicons/css/ionicons.min.css" rel="stylesheet">
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<!-- Main Stylesheet File -->
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<div class="click-closed"></div>
<!--/ Nav Star /-->
<nav class="navbar navbar-default navbar-trans navbar-expand-lg fixed-top">
<div class="container">
<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarDefault"
aria-controls="navbarDefault" aria-expanded="false" aria-label="Toggle navigation">
<span></span>
<span></span>
<span></span>
</button>
<a class="navbar-brand text-brand" href="index.php">Clearance<span class="color-b">System</span></a>
<div class="navbar-collapse collapse justify-content-center" id="navbarDefault">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" href="index.php">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<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">
Pages
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="profile.php">Profile</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html">Contact</a>
</li>
<!-- logged in user information -->
<li>
<?php if (isset($_SESSION['username'])) : ?>
<strong> <a class="nav-link" href="#"><?php echo $_SESSION['username']; ?></a></strong>
</li>
<li>
<a class="nav-link" href="index.php?logout='1'" style="color: red;">  [logout] </a>
<?php endif ?>
</li>
</ul>
</div>
</div>
</nav>
<!--/ Nav End /-->
<!--/ Testimonials Star /-->
<section class="section-testimonials section-t8 nav-arrow-a">
<div class="container">
<h2>CLEARANCE PROGRESS</h2>
[[ OUR TABLE HERE ]]
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">REG No. </th>
<th scope="col">COD</th>
<th scope="col">librarian</th>
<th scope="col">Housekeeper</th>
<th scope="col">Dean of Students</th>
<th scope="col">Sports Officer</th>
<th scope="col">Registrar</th>
<th scope="col">Finance</th>
</tr>
</thead>
<tbody>
<?php
$user =$_SESSION['username'];
echo $user;
$sql = "SELECT * FROM clearance WHERE student_reg = '$user'";
$result = mysqli_query($db, $sql);
while($row = mysqli_fetch_array($result, MYSQLI_NUM)){
$cod = $row[2]; $lib = $row[3]; $hse = $row[4]; $dos = $row[5]; $sprt= $row[6]; $rgtr= $row[7]; $fin = $row[8];
echo' <tr>
<th scope="row">'.$_SESSION['username'].'</th>';
echo '<td>'.$row[2].'</td>';
echo '<td>'.$row[3].'</td>';
echo '<td>'.$row[4].'</td>';
echo '<td>'.$row[5].'</td>';
echo '<td>'.$row[6].'</td>';
echo '<td>'.$row[7].'</td>';
echo '<td>'.$row[8].'</td>';
echo'</tr>';
}
?>
</tbody>
</table>
<?php
if( ($cod =='CLEARED') && ($cod == $lib) && ($lib== $hse) && ($hse==$dos) && ($dos== $sprt) && ($sprt==$rgtr) && ($rgtr==$fin)){
echo "<div style='padding: 6px 12px; border: 1px solid #ccc; background-color:rgba(10, 200, 0, 0.3);'>
<h4>All Cleared !!</h4>
<a href='#' ><i class='fa fa-download'></i><b>'.$user.'</b></a><br>
Fantastick. you can download the Department Clearance form";
echo '<a href="pdf/pdf.php?reg='.$user.'" target="0"><button class="btn btn-primary" style="width:100%"><i class="fa fa-download"></i>Download Clearance Form</button></a>';
echo '</div>';
echo '<br>';
echo "<div style='padding: 6px 12px; border: 1px solid #ccc; background-color:rgba(5, 0, 200, 0.3);'>
<h4 style='color:white;'>Gawn Clearance !</h4>
<a href='#' ><i class='fa fa-download'></i><b>'.$user.'</b></a><br>
you can now access gawn clearance here <br>";
echo '<a href="gawnpart.php" target="0"><i class="fa fa-book"></i> Gown Clearance</a>';
echo '</div>';
}
?>
</div>
<br>
<div class="container" >
<div style="padding: 6px 12px; border: 1px solid #ccc;height:auto; verflow: auto;">
<b>Issues from department ...... if there's any </b>
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">REG No. </th>
<th scope="col">Department</th>
<th scope="col">Issue Category</th>
<th scope="col">Description</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
<?php
$user =$_SESSION['username'];
?>
<!-- [ LOOP THE ISSUES FROM ALL DEPARTMENTS IF ANY ] -->
<?php
$sqlcod = "SELECT * FROM issue_cod WHERE std_reg='$user'";
$sqldeanofstudents = "SELECT * FROM issue_deanofstudents WHERE std_reg='$user'";
$sqlfinance = "SELECT * FROM issue_finance WHERE std_reg='$user'";
$sqlhousekeeper = "SELECT * FROM issue_housekeeper WHERE std_reg='$user'";
$sqllibrarian = "SELECT * FROM issue_librarian WHERE std_reg='$user'";
$sqlregistrar = "SELECT * FROM issue_registrar WHERE std_reg='$user'";
$sqlsportsofficer = "SELECT * FROM issue_sportsofficer WHERE std_reg='$user'";
$rescod = mysqli_query($db, $sqlcod);
$resdeanofstudents = mysqli_query($db, $sqldeanofstudents);
$resfinance = mysqli_query($db, $sqlfinance);
$reshousekeeper = mysqli_query($db, $sqlhousekeeper);
$reslibrarian = mysqli_query($db, $sqllibrarian);
$resregistrar = mysqli_query($db, $sqlregistrar);
$ressportsofficer = mysqli_query($db, $sqlsportsofficer);
if (mysqli_num_rows($rescod) > 0) {
echo '<tr>' ;
$sql = "SELECT * FROM issue_cod WHERE std_reg = '$user' ";
$result = mysqli_query($db, $sql);
while($row = mysqli_fetch_array($result, MYSQLI_NUM)){
$dept = 'COD';
echo '<td>'.$row[1].'</td>';
echo '<td>'.$dept.'</td>';
echo '<td>'.$row[2].'</td>';
echo '<td>'.$row[3].'</td>';
echo '<td>'.$row[4].'</td>';
}
echo '</tr>';
}
if (mysqli_num_rows($resdeanofstudents) > 0) {
echo '<tr>' ;
$sql = "SELECT * FROM issue_deanofstudents WHERE std_reg = '$user' ";
$result = mysqli_query($db, $sql);
while($row = mysqli_fetch_array($result, MYSQLI_NUM)){
$dept = 'Dean Of Students';
echo '<td>'.$row[1].'</td>';
echo '<td>'.$dept.'</td>';
echo '<td>'.$row[2].'</td>';
echo '<td>'.$row[3].'</td>';
echo '<td>'.$row[4].'</td>';
}
echo '</tr>';
}
if (mysqli_num_rows($resfinance) > 0) {
echo '<tr>' ;
$sql = "SELECT * FROM issue_finance WHERE std_reg = '$user' ";
$result = mysqli_query($db, $sql);
while($row = mysqli_fetch_array($result, MYSQLI_NUM)){
$dept = 'Finance';
echo '<td>'.$row[1].'</td>';
echo '<td>'.$dept.'</td>';
echo '<td>'.$row[2].'</td>';
echo '<td>'.$row[3].'</td>';
echo '<td>'.$row[4].'</td>';
}
echo '</tr>';
}
if (mysqli_num_rows($reshousekeeper) > 0) {
echo '<tr>' ;
$sql = "SELECT * FROM issue_housekeeper WHERE std_reg = '$user' ";
$result = mysqli_query($db, $sql);
while($row = mysqli_fetch_array($result, MYSQLI_NUM)){
$dept = 'HouseKeeper';
echo '<td>'.$row[1].'</td>';
echo '<td>'.$dept.'</td>';
echo '<td>'.$row[2].'</td>';
echo '<td>'.$row[3].'</td>';
echo '<td>'.$row[4].'</td>';
}
echo '</tr>';
}
if (mysqli_num_rows($reslibrarian) > 0) {
echo '<tr>' ;
$sql = "SELECT * FROM issue_librarian WHERE std_reg = '$user' ";
$result = mysqli_query($db, $sql);
while($row = mysqli_fetch_array($result, MYSQLI_NUM)){
$dept = 'Librarian';
echo '<td>'.$row[1].'</td>';
echo '<td>'.$dept.'</td>';
echo '<td>'.$row[2].'</td>';
echo '<td>'.$row[3].'</td>';
echo '<td>'.$row[4].'</td>';
}
echo '</tr>';
}
if (mysqli_num_rows($resregistrar) > 0) {
echo '<tr>' ;
$sql = "SELECT * FROM issue_registrar WHERE std_reg = '$user' ";
$result = mysqli_query($db, $sql);
while($row = mysqli_fetch_array($result, MYSQLI_NUM)){
$dept = 'Registrar';
echo '<td>'.$row[1].'</td>';
echo '<td>'.$dept.'</td>';
echo '<td>'.$row[2].'</td>';
echo '<td>'.$row[3].'</td>';
echo '<td>'.$row[4].'</td>';
}
echo '</tr>';
}
if (mysqli_num_rows($ressportsofficer) > 0) {
echo '<tr>' ;
$sql = "SELECT * FROM issue_sportsofficer WHERE std_reg = '$user' ";
$result = mysqli_query($db, $sql);
while($row = mysqli_fetch_array($result, MYSQLI_NUM)){
$dept = 'Sports Officer';
echo '<td>'.$row[1].'</td>';
echo '<td>'.$dept.'</td>';
echo '<td>'.$row[2].'</td>';
echo '<td>'.$row[3].'</td>';
echo '<td>'.$row[4].'</td>';
}
echo '</tr>';
}
?>
</tbody>
</table>
</div>
</div>
</section>
<!--/ Testimonials End /-->
<!--/ footer Star /-->
<section class="section-footer">
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-4">
<div class="widget-a">
<div class="w-header-a">
<h3 class="w-title-a text-brand">DEDAN KIMATHI UNIVERSITY</h3>
</div>
<div class="w-body-a">
<p class="w-text-a color-text-a">
Dedan kimathi university was founded some time long ago :).. and other stories coming right up
</p>
</div>
<div class="w-footer-a">
<ul class="list-unstyled">
<li class="color-a">
<span class="color-text-a">Phone .</span> +254 713 835 965</li>
<li class="color-a">
<span class="color-text-a">Email .</span> [email protected]</li>
</ul>
</div>
</div>
</div>
<div class="col-sm-12 col-md-4 section-md-t3">
<div class="widget-a">
<div class="w-header-a">
<h3 class="w-title-a text-brand">Quick Links</h3>
</div>
<div class="w-body-a">
<div class="w-body-a">
<ul class="list-unstyled">
<li class="item-list-a">
<i class="fa fa-angle-right"></i> <a href="#">DKUT Conservancy</a>
</li>
<li class="item-list-a">
<i class="fa fa-angle-right"></i> <a href="#">Enquiry</a>
</li>
<li class="item-list-a">
<i class="fa fa-angle-right"></i> <a href="#">Complaints and Compliments</a>
</li>
<li class="item-list-a">
<i class="fa fa-angle-right"></i> <a href="#">Media Center</a>
</li>
<li class="item-list-a">
<i class="fa fa-angle-right"></i> <a href="#">Affiliate</a>
</li>
<li class="item-list-a">
<i class="fa fa-angle-right"></i> <a href="#">Privacy Policy</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-md-4 section-md-t3">
<div class="widget-a">
<div class="w-header-a">
<h3 class="w-title-a text-brand">Resources</h3>
</div>
<div class="w-body-a">
<ul class="list-unstyled">
<li class="item-list-a">
<i class="fa fa-angle-right"></i> <a href="#">student Portal</a>
</li>
<li class="item-list-a">
<i class="fa fa-angle-right"></i> <a href="#">staff Portal</a>
</li>
<li class="item-list-a">
<i class="fa fa-angle-right"></i> <a href="#">Office Extension Memmabers</a>
</li>
<li class="item-list-a">
<i class="fa fa-angle-right"></i> <a href="#">ICT Helpdesk</a>
</li>
<li class="item-list-a">
<i class="fa fa-angle-right"></i> <a href="#">Library Catallogue</a>
</li>
<li class="item-list-a">
<i class="fa fa-angle-right"></i> <a href="#">Institutional Repository</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<footer>
<div class="container">
<div class="row">
<div class="col-md-12">
<nav class="nav-footer">
</nav>
<div class="socials-a">
<ul class="list-inline">
<li class="list-inline-item">
<a href="#">
<i class="fa fa-facebook" aria-hidden="true"></i>
</a>
</li>
<li class="list-inline-item">
<a href="#">
<i class="fa fa-twitter" aria-hidden="true"></i>
</a>
</li>
<li class="list-inline-item">
<a href="#">
<i class="fa fa-instagram" aria-hidden="true"></i>
</a>
</li>
<li class="list-inline-item">
<a href="#">
<i class="fa fa-pinterest-p" aria-hidden="true"></i>
</a>
</li>
<li class="list-inline-item">
<a href="#">
<i class="fa fa-dribbble" aria-hidden="true"></i>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</footer>
<!--/ Footer End /-->
<a href="#" class="back-to-top"><i class="fa fa-chevron-up"></i></a>
<div id="preloader"></div>
<!-- JavaScript Libraries -->
<script src="lib/jquery/jquery.min.js"></script>
<script src="lib/jquery/jquery-migrate.min.js"></script>
<script src="lib/popper/popper.min.js"></script>
<script src="lib/bootstrap/js/bootstrap.min.js"></script>
<script src="lib/easing/easing.min.js"></script>
<script src="lib/owlcarousel/owl.carousel.min.js"></script>
<script src="lib/scrollreveal/scrollreveal.min.js"></script>
<!-- Contact Form JavaScript File -->
<script src="contactform/contactform.js"></script>
<!-- Template Main Javascript File -->
<script src="js/main.js"></script>
</body>
</html>