Make sure safety questions are only displayed/checked for the current fairyear

This commit is contained in:
james 2005-12-08 15:35:41 +00:00
parent 2179f3f709
commit ba25b4ae86
3 changed files with 5 additions and 3 deletions

View File

@ -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])

View File

@ -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 <b>registration number</b> in order to continue your registration");
echo "<input type=\"hidden\" name=\"action\" value=\"continue\">";
$allownew=false;

View File

@ -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))
{