From 1d203535ee71847bd03dbd81a728cd27872d4a5b Mon Sep 17 00:00:00 2001 From: james Date: Wed, 7 Feb 2007 22:05:59 +0000 Subject: [PATCH] Add 1x4" judging sheet stickers for use on the CWSF judging sheets. It contains the project number, title, and category/division. --- admin/reports.php | 9 +- admin/reports_projects_judgingstickers.php | 111 +++++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 admin/reports_projects_judgingstickers.php diff --git a/admin/reports.php b/admin/reports.php index 4ccd173..79ef1bc 100644 --- a/admin/reports.php +++ b/admin/reports.php @@ -72,7 +72,8 @@ echo ""; echo i18n("Project Table Labels").": "; echo "PDF   "; echo "
"; - echo i18n("Project Summary Details").": "; + + echo i18n("Project Summary Details").": "; echo "PDF   "; echo "
"; echo i18n("Nametags").": "; @@ -106,6 +107,12 @@ echo ""; echo "CSV   "; echo "PDF   "; + echo "
"; + echo i18n("Project Identification Labels (for judging sheets)").": "; + echo "PDF   "; + echo "
"; + + echo "
"; echo "
"; diff --git a/admin/reports_projects_judgingstickers.php b/admin/reports_projects_judgingstickers.php new file mode 100644 index 0000000..5b60bcd --- /dev/null +++ b/admin/reports_projects_judgingstickers.php @@ -0,0 +1,111 @@ + + Copyright (C) 2007 James Grant + + 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. +*/ +?> +setPageStyle("labels"); + $rep->newPage(8.5,11); + $rep->setLabelDimensions($card_width,$card_height,$xspacer,$yspacer,$fontsize); + } + else if($type=="csv") { + $rep=new lcsv(i18n("$reportname ")); + } + + $projq=mysql_query("SELECT + registrations.id AS reg_id, + registrations.num AS reg_num, + projects.id, + projects.title, + projects.projectnumber, + projects.projectdivisions_id, + projects.projectcategories_id, + projectdivisions.division, + projectcategories.category + FROM + registrations + LEFT JOIN projectdivisions ON projectdivisions.id=projects.projectdivisions_id + LEFT JOIN projectcategories ON projectcategories.id=projects.projectcategories_id + LEFT JOIN projects on projects.registrations_id=registrations.id + + WHERE + projects.year='".$config['FAIRYEAR']."' + AND projectdivisions.year='".$config['FAIRYEAR']."' + AND projectcategories.year='".$config['FAIRYEAR']."' + AND ( registrations.status='complete' OR registrations.status='paymentpending' ) + ORDER BY + projects.projectnumber + "); + echo mysql_error(); + + if($type=="csv") + { + $table=array(); + $table['header'] = array( + i18n("Project Number"), + i18n("Project Title"), + i18n("Division"), + i18n("Category")); + } + + while($proj=mysql_fetch_object($projq)) + { + if($type=="pdf") + { + $rep->newLabel(); + $rep->addLabelText(.05,$proj->projectnumber); + $rep->addLabelText(.300,$proj->category." / ".$proj->division); + $rep->addLabelText(.500,$proj->title); + + } + else if($type=="csv") + { + $table['data'][]=array($proj->projectnumber,$proj->title,$proj->division,$proj->category); + } + } + + if($type=="csv") + $rep->addTable($table); + + $rep->output(); +?>