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 "".i18n("Last Donation")." $lastdonation \n";
+ echo "".i18n("Total This Year")." $totalthisyear \n";
+ echo "".i18n("Total Last Year")." $totallastyear \n";
+ echo "
\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 " ".i18n("Date")." \n";
+ echo " ".i18n("Goal")." \n";
+ echo " ".i18n("Campaign")." \n";
+ echo " ".i18n("Value")." \n";
+ echo " ";
+ while($r=mysql_fetch_object($q)) {
+ echo "\n";
+ echo " ".format_date($r->datereceived)." \n";
+ echo " $r->fundraising_goal ";
+ echo " $r->fundraising_campaigns_id ";
+ echo " ".format_money($r->value,false)." ";
+ }
+ echo "
\n";
+ echo "
\n";
+ echo "
\n";
+ echo " \n";
+ echo "".i18n("Add New Donation/Sponsorship")." \n";
+
+ echo "\n";
+
exit;
break;
@@ -449,7 +576,7 @@ function draw_activityinfo_form(){
Date
- User
+ Committee Member
Contact Type
Campaign
Notes
@@ -661,10 +788,9 @@ function organizationinfo_save() {
function update_sponsorshipinfo()
{
var id=sponsor_id;
- $.getJSON("=$_SERVER['PHP_SELF']?>?action=sponsorshipinfo_load&id="+id,
- function(json){
- $("#sponsor_id").val(json.id);
- });
+ $("#editor_tab_sponsorship").load("=$_SERVER['PHP_SELF']?>?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("$_SERVER['PHP_SELF']?>?action=contactsinfo_addexisting",{id: id, uid: uid} ,function() { update_contactsinfo(); });
}
+
+function togglefulldonationhistory() {
+ $("#fulldonationhistory").toggle('slow');
+
+}
+
+function campaignchange() {
+
+}
diff --git a/admin/fundraising.php b/admin/fundraising.php
index 4e22999..0da80b0 100644
--- a/admin/fundraising.php
+++ b/admin/fundraising.php
@@ -39,15 +39,15 @@ $(document).ready(function() {
});
-=i18n("Fundraising Goals and Progress Year to Date")?>
+=i18n("Fundraising Purposes and Progress Year to Date")?>
$q=mysql_query("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY deadline");
?>
+ =i18n("Purpose")?>
=i18n("Goal")?>
- =i18n("Budget Amount")?>
=i18n("Amount Received")?>
=i18n("% to Budget")?>
=i18n("Deadline")?>
@@ -75,17 +75,17 @@ $q=mysql_query("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISC
-=i18n("Current Campaigns")?>
+=i18n("Current Appeals")?>
=i18n("Name")?>
=i18n("Type")?>
=i18n("Start Date")?>
=i18n("End Date")?>
- =i18n("Goal")?>
=i18n("Target($)")?>
=i18n("Received")?>
=i18n("% to Budget")?>
+ =i18n("Purpose")?>
@@ -110,10 +110,10 @@ $q=mysql_query("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISC
echo " $r->type \n";
echo " ".format_date($r->startdate)." \n";
echo " ".format_date($r->enddate)." ";
- echo " $goalr->name ";
echo " ".format_money($r->target,false)." \n";
echo " ".format_money($received,false)." \n";
echo " {$percent}% \n";
+ echo " $goalr->name ";
echo "\n";
}
?>
@@ -165,14 +165,14 @@ if(mysql_num_rows($q)) {
?>
-Campaign Follow-Ups
+Appeal Follow-Ups
$q=mysql_query("SELECT * FROM fundraising_campaigns WHERE followupdate>=NOW() ORDER BY followupdate LIMIT 5");
echo mysql_error();
if(mysql_num_rows($q)) {
echo "";
echo "";
- echo " ".i18n("Campaign Name")." \n";
+ echo " ".i18n("Appeal")." \n";
echo " ".i18n("Start Date")." \n";
echo " ".i18n("Follow-Up Date")." \n";
echo " \n";
@@ -181,7 +181,7 @@ if(mysql_num_rows($q)) {
}
echo "
\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']){
}
?>
-
+
@@ -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']){
=i18n("Type")?>
=i18n("Start Date")?>
=i18n("End Date")?>
- =i18n("Goal")?>
=i18n("Target($)")?>
=i18n("Received")?>
=i18n("% to Budget")?>
+ =i18n("Purpose")?>
@@ -111,10 +111,10 @@ switch($_GET['action']){
echo " $r->type \n";
echo " ".format_date($r->startdate)." \n";
echo " ".format_date($r->enddate)." ";
- echo " $goalr->name ";
echo " ".format_money($r->target,false)." \n";
echo " ".format_money($received,false)." \n";
echo " {$percent}% \n";
+ echo " $goalr->name ";
echo "\n";
}
?>
@@ -186,7 +186,7 @@ switch($_GET['action']){
echo "\n";
echo " ".i18n("End Date")." ".format_date($r->enddate)." ";
echo "\n";
- echo " ".i18n("Default Goal")." $goalr->name ";
+ echo " ".i18n("Default Purpose")." $goalr->name ";
echo "\n";
echo " ".i18n("Target")." ".format_money($r->target,false)." \n";
echo "\n";
@@ -257,7 +257,7 @@ switch($_GET['action']){
=i18n("Mentor")?>
=i18n("Committee")?>
=i18n("Volunteer")?>
- =i18n("Students")?>
+ =i18n("Alumni")?>
@@ -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) {
=i18n("Target")?> $
- =i18n("Default Goal")?>
+ =i18n("Default Purpose")?>
$fgq=mysql_query("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISCALYEAR']}' ORDER BY name");
echo "";
- echo "".i18n("Choose Default Goal")." \n";
+ echo "".i18n("Choose Default Purpose")." \n";
while($fgr=mysql_fetch_object($fgq)) {
if($r->fundraising_goal==$fgr->goal) $sel="selected=\"selected\""; else $sel="";
echo "goal\">".i18n($fgr->name)." \n";
@@ -491,9 +491,9 @@ function display_campaign_form($r=null) {
?>
diff --git a/admin/fundraising_setup.php b/admin/fundraising_setup.php
index 158bc3b..29e9778 100644
--- a/admin/fundraising_setup.php
+++ b/admin/fundraising_setup.php
@@ -122,7 +122,7 @@
echo "
\n";
echo "
\n";
echo "";
echo "
\n";
}
- echo "\n";
+ echo "\n";
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() {