<?php
$filename = 'c_leitura.php';
if (!file_exists($filename)) {
    header("Location: error.php");
    exit;
}
include 'c_leitura.php';
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <link rel="shortcut icon" href="img/logo.ico" type="image/x-icon" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Gerenciamento de Tablets</title>
        <!-- Core CSS - Include with every page -->

        <link href="css/bootstrap2.css" rel="stylesheet">
        <link href="font-awesome/css/font-awesome.css" rel="stylesheet">

        <!-- SB Admin CSS - Include with every page -->
        <link href="css/sb-admin-2.css" rel="stylesheet">

    </head>



    <body>

        <div id="wrapper">



            <div class="container">

                <div class="row">

                    <div class="col-md-4 col-md-offset-4">

                        <div class="login-panel panel panel-default">

                            <div class="panel-heading">

                                <h3 class="panel-title">Login</h3>

                            </div>

                            <div class="panel-body">

                                <?php
                                if (!empty($_GET)) {



                                    echo "<div class='alert alert-danger alert-dismissable'>";

                                    echo "<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>";

                                    if ($_GET['erro'] == 1)
                                        echo "Usuário ou senha inválidos </div>";

                                    if ($_GET['erro'] == 2)
                                        echo "Você deve digitar usuário e senha </div>";
                                }
                                ?>

                                <form role="form" action="login.php" method="POST">

                                    <fieldset>

                                        <div class="form-group">

                                            <input class="form-control" placeholder="Usuário" name="login" type="text" autofocus required>

                                        </div>

                                        <div class="form-group">

                                            <input class="form-control" placeholder="Senha" name="passwd" type="password" required>

                                        </div>

                                        <!-- Change this to a button or input when using this as a form -->

                                        <button type="submit" class="btn btn-lg btn-success btn-block"> Entrar</button>

                                    </fieldset>

                                </form>

                            </div>

                        </div>

                    </div>

                </div>

            </div>



            <!-- Core Scripts - Include with every page -->

            <script src="js/jquery-2.1.1.js"></script>

            <script src="js/bootstrap.min.js"></script>

            <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>



            <!-- SB Admin Scripts - Include with every page -->

            <script src="js/sb-admin-2.js"></script>



    </body>



</html>

