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.

26 lines
901 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. if( isset( $_POST['NID'] ) ){
  5. $NID = intval( $_POST['NID'] );
  6. $QS = "SELECT * FROM `lrf_detection_width_tables` WHERE `aux_id`={$NID} ORDER BY `range_k`";
  7. $RR = $DATABASE->Query( $QS );
  8. if( count( $RR ) ){
  9. $QS = "SELECT `max_range` FROM `lrf_sensors` WHERE `id`={$NID}";
  10. $ZZ = $DATABASE->Query( $QS );
  11. $MR = floatval( $ZZ[0]['max_range'] );
  12. $Data['totalCount'] = count( $RR );
  13. $Data['rows'] = array();
  14. foreach( $RR as $R ){
  15. $CC['id'] = intval( $R['id'] );
  16. $CC['width'] = intval( 100.0 * floatval($R['width_k']));
  17. $CC['range'] = intval( 100.0 * floatval($R['range_k']));
  18. $CC['range_m'] = intval( $MR * floatval($R['range_k']) );
  19. $Data['rows'][] = $CC;
  20. };
  21. echo json_encode( $Data );
  22. } else {
  23. echo "{ 'totalCount': 0, 'rows':[] }";
  24. };
  25. };
  26. };
  27. ?>