Web UI for ARGUS server
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.

39 lines
2.9 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. if( isset( $_POST['NID'] ) ) $NID = intval($_POST['NID']); else $NID = 0;
  5. if( isset( $_POST['PID'] ) ) $PID = intval($_POST['PID']); else $PID = 0;
  6. if( $PID > 3 ) $PID = 3;
  7. if( $NID ){
  8. $QS = "SELECT `aux_id` FROM `nodes` WHERE `id`={$NID}";
  9. $RR = $DATABASE->Query( $QS, false );
  10. $CSID = intval( $RR[0]['aux_id'] );
  11. if( $CSID ){
  12. if( isset( $_POST['MOFS'] ) ) $MOFS = intval( $_POST['MOFS'] ); else $MOFS = 10;
  13. if( isset( $_POST['MDEL'] ) ) $MDEL = intval( $_POST['MDEL'] ); else $MDEL = 20;
  14. if( isset( $_POST['MWIT'] ) ) $MWIT = intval( $_POST['MWIT'] ); else $MWIT = 1800;
  15. if( isset( $_POST['MORD'] ) ) $MORD = intval( $_POST['MORD'] ); else $MORD = 5;
  16. if( isset( $_POST['MSST'] ) ) $MSST = intval( $_POST['MSST'] ); else $MSST = 1;
  17. if( isset( $_POST['MFLP'] ) ) $MFLP = intval( $_POST['MFLP'] ); else $MFLP = 16;
  18. if( isset( $_POST['MSUN'] ) ) $MSUN = intval( $_POST['MSUN'] ); else $MSUN = 100;
  19. if( isset( $_POST['MGP'] ) ) $MGP = intval( $_POST['MGP'] ); else $MGP = 8;
  20. if( isset( $_POST['MSPK'] ) ) $MSPK = intval( $_POST['MSPK'] ); else $MSPK = 2;
  21. if( isset( $_POST['SOFS'] ) ) $SOFS = intval( $_POST['SOFS'] ); else $SOFS = 10;
  22. if( isset( $_POST['SDEL'] ) ) $SDEL = intval( $_POST['SDEL'] ); else $SDEL = 20;
  23. if( isset( $_POST['SWIT'] ) ) $SWIT = intval( $_POST['SWIT'] ); else $SWIT = 1800;
  24. if( isset( $_POST['SORD'] ) ) $SORD = intval( $_POST['SORD'] ); else $SORD = 5;
  25. if( isset( $_POST['SSST'] ) ) $SSST = intval( $_POST['SSST'] ); else $SSST = 1;
  26. if( isset( $_POST['SFLP'] ) ) $SFLP = intval( $_POST['SFLP'] ); else $SFLP = 16;
  27. if( isset( $_POST['SSUN'] ) ) $SSUN = intval( $_POST['SSUN'] ); else $SSUN = 100;
  28. if( isset( $_POST['SGP'] ) ) $SGP = intval( $_POST['SGP'] ); else $SGP = 8;
  29. if( isset( $_POST['SSPK'] ) ) $SSPK = intval( $_POST['SSPK'] ); else $SSPK = 2;
  30. $QS = "INSERT INTO `lrf_detection_profiles` SET `aux_id`={$CSID}, `profile_id`={$PID}, `master`=b'1', `order`={$MORD},`offset`={$MOFS},`delta`={$MDEL},`flip`={$MFLP},`width`={$MWIT},`sst`={$MSST},`sun`={$MSUN},`gp`={$MGP},`spikes`={$MSPK} ON DUPLICATE KEY UPDATE `order`={$MORD},`offset`={$MOFS},`delta`={$MDEL},`flip`={$MFLP},`width`={$MWIT},`sst`={$MSST},`sun`={$MSUN},`gp`={$MGP},`spikes`={$MSPK}";
  31. $DATABASE->Query( $QS );
  32. $QS = "INSERT INTO `lrf_detection_profiles` SET `aux_id`={$CSID}, `profile_id`={$PID}, `master`=b'0', `order`={$SORD},`offset`={$SOFS},`delta`={$SDEL},`flip`={$SFLP},`width`={$SWIT},`sst`={$SSST},`sun`={$SSUN},`gp`={$SGP},`spikes`={$SSPK} ON DUPLICATE KEY UPDATE `order`={$SORD},`offset`={$SOFS},`delta`={$SDEL},`flip`={$SFLP},`width`={$SWIT},`sst`={$SSST},`sun`={$SSUN},`gp`={$SGP},`spikes`={$SSPK}";
  33. $DATABASE->Query( $QS );
  34. $NCMD = 100+$PID;
  35. $QS = "INSERT INTO `nodes_qcq` SET `node_id`={$NID}, `cmd`={$NCMD}";
  36. $DATABASE->Query( $QS );
  37. };
  38. };
  39. };
  40. ?>