<?php
session_start();
ob_start();
include_once './banco/conexaobd.php';
?>

<!DOCTYPE html>
<html lang="en">

<head>
    <!-- ========== Meta Tags ========== -->
    <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="Maxa - Multipurpose HTML5 Template">

    <!-- ========== Page Title ========== -->
    <title>Solucionática - Consultor Executivo</title>

    <!-- ========== Favicon Icon ========== -->
    <link rel="shortcut icon" href="assets/img/favicon.png" type="image/x-icon">

    <!-- ========== Start Stylesheet ========== -->
    <link href="assets/css/bootstrap.min.css" rel="stylesheet" />
    <link href="assets/css/font-awesome.min.css" rel="stylesheet" />
    <link href="assets/css/themify-icons.css" rel="stylesheet" />
    <link href="assets/css/flaticon-set.css" rel="stylesheet" />
    <link href="assets/css/elegant-icons.css" rel="stylesheet" />
    <link href="assets/css/magnific-popup.css" rel="stylesheet" />
    <link href="assets/css/owl.carousel.min.css" rel="stylesheet" />
    <link href="assets/css/owl.theme.default.min.css" rel="stylesheet" />
    <link href="assets/css/animate.css" rel="stylesheet" />
    <link href="assets/css/bootsnav.css" rel="stylesheet" />
    <link href="assets/css/style.css" rel="stylesheet">
    <link href="assets/css/responsive.css" rel="stylesheet" />
    <!-- ========== End Stylesheet ========== -->


</head>

