From cdc93de3bd93567d716e0aafc27bfabfea68b493 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 7 Oct 2009 21:44:32 +0000 Subject: [PATCH] Overview tab implementation --- admin/fundraising_campaigns.php | 49 +++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/admin/fundraising_campaigns.php b/admin/fundraising_campaigns.php index 89b0702..c76387b 100644 --- a/admin/fundraising_campaigns.php +++ b/admin/fundraising_campaigns.php @@ -117,12 +117,13 @@ switch($_GET['action']){ echo "\n"; } ?> -
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 ""; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo " "; + echo "\n"; + echo " "; + echo "\n"; + echo " \n"; + echo "\n"; + echo " \n"; + echo "\n"; + echo " \n"; + echo "\n"; + echo "
Type$r->type
Start Date".format_date($r->startdate)."
Follow-Up Date".format_date($r->enddate)."
Default Goal$goalr->name
Target".format_money($r->target,false)."
Received".format_money($received,false)."
% to Budget{$percent}%
\n"; + } + exit; + break; } function save_campaign_info(){ @@ -211,9 +250,12 @@ function managecampaigns() { $("#campaigndiv").load("?action=managelist", null, function() {managecampaignsfinish();}); } +var currentcampaignid; + function managecampaign(id) { $("#campaigndiv").show(); $("#campaigndiv").load("?action=manage&id="+id, null, function() {managecampaignfinish();}); + currentcampaignid=id; } @@ -234,7 +276,7 @@ function managecampaignfinish() { show: function(event, ui) { switch(ui.panel.id) { case 'campaign_tab_overview': -// update_organizationinfo(); + update_tab_overview(); break; case 'campaign_tab_donations': // update_sponsorshipinfo(); @@ -262,6 +304,9 @@ function campaigninfo_save(id) { return false; } +function update_tab_overview() { + $("#campaign_tab_overview").load("?action=manage_tab_overview&id="+currentcampaignid); +}