forked from mig0s/BullyTrack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcourses.php
executable file
·38 lines (32 loc) · 1.03 KB
/
courses.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
<?php
require_once("models/config.php");
if (!securePage($_SERVER['PHP_SELF'])){die();}
require_once("models/header.php");
$getcourses = $mysqli->prepare("SELECT
course_code,
course_name FROM course WHERE `lecturer_name`='".$loggedInUser->displayname."'");
$getcourses->execute();
$getcourses->bind_result($course_code, $course_name);
while ($getcourses->fetch()){
$courses[] = array('course_code' => $course_code, 'course_name' => $course_name);
}
$getcourses->close();
echo "
</div>
<div id='main' class='col-md-10'>
<div id='regbox'><h1>Courses assigned to $loggedInUser->displayname:</h1>
<table class='table table-bordered'><thead><tr><th>Course code</th><th>Course name</th></tr></thead><tbody>";
if (isset($courses)) {
foreach ($courses as $course) {
echo "<tr><td>".$course['course_code']."</td><td><a method='GET' href='studlist.php?ccode=".$course['course_code']."'>".$course['course_name']."</a></td></tr>";
}
}
echo" </tbody></table>
</div>
</div>
</div>
<div id='bottom'></div>
</div>
</body>
</html>";
?>