diff --git a/register_participants.inc.php b/register_participants.inc.php index a41ddfd..2fa7947 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -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"; }