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.

26 lines
889 B

​
​
3 years ago
​
​
​
​
4 years ago
​
​
​
3 years ago
​
​
4 years ago
3 years ago
4 years ago
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $ZIZI = new SQLite_DB( '/srv/www/web/lib/controller/data/reports/stat.db');
  5. $TZ = new DateTimeZone( date_default_timezone_get() );
  6. $DT = new DateTime("now", $TZ );
  7. $DIDI = $TZ->getOffset( $DT );
  8. $QS = "SELECT * FROM `days`";
  9. $RR = $ZIZI->Query( $QS );
  10. if( count( $RR ) ){
  11. $DD = array();
  12. foreach( $RR as $R ){
  13. $CC = intval( $R['session_count'] );
  14. $DS = $R['year'] . '-' . $R['month'] . '-' . $R['day'] . ' 00:00:00';
  15. $TS = strtotime( $DS );
  16. if( $CC > 100 ) $CC = 100;
  17. $DD[] = '{"t": '.( $TS * 1000 ).',"v":'.$CC.'}';
  18. //echo '[{"t": 1285891200000,"v": 20},{"t": 1285804800000,"v": 100},{"t": 1672249854000,"v": 50},{"t": 1672279854000,"v": 80}]';
  19. };
  20. echo "[" . implode(",", $DD ) . "]";
  21. } else {
  22. echo "[]";
  23. };
  24. } else {
  25. header('location: /');
  26. };
  27. ?>