require("../common.inc.php"); require("../lpdf.php"); $pdf=new lpdf(i18n($config['fairname']),i18n("Checkin List")); //lets split this up by age category, then sort each one by division... so first, just get the age categories $catq=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' ORDER BY id"); while($catr=mysql_fetch_object($catq)) { $q=mysql_query("SELECT registrations.id AS reg_id, registrations.num AS reg_num, registrations.status, projects.title, projects.projectdivisions_id FROM registrations left outer join projects on projects.registrations_id=registrations.id WHERE registrations.year='".$config['FAIRYEAR']."' AND ( registrations.status='complete' OR registrations.status='paymentpending' ) AND projects.projectcategories_id='$catr->id' ORDER BY registrations.status DESC, projects.title "); echo mysql_error(); $table=array(); $table['header']=array(i18n("Paid?"),i18n("Proj #"),i18n("Project Title"),i18n("Student(s)"),i18n("Div")); $table['widths']=array(0.5, 0.6, 3.5, 2.4, 0.5); $table['dataalign']=array("center","left","left","left","center"); while($r=mysql_fetch_object($q)) { switch($r->status) { case "paymentpending": $status_text="No"; break; case "complete": $status_text=""; break; } $status_text=i18n($status_text); $divq=mysql_query("SELECT division FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' AND id='".$r->projectdivisions_id."'"); $divr=mysql_fetch_object($divq); $sq=mysql_query("SELECT students.firstname, students.lastname, schools.school FROM students,schools WHERE students.registrations_id='$r->reg_id' AND students.schools_id=schools.id "); echo mysql_error(); $schools=""; $students=""; while($studentinfo=mysql_fetch_object($sq)) { $students.="$studentinfo->firstname $studentinfo->lastname\n"; $schools.="$studentinfo->school\n"; } $table['data'][]=array($status_text,$r->proj_num,$r->title,$students,i18n($divr->division_short)); } $pdf->addTable($table); $pdf->newPage(); } /* echo "
".i18n("Status")." | "; echo "".i18n("Reg Num")." | "; echo "".i18n("Project Title")." | "; echo "".i18n("Age Category")." | "; echo "".i18n("Division")." | "; echo "".i18n("School(s)")." | "; echo "".i18n("Student(s)")." | "; echo "
---|---|---|---|---|---|---|
$status_text | "; echo "$r->reg_num | "; echo "$r->title | "; //now get thh category and division $catq=mysql_query("SELECT category FROM projectcategories WHERE year='".$config['FAIRYEAR']."' AND id='".$r->projectcategories_id."'"); $catr=mysql_fetch_object($catq); $divq=mysql_query("SELECT division FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' AND id='".$r->projectdivisions_id."'"); $divr=mysql_fetch_object($divq); echo "".i18n("$catr->category")." | "; echo "".i18n("$divr->division")." | "; $sq=mysql_query("SELECT students.firstname, students.lastname, schools.school FROM students,schools WHERE students.registrations_id='$r->reg_id' AND students.schools_id=schools.id "); echo mysql_error(); $studnum=1; $schools=""; $students=""; while($studentinfo=mysql_fetch_object($sq)) { $students.="$studentinfo->firstname $studentinfo->lastname$schools | "; echo "$students | "; echo "