diff --git a/admin/reports_students.inc.php b/admin/reports_students.inc.php index 7f7d670..e552426 100644 --- a/admin/reports_students.inc.php +++ b/admin/reports_students.inc.php @@ -264,13 +264,20 @@ $report_students_fields = array( 'large' => 'Large', 'xlarge' => 'X-Large')), 'awards' => array( - 'name' => 'Awards (warning: duplicates student for multiple awards!)', + 'name' => 'Award -- Type + Name (warning: duplicates student for multiple awards!)', 'header' => 'Award Name', 'width' => 4, 'table' => "CONCAT(IF(award_types.type='Other','Special',award_types.type),' ', award_awards.name)", - 'table_sort' => 'award_awards.order', + 'table_sort' => 'award_awards.name', 'components' => array('awards')), + 'award_name' => array( + 'name' => 'Award -- Name', + 'header' => 'Award Name', + 'width' => 4, + 'table' => 'award_awards.name', + 'components' => array('awards')), + 'order' => array( 'name' => 'Award -- Order', 'header' => 'Award Order', @@ -279,6 +286,13 @@ $report_students_fields = array( 'table_sort' => 'award_awards.order', 'components' => array('awards')), + 'award_type' => array( + 'name' => 'Award -- Type (Divisional, Special, etc.)', + 'header' => 'Award Type', + 'width' => 1, + 'table' => 'award_types.type', + 'components' => array('awards')), + 'sponsor' => array( 'name' => 'Award -- Sponsor DB ID', 'header' => 'Award Sponsor', @@ -295,6 +309,21 @@ $report_students_fields = array( 'table_sort' => 'award_awards.order', 'components' => array('awards')), + 'award_prize_name' => array( + 'name' => 'Award -- Prize Name', + 'header' => 'Prize Name', + 'width' => 2, + 'table' => 'award_prizes.prize', + 'components' => array('awards')), + + 'award_prize_fullname' => array( + 'name' => 'Award -- Prize Name, Category, Division', + 'header' => 'Prize Name', + 'width' => 4, + 'table' => "CONCAT(award_prizes.prize,' in ',projectcategories.category,' ', projectdivisions.division)", + 'table_sort' => 'award_awards.category', + 'components' => array('awards')), + 'nom_awards' => array( 'name' => 'Award Nominations -- Award Name (warning: duplicates student for multiple awards!)', 'header' => 'Award Name', @@ -352,6 +381,13 @@ $report_students_fields = array( 'table' => "CONCAT(emergencycontact.phone1, ' ', emergencycontact.phone2, ' ', emergencycontact.phone3, ' ', emergencycontact.phone4)", 'components' => array('emergencycontacts')), + 'tour_assign_name' => array( + 'name' => 'Tours -- Assigned Tour Name', + 'header' => 'Tour', + 'width' => 4, + 'table' => "tours.name", + 'components' => array('tours')), + 'fair_year' => array ( 'name' => 'Fair -- Year', 'header' => 'Year', @@ -419,6 +455,15 @@ $report_students_fields = array( AND students2.id != students.id)"; } + $tour_join = ''; + $tour_where = ''; + if(in_array('tours', $components)) { + $tour_join = "LEFT JOIN tours_choice ON (students.id=tours_choice.students_id AND tours_choice.rank=0), tours"; + $tour_where = "AND tours.year='$year' + AND tours.id=tours_choice.tour_id"; + + } + $emergencycontact_join = ''; if(in_array('emergencycontacts', $components)) { /* No need to put the year in here, students.id is unique across years */ @@ -431,6 +476,7 @@ $report_students_fields = array( schools, projects $awards_join, projectdivisions, projectcategories, registrations $emergencycontact_join + $tour_join WHERE schools.id=students.schools_id AND projects.registrations_id=students.registrations_id @@ -444,6 +490,7 @@ $report_students_fields = array( AND projectcategories.year='$year' AND projectdivisions.year='$year' $awards_where + $tour_where "; return $q;