-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathproduto-formulario.php
49 lines (46 loc) · 1.28 KB
/
produto-formulario.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
<?php
include("include/cabecalho.php");
include("include/conexao.php");
include("include/banco-categoria.php");
$categorias = listaCategorias($conexao);
?>
<h1>Formulário de Cadastro</h1>
<form action="adiciona-produto.php" method="post">
<table class="table">
<tr>
<td>Nome:</td>
<td><input class="form-control" type="text" name="nome"/></td>
</tr>
<tr>
<td>Preço</td>
<td><input class="form-control" type="number" name="preco"/></td>
</tr>
<tr>
<td>Descrição</td>
<td><textarea class="form-control" name="descricao"></textarea></td>
</tr>
<tr>
<td></td>
<td>
<input type="checkbox" name="usado" value="true"> Usado
</td>
</tr>
<tr>
<td>Categorias</td>
<td>
<select class="form-control" name="categoria_id">
<?php foreach($categorias as $categoria) : ?>
<option value="<?= $categoria['id'] ?>">
<?= $categoria['nome'] ?><br>
</option>
<?php endforeach ?>
</select>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Cadastrar"></td>
</tr>
</table>
</form>
<?php include("include/rodape.php") ?>