Properly perform the safety status, based on the safetyquestions and the required fields

This commit is contained in:
james 2004-12-10 21:39:47 +00:00
parent d5a5e9800f
commit 8862433fc2

View File

@ -116,7 +116,23 @@ function mentorStatus()
function safetyStatus()
{
return "incomplete";
//grab all of their answers
$q=mysql_query("SELECT * FROM safety WHERE registrations_id='".$_SESSION['registration_id']."'");
while($r=mysql_fetch_object($q))
{
$safetyanswers[$r->safetyquestions_id]=$r->answer;
}
//now grab all the questions
$q=mysql_query("SELECT * FROM safetyquestions ORDER BY ord");
while($r=mysql_fetch_object($q))
{
if($r->required && !$safetyanswers[$r->id])
{
return "incomplete";
}
}
return "complete";
}