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.
70 lines
3.2 KiB
70 lines
3.2 KiB
<?php
|
|
require_once('../ajax_asm.php');
|
|
require_once('../php/argus/server.php');
|
|
ob_start();
|
|
$UID = intval( $CUser->Data['id'] );
|
|
$ACCESS = intval( $CUser->Data['access'] );
|
|
if( $UID > 1 ){
|
|
$Data = array();
|
|
if( isset( $_POST['OID'] ) ) $PID = intval( $_POST['OID'] ); else $PID = 0;
|
|
$Data['status']='error';
|
|
$Data['b_a_b'] = false;
|
|
if( $PID ){
|
|
$OP = array();
|
|
$QS = "SELECT * FROM `metro_tracks` WHERE `platform_id`={$PID}";
|
|
$RR = $DATABASE->Query( $QS );
|
|
if( count( $RR ) ){
|
|
$MID = array();
|
|
foreach( $RR as $CT ){
|
|
if( intval($CT['far_module_id']) ){
|
|
$CC = array();
|
|
$CC['id']=intval($CT['far_module_id']);
|
|
$CC['hside']=($CT['side']=='U')?'L':'R';
|
|
$CC['vside']=$CT['side'];
|
|
$CC['tname']=$CT['name'];
|
|
$CC['tshort']=$CT['short'];
|
|
$MID[] = $CC;
|
|
};
|
|
if( intval($CT['near_module_id']) ){
|
|
$CC = array();
|
|
$CC['id']=intval($CT['near_module_id']);
|
|
$CC['hside']=($CT['side']=='U')?'R':'L';;
|
|
$CC['vside']=$CT['side'];
|
|
$CC['tname']=$CT['name'];
|
|
$CC['tshort']=$CT['short'];
|
|
$MID[] = $CC;
|
|
};
|
|
};
|
|
$CCC = count( $MID );
|
|
$PLO = getPlatformLineInfo( $PID );
|
|
$NAME = getStationName( $PLO[0]['station_id'] ).'<br/>'.getPlatformName( $PID );
|
|
$INFO = '<table width="100%" border=0><tr><td width="130px" align="right">'.$Labels->GetLabel('_MODULES_').':</td><td>'.$CCC.'</td></tr></table>';
|
|
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_');
|
|
};
|
|
$OP[] = "{ xtype:'panel', border: false, frame: false, html: '<table border=0 class=\"setEd_infoPanel\" id=\"SENSOR_N\"><tr><td valign=\"middle\" align=\"left\" style=\"padding-left:30px;font-size: 22px; font-weight: bold;\">{$NAME}</td></tr><tr><td>{$INFO}</td></tr><tr><td>{$LINES}</td></tr></table><br/>'}";
|
|
if( $CCC ){
|
|
if( $CCC > 3 ) $Data['b_a_b'] = true;
|
|
foreach( $MID as $CM ){
|
|
$QS = "SELECT * FROM `metro_modules` WHERE `id`={$CM['id']}";
|
|
$ZZ = $DATABASE->Query( $QS );
|
|
$MM = $ZZ[0];
|
|
$OP[] = '{ xtype: \'panel\', border: false, frame: false, html: \'<table width="100%" border=0><tr><td><span class="sideInfo_item '.(($MM['status']=='D')?'active_gray':'active_green').'" id="MODULE_TAG_'.$CM['id'].'" onclick="editModule('.$CM['id'].');"><table width="100%" border=0><tr><td width="32px"><div class="level_label">'.$CM['tshort'].'</div></td><td width="32px"><img width="16px" title="'.$Labels->GetLabel('MOD_LOC_'.$CM['vside'].$CM['hside']).'" src="/style/assets/ms_'.strtolower($CM['vside'].$CM['hside']).'.png"></td><td width="50%">'.urldecode($MM['name']).'</td><td>'.$MM['IP4'].'</td></tr></table></span></td></tr></table>\'}';
|
|
};
|
|
};
|
|
};
|
|
$Data['status']='ok';
|
|
$Data['modules'] = '[' . implode( ',', $OP ) . ']';
|
|
};
|
|
$Data['messages'] = ob_get_clean();
|
|
echo json_encode( $Data );
|
|
} else {
|
|
header('location: /');
|
|
};
|
|
|
|
|
|
?>
|