Modify some locations to be more organised and move uptime tracking to a seperate table.

git-svn-id: http://www.observium.org/svn/observer/trunk@38 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2007-04-04 10:08:02 +00:00
parent 1806ee02f5
commit bfb8aa7af5
7 changed files with 31 additions and 62 deletions
+13 -4
View File
@@ -1,16 +1,25 @@
<?
$updated = '1';
$descr = $_POST['descr'];
$apache = $_POST['apache'];
$temp = $_POST['temp'];
$ignore = $_POST['ignore'];
$type = $_POST['type'];
$sql = "UPDATE `devices` SET `purpose` = '$descr', `apache` = '$apache', `temp` = '$temp', `type` = '$type', `ignore` = '$ignore' WHERE `id` = '$_GET[id]'";
$sql = "UPDATE `devices` SET `purpose` = '$descr', `apache` = '$apache', `type` = '$type', `ignore` = '$ignore' WHERE `id` = '$_GET[id]'";
$query = mysql_query($sql);
$affected = mysql_affected_rows() . "records affected";
$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;
}
?>