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.

125 lines
3.0 KiB

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. } else {
  14. $MSG = 'The Train Filter is not defined in the System';
  15. };
  16. $LILI=<<<lskdjflsdsdf
  17. ,listeners:{
  18. afterrender: function(){
  19. Ext.Msg.show({
  20. title: 'Information',
  21. msg: '{$MSG}',
  22. buttons: Ext.Msg.OK,
  23. fn: function(){
  24. var tt = Ext.getCmp('up_se_popanel');
  25. tt.removeAll( true );
  26. tt.doLayout();
  27. },
  28. icon: Ext.MessageBox.INFO
  29. });
  30. }
  31. }
  32. lskdjflsdsdf;
  33. $TPL=<<<JOJOKA
  34. {
  35. xtype: 'panel',
  36. id: 'up_se_popanel',
  37. border: true,
  38. title: 'Train Filter Fusion Engine Settings',
  39. frame: true,
  40. labelWidth: 150,
  41. labelAlign: 'right',
  42. layout: 'form',
  43. height: PanelH,
  44. bbar:[{
  45. text: 'Apply Filter Settings',
  46. handler: function(){
  47. var odtr = (Ext.getCmp('ups_tdetect').getValue())?1:0;
  48. var odtm = Ext.getCmp('ups_dtime').getValue();
  49. var ostm = Ext.getCmp('ups_stime').getValue();
  50. var ottr = (Ext.getCmp('ups_ttrain').getValue())?1:0;
  51. var owid = Ext.getCmp('ups_width').getValue();
  52. var odbg = (Ext.getCmp('ups_dbg').getValue())?1:0;
  53. Ext.Ajax.request({
  54. url: '/lib/controller/doFilterOperation.php',
  55. params: {
  56. UID: {$UserID},
  57. SID: '{$Session}',
  58. FID: {$FL['id']},
  59. OPID: 9,
  60. DTR: odtr,
  61. DTM: odtm,
  62. STM: ostm,
  63. TTR: ottr,
  64. WIZ: owid,
  65. DBG: odbg
  66. },
  67. success: function( response, opts ){
  68. Ext.Msg.show({
  69. title: 'Information',
  70. msg: 'Settings are Saved',
  71. buttons: Ext.Msg.OK,
  72. icon: Ext.MessageBox.INFO
  73. });
  74. },
  75. failure: failureAJAXFunction
  76. });
  77. }
  78. }],
  79. items:[{
  80. xtype: 'numberfield',
  81. id: 'ups_width',
  82. fieldLabel: 'Train Width',
  83. value: '{$SD['TRAIN_WIDTH']}'
  84. },{
  85. xtype: 'checkbox',
  86. id: 'ups_tdetect',
  87. fieldLabel: 'Detect Train',
  88. checked: parseInt('{$SD['TRAIN_DETECT']}')
  89. },{
  90. xtype: 'numberfield',
  91. id: 'ups_dtime',
  92. fieldLabel: 'Decision Time',
  93. value: '{$SD['DECISION_TIME']}'
  94. },{
  95. xtype: 'numberfield',
  96. id: 'ups_stime',
  97. fieldLabel: 'Suspect Train Time',
  98. value: '{$SD['SUSPECT_TIME']}'
  99. },{
  100. xtype: 'checkbox',
  101. id: 'ups_ttrain',
  102. fieldLabel: 'Track Train',
  103. checked: parseInt('{$SD['TRACK_TRAIN']}')
  104. },{
  105. xtype: 'checkbox',
  106. id: 'ups_dbg',
  107. fieldLabel: 'Debugging Mode',
  108. checked: parseInt('{$SD['DEBUG']}')
  109. }]
  110. %%%JUMPAPA%%%
  111. }
  112. JOJOKA;
  113. if( $FOK ){
  114. $TPL = str_replace('%%%JUMPAPA%%%', '', $TPL );
  115. } else {
  116. $TPL = str_replace('%%%JUMPAPA%%%', $LILI, $TPL );
  117. };
  118. echo $TPL;
  119. } else {
  120. header('location: /');
  121. };
  122. ?>