-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
62 lines (55 loc) · 1.32 KB
/
archive.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
<?php
require_once 'private_php/p_global.php';
pageHeader('Archive');
?>
<h2>Archive</h2>
<?php
$stmt = $Database->query('
SELECT DISTINCT d.year, s.section_id, s.name, s.season, s.url_name
FROM division d
JOIN section s ON d.section_id = s.section_id
ORDER BY s.sequence, d.year');
$lastSectionName = null;
$inList = false;
while ($row = $stmt->fetch()) {
// first, see if we're starting a new section
$year = $row['year'];
$sectionID = $row['section_id'];
$sectionName = $row['name'];
$season = $row['season'];
if ($sectionName != $lastSectionName) {
if ($inList) {
echo '</ul>';
$inList = false;
}
echo '<h3>', htmlspecialchars($sectionName), '</h3>';
$lastSectionName = $sectionName;
}
if (!$inList) {
echo '<ul>';
$inList = true;
}
// now display the list entry
switch ($season) {
case Season::Winter:
$displayYear = $year . '–' . ($year + 1);
break;
case Season::Summer:
$displayYear = $year;
}
?>
<li>
<a href="../<?php echo $year; ?>/<?php echo $row['url_name']; ?>"><?php echo $displayYear; ?></a>
</li>
<?php
}
if ($inList) echo '</ul>';
?>
<h3>Previous LRCA Websites</h3>
<ul>
<li><a href="http://legacy.leicestershirechess.org/2011-18/">2011-18 site</a></li>
<li><a href="http://legacy.leicestershirechess.org/2001-11/">2001-11 site</a></li>
</ul>
<?php
pageFooter();
?>