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.

21 lines
693 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $Data = array();
  5. $Data['success'] = false;
  6. if( isset( $_POST['SITE'] ) ){
  7. $SiteID = intval( $_POST['SITE'] );
  8. $QS = "SELECT re.aux_id as id, re.device as name FROM resources re LEFT JOIN nodes no ON( re.node_id = no.id ) WHERE ( re.type=1 OR re.type=129 ) AND no.site_id={$SiteID}";
  9. $Result = $DATABASE->Query($QS,false);
  10. $Data['ports'] = array();
  11. foreach( $Result as $CD ){
  12. $cnode['uart_id'] = $CD['id'];
  13. $cnode['uart_name'] = $CD['name'];
  14. $Data['ports'][] = $cnode;
  15. };
  16. $Data['success'] = true;
  17. };
  18. echo json_encode( $Data );
  19. } else {
  20. header('location: /');
  21. };
  22. ?>