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 ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $stats_totalprojects=0; $stats_totalstudents=0; $stats_divisions=array(); $stats_categories=array(); while($r=mysql_fetch_object($q)) { $stats_totalprojects++; $stats_divisions[$r->projectdivisions_id]++; $stats_categories[$r->projectcategories_id]++; echo ""; echo ""; echo ""; echo ""; //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 ""; echo ""; $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.="$studentinfo->school
"; $stats_totalstudents++; } echo ""; echo ""; echo ""; } echo "
".i18n("Status")."".i18n("Reg Num")."".i18n("Project Title")."".i18n("Age Category")."".i18n("Division")."".i18n("School(s)")."".i18n("Student(s)")."
$status_text$r->reg_num$r->title".i18n("$catr->category")."".i18n("$divr->division")."$schools$students
\n"; */ $pdf->output(); ?>