From c1d7b8fc24d9f819cac7430e5dc620bf19404e17 Mon Sep 17 00:00:00 2001 From: james Date: Fri, 18 Sep 2009 17:06:44 +0000 Subject: [PATCH] Commit working stuff for fundraising so i can update on lightbox --- admin/fundraising_main.inc.php | 41 ++++++++++------------- admin/fundraising_sponsorship.php | 55 +++++++++++++++++++++++++++++-- 2 files changed, 69 insertions(+), 27 deletions(-) diff --git a/admin/fundraising_main.inc.php b/admin/fundraising_main.inc.php index 0dca138..e43d118 100644 --- a/admin/fundraising_main.inc.php +++ b/admin/fundraising_main.inc.php @@ -24,41 +24,34 @@ if($_GET['action']=="fundraisingmain") { $typetotal=0; $typeprobtotal=0; - $sq=mysql_query("SELECT sponsorships.id, sponsors.organization, sponsorships.value, sponsorships.status, sponsorships.probability + $sq=mysql_query(" + SELECT sponsorships.id, sponsors.organization AS name, sponsorships.value, sponsorships.status, sponsorships.probability FROM sponsorships JOIN sponsors ON sponsorships.sponsors_id=sponsors.id WHERE (sponsorships.fundraising_type='$r->type' $orsql) AND sponsorships.year='{$config['FAIRYEAR']}' - ORDER BY status DESC, probability DESC, organization"); + + UNION + + SELECT sponsorships.id, CONCAT(users.firstname,' ',users.lastname) AS name, sponsorships.value, sponsorships.status, sponsorships.probability + FROM sponsorships + JOIN users ON sponsorships.users_uid=users.uid + WHERE (sponsorships.fundraising_type='$r->type' $orsql) + AND sponsorships.year='{$config['FAIRYEAR']}' + + ORDER BY status DESC, probability DESC, name + "); + echo mysql_error(); while($sr=mysql_fetch_object($sq)) { echo "id\" class=\"fundraising{$sr->status}\">"; echo ""; -// echo "id\">"; - echo "id)\" border=\"0\" src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\">"; - // echo ""; - + echo "id)\" border=\"0\" src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\">"; echo ""; echo "id&fundraising_type=$r->type')\">"; - //echo "id&fundraising_type=$r->type',400,250)\" href=\"#\">$sr->organization\n"; - echo "$sr->organization\n"; - /* - echo "id\">"; - - //only user emails can be deleted, system ones are required and cannot be removed - if($r->type=="user") - { - echo " "; - echo "id\">"; - echo " "; - echo "id\">Send"; - } - - - */ + echo "$sr->name\n"; echo "$sr->status"; echo ""; - if($sr->status=="pending") - { + if($sr->status=="pending") { echo "$sr->probability%"; echo ""; echo "".format_money($sr->value).""; diff --git a/admin/fundraising_sponsorship.php b/admin/fundraising_sponsorship.php index 56684e1..e9c173f 100644 --- a/admin/fundraising_sponsorship.php +++ b/admin/fundraising_sponsorship.php @@ -37,17 +37,41 @@ $formaction="sponsorshipadd"; $fundraising_type=$_GET['fundraising_type']; } +?> + +"; echo ""; echo ""; echo ""; - echo ""; - echo ""; + echo "\n"; + + echo ""; + echo ""; + echo "\n"; + + echo ""; + echo "\n";
".i18n("Sponsor").""; if($formaction=="sponsorshipadd") { + echo "
".i18n("Sponsor Type").""; + echo " ".i18n("Organization"); + echo " "; echo " "; echo " "; + echo " ".i18n("Individual"); + echo "
".i18n("Sponsor").""; + $q=mysql_query("SELECT * FROM sponsors ORDER BY organization"); echo mysql_error(); + echo ""; echo " ".i18n("Add")."\n"; + echo ""; + + + $q=mysql_query("SELECT users.*, MAX(year) AS year FROM users WHERE (firstname!='' AND lastname!='') GROUP BY uid HAVING deleted='no' ORDER BY lastname,firstname"); + echo mysql_error(); + echo ""; + echo " ".i18n("Add")."\n"; + echo ""; + + + } else { - echo $sponsorship->organization; + echo "
".i18n("Sponsor Type").""; + if($sponsorship->sponsors_id) echo i18n("Organization"); + else echo i18n("Individual"); + echo "
".i18n("Sponsor").""; + echo $sponsorship->organization; } echo "