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. */ ?> 'committee_main.php', 'SFIAB Configuration' => 'config/index.php', 'Age Categories' => 'config/categories.php'),"project_age_categories"); } else { send_header("Age Categories", array('Committee Main' => 'committee_main.php', 'SFIAB Configuration' => 'config/index.php'),"project_age_categories"); } if($_POST['action']=="edit") { //ues isset($_POST['mingrade']) instead of just $_POST['mingrade'] to allow entering 0 for kindergarden if($_POST['id'] && $_POST['category'] && isset($_POST['mingrade']) && $_POST['maxgrade']) { $q=mysql_query("SELECT id FROM projectcategories WHERE id='".intval($_POST['id'])."' AND conferences_id='".$conference['id']."'"); echo mysql_error(); if(mysql_num_rows($q) && $_POST['saveid']!=$_POST['id']) { echo error(i18n("Category ID %1 already exists",array($_POST['id']),array("category ID"))); } else { mysql_query("UPDATE projectcategories SET ". "id='".intval($_POST['id'])."', ". "category='".mysql_real_escape_string($_POST['category'])."', ". "category_shortform='".mysql_real_escape_string($_POST['category_shortform'])."', ". "mingrade='".intval($_POST['mingrade'])."', ". "maxgrade='".intval($_POST['maxgrade'])."' ". "WHERE id='".intval($_POST['saveid'])."'"); echo happy(i18n("Category successfully saved")); } } else { echo error(i18n("All fields are required")); } } if($_POST['action']=="new") { //ues isset($_POST['mingrade']) instead of just $_POST['mingrade'] to allow entering 0 for kindergarden if($_POST['id'] && $_POST['category'] && isset($_POST['mingrade']) && $_POST['maxgrade']) { $q=mysql_query("SELECT id FROM projectcategories WHERE id='".intval($_POST['id'])."' AND conferences_id='".$conference['id']."'"); if(mysql_num_rows($q)) { echo error(i18n("Category ID %1 already exists",array($_POST['id']),array("category ID"))); } else { mysql_query("INSERT INTO projectcategories (id,category,category_shortform,mingrade,maxgrade,conferences_id) VALUES ( ". "'".intval($_POST['id'])."', ". "'".mysql_real_escape_string($_POST['category'])."', ". "'".mysql_real_escape_string($_POST['category_shortform'])."', ". "'".intval($_POST['mingrade'])."', ". "'".intval($_POST['maxgrade'])."', ". "'".$conference['id']."')"); echo happy(i18n("Category successfully added")); } } else { echo error(i18n("All fields are required")); } } if($_GET['action']=="remove" && $_GET['remove']) { //###### Feature Specific - filtering divisions by category - not conditional, cause even if they have the filtering turned off..if any links //for this division exist they should be deleted mysql_query("DELETE FROM projectcategoriesdivisions_link where projectcategories_id='".intval($_GET['remove'])."' AND conferences_id='".$conference['id']."'"); //#### mysql_query("DELETE FROM projectcategories WHERE id='".intval($_GET['remove'])."' AND conferences_id='".$conference['id']."'"); echo happy(i18n("Category successfully removed")); } echo "
"; if(! ($_GET['action']=="edit" || $_GET['action']=="new") ) echo "".i18n("Add new age category")."\n"; echo ""; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; if($_GET['action']=="edit" || $_GET['action']=="new") { echo "\n"; if($_GET['action']=="edit") { echo "\n"; $q=mysql_query("SELECT * FROM projectcategories WHERE id='".$_GET['edit']."' AND conferences_id='".$conference['id']."'"); $categoryr=mysql_fetch_object($q); $buttontext="Save"; } else if($_GET['action']=="new") { $buttontext="Add"; } echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo ""; } else { $q=mysql_query("SELECT * FROM projectcategories WHERE conferences_id='".$conference['id']."' ORDER BY mingrade"); while($r=mysql_fetch_object($q)) { echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo ""; } } echo "
".i18n("Category ID")."".i18n("Category Name")."".i18n("Shortform")."".i18n("Minimum Grade")."".i18n("Maximum Grade")."".i18n("Actions")."
id\">category)."\">category_shortform)."\">mingrade\">maxgrade\">
$r->id".i18n($r->category)."".i18n($r->category_shortform)."$r->mingrade$r->maxgrade"; echo "id\">"; echo "   "; echo "id\">"; echo "
"; echo "
"; echo i18n("You should assign the 'Category ID's in numerical order, starting with 1. This Category ID is used to generate the project number"); send_footer(); ?>