-
Notifications
You must be signed in to change notification settings - Fork 0
/
schools.php
71 lines (71 loc) · 1.98 KB
/
schools.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
session_start();
require_once "includer.php";
require_once "includes/check_logged.php";
if(!is_admin()){
redirect("adminlogin.php");
}
function process(){
}
//TODO: This is for both hod and admin but hod can only view courses in his department
?>
<?php
//print_r($_SESSION['user_type'] === "hod");
$schools = School::all();
?>
<html>
<head>
<title>Schools</title>
<?php
include_once "includes/styles.php";
?>
<style type="text/css">
.center{
margin-top: 23vh;
}
</style>
</head>
<body>
<?php
include_once "includes/admin_nav_logged_in.php";
?>
<div class="col-md-8 offset-2 mt-4">
<?php if(!zero($schools)){
?>
<h4 class="text-center text-secondary">Schools</h4>
<?php if(is_admin()) {?>
<a href="addschool.php" class="float-right btn btn-success btn-sm">Add school <i class="fa fa-plus-circle"></i> </a>
<?php } ?>
<div class="clearfix"></div><br>
<table class="table table-responsive-lg table-hover">
<thead>
<tr class="bg-primary text-white">
<th>Number</th>
<th>School name</th>
</tr>
</thead>
<tbody>
<?php $i = 1; foreach ($schools as $school){ ?>
<tr>
<td><?= $i ?></td>
<td><?= $school->getName() ?></td>
</tr>
<?php $i++;} ?>
</tbody>
</table>
<?php } else {?>
<div class="col-mod-4 offset-2">
<h2 class="text-warning text-center center">Sorry</h2>
<p class="text-center"><small class="font-weight-light text-center font-italic">There are currently no schools available</small></p>
<?php
if(is_admin()){
?>
<a class="btn btn-primary btn-sm offset-5" href="addschool.php">Add some <i class="fa fa-plus-circle"></i> </a>
<?php } }?>
</div>
</div>
<?php
include_once "includes/scripts.php";
?>
</body>
</html>