-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadm.php
418 lines (398 loc) · 20.7 KB
/
adm.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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
<?php
session_start();
// Confere se o usuário está logado
if(!$_SESSION['valid']){
header('Location: ./server/login.php');
}
// logout
if(isset($_POST['logout'])){
session_destroy();
header('Location: ./server/login.php');
}
?>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="./styles/adm.css">
<title>Cartas Radioativas - Adm</title>
</head>
<body>
<div class="container">
<div class="header mt-3">
<h1 class="me-4">Cartas Radioativas - Administração</h1>
<form class="" method="post" action="">
<div id="div_login">
<input type="submit" class="btn btn-secondary" value="Logout" name="logout" id="logout" />
</div>
</form>
</div>
<div class="row cartas pesquisa">
<h2 class="titulo">Pesquisar cartas</h2>
<div class="col-12">
<input class="form-control mb-3" type="text" name="campo-pesquisa" id="campo-pesquisa" placeholder="Digite aqui...">
</div>
<div class="col">
<div class="area-titulo-tabela">
<h3>Cartas Brancas <span class="qtd-brancas badge bg-secondary"><span class="qtd">0</span></span>
</h3>
</div>
<div class="area-tabela cartas-brancas">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" class="col-texto">Texto</th>
<th scope="col" class="col-categoria">Categoria</th>
<th scope="col" class="col-btn"></th>
</tr>
</thead>
<tbody class="corpo-tabela-brancas"></tbody>
</table>
</div>
</div>
<div class="col">
<div class="area-titulo-tabela">
<h3>Cartas Pretas <span class="qtd-pretas badge bg-secondary"><span class="qtd">0</span></span>
</h3>
</div>
<div class="area-tabela cartas-pretas">
<table class="table table-dark table-hover">
<thead>
<tr>
<th scope="col" class="col-texto">Texto</th>
<th scope="col" class="col-categoria">Categoria</th>
<th scope="col" class="col-btn"></th>
</tr>
</thead>
<tbody class="corpo-tabela-pretas"></tbody>
</table>
</div>
</div>
</div>
<div class="row cartas triagem">
<h2 class="titulo">Aprovar cartas</h2>
<div class="col">
<div class="area-titulo-tabela">
<h3>Cartas Brancas <span class="qtd-brancas badge bg-secondary"><span class="qtd">0</span></span>
</h3>
</div>
<div class="area-tabela cartas-brancas">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" class="col-texto">Texto</th>
<th scope="col" class="col-categoria">Categoria</th>
<th scope="col" class="col-btn"></th>
</tr>
</thead>
<tbody class="corpo-tabela-brancas"></tbody>
</table>
</div>
</div>
<div class="col">
<div class="area-titulo-tabela">
<h3>Cartas Pretas <span class="qtd-pretas badge bg-secondary"><span class="qtd">0</span></span>
</h3>
</div>
<div class="area-tabela cartas-pretas">
<table class="table table-dark table-hover">
<thead>
<tr>
<th scope="col" class="col-texto">Texto</th>
<th scope="col" class="col-categoria">Categoria</th>
<th scope="col" class="col-btn"></th>
</tr>
</thead>
<tbody class="corpo-tabela-pretas"></tbody>
</table>
</div>
</div>
</div>
<div class="row cartas adicionar-cartas">
<h2 class="titulo">Adicionar cartas</h2>
<div class="col">
<div class="area-titulo-tabela">
<h3>Cartas Brancas <span class="qtd-brancas badge bg-secondary"><span class="qtd">0</span></span>
</h3>
</div>
<div class="area-tabela cartas-brancas">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" class="col-texto">Texto</th>
<th scope="col" class="col-categoria">Categoria</th>
</tr>
</thead>
<tbody class="corpo-tabela-brancas">
<tr class="linha-nova-carta" tipo="b">
<th scope="col" class="col-texto">
<input class="form-control campo-nova-carta" type="text" name="campo-nova-carta" placeholder="Digite aqui..."></input>
</th>
<th scope="col" class="col-categoria">
<select class="form-control select-categorias"></select>
</th>
</tr>
</tbody>
</table>
<div class="d-grid">
<button type="button" class="btn btn-primary mais-carta" tipo="brancas">+</button>
</div>
</div>
</div>
<div class="col">
<div class="area-titulo-tabela">
<h3>Cartas Pretas <span class="qtd-pretas badge bg-secondary"><span class="qtd">0</span></span>
</h3>
</div>
<div class="area-tabela cartas-pretas">
<table class="table table-dark table-hover">
<thead>
<tr>
<th scope="col" class="col-texto">Texto</th>
<th scope="col" class="col-categoria">Categoria</th>
</tr>
</thead>
<tbody class="corpo-tabela-pretas">
<tr class="linha-nova-carta" tipo="p">
<th scope="col" class="col-texto">
<input class="form-control campo-nova-carta" type="text" name="campo-nova-carta" placeholder="Digite aqui..."></input>
</th>
<th scope="col" class="col-categoria">
<select class="form-control select-categorias"></select>
</th>
</tr>
</tbody>
</table>
<div class="d-grid">
<button type="button" class="btn btn-primary mais-carta" tipo="pretas">+</button>
</div>
</div>
</div>
<div class="d-grid">
<button type="button" id="btn-salva-novas-cartas" class="btn btn-primary mt-3">Salvar cartas</button>
</div>
</div>
<div class="row mensagens">
<h2 class="titulo">Mensagens <span class="qtd-mensagens badge bg-secondary"><span class="qtd">0</span></span>
</h2>
<div class="col lista-mensagens">
<div class="area-tabela">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" class="col-texto">Data</th>
<th scope="col" class="col-categoria">Texto</th>
<th scope="col" class="col-btn"></th>
</tr>
</thead>
<tbody id="corpo-tabela-mensagens"></tbody>
</table>
</div>
</div>
<div class="col texto-mensagem">
<div class="mensagem-btns">
<button type="button" id="btn-apagar" class="btn btn-secondary btn-sm">Apagar</button>
<button type="button" id="btn-marcarnaolida" class="btn btn-secondary btn-sm">Marcar como não lida</button>
</div>
<div class="area-mensagem">
<textarea name="corpo-mensagem" id="corpo-mensagem" cols="30 " rows="10 "></textarea>
</div>
</div>
</div>
<div class="row cartas todas">
<h2 class="titulo">Alterar cartas</h2>
<div class="col-12 text-center mt-2 mb-3">
<div id="botoes-categorias" class="btn-group" role="group" aria-label="Basic checkbox toggle button group"></div>
</div>
<div class="col">
<div class="area-titulo-tabela">
<h3>Cartas Brancas <span class="qtd-brancas badge bg-secondary"><span class="qtd">0</span></span>
</h3>
</div>
<div class="area-tabela cartas-brancas">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" class="col-texto">Texto</th>
<th scope="col" class="col-categoria">Categoria</th>
<th scope="col" class="col-btn"></th>
</tr>
</thead>
<tbody class="corpo-tabela-brancas"></tbody>
</table>
</div>
</div>
<div class="col">
<div class="area-titulo-tabela">
<h3>Cartas Pretas <span class="qtd-pretas badge bg-secondary"><span class="qtd">0</span></span>
</h3>
</div>
<div class="area-tabela cartas-pretas">
<table class="table table-dark table-hover">
<thead>
<tr>
<th scope="col" class="col-texto">Texto</th>
<th scope="col" class="col-categoria">Categoria</th>
<th scope="col" class="col-btn"></th>
</tr>
</thead>
<tbody class="corpo-tabela-pretas"></tbody>
</table>
</div>
</div>
</div>
<div class="row outros">
<h2 class="titulo">Outros</h2>
<div class="col-6 lista-categorias">
<div class="area-titulo d-inline-flex align-items-center">
<h3 class="">Categorias</h3>
<button type="button" id="adicionar-categoria" class="btn btn-secondary btn-sm ms-3">+</button>
</div>
<div class="area-tabela">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" class="col-cat">Categoria</th>
<th scope="col" class="col-icone">Icone</th>
<th scope="col" class="col-qtd-cat">Qtd</th>
<th scope="col" class="col-btn"></th>
</tr>
</thead>
<tbody id="corpo-tabela-categorias"></tbody>
</table>
</div>
</div>
<div class="col-6 lista-icones">
<div class="area-titulo d-inline-flex align-items-center">
<h3>Ícones</h3>
<button type="button" id="adicionar-icones" class="btn btn-secondary btn-sm ms-3">+</button>
</div>
<div class="area-icones row">
</div>
</div>
</div>
*Se tiver dando muito erro de BD por estar acessando uma por uma, refatorar o código para acumular as ações e fazer tudo de uma só vez!
</div>
<!-- MODAL TROCA TEXTO CARTAS -->
<div id="modal-troca-texto" class="modal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Trocar o texto da carta</h5>
<button type="button" class="btn-close " data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form>
<div class="mb-3">
<label id="label-texto-novo" for="texto-novo" class="col-form-label"></label>
<input type="text" class="form-control" id="texto-novo">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
<button type="button" class="btn btn-primary btn-trocar">Trocar</button>
</div>
</div>
</div>
</div>
<!-- MODAL TROCA CATEGORIA CARTAS -->
<div id="modal-troca-categoria" class="modal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Trocar a categoria da carta</h5>
<button type="button" class="btn-close " data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form>
<div class="mb-3">
<label id="label-categoria-nova" for="select-categorias" class="form-label"></label>
<select id="select-categorias" class="form-select" aria-label="Select de categorias"></select>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
<button type="button" class="btn btn-primary btn-trocar">Trocar</button>
</div>
</div>
</div>
</div>
<!-- MODAL ICONES -->
<div id="modal-icones" class="modal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Adicionar ícones</h5>
<button type="button" class="btn-close " data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-9 mb-3">
<label for="input-icone-branco" class="form-label">Ícone preto</label>
<input class="form-control input-icone" preview="#icone-branco-preview" type="file" id="input-icone-branco">
</div>
<div class="col-3">
<div class="area-icone-preview preto">
<img id="icone-branco-preview" class="icone-preview" accept=".png">
</div>
</div>
</div>
<div class="row">
<div class="col-9 mb-3">
<label for="input-icone-preto" class="form-label">Ícone branco</label>
<input class="form-control input-icone" preview="#icone-preto-preview" type="file" id="input-icone-preto">
</div>
<div class="col-3">
<div class="area-icone-preview branco">
<img id="icone-preto-preview" class="icone-preview" accept="*-branco.png" accept=".png">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
<button type="button" class="btn btn-primary btn-adicionar">Adicionar Ícones</button>
</div>
</div>
</div>
</div>
<!-- MODAL PARA ESCOLHER O ICONE DA CATEGORIA -->
<div id="modal-escolhe-icone" class="modal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Escolher ícone</h5>
<button type="button" class="btn-close " data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="area-icones row">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
<button type="button" class="btn btn-primary btn-adicionar">Escolher ícone</button>
</div>
</div>
</div>
</div>
<!-- Toast de mensagens -->
<div class="position-fixed bottom-0 end-0 p-3" style="z-index: 11">
<div class="toast align-items-center text-white border-0" role="alert" aria-live="assertive" aria-atomic="true">
<div class="d-flex">
<div class="toast-body"></div>
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
</div>
</div>
<script src="./js/plugins/jquery-3.6.0.min.js"></script>
<script src="./js/plugins/bootstrap.min.js"></script>
<script src="./js/plugins/dayjs/dayjs.min.js"></script>
<script src="./js/plugins/dayjs/relativeTime.js"></script>
<script src="./js/plugins/dayjs/pt-br.min.js"></script>
<script src="./js/adm.js"></script>
</body>