forked from science-ation/science-ation
This now prompts for which fields to display in the name tag (pdf).
This commit is contained in:
parent
5edba483e3
commit
4c08f9c517
@ -27,7 +27,83 @@
|
||||
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 "<a href=\"index.php\"><< ".i18n("Back to Administration")."</a> ";
|
||||
echo "<a href=\"reports.php\"><< ".i18n("Back to Reports")."</a><br />";
|
||||
echo "<br />";
|
||||
echo "<table><tr><td>";
|
||||
echo i18n("Day of Fair Registration/Checkin Forms").": ";
|
||||
echo "</td>";
|
||||
|
||||
/*
|
||||
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 "<form action=\"reports_nametags_students.php\" method=\"post\">\n";
|
||||
echo "<input type=\"hidden\" value=\"" . $type . "\" name=\"type\">\n";
|
||||
|
||||
echo "<table>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td>\n";
|
||||
echo "<input type=\"checkbox\" name=\"title\" checked> Project Title\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td>\n";
|
||||
echo "<input type=\"checkbox\" name=\"projectnumber\" checked> Project Number\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td>\n";
|
||||
echo "<input type=\"checkbox\" name=\"firstname\" checked> Student's First Name\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td>\n";
|
||||
echo "<input type=\"checkbox\" name=\"lastname\" checked> Student's Surname Name\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td>\n";
|
||||
echo "<input type=\"checkbox\" name=\"category\" checked> Project Category\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td>\n";
|
||||
echo "<input type=\"checkbox\" name=\"division\" checked> Project Division\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td>\n";
|
||||
echo "<input type=\"submit\" value=\"Continue\">\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>";
|
||||
echo "</form>\n";
|
||||
|
||||
send_footer();
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if($type=="pdf")
|
||||
{
|
||||
$card_width=4;
|
||||
@ -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);
|
||||
|
||||
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);
|
||||
if($projectnumber)
|
||||
$rep->addNametagText(1.75,"# $r->projectnumber");
|
||||
else
|
||||
$rep->addNametagText(1.75," ");
|
||||
|
||||
}
|
||||
else if($type=="csv")
|
||||
{
|
||||
@ -150,4 +253,6 @@ on the page we have tagnum layout like this:
|
||||
|
||||
$rep->output();
|
||||
|
||||
} // Close the if-statement that governs whether or not to display the fields
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user