<?php  
//include_once('controller.php');
include_once('conexao.php');
include_once('classes/usuario.php');
include_once('DAO/DAOusuario.php');
 
  
$conn           = new Conexao();
$daousuario     = new DAOusuario(); 
$u              = new usuario();
$status         = false;
$mensagem       = " "; 
 
if (isset($_POST['enviar'])){
    $usu_email  = $_POST['usu_email'];
    $usu_senha  = strtoupper(md5( $_POST['usu_senha'])); 

   // echo "Usuário: ".$usu_email.'<br>';
   // echo "Senha: ".$usu_senha.'<br>';

  //  echo "SELECT usu_email, usu_senha FROM usuario WHERE usu_email = '$usu_email' and usu_senha = '$usu_senha' and usu_situacao = 'ATIVO'";
    $result = $daousuario->autenticarUsuario($usu_email,$usu_senha); 
    foreach($result as $row) {
   //   echo "logou: ".$usu_senha.'<br>';
        setcookie('usu_email', $row['usu_email'], time()+12*30*12*5);
        setcookie('usu_senha', $row['usu_senha'], time()+12*30*12*5);
        setcookie('usu_id', $row['usu_id'], time()+12*30*12*5);
        setcookie('usu_nivel', $row['usu_nivel'], time()+12*30*12*5);
        setcookie('usu_id', $row['usu_id'], time()+12*30*12*5);
        echo("<script language = 'javascript'> location.href = 'index.php'; </script>");  
        $status = true;
    } 

    if ($status == false) {
        $status = false;
        $mensagem = "<br><br><span style='text-align:center'>Usuário ou senha inválido.</span>"; 
    }    
} 

?>
<!DOCTYPE html>
<html class="loading" lang="pt-br" data-textdirection="ltr">
  
<!-- Mirrored from pixinvent.com/bootstrap-admin-template/robust/html/ltr/horizontal-top-icon-menu-template/login-with-bg-image.html by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 12 Feb 2021 19:23:50 GMT -->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="description" content="SucatãoRN">
    <meta name="keywords" content="">
    <!--<meta name="author" content="PIXINVENT">-->
    <title><?php include "titulo.php" ?></title>
    
    <link rel="icon" href="images/favicon.ico">
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i%7CMuli:300,400,500,700" rel="stylesheet">
    <!-- BEGIN VENDOR CSS-->
	<link rel="stylesheet" href="assets/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="css/vendors.min.css">
    <link rel="stylesheet" type="text/css" href="vendors/css/forms/icheck/icheck.css">
    <link rel="stylesheet" type="text/css" href="vendors/css/forms/icheck/custom.css">
    <!-- END VENDOR CSS-->
    <!-- BEGIN ROBUST CSS-->
    <link rel="stylesheet" type="text/css" href="css/app.min.css">
    <!-- END ROBUST CSS-->
    <!-- BEGIN Page Level CSS-->
    <link rel="stylesheet" type="text/css" href="css/core/menu/menu-types/horizontal-top-icon-menu.min.css">
    <link rel="stylesheet" type="text/css" href="css/pages/login-register.min.css">
    <!-- END Page Level CSS-->
    <!-- BEGIN Custom CSS-->
    <link rel="stylesheet" type="text/css" href="assets/css/style.css">
    <!-- END Custom CSS-->
	<style>
	.btn-outline-info {
    border-color: #db602b;
    background-color: transparent;
    color: #db602b;
    }
	
	.btn-outline-info:hover {
    background-color: #db602b;
    color: #FFF !important;
	border-color: #db602b;
	}
	

	</style>
  </head>
  <body class="horizontal-layout horizontal-top-icon-menu 1-column  bg-full-screen-image menu-expanded blank-page blank-page" data-open="hover" data-menu="horizontal-menu" data-col="1-column">
    <!-- ////////////////////////////////////////////////////////////////////////////-->
    <div class="app-content content">
      <div class="content-wrapper">
        <div class="content-header row">
        </div>
        <div class="content-body"><section class="flexbox-container">
    <div class="col-12 d-flex align-items-center justify-content-center">
        <div class="col-md-3 col-10 box-shadow-2 p-0">
            <div class="card border-grey border-lighten-3 px-1 py-1 m-0">
                <div class="card-header border-0">
                    <div class="card-title text-center">
                        <img src="images/logo.png" alt="branding logo" style="width: 250px;">
                    </div>
                  
                </div>
                <div class="card-content">
				 <form id="sign_in" method="POST">
                   
                    <p class="card-subtitle line-on-side text-muted text-center font-small-3 mx-2 my-1"><span>Acesso a Área Administrativa</span></p>
                    <div class="card-body">
                        <form class="form-horizontal" action="" novalidate>
						
						
                            <fieldset class="form-group position-relative has-icon-left">
                                <input type="text" class="form-control" name="usu_email" id="usu_email"  placeholder="Usuário" required>
                                <div class="form-control-position">
                                    <i class="ft-user"></i>
                                </div>
                            </fieldset>
                            <fieldset class="form-group position-relative has-icon-left">
                                <input type="password" class="form-control" name="usu_senha" id="usu_senha" placeholder="Senha" required>
                                <div class="form-control-position">
                                    <i class="ft-lock"></i>
                                </div>
                            </fieldset>
                           <!-- <div class="form-group row">
                                <div class="col-md-6 col-12 text-center text-sm-left">
                                    <fieldset>
                                        <input type="checkbox" id="remember-me" class="chk-remember">
                                        <label for="remember-me"> Remember Me</label>
                                    </fieldset>
                                </div>
                                <div class="col-md-6 col-12 float-sm-left text-center text-sm-right"><a href="recover-password.html" class="card-link">Forgot Password?</a></div>
                            </div>-->
                            <button type="submit" name="enviar" class="btn btn-outline-info btn-block"><i class="ft-unlock"></i> Login</button>
                        </form>
                    </div>
                    
                    
                </div>
				 </form>
            </div>
        </div>
    </div>
</section>

        </div>
      </div>
    </div>
    <!-- ////////////////////////////////////////////////////////////////////////////-->

    <!-- BEGIN VENDOR JS-->
    <script src="vendors/js/vendors.min.js"></script>
    <!-- BEGIN VENDOR JS-->
    <!-- BEGIN PAGE VENDOR JS-->
    <script src="vendors/js/ui/jquery.sticky.js"></script>
    <script src="vendors/js/charts/jquery.sparkline.min.js"></script>
    <script src="vendors/js/forms/validation/jqBootstrapValidation.js"></script>
    <script src="vendors/js/forms/icheck/icheck.min.js"></script>
    <!-- END PAGE VENDOR JS-->
    <!-- BEGIN ROBUST JS-->
    <script src="js/core/app-menu.min.js"></script>
    <script src="js/core/app.min.js"></script>
    <!-- END ROBUST JS-->
    <!-- BEGIN PAGE LEVEL JS-->
    <script src="js/scripts/ui/breadcrumbs-with-stats.min.js"></script>
    <script src="js/scripts/forms/form-login-register.min.js"></script>
    <!-- END PAGE LEVEL JS-->
	<!--Script Https-->
	  <script>
	  if (location.protocol !== 'https:') {
		location.replace(`https:${location.href.substring(location.protocol.length)}`);
	  }
	  </script>
  </body>

<!-- Mirrored from pixinvent.com/bootstrap-admin-template/robust/html/ltr/horizontal-top-icon-menu-template/login-with-bg-image.html by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 12 Feb 2021 19:23:52 GMT -->
</html>