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.
57 lines
2.6 KiB
57 lines
2.6 KiB
<?php
|
|
require_once('../ajax_asm.php');
|
|
if( $CUser->Data['id'] > 1 ){
|
|
$EID = intval( $_POST['EVENT'] );
|
|
$QS = "SELECT * FROM events_cloud WHERE id = {$EID}";
|
|
$Result = $DATABASE->Query( $QS, false );
|
|
if( count( $Result ) ){
|
|
$Props = $Result[0];
|
|
$QS="SELECT * FROM nodes WHERE id={$Props['node_id']}";
|
|
$RR = $DATABASE->Query( $QS );
|
|
$CC = $RR[0];
|
|
$Type = intval( $Props['type'] );
|
|
$Data = file_get_contents( 'props/event_prop.js' );
|
|
$Data = str_replace('%%%NODEID%%%', $Props['node_id'], $Data );
|
|
$Data = str_replace('%%%TYPE%%%', $CC['type'], $Data );
|
|
$Data = str_replace('%%%NAME%%%', $CC['name'], $Data );
|
|
$Data = str_replace('%%%AZIMUTH%%%', sprintf( "%0.2f", $Props['azimuth']), $Data );
|
|
$Data = str_replace('%%%ELEVETION%%%', sprintf( "%0.2f", $Props['elevation']), $Data );
|
|
$Data = str_replace('%%%RANGE%%%', sprintf( "%0.2f", $Props['range']), $Data );
|
|
$Data = str_replace('%%%LON%%%', sprintf( "%0.8f", $Props['lon']), $Data );
|
|
$Data = str_replace('%%%LAT%%%', sprintf( "%0.8f", $Props['lat']), $Data );
|
|
$Data = str_replace('%%%ALT%%%', sprintf( "%0.1f", $Props['alt']), $Data );
|
|
$QS="SELECT * FROM events_video_records WHERE evt_id={$EID}";
|
|
$VDD = $DATABASE->Query( $QS );
|
|
if( count( $VDD ) ){
|
|
$O = array();
|
|
$VTPL = file_get_contents( 'props/event_video.js' );
|
|
foreach( $VDD as $VD ){
|
|
//$QS="SELECT * FROM video_records WHERE id={$VD['video_id']}";
|
|
//$RRR = $DATABASE->Query( $QS );
|
|
//$P = '/lib/controller/data/videos/'.substr( $RRR[0]['md5'], 0, 2 ).'/'.substr( $RRR[0]['md5'], 2, 2 ).'/'.$RRR[0]['md5'].'.m3u8';
|
|
$P = "/lib/controller/getM3U8.php?VID={$VD['video_id']}";
|
|
$TT = $VTPL;
|
|
//$TT = str_replace('%%%HLSID%%%',$RRR[0]['md5'],$TT);
|
|
$TT = str_replace('%%%HLSID%%%','HLS_' . $VD['video_id'],$TT);
|
|
$TT = str_replace('%%%HLSSRC%%%',$P,$TT);
|
|
$OFFSET = 0;//intval($VD['offset']);
|
|
if( $OFFSET > 0 ) {
|
|
$EVTEND = $OFSET+5;
|
|
$TT = str_replace('%%%HLSOFFSET%%%',"t.plr.offset({ start: {$OFFSET}, end: {$EVTEND}, restart_beginning: true });",$TT);
|
|
} else {
|
|
$TT = str_replace('%%%HLSOFFSET%%%',"t.plr.offset({ start: 0, end: 5, restart_beginning: true });",$TT);
|
|
};
|
|
$O[]=$TT;
|
|
};
|
|
$Data = str_replace('%%%VIDEOSECTION%%%', implode( ',', $O ), $Data );
|
|
} else {
|
|
$Data = str_replace('%%%VIDEOSECTION%%%', '{ xtype: \'panel\', html: \' \' }', $Data );
|
|
};
|
|
echo $Data;
|
|
} else {
|
|
echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
|
|
};
|
|
} else {
|
|
header('location: /');
|
|
};
|
|
?>
|