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').")";