Web UI for ARGUS server
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.

29 lines
993 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $NodeID = intval($_POST['NID']);
  5. $SiteID = intval($_POST['SITE']);
  6. $QS = "SELECT * FROM nodes WHERE id={$NodeID}";
  7. $Data = array();
  8. $result = $DATABASE->Query( $QS, false );
  9. if( count( $result ) ){
  10. $T = $result[0];
  11. $AID = $T['aux_id'];
  12. $QS = "SELECT * FROM lrf_sensors WHERE id={$AID}";
  13. $result = $DATABASE->Query( $QS, false );
  14. if( count($result)) {
  15. $R = $result[0];
  16. $K['name'] = $T['name'];
  17. $K['data_status'] = intval( $R['data_status'] );
  18. $K['online'] = intval($T['online']);
  19. $K['profile_id'] = intval($R['detection_profile_id']);
  20. $K['profiles'] = array();
  21. $QS = "SELECT DISTINCT `profile_id` as `id` FROM `lrf_detection_profiles` WHERE `aux_id`={$AID} ORDER BY `profile_id`";
  22. foreach( $DATABASE->Query( $QS ) as $Z ) $K['profiles'][] = intval($Z['id']);
  23. $Data = $K;
  24. };
  25. };
  26. echo json_encode( $Data );
  27. exit();
  28. };
  29. header('location: /');
  30. ?>