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.

31 lines
1.1 KiB

5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
5 years ago
​
​
​
​
​
​
6 years ago
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $NodeID = intval($_POST['NID']);
  5. $Master = intval($_POST['MST']);
  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. $R['name'] = $T['name'];
  17. $R['data_status'] = intval( $R['data_status'] );
  18. $R['online'] = intval($T['online']);
  19. $QS="SELECT * FROM `lrf_detection_profiles` WHERE `aux_id`={$AID} AND `profile_id`={$R['detection_profile_id']} AND `master`=b'1'";
  20. $result = $DATABASE->Query( $QS, false );
  21. $R['master_profile']=$result[0];
  22. $QS="SELECT * FROM `lrf_detection_profiles` WHERE `aux_id`={$AID} AND `profile_id`={$R['detection_profile_id']} AND `master`=b'0'";
  23. $result = $DATABASE->Query( $QS, false );
  24. $R['slave_profile']=$result[0];
  25. $Data = $R;
  26. };
  27. };
  28. echo json_encode( $Data );
  29. exit();
  30. };
  31. header('location: /');
  32. ?>