"7") { $updated = 0; $override_sysLocation_bool = mres($_POST['override_sysLocation']); if (isset($_POST['sysLocation'])) { $override_sysLocation_string = mres($_POST['sysLocation']); } if (get_dev_attrib($device,'override_sysLocation_bool') != $override_sysLocation_bool || get_dev_attrib($device,'override_sysLocation_string') != $override_sysLocation_string) { $updated = 1; } if ($override_sysLocation_bool) { set_dev_attrib($device, 'override_sysLocation_bool', '1'); } else { del_dev_attrib($device, 'override_sysLocation_bool'); } if (isset($override_sysLocation_string)) { set_dev_attrib($device, 'override_sysLocation_string', $override_sysLocation_string); }; #FIXME needs more sanity checking! and better feedback $param = array('purpose' => $_POST['descr'], 'type' => $_POST['type'], 'ignore' => $_POST['ignore'], 'disabled' => $_POST['disabled']); $rows_updated = dbUpdate($param, 'devices', '`device_id` = ?', array($device['device_id'])); if ($rows_updated > 0 || $updated) { $update_message = "Device record updated."; $updated = 1; $device = dbFetchRow("SELECT * FROM `devices` WHERE `device_id` = ?", array($device['device_id'])); } elseif ($rows_updated = '-1') { $update_message = "Device record unchanged. No update necessary."; $updated = -1; } else { $update_message = "Device record update error."; } } else { include("includes/error-no-perm.inc.php"); } } $descr = $device['purpose']; $override_sysLocation_bool = get_dev_attrib($device,'override_sysLocation_bool'); $override_sysLocation_string = get_dev_attrib($device,'override_sysLocation_string'); if ($updated && $update_message) { print_message($update_message); } elseif ($update_message) { print_error($update_message); } ?>