diff --git a/register_judges.inc.php b/register_judges.inc.php index 2ec97a5..eb9603e 100644 --- a/register_judges.inc.php +++ b/register_judges.inc.php @@ -56,6 +56,19 @@ function personalStatus() $r=mysql_fetch_object($q); if($r->num==0) return "incomplete"; + + //and they need to rank all of the age categories + $q=mysql_query("SELECT COUNT(id) AS num FROM projectcategories WHERE year='".$config['FAIRYEAR']."'"); + $r=mysql_fetch_object($q); + $numcats=$r->num; + + $q=mysql_query("SELECT COUNT(id) AS num FROM judges_catpref WHERE year='".$config['FAIRYEAR']."' AND judges_id='".$_SESSION['judges_id']."'"); + $r=mysql_fetch_object($q); + $numprefs=$r->num; + + if($numcats!=$numprefs) + return "incomplete"; + //if it made it through without returning incomplete, then we must be complete diff --git a/register_judges_personal.php b/register_judges_personal.php index 7ecef49..dc426b9 100644 --- a/register_judges_personal.php +++ b/register_judges_personal.php @@ -33,12 +33,6 @@ if($_POST['action']=="save") { -/* if($_POST['catpref']) $catpref="'".$_POST['catpref']."'"; - else $catpref="null"; - if($_POST['divpref']) $divpref="'".$_POST['divpref']."'"; - else $divpref="null"; -*/ - mysql_query("UPDATE judges SET ". "firstname='".mysql_escape_string(stripslashes($_POST['firstname']))."', ". "lastname='".mysql_escape_string(stripslashes($_POST['lastname']))."', ". @@ -80,7 +74,8 @@ { foreach($_POST['catpref'] AS $k=>$v) { - mysql_query("INSERT INTO judges_catpref (judges_id,projectcategories_id,rank,year) values ('".$_SESSION['judges_id']."','$k','$v','".$config['FAIRYEAR']."')"); + if($v!="") + mysql_query("INSERT INTO judges_catpref (judges_id,projectcategories_id,rank,year) values ('".$_SESSION['judges_id']."','$k','$v','".$config['FAIRYEAR']."')"); } } @@ -157,12 +152,13 @@ while($r=mysql_fetch_object($q)) echo ""; echo "