-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusuarios.php
More file actions
92 lines (66 loc) · 2.95 KB
/
usuarios.php
File metadata and controls
92 lines (66 loc) · 2.95 KB
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
91
92
<?php
require_once 'includes/config.php';
require_once 'header.php';
?>
<script type="text/javascript">
function deleteUsuario(p_id) {
if(confirm("Tem certeza que deseja apagar o usuario?")) {
var action = '/actions/deleteUsuario.php';
var form_data = {
id: p_id
};
$.ajax({
type: "POST",
url: action,
data: form_data,
success: function(response)
{
location.reload();
}
});
}
}
</script>
<div class="main">
<div class="speedbar">
<div class="speedbar-nav">Cadastro Famílias</div>
</div>
<?php
$sql = 'SELECT username, nome, case isadmin when "S" then "Sim" else "Não" end as admin, case isAnalista when "S" then "Sim" else "Não" end as analista, case status when "A" then "Ativo" else "Inativo" end status FROM usuarios';
$result = $db->query($sql);
?>
<!--Table Styling-->
<div class="grid-1">
<div class="title-grid">Usuários</div>
<div class="content-gird">
<table class="display" id="example">
<thead>
<tr>
<th class="th_id">Usuário</th>
<th class="th_status">Nome</th>
<th class="th_date">Administrador</th>
<th class="th_date">Analista</th>
<th class="th_date">Status</th>
<th class="th_chexbox"> </th>
</tr>
</thead>
<tbody>
<?php
while ($row = $result->fetch_assoc()) { ?>
<tr class="item">
<td class="subject"><a href="addUsuario.php?id=<?=$row['username']?>"><?=$row['username']?></a></td>
<td><span class="published"><?=$row['nome']?></span></td>
<td><?=$row['admin']?></td>
<td><?=$row['analista']?></td>
<td><?=$row['status']?></td>
<td class="action"><a href="#"><img onclick="deleteUsuario('<?=$row['username']?>');" src="images/del.png" alt="delete"></a></td>
</tr>
<?php } ?>
</table>
<div class="clear"> </div>
</div>
</div>
</div><!-- END MAIN-->
<?php
require_once 'barralateral.php';
require_once 'footer.php';