2007-03-18 19:59:02 +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_awards_fields = array(
|
|
|
|
'name' => array(
|
2010-04-04 18:57:27 +00:00
|
|
|
'start_option_group' => 'Award Information',
|
2007-03-18 19:59:02 +00:00
|
|
|
'name' => 'Award -- Name',
|
2007-03-18 21:48:36 +00:00
|
|
|
'header' => 'Award Name',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 76.2 /*mm*/,
|
2007-03-18 19:59:02 +00:00
|
|
|
'table' => 'award_awards.name' ),
|
|
|
|
|
2007-03-22 14:55:24 +00:00
|
|
|
'criteria' => array(
|
|
|
|
'name' => 'Award -- Criteria',
|
|
|
|
'header' => 'Award Criteria',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 76.2 /*mm*/,
|
2007-03-22 14:55:24 +00:00
|
|
|
'table' => 'award_awards.criteria' ),
|
|
|
|
|
|
|
|
'presenter' => array(
|
|
|
|
'name' => 'Award -- Presenter',
|
|
|
|
'header' => 'Award Presenter',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 38.1 /*mm*/,
|
2007-03-22 14:55:24 +00:00
|
|
|
'table' => 'award_awards.presenter' ),
|
|
|
|
|
|
|
|
'order' => array(
|
|
|
|
'name' => 'Award -- Order',
|
|
|
|
'header' => 'Award Order',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 12.7 /*mm*/,
|
2007-03-22 14:55:24 +00:00
|
|
|
'table' => 'award_awards.order' ),
|
|
|
|
|
2007-03-18 19:59:02 +00:00
|
|
|
'cwsfaward' => array(
|
|
|
|
'name' => 'Award -- CWSF Award',
|
|
|
|
'header' => 'CWSF',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 12.7 /*mm*/,
|
2007-03-18 19:59:02 +00:00
|
|
|
'table' => 'award_awards.cwsfaward',
|
|
|
|
'value_map' => array ('0' => 'No', '1' => 'Yes')),
|
|
|
|
|
2007-03-18 21:48:36 +00:00
|
|
|
'type' => array(
|
|
|
|
'name' => 'Award -- Type',
|
|
|
|
'header' => 'Award Type',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 25.4 /*mm*/,
|
2007-03-18 21:48:36 +00:00
|
|
|
'table' => 'award_types.type' ),
|
|
|
|
|
2010-04-04 18:57:30 +00:00
|
|
|
'empty_winner_box' => array(
|
|
|
|
'name' => 'Award -- Empty Winner Box (for hand entry on printed reports)',
|
|
|
|
'header' => 'Winner',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 25.4 /*mm*/,
|
2010-04-04 18:57:30 +00:00
|
|
|
'table' => "CONCAT('')" ),
|
|
|
|
|
2007-12-13 19:56:44 +00:00
|
|
|
'sponsor_organization' => array(
|
2010-04-04 18:57:27 +00:00
|
|
|
'start_option_group' => 'Sponsor Information',
|
2007-12-13 19:56:44 +00:00
|
|
|
'name' => 'Sponsor -- Organization',
|
|
|
|
'header' => 'Sponsor Organization',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 50.8 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'sponsors.organization' ),
|
2007-12-13 19:56:44 +00:00
|
|
|
|
|
|
|
'sponsor_phone' => array(
|
|
|
|
'name' => 'Sponsor -- Phone',
|
|
|
|
'header' => 'Sp. Phone',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 25.4 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'sponsors.phone' ),
|
2007-12-13 19:56:44 +00:00
|
|
|
|
|
|
|
'sponsor_fax' => array(
|
|
|
|
'name' => 'Sponsor -- Fax',
|
|
|
|
'header' => 'Sp. Fax',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 25.4 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'sponsors.fax' ),
|
2007-12-13 19:56:44 +00:00
|
|
|
|
|
|
|
'sponsor_address' => array(
|
|
|
|
'name' => 'Sponsor -- Street Address',
|
|
|
|
'header' => 'Sponsor Address',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 50.8 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'sponsors.address'),
|
2007-12-13 19:56:44 +00:00
|
|
|
|
|
|
|
'sponsor_city' => array(
|
|
|
|
'name' => 'Sponsor -- City',
|
|
|
|
'header' => 'Sp. City',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 38.1 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'sponsors.city' ),
|
2007-12-13 19:56:44 +00:00
|
|
|
|
|
|
|
'sponsor_province' => array(
|
2008-07-16 17:23:53 +00:00
|
|
|
'name' => 'Sponsor -- '.$config['provincestate'],
|
|
|
|
'header' => 'Sp. '.$config['provincestate'],
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 19.05 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'sponsors.province_code' ),
|
2007-12-13 19:56:44 +00:00
|
|
|
|
|
|
|
'sponsor_postal' => array(
|
2008-07-16 17:23:53 +00:00
|
|
|
'name' => 'Sponsor -- '.$config['postalzip'],
|
|
|
|
'header' => 'Sp. '.$config['postalzip'],
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 19.05 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'sponsors.postalcode' ),
|
2007-12-13 19:56:44 +00:00
|
|
|
|
|
|
|
'sponsor_notes' => array(
|
|
|
|
'name' => 'Sponsor -- Notes',
|
|
|
|
'header' => 'Sponsor Notes',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 76.2 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'sponsors.notes' ),
|
2007-12-13 19:56:44 +00:00
|
|
|
|
2009-09-09 00:26:12 +00:00
|
|
|
'sponsorship_status' => array(
|
|
|
|
'name' => 'Sponsorship -- Status',
|
|
|
|
'header' => 'Sp. Status',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 12.7 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'sponsorships.status',
|
|
|
|
'value_map' => array ('pending' => 'Pending', 'confirmed' => 'Confirmed'), "received"=>"Received"),
|
2007-12-13 19:56:44 +00:00
|
|
|
|
2007-12-13 21:23:29 +00:00
|
|
|
'pcontact_salutation' => array(
|
2010-04-04 18:57:27 +00:00
|
|
|
'start_option_group' => 'Sponsor Primary Contact',
|
2007-12-13 21:23:29 +00:00
|
|
|
'name' => 'Primary Contact -- Salutation',
|
|
|
|
'header' => 'Cnct. Salutation',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 25.4 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'PRIMARYCONTACTUSER.salutation' ),
|
2007-12-13 21:23:29 +00:00
|
|
|
|
|
|
|
'pcontact_last_name' => array(
|
|
|
|
'name' => 'Primary Contact -- Last Name',
|
|
|
|
'header' => 'Cnct. Last Name',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 25.4 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'PRIMARYCONTACTUSER.lastname' ),
|
2007-12-13 21:23:29 +00:00
|
|
|
|
|
|
|
'pcontact_first_name' => array(
|
|
|
|
'name' => 'Primary Contact -- First Name',
|
|
|
|
'header' => 'Cnct. First Name',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 25.4 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'PRIMARYCONTACTUSER.firstname' ),
|
2007-12-13 21:23:29 +00:00
|
|
|
|
|
|
|
'pcontact_name' => array(
|
|
|
|
'name' => 'Primary Contact -- Full Name (last, first)',
|
|
|
|
'header' => 'Contact Name',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 44.45 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => "CONCAT(PRIMARYCONTACTUSER.lastname, ', ', PRIMARYCONTACTUSER.firstname)",
|
|
|
|
'table_sort'=> 'PRIMARYCONTACTUSER.lastname' ),
|
2007-12-13 21:23:29 +00:00
|
|
|
|
|
|
|
'pcontact_namefl' => array(
|
|
|
|
'name' => 'Primary Contact -- Full Name (salutation first last)',
|
|
|
|
'header' => 'Contact Name',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 44.45 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => "CONCAT(PRIMARYCONTACTUSER.salutation, ' ', PRIMARYCONTACTUSER.firstname, ' ', PRIMARYCONTACTUSER.lastname)",
|
|
|
|
'table_sort'=> 'PRIMARYCONTACTUSER.lastname' ),
|
2007-12-13 21:23:29 +00:00
|
|
|
|
|
|
|
'pcontact_position' => array(
|
|
|
|
'name' => 'Primary Contact -- Position',
|
|
|
|
'header' => 'Cnct. Position',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 31.75 /*mm*/,
|
2007-12-13 21:23:29 +00:00
|
|
|
'table' => 'PRIMARYCONTACT.position'),
|
|
|
|
|
|
|
|
'pcontact_email' => array(
|
|
|
|
'name' => 'Primary Contact -- Email',
|
|
|
|
'header' => 'Cnct. Email',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 50.8 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'PRIMARYCONTACTUSER.email'),
|
2007-12-13 21:23:29 +00:00
|
|
|
|
|
|
|
'pcontact_hphone' => array(
|
|
|
|
'name' => 'Primary Contact -- Home Phone',
|
|
|
|
'header' => 'Cnct. Home',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 25.4 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'PRIMARYCONTACTUSER.phonehome' ),
|
2007-12-13 21:23:29 +00:00
|
|
|
|
|
|
|
'pcontact_wphone' => array(
|
|
|
|
'name' => 'Primary Contact -- Work Phone',
|
|
|
|
'header' => 'Cnct. Work',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 25.4 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'PRIMARYCONTACTUSER.phonework' ),
|
2007-12-13 21:23:29 +00:00
|
|
|
|
|
|
|
'pcontact_cphone' => array(
|
|
|
|
'name' => 'Primary Contact -- Cell Phone',
|
|
|
|
'header' => 'Cnct. Cell',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 25.4 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'PRIMARYCONTACTUSER.phonecell' ),
|
2007-12-13 21:23:29 +00:00
|
|
|
|
|
|
|
'pcontact_fax' => array(
|
|
|
|
'name' => 'Primary Contact -- Fax',
|
|
|
|
'header' => 'Cnct. Fax',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 25.4 /*mm*/,
|
2009-09-09 00:26:12 +00:00
|
|
|
'table' => 'PRIMARYCONTACTUSER.fax' ),
|
2007-12-13 21:23:29 +00:00
|
|
|
|
|
|
|
'pcontact_notes' => array(
|
|
|
|
'name' => 'Primary Contact -- Notes',
|
|
|
|
'header' => 'Contact Notes',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 76.2 /*mm*/,
|
2010-01-28 08:42:32 +00:00
|
|
|
'table' => 'PRIMARYCONTACT.notes' ),
|
2007-12-13 21:23:29 +00:00
|
|
|
|
2010-05-07 07:29:31 +00:00
|
|
|
'pcontact_address' => array(
|
|
|
|
'name' => 'Primary Contact Address -- Street',
|
|
|
|
'header' => 'Address',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 50.8 /*mm*/,
|
2010-05-07 07:29:31 +00:00
|
|
|
'table' => "CONCAT(PRIMARYCONTACTUSER.address, ' ', PRIMARYCONTACTUSER.address2)"),
|
|
|
|
|
|
|
|
'pcontact_city' => array(
|
|
|
|
'name' => 'Primary Contact Address -- City',
|
|
|
|
'header' => 'City',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 38.1 /*mm*/,
|
2010-05-07 07:29:31 +00:00
|
|
|
'table' => 'PRIMARYCONTACTUSER.city'),
|
|
|
|
|
|
|
|
'pcontact_province' => array(
|
|
|
|
'name' => 'Primary Contact Address -- '.$config['provincestate'],
|
|
|
|
'header' => $config['provincestate'],
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 19.05 /*mm*/,
|
2010-05-07 07:29:31 +00:00
|
|
|
'table' => 'PRIMARYCONTACTUSER.province'),
|
|
|
|
|
|
|
|
'pcontact_postal' => array(
|
|
|
|
'name' => 'Primary Contact Address -- '.$config['postalzip'],
|
|
|
|
'header' => $config['postalzip'],
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 19.05 /*mm*/,
|
2010-05-07 07:29:31 +00:00
|
|
|
'table' => 'PRIMARYCONTACTUSER.postalcode' ),
|
|
|
|
|
|
|
|
'pcontact_city_prov' => array(
|
|
|
|
'name' => 'Primary Contact Address -- City, '.$config['provincestate'].' (for mailing)',
|
|
|
|
'header' => 'City',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 38.1 /*mm*/,
|
2010-05-07 07:29:31 +00:00
|
|
|
'table' => "CONCAT(PRIMARYCONTACTUSER.city, ', ', PRIMARYCONTACTUSER.province)"),
|
|
|
|
|
2007-03-18 21:48:36 +00:00
|
|
|
'judgeteamname' => array(
|
2010-04-04 18:57:27 +00:00
|
|
|
'start_option_group' => 'Judging Team',
|
2007-12-13 21:23:29 +00:00
|
|
|
'components' => array('judgingteam'),
|
2007-03-18 21:48:36 +00:00
|
|
|
'name' => 'Judging Team -- Name',
|
|
|
|
'header' => 'Judging Team',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 76.2 /*mm*/,
|
2007-03-18 21:48:36 +00:00
|
|
|
'table' => 'judges_teams.name'),
|
|
|
|
|
|
|
|
'judgeteamnum' => array(
|
2007-12-13 21:23:29 +00:00
|
|
|
'components' => array('judgingteam'),
|
2007-03-18 21:48:36 +00:00
|
|
|
'name' => 'Judging Team -- Number',
|
2007-03-19 00:13:12 +00:00
|
|
|
'header' => 'Team',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 12.7 /*mm*/,
|
2007-03-18 21:48:36 +00:00
|
|
|
'table' => 'judges_teams.num'),
|
|
|
|
|
2007-12-24 21:18:08 +00:00
|
|
|
'judgeteammembers_name' => array(
|
|
|
|
'components' => array('judgingteam', 'judgingteammembers'),
|
|
|
|
'name' => 'Judging Team -- Judge Name',
|
|
|
|
'header' => 'Judge Name',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 38.1 /*mm*/,
|
2007-12-24 21:18:08 +00:00
|
|
|
'table' => "CONCAT(judges.firstname, ' ', judges.lastname)"),
|
|
|
|
|
2007-03-18 21:48:36 +00:00
|
|
|
'judgeteammembers' => array(
|
2007-12-24 21:18:08 +00:00
|
|
|
'components' => array('judgingteam', 'judgingteammembers'),
|
2007-03-18 21:48:36 +00:00
|
|
|
'name' => 'Judging Team -- Members (REQUIRES MySQL 5.0)',
|
|
|
|
'header' => 'Team Members',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 76.2 /*mm*/,
|
2007-12-24 21:18:08 +00:00
|
|
|
'table' => "GROUP_CONCAT(judges.firstname, ' ', judges.lastname ORDER BY judges.lastname SEPARATOR ', ')",
|
|
|
|
'group_by' => array('award_awards.id', 'judges_teams.num') ),
|
|
|
|
|
2010-04-04 18:57:30 +00:00
|
|
|
'prize_name' => array(
|
|
|
|
'start_option_group' => 'Prize Info (Duplicates award data for each prize, omits awards with no prizes)',
|
|
|
|
'name' => 'Prize -- Name',
|
|
|
|
'header' => 'Prize Name',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 50.8 /*mm*/,
|
2010-04-04 18:57:30 +00:00
|
|
|
'table' => 'award_prizes.prize',
|
|
|
|
'components' => array('prizes')),
|
|
|
|
|
|
|
|
'prize_cash' => array(
|
|
|
|
'name' => 'Prize -- Cash Amount',
|
|
|
|
'header' => 'Cash',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 12.7 /*mm*/,
|
2010-04-04 18:57:30 +00:00
|
|
|
'table' => 'award_prizes.cash',
|
|
|
|
'components' => array('prizes')),
|
|
|
|
|
|
|
|
'prize_scholarship' => array(
|
|
|
|
'name' => 'Prize -- Scholarship Amount',
|
|
|
|
'header' => 'Scholarship',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 19.05 /*mm*/,
|
2010-04-04 18:57:30 +00:00
|
|
|
'table' => 'award_prizes.scholarship',
|
|
|
|
'components' => array('prizes')),
|
|
|
|
|
|
|
|
'prize_value' => array(
|
|
|
|
'name' => 'Prize -- Value Amount',
|
|
|
|
'header' => 'Value',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 12.7 /*mm*/,
|
2010-04-04 18:57:30 +00:00
|
|
|
'table' => 'award_prizes.value',
|
|
|
|
'components' => array('prizes')),
|
|
|
|
|
|
|
|
/* Don't have projectcategories and projectdivisions
|
|
|
|
'prize_fullname' => array(
|
|
|
|
'name' => 'Prize -- Name, Category, Division',
|
|
|
|
'header' => 'Prize Name',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 101.6 /*mm,
|
2010-04-04 18:57:30 +00:00
|
|
|
'table' => "CONCAT(award_prizes.prize,' in ',projectcategories.category,' ', projectdivisions.division)",
|
|
|
|
'table_sort' => 'award_prizes.order',
|
|
|
|
'components' => array('prizes')),
|
|
|
|
*/
|
|
|
|
'prize_trophy_any' => array(
|
|
|
|
'name' => 'Prize -- Trophy (\'Yes\' if the award has a trophy)',
|
|
|
|
'header' => 'Trophy',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 12.7 /*mm*/,
|
2010-04-04 18:57:30 +00:00
|
|
|
'table' => "IF ( award_prizes.trophystudentkeeper=1
|
|
|
|
OR award_prizes.trophystudentreturn=1
|
|
|
|
OR award_prizes.trophyschoolkeeper=1
|
|
|
|
OR award_prizes.trophyschoolreturn=1, 'Yes', 'No')",
|
|
|
|
'components' => array('prizes')),
|
|
|
|
|
|
|
|
'prize_trophy_return' => array(
|
|
|
|
'name' => 'Prize -- Annual Trophy (\'Yes\' if the award has a school or student trophy that isn\'t a keeper)',
|
|
|
|
'header' => 'Trophy',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 12.7 /*mm*/,
|
2010-04-04 18:57:30 +00:00
|
|
|
'table' => "IF ( award_prizes.trophystudentreturn=1
|
|
|
|
OR award_prizes.trophyschoolreturn=1, 'Yes', 'No')",
|
|
|
|
'components' => array('prizes')),
|
|
|
|
|
|
|
|
'prize_trophy_return_student' => array(
|
|
|
|
'name' => 'Prize -- Annual Student Trophy (\'Yes\' if the award has astudent trophy that isn\'t a keeper)',
|
|
|
|
'header' => 'Ind.',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 12.7 /*mm*/,
|
2010-04-04 18:57:30 +00:00
|
|
|
'table' => "IF ( award_prizes.trophystudentreturn=1, 'Yes', 'No')",
|
|
|
|
'components' => array('prizes')),
|
|
|
|
|
|
|
|
'prize_trophy_return_school' => array(
|
|
|
|
'name' => 'Prize -- Annual School Trophy (\'Yes\' if the award has a school trophy that isn\'t a keeper)',
|
|
|
|
'header' => 'Sch.',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 12.7 /*mm*/,
|
2010-04-04 18:57:30 +00:00
|
|
|
'table' => "IF ( award_prizes.trophyschoolreturn=1, 'Yes', 'No')",
|
|
|
|
'components' => array('prizes')),
|
|
|
|
|
|
|
|
'prize_all' => array(
|
|
|
|
'name' => 'Prize -- Lists all prize data (name, cash, scholarship, value, trophies)',
|
|
|
|
'header' => 'Prize',
|
2010-06-08 18:49:14 +00:00
|
|
|
'width' => 50.8 /*mm*/,
|
2010-04-04 18:57:30 +00:00
|
|
|
'table' => "CONCAT(
|
|
|
|
IF(award_prizes.prize != '', CONCAT(award_prizes.prize,'\n', ''),''),
|
|
|
|
IF(award_prizes.cash != '', CONCAT('$',award_prizes.cash,'\n'), ''),
|
|
|
|
IF(award_prizes.scholarship != '', CONCAT('$',award_prizes.scholarship,' scholarship\n'), ''),
|
|
|
|
IF(award_prizes.value != '', CONCAT('$',award_prizes.value,' value\n'), ''),
|
|
|
|
IF(award_prizes.trophystudentkeeper != '', CONCAT('Student Keeper Trophy\n'), ''),
|
|
|
|
IF(award_prizes.trophystudentreturn != '', CONCAT('Student Annual-Return Trophy\n'), ''),
|
|
|
|
IF(award_prizes.trophyschoolkeeper != '', CONCAT('School Keeper Trophy\n'), ''),
|
|
|
|
IF(award_prizes.trophyschoolreturn != '', CONCAT('School Annual-Return Trophy\n'), '')
|
|
|
|
)",
|
|
|
|
'components' => array('prizes')),
|
|
|
|
|
2007-03-18 21:48:36 +00:00
|
|
|
|
2007-03-18 19:59:02 +00:00
|
|
|
);
|
|
|
|
|
2007-03-26 01:54:18 +00:00
|
|
|
function report_awards_fromwhere($report, $components)
|
2007-03-18 19:59:02 +00:00
|
|
|
{
|
|
|
|
global $config, $report_awards_fields;
|
|
|
|
|
|
|
|
$fields = $report_awards_fields;
|
|
|
|
$year = $report['year'];
|
|
|
|
|
2007-03-18 21:48:36 +00:00
|
|
|
$judges_join = '';
|
|
|
|
$judges_where = '';
|
2007-12-13 21:23:29 +00:00
|
|
|
if(in_array('judgingteam', $components)) {
|
2007-12-24 21:18:08 +00:00
|
|
|
$judges_join = 'LEFT JOIN judges_teams_awards_link ON judges_teams_awards_link.award_awards_id=award_awards.id
|
|
|
|
LEFT JOIN judges_teams ON judges_teams.id=judges_teams_awards_link.judges_teams_id';
|
|
|
|
$judges_where = "AND judges_teams_awards_link.year='$year'
|
|
|
|
AND judges_teams.year='$year'";
|
2007-03-18 19:59:02 +00:00
|
|
|
}
|
|
|
|
|
2007-12-24 21:18:08 +00:00
|
|
|
$judges_members_join = '';
|
|
|
|
$judges_members_where = '';
|
|
|
|
if(in_array('judgingteammembers', $components)) {
|
|
|
|
$judges_members_join = 'LEFT JOIN judges_teams_link ON judges_teams_link.judges_teams_id=judges_teams.id
|
|
|
|
LEFT JOIN judges ON judges.id=judges_teams_link.judges_id';
|
|
|
|
|
|
|
|
$judges_members_where = "AND judges_teams_link.year='$year'";
|
|
|
|
}
|
|
|
|
|
2010-04-04 18:57:30 +00:00
|
|
|
$prizes_join = '';
|
|
|
|
if(in_array('prizes', $components)) {
|
|
|
|
$prizes_join = 'LEFT JOIN award_prizes ON award_prizes.award_awards_id=award_awards.id';
|
|
|
|
/* Don't need a where filter, the prize is attached by unique ID to an award
|
|
|
|
* that is already from the correct year. */
|
|
|
|
}
|
|
|
|
|
2007-12-24 21:18:08 +00:00
|
|
|
|
|
|
|
$q = " FROM award_awards
|
2009-09-09 00:26:12 +00:00
|
|
|
LEFT JOIN sponsors ON (
|
|
|
|
sponsors.id=award_awards.sponsors_id)
|
2007-12-24 21:18:08 +00:00
|
|
|
LEFT JOIN award_types ON award_types.id=award_types_id
|
2009-09-09 00:26:12 +00:00
|
|
|
LEFT JOIN users_sponsor AS PRIMARYCONTACT ON (
|
|
|
|
PRIMARYCONTACT.sponsors_id=sponsors.id
|
2007-12-24 21:18:08 +00:00
|
|
|
AND PRIMARYCONTACT.`primary`='yes')
|
2009-09-09 00:26:12 +00:00
|
|
|
LEFT JOIN users AS PRIMARYCONTACTUSER ON (
|
|
|
|
PRIMARYCONTACT.users_id=PRIMARYCONTACTUSER.id)
|
2007-03-18 21:48:36 +00:00
|
|
|
$judges_join
|
2007-12-24 21:18:08 +00:00
|
|
|
$judges_members_join
|
2010-04-04 18:57:30 +00:00
|
|
|
$prizes_join
|
2007-03-18 19:59:02 +00:00
|
|
|
WHERE
|
2007-03-18 21:48:36 +00:00
|
|
|
award_awards.year='$year'
|
|
|
|
AND award_types.year='$year'
|
2007-12-13 21:23:29 +00:00
|
|
|
$judges_where
|
2007-12-24 21:18:08 +00:00
|
|
|
$judges_members_where
|
2007-03-18 19:59:02 +00:00
|
|
|
";
|
|
|
|
|
|
|
|
return $q;
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|