diff --git a/admin/fundraising_campaigns.php b/admin/fundraising_campaigns.php index 649a208..0faf7a7 100644 --- a/admin/fundraising_campaigns.php +++ b/admin/fundraising_campaigns.php @@ -211,8 +211,98 @@ switch($_GET['action']){ case "manage_tab_prospects": + $donationhistorylist=array("never"=>"Never donated/sponsored", "past"=>"Donated/sponsored in the past", "lastyear"=>"Donated/sponsored last year", "thisyear"=>"Donated/sponosred this year"); + $emailaddresslist=array("available"=>"Available", "notavaialble"=>"Not Available"); + + $rolelist=array( + "judge"=>"Judge", + "teacher"=>"Teacher", + "sciencehead"=>"School Science Head", + "principal"=>"School Principal", + "parent"=>"Parent", + "committee"=>"Committee", + "volunteer"=>"Volunteer", + "alumni"=>"Alumni (not implemented)", + "mentor"=>"Mentor (not implemented)", + ); $campaign_id=intval($_GET['id']); $q=mysql_query("SELECT * FROM fundraising_campaigns WHERE id='$campaign_id' AND fiscalyear='{$config['FISCALYEAR']}'"); + $campaign=mysql_fetch_object($q); + if($campaign->filterparameters) { + echo "

".i18n("User List")."

\n"; + $params=unserialize($campaign->filterparameters); + echo ""; + echo "\n"; + if(is_array($params['donationhistory'])) { + echo "\n"; + } +// echo "\n"; + if(is_array($params['emailaddress'])) { + echo "\n"; + } + if($params['donortype']=="individual" && is_array($params['individual_type'])) { + echo "\n"; + } else if( is_array($params['contacttype'])) { + echo "\n"; + } + + echo "
".i18n("Donor Type")."".i18n(ucfirst($params['donortype']))."
".i18n("Donation History").""; + foreach($params['donationhistory'] AS $d) { + echo i18n($donationhistorylist[$d])."
\n"; + } + echo "
".i18n("Donation Level").""; +// echo "
".i18n("Email Address").""; + foreach($params['emailaddress'] AS $e) { + echo i18n($emailaddresslist[$e])."
\n"; + } + echo "
".i18n("Role").""; + foreach($params['individual_type'] AS $e) { + echo i18n($rolelist[$e])."
\n"; + } + echo "
".i18n("Role").""; + foreach($params['contacttype'] AS $e) { + echo i18n(ucfirst($e))."
"; + } + echo "
\n"; + //params: individual/org + // donation history + // donation level + // email address + // role ind + // role org + + echo "
"; + echo "
\n"; + echo "\n"; + $q=mysql_query("SELECT * FROM fundraising_campaigns_users_link WHERE fundraising_campaigns_id='$campaign_id'"); + while($r=mysql_fetch_object($q)) { + $u=user_load_by_uid($r->users_uid); + //hopefully this never returns false, but who knows.. + if($u) { + echo "\n"; + echo "
"; + } + } + echo "
"; + echo "
"; + + echo "
"; + echo "\n"; + echo ""; + echo "\n"; + // echo ""; + // echo "\n"; + echo "
\n"; + } + else { ?>

@@ -227,10 +317,11 @@ switch($_GET['action']){
: -
-
-
-
+ $v) { + echo "
\n"; + } + ?>
:
: -
-
+ $v) { + echo "
\n"; + } + ?>
@@ -251,15 +345,12 @@ switch($_GET['action']){ @@ -276,6 +367,7 @@ switch($_GET['action']){
num==0) { + mysql_query("UPDATE fundraising_campaigns SET filterparameters=NULL WHERE id='$campaignid'"); + } + + happy_("Selected users removed from list"); + exit; + break; + + case "prospect_removeall": + $campaignid=intval($_POST['fundraising_campaigns_id']); + mysql_query("DELETE FROM fundraising_campaigns_users_link WHERE fundraising_campaigns_id='$campaignid'"); + mysql_query("UPDATE fundraising_campaigns SET filterparameters=NULL WHERE id='$campaignid'"); + happy_("All users removed from list"); + exit; + break; } @@ -442,7 +561,23 @@ function prospect_search() { } function prospect_generatelist() { - $("#prospectsearchresults").load("fundraising_campaigns_prospecting.php?generatelist=true",$("#prospectform").serializeArray()); + $("#prospectsearchresults").load("fundraising_campaigns_prospecting.php?generatelist=true",$("#prospectform").serializeArray(), function() { + update_tab_prospects(); + }); + return false; +} + +function prospect_removeselected() { + $("#debug").load("fundraising_campaigns.php?action=prospect_removeselected",$("#prospectremoveform").serializeArray(),function() { + update_tab_prospects(); + }); + return false; +} + +function prospect_removeall() { + $("#debug").load("fundraising_campaigns.php?action=prospect_removeall",$("#prospectremoveform").serializeArray(),function() { + update_tab_prospects(); + }); return false; } diff --git a/admin/fundraising_campaigns_prospecting.php b/admin/fundraising_campaigns_prospecting.php index 6cfd6c9..fabf027 100644 --- a/admin/fundraising_campaigns_prospecting.php +++ b/admin/fundraising_campaigns_prospecting.php @@ -61,8 +61,8 @@ if($_POST['donortype']=="organization") { echo mysql_error(); while($cr=mysql_fetch_object($cq)) { - if(!$userslist[$cr->users_id]) - $userslist[$cr->users_id]=user_load($cr->users_id); + if(!$userslist[$cr->uid]) + $userslist[$cr->uid]=user_load($cr->users_id); } } } diff --git a/theme/default/sfiab.css b/theme/default/sfiab.css index b3da046..0302ea4 100644 --- a/theme/default/sfiab.css +++ b/theme/default/sfiab.css @@ -354,7 +354,7 @@ div.notice_area div.happy { } .date { - width: 80px; + width: 100px; } diff --git a/user.inc.php b/user.inc.php index 55fa268..dd618c8 100644 --- a/user.inc.php +++ b/user.inc.php @@ -125,11 +125,15 @@ function user_load_volunteer(&$u) return true; } -function user_load_sponsor($u) +function user_load_sponsor(&$u) { $u['sponsors_id'] = intval($u['sponsors_id']); $u['sponsor_complete'] = ($u['sponsor_complete'] == 'yes') ? 'yes' : 'no'; $u['sponsor_active'] = ($u['sponsor_active'] == 'yes') ? 'yes' : 'no'; + if($u['sponsors_id']) { + $q=mysql_query("SELECT * FROM sponsors WHERE id='{$u['sponsors_id']}'"); + $u['sponsor']=mysql_fetch_assoc($q); + } return true; }