From e766945fcb2b9bd00128fae0be7d6eff6652e9a6 Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 5 Apr 2009 19:20:43 +0000 Subject: [PATCH] Update the stats for the nwe user system --- admin/ysfstats.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/admin/ysfstats.php b/admin/ysfstats.php index d202fa0..434b1fe 100644 --- a/admin/ysfstats.php +++ b/admin/ysfstats.php @@ -233,14 +233,22 @@ $stats["proj910"]=$projs["910"]?$projs["910"]:0; $stats["proj11up"]=$projs["11up"]?$projs["11up"]:0; - $q=mysql_query("SELECT COUNT(id) AS num FROM users WHERE types LIKE '%committee%' AND deleted='no'"); + $q=mysql_query("SELECT COUNT(id) AS num FROM users + WHERE types LIKE '%committee%' + AND year='$year' + AND deleted='no'"); $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 i18n("Committee Members: %1 (note: this is number of committee members who logged in to SFIAB for the year, anyone who was active but didn't log in to SFIAB will NOT be counted)",array($r->num)); echo "
"; $stats["committee"]=$numcommittee; - $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'"); + $q=mysql_query("SELECT COUNT(id) AS num FROM users LEFT JOIN users_judge ON users_judge.users_id=users.id + WHERE users.year='$year' + AND users.types LIKE '%judge%' + AND users.deleted='no' + AND users_judge.judge_complete='yes' + AND users_judge.judge_active='yes'"); $r=mysql_fetch_object($q); $numjudges=$r->num; echo i18n("Judges: %1",array($r->num));