<?php
//header('Content-Type: text/html; charset=utf-8');



/*
CRIADO POR: K88
DATA ULTIMA ALTERAÇÃO: 16/08/2017 18:49
OBS.: ATUALIZAÇÃO DE NOVA ESTRUTURA E REVISÃO
*/
include("configuracao.php");//confirma no banco de dados

if(isset($_GET['logoff']) == "sim"){

// Apaga todas as variáveis da sessão
$_SESSION = array();

// Se é preciso matar a sessão, então os cookies de sessão também devem ser apagados.
// Nota: Isto destruirá a sessão, e não apenas os dados!
if (ini_get("session.use_cookies")) {
    $params = session_get_cookie_params();
    setcookie(session_name(), '', time() - 42000,
        $params["path"], $params["domain"],
        $params["secure"], $params["httponly"]
    );
}

// Por último, destrói a sessão
session_destroy();

}

if( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ) {
    // faço algo aqui
    //echo "<br><br><br><br><br><br>AQUI1";
}else{
    //echo "<br><br><br><br><br>AQUI2";
    echo "<script>window.location.href = '".$DiretorioVirtualRaiz."';</script>";
}
?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title><?php echo $TituloSitema;?></title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <link href="css/style_novo.css" rel="stylesheet" type="text/css" />
    <link href="css/font-awesome.min.css" rel="stylesheet">
    <link href="css/simple-line-icons.css" rel="stylesheet">    
    <!-- Bootstrap 3.3.2 -->
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Font Awesome Icons -->
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <!-- iCheck -->
    <link href="plugins/iCheck/square/blue.css" rel="stylesheet" type="text/css" />

    <!-- 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.3.0/respond.min.js"></script>
    <![endif]-->
    
<style type="text/css">
video { 
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -100;
    transform: translateX(-50%) translateY(-50%);
 background: url('<?php echo $DiretorioVirtual;?>inclusos/background-video.jpg') no-repeat;
  background-size: cover;
  transition: 1s opacity;
}
.stopfade { 
   opacity: .5;
}
body {
  overflow: hidden;
}

</style>            
    
  </head>
  <body class="app flex-row align-items-center">
    <video poster="<?php echo $DiretorioVirtual;?>inclusos/background-video.jpg" id="bgvid" playsinline autoplay muted loop>
    <source src="<?php echo $DiretorioVirtual;?>inclusos/video_login.mp4" type="video/mp4">
    </video>      
    <div class="login-box">      
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-0">
                <div class="card-group mb-0">
                    <div class="card p-2">
                        <form method="post" enctype="multipart/form-data" action="valida.php">
                           <div class="card-block">
                            <h1>Login</h1>
                            <p class="text-muted">Faça o Login para acessar o sistema</p>
                            <div class="input-group mb-1">
                                <span class="input-group-addon"><i class="fa fa-server"></i>
                                </span>
                                <input type="text" name="cnpj" class="form-control" placeholder="AGÊNCIA E" disabled>
                            </div>
                            <div class="input-group mb-1">
                                <span class="input-group-addon"><i class="icon-user"></i>
                                </span>
                                <input type="text" name="usuario" class="form-control" placeholder="Login" required style="text-transform: lowercase;">
                            </div>
                            <div class="input-group mb-2">
                                <span class="input-group-addon"><i class="icon-lock"></i>
                                </span>
                                <input type="password" name="senha" class="form-control" placeholder="Senha" required autocomplete="off">
                            </div>
                            <div class="row">                            
                                <div class="col-6">
                                    <button type="submit" class="btn btn-primary px-2">Login</button>
                                </div>
                                <div class="col-12">								
                                <!--    
								<a href="https://docs.google.com/forms/d/e/1FAIpQLSd-aHF63jJ1selxWFRucYblX0D2MCNbXW8vDXZN_Nar192BwQ/viewform" target="_blank"><button type="button" class="btn btn-primary active mt-1">Pesquisa de Atendimento</button></a>
									
								<a href="https://goo.gl/forms/xEvEhfVrHppJRYgI2" target="_blank"><button type="button" class="btn btn-primary active mt-1">Pos Atendimento</button></a>                                    
                                -->    
								<a href="agenda_externa.php" target="_blank"><button type="button" class="btn btn-primary active mt-1">AGENDA PUBLICA</button></a>                                    
									
									
                                </div>
                            </div>
                        </div>
                        </form> 
                    </div>
                    <div class="card card-inverse card-primary py-3 hidden-md-down" style="width:44%; background-color: <?php echo $CorLogin;?>; border-color: <?php echo $CorLogin;?>;">
                        <div class="card-block text-center">
                            <div>
                                <h2><?php echo $NomeEmpresa;?></h2>
                                <h6>VERSÃO 3.0 BETA</h6>
                                <p>Se houver algum problema no acesso do sistema, por favor entre em contato através do e-mail.</p>
                                <a href="mailto: suporte@k88.com.br"><button type="button" class="btn btn-primary active mt-1">suporte@k88.com.br</button></a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- jQuery 2.1.3 -->
    <script src="plugins/jQuery/jQuery-2.1.3.min.js"></script>
    <!-- Bootstrap 3.3.2 JS -->
    <script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="js/tether.min.js"></script>    
    <!-- iCheck -->
    <script src="plugins/iCheck/icheck.min.js" type="text/javascript"></script>
    <script>
      $(function () {
        $('input').iCheck({
          checkboxClass: 'icheckbox_square-blue',
          radioClass: 'iradio_square-blue',
          increaseArea: '20%' // optional
        });
      });
    </script>
  </body>
</html>