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.
 
 
 
 

27 lines
901 B

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( isset( $_POST['NID'] ) ){
$NID = intval( $_POST['NID'] );
$QS = "SELECT * FROM `lrf_detection_width_tables` WHERE `aux_id`={$NID} ORDER BY `range_k`";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
$QS = "SELECT `max_range` FROM `lrf_sensors` WHERE `id`={$NID}";
$ZZ = $DATABASE->Query( $QS );
$MR = floatval( $ZZ[0]['max_range'] );
$Data['totalCount'] = count( $RR );
$Data['rows'] = array();
foreach( $RR as $R ){
$CC['id'] = intval( $R['id'] );
$CC['width'] = intval( 100.0 * floatval($R['width_k']));
$CC['range'] = intval( 100.0 * floatval($R['range_k']));
$CC['range_m'] = intval( $MR * floatval($R['range_k']) );
$Data['rows'][] = $CC;
};
echo json_encode( $Data );
} else {
echo "{ 'totalCount': 0, 'rows':[] }";
};
};
};
?>