|
|
<?php require_once('../ajax_asm.php'); require_once('../php/argus/server.php'); require_once('../php/argus/templates.php'); ob_start(); $UID = intval( $CUser->Data['id'] ); $ACCESS = intval( $CUser->Data['access'] ); if( isset($_POST['SESSION']) ) $SESSION_ID = intval( $_POST['SESSION'] ); else $SESSION_ID = 0; if( $UID > 1 && $SESSION_ID ){ $QS = "SELECT * FROM `sessions` WHERE `id`={$SESSION_ID}"; $Result = $DATABASE->Query( $QS, false ); if( count( $Result ) ){ $CS = $Result[0]; $CTID = intval( $CS['track_id'] ); $QS = "SELECT * FROM `metro_tracks` WHERE `id`={$CTID}"; $Result = $DATABASE->Query( $QS, false ); $CTR = $Result[0]; $CPID = intval( $CTR['platform_id'] ); $QS = "SELECT * FROM `metro_platforms` WHERE `id`={$CPID}"; $Result = $DATABASE->Query( $QS, false ); $CPL = $Result[0]; $STID = $CPL['station_id']; $QS = "SELECT * FROM `metro_stations` WHERE `id`={$STID}"; $Result = $DATABASE->Query( $QS, false ); $CST = $Result[0]; $Data['status']='ok'; $CTITLE = $CPL['name'] . ' <span class="level_label_title">'.$CPL['level'].'</span>'; if( $CTR['name']!=''){ $TNAME = $CTR['name'] . ':' . $CTR['short'] ; } else { $TNAME = $CTR['short'] ; }; $MAIN_TPL = str_ireplace( '%%STATION%NAME%%', $CST['name'], $TRACK_VIEW_CTX ); $MAIN_TPL = str_ireplace( '%%STATION%ID%%', $STID, $MAIN_TPL ); $MAIN_TPL = str_ireplace( '%%PLATFORM%NAME%%', $CPL['name'], $MAIN_TPL ); $MAIN_TPL = str_ireplace( '%%PLATFORM%ID%%', $CPID, $MAIN_TPL ); $MAIN_TPL = str_ireplace( '%%PLATFORM%TITLE%%', $CTITLE, $MAIN_TPL ); $MAIN_TPL = str_ireplace( '%%TRACK%NAME%%', $TNAME, $MAIN_TPL ); if( $CTR['side'] == 'U' ){ $LMID = intval( $CTR['far_module_id'] ); $RMID = intval( $CTR['near_module_id'] ); } else { $RMID = intval( $CTR['far_module_id'] ); $LMID = intval( $CTR['near_module_id'] ); }; if( $LMID ){ $QS = "SELECT * FROM `metro_modules` WHERE `id`={$LMID}"; $DD = $DATABASE->Query( $QS, false ); $MD = $DD[0]; $URL = '/style/assets/no-signal_h.png'; $LVID = str_ireplace( '%%MID%%', $LMID, $VIDEOJS_CTX ); $LVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $LVID ); $LTitle = $MD['name']; $LVID = str_ireplace( '%%%SELURL%%%', $URL, $LVID ); $LVID = str_ireplace( '%%%HBTN%%%',' ', $LVID ); } else { $LVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX ); $LVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $LVID ); }; if( $RMID ){ $QS = "SELECT * FROM `metro_modules` WHERE `id`={$RMID}"; $DD = $DATABASE->Query( $QS, false ); $MD = $DD[0]; $URL = '/style/assets/no-signal_h.png'; $RVID = str_ireplace( '%%MID%%', $RMID, $VIDEOJS_CTX ); $RVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $RVID ); $RTitle = $MD['name']; $RVID = str_ireplace( '%%%SELURL%%%', $URL, $RVID ); $RVID = str_ireplace( '%%%HBTN%%%',' ', $RVID ); } else { $RVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX ); $RVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $RVID ); }; $PLO = getPlatformLineInfo( $CPID ); if( count( $PLO ) ){ $LINES='<table><tr>'; 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>"; $LINES.='</tr></table>'; } else { $LINES=$Labels->GetLabel('_NOBI_LINE_'); }; $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> '.getPlatformName( $CPID ) . '</td><td>'.$LINES.'</td></tr></table>'; //$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>'}";
$PLAT_PARTS[] = createTopLabel(getStationName( $PLO[0]['station_id'] ), getPlatformName( $CPID ), $LINES, $CTR['short'] ); //$PLAT_PARTS[] = "{html:'Track Nfo'}";//str_ireplace( '%%%MODULE%MAP%%%', $ITEM_X, $ITEM );
//$PLAT_PARTS[] = str_ireplace( '%%MID%%', $MID , $VIDEOJS_CTX );
//$PLAT_PARTS[] = str_ireplace( '%%MID%%', '' , $VIDEOJS_CTX );
$MSVG = createTrackBackground( $CPL['layout'], $CTR['side'], $LTitle, $RTitle ); if( $CS['final'] == 'Y' ){ $QS = "SELECT * FROM `session_statuses` WHERE `min_access`<={$ACCESS}"; } else { $QS = "SELECT * FROM `session_statuses` WHERE `min_access`<={$ACCESS} AND `special`=''"; }; $SR = $DATABASE->Query( $QS ); $TDS = ''; $PPP = 100.0 / count($SR); foreach( $SR as $S ){ $FUNC = ($S['special']!='')?$S['special']:'setSessionStatus'; if( $CS['status'] >= $S['lvl'] ){ $TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item passive_gray\">{$S['label']}</span></td>"; } else { $TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item {$S['class']}\" onclick=\"{$FUNC}({$SESSION_ID},{$S['lvl']});\" >{$S['label']}</span></td>"; }; }; $PLAT_PARTS[] =<<<DATA_BOUNDARY{ xtype: 'panel', layout: 'table', frame: true, width: '100%', defaults: { bodyStyle:'padding:0px' }, layoutConfig: { columns: 2 }, items:[{ html: '{$MSVG}', width: '100%', colspan: 2 },{$LVID},{$RVID}]},{ xtype: 'panel', layout: 'hbox', frame: true, items:[{ xtype: 'spacer', width: 5 },{ xtype: 'button', id: 'hpl_pl_btn', text: 'Play', iconCls: 'plr_op_play', width: 75, scale: 'small', handler: function(){ mSesPlay.play(); } },{ xtype: 'spacer', width: 5 },{ xtype: 'button', text: 'Loop', iconCls: 'plr_op_loop', enableToggle: true, width: 60, pressed: true, scale: 'small', handler: function(){ mSesPlay.toggleLoop(); } },{ xtype: 'spacer', width: 10 },{ id: 'hpl_slider', xtype: 'slider', //autoWidth: true,
width: 400, //cls: 'hpl_evt_slider_bg',
minValue: 0, maxValue: 30000, listeners:{ change: function( sl, nv, tt ){ mSesPlay.setPosition( nv ); } } },{ xtype: 'spacer', width: 5 },{ html: '<div id="hpl_time_mon"></div>' }]},{ id: 'sets_ui', frame: true, html: '<table width="100%" border=0><tr>{$TDS}</tr></table>'}DATA_BOUNDARY; //$TOP = str_ireplace('%%%PANELS%%%', implode( ",{ xtype:'spacer', height: 10 },",$PLAT_PARTS ), $MAIN_TPL );
$TOP = str_ireplace('%%%PANELS%%%', implode( ",",$PLAT_PARTS ), $MAIN_TPL ); $Data['pid'] = $PID; $Data['mid'] = $MID; $Data['content']= $TOP; }; $Data['messages'] = ob_get_clean(); echo json_encode( $Data ); } else { header('location: /'); }; ?>
|