$val) { if (!empty($val)) { unset($device); if (isset($_POST["e_set_type"])) { $device['device_type'] = $a_dev_type; } if (isset($_POST["e_set_model"])) { $device['device_model_id'] = $a_device_model_id; $device['vendor_id'] = get_device_model_vendor($db_link,$a_device_model_id); } //snmp if (isset($_POST["e_set_snmp_version"])) { $device['snmp_version'] = $a_snmp_version * 1; } if (isset($_POST["e_set_ro_community"])) { $device['community'] = $a_ro_community; } if (isset($_POST["e_set_rw_community"])) { $device['rw_community'] = $a_rw_community; } //location if (isset($_POST["e_set_building"])) { $device['building_id'] = $a_building_id * 1; } if (!empty($device)) { $ret = update_record($db_link, "devices", "id='" . $val . "'", $device); if (!$ret) { $all_ok = 0; } } } } if ($all_ok) { print "Success!"; } else { print "Fail!"; } }