From 4dce79933801a896590da267edf8178331bd7f51 Mon Sep 17 00:00:00 2001 From: james Date: Tue, 14 Dec 2004 20:30:04 +0000 Subject: [PATCH] implement configuration of variables in the config table --- config/index.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/config/index.php b/config/index.php index 85dff81..42b9290 100644 --- a/config/index.php +++ b/config/index.php @@ -2,7 +2,47 @@ require("../common.inc.php"); send_header("Configuration"); + 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'"); + } + } + if($_POST['saveconfig']) + { + foreach($_POST['saveconfig'] as $key=>$val) + { + mysql_query("UPDATE config SET val='".mysql_escape_string(stripslashes($val))."' WHERE year='".$config['FAIRYEAR']."' AND var='$key'"); + } + } + echo happy(i18n("Configuration successfully saved")); + } + $q=mysql_query("SELECT * FROM config WHERE year=0 ORDER BY var"); + echo "
"; + echo "\n"; + echo ""; + while($r=mysql_fetch_object($q)) + { + echo ""; + } + + echo ""; + + $q=mysql_query("SELECT * FROM config WHERE year='".$config['FAIRYEAR']."' ORDER BY var"); + while($r=mysql_fetch_object($q)) + { + echo ""; + + + } + echo "
$r->var".i18n($r->description)."var]\" value=\"$r->val\" />


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

$r->var".i18n($r->description)."var]\" value=\"$r->val\" />
"; + echo "\n"; + echo "
"; + send_footer(); ?>