-
Notifications
You must be signed in to change notification settings - Fork 57
/
teams.php
40 lines (39 loc) · 1.17 KB
/
teams.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
<?php
require_once('includes/application_top.php');
require_once('includes/header.php');
?>
<h1>Teams</h1>
<p>Click on a team below to see their schedule.</p>
<table>
<tr valign="top">
<td>
<?php
$sql = "select t.*, d.conference, d.division ".
"from " . DB_PREFIX . "teams t ".
"inner join " . DB_PREFIX . "divisions d on t.divisionid = d.divisionid ".
"order by d.divisionid";
$query = $mysqli->query($sql);
$conference = '';
$division = '';
while ($row = $query->fetch_assoc()) {
if ($row['conference'] !== $conference) {
if ($conference !== '') {
echo '</td><td>' . "\n";
}
echo '<h2><img src="images/logos/' . strtolower($row['conference']) . '_logo.gif" />' . $row['conference'] . '</h2>' . "\n";
}
if ($row['division'] !== $division) {
echo '<h3>' . $row['division'] . '</h3>' . "\n";
}
//echo '<img src="images/helmets_small/' . $row['teamID'] . 'R.gif" /> ';
echo '<a href="schedules.php?team=' . $row['teamID'] . '">' . $row['city'] . ' ' . $row['team'] . '</a><br />' . "\n";
$conference = $row['conference'];
$division = $row['division'];
}
$query->free;
?>
</td>
</tr>
</table>
<?php
include('includes/footer.php');