|
|
<?php require_once('../ajax_asm.php'); if( $CUser->Data['id'] > 1 ){ $QS = "SELECT * FROM `target_filters` WHERE `type`=1"; $RZ = $DATABASE->Query( $QS, false ); $FOK = false; if( count( $RZ ) ){ $FL = $RZ[0]; $FOK = true; $QS = "SELECT * FROM `target_filter_train` WHERE `id`={$FL['aux_id']}"; $RK = $DATABASE->Query( $QS, false ); $SD = $RK[0]; if( !isset( $SD['MINIMAL_LEFT_RANGE'] ) ){ //Upgrade Table
$SD['MINIMAL_LEFT_RANGE'] = $SD['MINIMAL_RANGE']; $SD['MINIMAL_RIGHT_RANGE'] = $SD['MINIMAL_RANGE']; $QS="ALTER TABLE `target_filter_train` RENAME COLUMN `MINIMAL_RANGE` TO `MINIMAL_LEFT_RANGE`"; $DATABASE->Query( $QS, false ); $QS="ALTER TABLE `target_filter_train` ADD COLUMN `MINIMAL_RIGHT_RANGE` REAL DEFAULT 0.0"; $DATABASE->Query( $QS, false ); $QS="UPDATE `target_filter_train` SET `MINIMAL_RIGHT_RANGE`={$SD['MINIMAL_RIGHT_RANGE']} WHERE `id`={$FL['aux_id']}"; $DATABASE->Query( $QS, false ); }; } else { $MSG = 'The Train Filter is not defined in the System'; }; $LILI=<<<lskdjflsdsdf ,listeners:{ afterrender: function(){ Ext.Msg.show({ title: 'Information', msg: '{$MSG}', buttons: Ext.Msg.OK, fn: function(){ var tt = Ext.getCmp('up_se_popanel'); tt.removeAll( true ); tt.doLayout(); }, icon: Ext.MessageBox.INFO }); } }lskdjflsdsdf; $TPL=<<<JOJOKA { xtype: 'panel', id: 'up_se_popanel', border: true, title: 'Train Filter Fusion Engine Settings', frame: true, labelWidth: 200, labelAlign: 'right', layout: 'form', height: PanelH, bbar:[{ text: 'Apply Filter Settings', handler: function(){ var odtr = (Ext.getCmp('ups_tdetect').getValue())?1:0; var odtm = Ext.getCmp('ups_dtime').getValue(); var ostm = Ext.getCmp('ups_stime').getValue(); var oatm = Ext.getCmp('ups_atime').getValue(); var omrgr = Ext.getCmp('ups_mrrange').getValue(); var omrgl = Ext.getCmp('ups_mlrange').getValue(); var ottr = (Ext.getCmp('ups_ttrain').getValue())?1:0; var owid = Ext.getCmp('ups_width').getValue(); var odbg = (Ext.getCmp('ups_dbg').getValue())?1:0; Ext.Ajax.request({ url: '/lib/controller/doFilterOperation.php', params: { UID: {$UserID}, SID: '{$Session}', FID: {$FL['id']}, OPID: 9, DTR: odtr, DTM: odtm, STM: ostm, TTR: ottr, WIZ: owid, DBG: odbg, ATM: oatm, MRRG: omrgr, MLRG: omrgl }, success: function( response, opts ){ Ext.Msg.show({ title: 'Information', msg: 'Settings are Saved', buttons: Ext.Msg.OK, icon: Ext.MessageBox.INFO }); }, failure: failureAJAXFunction }); } }], items:[{ xtype: 'checkbox', id: 'ups_dbg', fieldLabel: 'Debugging Mode', checked: parseInt('{$SD['DEBUG']}') },{ xtype: 'checkbox', id: 'ups_tdetect', fieldLabel: 'Detect Train', checked: parseInt('{$SD['TRAIN_DETECT']}') },{ xtype: 'checkbox', id: 'ups_ttrain', fieldLabel: 'Track Train', checked: parseInt('{$SD['TRACK_TRAIN']}') },{ xtype: 'spacer', html: '<hr/>' },{ xtype: 'numberfield', id: 'ups_dtime', fieldLabel: '[UTF] No Train Time', value: '{$SD['DECISION_TIME']}' },{ xtype: 'numberfield', id: 'ups_atime', fieldLabel: '[UTF] Restart Senor Hours', value: '{$SD['UPPER_RESTART']}' },{ xtype: 'spacer', html: '<hr/>' },{ xtype: 'numberfield', id: 'ups_stime', fieldLabel: '[LTF] Suspect Time', value: '{$SD['SUSPECT_TIME']}' },{ xtype: 'numberfield', id: 'ups_width', fieldLabel: '[LTF] Suspicious Width', value: '{$SD['TRAIN_WIDTH']}' },{ xtype: 'numberfield', id: 'ups_mlrange', fieldLabel: '[LTF] Minimal Range Left', value: '{$SD['MINIMAL_LEFT_RANGE']}' },{ xtype: 'numberfield', id: 'ups_mrrange', fieldLabel: '[LTF] Minimal Range Right', value: '{$SD['MINIMAL_RIGHT_RANGE']}' }] %%%JUMPAPA%%% }JOJOKA; if( $FOK ){ $TPL = str_replace('%%%JUMPAPA%%%', '', $TPL ); } else { $TPL = str_replace('%%%JUMPAPA%%%', $LILI, $TPL ); }; echo $TPL; } else { header('location: /'); };?>
|