Web Interface For Lite Argus Control modules
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.

163 lines
4.4 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
12 months ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
12 months ago
​
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
12 months ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
4 years ago
12 months ago
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $QS = "SELECT * FROM `target_filters` WHERE `type`=1";
  5. $RZ = $DATABASE->Query( $QS, false );
  6. $FOK = false;
  7. if( count( $RZ ) ){
  8. $FL = $RZ[0];
  9. $FOK = true;
  10. $QS = "SELECT * FROM `target_filter_train` WHERE `id`={$FL['aux_id']}";
  11. $RK = $DATABASE->Query( $QS, false );
  12. $SD = $RK[0];
  13. if( !isset( $SD['MINIMAL_LEFT_RANGE'] ) ){
  14. //Upgrade Table
  15. $SD['MINIMAL_LEFT_RANGE'] = $SD['MINIMAL_RANGE'];
  16. $SD['MINIMAL_RIGHT_RANGE'] = $SD['MINIMAL_RANGE'];
  17. $QS="ALTER TABLE `target_filter_train` RENAME COLUMN `MINIMAL_RANGE` TO `MINIMAL_LEFT_RANGE`";
  18. $DATABASE->Query( $QS, false );
  19. $QS="ALTER TABLE `target_filter_train` ADD COLUMN `MINIMAL_RIGHT_RANGE` REAL DEFAULT 0.0";
  20. $DATABASE->Query( $QS, false );
  21. $QS="UPDATE `target_filter_train` SET `MINIMAL_RIGHT_RANGE`={$SD['MINIMAL_RIGHT_RANGE']} WHERE `id`={$FL['aux_id']}";
  22. $DATABASE->Query( $QS, false );
  23. };
  24. } else {
  25. $MSG = 'The Train Filter is not defined in the System';
  26. };
  27. $LILI=<<<lskdjflsdsdf
  28. ,listeners:{
  29. afterrender: function(){
  30. Ext.Msg.show({
  31. title: 'Information',
  32. msg: '{$MSG}',
  33. buttons: Ext.Msg.OK,
  34. fn: function(){
  35. var tt = Ext.getCmp('up_se_popanel');
  36. tt.removeAll( true );
  37. tt.doLayout();
  38. },
  39. icon: Ext.MessageBox.INFO
  40. });
  41. }
  42. }
  43. lskdjflsdsdf;
  44. $TPL=<<<JOJOKA
  45. {
  46. xtype: 'panel',
  47. id: 'up_se_popanel',
  48. border: true,
  49. title: 'Train Filter Fusion Engine Settings',
  50. frame: true,
  51. labelWidth: 200,
  52. labelAlign: 'right',
  53. layout: 'form',
  54. height: PanelH,
  55. bbar:[{
  56. text: 'Apply Filter Settings',
  57. handler: function(){
  58. var odtr = (Ext.getCmp('ups_tdetect').getValue())?1:0;
  59. var odtm = Ext.getCmp('ups_dtime').getValue();
  60. var ostm = Ext.getCmp('ups_stime').getValue();
  61. var oatm = Ext.getCmp('ups_atime').getValue();
  62. var omrgr = Ext.getCmp('ups_mrrange').getValue();
  63. var omrgl = Ext.getCmp('ups_mlrange').getValue();
  64. var ottr = (Ext.getCmp('ups_ttrain').getValue())?1:0;
  65. var owid = Ext.getCmp('ups_width').getValue();
  66. var odbg = (Ext.getCmp('ups_dbg').getValue())?1:0;
  67. Ext.Ajax.request({
  68. url: '/lib/controller/doFilterOperation.php',
  69. params: {
  70. UID: {$UserID},
  71. SID: '{$Session}',
  72. FID: {$FL['id']},
  73. OPID: 9,
  74. DTR: odtr,
  75. DTM: odtm,
  76. STM: ostm,
  77. TTR: ottr,
  78. WIZ: owid,
  79. DBG: odbg,
  80. ATM: oatm,
  81. MRRG: omrgr,
  82. MLRG: omrgl
  83. },
  84. success: function( response, opts ){
  85. Ext.Msg.show({
  86. title: 'Information',
  87. msg: 'Settings are Saved',
  88. buttons: Ext.Msg.OK,
  89. icon: Ext.MessageBox.INFO
  90. });
  91. },
  92. failure: failureAJAXFunction
  93. });
  94. }
  95. }],
  96. items:[{
  97. xtype: 'checkbox',
  98. id: 'ups_dbg',
  99. fieldLabel: 'Debugging Mode',
  100. checked: parseInt('{$SD['DEBUG']}')
  101. },{
  102. xtype: 'checkbox',
  103. id: 'ups_tdetect',
  104. fieldLabel: 'Detect Train',
  105. checked: parseInt('{$SD['TRAIN_DETECT']}')
  106. },{
  107. xtype: 'checkbox',
  108. id: 'ups_ttrain',
  109. fieldLabel: 'Track Train',
  110. checked: parseInt('{$SD['TRACK_TRAIN']}')
  111. },{
  112. xtype: 'spacer',
  113. html: '<hr/>'
  114. },{
  115. xtype: 'numberfield',
  116. id: 'ups_dtime',
  117. fieldLabel: '[UTF] No Train Time',
  118. value: '{$SD['DECISION_TIME']}'
  119. },{
  120. xtype: 'numberfield',
  121. id: 'ups_atime',
  122. fieldLabel: '[UTF] Restart Senor Hours',
  123. value: '{$SD['UPPER_RESTART']}'
  124. },{
  125. xtype: 'spacer',
  126. html: '<hr/>'
  127. },{
  128. xtype: 'numberfield',
  129. id: 'ups_stime',
  130. fieldLabel: '[LTF] Suspect Time',
  131. value: '{$SD['SUSPECT_TIME']}'
  132. },{
  133. xtype: 'numberfield',
  134. id: 'ups_width',
  135. fieldLabel: '[LTF] Suspicious Width',
  136. value: '{$SD['TRAIN_WIDTH']}'
  137. },{
  138. xtype: 'numberfield',
  139. id: 'ups_mlrange',
  140. fieldLabel: '[LTF] Minimal Range Left',
  141. value: '{$SD['MINIMAL_LEFT_RANGE']}'
  142. },{
  143. xtype: 'numberfield',
  144. id: 'ups_mrrange',
  145. fieldLabel: '[LTF] Minimal Range Right',
  146. value: '{$SD['MINIMAL_RIGHT_RANGE']}'
  147. }]
  148. %%%JUMPAPA%%%
  149. }
  150. JOJOKA;
  151. if( $FOK ){
  152. $TPL = str_replace('%%%JUMPAPA%%%', '', $TPL );
  153. } else {
  154. $TPL = str_replace('%%%JUMPAPA%%%', $LILI, $TPL );
  155. };
  156. echo $TPL;
  157. } else {
  158. header('location: /');
  159. };
  160. ?>