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.
31 lines
831 B
31 lines
831 B
<?php
|
|
require_once('../ajax_asm.php');
|
|
if( $CUser->Data['id'] > 1 ){
|
|
$Z = $_POST['NID'];
|
|
if( $Z != '' ){
|
|
$TArr = explode( ':', $Z );
|
|
$NodeID = intval( $TArr[0] );
|
|
$QS = "SELECT * FROM nodes WHERE id={$NodeID}";
|
|
$Data = array();
|
|
$result = $DATABASE->Query( $QS, false );
|
|
if( count( $result ) ){
|
|
$T = $result[0];
|
|
$AID = intval( $T['aux_id'] );
|
|
$QS = "SELECT * FROM lrf_sensors WHERE id={$AID}";
|
|
$result = $DATABASE->Query( $QS, false );
|
|
if( count($result)) {
|
|
$R = $result[0];
|
|
$K['name'] = $T['name'];
|
|
$K['dev_id'] = $AID;
|
|
//$K['data_status'] = intval( $R['data_status'] );
|
|
$K['type'] = intval( $R['type_id'] );
|
|
$K['range'] = floatval( $R['max_range'] );
|
|
$Data = $K;
|
|
};
|
|
};
|
|
echo json_encode( $Data );
|
|
exit();
|
|
};
|
|
};
|
|
header('location: /');
|
|
?>
|