-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditProd.php
48 lines (43 loc) · 1.12 KB
/
editProd.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
<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");
$mostrar = new Produtos();
$query = "SELECT * FROM produtos order by id desc";
$result = $mostrar->getData($query);
?>
<?php
require("topSite.html");
?>
<center>
<div class="container">
<table border="1">
<thead>
<tr>
<td>ID:</td>
<td>Produto</td>
<td>Descrição</td>
<td>Valor</td>
<td></td>
</tr>
</thead>
<form action="edit.php" method="POST">
<?php
foreach ($result as $res){
echo "<tr>";
echo "<td>".$res['id']."</td>";
echo "<td>".$res['nomeProd']."</td>";
echo "<td>".$res['descrProd']."</td>";
echo "<td>".$res['valorProd']."</td>";
echo "<td><input type='hidden' name='id' value='".$res['id']."'";
echo "<td><input type='submit' value='Editar'";
echo "</tr>";
}
?>
</form>
</table>
</div>
</center>