-
Notifications
You must be signed in to change notification settings - Fork 1
/
gala-results.php
83 lines (66 loc) · 3.06 KB
/
gala-results.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
session_start();
require 'inc/connection.inc.php';
require 'inc/security.inc.php';
?>
<!DOCTYPE html>
<html lang="en-GB">
<head>
<?php include 'inc/meta.inc.php';?>
<title>Gala Results | Galas | Bucksburn Amateur Swimming Club</title>
<link href='https://fonts.googleapis.com/css?family=Bree+Serif' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Hind' rel='stylesheet' type='text/css'>
<link href="css/site.min.css" rel="stylesheet"/>
</head>
<body>
<?php include 'inc/header.inc.php'; ?>
<br>
<div class="row" id="content">
<div class="large-12 medium-12 small-12 columns">
<ul class="breadcrumbs">
<li><a href="index.php" role="link">Home</a></li>
<?php if(isset($_SESSION["username"])) { echo '<li><a href="galas.php" role="link">Galas</a></li>'; } ?>
<li class="current">Gala Results</li>
</ul>
<h2>Gala Results</h2>
<p></p>
<?php
require 'obj/galas.obj.php';
require 'obj/venues.obj.php';
$conn = dbConnect();
$galaItem = new Galas();
$venue = new Venues();
$galasList = $galaItem->listAllCompletedGalas($conn);
echo '<p class="right"><b>' . count($galasList) . ' results</b></p>';
echo '<table class="large-12 medium-12 small-12 columns">
<tr role="row">
<th role="columnheader">Title</th>
<th role="columnheader">Venue</th>
<th role="columnheader">Date</th>
<th role="columnheader">View Details</th>
</tr>';
if (count($galasList) > 0 ) {
foreach ($galasList as $gala) {
$galaItem->setID($gala["id"]);
$galaItem->getAllDetails($conn);
$venue->setID($gala["venueID"]);
$venue->getAllDetails($conn);
$link = "gala-results/view.php?id=" . $galaItem->getID();
echo "<tr>";
echo '<td data-th="Title">' . $galaItem->getTitle() . '</td>';
echo '<td data-th="Venue">' . $venue->getVenue() . '</td>';
echo '<td data-th="Date">' . date("d/m/Y", strtotime($galaItem->getDate())) . '</td>';
echo '<td class="none"><a href="' . $link . '">View Details</a></td>';
echo "</tr>";
}
} else {
echo '<tr><td colspan="5" class="centre">No completed galas were found.</td></tr>';
}
dbClose($conn);
?>
</table>
</div>
</div>
<?php include 'inc/footer.inc.php';?>
</body>
</html>