2007-03-18 07:10:54 +00:00
|
|
|
<?
|
|
|
|
/*
|
|
|
|
This file is part of the 'Science Fair In A Box' project
|
|
|
|
SFIAB Website: http://www.sfiab.ca
|
|
|
|
|
|
|
|
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
|
|
|
|
Copyright (C) 2005 James Grant <james@lightbox.org>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public
|
|
|
|
License as published by the Free Software Foundation, version 2.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; see the file COPYING. If not, write to
|
|
|
|
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
$report_students_fields = array(
|
|
|
|
'pn' => array(
|
|
|
|
'name' => 'Project Number',
|
|
|
|
'header' => '#',
|
|
|
|
'width' => 0.5,
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'table' => 'CAST(projects.projectnumber AS UNSIGNED)' ),
|
2007-03-18 07:10:54 +00:00
|
|
|
|
|
|
|
'last_name' => array(
|
2007-03-19 06:51:44 +00:00
|
|
|
'name' => 'Student -- Last Name',
|
2007-03-18 07:10:54 +00:00
|
|
|
'header' => 'Last Name',
|
|
|
|
'width' => 1.0,
|
|
|
|
'table' => 'students.lastname' ),
|
|
|
|
|
|
|
|
'first_name' => array(
|
2007-03-19 06:51:44 +00:00
|
|
|
'name' => 'Student -- First Name',
|
2007-03-18 07:10:54 +00:00
|
|
|
'header' => 'First Name',
|
|
|
|
'width' => 1.0,
|
|
|
|
'table' => 'students.firstname' ),
|
|
|
|
|
|
|
|
'name' => array(
|
2007-03-19 06:51:44 +00:00
|
|
|
'name' => 'Student -- Full Name (last, first)',
|
2007-03-18 07:10:54 +00:00
|
|
|
'header' => 'Name',
|
|
|
|
'width' => 1.75,
|
|
|
|
'table' => "CONCAT(students.lastname, ', ', students.firstname)",
|
|
|
|
'table_sort'=> 'students.lastname' ),
|
|
|
|
|
2007-03-19 06:51:44 +00:00
|
|
|
'namefl' => array(
|
|
|
|
'name' => 'Student -- Full Name (first last)',
|
|
|
|
'header' => 'Name',
|
|
|
|
'width' => 1.75,
|
|
|
|
'table' => "CONCAT(students.firstname, ' ', students.lastname)",
|
|
|
|
'table_sort'=> 'students.lastname' ),
|
|
|
|
|
2007-03-18 07:10:54 +00:00
|
|
|
'partner' => array(
|
2007-03-19 06:51:44 +00:00
|
|
|
'name' => 'Student -- Partner Name',
|
2007-03-18 07:10:54 +00:00
|
|
|
'header' => 'Partner',
|
|
|
|
'width' => 1.5,
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'table' => "CONCAT(students2.lastname, ', ', students2.firstname)",
|
|
|
|
'components' => array('partner') ),
|
2007-03-18 07:10:54 +00:00
|
|
|
|
|
|
|
'bothnames' => array(
|
2007-03-19 06:51:44 +00:00
|
|
|
'name' => "Student -- Both Student Names",
|
2007-03-18 07:10:54 +00:00
|
|
|
'header' => 'Student(s)',
|
|
|
|
'width' => 3.0,
|
|
|
|
'table' => "CONCAT(students.firstname, ' ', students.lastname, IF(students2.lastname IS NULL,'', CONCAT(', ', students2.firstname, ' ', students2.lastname)))",
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'table_sort' => 'students.lastname',
|
|
|
|
'components' => array('partner') ),
|
2007-03-18 07:10:54 +00:00
|
|
|
|
|
|
|
'grade' => array(
|
2007-03-19 06:51:44 +00:00
|
|
|
'name' => 'Student -- Grade',
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'header' => 'Gr.',
|
|
|
|
'width' => 0.3,
|
2007-03-18 07:10:54 +00:00
|
|
|
'table' => 'students.grade'),
|
|
|
|
|
|
|
|
'gender' => array(
|
2007-03-19 06:51:44 +00:00
|
|
|
'name' => 'Student -- Gender',
|
2007-03-18 07:10:54 +00:00
|
|
|
'header' => 'Gender',
|
|
|
|
'width' => 0.5,
|
|
|
|
'table' => 'students.sex',
|
|
|
|
'value_map' =>array ('male' => 'Male', 'female' => 'Female')),
|
|
|
|
|
2007-03-18 07:24:52 +00:00
|
|
|
'birthdate' => array(
|
2007-03-19 06:51:44 +00:00
|
|
|
'name' => 'Student -- Birthdate',
|
2007-03-18 07:24:52 +00:00
|
|
|
'header' => 'Birthdate',
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'width' => 0.9,
|
2007-03-18 07:24:52 +00:00
|
|
|
'table' => 'students.dateofbirth'),
|
|
|
|
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'age' => array(
|
|
|
|
'name' => 'Student -- Age (when this report is created)',
|
|
|
|
'header' => 'Age',
|
|
|
|
'width' => 0.4,
|
|
|
|
'table' => "DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(students.dateofbirth)), '%Y')+0",
|
|
|
|
'table_sort' => 'students.dateofbirth'),
|
|
|
|
|
2007-03-18 07:10:54 +00:00
|
|
|
'title' => array(
|
2007-03-19 06:51:44 +00:00
|
|
|
'name' => 'Project -- Title',
|
2007-03-18 07:10:54 +00:00
|
|
|
'header' => 'Project Title',
|
|
|
|
'width' => 2.75,
|
|
|
|
'table' => 'projects.title' ),
|
|
|
|
|
|
|
|
'division' => array(
|
2007-03-19 06:51:44 +00:00
|
|
|
'name' => 'Project -- Division',
|
2007-03-18 07:10:54 +00:00
|
|
|
'header' => 'Division',
|
|
|
|
'width' => 3.0,
|
|
|
|
'table' => 'projectdivisions.division' ),
|
|
|
|
|
|
|
|
'div' => array(
|
2007-03-19 06:51:44 +00:00
|
|
|
'name' => 'Project -- Division Short Form' ,
|
2007-03-18 07:10:54 +00:00
|
|
|
'header' => 'Div',
|
|
|
|
'width' => 0.4,
|
|
|
|
'table' => 'projectdivisions.division_shortform' ),
|
|
|
|
|
|
|
|
'category' => array(
|
2007-03-19 06:51:44 +00:00
|
|
|
'name' => 'Project -- Category',
|
2007-03-18 07:10:54 +00:00
|
|
|
'header' => 'Category',
|
|
|
|
'width' => 1,
|
|
|
|
'table_sort' => 'projectcategories.id',
|
|
|
|
'table' => 'projectcategories.category' ),
|
|
|
|
|
|
|
|
'categorydivision' => array(
|
2007-03-19 06:51:44 +00:00
|
|
|
'name' => 'Project -- Category and Division',
|
2007-03-18 07:10:54 +00:00
|
|
|
'header' => 'Category/Division',
|
|
|
|
'width' => 3.5,
|
|
|
|
'table_sort' => 'projectcategories.id',
|
2007-03-19 06:51:44 +00:00
|
|
|
'table' => "CONCAT(projectcategories.category,' - ', projectdivisions.division)"),
|
2007-03-18 07:10:54 +00:00
|
|
|
|
|
|
|
'address' => array(
|
|
|
|
'name' => 'Student Address -- Street Address',
|
|
|
|
'header' => 'Address',
|
|
|
|
'width' => 2.0,
|
|
|
|
'table' => 'students.address'),
|
|
|
|
|
|
|
|
'city' => array(
|
|
|
|
'name' => 'Student Address -- City',
|
|
|
|
'header' => 'City',
|
|
|
|
'width' => 1.5,
|
|
|
|
'table' => 'students.city' ),
|
|
|
|
|
|
|
|
'province' => array(
|
|
|
|
'name' => 'Student Address -- Province',
|
|
|
|
'header' => 'Province',
|
|
|
|
'width' => 0.75,
|
|
|
|
'table' => 'students.province' ),
|
|
|
|
|
|
|
|
'postal' => array(
|
|
|
|
'name' => 'Student Address -- Postal Code',
|
|
|
|
'header' => 'Postal',
|
|
|
|
'width' => 0.75,
|
|
|
|
'table' => 'students.postalcode' ),
|
|
|
|
|
|
|
|
'school' => array(
|
|
|
|
'name' => 'School -- Name',
|
|
|
|
'header' => 'School Name',
|
|
|
|
'width' => 2.25,
|
|
|
|
'table' => 'schools.school' ),
|
|
|
|
|
|
|
|
'schooladdr' => array(
|
|
|
|
'name' => 'School -- Full Address',
|
|
|
|
'header' => 'School Address',
|
|
|
|
'width' => 3.0,
|
|
|
|
'table' => "CONCAT(schools.address, ', ', schools.city, ', ', schools.province_code, ', ', schools.postalcode)" ),
|
|
|
|
|
|
|
|
'teacher' => array(
|
|
|
|
'name' => 'School -- Teacher Name',
|
|
|
|
'header' => 'Teacher',
|
|
|
|
'width' => 1.5,
|
|
|
|
'table' => 'students.teachername' ),
|
|
|
|
|
|
|
|
'teacheremail' => array(
|
|
|
|
'name' => 'School -- Teacher Email',
|
|
|
|
'header' => 'Teacher Email',
|
|
|
|
'width' => 2.0,
|
|
|
|
'table' => 'students.teacheremail' ),
|
|
|
|
|
|
|
|
'school_phone' => array(
|
|
|
|
'name' => 'School -- Phone',
|
|
|
|
'header' => 'School Phone',
|
|
|
|
'width' => 1,
|
|
|
|
'table' => 'schools.phone' ),
|
|
|
|
|
|
|
|
'school_fax' => array(
|
|
|
|
'name' => 'School -- Fax',
|
|
|
|
'header' => 'School Fax',
|
|
|
|
'width' => 1,
|
|
|
|
'table' => 'schools.fax' ),
|
|
|
|
|
2007-03-20 06:24:18 +00:00
|
|
|
|
|
|
|
'school_address' => array(
|
|
|
|
'name' => 'School Address -- Street Address',
|
|
|
|
'header' => 'Address',
|
|
|
|
'width' => 2.0,
|
|
|
|
'table' => 'schools.address'),
|
|
|
|
|
|
|
|
'school_city' => array(
|
|
|
|
'name' => 'School Address -- City',
|
|
|
|
'header' => 'City',
|
|
|
|
'width' => 1.5,
|
|
|
|
'table' => 'schools.city' ),
|
|
|
|
|
|
|
|
'school_province' => array(
|
|
|
|
'name' => 'School Address -- Province',
|
|
|
|
'header' => 'Province',
|
|
|
|
'width' => 0.75,
|
|
|
|
'table' => 'schools.province_code' ),
|
|
|
|
|
|
|
|
'school_city_prov' => array(
|
|
|
|
'name' => 'School Address -- City, Province (for mailing)',
|
|
|
|
'header' => 'City',
|
|
|
|
'width' => 1.5,
|
|
|
|
'table' => "CONCAT(schools.city, ', ', schools.province_code)" ),
|
|
|
|
|
|
|
|
'school_postal' => array(
|
|
|
|
'name' => 'School Address -- Postal Code',
|
|
|
|
'header' => 'Postal',
|
|
|
|
'width' => 0.75,
|
|
|
|
'table' => 'schools.postalcode' ),
|
|
|
|
|
2007-03-26 01:54:18 +00:00
|
|
|
'school_board' => array(
|
|
|
|
'name' => 'School -- Board ID',
|
|
|
|
'header' => 'Board',
|
|
|
|
'width' => 0.75,
|
|
|
|
'table' => 'schools.board' ),
|
2007-03-20 06:24:18 +00:00
|
|
|
|
2007-03-18 07:10:54 +00:00
|
|
|
'paid' => array(
|
|
|
|
'name' => 'Paid',
|
|
|
|
'header' => 'Paid',
|
|
|
|
'width' => '0.4',
|
|
|
|
'table' => 'registrations.status',
|
|
|
|
'value_map' => array ('complete' => '', 'paymentpending' => 'No')),
|
|
|
|
|
|
|
|
'tshirt' => array(
|
|
|
|
'name' => 'T-Shirt Size',
|
|
|
|
'header' => 'T-Shirt',
|
|
|
|
'width' => 0.55,
|
|
|
|
'table' => 'students.tshirt',
|
|
|
|
'value_map' => array ('none' => '', 'small' => 'Small', 'medium' => 'Medium',
|
|
|
|
'large' => 'Large', 'xlarge' => 'X-Large')),
|
|
|
|
|
|
|
|
'awards' => array(
|
|
|
|
'name' => 'Awards (warning: duplicates student for multiple awards!)',
|
|
|
|
'header' => 'Award Name',
|
|
|
|
'width' => 4,
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'table' => "CONCAT(IF(award_types.type='Other','Special',award_types.type),' ', award_awards.name)",
|
2007-03-26 01:54:18 +00:00
|
|
|
'table_sort' => 'award_awards.order',
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'components' => array('awards')),
|
2007-03-18 07:10:54 +00:00
|
|
|
|
2007-03-28 22:32:57 +00:00
|
|
|
'order' => array(
|
|
|
|
'name' => 'Award -- Order',
|
|
|
|
'header' => 'Award Order',
|
|
|
|
'width' => 0.5,
|
|
|
|
'table' => 'award_awards.order',
|
|
|
|
'table_sort' => 'award_awards.order',
|
|
|
|
'components' => array('awards')),
|
|
|
|
|
2007-03-18 07:10:54 +00:00
|
|
|
'pn_awards' => array(
|
|
|
|
'name' => 'Project Num + Award (will be unique)',
|
|
|
|
'header' => 'Award Name',
|
|
|
|
'width' => 4,
|
|
|
|
'table' => "CONCAT(projects.projectnumber,' ', award_awards.name)",
|
2007-03-26 01:54:18 +00:00
|
|
|
'table_sort' => 'award_awards.order',
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'components' => array('awards')),
|
2007-03-26 01:54:18 +00:00
|
|
|
|
|
|
|
'nom_awards' => array(
|
|
|
|
'name' => 'Award Nominations -- Award Name (warning: duplicates student for multiple awards!)',
|
|
|
|
'header' => 'Award Name',
|
|
|
|
'width' => 4,
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'table' => "CONCAT(award_types.type,' -- ',award_awards.name)",
|
|
|
|
'table_sort' => 'award_awards.name',
|
|
|
|
'components' => array('awards_nominations')),
|
2007-03-26 01:54:18 +00:00
|
|
|
|
|
|
|
'nom_pn_awards' => array(
|
|
|
|
'name' => 'Award Nominations -- Project Num + Award Name(will be unique)',
|
|
|
|
'header' => 'Award Name',
|
|
|
|
'width' => 4,
|
|
|
|
'table' => "CONCAT(projects.projectnumber,' ', award_awards.name)",
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'table_sort' => 'award_awards.name',
|
|
|
|
'components' => array('awards_nominations')),
|
2007-03-18 07:10:54 +00:00
|
|
|
|
|
|
|
'req_elec' => array(
|
|
|
|
'name' => 'If the project requires electricity',
|
|
|
|
'header' => 'Elec',
|
|
|
|
'width' => .5,
|
|
|
|
'table' => "projects.req_electricity",
|
|
|
|
'value_map' => array ('no' => '', 'yes' => 'Yes')),
|
|
|
|
|
|
|
|
'req_table' => array(
|
|
|
|
'name' => 'If the project requires a table',
|
|
|
|
'header' => 'Table',
|
|
|
|
'width' => .5,
|
|
|
|
'table' => "projects.req_table",
|
|
|
|
'value_map' => array ('no' => '', 'yes' => 'Yes')),
|
|
|
|
|
|
|
|
'req_special' => array(
|
|
|
|
'name' => 'Any special requirements the project has',
|
|
|
|
'header' => 'Special Requirements',
|
|
|
|
'width' => 3,
|
|
|
|
'table' => "projects.req_special"),
|
|
|
|
|
|
|
|
'emerg_name' => array(
|
|
|
|
'name' => 'Emergency Contact -- Name',
|
|
|
|
'header' => 'Emerg. Name',
|
|
|
|
'width' => 1.5,
|
2007-03-26 01:54:18 +00:00
|
|
|
'table' => "CONCAT(emergencycontact.firstname, ' ', emergencycontact.lastname)",
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'components' => array('emergencycontacts')),
|
2007-03-18 07:10:54 +00:00
|
|
|
|
|
|
|
'emerg_relation' => array(
|
|
|
|
'name' => 'Emergency Contact -- Relationship',
|
|
|
|
'header' => 'Emerg. Rlt',
|
|
|
|
'width' => 1,
|
2007-03-26 01:54:18 +00:00
|
|
|
'table' => "emergencycontact.relation",
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'components' => array('emergencycontacts')),
|
2007-03-18 07:10:54 +00:00
|
|
|
|
|
|
|
'emerg_phone' => array(
|
|
|
|
'name' => 'Emergency Contact -- Phone',
|
|
|
|
'header' => 'Emerg. Phone',
|
|
|
|
'width' => 1,
|
2007-03-26 01:54:18 +00:00
|
|
|
'table' => "CONCAT(emergencycontact.phone1, ' ', emergencycontact.phone2, ' ', emergencycontact.phone3, ' ', emergencycontact.phone4)",
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
'components' => array('emergencycontacts')),
|
|
|
|
|
|
|
|
'fair_year' => array (
|
|
|
|
'name' => 'Fair -- Year',
|
|
|
|
'header' => 'Year',
|
|
|
|
'width' => 0.5,
|
|
|
|
'table' => "{$config['FAIRYEAR']}"),
|
|
|
|
|
|
|
|
'fair_name' => array (
|
|
|
|
'name' => 'Fair -- Name',
|
|
|
|
'header' => 'Fair Name',
|
|
|
|
'width' => 3,
|
|
|
|
'table' => "'{$config['fairname']}'"),
|
2007-03-18 07:10:54 +00:00
|
|
|
|
2007-03-20 06:24:18 +00:00
|
|
|
'static_text' => array (
|
|
|
|
'name' => 'Static Text (useful for labels)',
|
|
|
|
'header' => '',
|
|
|
|
'width' => 0.1,
|
|
|
|
'table' => "CONCAT(' ')"),
|
|
|
|
|
|
|
|
'gvrsf_tn' => array (
|
|
|
|
'name' => 'GVRSF Project Number (Table Number)',
|
|
|
|
'header' => '#',
|
|
|
|
'width' => 0.6,
|
|
|
|
'table' => "CAST(projects.projectnumber AS UNSIGNED) AS GVRSFTBL, CONCAT(projectcategories.category_shortform, ' ', projects.projectnumber, ' ', projectdivisions.division_shortform)",
|
|
|
|
'table_sort' => 'GVRSFTBL'),
|
|
|
|
|
2007-03-18 07:10:54 +00:00
|
|
|
|
|
|
|
);
|
|
|
|
|
2007-03-26 01:54:18 +00:00
|
|
|
function report_students_fromwhere($report, $components)
|
2007-03-18 07:10:54 +00:00
|
|
|
{
|
|
|
|
global $config, $report_students_fields;
|
|
|
|
|
|
|
|
$fields = $report_students_fields;
|
2007-03-18 19:59:02 +00:00
|
|
|
$year = $report['year'];
|
2007-03-18 07:10:54 +00:00
|
|
|
|
2007-03-18 19:59:02 +00:00
|
|
|
$awards_join = '';
|
|
|
|
$awards_where = '';
|
2007-03-18 07:10:54 +00:00
|
|
|
|
2007-03-26 01:54:18 +00:00
|
|
|
if(in_array('awards', $components)) {
|
2007-03-18 07:10:54 +00:00
|
|
|
/* This requires some extra gymnastics */
|
|
|
|
$awards_join = "LEFT JOIN winners ON(winners.projects_id = projects.id),award_prizes,award_awards,award_types";
|
|
|
|
$awards_where = " AND winners.awards_prizes_id=award_prizes.id
|
|
|
|
AND award_prizes.award_awards_id=award_awards.id
|
|
|
|
AND award_types.id=award_awards.award_types_id
|
2007-03-18 19:59:02 +00:00
|
|
|
AND winners.year='$year'
|
|
|
|
AND award_awards.year='$year'
|
|
|
|
AND award_prizes.year='$year'
|
|
|
|
AND award_types.year='$year' ";
|
2007-03-18 07:10:54 +00:00
|
|
|
}
|
|
|
|
|
2007-03-26 01:54:18 +00:00
|
|
|
if(in_array('awards_nominations', $components)) {
|
|
|
|
$awards_join = "LEFT JOIN project_specialawards_link
|
|
|
|
ON(projects.id=project_specialawards_link.projects_id),
|
|
|
|
award_awards,award_types";
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
$awards_where = " AND project_specialawards_link.award_awards_id=award_awards.id
|
2007-03-26 01:54:18 +00:00
|
|
|
AND award_types.id=award_awards.award_types_id
|
|
|
|
AND award_awards.year='$year'
|
|
|
|
AND award_types.year='$year' ";
|
|
|
|
}
|
|
|
|
|
2007-03-18 19:59:02 +00:00
|
|
|
$partner_join = '';
|
- BAM!
- Overhauled the report generator.. It's more versatile now
- Added 'filter' option to the generator, so you can filter any column by (=,
<=, >=, <, >, IS, IS NOT, LIKE, NOT LIKE). It doesn't support AND or OR
combinations, but that should cover what we need for now. Example: We can
filter "Award Name" LIKE "%Gold%" to generate a report of just the Gold medal
projects.
- Wipe out the report database, and create it again from scratch.
update.48.sql contains an example of how to add additional reports to the
system without knowing the report_ids, because after regions start adding
their own reports, we won't be able to just wipe out the whole report system
to add one.
- We handle more reports now, specifically nametags and table labels, so remove
those files, and update the reports.php file to link the old links to the new
report generator (so people don't get too confused in this transition).
- Beginnings of moving the report generator to proper LEFT JOIN style
constructs instead of just one big massive EQUALS JOIN.
2007-03-26 06:15:41 +00:00
|
|
|
if(in_array('partner', $components)) {
|
2007-03-18 07:10:54 +00:00
|
|
|
$partner_join = "LEFT JOIN students AS students2
|
|
|
|
ON(students2.registrations_id=students.registrations_id
|
|
|
|
AND students2.id != students.id)";
|
2007-03-18 19:59:02 +00:00
|
|
|
}
|
2007-03-18 07:10:54 +00:00
|
|
|
|
2007-03-26 01:54:18 +00:00
|
|
|
$emergencycontact_join = '';
|
|
|
|
if(in_array('emergencycontacts', $components)) {
|
|
|
|
/* No need to put the year in here, students.id is unique across years */
|
|
|
|
$emergencycontact_join = "LEFT JOIN emergencycontact ON (
|
|
|
|
students.id=emergencycontact.students_id )";
|
|
|
|
}
|
|
|
|
|
2007-03-18 19:59:02 +00:00
|
|
|
$q = " FROM
|
2007-03-18 07:10:54 +00:00
|
|
|
students $partner_join,
|
|
|
|
schools, projects $awards_join, projectdivisions,
|
2007-03-26 01:54:18 +00:00
|
|
|
projectcategories, registrations
|
|
|
|
$emergencycontact_join
|
2007-03-18 07:10:54 +00:00
|
|
|
WHERE
|
|
|
|
schools.id=students.schools_id
|
|
|
|
AND projects.registrations_id=students.registrations_id
|
|
|
|
AND projectdivisions.id=projects.projectdivisions_id
|
|
|
|
AND projectcategories.id=projects.projectcategories_id
|
|
|
|
AND registrations.id=students.registrations_id
|
|
|
|
AND (registrations.status='complete' OR registrations.status='paymentpending')
|
|
|
|
AND students.year='$year'
|
|
|
|
AND projects.year='$year'
|
|
|
|
AND registrations.year='$year'
|
|
|
|
AND projectcategories.year='$year'
|
|
|
|
AND projectdivisions.year='$year'
|
|
|
|
$awards_where
|
2007-03-18 19:59:02 +00:00
|
|
|
";
|
2007-03-18 07:10:54 +00:00
|
|
|
|
2007-03-18 19:59:02 +00:00
|
|
|
return $q;
|
2007-03-18 07:10:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|