Force registration to be completed in order. Student grade is required for detection of age category, so it makes sense to enforce the registration process to be done in the right order.

This commit is contained in:
james 2004-12-07 16:42:53 +00:00
parent f1dadb4434
commit 8326b10958
2 changed files with 16 additions and 5 deletions

View File

@ -59,9 +59,11 @@ echo "</td></tr>";
//project information
echo "<tr><td>";
echo "<a href=\"register_participants_project.php\">";
echo "".i18n("Project Information");
echo "</a>";
if($status=="complete")
echo "<a href=\"register_participants_project.php\">";
echo i18n("Project Information");
if($status=="complete")
echo "</a>";
echo "</td><td>";
//check to see if its complete
$status=projectStatus();

View File

@ -1,5 +1,6 @@
<?
require("common.inc.php");
include "register_participants.inc.php";
//authenticate based on email address and registration number from the SESSION
if(!$_SESSION['email'])
@ -33,6 +34,15 @@ echo mysql_error();
//send the header
send_header("Participant Registration - Project Information");
$studentstatus=studentStatus();
if($studentstatus!="complete")
{
echo error(i18n("Please complete the <a href=\"register_participants_students.php\">Student Information Page</a> first"));
send_footer();
exit;
}
if($_POST['action']=="save")
{
//first, lets make sure this project really does belong to them
@ -76,7 +86,6 @@ echo mysql_error();
$projectcategories_id=$r->id;
}
}
//now select their project info
$q=mysql_query("SELECT * FROM projects WHERE registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'");
//check if it exists, if we didnt find any record, lets insert one
@ -89,7 +98,7 @@ echo mysql_error();
$projectinfo=mysql_fetch_object($q);
//make sure that if they changed their grade on the student page, we update their projectcategories_id accordingly
if($projectinfo->projectcategories_id!=$projectcategories_id)
if($projectcategories_id && $projectinfo->projectcategories_id!=$projectcategories_id)
{
echo notice(i18n("Age category changed, updating to %1",array($agecategories[$projectcategories_id]['category'])));
mysql_query("UPDATE projects SET projectcategories_id='$projectcategories_id' WHERE id='$projectinfo->id'");