<< ".i18n("Back to Administration").""; echo "   "; echo "<< ".i18n("Back to Registration").""; echo "
"; echo "
"; echo i18n("Choose Status").":"; echo "
"; echo ""; echo "
"; if($_GET['showstatus']) $wherestatus="AND status='".$_GET['showstatus']."' "; else $wherestatus=""; $q=mysql_query("SELECT registrations.id AS reg_id, registrations.num AS reg_num, registrations.status, projects.title, projects.projectcategories_id, projects.projectdivisions_id FROM registrations left outer join projects on projects.registrations_id=registrations.id WHERE 1 AND registrations.year='".$config['FAIRYEAR']."' $wherestatus ORDER BY registrations.status DESC, projects.title "); echo mysql_error(); 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]++; switch($r->status) { case "new": $status_text="New"; break; case "open": $status_text="Open"; break; case "paymentpending": $status_text="Payment Pending"; break; case "complete": $status_text="Complete"; break; } $status_text=i18n($status_text); 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"; echo "
"; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo ""; $q=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' ORDER BY id"); while($r=mysql_fetch_object($q)) echo "\n"; echo ""; echo ""; $q=mysql_query("SELECT * FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' ORDER BY id"); while($r=mysql_fetch_object($q)) echo "\n"; echo "

".i18n("Project / Student totals")."

".i18n("Total Projects").":$stats_totalprojects
".i18n("Total Students").": $stats_totalstudents

".i18n("Projects per age category")."

".i18n($r->category).":".($stats_categories[$r->id]?$stats_categories[$r->id]:"0")."

".i18n("Projects per division")."

".i18n($r->division).":".($stats_divisions[$r->id]?$stats_divisions[$r->id]:"0")."
"; echo "
"; echo i18n("Note: statistics reflect the numbers of the current 'Status' selected at the top of the page"); echo "
"; echo "
"; send_footer(); ?>