<?php include('casa/setup.casa.php');
include('inc_scripts.php');
$title = 'Tipo de Cambio Dolar $u$';
echo "<title>".AppName.' - '.$title."</title>";

$sql = "SELECT * FROM ventas_moneda
WHERE mone_codigo = 'dollar';";	
$db= new DB();
$db->dbSQL($sql);
$db->next();	
	$mone_valor = $db->dbField("mone_valor");
?>
</head>
<body>
	<div class="wrapper">		
	<?php include('inc_menu.php');?>

		<div class="main-panel">
			<div class="content">
				
				<div class="page-inner">						
				<div class="row">
						<div class="col-md-12">
						<form>
							<div class="card">
								<div class="card-header">
									<div class="card-title"><?php echo $title?></div>
								</div>
								<div class="card-body">
									<div class="row">										
										<div class="col-md-6 col-lg-4">		
											<div class="form-group form-group-default">
												<label>Valor Moneda Dolar $u$:</label>
												<input id="mone_valor" value="<?php echo $mone_valor; ?>" type="text" class="form-control" required>
											</div>										
										</div>
									</div>									
								</div>
								<div class="card-action"><center>
									<div id='res'></div>
									<button class="btn btn-info" type='submit'><b> GUARDAR DATOS </b></button>	</center>								
								</div>
							</div>
						</form>
						</div>
					</div>
				</div>
				
			</div>
			<?php include('inc_pie.php');?>
		</div>
		
		
	</div>
</body>
</html>
<script>
$('form').on('submit', function(event) {
  event.preventDefault();

  $.post('<?php echo PATH_HOME.'tipocambio2/cifrado='.substr(sha1(uniqid()),1,14); ?>',{
	 'mone_valor': $('#mone_valor').val(),
    'MxEncoder': '<?php echo sha1(uniqid()); ?>'
  },function(data){
    $('#res').html(data);
  });  
});
</script>