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.2 KiB
32 lines
1.2 KiB
<?php
|
|
require_once('../ajax_asm.php');
|
|
ob_start();
|
|
$UID = intval( $CUser->Data['id'] );
|
|
$ACCESS = intval( $CUser->Data['access'] );
|
|
if( $UID > 1 ){
|
|
$QS = "SELECT `sen`.*, `no`.`enable`, `no`.`name` FROM `lrf_sensors` `sen` LEFT JOIN `nodes` `no` ON( `no`.`aux_id`=`sen`.`id` AND `no`.`type`=`sen`.`type`)";
|
|
$Result = $DATABASE->Query( $QS, false );
|
|
if( count( $Result ) ){
|
|
$SenPart = array();
|
|
foreach( $Result as $R ){
|
|
switch( $R['type'] ){
|
|
case 1: $HWT = 'ALS ' . $R['max_range'] . ' meters'; break;
|
|
case 2: $HWT = 'LFS ' . $R['max_range'] . ' meters'; break;
|
|
case 3: $HWT = 'PLS200 ' . $R['max_range'] . ' meters'; break;
|
|
case 4: $HWT = 'PLS360 ' . $R['max_range'] . ' meters'; break;
|
|
};
|
|
$SenPart[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="UART_'.(($R['enable']==0)?'N':'O').'" onclick="editSensorHW('.$R['id'].');">'.urldecode($R['name']).'['.$HWT.']</a>\'}';
|
|
};
|
|
$Data['status']='ok';
|
|
$Data['sensors'] = '['.implode( ',', $SenPart ) .']';
|
|
} else {
|
|
$Data['status']='na';
|
|
};
|
|
$Data['messages'] = ob_get_clean();
|
|
echo json_encode( $Data );
|
|
} else {
|
|
header('location: /');
|
|
};
|
|
|
|
|
|
?>
|