| | ";
};
foreach( $PINFO as $II ){
// If has more stations on the line
//if( $II['index'] > 1 ) {
$SI = getLineStationInfo( $II['id'], $II['index'] + $D );
if( count( $SI ) ){
if( $CSID != $SI['id'] ){
$CSID = $SI['id'];
$pidx++;
};
$PARTS[$pidx]['name']=$SI['name'];
$PARTS[$pidx]['colors'][]=$II['color'];
};
//};
};
$Output = '';
foreach( $PARTS as $P ){
if( ( $CC = count( $P['colors'] ) ) > 1 ){
$CP = 100 / $CC;
$COMAP = array();
for( $ix = 0; $ix < $CC; $ix++ ){
$SPO= intval( $ix * $CP );
$NPO= intval( ( $ix+1 ) * $CP ) - 1;
if( $SPO < 2 ){
$COMAP[] = "#{$P['colors'][$ix]}, #{$P['colors'][$ix]} {$NPO}%";
} else if( $SPO > 90 ){
$COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]}";
} else {
$COMAP[] = "#{$P['colors'][$ix]} {$SPO}%, #{$P['colors'][$ix]} {$NPO}%";
};
};
$GRADIENT = implode( ',', $COMAP );//writing-mode: vertical-lr;text-orientation: upright;
$Output .= " | {$L_P}{$P['name']}{$R_P} | ";
} else {
$Output .= "{$L_P}{$P['name']}{$R_P} | ";
};
};
return $Output;
};
function getModleOnlineStatus( $MID ){
global $DATABASE;
$QS = "SELECT `status`,`ts`,`SID` FROM `mem_online_cloud` WHERE `object_id`={$MID} AND `object_type`=2";
$RV = $DATABASE->Query( $QS, false );
if( count( $RV ) ) return $RV[0];
return array();
}
?>