From 537fdb2139209afab9b9562d03ea5cb02ced4e1f Mon Sep 17 00:00:00 2001 From: james Date: Wed, 23 Feb 2005 22:03:56 +0000 Subject: [PATCH] Add awards subsystem Add award sponsors --- admin/award_sponsors.php | 185 +++++++++++++++++++++++++++++++++++++++ admin/awards.php | 37 ++++++++ admin/index.php | 3 + 3 files changed, 225 insertions(+) create mode 100644 admin/award_sponsors.php create mode 100644 admin/awards.php diff --git a/admin/award_sponsors.php b/admin/award_sponsors.php new file mode 100644 index 0000000..aefb148 --- /dev/null +++ b/admin/award_sponsors.php @@ -0,0 +1,185 @@ + + 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"; + + if($_POST['save']=="edit" || $_POST['save']=="add") + { + if($_POST['save']=="add") + { + $q=mysql_query("INSERT INTO award_sponsors (year) VALUES ('".$config['FAIRYEAR']."')"); + $id=mysql_insert_id(); + } + else + $id=$_POST['id']; + + + $exec="UPDATE award_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']))."', ". + "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("Sponsor successfully added"); + else + echo happy("Successfully saved changes to sponsor"); + } + + if($_GET['action']=="delete" && $_GET['delete']) + { + mysql_query("DELETE FROM award_sponsors WHERE id='".$_GET['delete']."'"); + echo happy("Sponsor successfully deleted"); + } + + if($_GET['action']=="confirm" && $_GET['confirm']) + { + mysql_query("UPDATE award_sponsors SET confirmed='yes' WHERE id='".$_GET['confirm']."'"); + echo happy("Sponsor successfully confirmed"); + + } + if($_GET['action']=="unconfirm" && $_GET['unconfirm']) + { + mysql_query("UPDATE award_sponsors SET confirmed='no' WHERE id='".$_GET['unconfirm']."'"); + echo happy("Sponsor successfully unconfirmed"); + } + + if($_GET['action']=="edit" || $action=="add") + { + + echo "<< ".i18n("Back to Award Sponsors")."\n"; + if($_GET['action']=="edit") + { + echo "

".i18n("Edit Award Sponsor")."

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

".i18n("Add New Award Sponsor")."

\n"; + $buttontext="Add Sponsor"; + } + $buttontext=i18n($buttontext); + + 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 "
".i18n("Organization Name")."organization)."\" size=\"60\" maxlength=\"128\" />
".i18n("Address")."address)."\" size=\"60\" maxlength=\"64\" />
".i18n("City")."city)."\" size=\"32\" maxlength=\"32\" />
".i18n("Province").""; + emit_province_selector("province_code",$r->province_code); + echo "
".i18n("Postal Code")."postalcode\" size=\"8\" maxlength=\"7\" />
".i18n("Phone")."phone)."\" 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 "Add New Sponsor\n"; + echo "
"; + echo ""; + echo ""; + echo " "; + echo " "; + echo " "; + echo " "; + echo "\n"; + + $q=mysql_query("SELECT * FROM award_sponsors WHERE year='".$config['FAIRYEAR']."' ORDER BY organization"); + while($r=mysql_fetch_object($q)) + { + echo "\n"; + echo "\n"; + echo " \n"; + + $numq=mysql_query("SELECT COUNT(id) AS num FROM award_awards WHERE id='$r->id'"); + $numr=mysql_fetch_object($numq); + $num=$numr->num; + $total=$numr->total; + + + echo " "; + echo " \n"; + echo "\n"; + } + + echo "
Confirmed?Organization# of AwardsAction
\n"; + if($r->confirmed=='yes') + { + echo "id\">\n"; + } + else + { + echo "id\">confirm"; + } + echo "$r->organization"; + echo "$num  "; + echo "id\">\"view\""; + echo ""; + echo "id\">"; + echo " "; + echo "id\">"; + + + echo "
\n"; + + + } + + send_footer(); + +?> diff --git a/admin/awards.php b/admin/awards.php new file mode 100644 index 0000000..35340b5 --- /dev/null +++ b/admin/awards.php @@ -0,0 +1,37 @@ + + 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 "
"; + echo "
"; + echo "Award Sponsors
"; + + send_footer(); + +?> diff --git a/admin/index.php b/admin/index.php index 6fb5308..196b8e4 100644 --- a/admin/index.php +++ b/admin/index.php @@ -26,9 +26,12 @@ auth_required('admin'); send_header("Administration"); + echo "
"; echo "Participant Registration
"; echo "Print / Export Reports
"; + echo "
"; echo "Committee Management
"; + echo "Awards Management
"; send_footer(); ?>