diff --git a/register_participants_tours.php b/register_participants_tours.php index 72f9b74..dbe9967 100644 --- a/register_participants_tours.php +++ b/register_participants_tours.php @@ -80,9 +80,19 @@ echo mysql_error(); { foreach($_POST['toursel'] AS $students_id=>$ts) { + $selarray = array(); + foreach($ts AS $rank=>$tid) { if($tid == -1) continue; + $x = intval($tid); + + /* If this choice has already been selected, don't record it */ + if(in_array($x, $selarray)) continue; + + /* Remember this choice in a format that is easily searchable */ + $selarray[] = $x; + mysql_query("INSERT INTO tours_choice (registrations_id,students_id,tour_id,year,rank) VALUES (". "'".$_SESSION['registration_id']."', ". "'".intval($students_id)."', ". @@ -151,27 +161,22 @@ else if($newstatus=="complete") $min = $config['tours_choices_min']; $max = $config['tours_choices_max']; -/* - if($min == $max) { - $t = i18n("Please select %1 tour(s)", array($min)); - } else if($min == 1) { - $t = i18n("Please select up to %1 tours", array($max)); - } else { - $t = i18n("Please select between %1 and %2 tours", array($min, $max)); - } - echo $t." "; - echo i18n("by placing a number from 1 (highest preference) to %1 (lowest preference) beside the tours you select", array($config['tours_choices_max']) ); -*/ - echo "