-
Notifications
You must be signed in to change notification settings - Fork 0
/
all-events.php
42 lines (42 loc) · 1.09 KB
/
all-events.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
<?php
include_once("functions.php");
$conn = get_connection_handle();
if(isset($_GET['limit'])){
$limit = $_GET['limit'];
}else{
$limit = 25;
}
$query = $conn->query("select * from events order by id desc LIMIT $limit");
if($query->num_rows > 0){
echo '
<div class="card p-4">
<h1 class="card-title">All events</h1>
<table class="table table-bordered table-responsive-md">
<thead>
<th>Title</th>
<th>Organizer</th>
<th>Contact</th>
<th>Location</th>
<th>Event type</th>
<th>Starts</th>
<th>Ends</th>
<th>Time</th>
</thead>
<tbody>';
while($row = $query->fetch_object()){
$list = <<<LOVE
<tr>
<td>$row->title</td>
<td>$row->organizer</td>
<td>$row->contact</td>
<td>$row->location</td>
<td>$row->type</td>
<td>$row->start_date</td>
<td>$row->end_date</td>
<td>$row->time</td>
</tr>
LOVE;
echo $list;
}
echo "</tbody></table></div>";
}