Show different messages if we're BEFORE the registration open VS after registration close.

Also do now display any sort of login (email) box if we're before registration open, but do
show it if we're after registration close so they can still login and view info or apply for
special awards
This commit is contained in:
james 2006-09-17 14:32:42 +00:00
parent e6ed1c35b0
commit 794cbe7c84

View File

@ -24,7 +24,9 @@
<?
require("common.inc.php");
$q=mysql_query("SELECT (NOW()>'".$config['dates']['regopen']."' AND NOW()<'".$config['dates']['regclose']."') AS datecheck");
$q=mysql_query("SELECT (NOW()>'".$config['dates']['regopen']."' AND NOW()<'".$config['dates']['regclose']."') AS datecheck,
NOW()<'".$config['dates']['regopen']."' AS datecheckbefore,
NOW()>'".$config['dates']['regclose']."' AS datecheckafter");
$datecheck=mysql_fetch_object($q);
if($_POST['action']=="new")
@ -300,7 +302,10 @@
{
if($datecheck->datecheck==0)
{
echo error(i18n("Registration is closed. You can not create a new account"));
if($datecheck->datecheckbefore)
echo error(i18n("Registration is not open yet. You can not create a new account"));
else if($datecheck->datecheckafter)
echo error(i18n("Registration is now closed. You can not create a new account"));
$showform=false;
echo "<A href=\"register_participants.php\">Back to Participant Registration Login Page</a>";
@ -369,8 +374,13 @@
//this will return 1 if its between the dates, 0 otherwise.
if($datecheck->datecheck==0)
{
echo notice(i18n("Registration for the %1 %2 is now closed. Existing registrants can login and view (read only) their information, as well as apply for special awards (if applicable).",array($config['FAIRYEAR'],$config['fairname']),array("fair year","fair name")));
echo i18n("Please enter your email address to login");
if($datecheck->datecheckbefore)
echo notice(i18n("Registration for the %1 %2 is not open yet. Registration will open on %3.",array($config['FAIRYEAR'],$config['fairname'],$config['dates']['regopen']),array("fair year","fair name","registration open date")));
else if($datecheck->datecheckafter)
{
echo notice(i18n("Registration for the %1 %2 is now closed. Existing registrants can login and view (read only) their information, as well as apply for special awards (if applicable).",array($config['FAIRYEAR'],$config['fairname']),array("fair year","fair name")));
echo i18n("Please enter your email address to login");
}
echo "<br />";
echo "<br />";
$buttontext=i18n("Login");
@ -403,6 +413,9 @@
$buttontext=i18n("Begin");
}
//only show the email login box if registration is open, or we're past the registration deadline (so they can login and view / apply for special awards). if we're before the registration deadline then they cant create an account or login anwyays so no point in showing the box
if(!$datecheck->datecheckbefore)
{
?>
<form method="post" action="register_participants.php">
<input type="hidden" name="action" value="login" />
@ -410,6 +423,7 @@
<input type="submit" value="<?=$buttontext?>" />
</form>
<?
}
}
send_footer();
?>