implement actually changing the status of the registration to 'closed'

This commit is contained in:
james 2005-01-06 04:56:33 +00:00
parent ce66249238
commit 15cbc2597a

View File

@ -9,6 +9,7 @@
echo "<br />";
echo "<br />";
$showformatbottom=true;
if($_POST['action']=="received" && $_POST['registration_number'])
{
$q=mysql_query("SELECT * FROM registrations WHERE num='".$_POST['registration_number']."' AND year='".$config['FAIRYEAR']."'");
@ -24,7 +25,7 @@
}
else if($r->status=='closed')
{
echo error(i18n("Registration number (%1) has already been received.",array($_POST['registration_number'],$r->status)));
echo notice(i18n("Registration number (%1) has already been received.",array($_POST['registration_number'],$r->status)));
}
else
@ -43,7 +44,6 @@
$statusmentor == "complete" &&
$statussafety == "complete"
) {
echo "<h3>".i18n("Registration Summary for %1",array($reg_num))."</h3>";
$q=mysql_query("SELECT projects.title,
projectcategories.category,
@ -60,10 +60,12 @@
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 />";
echo "<table class=\"summarytable\">";
echo "<tr><th colspan=\"2\">".i18n("Registration Summary for %1",array($reg_num))."</th></tr>";
echo "<tr><td><b>".i18n("Registration Number").":</b></td><td>$reg_num</td></tr>";
echo "<tr><td><b>".i18n("Project Title").":</b></td><td>$projectinfo->title</td></tr>";
echo "<tr><td><b>".i18n("Category / Division").":</b></td><td>$projectinfo->category / $projectinfo->division</td></tr>";
$q=mysql_query("SELECT students.firstname,
students.lastname,
@ -80,32 +82,45 @@ echo mysql_Error();
while($studentinfo=mysql_fetch_object($q))
{
if($studnum==1)
echo "<b>".i18n("School").": </b>$studentinfo->school <br />";
echo "<tr><td><b>".i18n("School").":</b></td><td>$studentinfo->school </td></tr>";
echo "<b>".i18n("Student %1",array($studnum)).": </b>$studentinfo->firstname $studentinfo->lastname <br />";
echo "<tr><td><b>".i18n("Student %1",array($studnum)).":</b></td><td>$studentinfo->firstname $studentinfo->lastname </td></tr>";
}
//FIXME: create button - if the above information is correct, please 'click here' to complete the registration process, otherwise, click here to cancel.
echo "</table>\n";
echo "<br />";
echo "<br />";
echo "<hr />";
echo "<table style=\"margin-left: 30px;\">";
echo "<tr><td colspan=\"3\">";
echo i18n("Is this the correct form to register?");
echo "</td></tr>";
echo "<tr>";
echo "<td>";
echo "<form method=\"post\" action=\"registration_receivedforms.php\">";
echo "<input type=\"hidden\" name=\"registration_number\" value=\"$reg_num\" />";
echo "<input type=\"hidden\" name=\"action\" value=\"receivedno\" />";
echo "<input type=submit value=\"No\" />";
echo "</form>";
echo "</td>\n";
echo "<td width=\"50\">&nbsp;</td>";
echo "<td>";
echo "<form method=\"post\" action=\"registration_receivedforms.php\">";
echo "<input type=\"hidden\" name=\"registration_number\" value=\"$reg_num\" />";
echo "<input type=\"hidden\" name=\"action\" value=\"receivedyes\" />";
echo "<input type=submit value=\"Yes\" />";
echo "</form>";
echo "</td>\n";
echo "</tr>";
echo "</table>";
$showformatbottom=false;
}
else
{
echo error(i18n("All Registration sections are not complete. Cannot register"));
}
}
}
else
{
@ -115,13 +130,31 @@ echo mysql_Error();
}
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>";
else if($_POST['action']=="receivedyes" && $_POST['registration_number'])
{
//actually set it to 'closed'
mysql_query("UPDATE registrations SET status='closed' WHERE num='".$_POST['registration_number']."'");
//FIXME: assign the project number here as well!
echo happy(i18n("Registration of form %1 successfully completed",array($registration_number)));
}
else if($_POST['action']=="receivedno" && $_POST['registration_number'])
{
echo notice(i18n("Registration of form %1 cancelled",array($registration_number)));
}
if($showformatbottom)
{
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();
?>