-
Notifications
You must be signed in to change notification settings - Fork 0
/
ploComparisonSchool.php
251 lines (203 loc) · 8.77 KB
/
ploComparisonSchool.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
<?php
include 'connect.php';
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<title>Employee Dashboard</title>
<!--Google Font-->
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript"></script>
</head>
<body>
<div class="nav">
<input type="checkbox" id="nav-check">
<div class="nav-header">
<div class="nav-title">
SPMS 3.0
</div>
</div>
<div class="nav-btn">
<label for="nav-check">
<span></span>
<span></span>
<span></span>
</label>
</div>
<div class="nav-links">
<ul>
<li><a href="employee_dashboard.php" target="_self">Dashboard</a></li>
<li><a href="ploComparisonStudent.php" target="_self">PLO Comparison(Student)</a></li>
<li><a href="ploComparisonCourse.php" target="_self">PLO Comparison(Course)</a></li>
<li><a href="ploComparisonProgram.php" target="_self">PLO Comparison(Program)</a></li>
<li><a href="enrollmentStatistics.php" target="_self">PLO Comparison(School)</a></li>
<li><a href="ploComparisonDepartment.php" target="_self">PLO Comparison(Department)</a></li>
<li><a href="logout.php" target="_self">Logout</a></li>
</ul>
</div>
</div>
<div class="background">
<div style="display:flex;justify-content:center;" class="row1">
<form method="POST">
<select style="margin-left:10px;" name="schoolID" class="select">
<option disabled selected>School</option>
<option value="SETS">SETS</option>
<option value="SBE">SBE</option>
</select>
<select style="margin-left:10px;" name="year" class="select">
<option disabled selected>Year</option>
<option value="2020">2020</option>
<option value="2021">2021</option>
<option value="2022">2022</option>
</select>
<input style="background:#00BFFF;border-radius:10px;border:none;outline:none;color:#fff;font-size:14px;letter-spacing:2px;
text-transform:uppercase;cursor:pointer;font-weight:bold;margin-left:10px;height: 36px;width: 100px;"
type="submit" name="submit" value="Submit"/>
</form>
</div> <!-- div row-1 ends here -->
<!-- div row-2 -->
<div style="height:50px;padding-left:43%;margin-top:15px;">
<button onclick="view()" style="height: 46px;width: 100px;margin-left:40px;display:inline-block;border-radius: 10px;
border: none;outline: none;background:#00BFFF;color: #fff;font-size: 14px;letter-spacing:2px;
text-transform: uppercase;cursor:pointer;font-weight: bold;">view</button>
</div> <!-- div row-2 ends here -->
<div class="row3" style="margin-top:5px;">
<div id="Spring" style="width: 500px; height: 500px; display:inline-block;margin-top:15px;"></div>
<div id="Summer" style="width: 500px; height: 500px; display:inline-block;"></div>
<div id="Autumn" style="width: 500px; height: 500px; display:inline-block;"></div>
</div>
<!-- div row-3 ends here -->
</div> <!-- background div ends here -->
<?php
if(isset($_POST['submit'])){
$year=$_POST['year'];
$schoolID=$_POST['schoolID'];
}?>
<script>
function view(){
<?php
$sql="SELECT plo.ploNum AS ploNum,
AVG((ans.markObtained/q.markPerQuestion)*100) AS percent
FROM section_t AS sec, plo_t AS plo, answer_t AS ans, question_t AS q,
registration_t AS r, co_t AS co, student_t AS s, department_t AS d
WHERE r.sectionID=sec.sectionID AND r.registrationID=ans.registrationID
AND ans.examID=q.examID
AND ans.answerNum=q.questionNum AND q.coNum=co.coNum
AND q.courseID=co.courseID AND co.ploID=plo.ploID
AND sec.year='$year' AND r.studentID=s.studentID AND sec.semester='spring'
AND s.departmentID=d.departmentID AND d.schoolID='$schoolID'
GROUP BY plo.ploNum
ORDER BY plo.ploNum";
$result=mysqli_query($con,$sql);
?>
google.charts.load('current', {'packages':['bar']});
google.charts.setOnLoadCallback(drawAutumnChart);
google.charts.setOnLoadCallback(drawSummerChart);
google.charts.setOnLoadCallback(drawSpringChart);
function drawAutumnChart() {
var data = google.visualization.arrayToDataTable([
['PLO','Achieved','Expected'],
<?php
while($data=mysqli_fetch_array($result)){
$ploNum="PLO".$data['ploNum'];
$percent=$data['percent'];
?>
['<?php echo $ploNum;?>',<?php echo $percent;?>,<?php echo '70';?>],
<?php
}
?>
]);
var options = {
chart: {
title: 'Semester Wise PLO Achievement Comparison for School (Autumn)',
},
bars: 'vertical' // Required for Material Bar Charts.
};
var chart = new google.charts.Bar(document.getElementById('Autumn'));
chart.draw(data, google.charts.Bar.convertOptions(options));
}
<?php
$sql="SELECT plo.ploNum AS ploNum,
AVG((ans.markObtained/q.markPerQuestion)*100) AS percent
FROM section_t AS sec, plo_t AS plo, answer_t AS ans, question_t AS q,
registration_t AS r, co_t AS co, student_t AS s, department_t AS d
WHERE r.sectionID=sec.sectionID AND r.registrationID=ans.registrationID
AND ans.examID=q.examID
AND ans.answerNum=q.questionNum AND q.coNum=co.coNum
AND q.courseID=co.courseID AND co.ploID=plo.ploID
AND sec.year='$year' AND r.studentID=s.studentID AND sec.semester='summer'
AND s.departmentID=d.departmentID AND d.schoolID='$schoolID'
GROUP BY plo.ploNum
ORDER BY plo.ploNum";
$result=mysqli_query($con,$sql);
?>
function drawSummerChart() {
var data = google.visualization.arrayToDataTable([
['PLO','Achieved','Expected'],
<?php
while($data=mysqli_fetch_array($result)){
$ploNum="PLO".$data['ploNum'];
$percent=$data['percent'];
?>
['<?php echo $ploNum;?>',<?php echo $percent;?>,<?php echo '70';?>],
<?php
}
?>
]);
var options = {
chart: {
title: 'Semester Wise PLO Achievement Comparison for School (Summer)',
},
bars: 'vertical' // Required for Material Bar Charts.
};
var chart = new google.charts.Bar(document.getElementById('Summer'));
chart.draw(data, google.charts.Bar.convertOptions(options));
}
<?php
$sql="SELECT plo.ploNum AS ploNum,
AVG((ans.markObtained/q.markPerQuestion)*100) AS percent
FROM section_t AS sec, plo_t AS plo, answer_t AS ans, question_t AS q,
registration_t AS r, co_t AS co, student_t AS s, department_t AS d
WHERE r.sectionID=sec.sectionID AND r.registrationID=ans.registrationID
AND ans.examID=q.examID
AND ans.answerNum=q.questionNum AND q.coNum=co.coNum
AND q.courseID=co.courseID AND co.ploID=plo.ploID
AND sec.year='$year' AND r.studentID=s.studentID AND sec.semester='autumn'
AND s.departmentID=d.departmentID AND d.schoolID='$schoolID'
GROUP BY plo.ploNum
ORDER BY plo.ploNum";
$result=mysqli_query($con,$sql);
?>
function drawSpringChart() {
var data = google.visualization.arrayToDataTable([
['PLO','Achieved','Expected'],
<?php
while($data=mysqli_fetch_array($result)){
$ploNum="PLO".$data['ploNum'];
$percent=$data['percent'];
?>
['<?php echo $ploNum;?>',<?php echo $percent;?>,<?php echo '70';?>],
<?php
}
?>
]);
var options = {
chart: {
title: 'Semester Wise PLO Achievement Comparison for School (Spring)',
},
bars: 'vertical' // Required for Material Bar Charts.
};
var chart = new google.charts.Bar(document.getElementById('Spring'));
chart.draw(data, google.charts.Bar.convertOptions(options));
}
}
</script>
</body>
</html>