$divq=mysql_query("SELECT projectdivisions.* FROM projectdivisions,projectcategoriesdivisions_link WHERE projectdivisions.year='{$config['FAIRYEAR']}' AND projectcategoriesdivisions_link.projectcategories_id='$catr->id' AND projectcategoriesdivisions_link.projectdivisions_id=projectdivisions.id AND projectcategoriesdivisions_link.year='".$config['FAIRYEAR']."' ORDER BY id");
else
$divq=mysql_query("SELECT * FROM projectdivisions WHERE year='{$config['FAIRYEAR']}' ORDER BY id");
$langq=mysql_query("SELECT * FROM languages WHERE active='Y'");
while($langr=mysql_fetch_object($langq))
{
$numq=mysql_query("SELECT COUNT(id) AS num FROM projects WHERE projectcategories_id='$catr->id' AND projectdivisions_id='$divr->id' AND year='{$config['FAIRYEAR']}' AND language='$langr->lang'");
echo"Minimum number of judges required: $minjudges";
echo"<br />";
echo"Maximum number of judges acceptable: $maxjudges";
echo"<br />";
$jq=mysql_query("SELECT COUNT(judges.id) AS num FROM judges,judges_years WHERE complete='yes' AND judges_years.year='{$config['FAIRYEAR']}' AND judges_years.judges_id=judges.id");
$jr=mysql_fetch_object($jq);
$currentjudges=$jr->num;
echo"Current number of registered judges: $currentjudges";
echo"<br />";
echo"<br />";
$ok=true;
if($currentjudges<$minjudges)
{
echoerror(i18n("You do not have sufficient number of judges based on your parameters"));
echo" ";
echo"<a href=\"judges_schedulerconfig.php\">".i18n("Update Scheduler Configuration")."</a> (".i18n("or get more judges!").")";
$ok=false;
}
else
echohappy(i18n("You have a sufficient number of judges based on your parameters"));
//now check if we can find a divisional award for each division and category
$q=mysql_query("SELECT * FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' ORDER BY id");
while($r=mysql_fetch_object($q))
$div[$r->id]=$r->division;
$q=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' ORDER BY id");
echoerror(i18n("You do not have enough judging timeslots available for divisional judging. Please create more timeslots first. Available: %1, Required: %2",array($numslots,$schedulerconfig['max_projects_per_team'])));