-
Notifications
You must be signed in to change notification settings - Fork 0
/
events.php
67 lines (64 loc) · 1.99 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
ob_start();
// If Session Variable is present on the page?
session_start();
require_once('class.event.php');
$event = new Event;
if(isset($_GET["event_name"])) {
$event_name = $_GET["event_name"];
$events = $event->get_all_events($event_name);
} else {
$events = $event->get_all_events();
}
?>
<div class="page-header">
<h1>Events</h1>
</div>
<div class="row">
<?php
if ($events->num_rows > 0) {
// output data of each row
while($row = $events->fetch_assoc()) {
$event_image_field = $event->get_event_image($row["id"]);
?>
<div class="col-sm-6 col-md-3">
<div class="thumbnail">
<?php
if (!empty($event_image_field['event_image'])) {
echo('<img src="data:image;base64,' . $event_image_field['event_image'] . '">');
} else {
echo('<img style="height: 128px !important;" src="assets/images/notfound.png">');
}
?>
<div class="caption">
<h3><?php echo($row["name"]); ?></h3>
<?php $description = (strlen($row["description"]) > 13) ? substr($row["description"],0,150).'...' : $row["description"]; ?>
<p><?php echo($description); ?></p>
<hr />
<p>
<div class="row">
<div class="col-md-6 col-xs-6">
<a href="show_event.php?id=<?php echo $row['id']; ?>" class="btn btn-primary" role="button">Show</a>
</div>
<div class="col-md-6 col-xs-6">
<blockquote class="blockquote-reverse">
<strong><?php echo($row["price"]); ?>$</strong>
</blockquote>
</div>
</div>
</p>
</div>
</div>
</div>
<?php
}
} else {
echo "<div class='alert alert-success'>No Events are present</div>";
}
?>
</div>
<?php
$pagemaincontent = ob_get_contents();
ob_end_clean();
include("application.php");
?>