diff --git a/projects.inc.php b/projects.inc.php index 6d66a6f..db133fd 100644 --- a/projects.inc.php +++ b/projects.inc.php @@ -123,7 +123,6 @@ function getSpecialAwardsNominatedForProject($projectid) { global $config; - //FIXME: this query isnt done yet, its still a copy from above $awardsq=mysql_query("SELECT award_awards.id, award_awards.name, diff --git a/register_participants.inc.php b/register_participants.inc.php index 34771b7..734c0b9 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -187,28 +187,34 @@ function safetyStatus($reg_id="") function spawardStatus($reg_id="") { + global $config; if($reg_id) $rid=$reg_id; else $rid=$_SESSION['registration_id']; - return false; - //grab all of their answers - $q=mysql_query("SELECT * FROM safety WHERE registrations_id='$rid'"); - while($r=mysql_fetch_object($q)) - { - $safetyanswers[$r->safetyquestions_id]=$r->answer; - } + $q=mysql_query("SELECT * FROM projects WHERE registrations_id='$rid'"); + $project=mysql_fetch_object($q); - //now grab all the questions - $q=mysql_query("SELECT * FROM safetyquestions ORDER BY ord"); - while($r=mysql_fetch_object($q)) - { - if($r->required=="yes" && !$safetyanswers[$r->id]) - { - return "incomplete"; - } - } - return "complete"; + $awardsq=mysql_query("SELECT + award_awards.id, + award_awards.name, + award_awards.criteria, + projects.id AS projects_id + FROM + award_awards, + project_specialawards_link, + projects + WHERE + project_specialawards_link.projects_id='".$project->id."' + AND project_specialawards_link.award_awards_id=award_awards.id + AND projects.year='".$config['FAIRYEAR']."' + ORDER BY + award_awards.name + "); + if(mysql_num_rows($awardsq)) + return "complete"; + else + return "incomplete"; } diff --git a/register_participants_main.php b/register_participants_main.php index 239fe5c..87923c6 100644 --- a/register_participants_main.php +++ b/register_participants_main.php @@ -24,6 +24,7 @@ "; if(registrationFormsReceived()) { echo "".i18n("Self-nominate for special awards").""; - // $awards=getSpecialAwardsNominatedByRegistrationID($_SESSION['registration_id']); + $q=mysql_query("SELECT * FROM projects WHERE registrations_id='".$_SESSION['registration_id']."'"); + $project=mysql_fetch_object($q); + $nominatedawards=getSpecialAwardsNominatedForProject($project->id); + $num=count($nominatedawards); + if($num) + { + echo ""; + echo happy(i18n("You are nominated for %1 awards",array($num)),"inline"); + echo ""; + + echo ""; + $c=1; + foreach($nominatedawards AS $na) + { + echo $c.". ".$na['name']."
"; + $c++; + } + echo ""; + echo ""; + + } + else + { + echo ""; + echo error(i18n("You are nominated for 0 awards"),"inline"); + echo ""; + + } + + echo ""; } else { diff --git a/register_participants_spawards.php b/register_participants_spawards.php index 9d03daa..bb7e1fe 100644 --- a/register_participants_spawards.php +++ b/register_participants_spawards.php @@ -116,10 +116,12 @@ else if($newstatus=="complete") $eligibleawards=getSpecialAwardsEligibleForProject($project->id); $nominatedawards=getSpecialAwardsNominatedForProject($project->id); +/* echo "eligible awards
"; echo nl2br(print_r($eligibleawards,true)); echo "nominated awards
"; echo nl2br(print_r($nominatedawards,true)); + */ $nominatedawards_list=array(); foreach($nominatedawards AS $naward)