diff --git a/admin/registration.php b/admin/registration.php index fbe0a21..7d6aa4b 100644 --- a/admin/registration.php +++ b/admin/registration.php @@ -4,7 +4,7 @@ echo "<< ".i18n("Back to Administration")."
"; echo "
"; echo "".i18n("Input Received Forms")."
"; - echo "".i18n("Registration List")."
"; + echo "".i18n("Registration List and Statistics")."
"; diff --git a/admin/registration_list.php b/admin/registration_list.php index a33b09b..355d6db 100644 --- a/admin/registration_list.php +++ b/admin/registration_list.php @@ -2,7 +2,7 @@ require("../common.inc.php"); require("../register_participants.inc.php"); - send_header("Participant Registration - List"); + send_header("Participant Registration - List and Statistics"); echo "<< ".i18n("Back to Administration").""; echo "   "; echo "<< ".i18n("Back to Registration").""; @@ -40,6 +40,7 @@ else $wherestatus=""; left outer join projects on projects.registrations_id=registrations.id WHERE 1 + AND registrations.year='".$config['FAIRYEAR']."' $wherestatus ORDER BY registrations.status DESC, @@ -57,9 +58,17 @@ else $wherestatus=""; echo "".i18n("School(s)").""; echo "".i18n("Student(s)").""; 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; @@ -81,6 +90,7 @@ else $wherestatus=""; $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").""; @@ -104,6 +114,7 @@ else $wherestatus=""; { $students.="$studentinfo->firstname $studentinfo->lastname
"; $schools.="$studentinfo->school
"; + $stats_totalstudents++; } echo "$schools"; echo "$students"; @@ -113,6 +124,29 @@ else $wherestatus=""; echo "\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(); ?>