<?php require('casa/setup.casa.php');
$titulo=' :: Iniciar Sesión';
include('inc_head.php');
?>
<style>
img{
	max-width:90%;
}	
</style>
</head>
<body class="bg-dark">
	<div class="wrapper">		
			<div class="content">				
				<div class="page-inner">
				<!-- -->	<br><br>
					<div class="row">
						<div class="col-md-4"></div>						
						<div class="col-md-4">
							<div class="card bg-blue">
								<form>								
								<div class="card-body">								
									<div class="row">																				
										<div class="col-md-12 col-lg-12 text-center">				
											<img src="<?php echo PATH_HOME.'fondo.png';?>" width="100%" class='avatar-img rounded'>											
										</div>	
										<div class="col-md-12 col-lg-12">				
											<div class="form-group">
												<div class="input-group mb-3">													
													<div class="input-group-prepend">
														<span class="input-group-text">Usuario:</span>
													</div>												
													<input id='txtUser' type="text" class="form-control">
												</div>
												<div class="input-group mb-3">
													<div class="input-group-prepend">
														<span class="input-group-text">Contraseña:</span>
													</div>
													<input id='txtPass' type="password" class="form-control">
												</div>												
											</div>																					
										</div>																			
									</div>	
									<div id='res'></div>
									<div class=" text-center">
										<input type='reset' class="btn btn-danger" value='REINICIAR' />
										<button type='submit' class="btn btn-default">INICIAR SESIÓN</button>									
									</div>
														
								</div>
								
								</form>
							</div>
						</div>
						<div class="col-md-4"></div>
					</div>
				<!-- -->									
				</div>
			</div>	
			<?php include('inc_pie.php');?>
	</div>	
</body>
</html>
<script>
$('form').on('submit', function(event) {
  event.preventDefault();

  $.post('<?php echo PATH_HOME.'indlogin/'.md5(uniqid()); ?>',{
    'uss': $('#txtUser').val(),
    'pss': $('#txtPass').val(),
    'coder': '<?php echo sha1(uniqid()); ?>'
  },function(data){
    $('#res').html(data);
  });
  
});
</script>