<?php
include('conexiones/conex.php'); 
session_start();

// *** Validate request to login to this site.
if ( isset($_SESSION['MM_Username']) && isset($_SESSION['MM_idAdmin']) && $_SESSION['MM_Username'] != '' && $_SESSION['MM_idAdmin'] != '0' ){
    header("Location:home.php");
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
?>
<html lang="en">
<head>
  <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="images/favicon.ico">

    <title>CEISCAS - Administrador Web </title>
  
	<link rel="stylesheet" href="assets/vendor_components/bootstrap/dist/css/bootstrap.min.css">
	
	<link rel="stylesheet" href="src/css/bootstrap-extend.css">
	
	<link rel="stylesheet" href="src/css/master_style.css">

	<link rel="stylesheet" href="src/css/skins/_all-skins.css">	
	<script type="text/javascript" src="src/js/jquery.js"></script>
	<script type="text/javascript" src="src/js/jquery.min.js"></script>
	<script type="text/javascript" src="src/js/jquery-ui.min.js"></script>
	<script type="text/javascript" src="src/js/log.js"></script>
	<script src="src/js/alertify.min.js" integrity="sha256-a5BJQEMVvKJbs38h5W3EFXI4svjVezJnZzK1YFF3Fm0="></script>
    <link rel="stylesheet" href="src/css/alertify.css"/>

</head>
<body class="hold-transition login-page">
	
	<div class="container h-p100">
		<div class="row align-items-center justify-content-md-center h-p100">
			
			<div class="col-lg-4 col-md-8 col-12">
				<div class="login-box">
				  <div class="login-box-body">
					<h3 class="text-center">Iniciar Sesión</h3>
					<p class="login-box-msg">Ingresa tu correo y contraseña</p>
					<form id="form_inicia_sesion" name="form1" onSubmit="return inicia_sesion()">
					  <div class="form-group has-feedback">
                        <input type="email" id="email" name="strEmail" class="form-control rounded" value="<?php if (isset($_COOKIE['mail'])) echo $_COOKIE['mail'];?>" placeholder="Email" required autofocus>
						<span class="ion ion-email form-control-feedback"></span>
					  </div>
					  <div class="form-group has-feedback">
                        <input type="password" name="strPassword" id="contrasena" value="<?php if(isset($_COOKIE['contrasena'])){ echo $_COOKIE['contrasena'];} ?>" class="form-control rounded" placeholder="Contraseña" required>
						<span class="ion ion-locked form-control-feedback"></span>
					  </div>
					  <div class="row">
						<div class="col-6">
						  <div class="checkbox">
                              <?php if(isset($_COOKIE['mail'])){?>
							<input type="checkbox" name="recordar" checked id="basic_checkbox_1">
                              <?php }else{?>
							<input type="checkbox" name="recordar" id="basic_checkbox_1">
                              <?php }?>
							<label for="basic_checkbox_1">Recuerdame</label>
						  </div>
						</div>
						<!-- /.col -->
						<div class="col-6">
						 <div class="fog-pwd text-right">
							<a href="javascript:void(0)" class="text-danger"><i class="ion ion-locked"></i> Olvidaste?</a><br>
						  </div>
						</div>
						<!-- /.col -->
						<div class="col-12 text-center">
						  <button type="submit" class="btn btn-info btn-block margin-top-10">INICIAR</button>
						</div>
						<!-- /.col -->
					  </div>
					</form>

				  </div>
				  <!-- /.login-box-body -->
				</div>
				<!-- /.login-box -->
			
			</div>
		</div>
	</div>


	<!-- jQuery 3 -->
	<script src="assets/vendor_components/jquery/dist/jquery.min.js"></script>
	
	<!-- popper -->
	<script src="assets/vendor_components/popper/dist/popper.min.js"></script>
	
	<!-- Bootstrap 4.0-->
	<script src="assets/vendor_components/bootstrap/dist/js/bootstrap.min.js"></script>



</body></html>