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 ""; + echo ""; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo "\n"; + + while($r=mysql_fetch_object($q)) { + echo "\n"; + echo " \n"; + echo " \n"; + echo " "; + echo " \n"; + echo " \n"; + $p = i18n(($r->primary=='yes')?'Yes':'No'); + echo " \n"; + echo " \n"; + + + echo "\n"; + } + echo "
".i18n("Year")."".i18n("Name")."".i18n("Email")."".i18n("Phone (Work)")."".i18n("Phone (Cell)")."".i18n("Primary")."Actions
$r->year"; + if($r->salutation) echo $r->salutation." "; + echo "$r->firstname $r->lastname"; + if($r->email) { + list($eb,$ea)=split("@",$r->email); + echo $r->email; + } + else + echo " "; + + echo " $r->phonework$r->phonecell$p"; + //FIXME: should we just go to /user_personal.php here instead? + echo "id\">"; + echo " "; + echo "id\">"; + echo "
\n"; + + exit; + break; } send_header("Sponsors", @@ -210,10 +278,7 @@ function sponsorshipinfo_save() { function update_contactsinfo() { var id=sponsor_id; - $.getJSON("?action=contactsinfo_load&id="+id, - function(json){ - $("#sponsor_id").val(json.id); - }); + $("#editor_tab_contacts").load("?action=contactsinfo_load&id="+id); } function contactsinfo_save() { @@ -286,7 +351,6 @@ function activityinfo_save() { sponsorship
- contacts
activity @@ -352,7 +416,7 @@ function activityinfo_save() { echo " "; echo "$numcontacts  "; - echo "id\">\"view\""; +// echo "id\">\"view\""; echo ""; echo "\n"; }