function listar() { require_once 'mvc/model/dao/ClienteDAO.php'; require_once 'mvc/model/dao/ProdutoDAO.php'; $clienteDAO = new ClienteDAO(); $produtoDAO = new ProdutoDAO(); $clientes = $clienteDAO->listar(); $produtos = $produtoDAO->listar(); $pedidos = $this->pedidoDAO->listar(); $_REQUEST['pedidos'] = $pedidos; $_REQUEST['produtos'] = $produtos; $_REQUEST['clientes'] = $clientes; $_REQUEST['body'] = "{$this->dir}/listaPedidos"; require_once 'template.php'; }
<h4>Listagem de Clientes</h4> </caption> <thead> <tr> <th>Id</th> <th>Nome</th> <th>Telefone</th> <th>Data Nascimento</th> <th colspan="2">Ações <a href="cliente.php?op=I" class="btn btn-success">Novo</a></th> </tr> </thead> <tbody> <?php $dao = new ClienteDAO(new Cliente()); $tabela = $dao->listar(); foreach ($tabela as $row) { $cli = new Cliente($row); ?> <tr> <td><?php echo $cli->__get('id'); ?> </td> <td><a href="../controller/clienteController.php?op=U&id=<?php echo $cli->__get('id'); ?> "><?php echo $cli->__get('nome'); ?> </a></td>