echo"<a href=\"schoolaccess.php\"><< ".i18n("Return to school access main page")."</a><br />";
echo"<br />";
$q=mysql_query("SELECT * FROM schools WHERE id='".$_SESSION['schoolid']."' AND accesscode='".$_SESSION['schoolaccesscode']."' AND year='".$config['FAIRYEAR']."'");
echohappy(i18n("The participant has been successfully invited"));
}
}
else
echoerror(i18n("All fields are required for invitations"));
}
if($_GET['action']=="uninvite")
{
//first, make sure that this is really their student, and it sfor this year.
$q=mysql_query("SELECT * FROM students WHERE id='".$_GET['uninvite']."' AND year='".$config['FAIRYEAR']."' AND schools_id='".$_SESSION['schoolid']."'");
if(mysql_num_rows($q))
{
$r=mysql_fetch_object($q);
$registrations_id=$r->registrations_id;
if($registrations_id)//just to be safe!
{
mysql_query("DELETE FROM students WHERE registrations_id='$registrations_id'");
mysql_query("DELETE FROM projects WHERE registrations_id='$registrations_id'");
mysql_query("DELETE FROM mentors WHERE registrations_id='$registrations_id'");
mysql_query("DELETE FROM safety WHERE registrations_id='$registrations_id'");
mysql_query("DELETE FROM emergencycontact WHERE registrations_id='$registrations_id'");
mysql_query("DELETE FROM registrations WHERE id='$registrations_id'");
echoi18n("In order for your school's students to register for the fair, you will need to invite them to register. Simply enter their email address below to invite them to register. <b>Important</b>: for group projects, only add one of the participants, that participant will then add the other group member(s) to the project");
echo"<a onclick=\"return confirmClick('Are you sure you want to uninvite this student?')\" href=\"schoolinvite.php?action=uninvite&uninvite=$r->id\"><imgborder=0src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\"></a>";
echo"</td>";
echo"</tr>";
}
echo"</table>";
}
else
echoi18n("You have not yet invited any participants from your school");
}
}
else
{
echoerror(i18n("Invalid School ID or Access Code"));
echo"<br />";
echo"<a href=\"schoolaccess.php\">".i18n("Perhaps you should login first")."</a>";