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.

31 lines
1.2 KiB

4 years ago
​
​
3 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. $EID = intval( $_POST['ID'] );
  5. $DTS = intval( $_POST['TS'] );
  6. if( $EID ){
  7. $DS = date("Y/m/d", $DTS );
  8. //$QS = "SELECT * FROM `videos` WHERE `id` = {$VID}";
  9. // ID is a global event id (see report_files.php); video ids are returned as global ids of the same file
  10. $SLOT = reportSlotOf( $EID );
  11. $REID = reportRawId( $EID );
  12. $QS = "SELECT `videos`.`id`, `videos`.`fps`,`videos`.`uts` as `ts`, `videos`.`md5`, `videos`.`ext`, `videos`.`media_stream_id`, `events_2_videos`.`frame` FROM `events_2_videos` LEFT JOIN `videos` ON( `videos`.`id` = `events_2_videos`.`video_id` ) WHERE `events_2_videos`.`evt_id`={$REID}";
  13. $ZIZI = reportOpenSlot( $DS, $SLOT );
  14. $LREC = $ZIZI ? $ZIZI->Query( $QS ) : array();
  15. if( count( $LREC ) ){
  16. $Pack = array();
  17. $Pack['ts'] = $DTS;
  18. $Pack['videos'] = array();
  19. foreach( $LREC as $Data ){
  20. $Data['id'] = reportEncodeId( $SLOT, $Data['id'] );
  21. $Data['fname'] = date( "Y_m_d_H-i-s", intval( $Data['ts'] ) ); // download file name in host local time
  22. $Pack['videos'][] = $Data;
  23. };
  24. echo json_encode( $Pack );
  25. exit();
  26. };
  27. echo "[]";
  28. exit();
  29. };
  30. };
  31. header('location: /');
  32. ?>