- Fix award info saving

- Fix clearing out divisons/categories
This commit is contained in:
dave 2009-09-26 00:10:57 +00:00
parent c47f53ad93
commit d77616a438

View File

@ -67,21 +67,22 @@
if(array_key_exists('name', $_POST)) { if(array_key_exists('name', $_POST)) {
/* These values may be disabled, if they name key exists, assume /* These values may be disabled, if they name key exists, assume
* they aren't disabled and save them too */ * they aren't disabled and save them too */
$q .= "name='".mysql_escape_string(stripslashes($_POST['name']))."', $q .= ",name='".mysql_escape_string(stripslashes($_POST['name']))."',
criteria='".mysql_escape_string(stripslashes($_POST['criteria']))."', criteria='".mysql_escape_string(stripslashes($_POST['criteria']))."',
sponsors_id='".intval($_POST['sponsors_id'])."'"; sponsors_id='".intval($_POST['sponsors_id'])."' ";
} }
$q .= "WHERE id='$id'"; $q .= "WHERE id='$id'";
mysql_query($q); mysql_query($q);
print_r($_POST); print_r($_POST);
echo $q; echo $q;
echo mysql_error();
happy_("Award information saved"); happy_("Award information saved");
exit; exit;
case 'eligibility_load': case 'eligibility_load':
$id = intval($_GET['id']); $id = intval($_GET['id']);
//select the current categories that this award is linked to //select the current categories that this award is linked to
$reg = array(); $ret = array('categories'=>array(), 'divisions'=>array() );
$q=mysql_query("SELECT * FROM award_awards_projectcategories WHERE award_awards_id='$id'"); $q=mysql_query("SELECT * FROM award_awards_projectcategories WHERE award_awards_id='$id'");
while($r=mysql_fetch_assoc($q)) { while($r=mysql_fetch_assoc($q)) {
$ret['categories'][] = $r['projectcategories_id']; $ret['categories'][] = $r['projectcategories_id'];