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.

30 lines
831 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $Z = $_POST['NID'];
  5. if( $Z != '' ){
  6. $TArr = explode( ':', $Z );
  7. $NodeID = intval( $TArr[0] );
  8. $QS = "SELECT * FROM nodes WHERE id={$NodeID}";
  9. $Data = array();
  10. $result = $DATABASE->Query( $QS, false );
  11. if( count( $result ) ){
  12. $T = $result[0];
  13. $AID = intval( $T['aux_id'] );
  14. $QS = "SELECT * FROM lrf_sensors WHERE id={$AID}";
  15. $result = $DATABASE->Query( $QS, false );
  16. if( count($result)) {
  17. $R = $result[0];
  18. $K['name'] = $T['name'];
  19. $K['dev_id'] = $AID;
  20. //$K['data_status'] = intval( $R['data_status'] );
  21. $K['type'] = intval( $R['type_id'] );
  22. $K['range'] = floatval( $R['max_range'] );
  23. $Data = $K;
  24. };
  25. };
  26. echo json_encode( $Data );
  27. exit();
  28. };
  29. };
  30. header('location: /');
  31. ?>