-
Notifications
You must be signed in to change notification settings - Fork 0
/
enrollmentStatistics.php
204 lines (167 loc) · 7.11 KB
/
enrollmentStatistics.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
<?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">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="ES_semester_dropdown.css">
<title>Student Enrollment Statistics Page</title>
<!--Google Font-->
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">
<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="ploAnalysis.php" target="_self">Student Wise PLO Analysis</a></li>
<li><a href="ploAchieveStats" target="_self">PLO Achievement Statistics</a></li>
<li><a href="dataEntry.php" target="_self">Data Entry</a></li>
<li><a href="enrollmentStatistics.php" target="_self">Student Enrollment Statistics</a></li>
<li><a href="performanceStats.php" target="_self">Student Performance Stats</a></li>
<li><a href="logout.php" target="_self">Logout</a></li>
</ul>
</div>
</div>
<div style="display:flex;justify-content:center;" class="row1">
<form method="POST">
<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 class="background">
<div class="row2">
<button style="margin-bottom:0px;" onclick="schoolWiseEnrollment()" class="School-wise">School-wise</button>
<button onclick="departmentWiseEnrollment()" class="Department-wise">Department-wise</button>
<button onclick="programWiseEnrollment()" class="Program-wise">Program-wise</button>
</div>
<div style="width:1000px; margin:auto; margin-top:20px;">
<div id="piechart" style="width: 1000px; height: 530px; background-color:#155977;"></div>
</div>
</div>
<?php
if(isset($_POST['submit'])){
$year=$_POST['year'];
}?>
<script>
function departmentWiseEnrollment() {
<?php
$sql = "SELECT d.departmentName AS department, COUNT(s.studentID) AS studentNumber
FROM department_t AS d, student_t AS s
WHERE s.enrollmentYear='$year' AND d.departmentID=s.departmentID
GROUP BY s.departmentID";
$result = mysqli_query($con, $sql);
?>
google.charts.load('current', { 'packages': ['corechart'] });
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Department', 'Number'],
<?php
while ($row = mysqli_fetch_array($result)) {
echo "['" . $row["department"] . "', " . $row["studentNumber"] . "],";
}
?>
]);
var options = {
title: 'Student Enrollment Statistics',
backgroundColor: '#87CEFA',
pieSliceText: 'percentage',
pieHole: 0.4,
colors: ['#4CAF50', '#2196F3', '#FF9800', '#E91E63', '#9C27B0']
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
}
function schoolWiseEnrollment(){
<?php
$sql="SELECT sch.schoolName as schoolName, COUNT(s.studentID) AS number
FROM student_t AS s INNER JOIN department_t AS d
ON s.departmentID=d.departmentID
INNER JOIN school_t AS sch
ON d.schoolID=sch.schoolID
WHERE s.enrollmentYear='$year' AND d.departmentID=s.departmentID
GROUP BY sch.schoolName";
$result=mysqli_query($con,$sql);
?>
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart()
{
var data = google.visualization.arrayToDataTable([
['School', 'Number'],
<?php
while($row = mysqli_fetch_array($result))
{
echo "['".$row["schoolName"]."', ".$row["number"]."],";
}
?>
]);
var options = {
title: 'Student Enrollment Statistics'
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data,{backgroundColor:{fill:"#87CEFA"}},);
}
}
function programWiseEnrollment(){
<?php
$sql="SELECT p.programName AS programName,COUNT(s.studentID) AS number
FROM student_t AS s,program_t AS p
WHERE s.enrollmentYear='$year' AND s.programID=p.programID
GROUP BY p.programName";
$result=mysqli_query($con,$sql);
?>
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart()
{
var data = google.visualization.arrayToDataTable([
['ProgramName', 'Number'],
<?php
while($row = mysqli_fetch_array($result))
{
echo "['".$row["programName"]."', ".$row["number"]."],";
}
?>
]);
var options = {
title: 'My Daily Activities',
is3D: true,
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data,{backgroundColor:{fill:"#87CEFA"}},);
}
}
</script>
</body>
</html>