forked from science-ation/science-ation
Properly perform the safety status, based on the safetyquestions and the required fields
This commit is contained in:
parent
d5a5e9800f
commit
8862433fc2
@ -116,7 +116,23 @@ function mentorStatus()
|
|||||||
|
|
||||||
function safetyStatus()
|
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";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user