FIx bug in special awards saving

This commit is contained in:
james 2011-03-04 00:49:25 +00:00
parent 5df66f4b7e
commit 7254d983d8

View File

@ -350,12 +350,13 @@ function saveProjectData($data,$registrations_id=null){
foreach($eligibleAwards AS $ea) { foreach($eligibleAwards AS $ea) {
$eligibleAwardsList[]=$ea['id']; $eligibleAwardsList[]=$ea['id'];
} }
mysql_query("DELETE FROM projects_specialawards_link WHERE projects_id='{$data['projects_id']}' AND conferences_id='{$conference['id']}'"); mysql_query("DELETE FROM project_specialawards_link WHERE projects_id='{$data['project_id']}' AND conferences_id='{$conference['id']}'");
$idx=0; $idx=0;
foreach($data['specialawards'] AS $sa) { foreach($data['specialawards'] AS $sa) {
if($sa['selected']==true) { if($sa['selected'] && in_array($sa['id'],$eligibleAwardsList)) {
mysql_query("INSERT INTO projects_specialawards_link (award_awards_id,projects_id,conferences_id) VALUES ('".intval($sa['id'])."','".intval($data['projects_id'])."','{$conference['id']}')"); $qstr="INSERT INTO project_specialawards_link (award_awards_id,projects_id,conferences_id) VALUES ('".intval($sa['id'])."','".intval($data['project_id'])."','{$conference['id']}')";
mysql_query($qstr);
$idx++; $idx++;
//dont let them sign up for more than they are allowed to //dont let them sign up for more than they are allowed to
if($idx>=$config['maxspecialawardsperproject']) if($idx>=$config['maxspecialawardsperproject'])