/
v-clientes.php
42 lines (41 loc) · 1.25 KB
/
v-clientes.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
<? require('TiposClientes.php') ?>
<? require('Clientes.php') ?>
<? $loTiposClientes = new TiposClientes(); ?>
<? $loClientes = new Clientes(); ?>
<?
if ($_SERVER['REQUEST_METHOD'] === 'POST'){
$loClientes->setCliente($_POST);
}
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title>Trabalho</title>
</head>
<body>
<h1>Trabalho Joabe</h1>
<form action="" method="POST">
<fieldset>
<label>Nome:</label>
<input type="text" value="" id="nome" name="nome" />
<br/><br/>
<label>CPF:</label>
<input type="text" value="" id="cpf" name="cpf" />
<br/><br/>
<? $laTiposClientes = $loTiposClientes->getTiposClientes() ?>
<label>Tipo Cliente:</label>
<select id="tipoCliente" name="tipoCliente">
<? if(!empty($laTiposClientes)): ?>
<? foreach($laTiposClientes as $laTipoCliente): ?>
<option value="<?=$laTipoCliente['tipoCliente']?>"><?=$laTipoCliente['descricao']?></option>
<? endforeach; ?>
<? else: ?>
<option value="0">Nenhum cadastrado.</option>
<? endif; ?>
</select>
</fieldset>
<input type="submit" value="GRAVAR" />
</form>
</body>
</html>