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.

70 lines
3.1 KiB

​
​
​
3 years ago
​
​
​
4 years ago
​
​
​
3 years ago
3 years ago
​
3 years ago
​
4 years ago
​
​
​
4 years ago
3 years ago
4 years ago
10 months ago
4 years ago
​
​
​
​
3 years ago
​
​
​
​
​
​
​
3 years ago
3 years ago
​
3 years ago
3 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( 1 || $BID ){
  8. $QS = "SELECT * FROM `system_props` LIMIT 1";
  9. $SPD = $DATABASE->Query( $QS );
  10. $SP = $SPD[0];
  11. $QS = "SELECT * FROM nodes";
  12. $result = $DATABASE->Query( $QS, false );
  13. $NodeNames = array();
  14. foreach( $result as $R ) $NodeNames[$R['id']] = $R['name'];
  15. $DS = date("Y/m/d", $DTS );
  16. //$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";
  17. $QS = "SELECT `events`.*, `events_2_videos`.`video_id`, `events_2_pictures`.`picture_id` FROM `events` LEFT JOIN `events_2_videos` ON( `events`.`id` = `events_2_videos`.`evt_id` ) LEFT JOIN `events_2_pictures` ON( `events`.`id` = `events_2_pictures`.`evt_id` ) WHERE `events`.`id`>={$BID} AND `events`.`id`<={$EID} ORDER BY `events`.`ts` ASC, `events`.`ts_ms` ASC";
  18. $ZIZI = new SQLite_DB( '/srv/www/web/lib/controller/data/reports/'.$DS.'/report.db');
  19. //$LREC = array_reverse( $ZIZI->Query( $QS ) );
  20. $LREC = $ZIZI->Query( $QS );
  21. $Data['log'] = array();
  22. foreach( $LREC as $REC ){
  23. $CR['id'] = intval( $REC['id'] );
  24. $CR['node_id'] = intval( $REC['node_id'] );
  25. $CR['node_name'] = $NodeNames[$CR['node_id']];
  26. $CR['rts'] = $DTS;
  27. $CR['ts'] = intval( $REC['ts'] );
  28. $CR['ms'] = sprintf( "%03d",intval( $REC['ts_ms'] ));
  29. $CR['dts'] = date( "Y-m-d H:i:s.{$CR['ms']}", $CR['ts'] );
  30. $CR['type'] = intval( $REC['evt_type'] );
  31. $CR['bid'] = intval( $REC['lrf_id'] );
  32. $CR['range'] = sprintf( "%0.2f", floatval( $REC['range'] ));
  33. $CR['az'] = sprintf( "%0.2f", floatval( $REC['azimuth'] ));
  34. $CR['el'] = sprintf( "%0.2f", floatval( $REC['elevation'] ));
  35. $CR['r'] = intval( $REC['range_digital'] );
  36. $CR['width'] = intval( $REC['area'] );
  37. if( intval( $REC['video_id'] ) ){
  38. $CR['video'] = 2;
  39. } elseif( intval( $REC['picture_id'] ) ){
  40. $CR['video'] = 1;
  41. } else {
  42. $CR['video'] = 0;
  43. };
  44. //$CR['video_id'] = intval( $REC['video_id'] );
  45. if( $REC['lat'] != 0 && $REC['lon'] != 0 ){
  46. $CR['geo'] = true;
  47. if( $SP['local_binding'] != 0 ){
  48. //$CHUCHA = ( M_PI / 180 ) * (floatval( $REC['azimuth'] )-40.9);
  49. //$RUR = sqrt( $REC['lon']* $REC['lon'] + $REC['lat']*$REC['lat']);
  50. $CR['lon'] = floatval( $SP['anchor_lon'] ) + floatval( $REC['lon'] );
  51. //$CR['lon'] = floatval( $SP['anchor_lon'] ) + cos( $CHUCHA ) * $RUR;
  52. $CR['lat'] = floatval( $SP['anchor_lat'] ) + floatval( $REC['lat'] );
  53. //$CR['lat'] = floatval( $SP['anchor_lat'] ) + sin( $CHUCHA ) * $RUR;
  54. } else {
  55. $CR['lon'] = floatval( $REC['lon'] );
  56. $CR['lat'] = floatval( $REC['lat'] );
  57. };
  58. } else {
  59. $CR['geo'] = false;
  60. if( isset( $CR['lon'] ) ) unset( $CR['lon'] );
  61. if( isset( $CR['lat'] ) ) unset( $CR['lat'] );
  62. };
  63. $Data['log'][] = $CR;
  64. };
  65. echo json_encode( $Data );
  66. exit();
  67. };
  68. };
  69. header('location: /');
  70. ?>