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 @@
-/*
+/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
@@ -26,8 +26,84 @@
auth_required('admin');
require("../lpdf.php");
require("../lcsv.php");
-
- $type=$_GET['type'];
+
+ $type=$_POST['type'];
+ if($type == "")
+ {
+ $type = $_GET['type'];
+ }
+
+ $title=$_POST['title'];
+ $projectnumber=$_POST['projectnumber'];
+ $firstname=$_POST['firstname'];
+ $lastname=$_POST['lastname'];
+ $category=$_POST['category'];
+ $division=$_POST['division'];
+
+ if($title == "" && $projectnumber == "" && $firstname == "" && $lastnmae == "" && $category == "" && $division == "")
+ {
+
+ send_header("Administration - Reports");
+ echo "<< ".i18n("Back to Administration")." ";
+ echo "<< ".i18n("Back to Reports")."
";
+ echo "
";
+ echo "
"; + echo i18n("Day of Fair Registration/Checkin Forms").": "; + 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"; + + 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 + ?>