diff --git a/admin/donors.php b/admin/donors.php index ae0cf3b..1d2c776 100644 --- a/admin/donors.php +++ b/admin/donors.php @@ -76,8 +76,135 @@ switch($_GET['action']) { break; case 'sponsorshipinfo_load': $id=intval($_GET['id']); - $ret=array(); - echo json_encode($ret); + echo "

".i18n("Summary")."

\n"; + echo "\n"; + + + //LAST DONATION + $q=mysql_query("SELECT * FROM fundraising_donations WHERE sponsors_id='$id' ORDER BY datereceived DESC LIMIT 1"); + if($r=mysql_fetch_object($q)) + $lastdonation=i18n("%1 on %2",array(format_money($r->value,false),format_date($r->datereceived)),array("Donation amount","Donation date")); + else + $lastdonation=i18n("Never"); + + //TOTAL THIS YEAR + $q=mysql_query("SELECT SUM(value) AS total FROM fundraising_donations + WHERE sponsors_id='$id' + AND fiscalyear={$config['FISCALYEAR']} + "); + + if($r=mysql_fetch_object($q)) + $totalthisyear=format_money($r->total,false); + else + $totalthisyear=format_money(0); + + //TOTAL LAST YEAR + $lastyear=$config['FISCALYEAR']-1; + $q=mysql_query("SELECT SUM(value) AS total FROM fundraising_donations + WHERE sponsors_id='$id' + AND fiscalyear=$lastyear + "); + + if($r=mysql_fetch_object($q)) + $totallastyear=format_money($r->total,false); + else + $totallastyear=format_money(0); + + + //OUTPUT + echo "\n"; + echo "\n"; + echo "\n"; + echo "
".i18n("Last Donation")."$lastdonation
".i18n("Total This Year")."$totalthisyear
".i18n("Total Last Year")."$totallastyear
\n"; + + echo "
\n"; + echo "".i18n("View full donation history").""; + echo "
"; + $q=mysql_query("SELECT * FROM fundraising_donations WHERE sponsors_id='$id' ORDER BY datereceived DESC"); + echo "FIXME: get the goal and campaign"; + echo ""; + echo ""; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo ""; + while($r=mysql_fetch_object($q)) { + echo "\n"; + echo " \n"; + echo " "; + echo " "; + echo " "; + } + echo "
".i18n("Date")."".i18n("Goal")."".i18n("Campaign")."".i18n("Value")."
".format_date($r->datereceived)."$r->fundraising_goal$r->fundraising_campaigns_id".format_money($r->value,false)."
\n"; + echo "
\n"; + echo "
\n"; + echo "
\n"; + echo "

".i18n("Add New Donation/Sponsorship")."

\n"; + + echo "
"; + echo ""; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + /* + echo ""; + echo "\n"; + */ + echo "
"; + echo i18n("Appeal").":"; + echo ""; + echo "\n"; + echo "
"; + echo i18n("Purpose").":"; + echo ""; + echo "\n"; + echo "\n"; + echo "
".i18n("Date Received").":
".i18n("Amount").":\$
".i18n("Type of Support").":"; + $supporttypes=array("Gift - no receipt"); + if($config['registered_charity']) + $supporttypes[]="Donation - with receipt"; + $supporttypes[]="Sponsorship"; + echo "\n"; + + echo "
"; + echo "".i18n("Generate Thank You")."
\n"; + + + echo "
\n"; + exit; break; @@ -449,7 +576,7 @@ function draw_activityinfo_form(){ - + @@ -661,10 +788,9 @@ function organizationinfo_save() { function update_sponsorshipinfo() { var id=sponsor_id; - $.getJSON("?action=sponsorshipinfo_load&id="+id, - function(json){ - $("#sponsor_id").val(json.id); - }); + $("#editor_tab_sponsorship").load("?action=sponsorshipinfo_load&id="+id, null,function() { + $(".date").datepicker({ dateFormat: 'yy-mm-dd' }); + }); } function sponsorshipinfo_save() { @@ -747,6 +873,15 @@ function useexistingcontact(uid) { var id=sponsor_id; $("#debug").load("?action=contactsinfo_addexisting",{id: id, uid: uid} ,function() { update_contactsinfo(); }); } + +function togglefulldonationhistory() { + $("#fulldonationhistory").toggle('slow'); + +} + +function campaignchange() { + +} -

+

DateUserCommittee Member Contact Type Campaign Notes
+ - @@ -75,17 +75,17 @@ $q=mysql_query("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISC

-

+

- + $r->type\n"; echo " \n"; echo " "; - echo " "; echo " \n"; echo " \n"; echo " \n"; + echo " "; echo "\n"; } ?> @@ -165,14 +165,14 @@ if(mysql_num_rows($q)) { ?>
-

Campaign Follow-Ups

+

Appeal Follow-Ups

=NOW() ORDER BY followupdate LIMIT 5"); echo mysql_error(); if(mysql_num_rows($q)) { echo "
".format_date($r->startdate)."".format_date($r->enddate)."$goalr->name".format_money($r->target,false)."".format_money($received,false)."{$percent}%$goalr->name
"; echo ""; - echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo "\n"; @@ -181,7 +181,7 @@ if(mysql_num_rows($q)) { } echo "
".i18n("Campaign Name")."".i18n("Appeal")."".i18n("Start Date")."".i18n("Follow-Up Date")."
\n"; } else { - echo i18n("No campaign follow-ups"); + echo i18n("No appeal follow-ups"); echo "
\n"; } diff --git a/admin/fundraising_campaigns.php b/admin/fundraising_campaigns.php index c222989..5649709 100644 --- a/admin/fundraising_campaigns.php +++ b/admin/fundraising_campaigns.php @@ -45,7 +45,7 @@ switch($_GET['action']){ ?>
- "> + "> @@ -53,7 +53,7 @@ switch($_GET['action']){ -

+

@@ -63,7 +63,7 @@ switch($_GET['action']){ ?>
- "> + ">
@@ -75,7 +75,7 @@ switch($_GET['action']){ case "managelist": - echo i18n("Select a campaign"); + echo i18n("Select an appeal"); ?> @@ -83,10 +83,10 @@ switch($_GET['action']){ - + $r->type\n"; echo " \n"; echo " "; - echo " "; echo " \n"; echo " \n"; echo " \n"; + echo " "; echo "\n"; } ?> @@ -186,7 +186,7 @@ switch($_GET['action']){ echo "\n"; echo " "; echo "\n"; - echo " "; + echo " "; echo "\n"; echo " \n"; echo "\n"; @@ -257,7 +257,7 @@ switch($_GET['action']){


-
+
".format_date($r->startdate)."".format_date($r->enddate)."$goalr->name".format_money($r->target,false)."".format_money($received,false)."{$percent}%$goalr->name
".i18n("End Date")."".format_date($r->enddate)."
".i18n("Default Goal")."$goalr->name".i18n("Default Purpose")."$goalr->name
".i18n("Target")."".format_money($r->target,false)."
@@ -294,7 +294,7 @@ switch($_GET['action']){ function save_campaign_info(){ global $config; if(!$_POST['name']){ - error_("Campaign Name is required"); + error_("Appeal Name is required"); return; } if(!$_POST['startdate']) $startdate=date("Y-m-d"); else $startdate=$_POST['startdate']; @@ -304,10 +304,10 @@ function save_campaign_info(){ '".mysql_real_escape_string($_POST['name'])."','{$config['FISCALYEAR']}')"; mysql_query($query); $id = mysql_insert_id(); - happy_("Campaign Created"); + happy_("Appeal Created"); }else{ $id = $_GET["id"]; - happy_("Campaign Saved"); + happy_("Appeal Saved"); } mysql_query("UPDATE fundraising_campaigns SET name='".mysql_real_escape_string($_POST['name'])."', @@ -320,7 +320,7 @@ function save_campaign_info(){ WHERE id='$id'"); } -send_header("Campaign Management", +send_header("Appeal Management", array('Committee Main' => 'committee_main.php', 'Administration' => 'admin/index.php', 'Fundraising' => 'admin/fundraising.php'), @@ -473,11 +473,11 @@ function display_campaign_form($r=null) { $ - + "; - echo "\n"; + echo "\n"; while($fgr=mysql_fetch_object($fgq)) { if($r->fundraising_goal==$fgr->goal) $sel="selected=\"selected\""; else $sel=""; echo "\n"; @@ -491,9 +491,9 @@ function display_campaign_form($r=null) { ?>
-Create/Modify Campaigns +Create/Modify Appeals -Campaign Management +Appeal Management

\n"; } - echo "

Create New Goal

\n"; + echo "

Create New Purpose

\n"; echo "
\n"; echo "
\n"; echo ""; echo "\n"; + echo i18n("Purpose Name").":\n"; echo ""; echo "
"; - echo i18n("Goal Name").":
"; echo i18n("Budget Amount").":\$
"; @@ -156,7 +156,7 @@ echo "
\n"; echo "
"; - echo ""; + echo ""; echo ""; echo "
\n"; echo "
\n"; @@ -240,7 +240,7 @@ case "goal_save": $id=$_POST['id']; if(! ($_POST['name'] && $_POST['budget'])) { - error_("Goal name and budget are required"); + error_("Purpose name and budget are required"); exit; } if($id) { @@ -251,7 +251,7 @@ description='".mysql_real_escape_string($_POST['description'])."' WHERE id='$id' AND fiscalyear='{$config['FISCALYEAR']}' "); - happy_("Goal Saved"); + happy_("Purpose Saved"); } else { $goal=strtolower($_POST['name']); @@ -259,7 +259,7 @@ $q=mysql_query("SELECT * FROM fundraising_goals WHERE goal='$goal' AND fiscalyear='{$config['FISCALYEAR']}'"); echo mysql_error(); if(mysql_num_rows($q)) { - error_("The automatically generated goal key (%1) generated from (%2) is not unique. Please try a different Goal Name",array($goal,$_POST['name'])); + error_("The automatically generated purpose key (%1) generated from (%2) is not unique. Please try a different Purpose Name",array($goal,$_POST['name'])); exit; } @@ -270,7 +270,7 @@ '".mysql_real_escape_string($_POST['deadline'])."', '".mysql_real_escape_string($_POST['description'])."', '{$config['FISCALYEAR']}')"); - happy_("Goal Created"); + happy_("Purpose Created"); } exit; break; @@ -293,7 +293,7 @@ } mysql_query("DELETE FROM fundraising_goals WHERE id='$id' AND fiscalyear='{$config['FISCALYEAR']}'"); - happy_("Goal Deleted"); + happy_("Purpose Deleted"); exit; break; @@ -417,7 +417,7 @@ function charitychange() {
diff --git a/common.inc.php b/common.inc.php index 9e2f0bb..d03fbdb 100644 --- a/common.inc.php +++ b/common.inc.php @@ -461,7 +461,7 @@ if(is_array($nav)) { echo "
  • ".i18n("Fundraising")."

  • \n"; echo "
  • ".i18n("Fundraising Dashboard").'
  • '; echo "
  • ".i18n("Fundraising Setup").'
  • '; - echo "
  • ".i18n("Manage Campaigns").'
  • '; + echo "
  • ".i18n("Manage Appeal").'
  • '; echo "
  • ".i18n("Manage Donors/Sponsors").'
  • '; echo "
  • ".i18n("Fundraising Reports").'
  • '; echo "
    \n";