-
Notifications
You must be signed in to change notification settings - Fork 0
/
tabLectures.php
38 lines (34 loc) · 970 Bytes
/
tabLectures.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
if(!session_id()) session_start();
if(isset($_SESSION['username'])){
include_once("Lesson.php");
$username = $_SESSION['username'];
$email = $_SESSION['email'];
$id = $_SESSION['id'];
}else{
header("UniPortal/");
}
$lesson = new Lessons();
$res = $lesson->get_all_lessons();
if($res && $res->num_rows > 0){
echo "<h5 class='card-title mx-2'>Today's lectures</h5>
<table class='table table-striped table-hover table-responsive-sm bg-white'>
<thead>
<th>Subject</th>
<th>Course code</th>
<th>Venue</th>
<th>Time</th>
</thead>
<tbody>";
while($row = $res->fetch_object()){
echo "
<tr>
<td>$row->subject</td>
<td>$row->course_code</td>
<td>$row->venue</td>
<td>$row->start to $row->end</td>";
}
echo("</tr></tbody></table>");
}else{
echo "<h1>No lectures for today</h1>";
}