This repository has been archived by the owner on Dec 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
produto-formulario.php
executable file
·55 lines (47 loc) · 1.65 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
50
51
52
53
54
55
<?php
include("cabecalho.php");
include("conecta-banco.php");
include("banco-categoria.php");
$categorias = listaCategorias($conexao);
?>
<h2><strong>Formulário de produto</strong></h2>
<br/>
<form action="adiciona-produto.php" method="post">
<table class = "table table-hover table-bordered">
<tr>
<td>Nome:</td>
<td><input class="form-control" type="text" name="nome"><br/></td>
</tr>
<tr>
<td>Preco:</td>
<td>
<div class="input-group">
<span class="input-group-addon">R$</span>
<input type="number" class="form-control" aria-label="Amount (to the nearest dollar)" name="preco">
</div>
</td>
</tr>
<tr>
<td>Descrição:</td>
<td><textarea name="descricao" class="form-control"></textarea></td>
</tr>
<tr>
<td>Usado:</td>
<td><input type="checkbox" name="usado" value="true" class="pull-left"></td>
</tr>
<tr>
<td>Categoria:</td>
<td>
<select name="categoria_id" class="form-control">
<?php
foreach($categorias as $categoria) { ?>
<option value="<?=$categoria["id"]?>">
<?=$categoria["nome"]?><br/> </option>
<?php } ?>
</select>
</td>
</tr>
</table>
<button class="btn btn-primary btn-lg btn-block" type="submit">Cadastrar</button>
</form>
<?php include("rodape.php")?>