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.1 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
3 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)
  10. $SLOT = reportSlotOf( $EID );
  11. $REID = reportRawId( $EID );
  12. $QS = "SELECT `pictures`.`media_stream_id`, `pictures`.`md5`, `pictures`.`ext` FROM `events_2_pictures` LEFT JOIN `pictures` ON( `pictures`.`id` = `events_2_pictures`.`picture_id` ) WHERE `events_2_pictures`.`evt_id`={$REID}";
  13. $ZIZI = reportOpenSlot( $DS, $SLOT );
  14. $LREC = $ZIZI ? $ZIZI->Query( $QS ) : array();
  15. if( count( $LREC ) ){
  16. $Pack = array();
  17. $Pack['pictures'] = array();
  18. foreach( $LREC as $Data ){
  19. $CP = array();
  20. $CP['file'] = $DS.'/'. $Data['md5'].'.'.$Data['ext'];
  21. $CP['media_stream_id'] = $Data['media_stream_id'];
  22. $Pack['pictures'][] = $CP;
  23. };
  24. echo json_encode( $Pack );
  25. exit();
  26. };
  27. echo "[]";
  28. exit();
  29. };
  30. };
  31. header('location: /');
  32. ?>