diff --git a/admin/reports_judges.php b/admin/reports_judges.php index b71139a..0f2f36c 100644 --- a/admin/reports_judges.php +++ b/admin/reports_judges.php @@ -99,6 +99,34 @@ while($r=mysql_fetch_object($q)) //now append the arrays together $table['header']=array_merge($table['header'],array_merge($catheadings,$divheadings)); + $times = array(); + $datetimeheadings=array(); + + /* Load the judging rounds */ + $q = mysql_query("SELECT date,starttime,endtime,name FROM judges_timeslots WHERE round_id='0' AND year='{$config['FAIRYEAR']}' ORDER BY starttime,type"); + $x = 0; + while($r = mysql_fetch_object($q)) { + $found = false; + foreach($times as $xx => $t) { + if($t['date'] == $r->date && $t['starttime'] == $r->starttime && $t['endtime'] == $r->endtime) { + $times[$xx]['name'] .= ", {$r->name}"; + $found = true; + break; + } + } + if(!$found) { + $times[$x] = array( 'date' => $r->date, + 'starttime' => $r->starttime, + 'endtime' => $r->endtime, + 'name' => $r->name); + $datetimeheadings[]=$r->name; + $x++; + } + } + +$table['header']=array_merge($table['header'],$datetimeheadings); + + //fill these in if we ever make this PDFable $table['widths']=array(); @@ -150,6 +178,32 @@ while($r=mysql_fetch_object($q)) { foreach($keys as $qid) { $qarray[] = $qans[$qid]; } + + + + + + + $tq = mysql_query("SELECT * FROM judges_availability WHERE users_id=\"".$r->id."\" ORDER BY `start`"); + + $sel = array(); + $timedata=array(); + while($tr=mysql_fetch_object($tq)) { + foreach($times as $x=>$t) { + if($tr->start == $t['starttime'] && $tr->end == $t['endtime'] && $tr->date == $t['date']) { + $sel[$x] = true; + } + } + } + + foreach($times as $x=>$t) { + if($sel[$x]==true) { + $timedata[]="yes"; + } else { + $timedata[]="no"; + } + } + $tmp=array( $r->id, @@ -175,7 +229,7 @@ while($r=mysql_fetch_object($q)) { $tmp = array_merge($tmp, $qarray); $extradata=array_merge($catdata,$divdata); - $table['data'][]=array_merge($tmp,$extradata); + $table['data'][]=array_merge(array_merge($tmp,$extradata),$timedata); } $rep->addTable($table);