-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
46 lines (45 loc) · 1.1 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
<html>
<?php require_once("cabecalho.php");
require_once("logica-usuario.php");
?>
<?php
if(isset($_GET["logout"]) && $_GET["logout"]==true) {
?>
<p class="alert-success">Deslogado com sucesso</p>
<?php
}
?>
<?php
mostraAlerta("success");
mostraAlerta("danger");
?>
<?php
if(usuarioEstaLogado()) {
?>
<p class="text-success">Você está logado como <?=usuarioLogado() ?></p>
<a href="logout.php">Deslogar</a></p>
<?php
} else {
?>
<h2>Login</h2>
<form action="login.php" method="post">
<table class="table">
<tr>
<td>Nome do Usuário</td>
<td><input class="form-control" type="text" name="nome"></td>
</tr>
<tr>
<td>Senha</td>
<td><input class="form-control" type="password" name="senha"></td>
</tr>
<tr>
<td><button type="submit"
class="btn btn-primary">Login</button></td>
</tr>
</table>
</form>
<?php
}
?>
<?php include("rodape.php")?>
</html>