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.
160 lines
6.4 KiB
160 lines
6.4 KiB
<?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'] );
|
|
$QS = "SELECT `status`, `track_id` FROM `sessions` WHERE `id`={$SESSION_ID}";
|
|
$Result = $DATABASE->Query( $QS, false );
|
|
if( count( $Result ) ){
|
|
$CS = $Result[0];
|
|
$CTID = intval( $CS['track_id'] );
|
|
} else {
|
|
$CTID = 0;
|
|
};
|
|
} else {
|
|
$SESSION_ID = 0;
|
|
if( isset($_POST['TID']) ) $CTID = intval( $_POST['TID'] ); else $CTID = 0;
|
|
};
|
|
if( $UID > 1 && $CTID ){
|
|
$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';
|
|
$Data['track_id']=$CTID;
|
|
$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];
|
|
if( $MD['status'] == 'E' ){
|
|
$URL = '/style/assets/no-signal_h.png';
|
|
$LVID = str_ireplace( '%%MID%%', $LMID, $EXT_VIDEO_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 );
|
|
$LMID = 0;
|
|
}
|
|
} 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];
|
|
if( $MD['status'] == 'E' ){
|
|
$URL = '/style/assets/no-signal_h.png';
|
|
$RVID = str_ireplace( '%%MID%%', $RMID, $EXT_VIDEO_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%%', '1', $EMPTY_VIDEO_CTX );
|
|
$RVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $RVID );
|
|
$RMID = 0;
|
|
};
|
|
} else {
|
|
$RVID = str_ireplace( '%%MID%%', '1', $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( $SESSION_ID ){
|
|
$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']}, false );\" >{$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}]
|
|
}
|
|
DATA_BOUNDARY;
|
|
if( $SESSION_ID ) $PLAT_PARTS[] ="{ id:'sets_ui', frame: true, html: '<table width=\"100%\" border=0><tr>{$TDS}</tr></table>'}";
|
|
//$TOP = str_ireplace('%%%PANELS%%%', implode( ",{ xtype:'spacer', height: 10 },",$PLAT_PARTS ), $MAIN_TPL );
|
|
$TOP = str_ireplace('%%%PANELS%%%', implode( ",",$PLAT_PARTS ), $MAIN_TPL );
|
|
$Data['platform_id'] = $CPID;
|
|
$Data['station_id'] = $STID;
|
|
$Data['content']= $TOP;
|
|
$Data['messages'] = ob_get_clean();
|
|
echo json_encode( $Data );
|
|
} else {
|
|
header('location: /');
|
|
};
|
|
|
|
?>
|