diff --git a/admin/judges_sa.php b/admin/judges_sa.php index d5ad4848..5dae4951 100644 --- a/admin/judges_sa.php +++ b/admin/judges_sa.php @@ -380,6 +380,16 @@ while($r=mysql_fetch_object($q)) unset($catprefs); unset($langprefs); + /* Try to fetch a team link ID for this judge, if we can, we don't want to use this judge + * in the divisional awards, they are already assigned to soemthing */ + $q2 = mysql_query("SELECT judges_id FROM judges_teams_link WHERE ". + "judges_id='$r->id' ". + " AND year='".$config['FAIRYEAR']."'"); + if(mysql_num_rows($q2) != 0) { + TRACE("Judge [{$r->firstname} {$r->lastname}] is already on a judging team, skipping.\n"); + continue; + } + //get category preferences $q2=mysql_query("SELECT * FROM judges_catpref WHERE judges_id='$r->id' AND year='".$config['FAIRYEAR']."' ORDER BY projectcategories_id"); $catprefs=array();