science-ation/admin/reports_committees.inc.php

173 lines
5.0 KiB
PHP
Raw Normal View History

<?
/*
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_committees_fields = array(
'name' => array(
'start_option_group' => 'Committee Member Name',
'name' => 'Committee Member -- Full Name ',
'header' => 'Name',
2010-06-08 18:49:14 +00:00
'width' => 44.45 /*mm*/,
'table' => "CONCAT(users.firstname, ' ', users.lastname)",
'table_sort' => 'users.lastname'),
'last_name' => array(
'name' => 'Committee Member -- Last Name',
'header' => 'Last Name',
2010-06-08 18:49:14 +00:00
'width' => 25.4 /*mm*/,
'table' => 'users.lastname' ),
'first_name' => array(
'name' => 'Committee Member -- First Name',
'header' => 'First Name',
2010-06-08 18:49:14 +00:00
'width' => 25.4 /*mm*/,
'table' => 'users.firstname' ),
'email' => array(
'start_option_group' => 'Committee Member Contact Information',
'name' => 'Committee Member -- Email',
'header' => 'Email',
2010-06-08 18:49:14 +00:00
'width' => 50.8 /*mm*/,
'table' => 'users.email'),
'phone_home' => array(
'name' => 'Committee Member -- Phone (Home)',
'header' => 'Phone(Home)',
2010-06-08 18:49:14 +00:00
'width' => 25.4 /*mm*/,
'table' => 'users.phonehome'),
'phone_work' => array(
'name' => 'Committee Member -- Phone (Work)',
'header' => 'Phone(Work)',
2010-06-08 18:49:14 +00:00
'width' => 31.75 /*mm*/,
'table' => 'users.phonework'),
'phone_cel' => array(
2010-07-11 02:27:00 +00:00
'name' => 'Committee Member -- Phone (Cell)',
'header' => 'Phone(Cell)',
2010-06-08 18:49:14 +00:00
'width' => 25.4 /*mm*/,
'table' => 'users.phonecell'),
'address' => array(
'name' => 'Committee Member -- Address Street',
'header' => 'Address',
2010-06-08 18:49:14 +00:00
'width' => 50.8 /*mm*/,
'table' => "CONCAT(users.address, ' ', users.address2)"),
'city' => array(
'name' => 'Committee Member -- Address City',
'header' => 'City',
2010-06-08 18:49:14 +00:00
'width' => 38.1 /*mm*/,
'table' => 'users.city' ),
'province' => array(
'name' => 'Committee Member -- Address '.$config['provincestate'],
'header' => $config['provincestate'],
2010-06-08 18:49:14 +00:00
'width' => 19.05 /*mm*/,
'table' => 'users.province' ),
'postal' => array(
'name' => 'Committee Member -- Address '.$config['postalzip'],
'header' => $config['postalzip'],
2010-06-08 18:49:14 +00:00
'width' => 19.05 /*mm*/,
'table' => 'users.postalcode' ),
'organization' => array(
'start_option_group' => 'Committee Member Misc.',
'name' => 'Committee Member -- Organization',
'header' => 'Organization',
2010-06-08 18:49:14 +00:00
'width' => 50.8 /*mm*/,
'table' => 'users.organization'),
'firstaid' => array(
'name' => 'Committee Member -- First Aid Training',
'header' => 'F.Aid',
2010-06-08 18:49:14 +00:00
'width' => 12.7 /*mm*/,
'table' => 'users.firstaid',
'value_map' =>array ('no' => 'no', 'yes' => 'YES')),
'cpr' => array(
'name' => 'Committee Member -- CPR Training',
'header' => 'CPR',
2010-06-08 18:49:14 +00:00
'width' => 12.7 /*mm*/,
'table' => 'users.cpr',
'value_map' =>array ('no' => 'no', 'yes' => 'YES')),
/* The label system depends on each report type having fair_name and fair_logo */
'fair_name' => array(
'start_option_group' => 'Fair Information',
'name' => 'Fair -- Name',
'header' => 'Fair Name',
'width' => 76.2 /*mm*/,
'table' => "'".mysql_escape_string($config['fairname'])."'"),
'fair_year' => array (
'name' => 'Fair -- Year',
'header' => 'Year',
'width' => 12.7 /*mm*/,
'table' => "{$config['FAIRYEAR']}"),
'fair_logo' => array(
'name' => 'Fair -- Logo (for Labels only)',
'header' => '',
'width' => 1 /*mm*/,
'table' => "CONCAT(' ')"),
'static_text' => array(
'start_option_group' => 'Special Fields',
'name' => 'Static Text (useful for labels)',
'header' => '',
2010-06-08 18:49:14 +00:00
'width' => 2.54 /*mm*/,
'table' => "CONCAT(' ')"),
);
function report_committees_fromwhere($report, $components)
{
global $config, $report_committees_fields;
$fields = $report_committees_fields;
$year = $report['year'];
/*
$teams_from = '';
$teams_where = '';
if(in_array('teams', $components)) {
$teams_from = ",committees_teams_link, committees_teams";
$teams_where = "AND committees_teams_link.committees_id=users.id
AND committees_teams_link.year='$year'
AND committees_teams.id=committees_teams_link.committees_teams_id
AND committees_teams.year='$year'";
}
*/
$q = " FROM
users
WHERE
users.types LIKE '%committee%'
";
return $q;
}
?>