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.

38 lines
1.6 KiB

​
​
​
3 years ago
4 years ago
​
​
​
3 years ago
​
​
​
4 years ago
​
​
​
3 years ago
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $BID = intval( $_POST['BID'] );
  5. $EID = intval( $_POST['EID'] );
  6. $DTS = intval( $_POST['TS'] );
  7. if( $BID ){
  8. $QS = "SELECT * FROM nodes";
  9. $result = $DATABASE->Query( $QS, false );
  10. $NodeNames = array();
  11. foreach( $result as $R ) $NodeNames[$R['id']] = $R['name'];
  12. $DS = date("Y/m/d", $DTS );
  13. $QS = "SELECT `events`.*, `events_2_videos`.* FROM `events` LEFT JOIN `events_2_videos` ON( `events`.`id` = `events_2_videos`.`evt_id` ) WHERE `events`.`id` >= {$BID} AND `events`.`id`<={$EID} ORDER BY `ts` ASC, `ts_ms` ASC";
  14. $ZIZI = new SQLite_DB( '/srv/www/web/lib/controller/data/reports/'.$DS.'/report.db');
  15. //$LREC = array_reverse( $ZIZI->Query( $QS ) );
  16. $LREC = $ZIZI->Query( $QS );
  17. $Data['log'] = array();
  18. foreach( $LREC as $REC ){
  19. $CR['id'] = intval( $REC['id'] );
  20. $CR['node_id'] = intval( $REC['node_id'] );
  21. $CR['node_name'] = 'koko';//$NodeNames[$CR['node_id']];
  22. $CR['ts'] = intval( $REC['ts'] );
  23. $CR['ms'] = intval( $REC['ts_ms'] );
  24. $CR['dts'] = date( "H:i:s.{$CR['ms']}", $CR['ts'] );
  25. $CR['type'] = intval( $REC['evt_type'] );
  26. $CR['range'] = sprintf( "%0.2f", floatval( $REC['range'] ));
  27. $CR['az'] = sprintf( "%0.2f", floatval( $REC['azimuth'] ));
  28. $CR['el'] = sprintf( "%0.2f", floatval( $REC['elevation'] ));
  29. $CR['r'] = intval( $REC['range_digital'] );
  30. $CR['width'] = intval( $REC['area'] );
  31. $CR['video_id'] = intval( $REC['video_id'] );
  32. $Data['log'][] = $CR;
  33. };
  34. echo json_encode( $Data );
  35. exit();
  36. };
  37. };
  38. header('location: /');
  39. ?>