- Ok, so jquery does do the right thing, we just have to be careful not to read

fields that may not exist.
This commit is contained in:
dave 2009-09-20 21:50:51 +00:00
parent e07d24102c
commit fdeef1f273

View File

@ -56,19 +56,25 @@
}
$q = "UPDATE award_awards SET
name='".mysql_escape_string(stripslashes($_POST['name']))."',
sponsors_id='".intval($_POST['sponsors_id'])."',
award_types_id='".intval($_POST['award_types_id'])."',
presenter='".mysql_escape_string(stripslashes($_POST['presenter']))."',
excludefromac='".(($_POST['excludefromac'] == 1) ? 1 : 0)."',
cwsfaward='".(($_POST['cwsfaward'] == 1) ? 1 : 0)."',
self_nominate='".(($_POST['self_nominate'] == 'yes') ? 'yes' : 'no')."',
schedule_judges='".(($_POST['schedule_judges'] == 'yes') ? 'yes' : 'no')."',
criteria='".mysql_escape_string(stripslashes($_POST['criteria']))."',
description='".mysql_escape_string(stripslashes($_POST['description']))."'
WHERE id='$id'";
description='".mysql_escape_string(stripslashes($_POST['description']))."' ";
if(array_key_exists('name', $_POST)) {
/* These values may be disabled, if they name key exists, assume
* they aren't disabled and save them too */
$q .= "name='".mysql_escape_string(stripslashes($_POST['name']))."',
criteria='".mysql_escape_string(stripslashes($_POST['criteria']))."',
sponsors_id='".intval($_POST['sponsors_id'])."'";
}
$q .= "WHERE id='$id'";
mysql_query($q);
// echo $q;
print_r($_POST);
echo $q;
happy_("Award information saved");
exit;
@ -278,9 +284,7 @@ function update_awardinfo()
}
/* Enable all fields */
$("#awardinfo_name").removeAttr('disabled');
$("#awardinfo_sponsors_id").removeAttr('disabled');
$("#awardinfo_criteria").removeAttr('disabled');
$("#awardinfo *").removeAttr('disabled');
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=awardinfo_load&id="+award_id,
function(json){
@ -301,9 +305,9 @@ function update_awardinfo()
/* Disable fields we don't want the user to edit
* for downloaded awards */
if(json.award_source_fairs_id != null) {
// $("#awardinfo_name").attr('disabled', 'disabled');
// $("#awardinfo_sponsors_id").attr('disabled', 'disabled');
// $("#awardinfo_criteria").attr('disabled', 'disabled');
$("#awardinfo_name").attr('disabled', 'disabled');
$("#awardinfo_sponsors_id").attr('disabled', 'disabled');
$("#awardinfo_criteria").attr('disabled', 'disabled');
}
/* Update the dialog title */