forked from science-ation/science-ation
show the awsards on the registration summary main page
This commit is contained in:
parent
ed663e77eb
commit
d9d82ce1f5
@ -123,7 +123,6 @@ function getSpecialAwardsNominatedForProject($projectid)
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
//FIXME: this query isnt done yet, its still a copy from above
|
|
||||||
$awardsq=mysql_query("SELECT
|
$awardsq=mysql_query("SELECT
|
||||||
award_awards.id,
|
award_awards.id,
|
||||||
award_awards.name,
|
award_awards.name,
|
||||||
|
@ -187,28 +187,34 @@ function safetyStatus($reg_id="")
|
|||||||
|
|
||||||
function spawardStatus($reg_id="")
|
function spawardStatus($reg_id="")
|
||||||
{
|
{
|
||||||
|
global $config;
|
||||||
if($reg_id) $rid=$reg_id;
|
if($reg_id) $rid=$reg_id;
|
||||||
else $rid=$_SESSION['registration_id'];
|
else $rid=$_SESSION['registration_id'];
|
||||||
|
|
||||||
return false;
|
$q=mysql_query("SELECT * FROM projects WHERE registrations_id='$rid'");
|
||||||
//grab all of their answers
|
$project=mysql_fetch_object($q);
|
||||||
$q=mysql_query("SELECT * FROM safety WHERE registrations_id='$rid'");
|
|
||||||
while($r=mysql_fetch_object($q))
|
|
||||||
{
|
|
||||||
$safetyanswers[$r->safetyquestions_id]=$r->answer;
|
|
||||||
}
|
|
||||||
|
|
||||||
//now grab all the questions
|
$awardsq=mysql_query("SELECT
|
||||||
$q=mysql_query("SELECT * FROM safetyquestions ORDER BY ord");
|
award_awards.id,
|
||||||
while($r=mysql_fetch_object($q))
|
award_awards.name,
|
||||||
{
|
award_awards.criteria,
|
||||||
if($r->required=="yes" && !$safetyanswers[$r->id])
|
projects.id AS projects_id
|
||||||
{
|
FROM
|
||||||
return "incomplete";
|
award_awards,
|
||||||
}
|
project_specialawards_link,
|
||||||
}
|
projects
|
||||||
return "complete";
|
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";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
<?
|
<?
|
||||||
require("common.inc.php");
|
require("common.inc.php");
|
||||||
include "register_participants.inc.php";
|
include "register_participants.inc.php";
|
||||||
|
include "projects.inc.php";
|
||||||
|
|
||||||
//authenticate based on email address and registration number from the SESSION
|
//authenticate based on email address and registration number from the SESSION
|
||||||
if(!$_SESSION['email'])
|
if(!$_SESSION['email'])
|
||||||
@ -182,7 +183,36 @@ echo "<table><tr><td>";
|
|||||||
if(registrationFormsReceived())
|
if(registrationFormsReceived())
|
||||||
{
|
{
|
||||||
echo "<tr><td><a href=\"register_participants_spawards.php\">".i18n("Self-nominate for special awards")."</a></td></tr>";
|
echo "<tr><td><a href=\"register_participants_spawards.php\">".i18n("Self-nominate for special awards")."</a></td></tr>";
|
||||||
// $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 "<tr><td>";
|
||||||
|
echo happy(i18n("You are nominated for %1 awards",array($num)),"inline");
|
||||||
|
echo "</td></tr>";
|
||||||
|
|
||||||
|
echo "<tr><td>";
|
||||||
|
$c=1;
|
||||||
|
foreach($nominatedawards AS $na)
|
||||||
|
{
|
||||||
|
echo $c.". ".$na['name']."<br />";
|
||||||
|
$c++;
|
||||||
|
}
|
||||||
|
echo "</td>";
|
||||||
|
echo "</tr>";
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo "<tr><td>";
|
||||||
|
echo error(i18n("You are nominated for 0 awards"),"inline");
|
||||||
|
echo "</td></tr>";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "</td></tr>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -116,10 +116,12 @@ else if($newstatus=="complete")
|
|||||||
$eligibleawards=getSpecialAwardsEligibleForProject($project->id);
|
$eligibleawards=getSpecialAwardsEligibleForProject($project->id);
|
||||||
$nominatedawards=getSpecialAwardsNominatedForProject($project->id);
|
$nominatedawards=getSpecialAwardsNominatedForProject($project->id);
|
||||||
|
|
||||||
|
/*
|
||||||
echo "eligible awards <br>";
|
echo "eligible awards <br>";
|
||||||
echo nl2br(print_r($eligibleawards,true));
|
echo nl2br(print_r($eligibleawards,true));
|
||||||
echo "nominated awards <br>";
|
echo "nominated awards <br>";
|
||||||
echo nl2br(print_r($nominatedawards,true));
|
echo nl2br(print_r($nominatedawards,true));
|
||||||
|
*/
|
||||||
|
|
||||||
$nominatedawards_list=array();
|
$nominatedawards_list=array();
|
||||||
foreach($nominatedawards AS $naward)
|
foreach($nominatedawards AS $naward)
|
||||||
|
Loading…
Reference in New Issue
Block a user