diff --git a/admin/fundraising.php b/admin/fundraising.php index e89ba3b..69a2fa2 100644 --- a/admin/fundraising.php +++ b/admin/fundraising.php @@ -75,12 +75,12 @@ function popup_sponsorship_editor(url) { } function save_sponsorship() { - $.post("/admin/fundraising.php", - $("#fundraisingsponsorship").serialize(), - function(data) { - $('#sponsorship_editor').dialog('close'); + $('#debug').load("/admin/fundraising.php", + $("#fundraisingsponsorship").serializeArray(), + function() { + $('#sponsorship_editor').dialog('close'); + refresh_fundraising_table(); }); - refresh_fundraising_table(); return false; } @@ -102,31 +102,35 @@ function popup_fund_editor(url) { } function save_fund() { - $.post("/admin/fundraising.php", - $("#fundraisingfundraising").serialize(), + $("#debug").load("/admin/fundraising.php", + $("#fundraisingfundraising").serializeArray(), function(data) { - $('#fund_editor').dialog('close'); + $('#fund_editor').dialog('close'); + refresh_fundraising_table(); }); - refresh_fundraising_table(); return false; } function delete_fund(id) { if(confirmClick('Are you sure you want to remove this fund?')) { - $.post("/admin/fundraising.php", - { action: 'funddelete', delete: id } + $('#debug').load("/admin/fundraising.php", + { action: 'funddelete', delete: id }, + function() { + refresh_fundraising_table(); + } ); - refresh_fundraising_table(); } return false; } function delete_sponsorship(id) { if(confirmClick('Are you sure you want to remove this sponsorship?')) { - $.post("/admin/fundraising.php", - { action: 'sponsorshipdelete', delete: id } + $('#debug').load("/admin/fundraising.php", + { action: 'sponsorshipdelete', delete: id }, + function() { + refresh_fundraising_table(); + } ); - refresh_fundraising_table(); } return false; } diff --git a/admin/fundraising_sponsorship_handler.inc.php b/admin/fundraising_sponsorship_handler.inc.php index fca76f5..09762a7 100644 --- a/admin/fundraising_sponsorship_handler.inc.php +++ b/admin/fundraising_sponsorship_handler.inc.php @@ -2,7 +2,7 @@ if($_POST['action']=="sponsorshipdelete") { mysql_query("DELETE FROM sponsorships WHERE id='".intval($_POST['delete'])."'"); if(mysql_affected_rows()) - message_push(happy(i18n("Successfully removed sponsorship"))); + happy_("Successfully removed sponsorship"); exit; } @@ -50,15 +50,15 @@ if($_POST['action']=="sponsorshipedit") { } if(mysql_error()) - message_push(error(mysql_error())); + echo error_(mysql_error()); else - message_push(happy(i18n("Saved sponsorship changes"))); + echo happy_("Saved sponsorship changes"); } else - message_push(happy(i18n("No changes were made"))); + echo error_("No changes were made"); } else { - message_push(error(i18n("Required fields were missing, please try again"))); + echo error_("Required fields were missing, please try again"); } exit; } @@ -70,12 +70,12 @@ if($_POST['action']=="sponsorshipadd") { NOW(), '".$_SESSION['users_id']."', '".mysql_real_escape_string("Created sponsorship: type=$fundraising_type, value=\$$value, status=$status, probability=$probability%")."')"); - message_push(happy(i18n("Added new sponsorship"))); + happy_("Added new sponsorship"); } else - message_push(error(i18n("Required fields were missing, please try again"))); + error_("Required fields were missing, please try again"); if(mysql_error()) - message_push(error(mysql_error())); + error_(mysql_error()); exit; } diff --git a/admin/fundraising_types_handler.inc.php b/admin/fundraising_types_handler.inc.php index b662bb8..a69170c 100644 --- a/admin/fundraising_types_handler.inc.php +++ b/admin/fundraising_types_handler.inc.php @@ -10,10 +10,10 @@ if($_POST['action']=="funddelete" && $_POST['delete']) { mysql_query("DELETE FROM sponsorships WHERE fundraising_type='".mysql_real_escape_string($f->type)."' AND year='".$config['FAIRYEAR']."'"); mysql_query("DELETE FROM fundraising WHERE id='$id'"); if(mysql_affected_rows()) - message_push(happy(i18n("Successfully removed fund %1",array($f->name)))); + happy_("Successfully removed fund %1",array($f->name)); } else { - message_push(error(i18n("Cannot remove system fund"))); + error_("Cannot remove system fund"); } } exit; @@ -40,12 +40,12 @@ if($_POST['action']=="fundedit") { mysql_query("UPDATE fundraising SET goal='$goal', description='$description', type='$type', name='$name' WHERE id='$fundraising_id'"); } if(mysql_error()) - message_push(error(mysql_error())); + error_("MySQL Error: %1",array(mysql_error())); else - message_push(happy(i18n("Saved fund changes"))); + happy_("Saved fund changes"); } else { - message_push(error(i18n("Required fields were missing, please try again"))); + error_("Required fields were missing, please try again"); } exit; @@ -53,12 +53,12 @@ if($_POST['action']=="fundedit") { if($_POST['action']=="fundadd") { if( $goal && $type && $name) { mysql_query("INSERT INTO fundraising (type,name,description,system,goal,year) VALUES ('$type','$name','$description','no','$goal','{$config['FAIRYEAR']}')"); - message_push(happy(i18n("Added new fund"))); + happy_("Added new fund"); } else - message_push(error(i18n("Required fields were missing, please try again"))); + error_("Required fields were missing, please try again"); if(mysql_error()) - message_push(error(mysql_error())); + error_("MySQL Error: %1",array(mysql_error())); exit; }