Don't let students sign up for more special awards than tehy are allowed to

This commit is contained in:
james 2011-03-03 20:58:54 +00:00
parent 42ba7a3db9
commit b1940cbb9a

View File

@ -346,9 +346,14 @@ function saveProjectData($data){
} }
mysql_query("DELETE FROM projects_specialawards_link WHERE projects_id='{$data['projects_id']}' AND conferences_id='{$conference['id']}'"); mysql_query("DELETE FROM projects_specialawards_link WHERE projects_id='{$data['projects_id']}' AND conferences_id='{$conference['id']}'");
$idx=0;
foreach($data['specialawards'] AS $sa) { foreach($data['specialawards'] AS $sa) {
if($sa['selected']==true) { if($sa['selected']==true) {
mysql_query("INSERT INTO projects_specialawards_link (award_awards_id,projects_id,conferences_id) VALUES ('".intval($sa['id'])."','".intval($data['projects_id'])."','{$conference['id']}')"); mysql_query("INSERT INTO projects_specialawards_link (award_awards_id,projects_id,conferences_id) VALUES ('".intval($sa['id'])."','".intval($data['projects_id'])."','{$conference['id']}')");
$idx++;
//dont let them sign up for more than they are allowed to
if($idx>=$config['maxspecialawardsperproject'])
break;
} }
} }
} }