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.
179 lines
5.2 KiB
179 lines
5.2 KiB
<?php
|
|
require_once('../ajax_asm.php');
|
|
|
|
if( $CUser->Data['id'] > 1 ){
|
|
$EID = intval( $_POST['LID'] );
|
|
$QS = "SELECT * FROM `metro_lines` 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_del_line',
|
|
text: "{$Labels->GetLabel( '_SMM_DEL_LINE_' )}",
|
|
handler: function(){
|
|
Ext.Msg.show({
|
|
title:'{$Labels->GetLabel('_REMOVE_LINE_')}',
|
|
msg: '{$Labels->GetLabel('_REMOVE_LINE_QUES_')}',
|
|
buttons: Ext.Msg.YESNO,
|
|
fn: function(btn){
|
|
if( btn == 'yes' ){
|
|
SelectedLine = 0;
|
|
doLineOperation( {$CR['id']}, 2, {$CR['id']}, true );
|
|
};
|
|
},
|
|
icon: Ext.MessageBox.QUESTION
|
|
});
|
|
}
|
|
}],
|
|
items:[%%%ITEMS%%%]
|
|
}
|
|
JOJOKA;
|
|
$QS="SELECT count(`station_id`) cnt FROM `metro_stations_2_lines` WHERE line_id={$EID}";
|
|
$RR=$DATABASE->Query( $QS );
|
|
if( count( $RR ) ){
|
|
$SCO = intval( $RR[0]['cnt'] );
|
|
} else {
|
|
$SCO = 0;
|
|
};
|
|
$ENANO=($CR['status']=='E')?1:0;
|
|
|
|
$ITEMS = array();
|
|
switch( $CR['type'] ){
|
|
case 1:$NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_LNT_BRT_'); break;
|
|
case 2:$NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_LNT_LRT_'); break;
|
|
case 3:$NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_LNT_MRT_'); break;
|
|
case 4:$NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_LNT_CRT_'); break;
|
|
case 5:$NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_LNT_LCR_'); break;
|
|
case 6:$NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_LNT_HSR_'); break;
|
|
default: $NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_UNDEF_TYPE_'); break;
|
|
};
|
|
$INFO = '<table width="100%" border=0><tr><td width="130px" align="right">'.$Labels->GetLabel('_STATIONS_').':</td><td>'.$SCO.'</td></tr><tr><td align="right">'.$Labels->GetLabel('_MODULES_').':</td><td>'."0" .'</td></tr></table>';
|
|
$CL=( $CR['type'] < 2 )?'line_type_64_ground':'line_type_64_rail';
|
|
$ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '<table width=\"100%\" border=0 class=\"setEd_infoPanel\" id=\"SENSOR_".(($ENANO)?'A':'N')."\"><tr><td width=\"100px\"><div class=\"{$CL}\" style=\"background-color:#{$CR['color']};\">{$CR['short']}</div></td><td valign=\"middle\" style=\"font-weight: bold;\">{$NAME}</td></tr><tr><td colspan=2>{$INFO}</td></tr></table><br/>'}";
|
|
|
|
|
|
$ED =<<<kokakskhkajhskr
|
|
{
|
|
xtype: 'form',
|
|
labelWidth: 200,
|
|
border: false,
|
|
frame: false,
|
|
labelAlign: 'right',
|
|
height: PanelH - 283,
|
|
items:[{
|
|
xtype: 'combo',
|
|
id: 'line_le',
|
|
fieldLabel: "{$Labels->GetLabel('_LINE_STATUS_')}",
|
|
lazyRender: true,
|
|
mode: 'local',
|
|
forceSelection: true,
|
|
triggerAction: 'all',
|
|
editable: false,
|
|
disableKeyFilter: true,
|
|
store: new Ext.data.ArrayStore({
|
|
fields: ['mode','mode_txt'],
|
|
data: [
|
|
[0,'{$Labels->GetLabel('__DISABLED__')}'],
|
|
[1,'{$Labels->GetLabel('___ENABLED__')}']
|
|
]
|
|
}),
|
|
valueField: 'mode',
|
|
displayField: 'mode_txt',
|
|
value: {$ENANO},
|
|
width: 200,
|
|
listeners:{
|
|
select: function( a, c, b ){
|
|
doLineOperation( {$CR['id']}, 7, b, true );
|
|
}
|
|
}
|
|
},{
|
|
xtype: 'combo',
|
|
id: 'line_type',
|
|
fieldLabel: "{$Labels->GetLabel('_LINE_TYPE_')}",
|
|
lazyRender: true,
|
|
mode: 'local',
|
|
forceSelection: true,
|
|
triggerAction: 'all',
|
|
editable: false,
|
|
disableKeyFilter: true,
|
|
store: new Ext.data.ArrayStore({
|
|
fields: ['mode','mode_txt'],
|
|
data: [
|
|
[0,'{$Labels->GetLabel('_UNDEF_TYPE_')}'],
|
|
[1,'{$Labels->GetLabel('_LNT_BRT_')}'],
|
|
[2,'{$Labels->GetLabel('_LNT_LRT_')}'],
|
|
[3,'{$Labels->GetLabel('_LNT_MRT_')}'],
|
|
[4,'{$Labels->GetLabel('_LNT_CRT_')}'],
|
|
[5,'{$Labels->GetLabel('_LNT_LCR_')}'],
|
|
[6,'{$Labels->GetLabel('_LNT_HSR_')}']
|
|
]
|
|
}),
|
|
valueField: 'mode',
|
|
displayField: 'mode_txt',
|
|
value: {$CR['type']},
|
|
width: 200,
|
|
listeners:{
|
|
select: function( a, c, b ){
|
|
doLineOperation( {$CR['id']}, 6, b, true );
|
|
}
|
|
}
|
|
},{
|
|
xtype: 'textfield',
|
|
id: 'line_name',
|
|
value: '{$CR['name']}',
|
|
fieldLabel: "{$Labels->GetLabel('_LINE_NAME_')}",
|
|
},{
|
|
xtype: 'textfield',
|
|
id: 'line_short',
|
|
value: '{$CR['short']}',
|
|
fieldLabel: "{$Labels->GetLabel('_LINE_SHORT_')}",
|
|
},{
|
|
xtype: 'textfield',
|
|
id: 'line_color_picker',
|
|
value: '#{$CR['color']}',
|
|
fieldLabel: "{$Labels->GetLabel('_LINE_LBL_COLOR_')}",
|
|
listeners:{
|
|
render: function( t ){
|
|
var j = t.getEl();
|
|
document.getElementById( j.id ).setAttribute("data-coloris","");
|
|
document.getElementById( j.id ).setAttribute("class","x-form-text x-form-field coloris instance1");
|
|
//debugger;
|
|
Coloris.setInstance('.instance1', {
|
|
theme: 'pill',
|
|
themeMode: 'dark',
|
|
formatToggle: false,
|
|
closeButton: true,
|
|
clearButton: false,
|
|
swatches: [
|
|
'#0072bc',
|
|
'#e3131b',
|
|
'#57a835',
|
|
'#a05da5',
|
|
'#f7b618',
|
|
'#ea6bb1'
|
|
],
|
|
onChange: function( w, c, e ){
|
|
doLineOperation( {$CR['id']}, 5, c.value, true );
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}]
|
|
}
|
|
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: /');
|
|
};
|
|
?>
|