diff --git a/register_judges.php b/register_judges.php index 1e32d35..18a64af 100644 --- a/register_judges.php +++ b/register_judges.php @@ -244,11 +244,16 @@ { //Lets check the date - if we are AFTER 'judgeregopen' and BEFORE 'judgeregclose' then we can login //otherwise, registration is closed - no logins! - - $q=mysql_query("SELECT (NOW()>'".$config['dates']['judgeregopen']."' AND NOW()<'".$config['dates']['judgeregclose']."') AS datecheck"); - $r=mysql_fetch_object($q); - //this will return 1 if its between the dates, 0 otherwise. - if($r->datecheck==1) + $now = date('Y-m-d H:i:s'); + if($now < $config['dates']['judgeregopen']) + { + echo i18n("Judges registration for the %1 %2 has not yet opened",array($config['FAIRYEAR'],$config['fairname']),array("Fair year","Fair name")); + } + else if($now > $config['dates']['judgeregclose']) + { + echo i18n("Judges registration for the %1 %2 is now closed",array($config['FAIRYEAR'],$config['fairname']),array("Fair year","Fair name")); + } + else { if($config['judge_registration_type']=="invite") { @@ -279,10 +284,6 @@