From 5d20a0590ae2a915b2f39c191f5acdc34da683bd Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 30 Jan 2007 08:05:29 +0000 Subject: [PATCH] - Might want to check my logic on this one.. but basically, if special awards are set to "with registration", bypass all date checks. Assume that if they're in the registration, they're allowed to select awards. - If the special award nominations are on "with registration", don't print the dates between which special awards can be selected. --- register_participants_spawards.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/register_participants_spawards.php b/register_participants_spawards.php index 4d44c6d..f60f19a 100644 --- a/register_participants_spawards.php +++ b/register_participants_spawards.php @@ -88,15 +88,21 @@ function checkboxclicked(b) echo "<< ".i18n("Back to Participant Registration Summary")."
"; echo "
"; - echo notice(i18n("Special award self-nomination is only available from %1 to %2. Please make sure you complete your nominations between these dates. You may apply to a maximum of %3 special awards.",array($config['dates']['specawardregopen'],$config['dates']['specawardregclose'],$config['maxspecialawardsperproject']))); + if($config['specialawardnomination']=="date") { + echo notice(i18n("Special award self-nomination is only available from %1 to %2. Please make sure you complete your nominations between these dates.", array($config['dates']['specawardregopen'],$config['dates']['specawardregclose']))); + $q=mysql_query("SELECT (NOW()>'".$config['dates']['specawardregopen']."' AND NOW()<'".$config['dates']['specawardregclose']."') AS datecheck"); + $r=mysql_fetch_object($q); + //this will return 1 if its between the dates, 0 otherwise. + if($r->datecheck==1) + $readonly=false; + else + $readonly=true; + } else { + /* Never make the awards readonly, when registration closes, so do the awards */ + $readonly = false; +} + echo notice(i18n("You may apply to a maximum of %1 special awards.",array($config['maxspecialawardsperproject']))); -$q=mysql_query("SELECT (NOW()>'".$config['dates']['specawardregopen']."' AND NOW()<'".$config['dates']['specawardregclose']."') AS datecheck"); -$r=mysql_fetch_object($q); -//this will return 1 if its between the dates, 0 otherwise. -if($r->datecheck==1) - $readonly=false; -else - $readonly=true; if($_POST['action']=="save") {