Add 1x4" judging sheet stickers for use on the CWSF judging sheets. It contains the project number, title, and category/division.

This commit is contained in:
james 2007-02-07 22:05:59 +00:00
parent ca040924e3
commit 1d203535ee
2 changed files with 119 additions and 1 deletions

View File

@ -72,7 +72,8 @@ echo "</table>";
echo i18n("Project Table Labels").": ";
echo "<a href=\"reports_projects_tablelabels.php?type=pdf\">PDF</a> &nbsp; ";
echo "<br />";
echo i18n("Project Summary Details").": ";
echo i18n("Project Summary Details").": ";
echo "<a href=\"reports_projects_details.php?type=pdf\">PDF</a> &nbsp; ";
echo "<br />";
echo i18n("Nametags").": ";
@ -106,6 +107,12 @@ echo "</table>";
echo "<a href=\"reports_projects_judges_teams.php?type=csv\">CSV</a> &nbsp; ";
echo "<a href=\"reports_projects_judges_teams.php?type=pdf\">PDF</a> &nbsp; ";
echo "<br />";
echo i18n("Project Identification Labels (for judging sheets)").": ";
echo "<a href=\"reports_projects_judgingstickers.php?type=pdf\">PDF</a> &nbsp; ";
echo "<br />";
echo "<br />";
echo "<br />";

View File

@ -0,0 +1,111 @@
<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Copyright (C) 2007 Sci-Tech Ontario Inc <info@scitechontario.org>
Copyright (C) 2007 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("../common.inc.php");
auth_required('admin');
require("../lpdf.php");
require("../lcsv.php");
$type="pdf";
$reportname="Project Identification Labels";
if($type=="pdf")
{
$card_width=4;
$card_height=1;
$xspacer=0.08;
$yspacer=0.08;
$fontsize=12;
$rep=new lpdf( i18n($config['fairname']),
"$reportname",
$_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif"
);
$rep->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();
?>