From 4c08f9c517ce7f56f131b5ae078ec3776637397e Mon Sep 17 00:00:00 2001 From: jesse Date: Sat, 24 Feb 2007 20:24:22 +0000 Subject: [PATCH] This now prompts for which fields to display in the name tag (pdf). --- admin/reports_nametags_students.php | 137 ++++++++++++++++++++++++---- 1 file changed, 121 insertions(+), 16 deletions(-) diff --git a/admin/reports_nametags_students.php b/admin/reports_nametags_students.php index 59c1f24..6c463ba 100644 --- a/admin/reports_nametags_students.php +++ b/admin/reports_nametags_students.php @@ -1,5 +1,5 @@ << ".i18n("Back to Administration")."  "; + echo "<< ".i18n("Back to Reports")."
"; + echo "
"; + echo ""; + + /* + We need to prompt them for the fields. We will display check boxes for + every field. By default all of the fields are checked. + */ + echo "\n\n"; + echo "\n"; + echo "\n"; + + echo "
"; + echo i18n("Day of Fair Registration/Checkin Forms").": "; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo " Project Title\n"; + echo "
\n"; + echo " Project Number\n"; + echo "
\n"; + echo " Student's First Name\n"; + echo "
\n"; + echo " Student's Surname Name\n"; + echo "
\n"; + echo " Project Category\n"; + echo "
\n"; + echo " Project Division\n"; + echo "
\n"; + echo "\n"; + echo "
"; + echo "\n"; + + send_footer(); + + + } + else + { if($type=="pdf") { $card_width=4; @@ -42,12 +118,12 @@ $rep->newPage(8.5,11); $rep->setNametagDimensions($card_width,$card_height); $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.num AS reg_num, projects.id, @@ -67,15 +143,15 @@ LEFT JOIN students ON students.registrations_id=registrations.id WHERE - projects.year='".$config['FAIRYEAR']."' - AND projectdivisions.year='".$config['FAIRYEAR']."' - AND projectcategories.year='".$config['FAIRYEAR']."' + 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(); -// +// /* this is 4x3" on my screen, so i'll use it to figure out what it should look like in a semi-proporational @@ -117,7 +193,7 @@ on the page we have tagnum layout like this: 5 6 */ - if($type=="csv") + if($type=="csv") { $table=array(); $table['header'] = array(i18n("First Name"),i18n("Last Name"),i18n("Project Title"),i18n("Category"),i18n("Division"),i18n("Project Number")); @@ -129,13 +205,40 @@ on the page we have tagnum layout like this: { $rep->newNametag(); $rep->setFontSize(18); - $rep->addNametagText(0.0,"$r->firstname $r->lastname"); + $studentName = " "; + if($firstname && $lastname) + $studentName = "$r->firstname $r->lastname"; + else if($firstname) + $studentName = "$r->firstname"; + else if($lastname) + $studentName = "$r->lastname"; + + $rep->addNametagText(0.0,"$studentName"); $rep->setFontSize(14); - $rep->addNametagText(0.75,"$r->title"); + + if($title) + $rep->addNametagText(0.75,"$r->title"); + else + $rep->addNametagText(0.75," "); + $rep->setFontSize(12); - $rep->addNametagText(1.5,$r->category." - ".$r->division); + + $categoryDivision = " "; + if($category && $division) + $categoryDivision = $r->category." - ".$r->division; + else if($category) + $categoryDivision = $r->category; + else if($division) + $categoryDivision = $r->division; + + $rep->addNametagText(1.5,$categoryDivision); + $rep->setFontSize(16); - $rep->addNametagText(1.75,"# $r->projectnumber"); + if($projectnumber) + $rep->addNametagText(1.75,"# $r->projectnumber"); + else + $rep->addNametagText(1.75," "); + } else if($type=="csv") { @@ -143,11 +246,13 @@ on the page we have tagnum layout like this: } } - if($type=="csv") + if($type=="csv") { $rep->addTable($table); } $rep->output(); - + + } // Close the if-statement that governs whether or not to display the fields + ?>