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.
 
 
 
 

30 lines
993 B

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$NodeID = intval($_POST['NID']);
$SiteID = intval($_POST['SITE']);
$QS = "SELECT * FROM nodes WHERE id={$NodeID}";
$Data = array();
$result = $DATABASE->Query( $QS, false );
if( count( $result ) ){
$T = $result[0];
$AID = $T['aux_id'];
$QS = "SELECT * FROM lrf_sensors WHERE id={$AID}";
$result = $DATABASE->Query( $QS, false );
if( count($result)) {
$R = $result[0];
$K['name'] = $T['name'];
$K['data_status'] = intval( $R['data_status'] );
$K['online'] = intval($T['online']);
$K['profile_id'] = intval($R['detection_profile_id']);
$K['profiles'] = array();
$QS = "SELECT DISTINCT `profile_id` as `id` FROM `lrf_detection_profiles` WHERE `aux_id`={$AID} ORDER BY `profile_id`";
foreach( $DATABASE->Query( $QS ) as $Z ) $K['profiles'][] = intval($Z['id']);
$Data = $K;
};
};
echo json_encode( $Data );
exit();
};
header('location: /');
?>