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 year='".$config['FAIRYEAR']."'"); if(is_array($_POST['toursel'])) { foreach($_POST['toursel'] AS $students_id=>$ts) { foreach($ts AS $rank=>$tid) { if($tid == -1) continue; mysql_query("INSERT INTO tours_choice (registrations_id,students_id,tour_id,year,rank) VALUES (". "'".$_SESSION['registration_id']."', ". "'".intval($students_id)."', ". "'".intval($tid)."', ". "'".$config['FAIRYEAR']."', ". "'".intval($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,year) VALUES (". "'".$_SESSION['registration_id']."', ". "'".$vname."', ". "'".$vemail."', ". "'".$config['FAIRYEAR']."'); "); 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")); } $q=mysql_query("SELECT * FROM tours_choice WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); while($r=mysql_fetch_object($q)) { $tour_choice[$r->students_id][$r->rank] = $r->tour_id; } $tours = array(); $q=mysql_query("SELECT * FROM tours WHERE year='".$config['FAIRYEAR']."' 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]['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']; /* 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 "
\n"; echo "\n"; echo "\n"; $q=mysql_query("SELECT * FROM students WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); $num_found = mysql_num_rows($q); while($r=mysql_fetch_object($q)) { echo ""; for($x=0;$x<$max;$x++) { echo ""; } echo ""; } echo ("id]; if($rank < 1 || $rank > $max) $rank = "--"; echo ""; echo ""; $num++; */ echo "\n"; echo ""; echo "

"; echo "

".i18n("Tour Descriptions")."


"; /* Dump the tours */ foreach($tours as $id=>$t) { echo i18n("Tour Name").": ".i18n($t['name'])."
"; echo i18n("Grade").": ".$t['grade_min']." - ".$t['grade_max'].", "; echo i18n("Capacity").": ".$t['capacity']." ".i18n("students")."
"; 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(); ?>
"; echo i18n("Tour Selection for")." ".$r->firstname." ".$r->lastname; echo "
"; $rank = $x+1; if($x==0) echo i18n("(most preferred)")." "; echo i18n("Choice")." $rank:"; echo ""; echo ""; echo "
 
id]\" value=\"$rank\" />"; echo "(tour $num). "; echo i18n($r->description)."