From 8c12e443b04885731c668d6a3a51261a23a00c09 Mon Sep 17 00:00:00 2001 From: justin Date: Mon, 12 Jul 2010 19:02:49 +0000 Subject: [PATCH] enable deleting of fundraising campaigns under certain conditions --- admin/fundraising_campaigns.php | 48 ++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/admin/fundraising_campaigns.php b/admin/fundraising_campaigns.php index 42fd00f..e1823da 100644 --- a/admin/fundraising_campaigns.php +++ b/admin/fundraising_campaigns.php @@ -36,19 +36,29 @@ switch($_GET['action']){ echo "
\n"; $q=mysql_query("SELECT * FROM fundraising_campaigns WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY name"); while($r=mysql_fetch_object($q)) { - echo "

".htmlspecialchars($r->name)."

\n"; + echo "

id}\">".htmlspecialchars($r->name)."

\n"; echo "
id}\">\n"; + echo "\n"; echo "id}\" method=\"post\" action=\"{$_SERVER['PHP_SELF']}\" onsubmit=\"return campaigninfo_save($r->id)\">\n"; echo "id}\" />\n"; - echo "
\n"; display_campaign_form($r); ?> -

">
+ +
+ id}\" method=\"post\" action=\"{$_SERVER['PHP_SELF']}\" onsubmit=\"return campaigninfo_remove($r->id)\">\n"; + echo "id}\" />\n"; + ?> +
+ "> + + +
"; + echo " $('#campaigntitle_$campaign_id').remove();"; + echo " $('#campaign_$campaign_id').remove();"; + echo ""; + } + } else { + error_("Invalid Campaign ID"); + } + exit; break; } @@ -612,6 +649,11 @@ function campaigninfo_save(id) { return false; } +function campaigninfo_remove(id) { + $("#debug").load("?action=campaign_remove", $("#campaignremove_"+id).serializeArray()); + return false; +} + function update_tab_overview() { $("#campaign_tab_overview").load("?action=manage_tab_overview&id="+currentcampaignid); }