-
Notifications
You must be signed in to change notification settings - Fork 0
/
lessons.php
40 lines (40 loc) · 1.01 KB
/
lessons.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
<?php
include_once("functions.php");
$conn = get_connection_handle();
if(isset($_GET['limit'])){
$limit = $_GET['limit'];
}else{
$limit = 25;
}
$query = $conn->query("select * from lessons LIMIT $limit");
if($query->num_rows > 0){
echo '
<div class="card p-4">
<h1 class="card-title">All lessons</h1>
<table class="table table-bordered table-responsive-md">
<thead>
<th>Subject</th>
<th>Course code</th>
<th>Lecturer</th>
<th>Venue</th>
<th>Day</th>
<th>Starts</th>
<th>Ends</th>
</thead>
<tbody>';
while($row = $query->fetch_object()){
$list = <<<LOVE
<tr>
<td>$row->subject</td>
<td>$row->course_code</td>
<td>$row->lecturer</td>
<td>$row->venue</td>
<td>$row->day</td>
<td>$row->start</td>
<td>$row->end</td>
</tr>
LOVE;
echo $list;
}
echo "</tbody></table></div>";
}