<body class="blue">


    <!-- Preloader Start -->
    <div id="site-preloader" class="site-preloader">
        <div class="loader-wrap">
            <div class="ring">
                <span></span>
            </div>
            <h2>Solucionática</h2>
        </div>
    </div>
    <!-- Preloader Ends -->

    <!-- Header 
    ============================================= -->
    <header id="home">

        <!-- Start Navigation -->
        <nav class="navbar navbar-default navbar-fixed white no-background bootsnav">

            <!-- Start Top Search -->
            <div class="top-search">
                <div class="container">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="fa fa-search"></i></span>
                        <input type="text" class="form-control" placeholder="Search">
                        <span class="input-group-addon close-search"><i class="fa fa-times"></i></span>
                    </div>
                </div>
            </div>
            <!-- End Top Search -->

            <div class="container-full">

                <!-- Start Atribute Navigation -->
                <div class="attr-nav">
                    <ul>
                        <button class="menu" type="button" class="fal fa-user" data-toggle="modal" data-target="#loginModal">Login</button>
                        <li class="menu"><a href="#"><i class="fal fa-user"></i> Criar login</a></li>
                    </ul>
                </div>        
                <!-- End Atribute Navigation -->

                <!-- Start Header Navigation -->
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-menu">
                        <i class="fa fa-bars"></i>
                    </button>
                    <a class="navbar-brand" href="index.html">
                        <img src="assets/img/logo Solucionatica - OF BRANCO.png" class="logo logo-display" alt="Logo">
                        <img src="assets/img/logo Solucionatica - OF COL.png" class="logo logo-scrolled" alt="Logo">
                    </a>
                </div>
                
            </div>

        </nav>
        <!-- End Navigation -->

    </header>
    <!-- End Header -->




    <!-- Start Banner 
    ============================================= -->
    <div class="banner-area auto-height text-light shadow theme-hard bg-cover app-banner" style="background-image: url(assets/img/fundo.png);">
        <div class="item">
            <div class="box-table">
                <div class="box-cell">
                    <!-- Shape -->
                    <div class="shape-bottom-center" style="background-image: url(assets/img/shape/7.png);"></div>
                    <!-- End Shape -->
                    <div class="container">
                        <div class="banner-items">
                            <div class="row align-center">
                                <div class="col-lg-6">
                                    <div class="content">
                                        <h2 class="wow fadeInDown">Bem vindos consultores executivos <br>
                                           </h2>
                                        <p class="wow fadeInUp" data-wow-delay="400ms">
                                            Plataforma de acompanhamento de consultores executivos solucionática! 
                                        </p>
                                        <div class="rating wow fadeInRight" data-wow-delay="600ms">
                                            <div class="star">
                                                <i class="fas fa-star"></i>
                                                <i class="fas fa-star"></i>
                                                <i class="fas fa-star"></i>
                                                <i class="fas fa-star"></i>
                                                <i class="fas fa-star-half-alt"></i>
                                            </div>
                                            <span></span>
                                        </div>
                                        <div class="forms wow fadeInLeft" data-wow-delay="800ms">
                                            <form action="#">
                                                <input type="email" placeholder="Digite seu E-mail" class="form-control" name="email">
                                                <button type="submit">Fale conosco</button>  
                                                </di>
                                            </form>
                                            <p>
                                                Dúvidas? Fale conosco
                                            </p>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-6 thumb">
                                    <div class="thumb-box">
                                        <img class="wow slideInUp" data-wow-delay="1100ms" src="assets/img/illustration/celular.png" alt="Thumb">
                                        <div class="sub">
                                            <img class="wow fadeInDown" data-wow-delay="2200ms" src="assets/img/illustration/21-sub.png" alt="Thumb">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- End Banner -->

    <!-- Start Work Process
    ============================================= -->
    <div class="process-style-three-area half-bg default-padding bottom-less">
         <div class="container">
             <div class="row">
                 <!-- Single Item-->
                 <div class="process-style-three col-lg-4 col-md-6 wow fadeInDown" data-wow-delay="300ms">
                     <div class="item">
                         <img src="assets/img/icon/login.png" alt="Login">
                         <h4>Login simples</h4>
                         <p>
                             Login de maneira rápida e facil de qualquer lugar
                         </p>
                     </div>
                 </div>
                 <!-- End SIngle Item-->
                 <!-- Single Item-->
                 <div class="process-style-three col-lg-4 col-md-6 wow fadeInRight" data-wow-delay="600ms">
                     <div class="item">
                        <img src="assets/img/icon/research.png" alt="Icon">
                         <h4>Vizualize roteiros e Respostas</h4>
                         <p>
                             Tudo em um só lugar
                         </p>
                     </div>
                 </div>
                 <!-- End SIngle Item-->
                 <!-- Single Item-->
                 <div class="process-style-three col-lg-4 col-md-6 wow fadeInRight" data-wow-delay="900ms">
                     <div class="item">
                        <img src="assets/img/icon/travel.png" alt="Login">
                         <h4>Acompanhamento fácil</h4>
                         <p>
                            Acesse de qualquer lugar!
                         </p>
                     </div>
                 </div>
                 <!-- End SIngle Item-->
             </div>
         </div>
    </div>
    <!-- End Work Process -->

   <!----modallll----->

   


   <div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">

        <div class="modal-body">
            <div class="form-title text-center">
                <h4>Faça login</h4>
            </div>
        </div>

 
        
        <?php

        $dados = filter_input_array(INPUT_POST, FILTER_DEFAULT);

        if (!empty($dados['SendLogin'])) {
        //var_dump($dados);
        $query_usuario = "SELECT id, nome, email, senha
                        FROM usuarios 
                        WHERE email=:email  
                        LIMIT 1";
        $result_usuario = $conn->prepare($query_usuario);
        $result_usuario->bindParam(':email', $dados['email'], PDO::PARAM_STR);
        $result_usuario->execute();

        if(($result_usuario) AND ($result_usuario->rowCount() != 0)){
            $row_usuario = $result_usuario->fetch(PDO::FETCH_ASSOC);
            var_dump($row_usuario);
            if(password_verify($dados['senha'], $row_usuario['senha'])){
                $_SESSION['id'] = $row_usuario['id'];
                $_SESSION['nome'] = $row_usuario['nome'];
                header("Location: dashboard.php");
            }else{
                $_SESSION['msg'] = "<p style='color: #ff0000'>Erro: Usuário ou senha inválida!</p>";
            }
        }else{
            $_SESSION['msg'] = "<p style='color: #ff0000'>Erro: Usuário ou senha inválida!</p>";
        }

        
    }

    if(isset($_SESSION['msg'])){
        echo $_SESSION['msg'];
        unset($_SESSION['msg']);
    }
    ?>
        
          <form method="POST" action="">

            
              <input type="email" class="form-control" name="email" id="email"placeholder="Digite o email..." value="<?php if(isset($dados['email'])){ echo $dados['email']; } ?>">
            
            

              <input type="password" class="form-control" name="senha" id="senha" placeholder="Digite sua senha..." value="<?php if(isset($dados['senha'])){ echo $dados['senha']; } ?>">


              <input type="submit" class="btn btn-info btn-block btn-round" value="Acessar" name="SendLogin"></input>

            
          </form>

          <!--<button type="submit" class="btn btn-info btn-block btn-round">Login</button>-->

          
            <div class="modal-footer d-flex justify-content-center">
                <div class="signup-section">Não possui login? <a href="#a" class="text-info"> Fale Conosco</a>.</div>
            </div>
          </div>
       
      </div>
    </div>

  


    <!----FIM MODAL--->


   <!-----Falta conteudo apartir daqui ate o footer[]-->

    <!-- Star Footer
    ============================================= -->
    <footer class="bg-dark text-light">
        <div class="container">
            <div class="f-items default-padding">
                <div class="row">
                    <div class="col-lg-5 col-md-6 item">
                        <div class="f-item about">
                            <h4 class="widget-title">Sobre nós</h4>
                            <p>
                                Nossa equipe tem convicção de que nossos princípios são capazes de transformar o ambiente em que vivemos num lugar de crescimento exponencial. Somos formados por pessoas que constroem caminhos ao invés de apenas percorrê-los. Sabemos que nossos resultados serão extraordinários se forem fruto da união de braços, mentes e corações fortes. Isso torna a SOLUCIONÁTICA um lugar de respeito, cordialidade e de interesse genuíno pelo outro. Essa postura nos mostra que nossas pessoas são a parte mais importante, não apenas de nosso sucesso, mas de toda a nossa história.

                            </p>
                            <div class="social">
                                <ul>
                                    <li class="facebook">
                                        <a href="#"><i class="fab fa-facebook-f"></i></a>
                                    </li>
                                    <li class="twitter">
                                        <a href="#"><i class="fab fa-twitter"></i></a>
                                    </li>
                                    <li class="youtube">
                                        <a href="#"><i class="fab fa-youtube"></i></a>
                                    </li>
                                    <li class="instagram">
                                        <a href="#"><i class="fab fa-instagram"></i></a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>

                    <div class="col-lg-2 col-md-6 item">
                        <div class="f-item link">
                            <h4 class="widget-title">Serviços</h4>
                            <ul>
                                <li>
                                    <a href="microempresa.html">Empresarial</a>
                                </li>
                                <li>
                                    <a href="agro.html">Agronegócio</a>
                                </li>
                                <li>
                                    <a href="info.html">Digital</a>
                                </li>
            
                            </ul>
                        </div>
                    </div>

                    <div class="col-lg-2 col-md-6 item">
                        <div class="f-item link">
                            <h4 class="widget-title">Companhia</h4>
                            <ul>
                                <li>
                                    <a href="#sobre">Nossos Princípios</a>
                                </li>
                                <li>
                                    <a href="contato.html">Fale Conosco</a>
                                </li>
                            </ul>
                        </div>
                    </div>

                    <div class="col-lg-3 col-md-6 item">
                        <div class="f-item contact">
                            <h4 class="widget-title">Entre em contato conosco</h4>
                            <div class="address">
                                <ul>
                                    <li>
                                        <!--p>Endereço</p>--> 
                                        <strong>Rio Verde, GO</strong>
                                    </li>
                                    <li>
                                        <p>Email</p> 
                                        <strong>borafazer@solucionati.ca</strong>
                                    </li>
                                    <li>
                                        <p>Contato</p> 
                                        <strong>0800 501 0000</strong>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="footer-bottom">
                <div class="row align-center">
                    <div class="col-lg-4">
                        <p>&copy; Copyright 2022. All Rights Reserved Astronaut</p>
                    </div>
                    <div class="col-lg-4 text-center logo">
                        <a href="#"><img src="assets/img/logo Solucionatica - OF BRANCO.png" alt="Logo"></a>
                    </div>
                </div>
            </div>
        </div>
    </footer>
    <!-- End Footer-->

    <script>
        $(document).ready(function() {             $('#loginModal').modal('show');
  $(function () {
    $('[data-toggle="tooltip"]').tooltip()
  })
});
    </script>

    <!-- jQuery Frameworks
    ============================================= -->
    <script src="assets/js/jquery-3.6.0.min.js"></script>
    <script src="assets/js/popper.min.js"></script>
    <script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/js/jquery.appear.js"></script>
    <script src="assets/js/jquery.easing.min.js"></script>
    <script src="assets/js/jquery.magnific-popup.min.js"></script>
    <script src="assets/js/modernizr.custom.13711.js"></script>
    <script src="assets/js/owl.carousel.min.js"></script>
    <script src="assets/js/wow.min.js"></script>
    <script src="assets/js/progress-bar.min.js"></script>
    <script src="assets/js/isotope.pkgd.min.js"></script>
    <script src="assets/js/imagesloaded.pkgd.min.js"></script>
    <script src="assets/js/count-to.js"></script>
    <script src="assets/js/YTPlayer.min.js"></script>
    <script src="assets/js/jquery.nice-select.min.js"></script>
    <script src="assets/js/bootsnav.js"></script>
    <script src="assets/js/main.js"></script>



    <div vw class="enabled">
        <div vw-access-button class="active"></div>
        <div vw-plugin-wrapper>
          <div class="vw-plugin-top-wrapper"></div>
        </div>
      </div>
      <script src="https://vlibras.gov.br/app/vlibras-plugin.js"></script>
      <script>
        new window.VLibras.Widget('https://vlibras.gov.br/app');
      </script>

</body>
</html>