Copyright (C) 2008 James Grant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> $id)); } if($id) { $exec="UPDATE sponsors SET ". "organization='".mysql_escape_string(stripslashes($_POST['organization']))."', ". "address='".mysql_escape_string(stripslashes($_POST['address']))."', ". "city='".mysql_escape_string(stripslashes($_POST['city']))."', ". "province_code='".mysql_escape_string(stripslashes($_POST['province_code']))."', ". "postalcode='".mysql_escape_string(stripslashes($_POST['postalcode']))."', ". "phone='".mysql_escape_string(stripslashes($_POST['phone']))."', ". "tollfree='".mysql_escape_string(stripslashes($_POST['tollfree']))."', ". "fax='".mysql_escape_string(stripslashes($_POST['fax']))."', ". "email='".mysql_escape_string(stripslashes($_POST['email']))."', ". "website='".mysql_escape_string(stripslashes($_POST['website']))."', ". "notes='".mysql_escape_string(stripslashes($_POST['notes']))."', ". "donationpolicyurl='".mysql_escape_string(stripslashes($_POST['donationpolicyurl']))."', ". "fundingselectiondate='".mysql_escape_string(stripslashes($_POST['fundingselectiondate']))."', ". "waiveraccepted='".mysql_escape_string(stripslashes($_POST['waiveraccepted']))."', ". "taxreceiptrequired='".mysql_escape_string(stripslashes($_POST['taxreceiptrequired']))."' ". "WHERE id='$id'"; mysql_query($exec); //FIXME accept the logo //"logo='".mysql_escape_string(stripslashes($_POST['logo']))."', ". } exit; break; case 'sponsorshipinfo_load': $id=intval($_GET['id']); $ret=array(); echo json_encode($ret); exit; break; case 'contactsinfo_load': 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!"); exit; break; } send_header("Donor/Sponsor Management", array('Committee Main' => 'committee_main.php', 'Administration' => 'admin/index.php', 'Fundraising' => 'admin/fundraising.php') ); function draw_contactsinfo_form(){ // use a basic form for now and beautify later ?>
*/ ?>
" onClick="return contactsinfo_save()" />
"; echo ""; echo " ".i18n("Year").""; echo " ".i18n("Name").""; echo " ".i18n("Email").""; echo " ".i18n("Phone (Work)").""; echo " ".i18n("Phone (Cell)").""; echo " ".i18n("Primary").""; echo " Actions"; echo "\n"; while($r=mysql_fetch_object($q)) { echo "\n"; 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 "\n"; } echo "\n"; */ } ?> "; echo ""; echo "Add New Donor(s)/Sponsor(s)\n"; echo ""; echo ""; echo "View/Modify Donor(s)/Sponsor(s)\n"; echo ""; echo ""; echo "
"; ?>