remove debugging

add function for emergencycontact status
add emergency contact to main checklist
This commit is contained in:
james 2005-01-05 15:05:32 +00:00
parent 14597ed325
commit 03dd7ffd16
3 changed files with 40 additions and 1 deletions

View File

@ -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;

View File

@ -57,6 +57,19 @@ $statusstudent=studentStatus();
echo outputStatus($statusstudent);
echo "</td></tr>";
//participant emergency contact information
echo "<tr><td>";
if($statusstudent=="complete")
echo "<a href=\"register_participants_emergencycontact.php\">";
echo i18n("Emergency Contact Information");
if($statusstudent=="complete")
echo "</a>";
echo "</td><td>";
//check to see if its complete
$statusemergencycontact=emergencycontactStatus();
echo outputStatus($statusemergencycontact);
echo "</td></tr>";
//project information - project requires students, so only show the link if the students is complete
echo "<tr><td>";
if($statusstudent=="complete")

View File

@ -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])));