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.

28 lines
992 B

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. $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`={$EID}";
  10. $ZIZI = new SQLite_DB( $SYSPath . '/lib/controller/data/reports/'.$DS.'/report.db');
  11. $LREC = $ZIZI->Query( $QS );
  12. if( count( $LREC ) ){
  13. $Pack = array();
  14. $Pack['pictures'] = array();
  15. foreach( $LREC as $Data ){
  16. $CP = array();
  17. $CP['file'] = $DS.'/'. $Data['md5'].'.'.$Data['ext'];
  18. $CP['media_stream_id'] = $Data['media_stream_id'];
  19. $Pack['pictures'][] = $CP;
  20. };
  21. echo json_encode( $Pack );
  22. exit();
  23. };
  24. echo "[]";
  25. exit();
  26. };
  27. };
  28. header('location: /');
  29. ?>