forked from science-ation/science-ation
whoops same as last msg forgot this file.
This commit is contained in:
parent
c93a18ea4e
commit
192d98f7b7
@ -61,13 +61,25 @@ function getProjectsEligibleForAward($award_id)
|
|||||||
return $projects;
|
return $projects;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProjectsEligibleForAwards($awards_ids_array)
|
function getProjectsEligibleOrNominatedForAwards($awards_ids_array)
|
||||||
{
|
{
|
||||||
$projects=array();
|
$projects=array();
|
||||||
foreach($awards_ids_array AS $award_id)
|
foreach($awards_ids_array AS $award_id)
|
||||||
{
|
{
|
||||||
|
$q=mysql_query("SELECT award_types.type FROM award_awards, award_types WHERE award_awards.id='$award_id' AND award_awards.award_types_id=award_types.id");
|
||||||
|
$r=mysql_fetch_object($q);
|
||||||
|
|
||||||
$awardprojects=array();
|
$awardprojects=array();
|
||||||
$awardprojects=getProjectsEligibleForAward($award_id);
|
|
||||||
|
//for special awards, we only want the ones that were nominated for it.
|
||||||
|
//for everything else, we weant all the eligible projects
|
||||||
|
if($r->type=="Special")
|
||||||
|
$awardprojects=getProjectsNominatedForSpecialAward($award_id);
|
||||||
|
else
|
||||||
|
$awardprojects=getProjectsEligibleForAward($award_id);
|
||||||
|
|
||||||
|
// $projects[$award_id]=$awardprojects;
|
||||||
|
|
||||||
//this will just overwrite ones that already exist, but still keep things in order because the main key is the projectnumber (i hope)
|
//this will just overwrite ones that already exist, but still keep things in order because the main key is the projectnumber (i hope)
|
||||||
foreach($awardprojects AS $proj)
|
foreach($awardprojects AS $proj)
|
||||||
$projects[$proj['projectnumber']]=$proj;
|
$projects[$proj['projectnumber']]=$proj;
|
||||||
@ -153,6 +165,37 @@ function getSpecialAwardsNominatedForProject($projectid)
|
|||||||
return $awards;
|
return $awards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getProjectsNominatedForSpecialAward($award_id)
|
||||||
|
{
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
$prjq=mysql_query("SELECT
|
||||||
|
projects.projectnumber,
|
||||||
|
projects.title,
|
||||||
|
projects.id AS projects_id
|
||||||
|
FROM
|
||||||
|
project_specialawards_link,
|
||||||
|
projects
|
||||||
|
WHERE
|
||||||
|
project_specialawards_link.award_awards_id='$award_id'
|
||||||
|
AND project_specialawards_link.projects_id=projects.id
|
||||||
|
AND projects.projectnumber is not null
|
||||||
|
AND projects.year='".$config['FAIRYEAR']."'
|
||||||
|
ORDER BY
|
||||||
|
projectnumber
|
||||||
|
");
|
||||||
|
$projects=array();
|
||||||
|
while($prjr=mysql_fetch_object($prjq))
|
||||||
|
{
|
||||||
|
$projects[$prjr->projectnumber]=array(
|
||||||
|
"id"=>$prjr->projects_id,
|
||||||
|
"projectnumber"=>$prjr->projectnumber,
|
||||||
|
"title"=>$prjr->title
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return $projects;
|
||||||
|
}
|
||||||
|
|
||||||
function getSpecialAwardsNominatedByRegistrationID($id)
|
function getSpecialAwardsNominatedByRegistrationID($id)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user