forked from science-ation/science-ation
Fix the -1 for the god damn last time
This commit is contained in:
parent
af47f30aeb
commit
c6ba56f57a
@ -356,20 +356,21 @@ function saveProjectData($data,$registrations_id=null){
|
||||
$awards=array();
|
||||
foreach($data['specialawards'] AS $sa) {
|
||||
//If all they've selected is they don't want to self nominate, then erase all other selections
|
||||
if($sa['id']==-1) {
|
||||
if($sa['id']==-1 && $sa['selected']) {
|
||||
//reset the array
|
||||
unset($awards);
|
||||
$awards=array();
|
||||
$awards[]=$sa;
|
||||
//and stop looping
|
||||
break;
|
||||
}
|
||||
else {
|
||||
if($sa['selected'] && in_array($sa['id'],$eligibleAwardsList)) {
|
||||
echo "id {$sa['id']} is selected AND eligible\n";
|
||||
$awards[]=$sa;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$idx=0;
|
||||
foreach($awards AS $sa) {
|
||||
$qstr="INSERT INTO project_specialawards_link (award_awards_id,projects_id,conferences_id) VALUES ('".intval($sa['id'])."','".intval($data['project_id'])."','{$conference['id']}')";
|
||||
|
Loading…
Reference in New Issue
Block a user