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
839 B

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( isset( $_POST['DID'] ) ){
$NID = intval( $_POST['DID'] );
$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[0] = intval( $R['id'] );
$CC[1] = intval( $R['width_k'] );
$CC[2] = intval( $R['range_k'] );
$CC[3] = intval( ( $MR * $CC[2] ) / 100.0 );
$Data['rows'][] = $CC;
};
echo json_encode( $Data );
} else {
echo "{ 'totalCount': 0, 'rows':[] }";
};
};
};
?>