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 $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 ON judges_timeslots.id=judges_teams_timeslots_link.judges_timeslots_id
LEFT JOIN judges_timeslots AS T ON T.id=judges_timeslots.round_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); $tt = mysql_fetch_assoc($qq);
echo mysql_error(); echo mysql_error();
$t['timeslot'] = $tt; $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 $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_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 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(); echo mysql_error();
$aa = mysql_fetch_assoc($qq); $aa = mysql_fetch_assoc($qq);
$t['award'] = $aa; $t['award'] = $aa;
@ -81,7 +81,7 @@ while($t = mysql_fetch_assoc($q)) {
/* Load team members */ /* Load team members */
$qq = mysql_query("SELECT * FROM judges_teams_link $qq = mysql_query("SELECT * FROM judges_teams_link
LEFT JOIN users ON users.id=judges_teams_link.users_id 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"); ORDER BY judges_teams_link.captain,users.lastname,users.firstname");
$t['members'] = array(); $t['members'] = array();
while(($mm = mysql_fetch_assoc($qq))) { while(($mm = mysql_fetch_assoc($qq))) {
@ -91,7 +91,7 @@ while($t = mysql_fetch_assoc($q)) {
/* Load projects */ /* Load projects */
$qq = mysql_query("SELECT projects.id,projects.projectnumber,projects.title FROM judges_teams_timeslots_projects_link $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 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(); $p = array();
while(($pp = mysql_fetch_assoc($qq))) while(($pp = mysql_fetch_assoc($qq)))
$p[] = $pp; $p[] = $pp;
@ -122,6 +122,9 @@ foreach($teams as $t) {
echo "<table><tr><td><b>".i18n('Projects').'</b>:'; echo "<table><tr><td><b>".i18n('Projects').'</b>:';
echo '</td><td>'; echo '</td><td>';
if(count($t['projects'])== 0) {
echo i18n("No projects assigned.");
} else {
echo '<table>'; echo '<table>';
foreach($t['projects'] as $p) { foreach($t['projects'] as $p) {
$pn = urlencode($p['projectnumber']); $pn = urlencode($p['projectnumber']);
@ -129,6 +132,7 @@ foreach($teams as $t) {
echo "</tr>"; echo "</tr>";
} }
echo '</table>'; echo '</table>';
}
echo '</td></tr></table>'; echo '</td></tr></table>';