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 ""; +if($statusstudent=="complete") + echo ""; +echo i18n("Emergency Contact Information"); +if($statusstudent=="complete") + echo ""; +echo ""; +//check to see if its complete +$statusemergencycontact=emergencycontactStatus(); +echo outputStatus($statusemergencycontact); +echo ""; + //project information - project requires students, so only show the link if the students is complete echo ""; if($statusstudent=="complete") diff --git a/register_participants_students.php b/register_participants_students.php index 36de598..5640a74 100644 --- a/register_participants_students.php +++ b/register_participants_students.php @@ -67,7 +67,6 @@ if($_POST['action']=="save") "'".mysql_escape_string(stripslashes($_POST['teachername'][$x]))."', ". "'".mysql_escape_string(stripslashes($_POST['teacheremail'][$x]))."', ". "'".$config['FAIRYEAR']."')"); -echo mysql_error(); echo notice(i18n("%1 %2 successfully added",array($_POST['firstname'][$x],$_POST['lastname'][$x])));