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.

198 lines
6.9 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_VIEW_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%\" class=\"setEd_infoPanel\"><tr><td valign=\"middle\" align=\"left\" style=\"padding-left:30px;font-size: 22px; font-weight: bold;\">{$NAME}</td><td width=\"100%\" class=\"setEd_infoPanel track_short_big\">{$CTR['short']}</td></tr></table>'}";
  84. $PLAT_PARTS[] = createTopLabel(getStationName( $PLO[0]['station_id'] ), getPlatformName( $CPID ), $LINES, $CTR['short'] );
  85. //$PLAT_PARTS[] = "{html:'Track Nfo'}";//str_ireplace( '%%%MODULE%MAP%%%', $ITEM_X, $ITEM );
  86. //$PLAT_PARTS[] = str_ireplace( '%%MID%%', $MID , $VIDEOJS_CTX );
  87. //$PLAT_PARTS[] = str_ireplace( '%%MID%%', '' , $VIDEOJS_CTX );
  88. $MSVG = createTrackBackground( $CPL['layout'], $CTR['side'], $LTitle, $RTitle );
  89. if( $CS['final'] == 'Y' ){
  90. $QS = "SELECT * FROM `session_statuses` WHERE `min_access`<={$ACCESS}";
  91. } else {
  92. $QS = "SELECT * FROM `session_statuses` WHERE `min_access`<={$ACCESS} AND `special`=''";
  93. };
  94. $SR = $DATABASE->Query( $QS );
  95. $TDS = '';
  96. $PPP = 100.0 / count($SR);
  97. foreach( $SR as $S ){
  98. $FUNC = ($S['special']!='')?$S['special']:'setSessionStatus';
  99. if( $CS['status'] >= $S['lvl'] ){
  100. $TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item passive_gray\">{$S['label']}</span></td>";
  101. } else {
  102. $TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item {$S['class']}\" onclick=\"{$FUNC}({$SESSION_ID},{$S['lvl']});\" >{$S['label']}</span></td>";
  103. };
  104. };
  105. $PLAT_PARTS[] =<<<DATA_BOUNDARY
  106. {
  107. xtype: 'panel',
  108. layout: 'table',
  109. frame: true,
  110. width: '100%',
  111. defaults: {
  112. bodyStyle:'padding:0px'
  113. },
  114. layoutConfig: {
  115. columns: 2
  116. },
  117. items:[{
  118. html: '{$MSVG}',
  119. width: '100%',
  120. colspan: 2
  121. },{$LVID},{$RVID}]
  122. },{
  123. xtype: 'panel',
  124. layout: 'hbox',
  125. frame: true,
  126. items:[{
  127. xtype: 'spacer',
  128. width: 5
  129. },{
  130. xtype: 'button',
  131. id: 'hpl_pl_btn',
  132. text: 'Play',
  133. iconCls: 'plr_op_play',
  134. width: 75,
  135. scale: 'small',
  136. handler: function(){
  137. mSesPlay.play();
  138. }
  139. },{
  140. xtype: 'spacer',
  141. width: 5
  142. },{
  143. xtype: 'button',
  144. text: 'Loop',
  145. iconCls: 'plr_op_loop',
  146. enableToggle: true,
  147. width: 60,
  148. pressed: true,
  149. scale: 'small',
  150. handler: function(){
  151. mSesPlay.toggleLoop();
  152. }
  153. },{
  154. xtype: 'spacer',
  155. width: 10
  156. },{
  157. id: 'hpl_slider',
  158. xtype: 'slider',
  159. //autoWidth: true,
  160. width: 400,
  161. //cls: 'hpl_evt_slider_bg',
  162. minValue: 0,
  163. maxValue: 30000,
  164. listeners:{
  165. change: function( sl, nv, tt ){
  166. mSesPlay.setPosition( nv );
  167. }
  168. }
  169. },{
  170. xtype: 'spacer',
  171. width: 5
  172. },{
  173. html: '<div id="hpl_time_mon"></div>'
  174. }]
  175. },{
  176. id: 'sets_ui',
  177. frame: true,
  178. html: '<table width="100%" border=0><tr>{$TDS}</tr></table>'
  179. }
  180. DATA_BOUNDARY;
  181. //$TOP = str_ireplace('%%%PANELS%%%', implode( ",{ xtype:'spacer', height: 10 },",$PLAT_PARTS ), $MAIN_TPL );
  182. $TOP = str_ireplace('%%%PANELS%%%', implode( ",",$PLAT_PARTS ), $MAIN_TPL );
  183. $Data['pid'] = $PID;
  184. $Data['mid'] = $MID;
  185. $Data['content']= $TOP;
  186. };
  187. $Data['messages'] = ob_get_clean();
  188. echo json_encode( $Data );
  189. } else {
  190. header('location: /');
  191. };
  192. ?>