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.

29 lines
945 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $Data = array();
  5. $GID = intval($_POST['NID']);
  6. if( isset( $_POST['LTS'] ) ){
  7. $TArr = explode( '.', $_POST['LTS'] );
  8. $tts = intval( $TArr[0] );
  9. $ttms = intval( $TArr[1] );
  10. };
  11. if( $tts > 0 ){
  12. $QS = "SELECT * FROM events_cloud WHERE ts > {$tts} AND ts_ms > 0";
  13. } else {
  14. $QS = "SELECT * FROM events_cloud ORDER BY id DESC LIMIT 20";
  15. };
  16. $Result = $DATABASE->Query( $QS, false );
  17. foreach( array_reverse ( $Result ) as $CD ){
  18. $cnode['id'] = $CD['id'];
  19. $cnode['group'] = $CD['node_id'];
  20. //$cnode['content'] = '*';//'' . ( intval( $CD['ts'] ) + $CD['ts_ms'] / 1000 );
  21. $cnode['start'] = intval( $CD['ts'] ) + ( $CD['ts_ms'] / 1000 );
  22. $cnode['type'] = 'point';
  23. $Data[] = $cnode;
  24. };
  25. //$Data['LT'] = $cnode['start'];// '' . microtime(true);
  26. echo json_encode( $Data );
  27. } else {
  28. header('location: /');
  29. };
  30. ?>