diff --git a/config/categories.php b/config/categories.php index 6f3f6818..2ab9d69a 100644 --- a/config/categories.php +++ b/config/categories.php @@ -30,7 +30,8 @@ if($_POST['action']=="edit") { - if($_POST['id'] && $_POST['category'] && $_POST['mingrade'] && $_POST['maxgrade']) + //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='".$_POST['id']."' AND year='".$config['FAIRYEAR']."'"); echo mysql_error(); @@ -57,7 +58,8 @@ if($_POST['action']=="new") { - if($_POST['id'] && $_POST['category'] && $_POST['mingrade'] && $_POST['maxgrade']) + //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='".$_POST['id']."' AND year='".$config['FAIRYEAR']."'"); if(mysql_num_rows($q)) @@ -130,11 +132,11 @@ while($r=mysql_fetch_object($q)) { echo ""; - echo " $r->id"; + echo " $r->id"; echo " ".i18n($r->category).""; - echo " $r->mingrade"; - echo " $r->maxgrade"; - echo " "; + echo " $r->mingrade"; + echo " $r->maxgrade"; + echo " "; echo "id\">"; echo "   "; echo "id\">";