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.
32 lines
1.2 KiB
32 lines
1.2 KiB
<?php
|
|
require_once('../ajax_asm.php');
|
|
if( $CUser->Data['id'] > 1 ){
|
|
$EID = intval( $_POST['ID'] );
|
|
$DTS = intval( $_POST['TS'] );
|
|
if( $EID ){
|
|
$DS = date("Y/m/d", $DTS );
|
|
//$QS = "SELECT * FROM `videos` WHERE `id` = {$VID}";
|
|
// ID is a global event id (see report_files.php); video ids are returned as global ids of the same file
|
|
$SLOT = reportSlotOf( $EID );
|
|
$REID = reportRawId( $EID );
|
|
$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}";
|
|
$ZIZI = reportOpenSlot( $DS, $SLOT );
|
|
$LREC = $ZIZI ? $ZIZI->Query( $QS ) : array();
|
|
if( count( $LREC ) ){
|
|
$Pack = array();
|
|
$Pack['ts'] = $DTS;
|
|
$Pack['videos'] = array();
|
|
foreach( $LREC as $Data ){
|
|
$Data['id'] = reportEncodeId( $SLOT, $Data['id'] );
|
|
$Data['fname'] = date( "Y_m_d_H-i-s", intval( $Data['ts'] ) ); // download file name in host local time
|
|
$Pack['videos'][] = $Data;
|
|
};
|
|
echo json_encode( $Pack );
|
|
exit();
|
|
};
|
|
echo "[]";
|
|
exit();
|
|
};
|
|
};
|
|
header('location: /');
|
|
?>
|