<?php
/*
This file is part of baseballNuke.
Created by Shawn Grimes http://claimid.com/shawn
baseballNuke is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
baseballNuke is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with baseballNuke; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
$debug=0;
require_once("mainfile.php");
$queryString=$_SERVER['QUERY_STRING'];
if($_POST["executeSeason"]){
$seasonValue=$_POST["season"];
setcookie("season",$seasonValue,time()+60*60*24*30,"/",".$domain");
if($debug) {echo "<br>cookie=".$_COOKIE["season"]; }
if($debug) {echo "<br>query=".$queryString; }
if(!$debug) {header("Location: http://".$domain.$_SERVER['PHP_SELF']."?".$queryString); }
exit;
}else{
//echo "cookie=".$_COOKIE["season"];
if(!($_COOKIE["season"])){
$sqlString= "SELECT defaultSeason FROM ".$prefix."_baseballNuke_settings WHERE ID=1";
$resultSeason=sql_query($sqlString, $dbi);
list($seasonValue) = sql_fetch_row($resultSeason, $dbi);
if($seasonValue){
setcookie("season",$seasonValue,time()+60*60*24*30,"/",".$domain");
if($debug) {echo "<BR>No execute Season"; }
if($debug) {echo "<br>cookie=".$_COOKIE["season"]; }
if($debug) {echo "<br>query=".$queryString; }
if(!$debug) {header("Location: http://".$domain.$_SERVER['PHP_SELF']."?".$queryString); }
}
}else{
$sqlString= "SELECT defaultTeam, displayMenu FROM ".$prefix."_baseballNuke_settings WHERE ID=1";
$resultDefaults=sql_query($sqlString,$dbi);
list($defaultTeam,$displayMenu)=sql_fetch_row($resultDefaults,$dbi);
}
}
?>