Copyright (C) 2005 James Grant This program 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, version 2. This program 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 this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> var)."', '".mysql_escape_string($r->val)."', '".mysql_escape_string($r->category)."', '".mysql_escape_string($r->type)."', '".mysql_escape_string($r->type_values)."', '".mysql_escape_string($r->ord)."', '".mysql_escape_string($r->description)."', '".$config['FAIRYEAR']."')"); } //for the Special category if($_POST['action']=="save") { if($_POST['specialconfig']) { foreach($_POST['specialconfig'] as $key=>$val) { mysql_query("UPDATE config SET val='".mysql_escape_string(stripslashes($val))."' WHERE year='0' AND var='$key'"); } } message_push(happy(i18n("Configuration successfully saved"))); } //get the category, and if nothing is chosen, default to Global if($_GET['category']) $category=$_GET['category']; else if($_POST['category']) $category=$_POST['category']; else $category="Global"; $action = config_editor_handle_actions($category, $config['FAIRYEAR'], "var"); if($action == 'update') { header("Location: variables.php?category=$category"); exit; } send_header("Configuration Variables", array('Committee Main' => 'committee_main.php', 'SFIAB Configuration' => 'config/index.php') ,"configuration_variables" ); $q=mysql_query("SELECT DISTINCT(category) AS cat FROM config ORDER BY cat"); echo "\n"; echo "
"; echo ""; $trclass = 'odd'; while($r=mysql_fetch_object($q)) { $trclass = ($trclass == 'odd') ? 'even' : 'odd'; echo ""; echo ""; echo "\n"; } echo "
"; if($r->cat==$category) echo "".i18n($r->cat).""; else echo "cat)."\">".i18n($r->cat).""; echo "
"; echo "
"; if($category) { if($category=="Special") { echo "

".i18n("Special Configuration Settings")."

"; echo "
"; echo "\n"; echo "\n"; echo ""; $q=mysql_query("SELECT * FROM config WHERE year=0 ORDER BY var"); echo ""; while($r=mysql_fetch_object($q)) { if($r->var=="FAIRYEAR" || $r->var=="DBVERSION") { echo ""; } else { echo ""; } } echo "
"; echo i18n("Warning, modifying values on this configuration variables page could cause your SFIAB to stop working. Only change anything on this page if you really know what you are doing"); echo "
$r->var - ".i18n($r->description)."$r->val
$r->var - ".i18n($r->description)."var]\" value=\"$r->val\" />
"; echo "\n"; echo "
"; } else { // echo "

".i18n("Configuration settings for fair year %1",array($config['FAIRYEAR']),array("fair year"))."

"; echo "

".i18n($category)." ({$config['FAIRYEAR']})

"; config_editor($category, $config['FAIRYEAR'], "var", $_SERVER['PHP_SELF']); } } else { echo i18n("Please choose a configuration category"); } echo "
"; send_footer(); ?>