forked from science-ation/science-ation
received forms implementation nearly complete
This commit is contained in:
parent
4f1265e38d
commit
ce66249238
@ -2,6 +2,9 @@
|
||||
require("../common.inc.php");
|
||||
send_header("Administration - Participant Registration");
|
||||
echo "<a href=\"index.php\"><< ".i18n("Back to Administration")."</a><br />";
|
||||
echo "<br />";
|
||||
echo "<a href=\"registration_receivedforms.php\">View/Input Received Forms</a> <br />";
|
||||
|
||||
|
||||
|
||||
send_footer();
|
||||
|
147
admin/registration_receivedforms.php
Normal file
147
admin/registration_receivedforms.php
Normal file
@ -0,0 +1,147 @@
|
||||
<?
|
||||
require("../common.inc.php");
|
||||
require("../register_participants.inc.php");
|
||||
|
||||
send_header("Participant Registration - Received Forms");
|
||||
echo "<a href=\"index.php\"><< ".i18n("Back to Administration")."</a>";
|
||||
echo " ";
|
||||
echo "<a href=\"registration.php\"><< ".i18n("Back to Registration")."</a>";
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
|
||||
if($_POST['action']=="received" && $_POST['registration_number'])
|
||||
{
|
||||
$q=mysql_query("SELECT * FROM registrations WHERE num='".$_POST['registration_number']."' AND year='".$config['FAIRYEAR']."'");
|
||||
if(mysql_num_rows($q)==1)
|
||||
{
|
||||
$r=mysql_fetch_object($q);
|
||||
$reg_id=$r->id;
|
||||
$reg_num=$r->num;
|
||||
|
||||
if($r->status=='new')
|
||||
{
|
||||
echo error(i18n("Invalid Registration Status (%1 is New). Cannot receive an empty form.",array($_POST['registration_number'])));
|
||||
}
|
||||
else if($r->status=='closed')
|
||||
{
|
||||
echo error(i18n("Registration number (%1) has already been received.",array($_POST['registration_number'],$r->status)));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//make sure all of the statuses are correct
|
||||
$statusstudent=studentStatus($reg_id);
|
||||
$statusemergencycontact=emergencycontactStatus($reg_id);
|
||||
$statusproject=projectStatus($reg_id);
|
||||
$statusmentor=mentorStatus($reg_id);
|
||||
$statussafety=safetyStatus($reg_id);
|
||||
|
||||
if(
|
||||
$statusstudent == "complete" &&
|
||||
$statusemergencycontact == "complete" &&
|
||||
$statusproject == "complete" &&
|
||||
$statusmentor == "complete" &&
|
||||
$statussafety == "complete"
|
||||
) {
|
||||
echo "<h3>".i18n("Registration Summary for %1",array($reg_num))."</h3>";
|
||||
|
||||
$q=mysql_query("SELECT projects.title,
|
||||
projectcategories.category,
|
||||
projectdivisions.division
|
||||
FROM
|
||||
projects,projectcategories,projectdivisions
|
||||
WHERE
|
||||
projects.registrations_id='$reg_id'
|
||||
AND
|
||||
projects.projectcategories_id=projectcategories.id
|
||||
AND
|
||||
projects.projectdivisions_id=projectdivisions.id
|
||||
");
|
||||
|
||||
echo mysql_Error();
|
||||
$projectinfo=mysql_fetch_object($q);
|
||||
|
||||
echo "<b>".i18n("Registration Number").": </b>$reg_num <br />";
|
||||
echo "<b>".i18n("Project Title").": </b>$projectinfo->title <br />";
|
||||
echo "<b>".i18n("Category / Division").": </b>$projectinfo->category / $projectinfo->division <br />";
|
||||
|
||||
$q=mysql_query("SELECT students.firstname,
|
||||
students.lastname,
|
||||
schools.school
|
||||
FROM
|
||||
students,schools
|
||||
WHERE
|
||||
students.registrations_id='$reg_id'
|
||||
AND
|
||||
students.schools_id=schools.id
|
||||
");
|
||||
|
||||
$studnum=1;
|
||||
while($studentinfo=mysql_fetch_object($q))
|
||||
{
|
||||
if($studnum==1)
|
||||
echo "<b>".i18n("School").": </b>$studentinfo->school <br />";
|
||||
|
||||
echo "<b>".i18n("Student %1",array($studnum)).": </b>$studentinfo->firstname $studentinfo->lastname <br />";
|
||||
}
|
||||
|
||||
|
||||
//FIXME: create button - if the above information is correct, please 'click here' to complete the registration process, otherwise, click here to cancel.
|
||||
|
||||
echo "<br />";
|
||||
echo "<br />";
|
||||
echo "<hr />";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo error(i18n("All Registration sections are not complete. Cannot register"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo error(i18n("Invalid Registration Number (%1)",array($_POST['registration_number'])));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
echo "<h3>".i18n("Input New Received Form")."</h3>";
|
||||
echo "<form method=\"post\" action=\"registration_receivedforms.php\">";
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"received\" />";
|
||||
echo i18n("Enter the registration number from the form: ")."<br />";
|
||||
echo "<input type=\"text\" size=\"15\" name=\"registration_number\" />";
|
||||
echo "<input type=\"submit\" value=\"".i18n("Lookup Registration Number")."\" />";
|
||||
echo "</form>";
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user