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.3 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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. if( $MD['status'] == 'E' ){
  51. $URL = '/style/assets/no-signal_h.png';
  52. $LVID = str_ireplace( '%%MID%%', $LMID, $VIDEOJS_CTX );
  53. $LVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $LVID );
  54. $LTitle = $MD['name'];
  55. $LVID = str_ireplace( '%%%SELURL%%%', $URL, $LVID );
  56. $LVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $LVID );
  57. } else {
  58. $LVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX );
  59. $LVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $LVID );
  60. };
  61. } else {
  62. $LVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX );
  63. $LVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $LVID );
  64. };
  65. if( $RMID ){
  66. $QS = "SELECT * FROM `metro_modules` WHERE `id`={$RMID}";
  67. $DD = $DATABASE->Query( $QS, false );
  68. $MD = $DD[0];
  69. if( $MD['status'] == 'E' ){
  70. $URL = '/style/assets/no-signal_h.png';
  71. $RVID = str_ireplace( '%%MID%%', $RMID, $VIDEOJS_CTX );
  72. $RVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $RVID );
  73. $RTitle = $MD['name'];
  74. $RVID = str_ireplace( '%%%SELURL%%%', $URL, $RVID );
  75. $RVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $RVID );
  76. } else {
  77. $RVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX );
  78. $RVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $RVID );
  79. };
  80. } else {
  81. $RVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX );
  82. $RVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $RVID );
  83. };
  84. $PLO = getPlatformLineInfo( $CPID );
  85. if( count( $PLO ) ){
  86. $LINES='<table><tr>';
  87. 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>";
  88. $LINES.='</tr></table>';
  89. } else {
  90. $LINES=$Labels->GetLabel('_NOBI_LINE_');
  91. };
  92. $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>';
  93. //$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>'}";
  94. $PLAT_PARTS[] = createTopLabel(getStationName( $PLO[0]['station_id'] ), getPlatformName( $CPID ), $LINES, $CTR['short'] );
  95. //$PLAT_PARTS[] = "{html:'Track Nfo'}";//str_ireplace( '%%%MODULE%MAP%%%', $ITEM_X, $ITEM );
  96. //$PLAT_PARTS[] = str_ireplace( '%%MID%%', $MID , $VIDEOJS_CTX );
  97. //$PLAT_PARTS[] = str_ireplace( '%%MID%%', '' , $VIDEOJS_CTX );
  98. $MSVG = createTrackBackground( $CPL['layout'], $CTR['side'], $LTitle, $RTitle );
  99. if( $CS['final'] == 'Y' ){
  100. $QS = "SELECT * FROM `session_statuses` WHERE `min_access`<={$ACCESS}";
  101. } else {
  102. $QS = "SELECT * FROM `session_statuses` WHERE `min_access`<={$ACCESS} AND `special`=''";
  103. };
  104. $SR = $DATABASE->Query( $QS );
  105. $TDS = '';
  106. $PPP = 100.0 / count($SR);
  107. foreach( $SR as $S ){
  108. $FUNC = ($S['special']!='')?$S['special']:'setSessionStatus';
  109. if( $CS['status'] >= $S['lvl'] ){
  110. $TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item passive_gray\">{$S['label']}</span></td>";
  111. } else {
  112. $TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item {$S['class']}\" onclick=\"{$FUNC}({$SESSION_ID},{$S['lvl']}, true );\" >{$S['label']}</span></td>";
  113. };
  114. };
  115. $PLAT_PARTS[] =<<<DATA_BOUNDARY
  116. {
  117. xtype: 'panel',
  118. layout: 'table',
  119. frame: true,
  120. width: '100%',
  121. defaults: {
  122. bodyStyle:'padding:0px'
  123. },
  124. layoutConfig: {
  125. columns: 2
  126. },
  127. items:[{
  128. html: '{$MSVG}',
  129. width: '100%',
  130. colspan: 2
  131. },{$LVID},{$RVID}]
  132. },{
  133. xtype: 'panel',
  134. layout: 'hbox',
  135. frame: true,
  136. items:[{
  137. xtype: 'spacer',
  138. width: 5
  139. },{
  140. xtype: 'button',
  141. id: 'hpl_pl_btn',
  142. text: 'Play',
  143. iconCls: 'plr_op_play',
  144. width: 75,
  145. scale: 'small',
  146. handler: function(){
  147. mSesPlay.play();
  148. }
  149. },{
  150. xtype: 'spacer',
  151. width: 5
  152. },{
  153. xtype: 'button',
  154. text: 'Loop',
  155. iconCls: 'plr_op_loop',
  156. enableToggle: true,
  157. width: 60,
  158. pressed: true,
  159. scale: 'small',
  160. handler: function(){
  161. mSesPlay.toggleLoop();
  162. }
  163. },{
  164. xtype: 'spacer',
  165. width: 10
  166. },{
  167. id: 'hpl_slider',
  168. xtype: 'slider',
  169. //autoWidth: true,
  170. width: 400,
  171. //cls: 'hpl_evt_slider_bg',
  172. minValue: 0,
  173. maxValue: 30000,
  174. listeners:{
  175. change: function( sl, nv, tt ){
  176. mSesPlay.setPosition( nv );
  177. }
  178. }
  179. },{
  180. xtype: 'spacer',
  181. width: 5
  182. },{
  183. html: '<div id="hpl_time_mon"></div>'
  184. }]
  185. },{
  186. id: 'sets_ui',
  187. frame: true,
  188. html: '<table width="100%" border=0><tr>{$TDS}</tr></table>'
  189. }
  190. DATA_BOUNDARY;
  191. //$TOP = str_ireplace('%%%PANELS%%%', implode( ",{ xtype:'spacer', height: 10 },",$PLAT_PARTS ), $MAIN_TPL );
  192. $TOP = str_ireplace('%%%PANELS%%%', implode( ",",$PLAT_PARTS ), $MAIN_TPL );
  193. $Data['pid'] = $PID;
  194. $Data['mid'] = $MID;
  195. $Data['content']= $TOP;
  196. };
  197. $Data['messages'] = ob_get_clean();
  198. echo json_encode( $Data );
  199. } else {
  200. header('location: /');
  201. };
  202. ?>