forked from rpitv/rpits
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtitle_list.php
43 lines (40 loc) · 1.8 KB
/
title_list.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
<?
mysql_connect("localhost", "root", "");
mysql_select_db("rpihockey");
$event = $_GET["event"];
$team = $_GET["team"];
$thing = $_GET["thing"];
$result;
if($thing == "billboards")
{
$query = "SELECT * from billboards";
$result = mysql_query($query) or die("<b>YOU DID SOMETHING WRONG YOU IDIOT</b>.\n<br />Query: " . $query . "<br />\nError: (" . mysql_errno() . ") " . mysql_error());
while ($row = mysql_fetch_array($result)) {
echo("<li type=\"billboard\" id=\"" . $row["id"] . "\"><img src=\"billboards\\" . $row["file_name"] . "\" width=\"40\" />" . $row["title"] . "</li>\n");
}
}
else if(!$team)
{
if ($event == 0)
$query = "SELECT * from general";
if ($event > 0)
$query = "SELECT *,event_title.id as etid from event_title LEFT JOIN general ON general.id = event_title.title_id WHERE event_title.event_id='$event'";
$result = mysql_query($query) or die("<b>YOU DID SOMETHING WRONG YOU IDIOT</b>.\n<br />Query: " . $query . "<br />\nError: (" . mysql_errno() . ") " . mysql_error());
while ($row = mysql_fetch_array($result)) {
echo("<li type=\"general\" id=\"" . $row["id"] . "\"><img src=\"gentitle.php?id=" . $row["id"] . "\" width=\"40\" />" . $row["filename"] . "</li>\n");
}
}
else
{
$query = "SELECT * from players WHERE team='$team' ORDER BY num ASC";
$result = mysql_query($query) or die("<b>YOU DID SOMETHING WRONG YOU IDIOT</b>.\n<br />Query: " . $query . "<br />\nError: (" . mysql_errno() . ") " . mysql_error());
while ($row = mysql_fetch_array($result))
{
$num = $row["num"];
$first = $row["first"];
$last = $row["last"];
$title_name = "$num - $first $last";
echo("<li type=\"player\" id=\"" . $row["id"] . "\"><img src=\"statscard.php?id=" . $row["id"] . "\" width=\"40\" />" . $title_name . "</li>\n");
}
}
?>