-
Notifications
You must be signed in to change notification settings - Fork 0
/
produto-formulario.php
43 lines (40 loc) · 1.3 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
<?php include("cabecalho.php");
include("conecta.php");
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
</tr>
<tr>
<td>Categoria</td>
<td>
<select class="form-control" name="categoria_id">
<?php foreach($categorias as $categoria) : ?>
<option value="<?=$categoria['id']?>"><?=$categoria['nome']?></option>
<?php endforeach ?>
</select>
</td>
</tr>
<tr>
<td><button class="btn btn-primary" type="submit">Cadastrar</button></td>
</tr>
</table>
</form>
<?php include("rodape.php"); ?>