public function getPublicGames() { $sql = goPublicGame::getSql(); $link = @mysqli_connect(Config::getDatabaseServer(), Config::getDatabaseUser(), Config::getDatabasePassword(), Config::getDatabase()); if (!$link) { mydie("Error connecting to Database"); } if (Config::getDebug()) { $this->LOG->log("{$sql}", PEAR_LOG_INFO); } $cursor = @mysqli_query($link, $sql); if (!$cursor) { $this->mydie(mysqli_error($link), $link); } $record = 0; while ($row = @mysqli_fetch_assoc($cursor)) { $game = new goPublicgame(); //$game->setGameID($row['gameID']); $game->setDescription($row['description']); $game->setTitle($row['title']); $game->setEventName($row['eventName']); $game->setEventDate($row['eventDate']); $game->setSportID($row['sport']); $game->setSportName($row['sportName']); $game->setLeagueName($row['leagueName']); $game->setFavorite($row['favorite']); $game->setTypeID($row['type']); $game->setTypeName($row['typeName']); /*** temp explicit treatment as array storage***/ $this->publicGames[$record] = $game; $record++; /*** end temp ***/ } //while $link->close(); }
} //if break; case GAME_TYPE_TOURNAMENT: break; case GAME_TYPE_USER: break; case GAME_TYPE_DATE: break; default: } //switch on typeID //if set, retrieve publicGame Object passing in publicGameID if (isset($publicGameID)) { require_once "go_publicgame.class.php"; $publicGame = new goPublicGame($publicGameID); if (isset($publicGame)) { if ($publicGame->getStatusCode() != "200") { $message .= " Invalid pubicGameID"; } } else { $message .= " Invalid publicGameID"; } } if (!empty($message)) { mydie("{$message}"); } $link = mysqli_connect(Config::getDatabaseServer(), Config::getDatabaseUser(), Config::getDatabasePassword(), Config::getDatabase()); if (!$link) { // Server error mydie("Error connecting to Database");
require_once 'go_usersettings.class.php'; require_once 'go_game.class.php'; require_once 'go_publicgame.class.php'; $LOG = Config::getLogObject(); /* is this a fresh invoke or based on user selection */ $action = $_GET['action']; if (!empty($action)) { $params['publicgameid'] = $_GET['publicgameid']; $publicGameID = $_GET['publicgameid']; } //if /* print_r( $_GET); */ include 'gohtmlhead.php'; include 'goheader.php'; $gameObject = new goPublicGame($publicGameID); $gameObject->setOutputFlag('xml'); //echo($gameObject); // present page to customize the game if ($action = 'customize') { } echo '<div id="gameblock">'; echo '<p>Event Name :' . $gameObject->getEventName() . '</p>'; echo '<p>Event Date:' . $gameObject->getEventDate() . '</p>'; echo '<input type="radio" name="teams" value="' . $gameObject->getVisitingTeamID() . '"/>' . $gameObject->getVisitingTeam(); echo '<input type="radio" name="teams" value="' . $gameObject->getHomeTeamID() . '"/>' . $gameObject->getHomeTeam(); echo '</div>'; include 'gofooter.php'; ob_end_flush(); exit;