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.
27 lines
889 B
27 lines
889 B
<?php
|
|
require_once('../ajax_asm.php');
|
|
if( $CUser->Data['id'] > 1 ){
|
|
$ZIZI = new SQLite_DB( '/srv/www/web/lib/controller/data/reports/stat.db');
|
|
$TZ = new DateTimeZone( date_default_timezone_get() );
|
|
$DT = new DateTime("now", $TZ );
|
|
$DIDI = $TZ->getOffset( $DT );
|
|
$QS = "SELECT * FROM `days`";
|
|
$RR = $ZIZI->Query( $QS );
|
|
if( count( $RR ) ){
|
|
$DD = array();
|
|
foreach( $RR as $R ){
|
|
$CC = intval( $R['session_count'] );
|
|
$DS = $R['year'] . '-' . $R['month'] . '-' . $R['day'] . ' 00:00:00';
|
|
$TS = strtotime( $DS );
|
|
if( $CC > 100 ) $CC = 100;
|
|
$DD[] = '{"t": '.( $TS * 1000 ).',"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: /');
|
|
};
|
|
?>
|