can name judging teams however the chief judge wants

This commit is contained in:
james 2005-03-29 19:38:58 +00:00
parent 7ba1196957
commit a5198a8c59

View File

@ -43,6 +43,12 @@ function delbuttonclicked(team_id,team_num,judge)
document.forms.judges.submit();
}
function saveteamnamesbuttonclicked()
{
document.forms.judges.action.value="saveteamnames";
document.forms.judges.submit();
}
</script>
<?
@ -93,6 +99,19 @@ function delbuttonclicked(team_id,team_num,judge)
}
if($_POST['action']=="saveteamnames")
{
if(count($_POST['teamname']))
{
foreach($_POST['teamname'] AS $team_id=>$team_name)
{
mysql_query("UPDATE judges_teams SET name='".mysql_escape_string(stripslashes($team_name))."' WHERE id='$team_id'");
}
echo happy(i18n("Team names successfully saved"));
}
}
echo "<form name=\"judges\" method=\"post\" action=\"judges_teams.php\">";
@ -163,6 +182,7 @@ function delbuttonclicked(team_id,team_num,judge)
$q=mysql_query("SELECT judges_teams.id,
judges_teams.num,
judges_teams.name,
judges.id AS judges_id,
judges.firstname,
judges.lastname
@ -190,6 +210,7 @@ function delbuttonclicked(team_id,team_num,judge)
{
$teams[$r->id]['id']=$r->id;
$teams[$r->id]['num']=$r->num;
$teams[$r->id]['name']=$r->name;
$lastteamid=$r->id;
$lastteamnum=$r->num;
}
@ -224,7 +245,9 @@ function delbuttonclicked(team_id,team_num,judge)
echo "</td><td>";
echo "<table>";
echo "<tr><th colspan=\"2\" align=\"left\">Team #".$team['num']."</th></tr>";
echo "<tr><th colspan=\"2\" align=\"left\">#".$team['num'].": ";
echo "<input type=\"text\" name=\"teamname[".$team['id']."]\" value=\"".$team['name']."\" size=\"10\">";
echo "</th></tr>";
foreach($team['members'] AS $member)
{
@ -238,9 +261,11 @@ function delbuttonclicked(team_id,team_num,judge)
echo "</table>";
echo "</td></tr></table>";
}
echo "<br />";
echo "<input type=\"button\" onclick=\"saveteamnamesbuttonclicked()\" type=\"button\" value=\"Save Team Names\" />";
echo "</td></tr>";