-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevaluation_results.php
59 lines (54 loc) · 2.11 KB
/
evaluation_results.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
<?php
session_start();
include('db.php');
$facultyId = $_SESSION['faculty_id'];
$year = $_GET['year'];
$selectedSemester = $_GET['sem'];
$courseId = $_GET['course_id'];
// Fetching evaluation scores for courses taught by the faculty in the selected semester and year
$evaluationsQuery = "SELECT c.course_name, e.criteria1, e.criteria2, e.criteria3 FROM course c JOIN sections s ON c.id = s.course_id JOIN evaluations e ON c.id = e.course_id WHERE s.faculty_id = $facultyId AND c.sem = $selectedSemester AND year = $year";
//change the above query
$evaluationsResult = mysqli_query($connection, $evaluationsQuery);
$results = mysqli_fetch_all($evaluationsResult, MYSQLI_ASSOC);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Evaluation Scores</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<h2 class="text-center my-4">Evaluation Scores</h2>
<table class="table">
<thead>
<tr>
<th>Course</th>
<th>Criteria 1</th>
<th>Criteria 2</th>
<th>Criteria 3</th>
</tr>
</thead>
<tbody>
<?php foreach ($results as $result): ?>
<tr>
<td><?= $result['course_name'] ?></td>
<td><?= $result['criteria1'] ?></td>
<td><?= $result['criteria2'] ?></td>
<td><?= $result['criteria3'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<button onclick="goBack()" class="btn btn-secondary mb-3">Go Back</button>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
<script>
function goBack() {
window.history.back();
}
</script>
</body>
</html>