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") { //FIXME: check the date when they have to have this in by and dont let them submit after that date // if(registrationFormsReceived()) // { // echo error(i18n("Cannot make changes to forms once they have been received by the fair")); // } // 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 project_specialawards_link WHERE projects_id='$project->id' AND year='".$config['FAIRYEAR']."'"); $count=0; foreach($_POST['spaward'] AS $spaward) { mysql_query("INSERT INTO project_specialawards_link (award_awards_id,projects_id,year) VALUES (". "'$spaward', ". "'$project->id', ". "'".$config['FAIRYEAR']."')"); echo mysql_error(); $count++; } echo happy(i18n("Successfully registered for %1 special awards",array($count))); // } } //output the current status $newstatus=spawardStatus(); if($newstatus!="complete") { echo error(i18n("Special Awards Self-Nomination Incomplete")); } else if($newstatus=="complete") { echo happy(i18n("Safety Awards Self-Nomination 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; } $eligibleawards=getSpecialAwardsEligibleForProject($project->id); $nominatedawards=getSpecialAwardsNominatedForProject($project->id); echo "eligible awards
"; echo nl2br(print_r($eligibleawards,true)); echo "nominated awards
"; echo nl2br(print_r($nominatedawards,true)); $nominatedawards_list=array(); foreach($nominatedawards AS $naward) { $nominatedawards_list[]=$naward['id']; } echo "
"; foreach($eligibleawards AS $eaward) { echo ""; echo ""; } echo "
"; if(in_array($eaward['id'],$nominatedawards_list)) $ch="checked=\"checked\""; else $ch=""; echo ""; echo ""; echo "".$eaward['name'].""; echo "
"; echo $eaward['criteria']; echo "

"; echo "
"; /* $num=1; while($r=mysql_fetch_object($q)) { echo "$num. ".i18n($r->question).""; echo ""; if($r->type=="check") { if($safetyanswers[$r->id]=="checked") $ch="checked=\"checked\""; else $ch=""; echo "id]\" value=\"checked\" />"; } echo ""; echo ""; $num++; } echo ""; */ echo "\n"; echo "
"; send_footer(); ?>