Copyright (C) 2005 James Grant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> << ".i18n("Back to Participant Registration Summary")."
"; echo "
"; if($_POST['action']=="save") { // if(registrationFormsReceived()) // { // echo error(i18n("Cannot make changes to forms once they have been received by the fair")); // } // else if(registrationDeadlinePassed()) { echo error(i18n("Cannot make changes to forms after registration deadline")); } else { //first we will delete all their old answer, its easier to delete and re-insert in this case then it would be to find the corresponding answers and update them mysql_query("DELETE FROM tours_choice WHERE registrations_id='{$_SESSION['registration_id']}' AND conferences_id='{$conference['id']}' AND rank!='0'"); if(is_array($_POST['toursel'])) { foreach($_POST['toursel'] AS $students_id=>$ts) { $selarray = array(); foreach($ts AS $rank=>$tid) { if($tid == -1) continue; $rank = intval($rank); $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,conferences_id,rank) VALUES (". "'".$_SESSION['registration_id']."', ". "'".intval($students_id)."', ". "'".intval($tid)."', ". "'".$conference['id']."', ". "'$rank')"); echo mysql_error(); } } } } } /* if($_POST['action']=="volunteer") { $vname = mysql_escape_string(stripslashes($_POST['vname'])); $vemail = mysql_escape_string(stripslashes($_POST['vemail'])); mysql_query("INSERT INTO tours_volunteers (registrations_id,name,email,conferences_id) VALUES (". "'".$_SESSION['registration_id']."', ". "'".$vname."', ". "'".$vemail."', ". "'".$conference['id']."'); "); echo happy(i18n("Tour volunteer added. They will be contacted soon.")); } */ //output the current status $newstatus=tourStatus(); if($newstatus!="complete") { echo error(i18n("Tour Selection Incomplete. You must select your tour preferences!")); } else if($newstatus=="complete") { echo happy(i18n("Tour Selection Complete")); } $assigned_tour = array(); $q=mysql_query("SELECT * FROM tours_choice WHERE registrations_id='".$_SESSION['registration_id']."' AND conferences_id='".$conference['id']."'"); while($r=mysql_fetch_object($q)) { if($r->rank == 0) $assigned_tour[$r->students_id] = $r->tour_id; $tour_choice[$r->students_id][$r->rank] = $r->tour_id; } $tours = array(); $q=mysql_query("SELECT * FROM tours WHERE conferences_id='".$conference['id']."' ORDER BY id"); if(mysql_num_rows($q) == 0) { echo notice(i18n("There is not tour information")); send_footer(); exit; } while($r=mysql_fetch_object($q)) { $tours[$r->id]['name'] = $r->name; $tours[$r->id]['num'] = $r->num; $tours[$r->id]['description'] = $r->description; $tours[$r->id]['capacity'] = $r->capacity; $tours[$r->id]['grade_min'] = $r->grade_min; $tours[$r->id]['grade_max'] = $r->grade_max; } $min = $config['tours_choices_min']; $max = $config['tours_choices_max']; echo "
\n"; echo "\n"; $q=mysql_query("SELECT * FROM students WHERE registrations_id='".$_SESSION['registration_id']."' AND conferences_id='".$conference['id']."'"); $num_found = mysql_num_rows($q); $print_submit = false; while($r=mysql_fetch_object($q)) { echo i18n("Tour Selection for")." {$r->firstname} {$r->lastname}:

"; if($r->grade <= 0) { echo error(i18n("You must select your grade on the Student Information page before selecting tours")); echo i18n("Go to the"). " "; echo i18n("Student Information"); echo "". i18n(" page now."). "

"; continue; } if(array_key_exists($r->id, $assigned_tour)) { echo happy(i18n('You have been assigned to a tour. Tour selection is disabled.')); $t = $tours[$assigned_tour[$r->id]]; echo i18n("Your Tour").": #{$t['num']}: ".i18n($t['name'])."
"; echo ''.i18n($t['description'])."

"; continue; } $print_submit = true; echo "\n"; for($x=0;$x<$max;$x++) { echo ""; } echo ""; echo ("
"; $rank = $x+1; if($x==0) echo i18n("(most preferred)")." "; echo i18n("Choice")." $rank:"; echo ""; echo ""; echo "
 
"); } /* $rank = $tour_choice[$r->id]; if($rank < 1 || $rank > $max) $rank = "--"; echo "id]\" value=\"$rank\" />"; echo "(tour $num). "; echo i18n($r->description).""; echo ""; $num++; */ if($print_submit == true) { echo "\n"; } echo "
"; echo "

"; echo "

".i18n("Tour Descriptions")."


"; /* Dump the tours */ foreach($tours as $id=>$t) { echo i18n("Tour")." #{$t['num']}: ".i18n($t['name'])."
"; echo i18n("Grade").": ".$t['grade_min']." - ".$t['grade_max'].""; // echo i18n(", Capacity").": ".$t['capacity']." ".i18n("students"); echo "
"; echo ''.i18n($t['description'])."

"; } /* echo "

Add A Parent/Teacher Volunteer for Tour Day


"; echo "If you have a parent / teacher who would like to accompany a group of students on a UBC tour (ask your parents right now and see if they want to volunteer on a tour!), please enter their name and email address below, and click on the Submit Volunteer button. The GVRSF will contact them by email to confirm additional details."; echo "
\n"; echo "\n"; echo "Name:
"; echo "Email:
"; echo "\n"; echo "

"; */ send_footer(); ?>