-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathaprovar_usuario.php
84 lines (76 loc) · 2.6 KB
/
aprovar_usuario.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="en">
<?php include_once 'head.php'?>
<title>Aprovar Usuário</title>
<body>
<?php include_once 'menu.php';?>
<div style="padding:20px 0" class="container">
<h3 style="margin-bottom:30px">Lista de Categorias</h3>
<table class="table">
<thead>
<tr>
<th>ID</th>
<th scope="col">Nome</th>
<th scope="col">E-mail</th>
<th scope="col">Nivel</th>
<th scope="col">Ações</th>
</tr>
</thead>
<tbody>
<?php
include_once 'conexao.php';
$sql = "SELECT * FROM `usuario` WHERE status = 'Inativo'";
$retorno = mysqli_query($conexao, $sql);
while ($array = mysqli_fetch_array($retorno, MYSQLI_ASSOC)) {
$idUsuario = $array['IdUsuario'];
$nome = $array['Nome'];
$email = $array['Email'];
$nivel = $array['NivelUsuario'];
switch ($nivel) {
case 1:
$nivel = "Administrador";
break;
case 2:
$nivel = "Funcionário";
break;
case 3:
$nivel = "Conferente";
break;
}
$id = $array['IdUsuario'];
?>
<tr>
<td><?=$id?></td>
<td><?=$nome?></td>
<td><?=$email?></td>
<td><?=$nivel?></td>
<td>
<form action="" method="POST">
<a type="submit" class="btn-editar btn btn-sm btn-primary"
href="editar_usuario_aprovado.php?id=<?=$idUsuario?>" role="button"><i
class="far fa-edit"></i> Aprovar</a>
<a class="btn-editar btn btn-sm btn-danger"
href="inserir_usuario_aprovado.php?id=<?=$idUsuario?>&reprovar=1" role="button"><i
class="far fa-trash-alt"></i> Reprovar</a>
</td>
</form>
</tr>
<?php }?>
</tbody>
</table>
<?php
if (isset($_GET['atualizado'])) {
echo '<div id="alerta" class="alert alert-success" role="alert">
Usuário <b>' . $_GET['atualizado'] . '</b> aprovado com sucesso!.
</div>';
}
if (isset($_GET['excluido'])) {
echo '<div id="alerta" class="alert alert-danger" role="alert">
Usuário <b>' . $_GET['excluido'] . '</b> excluido com sucesso!.
</div>';
}
?>
</div>
<?php include_once 'footer.php'?>
</body>
</html>