From ba25b4ae869c82a715e369a4de5139e8fdf59401 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 8 Dec 2005 15:35:41 +0000 Subject: [PATCH] Make sure safety questions are only displayed/checked for the current fairyear --- register_participants.inc.php | 4 +++- register_participants.php | 2 +- register_participants_safety.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/register_participants.inc.php b/register_participants.inc.php index 190dd4c..578cd1c 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -173,6 +173,8 @@ function mentorStatus($reg_id="") function safetyStatus($reg_id="") { + global $config; + if($reg_id) $rid=$reg_id; else $rid=$_SESSION['registration_id']; @@ -184,7 +186,7 @@ function safetyStatus($reg_id="") } //now grab all the questions - $q=mysql_query("SELECT * FROM safetyquestions ORDER BY ord"); + $q=mysql_query("SELECT * FROM safetyquestions WHERE year='".$config['FAIRYEAR']."' ORDER BY ord"); while($r=mysql_fetch_object($q)) { if($r->required=="yes" && !$safetyanswers[$r->id]) diff --git a/register_participants.php b/register_participants.php index a50771a..0308785 100644 --- a/register_participants.php +++ b/register_participants.php @@ -171,7 +171,7 @@ if(mysql_num_rows($q)>0) { $r=mysql_fetch_object($q); - print_r($r); +// print_r($r); echo i18n("Please enter your registration number in order to continue your registration"); echo ""; $allownew=false; diff --git a/register_participants_safety.php b/register_participants_safety.php index ab3bf7b..ece45fc 100644 --- a/register_participants_safety.php +++ b/register_participants_safety.php @@ -112,7 +112,7 @@ else if($newstatus=="complete") $safetyanswers[$r->safetyquestions_id]=$r->answer; } - $q=mysql_query("SELECT * FROM safetyquestions ORDER BY ord"); + $q=mysql_query("SELECT * FROM safetyquestions WHERE year='".$config['FAIRYEAR']."' ORDER BY ord"); $num=1; while($r=mysql_fetch_object($q)) {