-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
64 lines (54 loc) · 1.87 KB
/
index.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
<?php include 'header.php'?>
<?php
// Fetch all events from the database
$fetch_all_sql = "SELECT * FROM events";
$results = mysqli_query($conn, $fetch_all_sql);
if ($results) {
$events = mysqli_fetch_all($results, MYSQLI_ASSOC);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event List</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
padding: 20px;
}
h2 {
text-align: center;
margin-bottom: 30px;
}
.card-columns {
column-count: 3;
}
</style>
</head>
<body>
<div class="container">
<h1 style = "text-align: center;">Welcome to KLUMNI</h1>
<h2>All Events</h2>
<div class="card-columns">
<?php foreach ($events as $event): ?>
<div class="card">
<div class="card-body">
<h5 class="card-title"><?php echo $event['title']; ?></h5>
<p class="card-text">
<strong>Location:</strong> <?php echo $event['location']; ?><br>
<strong>Category:</strong> <?php echo $event['category']; ?><br>
<strong>Date:</strong> <?php echo $event['date']; ?>
</p>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
</body>
</html>
<?php include 'footer.php'?>