require_once($_SERVER['DOCUMENT_ROOT']."/hockey/include/sport.inc"); require_once($_SERVER['DOCUMENT_ROOT']."/include/desktop/visual.inc"); require_once($_SERVER['DOCUMENT_ROOT']."/include/mobile/visual.inc"); class page { public $base = null; public $visual = null; private $teaminfo = null; function page() { $this->base = new hockey_base(); if (!$this->base->isMobile) $this->visual = new visual_desktop($this->base); else $this->visual = new visual_mobile($this->base); $this->process(); if ($this->teaminfo) $this->base->title .= " - ".$this->teaminfo->teamname; $this->visual->Header($this->base->user->logged_in); $this->base->sportBar(); $this->content(); $this->visual->Footer(); } function process() { $sql_teaminfo = "SELECT * FROM teams WHERE teamurl = '".$_GET['team']."' AND sport = 4"; $result_teaminfo = DB::cxn()->query($sql_teaminfo); $this->teaminfo = $result_teaminfo->fetch_object(); } function content() { if ($this->teaminfo) { $q_stadium = "SELECT id, name, stadiumurl FROM stadiums WHERE id = ".$this->teaminfo->stadium; $r_stadium = DB::cxn()->query($q_stadium); $stadiuminfo = $r_stadium->fetch_object(); ?>
Game | Date | Opponent | Score/ Time |
---|---|---|---|
echo $i; ?> | echo date("D n/j", strtotime($row_schedule['gamedate'])); ?> | if ($this->teaminfo->id == $row_schedule['awayteam']) echo "@ "; echo "".$row_schedule['teamcity'].""; ?> | if (strlen($row_schedule['winner']) == 0) echo date("D n/j", strtotime($row_schedule['gamedate']))." ".date("g:ia", strtotime($row_schedule['gametime'])); else { if ($row_schedule['awayscore'] > $row_schedule['homescore']) { $winnerscore = $row_schedule['awayscore']; $loserscore = $row_schedule['homescore']; } else { $winnerscore = $row_schedule['homescore']; $loserscore = $row_schedule['awayscore']; } if ($row_schedule['winner'] == $this->teaminfo->id) echo "W ".$winnerscore."-".$loserscore; else if ($row_schedule['winner'] > 0) echo "L ".$loserscore."-".$winnerscore; else if ($row_schedule['winner'] == 0) echo "T ".$loserscore."-".$winnerscore; if ($row_schedule['ot']) echo " OT"; echo ""; } ?> |