<?php include('casa/setup.casa.php');
include('inc_scripts.php');
$title = 'Crear Nueva Ubicación';
echo "<title>".AppName.' - '.$title."</title>";

?>
</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-6">																						
											<div class="form-group form-group-default">
												<label>Nombre Ubicación:</label>
												<input id='txtUbicacion' type="text" class="form-control">
											</div>	
										</div>
										<div class="col-md-6 col-lg-6">																						
											<div class="form-group form-group-default">
												<label>Color Ubicación:</label>
												<input id='cmbColor' type="text" class="form-control">
												<!--select id='cmbColor' class="form-control">
													<option value="">Seleccionar color</option>
													<option value="red">Rojo</option>
													<option value="yellow">Amarillo</option>
													<option value="blue">Azul</option>
													<option value="green">Verde</option>
													<option value="orange">Naranja</option>
													<option value="cyan">Celeste</option>
													<option value="fuchsia">Fucsia</option>
													<option value="#cccccc">Plomo</option>
												</select-->
											</div>	
										</div>
										
									</div>
								</div>
								<div class="card-action"><center>
									<div id='res'></div>
									<a href='<?php echo PATH_HOME.'ubicaciones/'; ?>' class="btn btn-danger"><b> CANCELAR </b></a>
									<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.'ubicaciones-ins2/'. md5(uniqid()); ?>',{
	 'txtUbicacion': $('#txtUbicacion').val(),  
	 'cmbColor': $('#cmbColor').val(),  	 
    'MxEncoder': '<?php echo sha1(uniqid()); ?>'
  },function(data){
    $('#res').html(data);
  });  
});
</script>