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.
 
 
 
 

22 lines
714 B

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$ZIZI = new SQLite_DB( '/srv/www/web/lib/controller/data/reports.db');
$QS = "SELECT count(`id`) as `cnt`, `ts`/86400 as `ts` FROM `events` GROUP BY `ts`/86400";
$RR = $ZIZI->Query( $QS );
if( count( $RR ) ){
$DD = array();
foreach( $RR as $R ){
$CC = intval( $R['cnt'] );
if( $CC > 100 ) $CC = 100;
$DD[] = '{"t": '.($R['ts']*86400000).',"v":'.$CC.'}';
//echo '[{"t": 1285891200000,"v": 20},{"t": 1285804800000,"v": 100},{"t": 1672249854000,"v": 50},{"t": 1672279854000,"v": 80}]';
};
echo "[" . implode(",", $DD ) . "]";
} else {
echo "[]";
};
} else {
header('location: /');
};
?>