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.

208 lines
7.0 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. require_once('../php/argus/server.php');
  4. require_once('../php/argus/templates.php');
  5. ob_start();
  6. $UID = intval( $CUser->Data['id'] );
  7. $ACCESS = intval( $CUser->Data['access'] );
  8. if( isset($_POST['SESSION']) ) $SESSION_ID = intval( $_POST['SESSION'] ); else $SESSION_ID = 0;
  9. if( $UID > 1 && $SESSION_ID ){
  10. $QS = "SELECT * FROM `sessions` WHERE `id`={$SESSION_ID}";
  11. $Result = $DATABASE->Query( $QS, false );
  12. if( count( $Result ) ){
  13. $CS = $Result[0];
  14. $CTID = intval( $CS['track_id'] );
  15. $QS = "SELECT * FROM `metro_tracks` WHERE `id`={$CTID}";
  16. $Result = $DATABASE->Query( $QS, false );
  17. $CTR = $Result[0];
  18. $CPID = intval( $CTR['platform_id'] );
  19. $QS = "SELECT * FROM `metro_platforms` WHERE `id`={$CPID}";
  20. $Result = $DATABASE->Query( $QS, false );
  21. $CPL = $Result[0];
  22. $STID = $CPL['station_id'];
  23. $QS = "SELECT * FROM `metro_stations` WHERE `id`={$STID}";
  24. $Result = $DATABASE->Query( $QS, false );
  25. $CST = $Result[0];
  26. $Data['status']='ok';
  27. $CTITLE = $CPL['name'] . ' <span class="level_label_title">'.$CPL['level'].'</span>';
  28. if( $CTR['name']!=''){
  29. $TNAME = $CTR['name'] . ':' . $CTR['short'] ;
  30. } else {
  31. $TNAME = $CTR['short'] ;
  32. };
  33. $MAIN_TPL = str_ireplace( '%%STATION%NAME%%', $CST['name'], $TRACK_HISTORY_CTX );
  34. $MAIN_TPL = str_ireplace( '%%STATION%ID%%', $STID, $MAIN_TPL );
  35. $MAIN_TPL = str_ireplace( '%%PLATFORM%NAME%%', $CPL['name'], $MAIN_TPL );
  36. $MAIN_TPL = str_ireplace( '%%PLATFORM%ID%%', $CPID, $MAIN_TPL );
  37. $MAIN_TPL = str_ireplace( '%%PLATFORM%TITLE%%', $CTITLE, $MAIN_TPL );
  38. $MAIN_TPL = str_ireplace( '%%TRACK%NAME%%', $TNAME, $MAIN_TPL );
  39. if( $CTR['side'] == 'U' ){
  40. $LMID = intval( $CTR['far_module_id'] );
  41. $RMID = intval( $CTR['near_module_id'] );
  42. } else {
  43. $RMID = intval( $CTR['far_module_id'] );
  44. $LMID = intval( $CTR['near_module_id'] );
  45. };
  46. if( $LMID ){
  47. $QS = "SELECT * FROM `metro_modules` WHERE `id`={$LMID}";
  48. $DD = $DATABASE->Query( $QS, false );
  49. $MD = $DD[0];
  50. $URL = '/style/assets/no-signal_h.png';
  51. $LVID = str_ireplace( '%%MID%%', $LMID, $VIDEOJS_CTX );
  52. //$LVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $LVID );
  53. $LTitle = $MD['name'];
  54. $LVID = str_ireplace( '%%%SELURL%%%', $URL, $LVID );
  55. $LVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $LVID );
  56. } else {
  57. $LVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX );
  58. $LVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $LVID );
  59. };
  60. if( $RMID ){
  61. $QS = "SELECT * FROM `metro_modules` WHERE `id`={$RMID}";
  62. $DD = $DATABASE->Query( $QS, false );
  63. $MD = $DD[0];
  64. $URL = '/style/assets/no-signal_h.png';
  65. $RVID = str_ireplace( '%%MID%%', $RMID, $VIDEOJS_CTX );
  66. //$RVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $RVID );
  67. $RTitle = $MD['name'];
  68. $RVID = str_ireplace( '%%%SELURL%%%', $URL, $RVID );
  69. $RVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $RVID );
  70. } else {
  71. $RVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX );
  72. $RVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $RVID );
  73. };
  74. $PLO = getPlatformLineInfo( $CPID );
  75. if( count( $PLO ) ){
  76. $LINES='<table><tr>';
  77. foreach( $PLO as $Z ) $LINES.="<td><div style=\"border-radius:16px;width:32px;height:32px;background-color:#{$Z['color']};color:#fff;font-size:16px;padding-left:10px;padding-top:6px;\">{$Z['short']}</div></td>";
  78. $LINES.='</tr></table>';
  79. } else {
  80. $LINES=$Labels->GetLabel('_NOBI_LINE_');
  81. };
  82. $NAME = '<table border=0><tr><td colspan=2>'.getStationName( $PLO[0]['station_id'] ).'</td></tr><tr><td><span class="level_label_title_2">B2</span>&nbsp;'.getPlatformName( $CPID ) . '</td><td>'.$LINES.'</td></tr></table>';
  83. $PLAT_PARTS[] = "{ xtype:'panel', border: false, frame: false, html: '<table border=0 width=\"100%\" style=\"display: block; padding: 5px; color: black; background-color: silver;\"><tr><td width=\"120px\" class=\"setEd_infoPanel track_short_big\">{$CTR['short']}</td><td valign=\"middle\" align=\"left\" style=\"padding-left:30px;font-size: 22px; font-weight: bold;\">{$NAME}</td></tr></table>'}";
  84. //$PLAT_PARTS[] = "{html:'Track Nfo'}";//str_ireplace( '%%%MODULE%MAP%%%', $ITEM_X, $ITEM );
  85. //$PLAT_PARTS[] = str_ireplace( '%%MID%%', $MID , $VIDEOJS_CTX );
  86. //$PLAT_PARTS[] = str_ireplace( '%%MID%%', '' , $VIDEOJS_CTX );
  87. $MSVG = createTrackBackground( $CPL['layout'], $CTR['side'], $LTitle, $RTitle );
  88. $QS = "SELECT * FROM `session_statuses` WHERE `min_access`<={$ACCESS}";
  89. $SR = $DATABASE->Query( $QS );
  90. $TDS = '';
  91. $PPP = 100.0 / count($SR);
  92. foreach( $SR as $S ){
  93. $FUNC = ($S['special']!='')?$S['special']:'setSessionStatus';
  94. if( $CS['status'] >= $S['lvl'] ){
  95. $TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item passive_gray\">{$S['label']}</span></td>";
  96. } else {
  97. $TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item {$S['class']}\" onclick=\"{$FUNC}({$SESSION_ID},{$S['lvl']});\" >{$S['label']}</span></td>";
  98. };
  99. };
  100. $PLAT_PARTS[] =<<<DATA_BOUNDARY
  101. {
  102. xtype: 'panel',
  103. layout: 'table',
  104. frame: true,
  105. width: '100%',
  106. defaults: {
  107. bodyStyle:'padding:0px'
  108. },
  109. layoutConfig: {
  110. columns: 2
  111. },
  112. items:[{
  113. html: '{$MSVG}',
  114. width: '100%',
  115. colspan: 2
  116. },{$LVID},{$RVID}]
  117. },{
  118. xtype: 'panel',
  119. layout: 'hbox',
  120. frame: true,
  121. items:[{
  122. xtype: 'spacer',
  123. width: 5
  124. },{
  125. xtype: 'button',
  126. id: 'hpl_pl_btn',
  127. text: 'Play',
  128. iconCls: 'plr_op_play',
  129. width: 75,
  130. scale: 'small',
  131. handler: function(){
  132. mSesPlay.triggerPlay();
  133. }
  134. },{
  135. xtype: 'spacer',
  136. width: 5
  137. },{
  138. xtype: 'button',
  139. text: 'Loop',
  140. iconCls: 'plr_op_loop',
  141. enableToggle: true,
  142. width: 60,
  143. pressed: true,
  144. scale: 'small',
  145. handler: function(){
  146. mSesPlay.triggerLoop();
  147. }
  148. },{
  149. xtype: 'spacer',
  150. width: 10
  151. },{
  152. id: 'hpl_slider',
  153. xtype: 'slider',
  154. //autoWidth: true,
  155. width: 400,
  156. //cls: 'hpl_evt_slider_bg',
  157. minValue: 0,
  158. maxValue: 30000,
  159. listeners:{
  160. change: function( sl, nv, tt ){
  161. mSesPlay.setPosition( nv );
  162. }
  163. }
  164. },{
  165. xtype: 'spacer',
  166. width: 5
  167. },{
  168. width: 150,
  169. html: '<div id="hpl_time_mon">[timestamp]</div>'
  170. },{
  171. xtype: 'spacer',
  172. width: 5
  173. },{
  174. xtype: 'button',
  175. text: 'List All Videos',
  176. iconCls: 'plr_op_videos',
  177. enableToggle: false,
  178. width: 60,
  179. scale: 'small',
  180. handler: function(){
  181. showEventsVideos();
  182. }
  183. }]
  184. },{
  185. id: 'sets_ui',
  186. frame: true,
  187. html: '<table width="100%" border=0><tr>{$TDS}</tr></table>'
  188. }
  189. DATA_BOUNDARY;
  190. //$TOP = str_ireplace('%%%PANELS%%%', implode( ",{ xtype:'spacer', height: 10 },",$PLAT_PARTS ), $MAIN_TPL );
  191. $TOP = str_ireplace('%%%PANELS%%%', implode( ",",$PLAT_PARTS ), $MAIN_TPL );
  192. $Data['pid'] = $PID;
  193. $Data['mid'] = $MID;
  194. $Data['content']= $TOP;
  195. };
  196. $Data['messages'] = ob_get_clean();
  197. echo json_encode( $Data );
  198. } else {
  199. header('location: /');
  200. };
  201. ?>