From faceec20ed7117f87db38934bd39dcbd1d576a3d Mon Sep 17 00:00:00 2001 From: james Date: Tue, 13 Mar 2007 22:11:18 +0000 Subject: [PATCH] In the judges division groupings, only show the count of projects that are complete or paymentpending --- admin/judges_jdiv.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/admin/judges_jdiv.php b/admin/judges_jdiv.php index 77fdb64..c108ebb 100644 --- a/admin/judges_jdiv.php +++ b/admin/judges_jdiv.php @@ -123,13 +123,16 @@ function get_all_divs() $x = $cat[$cdl[$id]['cat']]; $y = $divshort[$cdl[$id]['div']]; $z = $div[$cdl[$id]['div']]; - $q = mysql_query("SELECT count(id) AS cnt FROM projects WHERE ". + $q = mysql_query("SELECT count(projects.id) AS cnt FROM projects,registrations WHERE ". " projectdivisions_id='{$cdl[$id]['div']}' ". " AND projectcategories_id='{$cdl[$id]['cat']}' ". " AND language='{$cdl[$id]['lang']}' ". - " AND year='{$config['FAIRYEAR']}' "); + " AND registrations.year='{$config['FAIRYEAR']}'". + " AND projects.registrations_id=registrations.id". + " AND (registrations.status='complete' OR registrations.status='paymentpending')"); $r = mysql_fetch_object($q); + echo mysql_error(); $c = $r->cnt; $cdl[$id]['name'] = "$x $y ({$cdl[$id]['lang']}) ($c project".($c==1?'':'s').")";