This will prompt for which fields to display on the project table label. By default all of the checkboxes are ticked.

This commit is contained in:
jesse 2007-02-24 19:59:55 +00:00
parent 25412b6054
commit 5edba483e3

View File

@ -1,5 +1,5 @@
<?
/*
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
@ -27,7 +27,78 @@
require("../lpdf.php");
require("../lcsv.php");
$type=$_GET['type'];
$type=$_POST['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\">&lt;&lt; ".i18n("Back to Administration")."</a>&nbsp;&nbsp;";
echo "<a href=\"reports.php\">&lt;&lt; ".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_projects_tablelabels.php\" method=\"post\">\n";
echo "<input type=\"hidden\" value=\"pdf\" 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")
{
@ -45,7 +116,7 @@
$rep=new lcsv(i18n("Table Labels"));
}
$projq=mysql_query("SELECT
$projq=mysql_query("SELECT
registrations.id AS reg_id,
registrations.num AS reg_num,
projects.id,
@ -62,7 +133,7 @@
LEFT JOIN projects on projects.registrations_id=registrations.id
WHERE
projects.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' )
@ -70,13 +141,21 @@
projects.projectnumber
");
echo mysql_error();
while($proj=mysql_fetch_object($projq))
{
$rep->setFontSize(22);
$rep->addtext($proj->title,"center");
if($title)
$rep->addtext($proj->title,"center");
else
$rep->nextLine();
$rep->setFontSize(150);
$rep->addtext($proj->projectnumber,"center");
if($projectnumber)
$rep->addtext($proj->projectnumber,"center");
else
$rep->nextLine();
$rep->setFontSize(22);
@ -94,7 +173,13 @@
while($studentinfo=mysql_fetch_object($sq))
{
if($studnum>0) $students.=", ";
$students.="$studentinfo->firstname $studentinfo->lastname";
if($firstname && $lastname)
$students.="$studentinfo->firstname $studentinfo->lastname";
else if($firstname)
$students.="$studentinfo->firstname";
else if($lastname)
$students.="$studentinfo->lastname";
$studnum++;
}
$rep->nextLine();
@ -102,10 +187,16 @@
$rep->addText($students,"center");
$rep->nextLine();
$rep->nextLine();
$rep->addText(i18n($proj->category)." - ".i18n($proj->division),"center");
if($category && $division)
$rep->addText(i18n($proj->category)." - ".i18n($proj->division),"center");
else if($category)
$rep->addText(i18n($proj->category),"center");
else if($division)
$rep->addText(i18n($proj->division),"center");
$rep->newPage();
}
$rep->output();
}
?>