<?php
#   SGT - The SGT for Internet - http://sgt.eti.br
#   Copyright (c) 2016-2018, Jean Azevedo. All rights reserved.

#   This file is part of SGT.

#   SGT is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   any later version.

#   SGT is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.

#   You should have received a copy of the GNU General Public License
#   along with Foobar.  If not, see <http://www.gnu.org/licenses/>.

    if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
        $uri = 'https://';
    } else {
        $uri = 'http://';
    }
    $uri .= $_SERVER['HTTP_HOST'];
    
    $p = @$_GET['p'];

    $arquivo =  $p . ".php";
    if (isset ($p)){
        if (file_exists ($arquivo)){
            include $arquivo;
        }
    }
    include "conectar.php";
    $busca_pe = $pdo_sgt->prepare("SELECT * FROM tb_conf WHERE conf=:conf");
    $busca_pe->bindValue(":conf","rodape");
    $busca_pe->execute();
    $dados_pe = $busca_pe->fetch(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <?php
        include 'css.html';
    ?>
    <meta charset="UTF-8">
    <title>Login - SGT</title>
</head>
<body>
    <div class="main_sgt">
        <div id="form-index" class="container-fluid ">
            <div class="row">
                <div class="col-md-12">
                    <img class="rounded mx-auto d-block" src="img/sgt.png" width="254" height="218">
                    <blockquote class="blockquote text-center">
                        <p class="h1">Sistema de Gestão Tecnológico</p>
                    </blockquote>
                    <form method="POST" action="login.php">
                        <div class="container">
                            <div class="row">
                                <div class="col">
                                </div>
                                <div class="col">
                                    <div class="form-group row">
                                        <input type="text" class="form-control" autofocus required name="usuario" maxlength="50" placeholder="Usuário"><br>
                                    </div>
                                </div>
                                <div class="col">
                                </div>
                            </div>
                        </div>
                        <div class="container">
                            <div class="row">
                                <div class="col"> 
                                </div>
                                <div class="col">
                                    <div class="form-group row">
                                        <input class="form-control" required type="password" name="senha" placeholder="Senha"><br>
                                    </div>
                                </div>
                                <div class="col">
                                    <input class="btn btn-primary" type="submit" value="entrar" name="entrar"><br>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <?php
            include 'roda_pe_.html';
        ?>
    </div>
</body>
</html>