-
Notifications
You must be signed in to change notification settings - Fork 0
/
result.php
504 lines (425 loc) · 19.7 KB
/
result.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
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
<?php
include('check_login.php');
include('connect.php');
include("RandomStringGenerator.php");
include('function.php');
include('process.php');
$type = $role = '';
///////////////////VARIABLES/////////////////////////
//Session Bios
//Session
//Term
//ExamType
//Class
//Subject
/////////////////////////////////////////////////
// if(isset($_SESSION['s_firstname'])){
// echo $_SESSION['s_firstname'];
// }
////////////////////////////////////////////////////
$type = 'Non-Staff';
$type1 = 'Staff';
$role = 'Student';
$role1 = 'Admin';
if(isset($_SESSION['s_role'])){
$staffrole = $_SESSION['s_role'];
}
if((isset($_GET['role'])) && ($_GET['role']=$role)){
}
// foreach ($_SESSION as $subject => $subt) {
// echo $subject.': '.$subt."<br>";
// }
// if(((isset($_GET['r'])) && ($_GET['r'] =='K45tg5p679uojg4d56ghnbSR098877766@34554333455dfgfgfgfseafmbnnvgtyjbnvfgbpo09oi87j'))){
// if ((isset($_GET['p'])) && ($_GET['p']=='dashboard')){
// if ((isset($_GET['role'])) && ($_GET['role']=$role)){
// echo "yes it is set <br>";
// echo $_GET['r'];
// echo "<br>";
// echo $_GET['role'];
// }
// }
// }
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>QuickSchool | Dashboard</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.7 -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="bower_components/Ionicons/css/ionicons.min.css">
<!-- bootstrap datepicker -->
<link rel="stylesheet" href="bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
<!-- DataTables -->
<link rel="stylesheet" href="bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
<!-- jvectormap -->
<link rel="stylesheet" href="bower_components/jvectormap/jquery-jvectormap.css">
<!-- Theme style -->
<link rel="stylesheet" href="dist/css/AdminLTE.min.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
<!-- Pace style -->
<link rel="stylesheet" href="plugins/pace/pace.min.css">
<script type="text/javascript" src="maini.js"></script>
<script type="text/javascript" src="ajax.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Google Font -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
<style>
#alertbox1{
position:fixed;z-index:1000;width:60%;display:none;
}
</style>
<script>
function show(a,b,c,d,e,f,g){
var x = document.getElementById(a);
var y = document.getElementById('imbox');
var z = document.getElementById('comment');
var za = document.getElementById(f).value;
var zb = document.getElementById(g).value;
var r = x.innerHTML;
var role = "Admin";
y.innerHTML ='USERID:'+ d+'<br>'+ ' Reg. No.:' + r + ' Term:' + b + ' Session:' + c + ' Class: '+ e +' '+"<?php echo getStaffComment1('" + r + "','" + b + "','" + c + "','" + role + "') ?>";
z.innerHTML ="<p><h4>Class Teacher's Comment:</h4> " + za + "</p>" + "<p><h4>Head Teacher's Comment:</h4> " + zb + "</p>";//"<?php echo getStaffComment1('" + r + "','" + b + "','" + c + "','" + role + "'); ?>"
document.getElementById('uid').value = d;
document.getElementById('studreg').value = x.innerText;
document.getElementById('term').value = b;
document.getElementById('acadyr').value = c;
document.getElementById('class').value = e;
}
</script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<?php include('topbar.php'); ?>
<?php include('sidebar.php'); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Dashboard
<small>Version 2.0</small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Dashboard</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="callout callout-success" id="alertbox1" >
<h4>I am a success callout!</h4>
<p>This is a green callout.</p>
</div>
<!-- Info boxes -->
<div class="row">
<!-- left column -->
<div class="col-lg-12">
<!-- general form elements -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Students Result</h3>
</div>
<!-- /.box-header -->
<!-- form start -->
<form role="form" action="<?php $_SERVER['PHP_SELF'] ?>" method="POST">
<div class="box-body">
<table align="center" style="width:100%;">
<tr>
<td>
<label>Class</label>
</td>
<td>
<label>Term</label>
</td>
<td>
<label >Session</label>
</td>
<td >
</td>
</tr>
<tr>
<td>
<div class="form-group">
<select class="form-control" name="class">
<?php $Classes = getAllClasses();
if (!empty($Classes)){
foreach ($Classes as $class) {?>
<option value="<?php echo $class['classx']; ?>"><?php echo $class['classx']; ?></option>
<?php }
} ?>
</select>
</div>
</td>
<td>
<div class="form-group">
<select class="form-control" name="term">
<?php $Terms = getAllTerms();
if (!empty($Terms)){
foreach ($Terms as $term) {?>
<option value="<?php echo $term['term']; ?>">
<?php
if(($term['term']=="1st") || ($term['term']=="1ST") || ($term['term']=="First") || ($term['term']=="FIRST")){
echo "First";
}elseif (($term['term']=="2nd") || ($term['term']=="2ND") || ($term['term']=="Second") || ($term['term']=="SECOND")){
echo "Second";
}elseif(($term['term']=="3rd") || ($term['term']=="3RD") || ($term['term']=="Third") || ($term['term']=="THIRD")){
echo "Third";
}
?>
</option>
<?php }
} ?>
</select>
</div>
</td>
<td>
<div class="form-group">
<select class="form-control" name="session">
<?php $Sessions = getAllSessions();
if (!empty($Sessions)){
foreach ($Sessions as $session) {?>
<option value="<?php echo $session['sessionx']; ?>"><?php echo $session['sessionx']; ?></option>
<?php }
}
?>
</select>
</div>
</td>
<td>
<div class="form-group">
<button type="submit" class="btn btn-primary ajax" name="fetch_group"><i class="fa fa-spin fa-refresh" ></i> Fetch Result</button>
</div>
</td>
</tr>
</table>
</div>
<!-- /.box -->
</div>
</form>
<?php// if(!empty($Studall)) {?>
<!-- <table>
<tr>
<td><strong>S/No.</strong></td>
<td><strong>Reg No.</strong></td>
<td><strong>First Name</strong></td>
<!-<td> Middle Name</td> ->
<td><strong>Last Name</strong></td>
<td><strong>Current Class</strong></td>
<td><strong>Sex</strong></td>
<td><strong>Birth Date</strong></td>1
<!-<td> role</td> ->
</tr> -->
<?php //$s=1; foreach ($Studall as $result ) {
// $fullname = $result['firstname']." ".$result['lastname'];
//$studentid = $result['id'];echo $fullname;} ?>
<!-- <tr>
<td><strong><?php //echo $s; ?></strong></td>
<td><?php //echo $result['regno']; ?></td>
<td><?php //echo $result['firstname']; ?></td>
<td><?php //echo $result['lastname']; ?></td>
<!- <td><?php //echo $result['']; ?></td> ->
<td><?php //echo $result['class']; ?></td>
<td><?php //echo $result['gender']; ?></td>
<td><?php //echo $result['dateofbirth']; ?></td>
<!- <td><?php //echo $result['role']; ?></td> ->
</tr> -->
<?php //$s++; ?>
<?php //} ?>
<!-- </table> -->
<?php //}else{ echo "<p>No Record Currently available...Kindly Select to check the available records!</p>";} ?>
<style>
/*td{
padding:10px;
}*/
</style>
<?php if(!empty($ranker)){?>
<?php $Subject = getAllSubjects(); ?>
<?php if(!empty($Subject)){?>
<div class="box">
<div class="box-header">
<h3 class="box-title">Record for <?php if(isset($_SESSION['class_record'])){echo $_SESSION['class_record'];} ?> Class in <?php if(isset($_SESSION['term_record'])){echo $_SESSION['term_record'];} ?> Term <?php if(isset($_SESSION['session_record'])){echo $_SESSION['session_record'];} ?> Session</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr>
<th class="rotate">S/No.</th>
<th class="rotate">Reg_No.</th>
<th class="rotate">First_Name</th>
<th class="rotate">Last_Name</th>
<?php foreach ($Subject as $subject ) {?>
<th class="rotate" style="width:20px;"><?php echo substr($subject['subject'],0,4); ?></th>
<?php }?>
<th class="rotate">Average</th>
<th class="rotate">Grade</th>
<th class="rotate">Position</th>
<!-- <th class="rotate">Status</th> -->
<th class="rotate">Comment</th>
</tr>
</thead>
<tbody>
<!-- <tr> -->
<?php
$i=1;
$red = 0;
foreach ($ranker as $ko => $va) { ?>
<tr>
<td><?php echo $i; ?></td>
<td id="<?php echo $va['regno']; ?>"><?php echo $va['regno'];$red=$va['regno']; ?></td>
<td><?php echo $va['firstname']; ?></td>
<td><?php echo $va['lastname']; ?></td>
<?php foreach (($va['subject']) as $k => $v){ ?>
<td><?php echo $v; ?></td>
<?php } ?>
<td><?php echo $va['average']; ?></td>
<td><?php echo $va['grade']; ?></td>
<td><?php echo $va['position']; ?></td>
<!-- <td>Promoted</td> -->
<td><input type="hidden" id="co1" value="<?php echo $va['comment1']; ?>">
<input type="hidden" id="co2" value="<?php echo $va['comment2']; ?>"><a href="#" class="btn btn-primary" data-toggle="modal" data-target="#modal-comment" onclick="show('<?php echo $red; ?>','<?php if(isset($_SESSION['term_record'])){echo $_SESSION['term_record'];}?>','<?php if(isset($_SESSION['session_record'])){echo $_SESSION['session_record'];}?>','<?php if(isset($_SESSION['s_id'])){echo $_SESSION['s_id'];}?>', '<?php if(isset($_SESSION['class_record'])){echo $_SESSION['class_record'];} ?>','co1','co2')">View/Add</a></td>
</tr>
<?php $i++;} ?>
<!-- </tr> -->
</tbody>
<!-- <tfoot>
<tr>
<th><strong>S/No.</strong></th>
<th><strong>Reg No.</strong></th>
<th><strong>First Name</strong></th>
<!- <td> Middle Name</td> ->
<th><strong>Last Name</strong></th>
<th><strong>Current Class</strong></th>
<th><strong>Sex</strong></th>
<th><strong>Birth Date</strong></th>
<!- <td> role</td> ->
</tr>
</tfoot> -->
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
<?php }
}?>
<?php // }else{ echo "<p>No Record Currently available...Kindly Select to check the available records!</p>";} ?>
<!-- </section> -->
</section>
<!-- /.content -->
<div class="modal fade" id="modal-comment">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span></button>
<h4 class="modal-title">Comment Student Performance</h4>
<form role="form" action="<?php $_SERVER['PHP_SELF'] ?>" method="POST">
<div class="input-group input-group-sm">
<input type="hidden" class="form-control" name="uid" id="uid">
<input type="hidden" class="form-control" name="studreg" id="studreg">
<input type="hidden" class="form-control" name="class" id="class">
<input type="hidden" class="form-control" name="term" id="term">
<input type="hidden" class="form-control" name="acadyr" id="acadyr">
<input type="text" class="form-control" name="comment" value="">
<span class="input-group-btn">
<input type="submit" class="btn btn-primary btn-flat" name="addcomment" value="Save">
<!-- <input type="submit" class="btn btn-success btn-flat pull-right" name="updatecomment" value="Update"> -->
</span>
</div>
</form>
</div>
<div class="modal-body">
<p id="imbox"> </p>
<p id="comment"><!-- One fine body… -->
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
</div>
<!-- /.content-wrapper -->
<?php include('footer.php'); ?>
</div>
<!-- ./wrapper -->
<!-- jQuery 3 -->
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- PACE -->
<script src="bower_components/PACE/pace.min.js"></script>
<!-- bootstrap datepicker -->
<script src="bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<!-- FastClick -->
<script src="bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.min.js"></script>
<!-- Sparkline -->
<script src="bower_components/jquery-sparkline/dist/jquery.sparkline.min.js"></script>
<!-- jvectormap -->
<script src="plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<!-- SlimScroll -->
<script src="bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<!-- ChartJS -->
<script src="bower_components/chart.js/Chart.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="dist/js/pages/dashboard2.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js"></script>
<!-- DataTables -->
<script src="bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!-- <script type="text/javascript" src="jquery.js"></script> -->
<?php if(isset($_SESSION['s_id'])){echo '<script type="text/javascript" src="registernew.js"></script>';}?>
<!-- page script -->
<script>
$(function () {
$('#example1').DataTable()
$('#example2').DataTable({
'paging' : true,
'lengthChange': true,
'searching' : true,
'ordering' : true,
'info' : true,
'autoWidth' : true
})
//Date picker
$('#dob').datepicker({
autoclose: true
})
})
// To make Pace works on Ajax calls
$(document).ajaxStart(function () {
Pace.restart()
})
$('.ajax').click(function () {
$.ajax({
url: '#', success: function (result) {
$('.ajax-content').html('<hr>Ajax Request Completed !')
}
})
})
</script>
</body>
</html>