-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelProduto.php
54 lines (46 loc) · 1.32 KB
/
delProduto.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
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css">
</head>
</html>
<?php
require("classes/Produtos.class.php");
$produto = new Produtos();
$query = "SELECT * FROM produtos ORDER BY id desc";
$result = $produto->getData($query);
?>
<?php
require("topSite.html");
?>
<div class="container">
<form action="del.php" method="POST">
<table>
<thead>
<tr>
<td>ID</td>
<td>Produto</td>
<td>Descrição</td>
<td>Valor</td>
<td></td>
</tr>
</thead>
<?php
foreach($result as $res){
$id = $res['id'];
$nomeProd = $res['nomeProd'];
$descrProd = $res['descrProd'];
$valorProd = $res['valorProd'];
?>
<tr>
<td><?php echo $id; ?></td>
<td><?php echo $nomeProd; ?></td>
<td><?php echo $descrProd; ?></td>
<td><?php echo $valorProd; ?></td>
<td><input type="hidden" name="id" value="<?php echo $id; ?>"></td>
<td><input type="submit" value="Deletar"></td>
</tr>
<?php }?>
</table>
</div>
</body>
</table>