-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamflow_admin_view_student_result.php
194 lines (187 loc) · 6.09 KB
/
examflow_admin_view_student_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
<?php
include 'examflow_constants.php';
include_once 'examflow_classes.php';
if (isset($_GET['exam_id'])) {
$exam_id = $_GET['exam_id'];
$exam_title = $_GET['exam_title'];
//Instantiating object of class Examination for adminViewResult method but the method used here is the examiner method because i am too lazy to do another one for the admin afterall they are exactly the same thing
$objResult = new Examination;
$output = $objResult->examinerViewResult($exam_id);
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<!--required meta tags-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!--Animate.css Stylesheet-->
<link href="animate.css" type="text/css" rel="stylesheet">
<!--Bootstrap Stylesheet-->
<link href="css/bootstrap.css" type="text/css" rel="stylesheet">
<!-- Google Font -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lobster+Two:ital@1&family=Satisfy&display=swap" rel="stylesheet">
<!--Fontawesome Stylesheet-->
<link href="fontawesome/css/all.css" type="text/css" rel="stylesheet">
<!--External Stylesheet-->
<link rel="stylesheet" type="text/css" href="">
<!--Internal Stylesheet-->
<style type="text/css">
#navbar{
background-color: #A6BDF0;
font-size: 18px;
}
.nav-item a:hover{
color: #AAAE8E !important;
font-size: 23px;
background-color: #0B1D51;
border-radius: 15px;
}
#logo{
height: 40px;
width: 40px;
}
#examflow{
font-family: 'Lobster Two', cursive;
}
#f_examflow{
font-family: 'Satisfy', cursive;
}
#container{
min-height: 650px;
}
footer{
background: rgba(255, 255, 255, 0.7);
background-color: #0B1D51;
min-height: 70px;
color: #AAAE8E;
}
footer div p a{
color: #AAAE8E;
}
footer div p a:hover{
color: #AAAE8E;
}
</style>
</head>
<body>
<div class="container-fluid">
<div id="container">
<div class="row">
<div class="col">
<header class="row mb-5" id="header">
<div class="col-12">
<!--Navbar Header-->
<nav class="navbar navbar-expand-lg navbar-light font-weight-bold" id="navbar">
<a class="navbar-brand" href="index.php"><img src="exam_image/exam3.png" alt="logo" id="logo"><span id="examflow">Exam<span id="f_examflow">f</span>low</span></a>
</nav>
</div>
</header>
</div>
</div>
<div class="row">
<div class="offset-1 col-9">
<?php
if (isset($output)) {
/*echo "<pre>";
print_r($output);
echo "</pre>";*/
?>
<div class="table-responsive-lg">
<table class="table table-hover table-striped table-light table-bordered text-bold w-100 d-block d-md-table" >
<thead class="bg-secondary text-light">
<th scope="col">S/N</th>
<th scope="col">Student Name</th>
<th scope="col">Action</th>
</thead>
<tbody>
<?php
foreach ($output as $key => $value) {
?>
<tr>
<td><?php echo ++$key?></td>
<td><?php echo $value['student_lname']." ".$value['student_fname']; ?></td>
<td class="text-center"><a href="#" class="btn btn-primary btn-sm" id="viewResults" data-id="<?php echo $value['student_id'];?>" data-exam="<?php echo $exam_id ;?>" data-name="<?php echo $value['student_lname']." ".$value['student_fname']; ?>" data-toggle='modal' data-target='#resultModal' data-title="<?php echo $exam_title; ?>">View Result</a></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php
}else{
?>
<div class="alert alert-info">Result yet to be released checkback in a while.</div>
<?php
}
?>
</div>
</div>
<!-- Begin Modal for Student Examination Results -->
<div class="modal fade" id="resultModal" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="staticBackdropLabel">Student's result</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div id="viewResultDiv">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- End Modal for Student Examination Results -->
</div>
<div class="">
<footer class="row">
<div class="col-12 mt-4">
<div class="col text-center">
<p>©Copyright <a href="index.php" class="text-decoration-none"><?php echo APPNAME." ".date('Y');?></a> | All right reserved</p>
</div>
</div>
</footer>
</div>
</div>
<!--Javascript Files jquery, popper, bootstrap-->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/popper.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function(){
//Begin view Student Examination Result
jQuery(document).on('click', '[id^=viewResults]',function(){
//alert('I got here');
var student_id = $(this).data('id');
var exam_id = $(this).data('exam')
var student_name = $(this).data('name')
var exam_title = $(this).data('title')
//alert(exam_id)
//alert(student_id)
$.ajax({
url: "examflow_asynchronous.php",
type: "POST",
data: "adminViewResultPage=adminViewResult&student_id="+student_id+"&exam_id="+exam_id+"&student_name="+student_name+"&exam_title="+exam_title,
success: function(result){
$("#viewResultDiv").html(result);
},
error: function(error){
console.log(error);
}
})
})
//End view Student Examination Result
})
</script>
</body>
</html>