-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
77 lines (70 loc) · 2.77 KB
/
admin.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
<?php
require "src/conexao-bd.php";
require "src/Model/Produto.php";
require "src/Repository/ProdutoRepositorio.php";
$produtoRepositorio = new ProdutoRepositorio($pdo);
$produtos = $produtoRepositorio->buscarTodos();
?>
<!doctype html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/admin.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="icon" href="img/icone-serenatto.png" type="image/x-icon">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;900&display=swap"
rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&display=swap" rel="stylesheet">
<title>Serenatto - Admin</title>
</head>
<body>
<main>
<section class="container-admin-banner">
<img src="img/logo-serenatto-horizontal.png" class="logo-admin" alt="logo-serenatto">
<h1>Admistração Serenatto</h1>
<img class="ornaments" src="img/ornaments-coffee.png" alt="ornaments">
</section>
<h2>Lista de Produtos</h2>
<section class="container-table">
<table>
<thead>
<tr>
<th>Produto</th>
<th>Tipo</th>
<th>Descricão</th>
<th>Valor</th>
<th colspan="2">Ação</th>
</tr>
</thead>
<tbody>
<?php foreach ($produtos as $produto): ?>
<tr>
<td><?= $produto->getNome() ?></td>
<td><?= $produto->getTipo() ?></td>
<td><?= $produto->getDescricao() ?></td>
<td><?= $produto->getPrecoFormatado() ?></td>
<td><a class="botao-editar" href="editar-produto.php?id=<?= $produto->getId() ?>">Editar</a></td>
<td>
<form action="excluir-produto.php" method="post">
<input type="hidden" name="id" value="<?= $produto->getId() ?>">
<input type="submit" class="botao-excluir" value="Excluir">
</form>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<a class="botao-cadastrar" href="cadastrar-produto.php">Cadastrar produto</a>
<form action="gerador-pdf.php" method="post">
<input type="submit" class="botao-cadastrar" value="Baixar Relatório" />
</form>
</section>
</main>
</body>
</html>