From 6e3072478550e74aaa7e59a9a467b7a979e0a6cc Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 4 Apr 2010 02:22:55 +0000 Subject: [PATCH] Use the proper judges_teams_id. If there are no projects print a message. --- judge_schedule.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/judge_schedule.php b/judge_schedule.php index b294ba1..cc31032 100644 --- a/judge_schedule.php +++ b/judge_schedule.php @@ -64,7 +64,7 @@ while($t = mysql_fetch_assoc($q)) { $qq = mysql_query("SELECT T.* FROM judges_teams_timeslots_link LEFT JOIN judges_timeslots ON judges_timeslots.id=judges_teams_timeslots_link.judges_timeslots_id LEFT JOIN judges_timeslots AS T ON T.id=judges_timeslots.round_id - WHERE judges_teams_timeslots_link.judges_teams_id={$t['id']}"); + WHERE judges_teams_timeslots_link.judges_teams_id={$t['judges_teams_id']}"); $tt = mysql_fetch_assoc($qq); echo mysql_error(); $t['timeslot'] = $tt; @@ -73,7 +73,7 @@ while($t = mysql_fetch_assoc($q)) { $qq = mysql_query("SELECT award_awards.*,T.type FROM judges_teams_awards_link LEFT JOIN award_awards ON award_awards.id=judges_teams_awards_link.award_awards_id LEFT JOIN award_types as T ON T.id=award_awards.award_types_id - WHERE judges_teams_awards_link.judges_teams_id={$t['id']}"); + WHERE judges_teams_awards_link.judges_teams_id={$t['judges_teams_id']}"); echo mysql_error(); $aa = mysql_fetch_assoc($qq); $t['award'] = $aa; @@ -81,7 +81,7 @@ while($t = mysql_fetch_assoc($q)) { /* Load team members */ $qq = mysql_query("SELECT * FROM judges_teams_link LEFT JOIN users ON users.id=judges_teams_link.users_id - WHERE judges_teams_link.judges_teams_id={$t['id']} + WHERE judges_teams_link.judges_teams_id={$t['judges_teams_id']} ORDER BY judges_teams_link.captain,users.lastname,users.firstname"); $t['members'] = array(); while(($mm = mysql_fetch_assoc($qq))) { @@ -91,7 +91,7 @@ while($t = mysql_fetch_assoc($q)) { /* Load projects */ $qq = mysql_query("SELECT projects.id,projects.projectnumber,projects.title FROM judges_teams_timeslots_projects_link LEFT JOIN projects ON projects.id=judges_teams_timeslots_projects_link.projects_id - WHERE judges_teams_id={$t['id']}"); + WHERE judges_teams_id={$t['judges_teams_id']}"); $p = array(); while(($pp = mysql_fetch_assoc($qq))) $p[] = $pp; @@ -122,13 +122,17 @@ foreach($teams as $t) { echo "
".i18n('Projects').':'; echo ''; - echo ''; - foreach($t['projects'] as $p) { - $pn = urlencode($p['projectnumber']); - echo ""; - echo ""; + if(count($t['projects'])== 0) { + echo i18n("No projects assigned."); + } else { + echo '
{$p['projectnumber']}-{$p['title']}
'; + foreach($t['projects'] as $p) { + $pn = urlencode($p['projectnumber']); + echo ""; + echo ""; + } + echo '
{$p['projectnumber']}-{$p['title']}
'; } - echo '
'; echo '';