Add csv versions of the committee, judge and student nametags. Resolves issue 60.

This commit is contained in:
justin 2006-07-04 20:38:09 +00:00
parent 0e9a889e4f
commit e87a80e04a
4 changed files with 137 additions and 67 deletions

View File

@ -66,9 +66,12 @@ echo "</table>";
echo "<a href=\"reports_projects_details.php?type=pdf\">PDF</a> &nbsp; "; echo "<a href=\"reports_projects_details.php?type=pdf\">PDF</a> &nbsp; ";
echo "<br />"; echo "<br />";
echo i18n("Nametags").": "; echo i18n("Nametags").": ";
echo "<a href=\"reports_nametags_students.php\">Students PDF</a> &nbsp; "; echo "<a href=\"reports_nametags_students.php?type=pdf\">Students PDF</a> &nbsp; ";
echo "<a href=\"reports_nametags_judges.php\">Judges PDF</a> &nbsp; "; echo "<a href=\"reports_nametags_students.php?type=csv\">Students CSV</a> &nbsp; ";
echo "<a href=\"reports_nametags_committee.php\">Committee PDF</a> &nbsp; "; echo "<a href=\"reports_nametags_judges.php?type=pdf\">Judges PDF</a> &nbsp; ";
echo "<a href=\"reports_nametags_judges.php?type=csv\">Judges CSV</a> &nbsp; ";
echo "<a href=\"reports_nametags_committee.phptype=pdf\">Committee PDF</a> &nbsp; ";
echo "<a href=\"reports_nametags_committee.php?type=csv\">Committee CSV</a> &nbsp; ";
echo "<br />"; echo "<br />";

View File

@ -27,11 +27,13 @@
require("../lpdf.php"); require("../lpdf.php");
require("../lcsv.php"); require("../lcsv.php");
if($type=="pdf")
{
$card_width=4; $card_width=4;
$card_height=3; $card_height=3;
$rep=new lpdf( i18n($config['fairname']), $rep=new lpdf( i18n($config['fairname']),
"Student Nametags", "Committee Nametags",
$_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif" $_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif"
); );
@ -39,7 +41,10 @@
$rep->newPage(8.5,11); $rep->newPage(8.5,11);
$rep->setNametagDimensions($card_width,$card_height); $rep->setNametagDimensions($card_width,$card_height);
$rep->setFontSize(11); $rep->setFontSize(11);
}
else if($type=="csv") {
$rep=new lcsv(i18n("Committee Nametags"));
}
$q=mysql_query("SELECT $q=mysql_query("SELECT
name, name,
organization organization
@ -93,7 +98,15 @@ on the page we have tagnum layout like this:
*/ */
if($type=="csv")
{
$table=array();
$table['header'] = array(i18n("Name"),i18n("Organization"));
}
while($r=mysql_fetch_object($q)) while($r=mysql_fetch_object($q))
{
if($type=="pdf")
{ {
$rep->newNametag(); $rep->newNametag();
$rep->setFontSize(18); $rep->setFontSize(18);
@ -102,9 +115,17 @@ on the page we have tagnum layout like this:
$rep->addNametagText(0.90,"Committee"); $rep->addNametagText(0.90,"Committee");
$rep->setFontSize(12); $rep->setFontSize(12);
$rep->addNametagText(1.5,$r->organization); $rep->addNametagText(1.5,$r->organization);
}
else if($type=="csv")
{
$table['data'][]=array($r->name, $r->organization);
}
} }
if($type=="csv")
{
$rep->addTable($table);
}
$rep->output(); $rep->output();

View File

@ -27,11 +27,13 @@
require("../lpdf.php"); require("../lpdf.php");
require("../lcsv.php"); require("../lcsv.php");
if($type=="pdf")
{
$card_width=4; $card_width=4;
$card_height=3; $card_height=3;
$rep=new lpdf( i18n($config['fairname']), $rep=new lpdf( i18n($config['fairname']),
"Student Nametags", "Judge Nametags",
$_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif" $_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif"
); );
@ -40,6 +42,11 @@
$rep->setNametagDimensions($card_width,$card_height); $rep->setNametagDimensions($card_width,$card_height);
$rep->setFontSize(11); $rep->setFontSize(11);
}
else if($type=="csv")
{
$rep=new lcsv(i18n("Judge Nametags"));
}
$q=mysql_query("SELECT $q=mysql_query("SELECT
judges.firstname, judges.firstname,
judges.lastname, judges.lastname,
@ -97,7 +104,15 @@ on the page we have tagnum layout like this:
*/ */
if($type=="csv")
{
$table=array();
$table['header'] = array(i18n("First Name"),i18n("Last Name"),i18n("Organization"));
}
while($r=mysql_fetch_object($q)) while($r=mysql_fetch_object($q))
{
if($type=="pdf")
{ {
$rep->newNametag(); $rep->newNametag();
$rep->setFontSize(18); $rep->setFontSize(18);
@ -106,9 +121,18 @@ on the page we have tagnum layout like this:
$rep->addNametagText(0.90,"Judge"); $rep->addNametagText(0.90,"Judge");
$rep->setFontSize(12); $rep->setFontSize(12);
$rep->addNametagText(1.5,$r->organization); $rep->addNametagText(1.5,$r->organization);
}
else if($type=="csv")
{
$table['data'][]=array($r->firstname, $r->lastname, $r->organization);
}
} }
if($type=="csv")
{
$rep->addTable($table);
}
$rep->output(); $rep->output();

View File

@ -27,6 +27,9 @@
require("../lpdf.php"); require("../lpdf.php");
require("../lcsv.php"); require("../lcsv.php");
$type=$_GET['type'];
if($type=="pdf")
{
$card_width=4; $card_width=4;
$card_height=3; $card_height=3;
@ -39,7 +42,11 @@
$rep->newPage(8.5,11); $rep->newPage(8.5,11);
$rep->setNametagDimensions($card_width,$card_height); $rep->setNametagDimensions($card_width,$card_height);
$rep->setFontSize(11); $rep->setFontSize(11);
}
else if($type=="csv")
{
$rep=new lcsv(i18n("Student Nametags"));
}
$q=mysql_query("SELECT $q=mysql_query("SELECT
registrations.id AS reg_id, registrations.id AS reg_id,
registrations.num AS reg_num, registrations.num AS reg_num,
@ -110,8 +117,15 @@ on the page we have tagnum layout like this:
5 6 5 6
*/ */
if($type=="csv")
{
$table=array();
$table['header'] = array(i18n("First Name"),i18n("Last Name"),i18n("Project Title"),i18n("Category"),i18n("Division"),i18n("Project Number"));
}
while($r=mysql_fetch_object($q)) while($r=mysql_fetch_object($q))
{
if($type=="pdf")
{ {
$rep->newNametag(); $rep->newNametag();
$rep->setFontSize(18); $rep->setFontSize(18);
@ -122,9 +136,17 @@ on the page we have tagnum layout like this:
$rep->addNametagText(1.5,$r->category." - ".$r->division); $rep->addNametagText(1.5,$r->category." - ".$r->division);
$rep->setFontSize(16); $rep->setFontSize(16);
$rep->addNametagText(1.75,"# $r->projectnumber"); $rep->addNametagText(1.75,"# $r->projectnumber");
}
else if($type=="csv")
{
$table['data'][]=array($r->firstname, $r->lastname, $r->title, $r->category, $r->division, $r->projectnumber);
} }
}
if($type=="csv")
{
$rep->addTable($table);
}
$rep->output(); $rep->output();