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.
31 lines
968 B
31 lines
968 B
<?php
|
|
require_once('../ajax_asm.php');
|
|
ob_start();
|
|
$UID = intval( $CUser->Data['id'] );
|
|
$ACCESS = intval( $CUser->Data['access'] );
|
|
if( $UID > 1 ){
|
|
$TY = intval( $_POST['TYP'] );
|
|
if( $TY ){
|
|
$QS = "SELECT * FROM `cameras` WHERE `status` = 3";
|
|
} else {
|
|
$QS = "SELECT * FROM `cameras` WHERE `status` < 3";
|
|
};
|
|
$Result = $DATABASE->Query( $QS, false );
|
|
if( count( $Result ) ){
|
|
$CamPart = array();
|
|
foreach( $Result as $R ){
|
|
$CamPart[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="UART_'.(($R['online']==0)?'N':'O').'" onclick="editCamera('.$R['id'].','.$TY.');">'.urldecode($R['name']).'['.$R['hardware'].']</a>\'}';
|
|
};
|
|
$Data['status']='ok';
|
|
$Data['cameras'] = '['.implode( ',', $CamPart ) .']';
|
|
} else {
|
|
$Data['status']='na';
|
|
};
|
|
$Data['messages'] = ob_get_clean();
|
|
echo json_encode( $Data );
|
|
} else {
|
|
header('location: /');
|
|
};
|
|
|
|
|
|
?>
|