Copyright (C) 2005 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. */ ?> << ".i18n("Back to Administration")."\n"; echo "<< ".i18n("Back to Awards")."\n"; $q=mysql_query("SELECT id,organization FROM award_sponsors ORDER BY organization"); echo "
"; echo ""; echo "
"; if($award_sponsors_id) { if($_POST['save']=="edit" || $_POST['save']=="add") { if($_POST['save']=="add") { $q=mysql_query("INSERT INTO award_contacts (award_sponsors_id,year) VALUES ('$award_sponsors_id','".$config['FAIRYEAR']."')"); $id=mysql_insert_id(); } else $id=$_POST['id']; $exec="UPDATE award_contacts SET ". "salutation='".mysql_escape_string(stripslashes($_POST['salutation']))."', ". "firstname='".mysql_escape_string(stripslashes($_POST['firstname']))."', ". "lastname='".mysql_escape_string(stripslashes($_POST['lastname']))."', ". "position='".mysql_escape_string(stripslashes($_POST['position']))."', ". "phonework='".mysql_escape_string(stripslashes($_POST['phonework']))."', ". "phonecell='".mysql_escape_string(stripslashes($_POST['phonecell']))."', ". "phonehome='".mysql_escape_string(stripslashes($_POST['phonehome']))."', ". "fax='".mysql_escape_string(stripslashes($_POST['fax']))."', ". "email='".mysql_escape_string(stripslashes($_POST['email']))."', ". "notes='".mysql_escape_string(stripslashes($_POST['notes']))."' ". "WHERE id='$id'"; mysql_query($exec); if($_POST['save']=="add") echo happy("Contact successfully added"); else echo happy("Successfully saved changes to contact"); } if($_GET['action']=="delete" && $_GET['delete']) { mysql_query("DELETE FROM award_contacts WHERE id='".$_GET['delete']."'"); echo happy("Contact successfully deleted"); } if($_GET['action']=="edit" || $action=="add") { echo "<< ".i18n("Back to %1 Contacts",array($award_sponsors_organization))."\n"; if($_GET['action']=="edit") { echo "

".i18n("Edit %1 Contact",array($award_sponsors_organization))."

\n"; $buttontext="Save Contact"; $q=mysql_query("SELECT * FROM award_contacts WHERE id='".$_GET['edit']."'"); $r=mysql_fetch_object($q); } else if($action=="add") { echo "

".i18n("Add %1 Contact",array($award_sponsors_organization))."

\n"; $buttontext="Add Contact"; } $buttontext=i18n($buttontext); echo "
\n"; echo "\n"; echo "\n"; if($_GET['action']=="edit") echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
".i18n("Salutation")."salutation)."\" size=\"4\" maxlength=\"8\" />
".i18n("First Name")."firstname)."\" size=\"32\" maxlength=\"32\" />
".i18n("Last Name")."lastname)."\" size=\"32\" maxlength=\"32\" />
".i18n("Position")."position)."\" size=\"32\" maxlength=\"32\" />
".i18n("Phone (Work)")."phonework)."\" size=\"16\" maxlength=\"16\" />
".i18n("Phone (Cell)")."phonecell)."\" size=\"16\" maxlength=\"16\" />
".i18n("Phone (Home)")."phonehome)."\" size=\"16\" maxlength=\"16\" />
".i18n("Fax")."fax)."\" size=\"16\" maxlength=\"16\" />
".i18n("Email")."email)."\" size=\"60\" maxlength=\"128\" />
".i18n("Notes")."
\n"; echo "
\n"; } else { echo "
"; echo "".i18n("Add New Contact to %1",array($award_sponsors_organization))."\n"; echo "
"; $q=mysql_query("SELECT * FROM award_contacts WHERE year='".$config['FAIRYEAR']."' AND award_sponsors_id='$award_sponsors_id' ORDER BY lastname,firstname"); if(mysql_num_rows($q)) { echo ""; echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo "\n"; while($r=mysql_fetch_object($q)) { echo "\n"; echo " \n"; echo " "; echo " \n"; echo " \n"; echo " \n"; echo "\n"; } echo "
".i18n("Name")."".i18n("Email")."".i18n("Phone (Work)")."".i18n("Phone (Cell)")."Actions
"; if($r->salutation) echo $r->salutation." "; echo "$r->firstname $r->lastname"; if($r->email) { list($eb,$ea)=split("@",$r->email); echo ""; } else echo " "; echo "$r->phonework$r->phonecell"; echo "id\">"; echo " "; echo "id\">"; echo "
\n"; } } } send_footer(); ?>