-
Notifications
You must be signed in to change notification settings - Fork 0
/
users.php
200 lines (186 loc) · 10 KB
/
users.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<?php
ob_start(); //ARMAZENA MEUS DADOS EM CACHE
session_start(); //INICIA A SESSÃO
if(!isset($_SESSION['username']) && (!isset($_SESSION['passUser']))){
header("Location: index.php?acao=negado");
exit;
}
include_once('config/sair.php');
?>
<!doctype html>
<html class="no-js h-100" lang="pt-br">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Sistema De Estoque | Budega Da Informática</title>
<link rel="website icon" type="png" href="images/php-icon.png">
<meta name="description" content="A high-quality & free Bootstrap admin dashboard template pack that comes with lots of templates and components.">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" id="main-stylesheet" data-version="1.1.0" href="styles/shards-dashboards.1.1.0.min.css">
<link rel="stylesheet" href="styles/extras.1.1.0.min.css">
<script async defer src="https://buttons.github.io/buttons.js"></script>
<script src="https://kit.fontawesome.com/1e32b8079d.js" crossorigin="anonymous"></script>
</head>
<body class="h-100">
<div class="container-fluid">
<div class="row">
<!-- Main Sidebar -->
<aside class="main-sidebar col-12 col-md-3 col-lg-2 px-0">
<div class="main-navbar">
<nav class="navbar align-items-stretch navbar-light bg-white flex-md-nowrap border-bottom p-0">
<a class="navbar-brand w-100 mr-0" href="#" style="line-height: 25px;">
<div class="d-table m-auto">
<img id="main-logo" class="d-inline-block align-top mr-1" style="max-width: 25px;" src="images/shards-dashboards-logo.svg" alt="Shards Dashboard">
<span class="d-none d-md-inline ml-1">Budega Da Informática </span>
</div>
</a>
<a class="toggle-sidebar d-sm-inline d-md-none d-lg-none">
<i class="material-icons"></i>
</a>
</nav>
</div>
<div class="nav-wrapper">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link " href="home.php">
<i class="fa-sharp fa-solid fa-house"></i>
<span>Página Principal</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="users.php">
<i class="fa-sharp fa-solid fa-users"></i>
<span>Tablela usuários</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="tables.php">
<i class="material-icons">table_chart</i>
<span>Tablela de serviços</span>
</a>
</li>
</ul>
</div>
</aside>
<!-- End Main Sidebar -->
<main class="main-content col-lg-10 col-md-9 col-sm-12 p-0 offset-lg-2 offset-md-3">
<div class="main-navbar sticky-top bg-white">
<!-- Main Navbar -->
<nav class="navbar align-items-stretch navbar-light flex-md-nowrap p-0">
<div class="main-navbar__search w-100 d-none d-md-flex d-lg-flex">
</div>
<ul class="navbar-nav border-left flex-row ">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle text-nowrap px-3" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
<img class="user-avatar rounded-circle mr-2" src="images/avatars/1.jpg" alt="User Avatar">
<span class="d-none d-md-inline-block"><?php echo $_SESSION['username'];?></span>
</a>
<div class="dropdown-menu dropdown-menu-small">
<a class="dropdown-item" href="perfil.php">
<i class="material-icons"></i> Perfil</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-danger" href="?sair">
<i class="material-icons text-danger"></i> Sair </a>
</div>
</li>
</ul>
<nav class="nav">
<a href="#" class="nav-link nav-link-icon toggle-sidebar d-md-inline d-lg-none text-center border-left" data-toggle="collapse" data-target=".header-navbar" aria-expanded="false" aria-controls="header-navbar">
<i class="material-icons"></i>
</a>
</nav>
</nav>
</div>
<!-- / .main-navbar -->
<div class="main-content-container container-fluid px-4">
<!-- Page Header -->
<div class="page-header row no-gutters py-4">
<div class="col-12 col-sm-4 text-center text-sm-left mb-0">
<span class="text-uppercase page-subtitle">Sistema de estoque</span>
<h3 class="page-title">Usuários cadastrados</h3>
</div>
</div>
<!-- End Page Header -->
<!-- Default Light Table -->
<div class="row">
<div class="col">
<div class="card card-small mb-4">
<div class="card-header border-bottom">
<h6 class="m-0">Usuários</h6>
</div>
<div class="card-body p-0 pb-3 text-center">
<table class="table mb-0">
<thead class="bg-light">
<tr>
<th scope="col" class="border-0">#</th>
<th scope="col" class="border-0">Nome Completo</th>
<th scope="col" class="border-0">Username</th>
<th scope="col" class="border-0">Contato</th>
<th scope="col" class="border-0">E-mail</th>
<th scope="col" class="border-0">Senha</th>
<th scope="col" class="border-0">Ação</th>
</tr>
</thead>
<tbody>
<?php
include_once('config/conexao.php');
$select = "SELECT * FROM tbusers ORDER BY idUser";
try{
$resultado = $conect->prepare($select);
$resultado->execute();
$contar = $resultado->rowCount();
if($contar > 0){
while($show = $resultado->FETCH(PDO::FETCH_OBJ)){
?>
<tr>
<td><?php echo $show->idUser;?></td>
<td><?php echo $show->nameUser;?></td>
<td><?php echo $show->username;?></td>
<td><?php echo $show->telUser;?></td>
<td><?php echo $show->emailUser;?></td>
<td><?php echo $show->passUser;?></td>
<td>
<a href="user-profile-lite.php?id=<?php echo $show->idUser;?>" class="btn btn-success">Up</a>
<a href="config/delete-user.php?idDel=<?php echo $show->idUser;?>" title="Remover" class="btn btn-danger">Dn</a>
</td>
</tr>
<?php
}
}else{
echo '<div class="alert alert-danger" role="alert">
<strong>OPS não há registros no momento, verifique sua tabela!</strong>
</div>';
}
}catch (PDOException $e){
echo "<p>ERRO DE PDO = </p>".$e->getMessage();
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- End Default Light Table -->
</div>
<footer class="main-footer d-flex p-2 px-3 bg-white border-top">
<span class="copyright ml-auto my-auto mr-2">© Todos os direitos reservados
<a href="#" rel="nofollow">2023</a>
</span>
</footer>
</main>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script>
<script src="https://unpkg.com/shards-ui@latest/dist/js/shards.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Sharrre/2.0.1/jquery.sharrre.min.js"></script>
<script src="scripts/extras.1.1.0.min.js"></script>
<script src="scripts/shards-dashboards.1.1.0.min.js"></script>
</body>
</html>