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.
121 lines
3.7 KiB
121 lines
3.7 KiB
<?php
|
|
require_once('../ajax_asm.php');
|
|
|
|
if( $CUser->Data['id'] > 1 ){
|
|
$EID = intval( $_POST['CID'] );
|
|
$QS = "SELECT * FROM `metro_stations` WHERE `id`={$EID}";
|
|
$Result = $DATABASE->Query( $QS, false );
|
|
if( count( $Result ) ){
|
|
$CR = $Result[0];
|
|
$TTPL=<<<JOJOKA
|
|
{
|
|
xtype: 'panel',
|
|
border: false,
|
|
frame: false,
|
|
tbar:[{
|
|
id: 'btn_unb_station',
|
|
text: '{$Labels->GetLabel('_SMM_UNB_STATION_')}',
|
|
handler: function(){
|
|
Ext.Msg.show({
|
|
title:'{$Labels->GetLabel('_UNBIND_STATION_')}?',
|
|
msg: '{$Labels->GetLabel('_UNBIND_STATION_QUES_')}?',
|
|
buttons: Ext.Msg.YESNO,
|
|
fn: function(btn){
|
|
if( btn == 'yes' ){
|
|
SelectedModule = 0;
|
|
doStationOperation( {$EID}, 4, SelectedLine, true );
|
|
};
|
|
},
|
|
icon: Ext.MessageBox.QUESTION
|
|
});
|
|
}
|
|
},{
|
|
id: 'btn_del_station',
|
|
text: '{$Labels->GetLabel('_SMM_DEL_STATION_')}',
|
|
handler: function(){
|
|
Ext.Msg.show({
|
|
title:'{$Labels->GetLabel('_REMOVE_STATION_')}?',
|
|
msg: '{$Labels->GetLabel('_REMOVE_STATION_QUES_')}?',
|
|
buttons: Ext.Msg.YESNO,
|
|
fn: function(btn){
|
|
if( btn == 'yes' ){
|
|
SelectedModule = 0;
|
|
doStationOperation( {$EID}, 4, SelectedLine, true );
|
|
};
|
|
},
|
|
icon: Ext.MessageBox.QUESTION
|
|
});
|
|
}
|
|
}],
|
|
items:[%%%ITEMS%%%]
|
|
}
|
|
JOJOKA;
|
|
$ITEMS = array();
|
|
$QS = "SELECT count(`id`) cnt FROM `metro_platforms` WHERE `station_id`={$EID}";
|
|
$Rt = $DATABASE->Query( $QS, false );
|
|
$PCO = $Rt[0]['cnt'];
|
|
$NAME =$CR['name'] .'<br/>';
|
|
$INFO = '<table width="100%" border=0><tr><td width="130px" align="right">'.$Labels->GetLabel('_LBL_PLATFORMS_').':</td><td>'.$PCO.'</td></tr><tr><td align="right">'.$Labels->GetLabel('_MODULES_').':</td><td>'."0" .'</td></tr></table>';
|
|
$QS = "SELECT `ln`.`short`,`ln`.`color`,`ln`.`name` FROM `metro_lines` `ln` LEFT JOIN `metro_stations_2_lines` `sl` ON ( `ln`.`id`=`sl`.`line_id` ) WHERE `sl`.`station_id`={$EID} ORDER BY `ln`.`short`";
|
|
$Rz = $DATABASE->Query( $QS, false );
|
|
if( count( $Rz ) ){
|
|
$LINES='<table><tr>';
|
|
foreach( $Rz 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_');
|
|
};
|
|
//$ITEMS[0]="{ xtype: 'spacer', height: 28 }";
|
|
$ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '<table border=0 class=\"setEd_infoPanel\" id=\"SENSOR_N\"><tr><td valign=\"middle\" align=\"center\" style=\"padding-left:30px;font-size: 22px; font-weight: bold;\">{$NAME}</td></tr><tr><td>{$INFO}</td></tr><tr><td>{$LINES}</td></tr></table>'}";
|
|
|
|
|
|
$ED =<<<kokakskhkajhskr
|
|
{
|
|
xtype: 'spacer',
|
|
height: 20
|
|
},{
|
|
xtype: 'tabpanel',
|
|
border: false,
|
|
frame: false,
|
|
height: PanelH - 190,
|
|
activeTab: 0,
|
|
items:[{
|
|
xtype: 'panel',
|
|
title: '{$Labels->GetLabel('_SMM_SCH_LOCATION_')}',
|
|
items: [{
|
|
xtype: 'panel',
|
|
id: 'schematic_map',
|
|
height: PanelH - 190,
|
|
listeners:{
|
|
afterrender: function(){
|
|
inintSchematicEditor('schematic_map',{$CR['y']},{$CR['x']});
|
|
}
|
|
}
|
|
}]
|
|
},{
|
|
xtype: 'panel',
|
|
title: '{$Labels->GetLabel('_SMM_GEO_LOCATION_')}',
|
|
items: [{
|
|
xtype: 'panel',
|
|
id: 'gis_map',
|
|
height: PanelH - 190,
|
|
listeners:{
|
|
afterrender: function(){
|
|
inintGisEditor('gis_map',{$CR['lat']},{$CR['lon']});
|
|
}
|
|
}
|
|
}]
|
|
}],
|
|
}
|
|
kokakskhkajhskr;
|
|
$ITEMS[1] = $ED;
|
|
$CONTENT = implode(',',$ITEMS);
|
|
$TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL );
|
|
echo $TTPL;
|
|
} else {
|
|
echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
|
|
};
|
|
} else {
|
|
header('location: /');
|
|
};
|
|
?>
|