示例#1
0
<?php

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/>
        <?php 
$laTiposClientes = $loTiposClientes->getTiposClientes();
?>
        <label>Tipo Cliente:</label>
示例#2
0
</head>
<body>
<h1>Trabalho Joabe</h1>
<a href="/v-clientes.php">Novo Cliente</a>
<table>
    <thead>
    <tr>
        <th>Cliente</th>
        <th>Nome</th>
        <th>CPF</th>
        <th>Tipo Cliente</th>
    </tr>
    </thead>
    <tbody>
    <?php 
$loTiposClientes = new TiposClientes();
?>
    <?php 
if (!empty($laClientes)) {
    ?>
        <?php 
    foreach ($laClientes as $laCliente) {
        ?>
            <?php 
        $laTipoCliente = $loTiposClientes->getTipoCliente($laCliente['tipoCliente']);
        ?>
            <tr>
                <td><?php 
        echo $laCliente['cliente'];
        ?>
</td>