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 @@ require("common.inc.php"); include "register_participants.inc.php"; + include "projects.inc.php"; //authenticate based on email address and registration number from the SESSION if(!$_SESSION['email']) @@ -182,7 +183,36 @@ echo "
"; if(registrationFormsReceived()) { echo " |
".i18n("Self-nominate for special awards")." |
"; + echo happy(i18n("You are nominated for %1 awards",array($num)),"inline"); + echo " |
";
+ $c=1;
+ foreach($nominatedawards AS $na)
+ {
+ echo $c.". ".$na['name']." "; + $c++; + } + echo " | ";
+ echo "
"; + echo error(i18n("You are nominated for 0 awards"),"inline"); + echo " |