diff --git a/admin/donors.php b/admin/donors.php index ce755b4..707642e 100644 --- a/admin/donors.php +++ b/admin/donors.php @@ -78,27 +78,16 @@ break; case 'contactsinfo_load': - draw_contactsinfo_form(); + if($_GET['id']){ + draw_contactsinfo_form(); + } exit; break; case 'contactsinfo_save': - $u = user_create('sponsor', $_POST['email']); - - $u['salutation']=$_POST['salutation']; - $u['firstname']=$_POST['firstname']; - $u['lastname']=$_POST['lastname']; - $u['position']=$_POST['position']; - $u['phonework']=$_POST['phonework']; - $u['phonecell']=$_POST['phonecell']; - $u['phonehome']=$_POST['phonehome']; - $u['fax']=$_POST['fax']; - $u['email']=$_POST['email']; -// $u['notes']=$_POST['notes']; -// $u['sponsors_id']=$sponsors_id; - user_save($u); -// happy_("happy!"); + save_contact(); +// draw_contactsinfo_form(); exit; break; } @@ -109,119 +98,135 @@ 'Fundraising' => 'admin/fundraising.php') ); -function draw_contactsinfo_form(){ - // use a basic form for now and beautify later -?> -
-<< ".i18n("Back to %1 Contacts",array($sponsors_organization))."\n"; /* - $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 "