From 570d7714dc46b512a635f9cdf298fce6c91ad8a8 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 12 May 2005 17:32:50 +0000 Subject: [PATCH] Dont allow submitting the forms after the registration is closed --- register_participants.inc.php | 11 +++++++++++ register_participants_emergencycontact.php | 4 ++++ register_participants_mentor.php | 4 ++++ register_participants_project.php | 4 ++++ register_participants_safety.php | 4 ++++ register_participants_students.php | 4 ++++ 6 files changed, 31 insertions(+) diff --git a/register_participants.inc.php b/register_participants.inc.php index 734c0b92..190dd4cd 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -33,6 +33,17 @@ function registrationFormsReceived($reg_id="") else return false; +} +function registrationDeadlinePassed() +{ + global $config; + $q=mysql_query("SELECT (NOW()<'".$config['dates']['regclose']."') AS datecheck"); + $datecheck=mysql_fetch_object($q); + if($datecheck->datecheck==1) + return false; + else + return true; + } function studentStatus($reg_id="") diff --git a/register_participants_emergencycontact.php b/register_participants_emergencycontact.php index 9067c181..072f0d29 100644 --- a/register_participants_emergencycontact.php +++ b/register_participants_emergencycontact.php @@ -75,6 +75,10 @@ echo mysql_error(); { echo error(i18n("Cannot make changes to forms once they have been received by the fair")); } + else if(registrationDeadlinePassed()) + { + echo error(i18n("Cannot make changes to forms after registration deadline")); + } else { //first, lets make sure this emergency contact really does belong to them diff --git a/register_participants_mentor.php b/register_participants_mentor.php index bb047472..f82b6b11 100644 --- a/register_participants_mentor.php +++ b/register_participants_mentor.php @@ -67,6 +67,10 @@ if($_POST['action']=="save") { echo error(i18n("Cannot make changes to forms once they have been received by the fair")); } + else if(registrationDeadlinePassed()) + { + echo error(i18n("Cannot make changes to forms after registration deadline")); + } else { $x=1; diff --git a/register_participants_project.php b/register_participants_project.php index 8a425878..67bee2f8 100644 --- a/register_participants_project.php +++ b/register_participants_project.php @@ -75,6 +75,10 @@ echo mysql_error(); { echo error(i18n("Cannot make changes to forms once they have been received by the fair")); } + else if(registrationDeadlinePassed()) + { + echo error(i18n("Cannot make changes to forms after registration deadline")); + } else { //first, lets make sure this project really does belong to them diff --git a/register_participants_safety.php b/register_participants_safety.php index 5a58b329..ab3bf7b8 100644 --- a/register_participants_safety.php +++ b/register_participants_safety.php @@ -66,6 +66,10 @@ echo mysql_error(); { echo error(i18n("Cannot make changes to forms once they have been received by the fair")); } + else if(registrationDeadlinePassed()) + { + echo error(i18n("Cannot make changes to forms after registration deadline")); + } else { //first we will delete all their old answer, its easier to delete and re-insert in this case then it would be to find the corresponding answers and update them diff --git a/register_participants_students.php b/register_participants_students.php index e2cb6433..79bbbc26 100644 --- a/register_participants_students.php +++ b/register_participants_students.php @@ -67,6 +67,10 @@ if($_POST['action']=="save") { echo error(i18n("Cannot make changes to forms once they have been received by the fair")); } + else if(registrationDeadlinePassed()) + { + echo error(i18n("Cannot make changes to forms after registration deadline")); + } else { $x=1;