From 7ea92bbcb474c53b4a665203618462fd76fa2fb3 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 30 Mar 2006 17:05:36 +0000 Subject: [PATCH] Properly handle empty judging teams --- admin/reports_judges_teams.php | 7 +++++-- admin/reports_judges_teams_view.php | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/admin/reports_judges_teams.php b/admin/reports_judges_teams.php index b058c7e..2a21b2a 100644 --- a/admin/reports_judges_teams.php +++ b/admin/reports_judges_teams.php @@ -56,9 +56,12 @@ foreach($teams AS $team) { - foreach($team['members'] AS $member) + if(count($team['members'])) { - $table['data'][]=array($team['num'],$team['name'],$member['captain'],$member['firstname'],$member['lastname']); + foreach($team['members'] AS $member) + { + $table['data'][]=array($team['num'],$team['name'],$member['captain'],$member['firstname'],$member['lastname']); + } } } diff --git a/admin/reports_judges_teams_view.php b/admin/reports_judges_teams_view.php index 003fa0e..da11462 100644 --- a/admin/reports_judges_teams_view.php +++ b/admin/reports_judges_teams_view.php @@ -70,9 +70,12 @@ $awardstr=substr($awardstr,0,-2); $rep->addText($awardstr); - foreach($team['members'] AS $member) + if(count($team['members'])) { - $table['data'][]=array($member['captain'],$member['firstname'],$member['lastname']); + foreach($team['members'] AS $member) + { + $table['data'][]=array($member['captain'],$member['firstname'],$member['lastname']); + } } $rep->addTable($table);