diff --git a/register_participants.inc.php b/register_participants.inc.php index 74303be..7198f7d 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -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']}')";