Check for special award timeslots if the scheduler is configured to

schedule special award judges
This commit is contained in:
dave 2010-03-26 06:03:31 +00:00
parent 9afcd82523
commit 5052234670
2 changed files with 27 additions and 0 deletions

View File

@ -70,6 +70,16 @@ if($config['judge_scheduler_percent']=="-1")
$ok = 0;
}
if($config['scheduler_enable_sa_scheduling'] == 'yes') {
$timeslots = judges_scheduler_check_timeslots_sa();
if($timeslots > 0) {
echo happy(i18n("There are %1 timeslot(s) defined for special awards judging, good", array($timeslots)));
} else {
echo error(i18n("There are no timeslots defined for special awards judging (but the scheduler is configured to do special awards judigng)"));
$ok = 0;
}
}
echo "<table class='headertable'><tr><td><h3>Awards</h3></td>";
echo "<td> - <a href=\"awards.php\">".i18n("Awards Manager")."</a>";
echo "</td></tr></table>";

View File

@ -16,6 +16,23 @@ function judges_scheduler_check_timeslots()
return 0;
}
function judges_scheduler_check_timeslots_sa()
{
global $config;
$rows = 0;
$q=mysql_query("SELECT * FROM judges_timeslots WHERE ".
" year='".$config['FAIRYEAR']."'".
" AND `type`='special'" );
if(mysql_num_rows($q)) {
while(( $round=mysql_fetch_object($q))) {
$rq=mysql_query("SELECT * FROM judges_timeslots WHERE round_id='$round->id' AND type='timeslot'");
$rows += mysql_num_rows($rq);
}
}
return $rows;
}
function judges_scheduler_check_awards()
{
global $config;