2007-09-13 18:57:56 +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_schools_fields = array(
|
|
|
|
'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)" ),
|
|
|
|
|
|
|
|
'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-12-03 21:04:35 +00:00
|
|
|
'school_email' => array(
|
|
|
|
'name' => 'School -- Email',
|
|
|
|
'header' => 'School Email',
|
|
|
|
'width' => 1,
|
|
|
|
'table' => 'schools.schoolemail' ),
|
2007-09-13 18:57:56 +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' ),
|
|
|
|
|
|
|
|
'school_board' => array(
|
|
|
|
'name' => 'School -- Board ID',
|
2007-12-08 00:00:26 +00:00
|
|
|
'header' => 'School Board',
|
|
|
|
'width' => 1.0,
|
2007-09-13 18:57:56 +00:00
|
|
|
'table' => 'schools.board' ),
|
|
|
|
|
2007-12-03 21:04:35 +00:00
|
|
|
'school_principal' => array(
|
|
|
|
'name' => 'School -- Principal',
|
|
|
|
'header' => 'Principal',
|
|
|
|
'width' => 1.25,
|
|
|
|
'table' => 'schools.principal' ),
|
|
|
|
|
|
|
|
'school_sh' => array(
|
|
|
|
'name' => 'School -- Science Head',
|
|
|
|
'header' => 'Science Head',
|
|
|
|
'width' => 1.25,
|
|
|
|
'table' => 'schools.sciencehead' ),
|
|
|
|
|
|
|
|
'school_shphone' => array(
|
|
|
|
'name' => 'School -- Science Head Phone',
|
|
|
|
'header' => 'Science Hd Phone',
|
|
|
|
'width' => 1,
|
|
|
|
'table' => 'schools.scienceheadphone' ),
|
|
|
|
|
|
|
|
'school_shemail' => array(
|
|
|
|
'name' => 'School -- Science Head Email',
|
|
|
|
'header' => 'Science Head Email',
|
|
|
|
'width' => 1.5,
|
|
|
|
'table' => 'schools.scienceheademail' ),
|
|
|
|
|
|
|
|
'school_contact' => array(
|
|
|
|
'name' => 'School -- Contact (Principal if school PHONE exists, else Science Head)',
|
|
|
|
'header' => 'Contact',
|
|
|
|
'width' => 1.5,
|
|
|
|
'table' => "IF(schools.phone='',schools.sciencehead,schools.principal)",
|
|
|
|
'table_sort' => 'schools.principal' ),
|
|
|
|
|
|
|
|
'school_contactphone' => array(
|
|
|
|
'name' => 'School -- Contact Phone (School Phone if exists, else Science Head Phone)',
|
2007-12-03 22:07:23 +00:00
|
|
|
'header' => 'Cnct Phone',
|
2007-12-03 21:04:35 +00:00
|
|
|
'width' => 1,
|
|
|
|
'table' => "IF(schools.phone='',schools.scienceheadphone,schools.phone)",
|
|
|
|
'table_sort' => 'schools.phone' ),
|
|
|
|
|
|
|
|
'school_contactemail' => array(
|
|
|
|
'name' => 'School -- Contact Email (School Email if school PHONE exists, else Science Head Email)',
|
|
|
|
'header' => 'Contact Email',
|
|
|
|
'width' => 1.5,
|
|
|
|
'table' => "IF(schools.phone='',schools.scienceheademail,schools.schoolemail)",
|
|
|
|
'table_sort' => 'schools.schoolemail' ),
|
|
|
|
|
2007-12-08 00:00:26 +00:00
|
|
|
'school_accesscode' => array(
|
|
|
|
'name' => 'School -- Access Code',
|
|
|
|
'header' => 'Access Code',
|
|
|
|
'width' => 1.1,
|
|
|
|
'table' => 'schools.accesscode' ),
|
|
|
|
|
|
|
|
'school_registration_password' => array(
|
|
|
|
'name' => 'School -- Registration Password',
|
|
|
|
'header' => 'Reg Pass',
|
|
|
|
'width' => 0.75,
|
|
|
|
'table' => 'schools.registration_password' ),
|
|
|
|
|
2007-09-13 18:57:56 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
function report_schools_fromwhere($report, $components)
|
|
|
|
{
|
|
|
|
global $config, $report_schools_fields;
|
|
|
|
|
|
|
|
$fields = $report_schools_fields;
|
|
|
|
$year = $report['year'];
|
|
|
|
|
|
|
|
$q = " FROM
|
|
|
|
schools
|
|
|
|
WHERE
|
|
|
|
schools.year='$year'
|
|
|
|
";
|
|
|
|
|
|
|
|
return $q;
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|