librenms/html/includes/edit-host.inc
Adam Amstrong 93d3751b3f better front page? who knows!
git-svn-id: http://www.observium.org/svn/observer/trunk@200 61d68cd4-352d-0410-923a-c4978735b2b8
2008-03-24 01:21:11 +00:00

25 lines
682 B
PHP

<?
$descr = $_POST['descr'];
$ignore = $_POST['ignore'];
$type = $_POST['type'];
$disabled = $_POST['disabled'];
$sql = "UPDATE `devices` SET `purpose` = '$descr', `type` = '$type', `ignore` = '$ignore', `disabled` = '$disabled' WHERE `device_id` = '$_GET[id]'";
$query = mysql_query($sql);
$rows_updated = mysql_affected_rows();
if($rows_updated > 0) {
$update_message = mysql_affected_rows() . " Device record updated.";
$updated = 1;
} elseif ($rows_updated = '-1') {
$update_message = "Device record unchanged. No update necessary.";
$updated = -1;
} else {
$update_message = "Device record update error.";
$updated = 0;
}
?>