function judges_scheduler_check_timeslots() { global $config; $q=mysql_query("SELECT * FROM judges_timeslots WHERE ". " year='".$config['FAIRYEAR']."'". " AND allowdivisional='yes'" ); $rows = mysql_num_rows($q); return $rows; } function judges_scheduler_check_awards() { global $config; $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"); while($r=mysql_fetch_object($q)) $cat[$r->id]=$r->category; $dkeys = array_keys($div); $ckeys = array_keys($cat); $missing_awards = array(); foreach($dkeys as $d) { reset($ckeys); foreach ($ckeys as $c) { $q=mysql_query("SELECT award_awards.id FROM award_awards, award_awards_projectcategories, award_awards_projectdivisions WHERE award_awards.year='{$config['FAIRYEAR']}' AND award_awards_projectcategories.year='{$config['FAIRYEAR']}' AND award_awards_projectdivisions.year='{$config['FAIRYEAR']}' AND award_awards.id=award_awards_projectcategories.award_awards_id AND award_awards.id=award_awards_projectdivisions.award_awards_id AND award_awards_projectcategories.projectcategories_id='$c' AND award_awards_projectdivisions.projectdivisions_id='$d' AND award_awards.award_types_id='1' "); echo mysql_error(); if(mysql_num_rows($q)!=1) { $missing_awards[] = "{$cat[$c]} - {$div[$d]}"; } } } return $missing_awards; } function judges_scheduler_check_jdivs() { global $config; $q=mysql_query("SELECT DISTINCT jdiv_id FROM judges_jdiv "); $rows = mysql_num_rows($q); return $rows; } function judges_scheduler_check_judges() { global $config; $ok = 1; $data = judges_scheduler_load_config(); $jdiv = array(); $q=mysql_query("SELECT * FROM judges_jdiv"); while($r=mysql_fetch_object($q)) { $d = $r->projectdivisions_id; $c = $r->projectcategories_id; $l = $r->lang; $qp = mysql_query("SELECT COUNT(id) as cnt FROM projects WHERE ". " year='".$config['FAIRYEAR']."' AND ". " projectdivisions_id='$d' AND ". " projectcategories_id='$c' AND ". " language='$l' " ); $qr = mysql_fetch_object($qp); $jdiv[$r->jdiv_id]['num_projects'] += $qr->cnt; } $totalteams = 0; print("
". " | ".i18n("Projects")." | ". "".i18n("Required Teams")." | Judging Division Group $jdiv_id | $c | $t | "); } print("
---|