require_once($_SERVER['DOCUMENT_ROOT']."/include/base.inc");
class page {
public $base = null;
public $visual = null;
private $error = "";
private $stadiumteams = null;
private $sport_stadiums = null;
function page()
{
$this->base = new top();
if (!$this->base->isMobile) $this->visual = new visual_desktop($this->base);
else $this->visual = new visual_mobile($this->base);
$this->base->title .= " - Stadiography";
$this->visual->Header($this->base->user->logged_in);
$this->content();
$this->visual->Footer();
}
function content()
{
?>
" style="margin-top:10px;">
Stadiography
//Get Teams
$q_teams = "SELECT id, teamcity, teamname, teamurl, sport, stadium FROM teams WHERE sport IN (1,2,3,4) ORDER BY teamname";
$r_teams = DB::cxn()->query($q_teams);
$this->stadiumteams = array();
while ($row_team = $r_teams->fetch_object())
{
$this->stadiumteams[$row_team->stadium][] = $row_team;
}
$this->sport_stadiums = array();
$this->sport_stadiums[1] = array();
$this->sport_stadiums[2] = array();
$this->sport_stadiums[3] = array();
$this->sport_stadiums[4] = array();
//Get Stadiums
$q_stadiums = "SELECT id, name, sport, stadiumurl, city FROM stadiums ORDER BY name";
$r_stadiums = DB::cxn()->query($q_stadiums);
$stadiumlist = array();
while ($row_stadium = $r_stadiums->fetch_object())
{
if (strpos($row_stadium->sport, "mlb") !== false) $this->sport_stadiums[1][] = $row_stadium;
if (strpos($row_stadium->sport, "nfl") !== false) $this->sport_stadiums[2][] = $row_stadium;
if (strpos($row_stadium->sport, "nba") !== false) $this->sport_stadiums[3][] = $row_stadium;
if (strpos($row_stadium->sport, "nhl") !== false) $this->sport_stadiums[4][] = $row_stadium;
$stadiumlist[$row_stadium->id] = $row_stadium;
}
?>
">
Stadium information, schedules, tips, and reviews.
">
Mobile App
">
View stadiums on a map and quickly see which stadiums are hosting a game on the selected date (today or in the future).
Available for iOS 7 devices (iPhone & iPad).
$this->showSportStadiums(1);
$this->showSportStadiums(2);
$this->showSportStadiums(3);
$this->showSportStadiums(4);
?>
}
function showSportStadiums($inSport)
{
?>
if ($inSport == 1) echo "Baseball";
else if ($inSport == 2) echo "Football";
else if ($inSport == 3) echo "Basketball";
else if ($inSport == 4) echo "Hockey";
?>
foreach ($this->sport_stadiums[$inSport] as $stadium)
{
?>
echo $stadium->city; ?>
if (sizeof($this->stadiumteams[$stadium->id]))
{
foreach ($this->stadiumteams[$stadium->id] as $team)
{
if ($team->sport == $inSport)
{
?>
echo $team->teamname; ?>
}
}
}
?>
}
?>
}
}
new page();
?>