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.

144 lines
3.5 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. $SOK = false;
  7. $FOK = false;
  8. if( count( $RZ ) ){
  9. $FL = $RZ[0];
  10. $FOK = true;
  11. $QS = "SELECT * FROM `target_filter_train` WHERE `id`={$FL['aux_id']}";
  12. $RK = $DATABASE->Query( $QS, false );
  13. $FD = $RK[0];
  14. if( $FD['UPPER_SENSOR'] ){
  15. $QS = "SELECT `aux_id` FROM `nodes` WHERE `id`={$FD['UPPER_SENSOR']}";
  16. $JJR = $DATABASE->Query( $QS, false );
  17. $SI = $JJR[0]['aux_id'];
  18. $QS = "SELECT * FROM `lrf_detection_profiles` WHERE `aux_id`={$SI} AND `profile_id`=0 AND `lrf_id`=0 AND `master`=1";
  19. $JJR = $DATABASE->Query( $QS, false );
  20. $SD = $JJR[0];
  21. $SOK = true;
  22. } else {
  23. $MSG = 'Upper Sensor is not defined in the Train Filter';
  24. };
  25. } else {
  26. $MSG = 'The Train Filter is not defined in the System';
  27. };
  28. $LILI=<<<lskdjflsdsdf
  29. ,listeners:{
  30. afterrender: function(){
  31. Ext.Msg.show({
  32. title: 'Information',
  33. msg: '{$MSG}',
  34. buttons: Ext.Msg.OK,
  35. fn: function(){
  36. var tt = Ext.getCmp('up_se_popanel');
  37. tt.removeAll( true );
  38. tt.doLayout();
  39. },
  40. icon: Ext.MessageBox.INFO
  41. });
  42. }
  43. }
  44. lskdjflsdsdf;
  45. $TPL=<<<JOJOKA
  46. {
  47. xtype: 'panel',
  48. id: 'up_se_popanel',
  49. border: true,
  50. title: 'Upper Sensor Detection Settings',
  51. frame: true,
  52. labelWidth: 150,
  53. labelAlign: 'right',
  54. layout: 'form',
  55. height: PanelH,
  56. bbar:[{
  57. text: 'Apply Detection Settings',
  58. handler: function(){
  59. var oder = Ext.getCmp('ups_order').getValue();
  60. var oset = Ext.getCmp('ups_offset').getValue();
  61. var odel = Ext.getCmp('ups_delta').getValue();
  62. var ofli = Ext.getCmp('ups_flip').getValue();
  63. var owid = Ext.getCmp('ups_width').getValue();
  64. var osst = Ext.getCmp('ups_sst').getValue();
  65. var osun = Ext.getCmp('ups_sun').getValue();
  66. Ext.Ajax.request({
  67. url: '/lib/controller/doSensorOperation.php',
  68. params: {
  69. UID: {$UserID},
  70. SID: '{$Session}',
  71. SNID: '{$SI}',
  72. OPID: 19,
  73. OFF: oset,
  74. ORD: oder,
  75. DEL: odel,
  76. FLI: ofli,
  77. WIZ: owid,
  78. SST: osst,
  79. SUN: osun
  80. },
  81. success: function( response, opts ){
  82. Ext.Msg.show({
  83. title: 'Information',
  84. msg: 'Settings are Saved',
  85. buttons: Ext.Msg.OK,
  86. icon: Ext.MessageBox.INFO
  87. });
  88. },
  89. failure: failureAJAXFunction
  90. });
  91. }
  92. }],
  93. items:[{
  94. xtype: 'numberfield',
  95. id: 'ups_order',
  96. fieldLabel: 'Order',
  97. value: '{$SD['order']}'
  98. },{
  99. xtype: 'numberfield',
  100. id: 'ups_offset',
  101. fieldLabel: 'Offset',
  102. value: '{$SD['offset']}'
  103. },{
  104. xtype: 'numberfield',
  105. id: 'ups_delta',
  106. fieldLabel: 'Delta',
  107. value: '{$SD['delta']}'
  108. },{
  109. xtype: 'numberfield',
  110. id: 'ups_flip',
  111. fieldLabel: 'Flip',
  112. value: '{$SD['flip']}'
  113. },{
  114. xtype: 'numberfield',
  115. id: 'ups_width',
  116. fieldLabel: 'Width',
  117. value: '{$SD['width']}'
  118. },{
  119. xtype: 'numberfield',
  120. id: 'ups_sst',
  121. fieldLabel: 'SST',
  122. value: '{$SD['sst']}'
  123. },{
  124. xtype: 'numberfield',
  125. id: 'ups_sun',
  126. fieldLabel: 'Sun',
  127. value: '{$SD['sun']}'
  128. }]
  129. %%%JUMPAPA%%%
  130. }
  131. JOJOKA;
  132. if( $FOK && $SOK ){
  133. $TPL = str_replace('%%%JUMPAPA%%%', '', $TPL );
  134. } else {
  135. $TPL = str_replace('%%%JUMPAPA%%%', $LILI, $TPL );
  136. };
  137. echo $TPL;
  138. } else {
  139. header('location: /');
  140. };
  141. ?>