-
Notifications
You must be signed in to change notification settings - Fork 1
/
aprovar_usuario.php
92 lines (82 loc) · 3.76 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
85
86
87
88
89
90
<?php
session_start();
// Se o usuário não estiver logado e tentar acessar a página diretamente pela url
// o mesmo será redirecionado para a tela de login
if(!isset($_SESSION['matricula']) || empty($_SESSION['matricula']))
{
unset($_SESSION['matricula']);
header('Location: index.php');
}
$matricula = $_SESSION['matricula'];
?>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="utf-8">
<title>Aprovar Usuário</title>
<link rel="stylesheet" href="css/bootstrap.css">
<script src="https://kit.fontawesome.com/8786c39b09.js"></script>
</head>
<body>
<div class="container" style="margin-top: 40px; width: 1000px">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<h1>Usuários Pendentes de Aprovação</h1>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-item nav-link active" href="adicionar_ponto.php" role="button" class="btn btn-success">Registrar Ponto</a>
<a class="nav-item nav-link active" href="menu.php" role="button" class="btn btn-primary" style="margin-left: 25px">Voltar</a>
<a class="nav-item nav-link active" href="sair.php" role="button" class="btn btn-danger" style="margin-left: 25px">Sair</a>
</div>
</div>
</nav>
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Nome usuário</th>
<th scope="col">Matrícula usuário</th>
<th scope="col">Nível usuário</th>
<th scope="col">Status usuário</th>
<th scope="col">Ação</th>
</tr>
</thead>
<?php
include "conexao.php";
$sql = "SELECT * FROM `usuarios` WHERE status = 'Inativo'";
$busca = mysqli_query($conn, $sql);
while ($array = mysqli_fetch_array($busca)){
$id_usuario = $array['id_usuario'];
$nome_usuario = $array['nome_usuario'];
$matricula_usuario = $array['matricula_usuario'];
$nivel_usuario = $array['nivel_usuario'];
$status = $array['status'];
?>
<tr>
<td><?php echo $nome_usuario; ?></td>
<td><?php echo $matricula_usuario; ?></td>
<td><?php echo $nivel_usuario; ?></td>
<td><?php echo $status; ?></td>
<td>
<a class="btn btn-secondary btn-sm" href="_aprovar_usuario.php?id=<?php echo $id_usuario; ?>&nivel=3"
role="button"><i class="fas fa-thumbs-up"></i> Funcionário
</a>
<a class="btn btn-success btn-sm" href="_aprovar_usuario.php?id=<?php echo $id_usuario; ?>&nivel=1"
role="button"><i class="fas fa-thumbs-up"></i> Gerente
</a>
<a class="btn btn-warning btn-sm" href="_aprovar_usuario.php?id=<?php echo $id_usuario; ?>&nivel=2"
role="button"><i class="fas fa-thumbs-up"></i> Supervisor
</a>
<a class="btn btn-danger btn-sm" href="_deletar_usuario.php?id=<?php echo $id_usuario; ?>"
role="button"><i class="far fa-trash-alt"></i> Excluir
</a>
</td>
<?php } ?>
</tr>
</table>
</div>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
</body>
</html>