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.
 
 
 
 

34 lines
1010 B

<?php
//await new Promise(r => setTimeout(r, 2000));
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$Data = array( 'sensors'=>array(), 'cameras'=>array() );
$QS = "SELECT * FROM `nodes` WHERE `type` > 0 AND `type` < 14";
$RR = $DATABASE->Query( $QS );
foreach( $RR AS $R ){
$CD = array();
$CD['node_id']=$R['id'];
if( $R['type'] < 10 ){
$QS = "SELECT * FROM `lrf_sensors` WHERE `id`={$R['aux_id']}";
$DD = $DATABASE->Query( $QS );
$D = $DD[0];
$CD['id']=$D['id'];
$CD['type']=intval( $D['type'] );
$CD['max_range']=floatval( $D['max_range'] );
$CD['base_shift']=intval( $D['base_shift'] );
$Data['sensors'][] = $CD;
} else {
$CD = array();
$QS = "SELECT * FROM `cameras` WHERE `id`={$R['aux_id']}";
$DD = $DATABASE->Query( $QS );
$D = $DD[0];
$CD['id']=$D['id'];
$CD['type']=intval( $D['type'] );
$Data['cameras'][] = $CD;
};
};
echo json_encode( $Data );
exit();
};
header( 'location: /' );
?>