From b0e7715fb9d88968c1eadf3a148919f87fd42cee Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 23 Sep 2009 16:42:24 +0000 Subject: [PATCH] - Turn fair_save into an ajax query - Add notification area and debug to the popup window, still an ugly hack. - Add a checkbox to the feeder fair config to enable/disable the whole thing (will confuse people less, needs to be implemented) - Also add a checkbox for signaling the feeder fair if there are additional materials for an assigned award. --- admin/award_awards.php | 16 +++++++----- common.inc.php | 4 ++- fair_info.php | 58 +++++++++++++++++++++++++----------------- 3 files changed, 47 insertions(+), 31 deletions(-) diff --git a/admin/award_awards.php b/admin/award_awards.php index 8255baa0..67c771df 100644 --- a/admin/award_awards.php +++ b/admin/award_awards.php @@ -709,14 +709,16 @@ $(document).ready(function() {

-

+

+

- - - - - -
:
+ : + + + + + +

diff --git a/common.inc.php b/common.inc.php index 2dd6c692..d3e1398c 100644 --- a/common.inc.php +++ b/common.inc.php @@ -634,6 +634,8 @@ function send_popup_header($title="") +
+ ".i18n($title).""; @@ -657,7 +659,7 @@ if($lastdigit%2!=0) echo "SFIAB Version ".$config['version']; ?> -
+
Debug...
diff --git a/fair_info.php b/fair_info.php index 73045f61..ef345b13 100644 --- a/fair_info.php +++ b/fair_info.php @@ -23,34 +23,23 @@ */ ?> 'Feeder Fair', 'sfiab' => 'SFIAB Upstream', 'ysc' => 'YSC/CWSF Upstream'); - function yesno($name, $val) - { - echo ""; - } - - if($_SESSION['embed'] == true) { +// user_auth_required('committee','admin'); $u = user_load($_SESSION['embed_edit_id']); } else { user_auth_required('fair'); $u = user_load($_SESSION['users_id']); } - - if($_POST['action']=="save") - { - $id = $_POST['id']; +switch($_GET['action']) { +case 'save': + $id = intval($_POST['id']); if(trim($id) == '') { $q = mysql_query("INSERT INTO fairs(`id`,`name`) VALUES('','new entry')"); $id = mysql_insert_id(); @@ -78,12 +67,24 @@ `enable_awards`='$enable_awards', `enable_winners`='$enable_winners' WHERE id=$id"); - + echo mysql_error(); $u['fairs_id'] = $id; user_save($u); - message_push(notice(i18n("Fair Informaiton successfully updated"))); + happy_("Fair Informaiton successfully updated"); + exit; } + function yesno($name, $val) + { + echo ""; + } + + /* update overall status */ fair_status_update($u); @@ -107,6 +108,18 @@ if($_SESSION['embed'] == true) { array("Science Fair Main" => "fair_main.php") ); } + +$s = ($_SESSION['embed'] == true) ? $_SESSION['embed_submit_url'].'&' : 'fair_info.php?'; +?> + + +\n"; + echo "\n"; echo "\n"; echo "\n"; echo "
\n"; @@ -176,7 +188,7 @@ if($_SESSION['embed'] == true) { their own SFIAB to upload data to this SFIAB.'); echo ''; echo "
"; -echo "\n"; +echo "\n"; echo ""; echo "
";