Add dates configuration

fix variables to POST to the right page
add dates to config index
This commit is contained in:
james 2005-01-14 15:44:36 +00:00
parent 2c3f6e745f
commit 43cf64ee89
3 changed files with 39 additions and 1 deletions

37
config/dates.php Normal file
View File

@ -0,0 +1,37 @@
<?
require("../common.inc.php");
send_header("Configuration - Dates");
echo "<a href=\"index.php\">&lt;&lt; ".i18n("Back to Configuration")."</a><br />";
if($_POST['action']=="save")
{
if($_POST['savedates'])
{
foreach($_POST['savedates'] as $key=>$val)
{
mysql_query("UPDATE dates SET date='".mysql_escape_string(stripslashes($val))."' WHERE year='".$config['FAIRYEAR']."' AND id='$key'");
}
}
echo happy(i18n("Dates successfully saved"));
}
$q=mysql_query("SELECT * FROM dates WHERE year=0 ORDER BY var");
echo "<form method=\"post\" action=\"dates.php\">";
echo "<input type=\"hidden\" name=\"action\" value=\"save\">\n";
echo "<table>";
echo "<tr><td colspan=\"3\"><h3>".i18n("Dates for fair year %1",array($config['FAIRYEAR']))."</h3></td></tr>";
$q=mysql_query("SELECT * FROM dates WHERE year='".$config['FAIRYEAR']."' ORDER BY date");
while($r=mysql_fetch_object($q))
{
echo "<tr><td>$r->name</td><td>".i18n($r->description)."</td><td><input type=\"text\" name=\"savedates[$r->id]\" value=\"$r->date\" /></td></tr>";
}
echo "</table>";
echo "<input type=\"submit\" value=\"".i18n("Save Dates")."\" />\n";
echo "</form>";
send_footer();
?>

View File

@ -4,6 +4,7 @@
echo error(i18n("Note: this section will normally be password protected. It is left open for now for debugging and testing purposes"));
echo "<a href=\"variables.php\">Configuration Variables</a> <br />";
echo "<a href=\"dates.php\">Important Dates</a> <br />";
echo "<a href=\"categories.php\">Project Age Categories</a> <br />";
echo "<a href=\"divisions.php\">Project Divisons</a> <br />";
echo "<a href=\"subdivisions.php\">Project Sub-Divisons</a> <br />";

View File

@ -24,7 +24,7 @@
}
$q=mysql_query("SELECT * FROM config WHERE year=0 ORDER BY var");
echo "<form method=\"post\" action=\"index.php\">";
echo "<form method=\"post\" action=\"variables.php\">";
echo "<input type=\"hidden\" name=\"action\" value=\"save\">\n";
echo "<table>";
echo "<tr><td colspan=\"3\"><h3>".i18n("Global configuration settings")."</h3></td></tr>";