forked from science-ation/science-ation
Error checking on judges_teams_timeslots when no teams/timeslots are selected to assign
This commit is contained in:
parent
fb10ed7447
commit
8a1a67f1be
@ -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)
|
//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.
|
//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['teams'] AS $tm)
|
||||||
{
|
{
|
||||||
foreach($_POST['timeslots'] AS $ts)
|
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']))));
|
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 "<form name=\"teamstimeslots\" method=\"post\" action=\"judges_teams_timeslots.php\">";
|
||||||
echo "<input type=\"hidden\" name=\"action\" value=\"assign\">";
|
echo "<input type=\"hidden\" name=\"action\" value=\"assign\">";
|
||||||
|
Loading…
Reference in New Issue
Block a user