"; for($i = 0; $i <= 23; $i++) echo "\n "; echo "\n \n :\n \n"; } /* This function generates a date selector. from MRBS, with tweaks by me */ function genDateSelector($prefix, $day, $month, $year) { if($day == 0) $day = date("d"); //if the current date isn't supplied if($month == 0) $month = date("m"); if($year == 0) $year = date("Y"); echo "\n \n \n \n"; } /* This function is only in php5(file_put_contents()), so I need to write it, but to avoid clashes I have changed the name slightly */ function file_put_content($file, $data) { if(function_exists('file_put_contents')) return file_put_contents($file, $data); $handle = fopen($file, 'w'); if(!fwrite($handle, $data)) return FALSE; return fclose($handle); } if(!empty($_COOKIE)) extract($_COOKIE, EXTR_OVERWRITE); if(!empty($_GET)) //recover all passed info extract($_GET, EXTR_OVERWRITE); if(!empty($_POST)) extract($_POST, EXTR_OVERWRITE); session_start(); //start the php session, just in case if(!isset($_username) || $_username == "") { if(isset($_SESSION['user']) && $_SESSION['user'] != "") $_username = $_SESSION['user']; elseif(isset($_SESSION['SR_user']) && $_SESSION['SR_user'] != "") $_username = $_SESSION['SR_user']; } $_logged_in = ((isset($users_arr[$_username]) && $users_arr[$_username] == md5($_pass))) || (isset($_SESSION['SR_user']) && $users_arr[$_username] != "") ? TRUE : FALSE; if($_logged_in) { //use cookies only to handle session stuff $debug_info .="\n ini_set(\"session.use_only_cookies\", \"1\") = ".ini_set("session.use_only_cookies", "1")."\n
"; $debug_info .="\n ini_set('url_rewriter.tags', '') = ".ini_set('url_rewriter.tags', '')."\n
"; $_SESSION['SR_user'] = $_username; $_filename = "Date.inc.php"; if(isset($_saving)) { $DATE_OUT = ""; if(!file_put_content($_filename, $DATE_OUT)) echo "file write failed"; } include $_filename; if(!isset($Comp_DATE)) $Comp_DATE = "2008-04-12"; if(!isset($Easter_DATE)) $Easter_DATE = "2008-03-23"; if(!isset($Kick_DATE)) $Kick_DATE = "2007-10-28 14:00"; ?> Date Editing Page
KickStart Date & Time:
\n"; genTimeSelector("Kick_", $hour, $minute); genDateSelector("Kick_", $day, $month, $year); echo "\n

\nCompetition Date:\n
\n"; list($day, $month, $year) = split("[./-]",date("j.n.Y", strtotime($Comp_DATE))); $debug_info .= "Comp: \$day=$day, \$month=$month, \$year=$year\n
\n"; genDateSelector("Comp_", $day, $month, $year); echo "\n

\nEaster Date:\n
\n"; list($day, $month, $year) = split("[./-]",date("j.n.Y", strtotime($Easter_DATE))); $debug_info .= "Easter: \$day=$day, \$month=$month, \$year=$year\n
\n"; genDateSelector("Easter_", $day, $month, $year); ?>

Date Editing Page

Please login to access the PHP Testing Page.