need to do same fix in score entry, moved name extractor to common file

This commit is contained in:
justin 2010-04-10 16:51:43 +00:00
parent 876899d17f
commit 384efa3363
3 changed files with 9 additions and 14 deletions

View File

@ -239,6 +239,11 @@ function getJudgingEligibilityCode() {
}
}
function teamMemberToName($member)
{
return $member["firstname"] . " " . $member["lastname"];
}
function judges_load_all()
{
global $config;

View File

@ -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 "<tr>\n";
echo "<td style=\"vertical-align: middle\">\n";
echo $r->num;

View File

@ -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";