diff --git a/admin/reports_judges.inc.php b/admin/reports_judges.inc.php index c4c720e..b0a8ee4 100644 --- a/admin/reports_judges.inc.php +++ b/admin/reports_judges.inc.php @@ -81,31 +81,44 @@ $report_judges_fields = array( 'table' => 'judges.postalcode' ), 'phone_home' => array( - 'name' => 'Judges -- Phone (Home)', + 'name' => 'Judge -- Phone (Home)', 'header' => 'Phone(Home)', 'width' => 1, 'table' => 'judges.phonehome'), 'phone_work' => array( - 'name' => 'Judges -- Phone (Work)', + 'name' => 'Judge -- Phone (Work)', 'header' => 'Phone(Work)', 'width' => 1.25, 'table' => "CONCAT(judges.phonework, ' ', judges.phoneworkext)"), 'organization' => array( - 'name' => 'Judges -- Organization', + 'name' => 'Judge -- Organization', 'header' => 'Organization', 'width' => 2, 'table' => 'judges.organization'), 'languages' => array( - 'name' => 'Judges -- Languages (REQUIRES MySQL 5.0)', + 'name' => 'Judge -- Languages (REQUIRES MySQL 5.0)', 'header' => 'Lang', 'width' => 0.75, 'table' => "GROUP_CONCAT(judges_languages.languages_lang ORDER BY judges_languages.languages_lang SEPARATOR ' ')", 'group_by' => array('judges.id'), 'components' => array('languages')), + 'complete' => array( + 'name' => 'Judge -- Registration Complete', + 'header' => 'Complete', + 'width' => 0.5, + 'table' => 'judges.complete', + 'value_map' => array ('no' => 'No', 'yes' => 'Yes')), + + 'year' => array( + 'name' => 'Judge -- Year', + 'header' => 'Year', + 'width' => 0.5, + 'table' => 'judges_years.year'), + 'captain' => array( 'name' => 'Judge Team -- Captain?', 'header' => 'Cptn', @@ -128,13 +141,6 @@ $report_judges_fields = array( 'table' => 'judges_teams.num', 'components' => array('teams')), - 'complete' => array( - 'name' => 'Judge -- Registration Complete', - 'header' => 'Complete', - 'width' => 0.5, - 'table' => 'judges.complete', - 'value_map' => array ('no' => 'No', 'yes' => 'Yes')), - 'project_pn' => array( 'name' => 'Project -- Number', 'header' => 'Number', @@ -247,6 +253,16 @@ $report_judges_fields = array( $students_from = "LEFT JOIN students ON students.registrations_id=projects.registrations_id"; $students_where = "AND students.year='$year'"; } + + /* Search the report for a filter based on judge year */ + $year_where = "judges_years.year='$year'"; + foreach($report['filter'] as $d) { + if($d['field'] == 'year') { + /* Don't interally filter on year, we'll do it + * externally */ + $year_where = '1'; + } + } $q = " FROM judges LEFT JOIN judges_years ON judges_years.judges_id = judges.id @@ -255,7 +271,7 @@ $report_judges_fields = array( $projects_from $students_from WHERE - judges_years.year='$year' + $year_where $teams_where $projects_where $students_where