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 safety WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); $safetyids=array_keys($_POST['safety']); foreach($safetyids AS $key=>$val) { mysql_query("INSERT INTO safety (registrations_id,safetyquestions_id,year,answer) VALUES (". "'".$_SESSION['registration_id']."', ". "'$val', ". "'".$config['FAIRYEAR']."', ". "'".mysql_escape_string(stripslashes($_POST['safety'][$val]))."')"); echo mysql_error(); } } } //output the current status $newstatus=safetyStatus(); if($newstatus!="complete") { echo error(i18n("Safety Information Incomplete. You must agree to all safety questions!")); } else if($newstatus=="complete") { echo happy(i18n("Safety Information Complete")); } echo "
\n"; echo "\n"; echo "\n"; $q=mysql_query("SELECT * FROM safety WHERE registrations_id='".$_SESSION['registration_id']."'"); while($r=mysql_fetch_object($q)) { $safetyanswers[$r->safetyquestions_id]=$r->answer; } $q=mysql_query("SELECT * FROM safetyquestions WHERE year='".$config['FAIRYEAR']."' ORDER BY ord"); $num=1; while($r=mysql_fetch_object($q)) { echo ""; echo ""; echo ""; $num++; } echo "
$num. ".i18n($r->question).""; if($r->type=="check") { if($safetyanswers[$r->id]=="checked") $ch="checked=\"checked\""; else $ch=""; echo "id]\" value=\"checked\" />"; } echo "
"; echo "\n"; echo "
"; send_footer(); ?>