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.

56 lines
2.6 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $EID = intval( $_POST['EVENT'] );
  5. $QS = "SELECT * FROM events_cloud WHERE id = {$EID}";
  6. $Result = $DATABASE->Query( $QS, false );
  7. if( count( $Result ) ){
  8. $Props = $Result[0];
  9. $QS="SELECT * FROM nodes WHERE id={$Props['node_id']}";
  10. $RR = $DATABASE->Query( $QS );
  11. $CC = $RR[0];
  12. $Type = intval( $Props['type'] );
  13. $Data = file_get_contents( 'props/event_prop.js' );
  14. $Data = str_replace('%%%NODEID%%%', $Props['node_id'], $Data );
  15. $Data = str_replace('%%%TYPE%%%', $CC['type'], $Data );
  16. $Data = str_replace('%%%NAME%%%', $CC['name'], $Data );
  17. $Data = str_replace('%%%AZIMUTH%%%', sprintf( "%0.2f", $Props['azimuth']), $Data );
  18. $Data = str_replace('%%%ELEVETION%%%', sprintf( "%0.2f", $Props['elevation']), $Data );
  19. $Data = str_replace('%%%RANGE%%%', sprintf( "%0.2f", $Props['range']), $Data );
  20. $Data = str_replace('%%%LON%%%', sprintf( "%0.8f", $Props['lon']), $Data );
  21. $Data = str_replace('%%%LAT%%%', sprintf( "%0.8f", $Props['lat']), $Data );
  22. $Data = str_replace('%%%ALT%%%', sprintf( "%0.1f", $Props['alt']), $Data );
  23. $QS="SELECT * FROM events_video_records WHERE evt_id={$EID}";
  24. $VDD = $DATABASE->Query( $QS );
  25. if( count( $VDD ) ){
  26. $O = array();
  27. $VTPL = file_get_contents( 'props/event_video.js' );
  28. foreach( $VDD as $VD ){
  29. //$QS="SELECT * FROM video_records WHERE id={$VD['video_id']}";
  30. //$RRR = $DATABASE->Query( $QS );
  31. //$P = '/lib/controller/data/videos/'.substr( $RRR[0]['md5'], 0, 2 ).'/'.substr( $RRR[0]['md5'], 2, 2 ).'/'.$RRR[0]['md5'].'.m3u8';
  32. $P = "/lib/controller/getM3U8.php?VID={$VD['video_id']}";
  33. $TT = $VTPL;
  34. //$TT = str_replace('%%%HLSID%%%',$RRR[0]['md5'],$TT);
  35. $TT = str_replace('%%%HLSID%%%','HLS_' . $VD['video_id'],$TT);
  36. $TT = str_replace('%%%HLSSRC%%%',$P,$TT);
  37. $OFFSET = 0;//intval($VD['offset']);
  38. if( $OFFSET > 0 ) {
  39. $EVTEND = $OFSET+5;
  40. $TT = str_replace('%%%HLSOFFSET%%%',"t.plr.offset({ start: {$OFFSET}, end: {$EVTEND}, restart_beginning: true });",$TT);
  41. } else {
  42. $TT = str_replace('%%%HLSOFFSET%%%',"t.plr.offset({ start: 0, end: 5, restart_beginning: true });",$TT);
  43. };
  44. $O[]=$TT;
  45. };
  46. $Data = str_replace('%%%VIDEOSECTION%%%', implode( ',', $O ), $Data );
  47. } else {
  48. $Data = str_replace('%%%VIDEOSECTION%%%', '{ xtype: \'panel\', html: \'&nbsp;\' }', $Data );
  49. };
  50. echo $Data;
  51. } else {
  52. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  53. };
  54. } else {
  55. header('location: /');
  56. };
  57. ?>