Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 lines
830 B

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( isset( $_POST['SENSOR'] ) ){
$S_ID = intval($_POST['SENSOR']);
if( $S_ID ){
$NAME = $DATABASE->escape($_POST['SNAME']);
if(isset($_POST['SADDR'])){
$ADDR = intval($_POST['SADDR']);
$RANGE = floatval($_POST['SRANGE']);
$QS="UPDATE `lrf_sensors` SET `device_id`={$ADDR}, `max_range`={$RANGE}, `label`='{$NAME}' WHERE id={$S_ID}";
$DATABASE->Query( $QS );
} else {
$IP= $DATABASE->escape($_POST['SIPADDR']);
$NAME = $DATABASE->escape($_POST['SNAME']);
$QS="UPDATE `lrf_sensors` SET `ip_address`='{$IP}', `label`='{$NAME}' WHERE id={$S_ID}";
$DATABASE->Query( $QS );
};
$QS="UPDATE `nodes` SET `name`='{$NAME}' WHERE `aux_id`={$S_ID}";
$DATABASE->Query( $QS );
};
};
};
?>