diff --git a/admin/fundraising_campaigns.php b/admin/fundraising_campaigns.php index 7b92ca7..89b0702 100644 --- a/admin/fundraising_campaigns.php +++ b/admin/fundraising_campaigns.php @@ -31,7 +31,7 @@ switch($_GET['action']){ exit; break; - case "display": + case "modify": echo "
\n"; $q=mysql_query("SELECT * FROM fundraising_campaigns WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY name"); while($r=mysql_fetch_object($q)) { @@ -71,6 +71,92 @@ switch($_GET['action']){ + + + + + + + + + + + + +fundraising_goal}' AND fiscalyear='{$config['FISCALYEAR']}'"); + $goalr=mysql_fetch_object($goalq); + $recq=mysql_query("SELECT SUM(value) AS received FROM fundraising_donations WHERE fundraising_campaigns_id='$r->id' AND fiscalyear='{$config['FISCALYEAR']}' AND status='received'"); + echo mysql_error(); + $recr=mysql_fetch_object($recq); + $received=$recr->received; + if($r->budget) + $percent=round($received/$r->target*100,1); + else + $percent=0; + $col=colour_to_percent($percent); + + echo "id)\">\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " "; + echo " "; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n"; + } + ?> + +
$r->name$r->type".format_date($r->startdate)."".format_date($r->enddate)."$goalr->name".format_money($r->target,false)."".format_money($received,false)."{$percent}%
+
+$campaign->name\n"; + ?> +
+ +
+ overview tab +
+
+ donations tab +
+
+ prospects tab +
+
+ communications tab +
+
+ $(document).ready(function() { - loadcampaigns(); + managecampaigns(); }); -function loadcampaigns() { - $("#campaigndiv").load("?action=display", null, function() {loadcampaignsfinish();}); +function modifycampaigns() { + $("#campaigndiv").show(); + $("#campaigndiv").load("?action=modify", null, function() {modifycampaignsfinish();}); +} + +function managecampaigns() { + $("#campaigndiv").show(); + $("#campaigndiv").load("?action=managelist", null, function() {managecampaignsfinish();}); +} + +function managecampaign(id) { + $("#campaigndiv").show(); + $("#campaigndiv").load("?action=manage&id="+id, null, function() {managecampaignfinish();}); } -function loadcampaignsfinish(){ +function modifycampaignsfinish(){ $("#campaignaccordion").accordion(); // create the date pickers for our form $(".date").datepicker({ @@ -128,12 +225,39 @@ function loadcampaignsfinish(){ }); } +function managecampaignsfinish() { + +} + +function managecampaignfinish() { + $("#campaign_tabs").tabs({ + show: function(event, ui) { + switch(ui.panel.id) { + case 'campaign_tab_overview': +// update_organizationinfo(); + break; + case 'campaign_tab_donations': + // update_sponsorshipinfo(); + break; + case 'campaign_tab_prospects': + // update_contactsinfo(); + break; + case 'campaign_tab_communications': + // update_activityinfo(); + break; + } + }, + selected: 0, + }); + +} + function campaigninfo_save(id) { //if we're creating we need to do the post, and get the id it returns, so we can re-open the popup window with that id if(id==-1) { - $("#debug").load("?action=campaigninfo_save", $("#campaigninfo_new").serializeArray(), function() { loadcampaigns(); }); + $("#debug").load("?action=campaigninfo_save", $("#campaigninfo_new").serializeArray(), function() { modifycampaigns(); }); } else { - $("#debug").load("?action=campaigninfo_save&id="+id, $("#campaigninfo_"+id).serializeArray(), function() { loadcampaigns(); }); + $("#debug").load("?action=campaigninfo_save&id="+id, $("#campaigninfo_"+id).serializeArray(), function() { modifycampaigns(); }); } return false; } @@ -176,8 +300,15 @@ function display_campaign_form($r=null) { + +
+Create/Modify Campaigns + +Campaign Management +
+
-
+