Use the proper judges_teams_id. If there are no projects print a message.

This commit is contained in:
dave 2010-04-04 02:22:55 +00:00
parent 0dd1637415
commit 6e30724785

View File

@ -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 "<table><tr><td><b>".i18n('Projects').'</b>:';
echo '</td><td>';
echo '<table>';
foreach($t['projects'] as $p) {
$pn = urlencode($p['projectnumber']);
echo "<tr><td>{$p['projectnumber']}</td><td>-</td><td><a href=\"judge_project_summary.php?pn=$pn\" target=\"_blank\">{$p['title']}</a></td>";
echo "</tr>";
if(count($t['projects'])== 0) {
echo i18n("No projects assigned.");
} else {
echo '<table>';
foreach($t['projects'] as $p) {
$pn = urlencode($p['projectnumber']);
echo "<tr><td>{$p['projectnumber']}</td><td>-</td><td><a href=\"judge_project_summary.php?pn=$pn\" target=\"_blank\">{$p['title']}</a></td>";
echo "</tr>";
}
echo '</table>';
}
echo '</table>';
echo '</td></tr></table>';