-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrms.php
328 lines (288 loc) · 13 KB
/
rms.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
<?php include 'auth.php' ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<!-- <link rel="icon" href="images/logo.jpg"> -->
<title>WEKS COLLEGE MANAGEMENT SYSTEM</title>
<link href="asset/css/bootstrap.min.css" rel="stylesheet">
<link href="asset/css/sb-admin.css" rel="stylesheet">
<link href="asset/css/plugins/morris.css" rel="stylesheet">
<link href="asset/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="datatables/dataTables.bootstrap.css" rel="stylesheet">
<link href="asset/css/styles.css" rel="stylesheet">
<script src="assets/js/jquery.min.js"></script>
<script src="datatables/jquery.dataTables.js"></script>
<script src="datatables/dataTables.bootstrap.js"></script>
<script src="asset/js/bootstrap.min.js" type="text/javascript"></script>
<script src="assets/js/ie-emulation-modes-warning.js"></script>
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="col-md-1">
<!-- <img src="" style="height:48px;width:50px;align:center" alt=""> -->
</div>
<a class="navbar-brand" href=""><b> WEKS COLLEGE MANAGEMENT SYSTEM</b></a>
</div>
<!-- Top Menu Items -->
<ul class="nav navbar-right top-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i>
<?php echo $_SESSION['fname']?>
<b class="caret"></b></a>
<ul class="dropdown-menu">
<?php
include 'db.php';
$sql = mysqli_query($conn,"SELECT * FROM user where USER_ID = '".$_SESSION['ID']."'");
$row = mysqli_fetch_assoc($sql);
if($row['USER_TYPE'] == 'ADMINISTRATOR'){
?>
<li>
<a href="" data-toggle="modal" data-target="#new_user"><i class="fa fa-fw fa-pencil"></i>Account</a>
</li>
<li class="divider"></li>
<?php
}else{}
?>
</li>
<li class="divider"></li>
<li>
<a href="logout.php"><i class="fa fa-fw fa-power-off"></i> Log Out</a>
</li>
</ul>
</li>
</ul>
<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<?php
include 'db.php';
$sql = mysqli_query($conn,"SELECT * FROM user where USER_ID = '".$_SESSION['ID']."'");
$row = mysqli_fetch_assoc($sql);
if($row['USER_TYPE'] == 'ADMINISTRATOR'){
include 'sidebar.php';
}else{
include 'sidebar_staff.php';
}
?>
</div>
<!-- /.navbar-collapse -->
</nav>
<div id="page-wrapper">
<div class="container-fluid">
<?php
error_reporting(E_ALL ^ E_NOTICE);
$page = $_GET['page'];
$pages = array('home', 'Students', 'subjects','student_p','records','record','addrecord','report','program','statistical','form137','list_report','student_report','users','school_year','grade','advisers','database','candidates','candidates_list', 'candidates_report','logs');
if (!empty($page)) {
if(in_array($page,$pages)) {
$page .= '.php';
include($page);
}
else {
echo 'Page not found. Return
<a href="rms.php?page=home">home</a>';
}
}
?>
</div>
</div>
</div>
<div class="modal fade" id="new_user" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Manage Acount</h4>
</div>
<div class="modal-body">
<div class="container">
<?php
include 'db.php';
$sql= mysqli_query($conn, "SELECT * FROM user where USER_ID = '".$_SESSION['ID']."'");
while($row = mysqli_fetch_assoc($sql)) {
?>
<form class="form-horizontal" method="post" action="update_account.php">
<div class="form-group">
<label class="control-label col-sm-1" for="fname">Firstname:</label>
<div class="col-sm-3">
<input type="hidden" class="form-control" name="id" value="<?php echo $row['USER_ID'] ?>" >
<input type="text" class="form-control" id="fname" name="fname" value="<?php echo $row['FIRSTNAME'] ?>" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1" for="lname">Lastname:</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="lname" name="lname" value="<?php echo $row['LASTNAME'] ?>" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1" for="user">User:</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="user" name="user" value="<?php echo $row['USER'] ?>" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1" for="pwd">Password:</label>
<div class="col-sm-3">
<input type="password" class="form-control" id="pwd" name="pwd" value="<?php echo $row['PASSWORD'] ?>" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1" for="pwd">User Type:</label>
<div class="col-sm-3">
<select class="form-control" name="type" id="sel1">
<option><?php echo $row['USER_TYPE']?></option>
<?php
if($row['USER_TYPE'] == "STAFF"){ ?>
<option value="ADMINISTRATOR">ADMINISTRATOR</option>
<?php }else{?>
<option value="STAFF">STAFF</option>
<?php } ?>
</select>
</div>
</div>
<?php } ?>
<div class="form-group">
<label class="control-label col-sm-1" for="admin">Current Password</label>
<div class="col-sm-3">
<input type="password" class="form-control" name="admin" required="">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<div class="col-md-offset-2">
<button type="submit" class="btn btn-default">Save</button>
</form>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="s_report" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Student List Report</h4>
</div>
<div class="modal-body">
<div class="container">
<div class="form-group">
<form action="rms.php?page=list_report" method="POST">
<label class="control-label col-sm-3" for="pd">School Year:</label>
<br><br>
<div class="col-sm-2">
<select class="form-control" name="sy" id="pd">
<option ></option>
<?php
include 'db.php';
$query= mysqli_query($conn,"SELECT SCHOOL_YEAR as sy FROM student_year_info GROUP BY SCHOOL_YEAR Order By SCHOOL_YEAR DESC");
while($row = mysqli_fetch_assoc($query)){
?>
<option><?php echo $row['sy'] ?></option>
<?php } ?>
</select>
</div>
</div>
<br><br>
<div class="form-group">
<label class="control-label col-sm-3" for="w">Status:</label>
<br><br>
<div class="col-sm-2">
<select class="form-control" name="stats" id="w">
<option ></option>
<option>Promoted</option>
<option>Retained</option>n>
</select>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-success " name="submitb" value="View">
</form>
<button type="button" class="btn btn-success" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="stats" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Select School Year</h4>
</div>
<div class="modal-body">
<div class="container">
<div class="form-group">
<form action="rms.php?page=statistical" method="POST">
<label class="control-label col-sm-3" for="pd">School Year:</label>
<br><br>
<div class="col-sm-2">
<select class="form-control" name="sy" id="pd">
<option ></option>
<?php
include 'db.php';
$query= mysqli_query($conn,"SELECT SCHOOL_YEAR as sy FROM student_year_info GROUP BY SCHOOL_YEAR Order By SCHOOL_YEAR DESC");
while($row = mysqli_fetch_assoc($query)){
?>
<option><?php echo $row['sy'] ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-success " name="submitb" value="View">
</form>
<button type="button" class="btn btn-success" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</div>
<script>
var slideIndex = 0;
showSlides();
function showSlides() {
var i;
var slides = document.getElementsByClassName("mySlides");
var dots = document.getElementsByClassName("dot");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex> slides.length) {slideIndex = 1}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "");
}
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active";
setTimeout(showSlides, 5000); // Change image every 2 seconds
}
</script>
<script src="assets/js/holder.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="assets/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>