/
index.php
67 lines (52 loc) · 2.3 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
include "autoload.php";
use Lib\Produto;
if($_POST) {
$produto = new Produto();
if( $produto->logar( $_POST['email'], $_POST['senha'] ) ) {
header( "Location: consulta_produto.php" );
} else {
$msg = "Usuário ou senha inválidos";
}
}
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<title>Autenticação | Controle de Estoque</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/signin.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<form class="form-signin" method="post" action="">
<div class="alert alert-info" role="alert">Usuário: contato@felipemota.com<br>Senha: 123456</div>
<?= (isset($msg)) ? "<div class='alert alert-danger' role='alert'>$msg</div>" : "";
// <?= equivale a <?php echo
?>
<label for="inputEmail" class="sr-only">E-mail</label>
<input type="email" id="inputEmail" class="form-control" placeholder="Endereço de e-mail" required autofocus name="email">
<label for="inputPassword" class="sr-only">Senha</label>
<input type="password" id="inputPassword" class="form-control" placeholder="Senha" required name="senha">
<button class="btn btn-lg btn-primary btn-block" type="submit">Entrar</button>
</form>
</div> <!-- /container -->
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>