forked from science-ation/science-ation
Fix special award nominations to work with "-1" special award (i dont want to nomiiated for special awradsa)
This commit is contained in:
parent
afd81015eb
commit
af47f30aeb
4
api.php
4
api.php
@ -44,6 +44,7 @@ fwrite($fout, " --- request at " . date("Y-m-d H:i:s") . " ---\n");
|
||||
fwrite($fout, "\$_GET = \n" . print_r($_GET, true) . "\n");
|
||||
fwrite($fout, "\$_POST = \n" . print_r($_POST, true) . "\n");
|
||||
fwrite($fout, "\$_SESSION = \n" . print_r($_SESSION, true) . "\n");
|
||||
ob_start();
|
||||
|
||||
switch($request[0]) {
|
||||
case 'config':
|
||||
@ -1278,6 +1279,9 @@ switch($request[0]) {
|
||||
|
||||
}
|
||||
fwrite($fout, "result = \n" . print_r($ret, true) . "\n");
|
||||
$output=ob_get_contents();
|
||||
fwrite($fout, "outputbuffer = $output\n");
|
||||
fclose($fout);
|
||||
ob_end_clean();
|
||||
echo json_encode($ret);
|
||||
?>
|
||||
|
@ -1 +1 @@
|
||||
234
|
||||
235
|
||||
|
1
db/db.update.235.sql
Normal file
1
db/db.update.235.sql
Normal file
@ -0,0 +1 @@
|
||||
ALTER TABLE `project_specialawards_link` CHANGE `award_awards_id` `award_awards_id` INT( 11 ) NULL DEFAULT NULL;
|
@ -177,18 +177,18 @@ function getNominatedForNoSpecialAwardsForProject($projectid)
|
||||
{
|
||||
global $conference;
|
||||
$awardsq=mysql_query("SELECT
|
||||
projects.id AS projects_id
|
||||
projects_id
|
||||
FROM
|
||||
project_specialawards_link,
|
||||
projects
|
||||
project_specialawards_link
|
||||
WHERE
|
||||
project_specialawards_link.projects_id='$projectid'
|
||||
AND projects.conferences_id='".$conference['id']."'
|
||||
AND projects.id='$projectid'
|
||||
AND project_specialawards_link.award_awards_id IS NULL
|
||||
projects_id='$projectid'
|
||||
AND conferences_id='{$conference['id']}'
|
||||
AND award_awards_id=-1
|
||||
");
|
||||
if(mysql_num_rows($awardsq) == 1) return true;
|
||||
return false;
|
||||
if(mysql_num_rows($awardsq) == 1)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function getProjectsNominatedForSpecialAward($award_id)
|
||||
@ -320,22 +320,24 @@ function getProjectId($registrations_id){
|
||||
function getAwardListing($project_id){
|
||||
$returnval = array();
|
||||
$eligibleAwards = getSpecialAwardsEligibleForProject($project_id);
|
||||
$nominatedawards = getSpecialAwardsNominatedForProject($project_id);
|
||||
$nominatedAwards = getSpecialAwardsNominatedForProject($project_id);
|
||||
|
||||
$eligibleawards = array_merge(array(array( 'id'=> -1,
|
||||
$eligibleAwards = array_merge(array(array( 'id'=> -1,
|
||||
'name' => "I do not wish to self-nominate for any special awards",
|
||||
'criteria' => "Select this option if you do not wish to self-nominate you project for any special awards.<hr>",
|
||||
'self_nominate' => 'yes')),
|
||||
$eligibleawards);
|
||||
$eligibleAwards);
|
||||
|
||||
/* See if they have the -1 award selected */
|
||||
$noawards = getNominatedForNoSpecialAwardsForProject($project_id);
|
||||
// echo "noawards=$noawards";
|
||||
if($noawards == true) {
|
||||
$nominatedawards = array_merge(array(array('id' => '-1')), $nominatedawards);
|
||||
// echo "marging -1 award";
|
||||
$nominatedAwards = array_merge(array(array('id' => '-1')), $nominatedAwards);
|
||||
}
|
||||
|
||||
$nominatedawards_list=array();
|
||||
foreach($nominatedawards AS $naward){
|
||||
foreach($nominatedAwards AS $naward){
|
||||
$nominatedawards_list[] = $naward['id'];
|
||||
}
|
||||
foreach($eligibleAwards AS $eaward){
|
||||
|
Loading…
Reference in New Issue
Block a user