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.
 
 
 
 

22 lines
693 B

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$Data = array();
$Data['success'] = false;
if( isset( $_POST['SITE'] ) ){
$SiteID = intval( $_POST['SITE'] );
$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}";
$Result = $DATABASE->Query($QS,false);
$Data['ports'] = array();
foreach( $Result as $CD ){
$cnode['uart_id'] = $CD['id'];
$cnode['uart_name'] = $CD['name'];
$Data['ports'][] = $cnode;
};
$Data['success'] = true;
};
echo json_encode( $Data );
} else {
header('location: /');
};
?>