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 .
*/
require_once ( " reports_students.inc.php " ); /* $report_students_fields */
2007-03-18 21:48:36 +00:00
require_once ( " reports_judges.inc.php " ); /* $report_students_fields */
require_once ( " reports_awards.inc.php " ); /* $report_students_fields */
2007-03-20 06:24:18 +00:00
require_once ( " reports_committees.inc.php " ); /* $report_students_fields */
2007-11-16 05:32:04 +00:00
require_once ( " reports_volunteers.inc.php " ); /* $report_volunteers_fields */
2007-09-13 18:57:56 +00:00
require_once ( " reports_schools.inc.php " );
2007-12-20 01:05:04 +00:00
require_once ( " reports_tours.inc.php " );
2009-09-18 05:35:13 +00:00
require_once ( " reports_fairs.inc.php " );
2009-10-16 17:17:45 +00:00
require_once ( " reports_fundraising.inc.php " );
2007-09-13 18:57:56 +00:00
2007-03-18 19:59:02 +00:00
require_once ( '../lpdf.php' );
require_once ( '../lcsv.php' );
2010-03-25 04:27:33 +00:00
require_once ( '../tcpdf.inc.php' );
2007-03-18 07:10:54 +00:00
- 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
$filter_ops = array ( 0 => '=' ,
1 => '<=' ,
2 => '>=' ,
3 => '<' ,
4 => '>' ,
5 => '!=' ,
6 => 'IS' ,
7 => 'IS NOT' ,
8 => 'LIKE' ,
9 => 'NOT LIKE ' ,
);
2007-03-18 07:10:54 +00:00
2007-12-10 02:50:53 +00:00
$report_options = array ();
$report_options [ 'type' ] = array ( 'desc' => 'Report Format' ,
2010-06-08 18:57:01 +00:00
'values' => array ( 'pdf' => 'PDF' , 'label' => 'Label' , 'csv' => 'CSV (for Excel)' , 'text' => 'Coming Soon: Text (Plain text in columns)' , 'html' => 'Coming Soon: HTML (Browser Renderable)' )
2007-03-18 07:10:54 +00:00
);
2007-12-10 02:50:53 +00:00
$report_options [ 'group_new_page' ] = array ( 'desc' => 'Start each new grouping on a new page' ,
2007-03-18 07:10:54 +00:00
'values' => array ( 'no' => 'No' , 'yes' => 'Yes' )
);
2007-12-10 02:50:53 +00:00
$report_options [ 'allow_multiline' ] = array ( 'desc' => 'Allow table rows to span multiple lines' ,
2007-03-18 07:10:54 +00:00
'values' => array ( 'no' => 'No' , 'yes' => 'Yes' )
);
2008-01-26 19:14:24 +00:00
$report_options [ 'fit_columns' ] = array ( 'desc' => 'Scale column widths to fit on the page width' ,
'values' => array ( 'no' => 'No' , 'yes' => 'Yes' )
);
2007-12-10 02:50:53 +00:00
$report_options [ 'label_box' ] = array ( 'desc' => 'Draw a box around each label' ,
2007-03-19 06:51:44 +00:00
'values' => array ( 'no' => 'No' , 'yes' => 'Yes' )
);
2008-03-20 20:07:13 +00:00
$report_options [ 'field_box' ] = array ( 'desc' => 'Draw a box around each text field on the label' ,
'values' => array ( 'no' => 'No' , 'yes' => 'Yes' )
);
2010-03-23 16:42:59 +00:00
$report_options [ 'default_font_size' ] = array ( 'desc' => 'Default font size to use in the report' ,
'values' => array (
'10' => '10' ,
'11' => '11' , '12' => '12' ,
'13' => '13' , '14' => '14' , '15' => '15' , '16' => '16' , '18' => '18' ,
'20' => '20' , '22' => '22' , '24' => '24'
)
);
2007-03-18 07:10:54 +00:00
/*
Viceroy Grand Avery rows ? w x h " per page
& Toy
LRP 130 99180 5960 3 2 5 / 8 x 1 30
LRP 120 99189 5961 2 4 x 1 20
LRP 114 99179 5959 7 4 x 1 1 / 2 14
LRP 214 99190 5962 7 4 x 1 1 / 3 14
LRP 110 99181 5963 5 4 x 2 10
LRP 106 99763 5964 3 4 x 3 1 / 3 6
LRP 100 99764 5965 1 8 1 / 2 x 11 1
LRP 180 99765 5967 4 1 3 / 4 x 1 / 2 80 */
/* FIXME: put these in a databse */
2010-06-09 05:21:40 +00:00
/* All dimensions are in millimeters */
2007-12-10 02:50:53 +00:00
$report_stock = array ();
Fix all participant emails in communication module
Make queries for communications easier, all you need is a users.id queried, the system will find everything else for you
Add ability to use [PASSWORD], [USERNAME], [EMAIL] (tries accounts.email first, if its not there, it uses accounts.pendingemail), in _ANY_ email. [REGNUM] also added but will obviously only work for participants
Add "all" section to the tabs list for user editor, so a user without any roles can still get the basic pages like "account", "roles", and "personal info"
Put count on participant invitations for teachers (and superusers)
Fix a bug where changing a password for a different user didnt work (it changed YOURS!)
2011-03-22 04:37:51 +00:00
2007-12-10 02:50:53 +00:00
$report_stock [ 'fullpage' ] = array ( 'name' => 'Letter 8.5 x 11 (3/4" margin)' ,
2010-06-09 05:21:40 +00:00
'page_format' => 'LETTER' ,
'page_orientation' => 'P' ,
'label_width' => 177.8 ,
'label_height' => 241.3 ,
2007-03-20 06:24:18 +00:00
'x_spacing' => 0 ,
'y_spacing' => 0 ,
2010-06-09 05:21:40 +00:00
'cols' => 1 ,
2007-03-20 06:24:18 +00:00
'rows' => 1 ,
);
- 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
2007-12-10 02:50:53 +00:00
$report_stock [ 'fullpage_landscape' ] = array ( 'name' => 'Letter 8.5 x 11 Landscape (3/4" margin)' ,
2010-06-09 05:21:40 +00:00
'page_format' => 'LETTER' ,
'page_orientation' => 'L' ,
'label_width' => 241.3 ,
'label_height' => 177.8 ,
- 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
'x_spacing' => 0 ,
'y_spacing' => 0 ,
2010-06-09 05:21:40 +00:00
'cols' => 1 ,
- 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
'rows' => 1 ,
);
2007-03-27 05:01:51 +00:00
2007-12-10 02:50:53 +00:00
$report_stock [ 'fullpage_full' ] = array ( 'name' => 'Letter 8.5 x 11 (no margin)' ,
2010-06-09 05:21:40 +00:00
'page_format' => 'LETTER' ,
'page_orientation' => 'P' ,
'label_width' => 215.9 ,
'label_height' => 279.4 ,
2007-03-27 05:01:51 +00:00
'x_spacing' => 0 ,
'y_spacing' => 0 ,
2010-06-09 05:21:40 +00:00
'cols' => 1 ,
2007-03-27 05:01:51 +00:00
'rows' => 1 ,
);
2007-12-10 02:50:53 +00:00
$report_stock [ 'fullpage_landscape_full' ] = array ( 'name' => 'Letter 8.5 x 11 Landscape (no margin)' ,
2010-06-09 05:21:40 +00:00
'page_format' => 'LETTER' ,
'page_orientation' => 'L' ,
'label_width' => 279.4 ,
'label_height' => 215.9 ,
2007-03-27 05:01:51 +00:00
'x_spacing' => 0 ,
'y_spacing' => 0 ,
2010-06-09 05:21:40 +00:00
'cols' => 1 ,
2007-03-27 05:01:51 +00:00
'rows' => 1 ,
);
2007-12-10 08:00:15 +00:00
2007-12-13 17:03:35 +00:00
$report_stock [ '5161' ] = array ( 'name' => 'Avery 5161/5261/5961/8161, G&T 99189 (1"x4")' ,
2010-03-25 04:27:33 +00:00
'page_format' => 'LETTER' ,
'page_orientation' => 'P' ,
2010-06-09 05:21:40 +00:00
'label_width' => 101.6 ,
'label_height' => 25.4 ,
'x_spacing' => 3.81 ,
'y_spacing' => 0.00 ,
'cols' => 2 ,
'rows' => 10 ,
2007-12-10 08:00:15 +00:00
);
2007-12-13 17:03:35 +00:00
$report_stock [ '5162' ] = array ( 'name' => 'Avery 5162/5262/5962/8162/8462, G&T 99190 (1 1/3"x4")' ,
2010-03-25 04:27:33 +00:00
'page_format' => 'LETTER' ,
'page_orientation' => 'P' ,
2010-06-09 05:21:40 +00:00
'label_width' => 101.35 ,
'label_height' => 33.6804 ,
'x_spacing' => 4.7498 ,
'y_spacing' => 0.00 ,
'cols' => 2 ,
'rows' => 7 ,
2007-12-10 08:00:15 +00:00
);
2007-12-13 17:03:35 +00:00
$report_stock [ '5163' ] = array ( 'name' => 'Avery 5163/5263/5963/8163/8463, G&T 99181 (2"x4")' ,
2010-03-25 04:27:33 +00:00
'page_format' => 'LETTER' ,
'page_orientation' => 'P' ,
2010-06-09 05:21:40 +00:00
'label_width' => 101.6 ,
'label_height' => 50.8 ,
'x_spacing' => 4.3663 ,
'y_spacing' => 0.00 ,
2007-03-20 18:49:44 +00:00
'cols' => 2 ,
2010-06-09 05:21:40 +00:00
'rows' => 5 ,
2007-03-20 18:49:44 +00:00
);
2007-12-20 09:25:43 +00:00
$report_stock [ '5164' ] = array ( 'name' => 'Avery 5164/5264/5964/8164, G&T 99763 (4"x3 1/3")' ,
2010-03-25 04:27:33 +00:00
'page_format' => 'LETTER' , /* tcpdf format */
'page_orientation' => 'P' , /* tcpdf orientation */
2010-06-09 05:21:40 +00:00
'label_width' => 101.6 ,
'label_height' => 84.6667 ,
'x_spacing' => 4.7625 ,
'y_spacing' => 0 ,
'cols' => 2 ,
'rows' => 3 ,
2010-03-25 04:27:33 +00:00
2007-03-18 07:10:54 +00:00
);
2007-12-10 02:50:53 +00:00
$report_stock [ 'nametag' ] = array ( 'name' => 'Cards 4"x3"' ,
2010-06-09 05:21:40 +00:00
'page_format' => 'LETTER' ,
'page_orientation' => 'P' ,
'label_width' => 101.6 ,
'label_height' => 76.2 ,
2007-03-19 06:51:44 +00:00
'x_spacing' => 0 ,
'y_spacing' => 0 ,
2010-06-09 05:21:40 +00:00
'cols' => 2 ,
2007-03-19 06:51:44 +00:00
'rows' => 3 ,
);
2007-03-18 07:10:54 +00:00
2008-01-25 05:31:27 +00:00
$report_stock [ 'letter_4up' ] = array ( 'name' => 'Fullpage, 4up' ,
2010-06-09 05:21:40 +00:00
'page_format' => 'LETTER' ,
'page_orientation' => 'P' ,
'label_width' => 101.6 ,
'label_height' => 127.0 ,
2008-01-23 18:32:31 +00:00
'x_spacing' => 0.25 ,
'y_spacing' => 0.25 ,
2010-06-09 05:21:40 +00:00
'cols' => 2 ,
2008-01-23 18:32:31 +00:00
'rows' => 2 ,
);
2008-01-25 05:31:27 +00:00
$report_stock [ 'ledger' ] = array ( 'name' => 'Ledger/Tabloid 11 x 17' ,
2010-06-09 05:21:40 +00:00
'page_format' => 'TABLOID' ,
'page_orientation' => 'P' ,
'label_width' => 279.4 ,
'label_height' => 431.8 ,
2008-01-25 05:31:27 +00:00
'x_spacing' => 0 ,
'y_spacing' => 0 ,
2010-06-09 05:21:40 +00:00
'cols' => 1 ,
2008-01-25 05:31:27 +00:00
'rows' => 1 ,
);
$report_stock [ 'ledger_landscape' ] = array ( 'name' => 'Ledger/Tabloid 11 x 17 Landscape' ,
2010-06-09 05:21:40 +00:00
'page_format' => 'TABLOID' ,
'page_orientation' => 'L' ,
'label_width' => 431.8 ,
'label_height' => 279.4 ,
2008-01-25 05:31:27 +00:00
'x_spacing' => 0 ,
'y_spacing' => 0 ,
2010-06-09 05:21:40 +00:00
'cols' => 1 ,
2008-01-25 05:31:27 +00:00
'rows' => 1 ,
);
2007-12-10 02:50:53 +00:00
$report_options [ 'stock' ] = array ( 'desc' => " Paper Type " ,
2007-03-20 06:24:18 +00:00
'values' => array () );
2007-03-18 07:10:54 +00:00
/* Add more types to the report format */
2007-12-10 02:50:53 +00:00
foreach ( $report_stock as $n => $v ) {
$report_options [ 'stock' ][ 'values' ][ $n ] = $v [ 'name' ];
2007-03-18 07:10:54 +00:00
}
2007-12-10 02:50:53 +00:00
$allow_options = array_keys ( $report_options );
/* A list of custom reports , as close as possible to a real report
* format , but with the 'custom_url' attached . */
$report_custom = array ();
$x = 1 ;
$report_custom [ $x ] = array ( 'id' => $x , 'name' => 'Custom -- Mailing Labels' ,
'desc' => 'Mailing Label Generator' ,
'custom_url' => 'admin/reports_mailinglabels.php' ,
'creator' => 'The Grant Brothers' );
$x ++ ;
$report_custom [ $x ] = array ( 'id' => $x , 'name' => 'Custom -- Project Details (PDF)' ,
'desc' => 'Project Details' ,
'custom_url' => 'admin/reports_projects_details.php?type=pdf' ,
'creator' => 'The Grant Brothers' );
$x ++ ;
$report_custom [ $x ] = array ( 'id' => $x , 'name' => 'Custom -- Judges List (CSV)' ,
'desc' => 'Judges List' ,
'custom_url' => 'admin/reports_judges.php?type=csv' ,
'creator' => 'The Grant Brothers' );
$x ++ ;
2011-02-23 23:12:42 +00:00
$report_custom [ $x ] = array ( 'id' => $x , 'name' => 'Custom -- Judges List (CSV) -- ALL YEARS' ,
'desc' => 'Judges List - All Years' ,
'custom_url' => 'admin/reports_judges_allyears.php?type=csv' ,
'creator' => 'The Grant Brothers' );
$x ++ ;
2007-12-10 02:50:53 +00:00
$report_custom [ $x ] = array ( 'id' => $x , 'name' => 'Custom -- Judging Teams Project Assignments (PDF)' ,
'desc' => 'Judging Teams Project Assignments' ,
'custom_url' => 'admin/reports_judges_teams_projects.php?type=pdf' ,
'creator' => 'The Grant Brothers' );
$x ++ ;
$report_custom [ $x ] = array ( 'id' => $x , 'name' => 'Custom -- Judging Teams Project Assignments (CSV)' ,
'desc' => 'Judging Teams Project Assignments' ,
'custom_url' => 'admin/reports_judges_teams_projects.php?type=csv' ,
'creator' => 'The Grant Brothers' );
$x ++ ;
$report_custom [ $x ] = array ( 'id' => $x , 'name' => 'Custom -- Projects Judging Team Assignments (PDF)' ,
'desc' => 'Projects Judging Team Assignments' ,
'custom_url' => 'admin/reports_projects_judges_teams.php?type=pdf' ,
'creator' => 'The Grant Brothers' );
$x ++ ;
$report_custom [ $x ] = array ( 'id' => $x , 'name' => 'Custom -- Projects Judging Team Assignments (CSV)' ,
'desc' => 'Projects Judging Team Assignments' ,
'custom_url' => 'admin/reports_projects_judges_teams.php?type=csv' ,
'creator' => 'The Grant Brothers' );
$x ++ ;
$report_custom [ $x ] = array ( 'id' => $x , 'name' => 'Custom -- Award List for Award Ceremony Program (CSV)' ,
'desc' => 'Award List for Award Ceremony Program creation' ,
'custom_url' => 'admin/reports_program_awards.php?type=csv' ,
'creator' => 'The Grant Brothers' );
2007-03-18 07:10:54 +00:00
2007-03-19 06:51:44 +00:00
function report_save_field ( $report , $type , $loc )
2007-03-18 07:10:54 +00:00
{
2007-03-18 21:48:36 +00:00
global $allow_options ;
global $report_students_fields , $report_judges_fields , $report_awards_fields ;
2007-09-13 18:57:56 +00:00
global $report_committees_fields , $report_schools_fields ;
2009-09-18 05:35:13 +00:00
global $report_volunteers_fields , $report_fairs_fields ;
2009-10-16 17:17:45 +00:00
global $report_tours_fields , $report_fundraisings_fields ;
2007-03-20 06:24:18 +00:00
2007-03-18 07:10:54 +00:00
2007-11-21 21:55:31 +00:00
$fieldvar = " report_ { $report [ 'type' ] } s_fields " ;
$allow_fields = array_keys ( $$fieldvar );
2007-03-18 07:10:54 +00:00
/* First delete all existing fields */
mysql_query ( " DELETE FROM reports_items
WHERE `reports_id` = '{$report[' id ']}'
AND `type` = '$type' " );
/* Now add new ones */
if ( count ( $report [ $type ]) == 0 ) return ;
$q = '' ;
$x = 0 ;
foreach ( $report [ $type ] as $k => $v ) {
if ( $type == 'option' ) {
2010-06-08 18:57:01 +00:00
/* field, value, x, y, w, h, align, valign, fn, fs, fsize, overflow */
$vals = " ' $k ',' $v ','0','0','0','0','','','','','0','truncate' " ;
2007-03-18 07:10:54 +00:00
} else {
2010-03-25 04:27:33 +00:00
$fs = is_array ( $v [ 'fontstyle' ]) ? implode ( ',' , $v [ 'fontstyle' ]) : '' ;
- 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
$vals = " ' { $v [ 'field' ] } ',' { $v [ 'value' ] } ',
2010-06-08 18:57:01 +00:00
'{$v[' x ']}' , '{$v[' y ']}' , '{$v[' w ']}' , '{$v[' h ']}' ,
'{$v[' align ']}' , '{$v[' valign ']}' ,
2010-03-25 04:27:33 +00:00
'{$v[' fontname ']}' , '$fs' , '{$v[' fontsize ']}' ,
'{$v[' on_overflow ']}' " ;
2007-03-18 07:10:54 +00:00
}
if ( $q != '' ) $q .= ',' ;
- 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
$q .= " ( { $report [ 'id' ] } , ' $type ',' $x ', $vals ) " ;
2007-03-18 07:10:54 +00:00
$x ++ ;
}
2010-03-25 04:27:33 +00:00
- 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
mysql_query ( " INSERT INTO reports_items(`reports_id`,`type`,`ord`,
`field` , `value` , `x` , `y` , `w` , `h` ,
2010-06-08 18:57:01 +00:00
`align` , `valign` ,
2010-03-25 04:27:33 +00:00
`fontname` , `fontstyle` , `fontsize` , `on_overflow` )
2007-03-18 07:10:54 +00:00
VALUES $q ; " );
2010-03-25 04:27:33 +00:00
2007-03-18 07:10:54 +00:00
echo mysql_error ();
}
function report_load ( $report_id )
{
2007-03-19 06:51:44 +00:00
global $allow_options , $report_students_fields , $report_judges_fields ;
global $report_committees_fields , $report_awards_fields ;
2007-11-16 05:32:04 +00:00
global $report_schools_fields , $report_volunteers_fields ;
2009-09-18 05:35:13 +00:00
global $report_tours_fields , $report_fairs_fields ;
2009-10-16 17:17:45 +00:00
global $report_fundraisings_fields ;
2007-03-19 06:51:44 +00:00
2007-03-18 07:10:54 +00:00
$report = array ();
$q = mysql_query ( " SELECT * FROM reports WHERE id=' $report_id ' " );
$r = mysql_fetch_assoc ( $q );
$report [ 'name' ] = $r [ 'name' ];
$report [ 'id' ] = $r [ 'id' ];
2007-11-21 21:55:31 +00:00
$report [ 'system_report_id' ] = $r [ 'system_report_id' ];
2007-03-18 07:10:54 +00:00
$report [ 'desc' ] = $r [ 'desc' ];
$report [ 'creator' ] = $r [ 'creator' ];
$report [ 'type' ] = $r [ 'type' ];
2007-03-19 16:47:01 +00:00
$report [ 'col' ] = array ();
$report [ 'sort' ] = array ();
$report [ 'group' ] = array ();
$report [ 'distinct' ] = array ();
$report [ 'options' ] = array ();
- 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
$report [ 'filter' ] = array ();
2007-03-19 16:47:01 +00:00
$report [ 'loc' ] = array ();
2007-11-21 21:55:31 +00:00
$fieldvar = " report_ { $report [ 'type' ] } s_fields " ;
2007-12-14 15:28:54 +00:00
if ( is_array ( $$fieldvar ))
$allow_fields = array_keys ( $$fieldvar );
else
$allow_fields = array ();
2007-03-18 07:10:54 +00:00
2007-03-19 06:51:44 +00:00
$q = mysql_query ( " SELECT * FROM reports_items
WHERE reports_id = '{$report[' id ']}'
- 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
ORDER BY `ord` " );
2007-03-19 06:51:44 +00:00
print ( mysql_error ());
if ( mysql_num_rows ( $q ) == 0 ) return $ret ;
while ( $a = mysql_fetch_assoc ( $q )) {
$f = $a [ 'field' ];
$t = $a [ 'type' ];
switch ( $t ) {
case 'option' :
- 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
/* We dont ' care about order , just construct
* [ 'option' ][ name ] = value ; */
2007-03-19 06:51:44 +00:00
if ( ! in_array ( $f , $allow_options )) {
print ( " Type[ $type ] Field[ $f ] not allowed. \n " );
2007-03-20 06:24:18 +00:00
continue ;
2007-03-19 06:51:44 +00:00
}
$report [ 'option' ][ $f ] = $a [ 'value' ];
break ;
default :
if ( ! in_array ( $f , $allow_fields )) {
print ( " Type[ $type ] Field[ $f ] not allowed. \n " );
2007-03-20 06:24:18 +00:00
continue ;
2007-03-19 06:51:44 +00:00
}
- 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
/* Pull out all the data */
$val = array ();
2010-06-08 18:57:01 +00:00
$col_fields = array ( 'field' , 'x' , 'y' , 'w' , 'h' , 'align' , 'valign' , 'value' , 'fontname' , 'fontsize' , 'on_overflow' );
- 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
foreach ( $col_fields as $lf ) $val [ $lf ] = $a [ $lf ];
2010-06-08 18:57:01 +00:00
2010-03-25 04:27:33 +00:00
$val [ 'fontstyle' ] = explode ( ',' , $a [ 'fontstyle' ]);
- 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
$report [ $t ][ $a [ 'ord' ]] = $val ;
2007-03-19 06:51:44 +00:00
break ;
}
}
2010-03-25 04:27:33 +00:00
//`int_r($report);
2007-03-18 07:10:54 +00:00
return $report ;
}
function report_save ( $report )
{
if ( $report [ 'id' ] == 0 ) {
/* New report */
mysql_query ( " INSERT INTO reports (`id`) VALUES ('') " );
$report [ 'id' ] = mysql_insert_id ();
2007-11-21 22:30:19 +00:00
} else {
/* if the report [ 'id' ] is not zero , see if this is a
* systeim report before doing anything . */
$q = mysql_query ( " SELECT system_report_id FROM reports WHERE id=' { $report [ 'id' ] } ' " );
$i = mysql_fetch_assoc ( $q );
if ( intval ( $i [ 'system_report_id' ]) != 0 ) {
/* This is a system report , the editor ( should )
* properly setup the editor pages so that the user
* cannot save this report . The only way to get here
* is by directly modifying the POST variables .. so ..
* we don ' t have to worry about being user friendly . */
echo " ERROR: attempt to save a system report (reports.id= { $report [ 'id' ] } ) " ;
exit ;
}
2007-03-18 07:10:54 +00:00
}
- 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
2007-11-21 22:30:19 +00:00
2010-03-25 04:27:33 +00:00
/* print ( " <pre> " );
- 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
print_r ( $_POST );
print_r ( $report );
print ( " </pre> " );
*/
2007-03-18 07:10:54 +00:00
mysql_query ( " UPDATE reports SET
`name` = '".mysql_escape_string($report[' name '])."' ,
`desc` = '".mysql_escape_string($report[' desc '])."' ,
`creator` = '".mysql_escape_string($report[' creator '])."' ,
`type` = '".mysql_escape_string($report[' type '])."'
WHERE `id` = { $report [ 'id' ]} " );
2007-03-19 06:51:44 +00:00
report_save_field ( $report , 'col' , $report [ 'loc' ]);
report_save_field ( $report , 'group' , array ());
report_save_field ( $report , 'sort' , array ());
report_save_field ( $report , 'distinct' , array ());
report_save_field ( $report , 'option' , array ());
- 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
report_save_field ( $report , 'filter' , array ());
2007-03-18 07:10:54 +00:00
return $report [ 'id' ];
}
function report_load_all ()
{
$ret = array ();
$q = mysql_query ( " SELECT * FROM reports ORDER BY `name` " );
while ( $r = mysql_fetch_assoc ( $q )) {
$report = array ();
$report [ 'name' ] = $r [ 'name' ];
$report [ 'id' ] = $r [ 'id' ];
$report [ 'desc' ] = $r [ 'desc' ];
$report [ 'creator' ] = $r [ 'creator' ];
$report [ 'type' ] = $r [ 'type' ];
$ret [] = $report ;
}
return $ret ;
}
function report_delete ( $report_id )
{
$r = intval ( $report_id );
2007-11-21 22:30:19 +00:00
/* if the report [ 'id' ] is not zero , see if this is a
* systeim report before doing anything . */
$q = mysql_query ( " SELECT system_report_id FROM reports WHERE id=' $r ' " );
$i = mysql_fetch_assoc ( $q );
if ( intval ( $i [ 'system_report_id' ]) != 0 ) {
/* This is a system report , the editor ( should )
* properly setup the editor pages so that the user
* cannot delete this report . The only way to get here
* is by directly modifying the POST variables .. so ..
* we don ' t have to worry about being user friendly . */
echo " ERROR: attempt to delete a system report (reports.id= $r ) " ;
exit ;
}
2007-03-18 07:10:54 +00:00
mysql_query ( " DELETE FROM reports WHERE `id`= $r " );
mysql_query ( " DELETE FROM reports_items WHERE `reports_id`= $r " );
}
2007-03-18 19:59:02 +00:00
function report_gen ( $report )
{
2007-09-13 18:57:56 +00:00
global $config , $report_students_fields , $report_judges_fields , $report_awards_fields , $report_schools_fields ;
2007-12-10 02:50:53 +00:00
global $report_stock , $report_committees_fields , $report_volunteers_fields ;
2009-09-18 05:35:13 +00:00
global $report_tours_fields , $report_fairs_fields ;
2009-10-16 17:17:45 +00:00
global $report_fundraisings_fields ;
- 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
global $filter_ops ;
2011-03-29 18:27:12 +00:00
global $conference ;
2007-03-18 19:59:02 +00:00
//print_r($report);
2007-11-21 21:55:31 +00:00
$fieldvar = " report_ { $report [ 'type' ] } s_fields " ;
$fields = $$fieldvar ;
2007-03-18 19:59:02 +00:00
$gen_mode = '' ;
$fieldname = array ();
$thead = array ();
2010-06-08 18:49:20 +00:00
$table [ 'col' ] = array ();
2007-03-18 19:59:02 +00:00
$table [ 'option' ] = array ();
2007-12-30 22:16:34 +00:00
$table [ 'total' ] = 0 ;
2007-12-10 02:50:53 +00:00
/* Validate the stock */
if ( $report [ 'option' ][ 'stock' ] != '' ) {
if ( ! array_key_exists ( $report [ 'option' ][ 'stock' ], $report_stock )) {
echo " Invalid stock [ { $report [ 'option' ][ 'stock' ] } ] " ;
exit ;
}
}
switch ( $report [ 'option' ][ 'type' ]) {
case 'csv' :
- 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
$rep = new lcsv ( i18n ( $report [ 'name' ]));
2007-03-18 19:59:02 +00:00
$gen_mode = 'table' ;
2007-12-10 02:50:53 +00:00
break ;
2010-03-23 16:42:59 +00:00
2010-06-08 18:49:20 +00:00
case 'label' :
2010-03-25 04:27:33 +00:00
$label_stock = $report_stock [ $report [ 'option' ][ 'stock' ]];
$show_box = ( $report [ 'option' ][ 'label_box' ] == 'yes' ) ? true : false ;
$rep = new pdf ( $report [ 'name' ], $label_stock [ 'page_format' ], $label_stock [ 'page_orientation' ]);
$rep -> setup_for_labels ( $show_box , $show_fair , $show_logo ,
2010-06-09 05:21:40 +00:00
$label_stock [ 'label_width' ], $label_stock [ 'label_height' ],
$label_stock [ 'x_spacing' ], $label_stock [ 'y_spacing' ],
2010-03-25 04:27:33 +00:00
$label_stock [ 'rows' ], $label_stock [ 'cols' ]);
2010-06-09 07:43:59 +00:00
$gen_mode = 'label' ;
2010-03-25 04:27:33 +00:00
break ;
2010-06-08 18:49:20 +00:00
case 'pdf' : case '' :
$label_stock = $report_stock [ $report [ 'option' ][ 'stock' ]];
if ( $report [ 'option' ][ 'allow_multiline' ] == 'yes' )
$on_overflow = 'nothing' ;
else
$on_overflow = '...' ;
$rep = new pdf ( $report [ 'name' ], $label_stock [ 'page_format' ], $label_stock [ 'page_orientation' ]);
$rep -> setup_for_tables ( $show_box , $show_fair , $show_logo ,
2010-06-09 05:21:40 +00:00
$label_stock [ 'label_width' ], $label_stock [ 'label_height' ],
$label_stock [ 'x_spacing' ], $label_stock [ 'y_spacing' ],
2010-06-08 18:49:20 +00:00
$label_stock [ 'rows' ], $label_stock [ 'cols' ]);
$gen_mode = 'table' ;
break ;
case 'text' :
echo " Not implemented [ { $report [ 'option' ][ 'type' ] } ] " ;
exit ;
2007-12-10 02:50:53 +00:00
default :
echo " Invalid type [ { $report [ 'option' ][ 'type' ] } ] " ;
exit ;
2007-03-18 19:59:02 +00:00
}
$sel = array ();
$x = 0 ;
$group_by = array ();
2007-12-20 09:43:22 +00:00
$post_group_by = array ();
- 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 ();
$order = array ();
2008-01-26 19:14:24 +00:00
$total_width = 0 ;
$scale_width = 0 ;
/* Add up the column widths , and figure out which
* ones are scalable , just in case */
foreach ( $report [ 'col' ] as $o => $d ) {
$f = $d [ 'field' ];
2010-06-08 18:49:20 +00:00
if ( $d [ 'w' ] != 0 ) {
/* Always 0 on old reports, so we never get in here */
$total_width += $d [ 'w' ];
/* For the rest of the computation , this field is
* not scalable */
/* FIXME! */
} else {
$total_width += $fields [ $f ][ 'width' ];
if ( $fields [ $f ][ 'scalable' ] == true )
$scale_width += $fields [ $f ][ 'width' ];
}
2008-01-26 19:14:24 +00:00
}
/* Determine the scale factor ( use the label width so
* we can enforce margins ) */
2008-11-20 18:21:56 +00:00
if ( $report [ 'option' ][ 'fit_columns' ] == 'yes' ) { // && $total_width > $label_stock['label_width']) {
2008-01-26 19:14:24 +00:00
$static_width = $total_width - $scale_width ;
2010-06-08 18:49:20 +00:00
if ( $scale_width )
$scale_factor = ( $label_stock [ 'label_width' ] - $static_width ) / $scale_width ;
else
$scale_factor = 1.0 ;
2008-01-26 19:14:24 +00:00
} else {
$scale_factor = 1.0 ;
}
2010-06-08 18:49:20 +00:00
2007-03-18 19:59:02 +00:00
/* Select columns to display */
- 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
foreach ( $report [ 'col' ] as $o => $d ) {
$f = $d [ 'field' ];
2010-06-08 18:49:20 +00:00
/* If width is specificed, use that, else compute based on default field width */
if ( $d [ 'w' ] == 0 )
$width = $fields [ $f ][ 'width' ] * (( $fields [ $f ][ 'scalable' ] == true ) ? $scale_factor : 1.0 );
else
$width = $d [ 'w' ];
$col = array ( 'header' => i18n ( $fields [ $f ][ 'header' ]),
'width' => $width ,
'align' => 'left' ,
'on_overflow' => $on_overflow );
$table [ 'col' ][] = $col ;
2007-03-18 19:59:02 +00:00
$sel [] = " { $fields [ $f ][ 'table' ] } AS C $x " ;
$fieldname [ $f ] = " C $x " ;
2007-12-20 09:43:22 +00:00
/* We want to add these to group by, but AFTER all the other group bys */
2007-03-18 19:59:02 +00:00
if ( is_array ( $fields [ $f ][ 'group_by' ]))
2007-12-20 09:43:22 +00:00
$post_group_by = array_merge ( $group_by , $fields [ $f ][ 'group_by' ]);
- 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 ( is_array ( $fields [ $f ][ 'components' ])) {
$components = array_merge ( $components ,
$fields [ $f ][ 'components' ]);
}
2007-03-18 19:59:02 +00:00
$x ++ ;
}
2007-03-19 16:47:01 +00:00
2007-12-24 19:20:01 +00:00
/* We also want to select any column groupings, but we won't display them */
- 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
foreach ( $report [ 'group' ] as $o => $d ) {
$f = $d [ 'field' ];
if ( ! isset ( $fieldname [ $f ])) {
$sel [] = " { $fields [ $f ][ 'table' ] } AS G $o " ;
$fieldname [ $f ] = " G $o " ;
}
2010-06-08 18:49:20 +00:00
if ( isset ( $fields [ $f ][ 'able_sort' ]))
2007-03-18 19:59:02 +00:00
$order [] = $fields [ $f ][ 'table_sort' ];
- 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
else
$order [] = $fieldname [ $f ];
if ( is_array ( $fields [ $f ][ 'components' ])) {
$components = array_merge ( $components ,
$fields [ $f ][ 'components' ]);
2007-03-18 19:59:02 +00:00
}
}
- 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
2007-12-24 19:20:01 +00:00
/* If no sort order is specified, make the first field the order */
if ( count ( $report [ 'sort' ]) == 0 )
$report [ 'sort' ] = array ( 0 => array ( 'field' => $report [ 'col' ][ 0 ][ 'field' ]));
- 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
foreach ( $report [ 'sort' ] as $o => $d ) {
$f = $d [ 'field' ];
if ( ! isset ( $fieldname [ $f ])) {
$sel [] = " { $fields [ $f ][ 'table' ] } AS S $o " ;
$fieldname [ $f ] = " S $o " ;
}
if ( isset ( $fields [ $f ][ 'table_sort' ]))
2007-03-18 19:59:02 +00:00
$order [] = $fields [ $f ][ 'table_sort' ];
- 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
else
$order [] = $fieldname [ $f ];
}
foreach ( $report [ 'distinct' ] as $o => $d ) {
$f = $d [ 'field' ];
if ( ! isset ( $fieldname [ $f ])) {
$sel [] = " { $fields [ $f ][ 'table' ] } AS D $o " ;
$fieldname [ $f ] = " D $o " ;
2007-03-18 19:59:02 +00:00
}
- 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
$group_by [] = $fieldname [ $f ];
2007-03-18 19:59:02 +00:00
}
- 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
foreach ( $report [ 'filter' ] as $o => $d ) {
$f = $d [ 'field' ];
if ( ! isset ( $fieldname [ $f ])) {
$sel [] = " { $fields [ $f ][ 'table' ] } AS F $o " ;
$fieldname [ $f ] = " F $o " ;
}
$t = $filter_ops [ $d [ 'x' ]];
$filter [] = " { $fields [ $f ][ 'table' ] } $t ' { $d [ 'value' ] } ' " ;
2009-09-09 00:26:12 +00:00
if ( is_array ( $fields [ $f ][ 'components' ])) {
$components = array_merge ( $components ,
$fields [ $f ][ 'components' ]);
}
- 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
}
$sel = implode ( " , " , $sel );
2007-03-18 19:59:02 +00:00
$order = implode ( " , " , $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
2007-03-18 19:59:02 +00:00
2010-11-02 20:35:47 +00:00
if ( ! isset ( $report [ 'conferences_id' ])){
$report [ 'conferences_id' ] = $conference [ 'id' ];
2010-10-20 21:58:26 +00:00
}
2007-03-18 19:59:02 +00:00
2007-12-20 09:43:22 +00:00
$group_by = array_merge ( $group_by , $post_group_by );
- 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
$group_query = " " ;
2007-03-18 21:48:36 +00:00
if ( count ( $group_by )) {
2007-03-18 19:59:02 +00:00
$group_query = " GROUP BY " . implode ( " , " , $group_by );
2007-03-26 01:54:18 +00:00
}
- 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
$filter_query = " " ;
if ( count ( $filter )) {
$filter_query = " AND " . implode ( " AND " , $filter );
2007-03-26 01:54:18 +00:00
}
- 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
2007-11-21 21:55:31 +00:00
$func = " report_ { $report [ 'type' ] } s_fromwhere " ;
$q = call_user_func_array ( $func , array ( $report , $components ));
2007-03-18 19:59:02 +00:00
- 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
$q = " SELECT $sel $q $filter_query $group_query ORDER BY $order " ;
2007-12-10 03:05:35 +00:00
$r = mysql_query ( $q );
2007-03-18 19:59:02 +00:00
2009-11-06 08:57:13 +00:00
// print_r($report);
2009-10-16 18:18:38 +00:00
// print_r($report['filter']);
// echo "$q";
2007-12-10 03:05:35 +00:00
if ( $r == false ) {
echo " The report database query has failed. This is
unfortunate but not your fault . Please send the following to
your fair administrator , or visit < a
href = \ " http://www.sfiab.ca \" >http://www.sfiab.ca</a> and submit
a bug report so we can get this fixed .< br /> " ;
echo " <pre> " ;
echo " Query: [ $q ]<br /> " ;
echo " Error: [ " . mysql_error () . " ]<br /> " ;
echo " </pre> " ;
exit ;
}
2007-03-18 19:59:02 +00:00
echo mysql_error ();
$ncols = count ( $report [ 'col' ]);
$n_groups = count ( $report [ 'group' ]);
$last_group_data = array ();
2010-03-25 04:27:33 +00:00
// echo "<pre>";print_r($rep);
2007-03-18 19:59:02 +00:00
while ( $i = mysql_fetch_assoc ( $r )) {
if ( $n_groups > 0 ) {
$group_change = false ;
2007-12-30 20:03:05 +00:00
/* See if any of the "group" fields have changed */
foreach ( $report [ 'group' ] as $x => $g ) {
2007-12-30 21:05:54 +00:00
$c = $fieldname [ $g [ 'field' ]];
2010-02-11 21:36:11 +00:00
if ( $fields [ $g [ 'field' ]][ 'exec_function' ])
$i_c = call_user_func_array ( $fields [ $g [ 'field' ]][ 'exec_function' ], array ( $report , $f , $i [ $c ]));
else
$i_c = $i [ $c ];
if ( $last_group_data [ $c ] != $i_c )
2007-03-18 19:59:02 +00:00
$group_change = true ;
2010-02-11 21:36:11 +00:00
$last_group_data [ $c ] = $i_c ;
2007-03-18 19:59:02 +00:00
}
if ( $group_change ) {
/* Dump the last table */
if ( count ( $table [ 'data' ])) {
// print_r($table);
2011-03-14 20:59:16 +00:00
$rep -> addTable ( $table );
2007-03-18 19:59:02 +00:00
$table [ 'data' ] = array ();
2007-12-30 22:16:34 +00:00
$table [ 'total' ] = 0 ;
2007-03-18 19:59:02 +00:00
/* Start a new page AFTER a table is
* dumped , so the first page doesn ' t
* end up blank */
if ( $report [ 'option' ][ 'group_new_page' ] == 'yes' ) {
2010-06-08 18:49:20 +00:00
$rep -> addpage ();
2007-03-18 19:59:02 +00:00
} else {
$rep -> hr ();
}
}
/* Construct a new header */
$h = implode ( " -- " , $last_group_data );
$rep -> heading ( $h );
}
}
$data = array ();
2007-03-19 06:51:44 +00:00
if ( $gen_mode == 'label' ) {
2010-03-25 04:27:33 +00:00
$rep -> label_new ();
2007-03-19 06:51:44 +00:00
}
2010-03-25 04:27:33 +00:00
- 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
foreach ( $report [ 'col' ] as $o => $d ) {
$f = $d [ 'field' ];
if ( is_array ( $fields [ $f ][ 'value_map' ])) {
$v = $fields [ $f ][ 'value_map' ][ $i [ " C $o " ]];
2007-12-25 05:13:42 +00:00
} else if ( is_callable ( $fields [ $f ][ 'exec_function' ])) {
2010-02-02 18:19:11 +00:00
$v = call_user_func_array ( $fields [ $f ][ 'exec_function' ], array ( $report , $f , $i [ " C $o " ]));
2007-12-25 05:13:42 +00:00
// } else if(isset($fields[$f]['exec_code'])) {
// Somethign like this, how do we pass $i["C$o"] in?
// $v = exec($fields[$f]['exec_code']);
2007-03-18 19:59:02 +00:00
} else {
- 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
$v = $i [ " C $o " ];
2007-03-18 19:59:02 +00:00
}
if ( $gen_mode == 'table' ) {
$data [] = $v ;
2010-06-09 07:43:59 +00:00
} else if ( $gen_mode == 'label' ) {
2010-03-25 04:27:33 +00:00
/* Setup additional options */
$show_box = ( $report [ 'option' ][ 'field_box' ] == 'yes' ) ? true : false ;
// echo "<pre>"; print_r($d);
2010-06-09 07:43:59 +00:00
switch ( $f ) {
case 'static_box' :
2010-03-25 04:27:33 +00:00
$rep -> label_rect ( $d [ 'x' ], $d [ 'y' ], $d [ 'w' ], $d [ 'h' ]);
2010-06-09 07:43:59 +00:00
break ;
2011-03-19 20:49:06 +00:00
case 'conference_logo' :
2010-06-09 07:43:59 +00:00
$rep -> label_fair_logo ( $d [ 'x' ], $d [ 'y' ], $d [ 'w' ], $d [ 'h' ], $show_box );
break ;
2011-03-19 20:49:06 +00:00
case " projectbarcode " :
$style = array (
'border' => 2 ,
'vpadding' => 'auto' ,
'hpadding' => 'auto' ,
'fgcolor' => array ( 0 , 0 , 0 ),
'bgcolor' => false , //array(255,255,255)
'module_width' => 3 , // width of a single module in points
'module_height' => 3 // height of a single module in points
);
2011-03-19 21:05:18 +00:00
$rep -> label_barcode ( $v , 'QRCODE,H' , $d [ 'x' ], $d [ 'y' ], $d [ 'w' ], $d [ 'h' ], $style , 'N' );
2011-03-19 20:49:06 +00:00
break ;
2010-06-09 07:43:59 +00:00
default :
2011-03-17 23:13:51 +00:00
if ( $f == 'static_text' )
$v = $d [ 'value' ];
2011-03-19 20:49:06 +00:00
$rep -> label_text ( $d [ 'x' ], $d [ 'y' ], $d [ 'w' ], $d [ 'h' ],
$v , $show_box , $d [ 'align' ], $d [ 'valign' ],
$d [ 'fontname' ], $d [ 'fontstyle' ], $d [ 'fontsize' ],
$d [ 'on_overflow' ]);
2011-03-17 23:13:51 +00:00
2010-06-09 07:43:59 +00:00
break ;
2010-03-25 04:27:33 +00:00
}
2007-03-18 19:59:02 +00:00
}
2007-12-30 22:16:34 +00:00
if ( $fields [ $f ][ 'total' ] == true )
$table [ 'total' ] += $v ;
2007-03-18 19:59:02 +00:00
}
2007-03-19 06:51:44 +00:00
if ( count ( $data )) $table [ 'data' ][] = $data ;
2007-03-18 19:59:02 +00:00
}
if ( count ( $table [ 'data' ])) {
2011-02-22 15:24:19 +00:00
$rep -> addTable ( $table );
2007-03-18 19:59:02 +00:00
}
2010-03-25 04:27:33 +00:00
2007-03-18 19:59:02 +00:00
$rep -> output ();
}
2007-03-18 07:10:54 +00:00
?>