Error checking on judges_teams_timeslots when no teams/timeslots are selected to assign

This commit is contained in:
james 2007-12-11 19:38:25 +00:00
parent fb10ed7447
commit 8a1a67f1be

View File

@ -93,6 +93,8 @@ function checkinvert(what)
{
//the db handles the uniqueness (to ensure the same timeslot isnt assigned to the same team more than once)
//so all we'll do here is just mass insert without regards for whats already there.
if(count($_POST['teams']) && count($_POST['timeslots'])
{
foreach($_POST['teams'] AS $tm)
{
foreach($_POST['timeslots'] AS $ts)
@ -103,6 +105,9 @@ function checkinvert(what)
}
echo happy(i18n("%1 Timeslots assigned to %2 teams",array(count($_POST['timeslots']),count($_POST['teams']))));
}
else
echo error(i18n("You must select both team(s) and timeslot(s) to assign"));
}
echo "<form name=\"teamstimeslots\" method=\"post\" action=\"judges_teams_timeslots.php\">";
echo "<input type=\"hidden\" name=\"action\" value=\"assign\">";