diff --git a/admin/sponsors.php b/admin/sponsors.php index fada89e..5b58158 100644 --- a/admin/sponsors.php +++ b/admin/sponsors.php @@ -28,7 +28,8 @@ switch($_GET['action']) { case 'organizationinfo_load': - $q=mysql_query("SELECT * FROM sponsors WHERE id='".intval($_GET['id'])."'"); + $id=intval($_GET['id']); + $q=mysql_query("SELECT * FROM sponsors WHERE id='$id'"); $ret=mysql_fetch_assoc($q); echo json_encode($ret); exit; @@ -70,11 +71,78 @@ break; case 'sponsorshipinfo_load': + $id=intval($_GET['id']); $ret=array(); echo json_encode($ret); exit; break; + + case 'contactsinfo_load': + $sponsors_id=intval($_GET['id']); + $q=mysql_query("SELECT id, + uid, + year, + firstname, + lastname, + deleted, + salutation, + email, + phonework, + phonecell, + `primary` + FROM users,users_sponsor + WHERE + `types` LIKE '%sponsor%' + AND sponsors_id='$sponsors_id' + AND users_sponsor.users_id=users.id + AND users.deleted='no' + ORDER BY year DESC"); + echo mysql_error(); + echo "
".i18n("Year")." | "; + echo "".i18n("Name")." | "; + echo "".i18n("Email")." | "; + echo "".i18n("Phone (Work)")." | "; + echo "".i18n("Phone (Cell)")." | "; + echo "".i18n("Primary")." | "; + echo "Actions | "; + echo "
---|---|---|---|---|---|---|
$r->year | \n"; + echo ""; + if($r->salutation) echo $r->salutation." "; + echo "$r->firstname $r->lastname | \n"; + echo ""; + if($r->email) { + list($eb,$ea)=split("@",$r->email); + echo $r->email; + } + else + echo " "; + + echo " | "; + echo "$r->phonework | \n"; + echo "$r->phonecell | \n"; + $p = i18n(($r->primary=='yes')?'Yes':'No'); + echo "$p | \n"; + echo ""; + //FIXME: should we just go to /user_personal.php here instead? + echo "id\">"; + echo " "; + echo "id\">"; + echo " | \n"; + + + echo "