Web Interface For Lite Argus Control modules
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.
 
 
 
 

35 lines
1.2 KiB

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$NodeID = intval($_POST['NID']);
$Data = array();
if( $NodeID ){
$QS = "SELECT * FROM nodes WHERE id={$NodeID}";
$result = $DATABASE->Query( $QS, false );
if( count( $result ) ){
$T = $result[0];
$AID = $T['aux_id'];
$MIP = $DATABASE->escape( $_POST['MIP'] );
$MPP = $DATABASE->escape( $_POST['MPP'] );
$SIP = $DATABASE->escape( $_POST['SIP'] );
$SPP = $DATABASE->escape( $_POST['SPP'] );
$LAT = floatval( $_POST['LAT'] );
$LON = floatval( $_POST['LON'] );
$ALT = floatval( $_POST['ALT'] );
$ROL = floatval( $_POST['ROL'] );
$PCH = floatval( $_POST['PCH'] );
$YAW = floatval( $_POST['YAW'] );
$QS = "UPDATE lrf_sensors SET ip_address='{$MIP}', port='{$MPP}', aux_ip_address='{$SIP}', aux_port='{$SPP}', lat={$LAT}, lon={$LON}, alt={$ALT}, roll={$ROL}, pitch={$PCH}, yaw={$YAW} WHERE id={$AID}";
$DATABASE->Query( $QS, false );
$Data['success'] = true;
} else {
$Data['error'] = 'Unknown Node ID Provided!';
};
} else {
$Data['error'] = 'Unknown Node ID Provided!';
};
echo json_encode( $Data );
exit();
};
header('location: /');
?>