<< ".i18n("Back to Configuration")."
"; if($_POST['action']=="edit") { if($_POST['id'] && $_POST['category'] && $_POST['mingrade'] && $_POST['maxgrade']) { $q=mysql_query("SELECT id FROM projectcategories WHERE id='".$_POST['id']."'"); if(mysql_num_rows($q) && $_POST['saveid']!=$_POST['id']) { echo error(i18n("Category ID %1 already exists",array($_POST['id']))); } else { mysql_query("UPDATE projectcategories SET ". "id='".$_POST['id']."', ". "category='".mysql_escape_string(stripslashes($_POST['category']))."', ". "mingrade='".$_POST['mingrade']."', ". "maxgrade='".$_POST['maxgrade']."' ". "WHERE id='".$_POST['saveid']."'"); echo happy(i18n("Category successfully saved")); } } else { echo error(i18n("All fields are required")); } } if($_POST['action']=="new") { if($_POST['id'] && $_POST['category'] && $_POST['mingrade'] && $_POST['maxgrade']) { $q=mysql_query("SELECT id FROM projectcategories WHERE id='".$_POST['id']."'"); if(mysql_num_rows($q)) { echo error(i18n("Category ID %1 already exists",array($_POST['id']))); } else { mysql_query("INSERT INTO projectcategories (id,category,mingrade,maxgrade) VALUES ( ". "'".$_POST['id']."', ". "'".mysql_escape_string(stripslashes($_POST['category']))."', ". "'".$_POST['mingrade']."', ". "'".$_POST['maxgrade']."')"); echo happy(i18n("Category successfully added")); } } else { echo error(i18n("All fields are required")); } } if($_GET['action']=="remove" && $_GET['remove']) { mysql_query("DELETE FROM projectcategories WHERE id='".$_GET['remove']."'"); echo happy(i18n("Category successfully removed")); } echo "
"; echo "

".i18n("Age Categories")."

"; 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 ""; 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']."'"); $categoryr=mysql_fetch_object($q); $buttontext="Save"; } else if($_GET['action']=="new") { $buttontext="Add"; } echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo ""; } else { $q=mysql_query("SELECT * FROM projectcategories ORDER BY mingrade"); while($r=mysql_fetch_object($q)) { echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo ""; } } echo "
".i18n("Category ID")."".i18n("Category Name")."".i18n("Minimum Grade")."".i18n("Maximum Grade")."".i18n("Actions")."
id\">category\">mingrade\">maxgrade\">
$r->id$r->category$r->mingrade$r->maxgrade"; echo "id\">"; echo "   "; echo "id\">"; echo "
"; echo "
"; send_footer(); ?>