forked from science-ation/science-ation
- Add assigned tour to the report generator
- Add prize names to the report generator - Change award name to sort by name, if you want to sort by order, use the Award--Order column. (Specifying a sort by prize name, and it actually sorting by order doesn't make sense)
This commit is contained in:
parent
3f8d70d47d
commit
9c1a16acc2
@ -264,11 +264,18 @@ $report_students_fields = array(
|
|||||||
'large' => 'Large', 'xlarge' => 'X-Large')),
|
'large' => 'Large', 'xlarge' => 'X-Large')),
|
||||||
|
|
||||||
'awards' => array(
|
'awards' => array(
|
||||||
'name' => 'Awards (warning: duplicates student for multiple awards!)',
|
'name' => 'Award -- Type + Name (warning: duplicates student for multiple awards!)',
|
||||||
'header' => 'Award Name',
|
'header' => 'Award Name',
|
||||||
'width' => 4,
|
'width' => 4,
|
||||||
'table' => "CONCAT(IF(award_types.type='Other','Special',award_types.type),' ', award_awards.name)",
|
'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')),
|
'components' => array('awards')),
|
||||||
|
|
||||||
'order' => array(
|
'order' => array(
|
||||||
@ -279,6 +286,13 @@ $report_students_fields = array(
|
|||||||
'table_sort' => 'award_awards.order',
|
'table_sort' => 'award_awards.order',
|
||||||
'components' => array('awards')),
|
'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(
|
'sponsor' => array(
|
||||||
'name' => 'Award -- Sponsor DB ID',
|
'name' => 'Award -- Sponsor DB ID',
|
||||||
'header' => 'Award Sponsor',
|
'header' => 'Award Sponsor',
|
||||||
@ -295,6 +309,21 @@ $report_students_fields = array(
|
|||||||
'table_sort' => 'award_awards.order',
|
'table_sort' => 'award_awards.order',
|
||||||
'components' => array('awards')),
|
'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(
|
'nom_awards' => array(
|
||||||
'name' => 'Award Nominations -- Award Name (warning: duplicates student for multiple awards!)',
|
'name' => 'Award Nominations -- Award Name (warning: duplicates student for multiple awards!)',
|
||||||
'header' => 'Award Name',
|
'header' => 'Award Name',
|
||||||
@ -352,6 +381,13 @@ $report_students_fields = array(
|
|||||||
'table' => "CONCAT(emergencycontact.phone1, ' ', emergencycontact.phone2, ' ', emergencycontact.phone3, ' ', emergencycontact.phone4)",
|
'table' => "CONCAT(emergencycontact.phone1, ' ', emergencycontact.phone2, ' ', emergencycontact.phone3, ' ', emergencycontact.phone4)",
|
||||||
'components' => array('emergencycontacts')),
|
'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 (
|
'fair_year' => array (
|
||||||
'name' => 'Fair -- Year',
|
'name' => 'Fair -- Year',
|
||||||
'header' => 'Year',
|
'header' => 'Year',
|
||||||
@ -419,6 +455,15 @@ $report_students_fields = array(
|
|||||||
AND students2.id != students.id)";
|
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 = '';
|
$emergencycontact_join = '';
|
||||||
if(in_array('emergencycontacts', $components)) {
|
if(in_array('emergencycontacts', $components)) {
|
||||||
/* No need to put the year in here, students.id is unique across years */
|
/* 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,
|
schools, projects $awards_join, projectdivisions,
|
||||||
projectcategories, registrations
|
projectcategories, registrations
|
||||||
$emergencycontact_join
|
$emergencycontact_join
|
||||||
|
$tour_join
|
||||||
WHERE
|
WHERE
|
||||||
schools.id=students.schools_id
|
schools.id=students.schools_id
|
||||||
AND projects.registrations_id=students.registrations_id
|
AND projects.registrations_id=students.registrations_id
|
||||||
@ -444,6 +490,7 @@ $report_students_fields = array(
|
|||||||
AND projectcategories.year='$year'
|
AND projectcategories.year='$year'
|
||||||
AND projectdivisions.year='$year'
|
AND projectdivisions.year='$year'
|
||||||
$awards_where
|
$awards_where
|
||||||
|
$tour_where
|
||||||
";
|
";
|
||||||
|
|
||||||
return $q;
|
return $q;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user