From 29f545f80f80d1bf5a7cd8cfdf47064b0a7fb149 Mon Sep 17 00:00:00 2001 From: james Date: Fri, 5 Oct 2007 17:34:06 +0000 Subject: [PATCH] The rest of the stats required for regional affiliation with YSF --- admin/ysfstats.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/admin/ysfstats.php b/admin/ysfstats.php index bc8aa47..cc753a4 100644 --- a/admin/ysfstats.php +++ b/admin/ysfstats.php @@ -85,5 +85,41 @@ echo i18n("11 up Unknown: %1",array($nums["11up"][""]?$nums["11up"][""]:0))."
"; echo "
"; + + //number of students per grade per gender + $q=mysql_query("SELECT MAX(students.grade) grade FROM students,registrations,projects WHERE students.registrations_id=registrations.id AND projects.registrations_id=registrations.id AND students.year='$year' AND registrations.year='$year' AND projects.year='$year' AND (registrations.status='complete' OR registrations.status='paymentpending') GROUP BY projects.id"); + echo mysql_error(); + while($r=mysql_fetch_object($q)) { + if($r->grade<=6) + $projs["6down"]++; + else if($r->grade>6&&$r->grade<=8) + $projs["78"]++; + else if($r->grade>8&&$r->grade<=10) + $projs["910"]++; + else if($r->grade>10) + $projs["11up"]++; + } + + echo "Project participation (by age group)
"; + echo i18n("K-6: %1",array($projs["6down"]?$projs["6down"]:0))."
"; + echo i18n("7-8: %1",array($projs["78"]?$projs["78"]:0))."
"; + echo i18n("9-10: %1",array($projs["910"]?$projs["910"]:0))."
"; + echo i18n("11 up: %1",array($projs["11up"]?$projs["11up"]:0))."
"; + echo "
"; + + $q=mysql_query("SELECT COUNT(id) AS num FROM committees_members WHERE deleted='N'"); + $r=mysql_fetch_object($q); + $numcommittee=$r->num; + echo i18n("Committee Members: %1 (note: this is CURRENT number of active committee members as of right now! There is no way to extract committee member numbers from previous years)",array($r->num)); + echo "
"; + + $q=mysql_query("SELECT COUNT(id) AS num FROM judges,judges_years WHERE judges_years.judges_id=judges.id AND judges_years.year='$year' AND judges.complete='yes' AND judges.deleted='no'"); + $r=mysql_fetch_object($q); + $numjudges=$r->num; + echo i18n("Judges: %1",array($r->num)); + echo "
"; + + + send_footer(); ?>