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.
 
 
 
 

30 lines
945 B

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$Data = array();
$GID = intval($_POST['NID']);
if( isset( $_POST['LTS'] ) ){
$TArr = explode( '.', $_POST['LTS'] );
$tts = intval( $TArr[0] );
$ttms = intval( $TArr[1] );
};
if( $tts > 0 ){
$QS = "SELECT * FROM events_cloud WHERE ts > {$tts} AND ts_ms > 0";
} else {
$QS = "SELECT * FROM events_cloud ORDER BY id DESC LIMIT 20";
};
$Result = $DATABASE->Query( $QS, false );
foreach( array_reverse ( $Result ) as $CD ){
$cnode['id'] = $CD['id'];
$cnode['group'] = $CD['node_id'];
//$cnode['content'] = '*';//'' . ( intval( $CD['ts'] ) + $CD['ts_ms'] / 1000 );
$cnode['start'] = intval( $CD['ts'] ) + ( $CD['ts_ms'] / 1000 );
$cnode['type'] = 'point';
$Data[] = $cnode;
};
//$Data['LT'] = $cnode['start'];// '' . microtime(true);
echo json_encode( $Data );
} else {
header('location: /');
};
?>