From 5ff9494d48fcb385cd9d7350e9829e0fd521e957 Mon Sep 17 00:00:00 2001 From: james Date: Mon, 16 Jan 2006 04:55:46 +0000 Subject: [PATCH] Fix judges info to properly show the age category preference and areas of expertise --- admin/judges_info.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/admin/judges_info.php b/admin/judges_info.php index d738deb..0d51a77 100644 --- a/admin/judges_info.php +++ b/admin/judges_info.php @@ -88,7 +88,7 @@ $preferencechoices=array( echo "\n"; echo " ".i18n("Age category preference").""; -$q=mysql_query("SELECT judges_catpref.*,projectcategories.category FROM judges_catpref,projectcategories WHERE judges_id='{$_GET['id']}' AND judges_catpref.year='".$config['FAIRYEAR']."' AND judges_catpref.projectcategories_id=projectcategories.id"); +$q=mysql_query("SELECT judges_catpref.*,projectcategories.category FROM judges_catpref,projectcategories WHERE judges_id='{$_GET['id']}' AND judges_catpref.year='".$config['FAIRYEAR']."' AND projectcategories.year='".$config['FAIRYEAR']."' AND judges_catpref.projectcategories_id=projectcategories.id"); echo mysql_error(); while($r=mysql_fetch_object($q)) echo i18n($r->category).": ".$preferencechoices[$r->rank]."
"; @@ -158,7 +158,7 @@ while($r=mysql_fetch_object($q)) echo ""; //grab the list of divisions, because the last fields of the table will be the sub-divisions - $q=mysql_query("SELECT * FROM projectdivisions ORDER BY id AND year='".$config['FAIRYEAR']."'"); + $q=mysql_query("SELECT * FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' ORDER BY id"); $divs=array(); while($r=mysql_fetch_object($q)) { @@ -166,9 +166,15 @@ while($r=mysql_fetch_object($q)) $divnames[$r->id]=$r->division; } - $subdivq=mysql_query("SELECT judges_expertise.*, projectsubdivisions.subdivision, projectsubdivisions.projectdivisions_id AS parent_id FROM judges_expertise + $subdivq=mysql_query("SELECT judges_expertise.*, + projectsubdivisions.subdivision, + projectsubdivisions.projectdivisions_id AS parent_id + FROM judges_expertise LEFT JOIN projectsubdivisions ON judges_expertise.projectsubdivisions_id=projectsubdivisions.id - WHERE judges_id='$judgeinfo->id' AND judges_expertise.year='".$config['FAIRYEAR']."' ORDER BY projectdivisions_id, projectsubdivisions_id"); + WHERE judges_id='$judgeinfo->id' + AND judges_expertise.year='".$config['FAIRYEAR']."' + ORDER BY projectdivisions_id, projectsubdivisions_id"); + echo mysql_error(); $judge_divs=array(); $judge_subdivs=array(); $divdata=array();