Properly count the number of judges in each language to check if we have enough

This commit is contained in:
james 2010-01-08 20:25:40 +00:00
parent d8ba3da289
commit 591f46b29d

View File

@ -186,13 +186,15 @@ function judges_scheduler_check_judges()
$ok=false;
}
foreach($config['languages'] AS $lkey=>$lname) {
$jq=mysql_query("SELECT COUNT(judges.id) AS num FROM judges,judges_years,judges_languages WHERE complete='yes' AND deleted='no' AND judges_years.year='{$config['FAIRYEAR']}' AND judges_years.judges_id=judges.id AND judges_languages.languages_lang='$lkey' AND judges_languages.judges_id=judges.id");
echo mysql_error();
$jr=mysql_fetch_object($jq);
$currentjudges=$jr->num;
$lcount=0;
foreach($judges AS $j) {
foreach($j['languages'] AS $jlang) {
if($jlang==$lkey) $lcount++;
}
}
$currentjudges=$lcount;
echo "&nbsp;&nbsp;<b>".i18n("Current number of registered judges that can judge in %1: %2",array($lname,$currentjudges))."</b>";
echo "<br />";
if($currentjudges<$minjudges[$lkey]) {
@ -202,8 +204,6 @@ function judges_scheduler_check_judges()
}
if(!$ok) {
echo "&nbsp;&nbsp;";
echo "<a href=\"judges_schedulerconfig.php\">".i18n("Update Scheduler Configuration")."</a> (".i18n("or get more judges!").")";