Web Interface For Lite Argus Control modules
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.
 
 
 
 

32 lines
1.1 KiB

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$NodeID = intval($_POST['NID']);
$Master = intval($_POST['MST']);
$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];
$R['name'] = $T['name'];
$R['data_status'] = intval( $R['data_status'] );
$R['online'] = intval($T['online']);
$QS="SELECT * FROM `lrf_detection_profiles` WHERE `aux_id`={$AID} AND `profile_id`={$R['detection_profile_id']} AND `master`=b'1'";
$result = $DATABASE->Query( $QS, false );
$R['master_profile']=$result[0];
$QS="SELECT * FROM `lrf_detection_profiles` WHERE `aux_id`={$AID} AND `profile_id`={$R['detection_profile_id']} AND `master`=b'0'";
$result = $DATABASE->Query( $QS, false );
$R['slave_profile']=$result[0];
$Data = $R;
};
};
echo json_encode( $Data );
exit();
};
header('location: /');
?>