-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
161 lines (160 loc) · 6.02 KB
/
home.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
<?php
session_start();
include 'database/config.php';
if (!isset($_SESSION['username'])) {
header("location: index.php");
}
$staffId = $_SESSION['id'];
$sch_id = $_SESSION['sch_id'];
$role = $_SESSION['role'];
$username = $_SESSION['username'];
$user = $_SESSION['name'];
?>
<!DOCTYPE html>
<html>
<head>
<title>Home | Re-Entry Policy Tracking System</title>
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<link href="assets/css/styles.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" data-bs-toggle="offcanvas" href="#offcanvas" role="button" aria-controls="offcanvas"><span class="navbar-toggler-icon"></span></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-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 ms-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="home.php">Re-Entry Policy Tracking System</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<?php echo $user; ?>
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="profile.php"><i icon-name="user"></i> Profile</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="logout.php"><i icon-name="log-out"></i> Logout</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<!-- Offcanvas -->
<div class="offcanvas offcanvas-start" tabindex="-1" id="offcanvas" aria-labelledby="offcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="offcanvasLabel">Re-Entry Policy Tracking System</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<ul>
<li class="bg-gold">
<a href="home.php"><i icon-name="menu"></i> Home</a>
</li>
<?php if ($role == 2) { ?>
<li>
<a href="add-maternity-leave.php"><i icon-name="contact"></i> Maternity Leave</a>
</li>
<?php } ?>
<li>
<a href="school-record.php"><i icon-name="clipboard"></i> School Record</a>
</li>
<li>
<a href="status.php"><i icon-name="line-chart"></i> Status</a>
</li>
<li>
<a href="commitments.php"><i icon-name="users"></i> Commitments</a>
</li>
<?php if ($role == 1) { ?>
<li>
<a href="schools.php"><i icon-name="building-2"></i> Schools</a>
</li>
<?php } if ($role < 3) { ?>
<li>
<a href="users.php"><i icon-name="users"></i> Users</a>
</li>
<?php } ?>
<li>
<a href="logout.php"><i icon-name="log-out"></i> Logout</a>
</li>
</ul>
</div>
</div>
<main id="account">
<div class="container">
<div class="row">
<?php if ($role == 2) { ?>
<div class="col-md-3">
<a href="add-maternity-leave.php">
<div class="card">
<i icon-name="contact"></i> Maternity Leave
<span class="badge rounded-pill text-bg-light">+</span>
</div>
</a>
</div>
<?php } ?>
<div class="col-md-3">
<a href="school-record.php">
<div class="card">
<i icon-name="clipboard"></i> School Records
<span class="badge rounded-pill text-bg-light">
<?php
$query = "SELECT * FROM `records` WHERE `sch_id` = '$sch_id'";
$fetch = $mysqli->query($query) or die($mysqli->error.__LINE__);
echo $num_records = $fetch->num_rows;
?>
</span>
</div>
</a>
</div>
<div class="col-md-3">
<a href="commitments.php">
<div class="card">
<i icon-name="users"></i> Commitments
<span class="badge rounded-pill text-bg-light">
<?php
$query = "SELECT * FROM `commitments` WHERE `sch_id` = '$sch_id'";
$fetch = $mysqli->query($query) or die($mysqli->error.__LINE__);
echo $num_records = $fetch->num_rows;
?>
</span>
</div>
</a>
</div>
<div class="col-md-3">
<a href="status.php">
<div class="card">
<i icon-name="line-chart"></i> Status
<span class="badge rounded-pill text-bg-light">
<?php
$query = "SELECT * FROM `records`";
$fetch = $mysqli->query($query) or die($mysqli->error.__LINE__);
echo $num_records = $fetch->num_rows;
?>
</span>
</div>
</a>
</div>
</div>
</div>
</main>
<footer>
<div class="copyright">
Re-Entry Policy Tracking System © <?php echo date('Y'); ?>. All Rights Reserved.
</div>
</footer>
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
<!-- Development version -->
<script src="https://unpkg.com/lucide@latest/dist/umd/lucide.js"></script>
<!-- Production version -->
<script src="https://unpkg.com/lucide@latest"></script>
<script>
lucide.createIcons();
</script>
</body>
</html>