From a2018771e7902bb6fc6b8aa5b7ab13e31771aff9 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 10 Sep 2009 04:24:47 +0000 Subject: [PATCH] Implement jquery datepicker! woohoo --- config/dates.php | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/config/dates.php b/config/dates.php index 5a04fcc..dfae213 100644 --- a/config/dates.php +++ b/config/dates.php @@ -31,22 +31,30 @@ ,"important_dates" ); +?> + +$val) - { - $v = mysql_escape_string(stripslashes($val)); + if($_POST['action']=="save") { + if($_POST['savedates']) { + foreach($_POST['savedates'] as $key=>$val) { + //put the date and time back together + $d = mysql_escape_string(stripslashes($val)); + $t =mysql_escape_string(stripslashes($_POST['savetimes'][$key])); + $v="$d $t"; mysql_query("UPDATE dates SET date='$v' WHERE year='".$config['FAIRYEAR']."' AND id='$key'"); } } echo happy(i18n("Dates successfully saved")); - - } + echo "
"; echo "\n"; echo ""; @@ -65,8 +73,7 @@ $dates = array('fairdate' => array() , /* Now copy the SQL data into the above array */ $q=mysql_query("SELECT * FROM dates WHERE year='".$config['FAIRYEAR']."' ORDER BY date"); - while($r=mysql_fetch_object($q)) - { + while($r=mysql_fetch_object($q)) { $dates[$r->name]['description'] = $r->description; $dates[$r->name]['id'] = $r->id; $dates[$r->name]['date'] = $r->date; @@ -111,11 +118,15 @@ chkafter('fairdate','postwinners'); foreach($dates as $d) { $e = ''; if($error_ids[$d['id']]) { - $e = "* ".$error_ids[$d['id']].""; + $e = "* ".$error_ids[$d['id']].""; } - echo ""; + list($_d,$_t)=split(" ",$d['date']); + + echo ""; + echo ""; } - echo "
".i18n($d['description'])."{$e}
".i18n($d['description']).""; + echo ""; + echo "{$e}
"; echo "\n"; echo "
";