-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduto-formulario-base.php
67 lines (67 loc) · 2.99 KB
/
produto-formulario-base.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
56
57
58
59
60
61
62
63
64
65
66
67
<tr>
<td>Código do Produto</td>
<td><input type="number" name="codigoDoProduto" class="form-control" value="<?=$produto['codigoDoProduto']?>"></td>
</tr>
<tr>
<td>Nome</td>
<td> <input class="form-control" type="text" name="nomeDoProduto" value="<?=$produto['produto']?>"></td>
</tr>
<tr>
<td>Preço de Custo</td>
<td><input type="number" name="precoDeCusto" class="form-control"
value="<?=$produto['precoDeCusto']?>"></td>
</tr>
<tr>
<td>Preço de Venda</td>
<td><input class="form-control" type="number" name="precoDeVenda"
value="<?=$produto['precoDeVenda']?>"></td>
</tr>
<tr>
<td>Tipo de Volume</td>
<td>
<select name="tipoDeVolume_id" class="form-control">
<?php foreach($tiposDeVolume as $tipoDeVolume) :
$essaEhACategoria = $produto['tipoDeVolume_id'] == $tipoDeVolume['id'];
$selecao = $essaEhOTipoDeVolume? "selected='selected'" : "";
?>
<option value="<?=$tipoDeVolume['id']?>" <?=$selecao?>>
<?=$tipoDeVolume['volume']?>
</option>
<?php endforeach ?>
</select>
</td>
</tr>
<tr>
<td>Quantidade</td>
<td><input type="number" name="quantidade" class="form-control"
value="<?=$produto['quantidade']?>"></td>
</tr>
<tr>
<td>Data de Validade</td>
<td><<input type="date"name="dataDeValidade" class="form-control"
value="<?=$produto['dataDeValidade']?>"></td>
</tr>
<tr>
<td>Categoria</td>
<td>
<select name="categoria_id" class="form-control">
<?php foreach($categorias as $categoria) :
$essaEhACategoria = $produto['categoria_id'] == $categoria['id'];
$selecao = $essaEhACategoria ? "selected='selected'" : "";
?>
<option value="<?=$categoria['id']?>" <?=$selecao?>>
<?=$categoria['categoria']?>
</option>
<?php endforeach ?>
</select>
</td>
</tr>
<tr>
<td>Código de Barra</td>
<td><input type="number" name="codigoDeBarra" class="form-control"
value="<?=$produto['codigoDeBarra']?>"></td>
</tr>
<tr>
<td>Descrição</td>
<td><textarea class="form-control" name="descricao"><?=$produto['descricao']?></textarea></td>
</tr>