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.

25 lines
903 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. if( isset( $_POST['UART'] ) ){
  5. $UART_ID = intval($_POST['UART']);
  6. if( $UART_ID ){
  7. $UART_SPEED = intval($_POST['USPD']);
  8. $UART_BIT = intval($_POST['UBIT']);
  9. $UART_STOP = floatval($_POST['USTP']);
  10. switch( strtoupper( substr( $_POST['UPAR'], 1 ) ) ){
  11. case 'E': $UART_PARITY = 'E'; break;
  12. case 'O': $UART_PARITY = 'O'; break;
  13. default:
  14. $UART_PARITY = 'N';
  15. };
  16. $UART_IP = $DATABASE->escape( $_POST['UADR'] );
  17. $UART_PORT = intval( $_POST['UPOR'] );
  18. $UART_MODE = intval( $_POST['UMOD'] );
  19. if( $UART_PORT > 0 ){
  20. $QS="UPDATE `uart_settings` SET `speed`={$UART_SPEED}, `bit`={$UART_BIT}, `parity`='{$UART_PARITY}', `stop_bit`={$UART_STOP}, `port`={$UART_PORT}, `path`='{$UART_IP}', `mode`={$UART_MODE} WHERE id ={$UART_ID}";
  21. $DATABASE->Query( $QS );
  22. };
  23. };
  24. };
  25. };
  26. ?>