From 384efa336381d7a22832408eefdd739e3cb5e042 Mon Sep 17 00:00:00 2001 From: justin Date: Sat, 10 Apr 2010 16:51:43 +0000 Subject: [PATCH] need to do same fix in score entry, moved name extractor to common file --- admin/judges.inc.php | 5 +++++ admin/judging_score_edit.php | 7 +------ admin/judging_score_entry.php | 11 +++-------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/admin/judges.inc.php b/admin/judges.inc.php index e3f893d..6144aec 100644 --- a/admin/judges.inc.php +++ b/admin/judges.inc.php @@ -239,6 +239,11 @@ function getJudgingEligibilityCode() { } } +function teamMemberToName($member) +{ + return $member["firstname"] . " " . $member["lastname"]; +} + function judges_load_all() { global $config; diff --git a/admin/judging_score_edit.php b/admin/judging_score_edit.php index ce972ec..666cdd8 100644 --- a/admin/judging_score_edit.php +++ b/admin/judging_score_edit.php @@ -25,10 +25,6 @@ require("../common.inc.php"); require_once("../user.inc.php"); require_once("judges.inc.php"); - function teamMemberToName($member) - { - return $member["firstname"] . " " . $member["lastname"]; - } user_auth_required('committee', 'admin'); send_header("Judging Score Entry - Update", array('Committee Main' => 'committee_main.php', @@ -89,8 +85,7 @@ $q=mysql_query("SELECT * FROM projectdivisions WHERE year='$year' ORDER BY id"); $i = 1; while($r=mysql_fetch_object($q)) { $team=getJudgingTeam($r->judges_teams_id); - $teamMembers=$team['members']; - $teamNames=array_map("teamMemberToName", $teamMembers); + $teamNames=array_map("teamMemberToName", $team['members']); echo "\n"; echo "\n"; echo $r->num; diff --git a/admin/judging_score_entry.php b/admin/judging_score_entry.php index 3382672..7ddc8e8 100644 --- a/admin/judging_score_entry.php +++ b/admin/judging_score_entry.php @@ -108,14 +108,9 @@ $ORDERBY="projects.projectcategories_id, projects.projectdivisions_id, projects. ); echo mysql_error(); while($s=mysql_fetch_object($p)) { - $t = mysql_query("SELECT CONCAT(judges.firstname, ' ', judges.lastname) as name - FROM judges, - judges_teams_link - WHERE judges_teams_link.judges_id = judges.id - AND judges_teams_link.judges_teams_id = " . $s->judges_teams_id - ); - - echo "\t " . mysql_fetch_object($t)->name . " \t $s->score"; + $team=getJudgingTeam($s->judges_teams_id); + $teamNames=array_map("teamMemberToName", $team['members']); + echo "\t " . implode(", ", $teamNames) . " \t $s->score"; } echo "\n";