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.

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