-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathploComparisonCourse.php
More file actions
161 lines (122 loc) · 5.24 KB
/
ploComparisonCourse.php
File metadata and controls
161 lines (122 loc) · 5.24 KB
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
<?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/bootstrap@4.4.1/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 4.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="ploComparisonSchool.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="courseID" class="select">
<option disabled selected>Course</option>
<option value="CSC101">CSC101</option>
<option value="EEE131">EEE131</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 style="display:flex;justify-content:center;" class="row3" style="margin-top:5px;">
<div id="curve_chart" style="width: 900px; height: 500px; margin-top:15px;"></div>
</div> <!-- div row-3 ends here -->
</div> <!-- background div ends here -->
<?php
if (isset($_POST['submit'])) {
$year = $_POST['year'];
$courseID = $_POST['courseID'];
} ?>
<script>
function view() {
<?php
$sql = "SELECT sec.semester AS semester,
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
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.courseID='$courseID' AND sec.year='$year'
GROUP BY semester";
$result = mysqli_query($con, $sql);
?>
google.charts.load('current', { 'packages': ['corechart'] });
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Semester', 'Actual', 'Expected'],
<?php
while ($data = mysqli_fetch_array($result)) {
$semester = $data['semester'];
$percent = $data['percent'];
?>
['<?php echo $semester . " " . $year; ?>', <?php echo $percent; ?>, <?php echo '70'; ?>],
<?php
}
?>
]);
var options = {
title: 'Semester Wise PLO Achievement Comparison For Course',
curveType: 'function',
legend: { position: 'bottom' }
};
var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
chart.draw(data, options);
}
}
</script>
</body>
</html>