Data['id'] > 1 ){ $EID = intval( $_POST['PID'] ); $QS = "SELECT * FROM `metro_platforms` WHERE `id`={$EID}"; $Result = $DATABASE->Query( $QS, false ); if( count( $Result ) ){ $CR = $Result[0]; $TTPL=<<GetLabel('_SMM_DEL_PLATFORM_')}', handler: function(){ Ext.Msg.show({ title:'{$Labels->GetLabel('_REMOVE_MODULE_')}?', msg: '{$Labels->GetLabel('_REMOVE_MODU_QUES_')}?', buttons: Ext.Msg.OKCANCEL, fn: function(btn){ if( btn == 'ok' ){ SelectedModule = 0; doModuleOperation( {$CR['id']}, 200, '', true ); }; }, icon: Ext.MessageBox.QUESTION }); } }], items:[%%%ITEMS%%%] } JOJOKA; $ITEMS = array(); $QS = "SELECT count(`id`) cnt FROM `metro_tracks` WHERE `platform_id`={$EID}"; $Rt = $DATABASE->Query( $QS, false ); $TCO = $Rt[0]['cnt']; $NAME =$CR['name'] .'
'; $PINFO = getPlatformInfo( $CR['id'] ); $QS = "SELECT * FROM `metro_tracks` WHERE `platform_id`={$CR['id']} ORDER BY `side` ASC"; $TI = $DATABASE->Query( $QS, false ); $TRACKS = ''; if( count( $TI ) ){ $COS = count( $PINFO['PREV'] ); if( $COS ) $COS = "rowspan={$COS} "; else $COS=""; $TRU = "{$TI[0]['short']}"; $TRACKS = "{ xtype: 'form', border: false, frame: false, labelWidth: 150,labelAlign: 'right',margins: {top:10, right:10, bottom:10, left:10},padding:8,labelAlign:'right', items:[{ xtype: 'panel', bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',html: '".$Labels->GetLabel('_UPPR_TRACK_')."'},{ xtype: 'textfield', fieldLabel:'Name', value: '{$TI[0]['name']}',listeners:{change: function( a, c, b ){doPlatformOperation( {$CR['id']}, 8, c, true );}}},{ xtype: 'textfield', fieldLabel:'Abbreviation', value: '{$TI[0]['short']}',listeners:{change: function( a, c, b ){doPlatformOperation( {$CR['id']}, 9, c, true );}}}]}"; if( count( $TI ) > 1 ){ $COS = count( $PINFO['NEXT'] ); if( $COS ) $COS = "rowspan={$COS} "; else $COS=""; $TRB = "{$TI[1]['short']}"; $TRACKS .= ",{ xtype: 'form', border: false, frame: false, labelWidth: 150,labelAlign: 'right',margins: {top:10, right:10, bottom:10, left:10},padding:8, labelAlign:'right', items:[{ xtype: 'panel', bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',html: '".$Labels->GetLabel('_BTOM_TRACK_')."'},{ xtype: 'textfield', fieldLabel:'Name', value: '{$TI[1]['name']}',listeners:{change: function( a, c, b ){doPlatformOperation( {$CR['id']}, 10, c, true );}}},{ xtype: 'textfield', fieldLabel:'Abbreviation', value: '{$TI[1]['short']}',listeners:{change: function( a, c, b ){doPlatformOperation( {$CR['id']}, 11, c, true );}}}]}"; }; } else { $COS = count( $PINFO['PREV'] ); if( $COS ) $COS = "rowspan={$COS} "; else $COS=""; $TRU = " "; $COS = count( $PINFO['NEXT'] ); if( $COS ) $COS = "rowspan={$COS} "; else $COS=""; $TRB = " "; }; $INFO = '
'.$Labels->GetLabel('_SMM_PAT_LEVEL_').':
'.$CR['level'].'
'.$Labels->GetLabel('_LBL_TRACKS_').':'.$TCO.'
'.$Labels->GetLabel('_MODULES_').':'. ( $TCO * 2 ) .'
'; $QS = "SELECT `sl`.`line_id`, `ln`.`short`,`ln`.`color`,`ln`.`name`,`sl`.`index` FROM `metro_lines` `ln` LEFT JOIN `metro_stations_2_lines` `sl` ON ( `ln`.`id`=`sl`.`line_id` ) WHERE `sl`.`station_id`={$CR['station_id']} ORDER BY `ln`.`short`"; $Sz = $DATABASE->Query( $QS, false ); if( count( $Sz ) ){ $LINE_COLORS = array(); $QS = "SELECT `ln`.`short`,`ln`.`color` FROM `metro_lines` `ln` LEFT JOIN `metro_platforms_2_lines` `sl` ON ( `ln`.`id`=`sl`.`line_id` ) WHERE `sl`.`platform_id`={$EID} ORDER BY `ln`.`short`"; $Rz = $DATABASE->Query( $QS, false ); if( count( $Rz ) ){ $LINES=''; foreach( $Rz as $Z ){ $LINE_COLORS[$Z['short']] = '#'.$Z['color']; $LINES.=""; }; $LINES.='
{$Z['short']}
'; }; $ROUTING = "{ xtype:'panel', width: '100%', layout: 'table', defaults: {margins: {top:10, right:10, bottom:10, left:10},padding:8},baseCls: 'x-plain', layoutConfig: {columns: 2},frame: false,border: false,items:[{xtype:'panel',border:false,frame:false,colspan:2,html:'{$Labels->GetLabel('_SMM_MET_ROUTE_')}'}"; foreach( $Sz as $Z ){ $AS = 'false'; for( $idx = 0; $idx < $PINFO['INFO_COUNT']; $idx++){ if( $Z['line_id'] == $PINFO[$idx]['id'] ){ $AS = 'true'; break; }; }; // $ROUTING .=",{xtype:'panel',width:70, height:60,border:false,frame:false,style:{float:'right'},html: '
{$Z['short']}
'},{ xtype: 'button',enableToggle:true,pressed:{$AS},text:'{$Labels->GetLabel('_ACTIVE_')}',handler:function(b,e){if(b.pressed){ doPlatformOperation({$CR['id']},3,{$Z['line_id']},true);}else{doPlatformOperation({$CR['id']},4,{$Z['line_id']},true);};}}"; }; $ROUTING .= "]}"; } else { $ROUTING = "{xtype:'spacer',height:0}"; }; $TOP ="{$TRU}
"; if( $PINFO['PREV_IS_MULTI'] ){ foreach( $PINFO['PREV'] as $P ){ $TOP .= ""; } } else { if( count( $PINFO['PREV'] )){ $TOP .= ""; } else { $TOP .=""; }; }; $TOP .="
 {$P['name']}
 {$PINFO['PREV'][0]['name']}
 {$Labels->GetLabel('_SMM_NO_NESTA_')}
"; $BOTTOM ="{$TRB}
"; if( $PINFO['NEXT_IS_MULTI'] ){ foreach( $PINFO['NEXT'] as $P ){ $BOTTOM .= ""; } } else { if( count( $PINFO['NEXT'] )){ $BOTTOM .= ""; } else { $BOTTOM .= ""; }; }; $BOTTOM .="
{$P['name']} 
{$PINFO['NEXT'][0]['name']} 
{$Labels->GetLabel('_SMM_NO_NESTA_')} 
"; $ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '{$TOP}{$BOTTOM}
{$NAME}
{$INFO}
 ".createPlatformAnimation( $CR['layout'], array(), $LINE_COLORS )." 
'}"; $QS="SELECT * FROM `modbus_modules` WHERE `platform_id`={$CR['id']}"; $JG=$DATABASE->Query( $QS ); if( count( $JG ) ){ $SC=$JG[0]; $CCCV = intval( $SC['values'] ); if( ( $CCCV & 0x01 ) == 0x01 ) $P1 = 'true'; else $P1 = 'false'; if( ( $CCCV & 0x02 ) == 0x02 ) $P2 = 'true'; else $P2 = 'false'; if( ( $CCCV & 0x04 ) == 0x04 ) $P3 = 'true'; else $P3 = 'false'; if( ( $CCCV & 0x08 ) == 0x08 ) $P4 = 'true'; else $P4 = 'false'; $MODBUS=<<GetLabel('_STATUS_')}", lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['mode','mode_txt'], data: [ ['D','{$Labels->GetLabel('__DISABLED__')}'], ['E','{$Labels->GetLabel('___ENABLED__')}'] ] }), valueField: 'mode', displayField: 'mode_txt', value: '{$SC['wm']}', width: 200, listeners:{ select: function( a, c, b ){ doPlatformOperation( {$CR['id']}, 12, b, true ); } } },{ xtype: 'textfield', id: 'sca_ip', fieldLabel: '{$Labels->GetLabel('_DEVICE_IP_')}', maxlength: 64, value: '{$SC['ip4']}', listeners:{ change: function( a, c, b ){ doPlatformOperation( {$CR['id']}, 13, c, true ); } } },{ xtype: 'textfield', id: 'sca_port', fieldLabel: '{$Labels->GetLabel('_DEVICE_PORT_')}', maxlength: 2, value: '{$SC['port']}', listeners:{ change: function( a, c, b ){ doPlatformOperation( {$CR['id']}, 14, c, true ); } } },{ xtype: 'panel', layout: 'table', border: false, frame: false, labelWidth: 150, labelAlign: 'right', width: '100%', defaults: { // applied to each contained panel bodyStyle:'padding:10px; text-align: center;' }, layoutConfig: { // The total column count must be specified here columns: 4 }, items:[{ xtype: 'panel', bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;', html: 'Upper Track' },{ xtype: 'panel', bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;', html: 'Bottom Track' },{ xtype: 'panel', bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;', html: 'Health Signal' },{ xtype: 'panel', bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;', html: 'AUX Signal' },{ xtype: 'combo', fieldLabel: "Upper Track", lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['mode','mode_txt'], data: [ [-1,'{$Labels->GetLabel('__DISABLED__')}'], [0,'Coil D1'],[1,'Coil D2'],[2,'Coil D3'],[3,'Coil D4'] ] }), valueField: 'mode', displayField: 'mode_txt', value: '{$SC['crossbar_a']}', width: 200, listeners:{ select: function( a, c, b ){ //doPlatformOperation( {$CR['id']}, 12, b, true ); } } },{ xtype: 'combo', fieldLabel: "Upper Track", lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['mode','mode_txt'], data: [ [-1,'{$Labels->GetLabel('__DISABLED__')}'], [0,'Coil D1'],[1,'Coil D2'],[2,'Coil D3'],[3,'Coil D4'] ] }), valueField: 'mode', displayField: 'mode_txt', value: '{$SC['crossbar_b']}', width: 200, listeners:{ select: function( a, c, b ){ //doPlatformOperation( {$CR['id']}, 12, b, true ); } } },{ xtype: 'combo', fieldLabel: "Upper Track", lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['mode','mode_txt'], data: [ [-1,'{$Labels->GetLabel('__DISABLED__')}'], [0,'Coil D1'],[1,'Coil D2'],[2,'Coil D3'],[3,'Coil D4'] ] }), valueField: 'mode', displayField: 'mode_txt', value: '{$SC['crossbar_c']}', width: 200, listeners:{ select: function( a, c, b ){ //doPlatformOperation( {$CR['id']}, 12, b, true ); } } },{ xtype: 'combo', fieldLabel: "Upper Track", lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['mode','mode_txt'], data: [ [-1,'{$Labels->GetLabel('__DISABLED__')}'], [0,'Coil D1'],[1,'Coil D2'],[2,'Coil D3'],[3,'Coil D4'] ] }), valueField: 'mode', displayField: 'mode_txt', value: '{$SC['crossbar_d']}', width: 200, listeners:{ select: function( a, c, b ){ //doPlatformOperation( {$CR['id']}, 12, b, true ); } } },{ xtype: 'spacer', height: 10, colspan: 4 },{ xtype: 'panel', colspan: 4, bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;', html: 'TEST MODBUS MODULE COILS' },{ xtype: 'spacer', height: 5, colspan: 4 },{ xtype: 'button', enableToggle: true, allowDepress: true, width: '80%', text: 'Test D1', pressed: {$P1}, handler: function( b, e ){ if( b.pressed ){ doPlatformOperation( {$CR['id']}, 15, ({$CCCV} | 1 ), true ); } else { doPlatformOperation( {$CR['id']}, 15, ({$CCCV} & ( ~1 ) ), true ); }; } },{ xtype: 'button', width: '80%', enableToggle: true, allowDepress: true, text: 'Test D2', pressed: {$P2}, handler: function( b, e ){ if( b.pressed ){ doPlatformOperation( {$CR['id']}, 15, ({$CCCV} | 2 ), true ); } else { doPlatformOperation( {$CR['id']}, 15, ({$CCCV} & ( ~2 ) ), true ); }; } },{ xtype: 'button', enableToggle: true, allowDepress: true, width: '80%', text: 'Test D3', pressed: {$P3}, handler: function( b, e ){ if( b.pressed ){ doPlatformOperation( {$CR['id']}, 15, ({$CCCV} | 4 ), true ); } else { doPlatformOperation( {$CR['id']}, 15, ({$CCCV} & ( ~4 ) ), true ); }; } },{ xtype: 'button', enableToggle: true, allowDepress: true, width: '80%', text: 'Test D4', pressed: {$P4}, handler: function( b, e ){ if( b.pressed ){ doPlatformOperation( {$CR['id']}, 15, ({$CCCV} | 8 ), true ); } else { doPlatformOperation( {$CR['id']}, 15, ({$CCCV} & ( ~8 ) ), true ); }; } }] } DATA_BOUNDARY; } else { $MODBUS=''; }; $ED =<<GetLabel('_GENERAL_')}', items: [{ xtype: 'form', height: PanelH - 283, labelWidth: 150, labelAlign: 'right', margins: {top:10, right:10, bottom:10, left:10}, padding:8, items: [{ xtype: 'combo', id: 'sens_se', fieldLabel: "{$Labels->GetLabel('_STATUS_')}", lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, store: new Ext.data.ArrayStore({ fields: ['mode','mode_txt'], data: [ ['D','{$Labels->GetLabel('__DISABLED__')}'], ['E','{$Labels->GetLabel('___ENABLED__')}'] ] }), valueField: 'mode', displayField: 'mode_txt', value: '{$CR['status']}', width: 200, listeners:{ select: function( a, c, b ){ doPlatformOperation( {$CR['id']}, 2, b, true ); } } },{ xtype: 'textfield', id: 'plt_name', fieldLabel: '{$Labels->GetLabel('_SMM_PAT_NAME_')}', maxlength: 64, value: '{$CR['name']}', listeners:{ change: function( a, c, b ){ doPlatformOperation( {$CR['id']}, 6, c, true ); } } },{ xtype: 'textfield', id: 'plt_lvl', fieldLabel: '{$Labels->GetLabel('_SMM_PAT_LEVEL_')}', maxlength: 2, value: '{$CR['level']}', listeners:{ change: function( a, c, b ){ doPlatformOperation( {$CR['id']}, 7, c, true ); } } },{$ROUTING}] }] },{ xtype: 'panel', title: '{$Labels->GetLabel('_LBL_TRACKS_')}', items: [{$TRACKS}] },{ xtype: 'panel', title: '{$Labels->GetLabel('_LBL_SCADA_')}', items: [{ xtype: 'form', height: PanelH - 283, labelWidth: 150, labelAlign: 'right', margins: {top:10, right:10, bottom:10, left:10}, padding:8, items: [{$MODBUS}] }] }], } 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: /'); }; ?>