diff --git a/register_participants.inc.php b/register_participants.inc.php index 2e38fb4..3b49f3f 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -26,6 +26,33 @@ function studentStatus() return "complete"; } +function emergencycontactStatus() +{ + global $config; + $required_fields=array("firstname","lastname","relation","phone1"); + + $sq=mysql_query("SELECT id FROM students WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); + $numstudents=mysql_num_rows($sq); + + while($sr=mysql_fetch_object($sq)) + { + $q=mysql_query("SELECT * FROM emergencycontact WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."' AND students_id='$sr->id'"); + + $r=mysql_fetch_object($q); + + foreach ($required_fields AS $req) + { + if(!$r->$req) + { + return "incomplete"; + } + } + } + + //if it made it through without returning incomplete, then we must be complete + return "complete"; +} + function projectStatus() { global $config; diff --git a/register_participants_main.php b/register_participants_main.php index dff9140..e5c817e 100644 --- a/register_participants_main.php +++ b/register_participants_main.php @@ -57,6 +57,19 @@ $statusstudent=studentStatus(); echo outputStatus($statusstudent); echo ""; +//participant emergency contact information +echo "