diff --git a/config/catdiv.php b/config/catdiv.php
deleted file mode 100644
index 0e188e5..0000000
--- a/config/catdiv.php
+++ /dev/null
@@ -1,10 +0,0 @@
-
- require("../common.inc.php");
- send_header("Configuration - Categories and Divisions");
-
- if($_POST['action']=="save")
- {
- }
-
- send_footer();
-?>
diff --git a/config/categories.php b/config/categories.php
new file mode 100644
index 0000000..18aed08
--- /dev/null
+++ b/config/categories.php
@@ -0,0 +1,122 @@
+
+ require("../common.inc.php");
+ send_header("Configuration - Categories and Divisions");
+ echo "<< ".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 "