From 1555f192930bd425192e9ac3c4a1a3fcd0b6aba8 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 13 Jan 2005 16:51:43 +0000 Subject: [PATCH] separate the division and category from the main query so we can make sure we match up the div/cats with the proper FAIRYEAR without using crazy joins and still making sure the record is displayed if no cat/div is specified yet --- admin/registration_list.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/admin/registration_list.php b/admin/registration_list.php index f3c2283..63ac346 100644 --- a/admin/registration_list.php +++ b/admin/registration_list.php @@ -31,13 +31,11 @@ else $wherestatus=""; registrations.num AS reg_num, registrations.status, projects.title, - projectcategories.category, - projectdivisions.division + projects.projectcategories_id, + projects.projectdivisions_id FROM registrations left outer join projects on projects.registrations_id=registrations.id - left outer join projectcategories on projects.projectcategories_id=projectcategories.id - left outer join projectdivisions on projects.projectdivisions_id=projectdivisions.id WHERE 1 $wherestatus @@ -46,6 +44,7 @@ else $wherestatus=""; projects.title "); echo mysql_error(); + echo ""; echo ""; echo ""; @@ -72,8 +71,17 @@ else $wherestatus=""; echo ""; echo ""; echo ""; - echo ""; - echo ""; + + + //now get thh category and division + $catq=mysql_query("SELECT category FROM projectcategories WHERE year='".$config['FAIRYEAR']."' AND id='".$r->projectcategories_id."'"); + $catr=mysql_fetch_object($catq); + $divq=mysql_query("SELECT division FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' AND id='".$r->projectdivisions_id."'"); + $divr=mysql_fetch_object($divq); + + echo ""; + + echo ""; $sq=mysql_query("SELECT students.firstname, students.lastname,
".i18n("Status")."$status_text$r->reg_num$r->title".i18n("$r->category")."".i18n("$r->division")."".i18n("$catr->category")."".i18n("$divr->division")."