<?php session_start();?>
<!DOCTYPE html>
<html dir="ltr">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Intranet BB3">
    <meta name="author" content="FDlabs">
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon1.png">
    <title>BB3 - Intranet</title>
    <!-- Custom CSS -->
    <link href="dist/css/style.min.css" rel="stylesheet">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->

<?php require_once('adminclude.php')?>
  <?php
          
		$ing = get("ing");  
		$error = 0;
		if($ing==1){
		  ////////// recoger datos del formulario de ingreso
		   $nom = $_POST["txtusu"];
		   $cla = $_POST["txtcorreo"];
		  
		   $usu = new clsusuario;
		   $usu->carga_usu_usuario($nom);
		   $usu->carga_usu_correo($cla);
		   $rsusu = $usu->usuario_correo();
		   $registros = $rsusu->num_rows;
		  
		   
		   if($registros > 0){
				 $filausu = $rsusu->fetch_array();
				 $_SESSION["perfil"] = $filausu[2];
				 $_SESSION["usuario"] = $filausu[1];
				 $_SESSION["correo"] = $filausu[3];
				 $_SESSION["persona"] = $filausu[4];
				 $_SESSION["nombre"] = $filausu[5];
				 $_SESSION["apellido"] = $filausu[6];
				 $_SESSION["solopanas"] = 100; 
				 redireccionar("bb3_nueva_clave.php");
				 
				
			}
			else{
				$error=1; 
			}
		}
  
  ?>
</head>

<body>
    <div class="main-wrapper">
        <!-- ============================================================== -->
        <!-- Preloader - style you can find in spinners.css -->
        <!-- ============================================================== -->
        <div class="preloader">
            <div class="lds-ripple">
                <div class="lds-pos"></div>
                <div class="lds-pos"></div>
            </div>
        </div>
        <!-- ============================================================== -->
        <!-- Preloader - style you can find in spinners.css -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Login box.scss -->
        <!-- ============================================================== -->
        <div class="auth-wrapper d-flex no-block justify-content-center align-items-center position-relative"
            style="background:url(assets/images/big/auth-bg.jpg) no-repeat center center;">
            <div class="auth-box row">
                <div class="col-lg-7 col-md-5 modal-bg-img" style="background-image: url(assets/images/big/1.jpg);">
                </div>
                <div class="col-lg-5 col-md-7 bg-white">
                    <div class="p-3">
                        <div class="text-center">
                            <img src="assets/images/big/icon.png" alt="wrapkit">
                        </div>
                        <h2 class="mt-3 text-center">Recuperar Cuenta</h2>
                        <p class="text-center">Ingrese su usuario y correo</p>
                        <form class="mt-4" method="post" action = "?ing=1">
                            <div class="row">
                                <div class="col-lg-12">
                                    <div class="form-group">
                                        <label class="text-dark" for="txtusu">Usuario</label>
                                        <input class="form-control" id="txtusu" name="txtusu" type="text" placeholder="Ingrese su usuario" required>
                                    </div>
                                </div>
                                <div class="col-lg-12">
                                    <div class="form-group">
                                        <label class="text-dark" for="txtcorreo">correo</label>
                                        <input class="form-control" id="txtcorreo" name="txtcorreo" type="email" placeholder="Ingrese su correo" required>
                                    </div>
                                </div>
                                <div class="col-lg-12 text-center">
                                    <button type="submit" class="btn btn-block btn-dark">Ingresar</button>
                                </div>
								 <?php if($error == 1){?>
								   <div class="text-center mt-4 font-weight-light text-danger">
										Usuario y/o clave incorrectos
									</div>
								 <?php }?>
                                
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <!-- ============================================================== -->
        <!-- Login box.scss -->
        <!-- ============================================================== -->
    </div>
    <!-- ============================================================== -->
    <!-- All Required js -->
    <!-- ============================================================== -->
    <script src="assets/libs/jquery/dist/jquery.min.js "></script>
    <!-- Bootstrap tether Core JavaScript -->
    <script src="assets/libs/popper.js/dist/umd/popper.min.js "></script>
    <script src="assets/libs/bootstrap/dist/js/bootstrap.min.js "></script>
    <!-- ============================================================== -->
    <!-- This page plugin js -->
    <!-- ============================================================== -->
    <script>
        $(".preloader ").fadeOut();
    </script>
</body>

</html>