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.
35 lines
1.0 KiB
35 lines
1.0 KiB
<?php
|
|
require_once('../ajax_asm.php');
|
|
$Data['status'] = 0;
|
|
if( $CUser->Data['id'] > 1 ){
|
|
$EID = intval( $_POST['RID'] );
|
|
$QS = "SELECT * FROM resources WHERE id = {$EID}";
|
|
$Result = $DATABASE->Query( $QS, false );
|
|
if( count( $Result ) ){
|
|
$R = $Result[0];
|
|
switch( $R['type'] ){
|
|
case 1:{
|
|
$UART_ID = intval($R['aux_id']);
|
|
$UART_SPEED = intval($_POST['USPD']);
|
|
$UART_BIT = intval($_POST['UBIT']);
|
|
$UART_STOP = floatval($_POST['USTP']);
|
|
switch( strtoupper( substr( $_POST['UPAR'], 1 ) ) ){
|
|
case 'E': $UART_PARITY = 'E'; break;
|
|
case 'O': $UART_PARITY = 'O'; break;
|
|
default:
|
|
$UART_PARITY = 'N';
|
|
};
|
|
$QS="UPDATE `uart_settings` SET `speed`={$UART_SPEED}, `bit`={$UART_BIT}, `parity`='{$UART_PARITY}', `stop_bit`={$UART_STOP} WHERE id ={$UART_ID}";
|
|
$DATABASE->Query( $QS );
|
|
break;
|
|
};
|
|
};
|
|
$Data['status'] = 1;
|
|
} else {
|
|
$Data['msg']='Wrong Resource';
|
|
};
|
|
} else {
|
|
$Data['msg']='Access Error!';
|
|
};
|
|
echo json_encode( $Data );
|
|
?>
|