101 lines
5.5 KiB
PHP
101 lines
5.5 KiB
PHP
<!--Esta pagina recebera via GET uma parte do nome do cliente ou codigo do cliente e listará todas as entradas do banco com akeles criterios e retornara para a pagina ../Telas/locacao.php uma variavel nomeCliente contendo nome completo do cliente e codCliente contendo o codigo do cliente-->
|
|
<?php
|
|
//include '../Includes/valida_sessao.inc';
|
|
require_once("../Controle/ControleCliente.php");
|
|
$nome = $_GET["nome"];
|
|
$objCliente = new Cliente;
|
|
$objClientes = $objCliente->buscarPorNome($nome);
|
|
$contador = count($objClientes)
|
|
?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<link rel="stylesheet" type="text/css" href="../CSS/estilo.css" media="screen" />
|
|
|
|
<title>Listar Clientes</title>
|
|
<script language="javascript" type="text/javascript">
|
|
function mudar_cor_over(celula){
|
|
celula.style.backgroundColor = "#bbbbff"
|
|
}
|
|
function mudar_cor_out(celula){
|
|
celula.style.backgroundColor = "#ddddff"
|
|
}
|
|
function retorna(codCliente, nomeCliente) {
|
|
//alert("teste");
|
|
//window.opener.document.formOS.codCliente.value = codCliente; //a janela mãe recebe o id, você precisa passar o nome do formulario e do textfield que receberá o valor passado por parametro.
|
|
window.opener.document.formOS.cliente.value = codCliente;
|
|
window.opener.document.formOS.nomeCliente.value = nomeCliente;
|
|
window.close(); //fecha a janla popup
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
<div id="geral">
|
|
<div id="conteudo">
|
|
<?php
|
|
echo "<form action='../Telas/buscaClienteParaTermoCompromisso.php' method='get' name='frmBusca'>
|
|
<p>Cliente: <input name='nome' type='text' size='50'>
|
|
<input name='cmdBusca' type='submit' value='Procurar'></p>
|
|
</form><br />";
|
|
if ($nome != '') {
|
|
?>
|
|
<table cellspacing="2" cellpadding="2" class="list">
|
|
<tr>
|
|
<th width="18%" class="titulo">Nome</th>
|
|
<th width="26%" class="titulo">Endereço</th>
|
|
<th width="6%" class="titulo">Telefone</th>
|
|
<th width="6%" class="titulo">Celular</th>
|
|
<th width="11%" class="titulo">Email</th>
|
|
<th width="5%" class="titulo">Data de Nascimento</th>
|
|
<th width="5%" class="titulo">Ações</th>
|
|
</tr>
|
|
<?php
|
|
for ($x = 0; $x < $contador; $x++) {
|
|
$objCliente = $objClientes[$x];
|
|
?>
|
|
<tr id="<?php echo $objCliente->get('codCliente') ?>" onmouseover="mudar_cor_over(this)" onmouseout="mudar_cor_out(this)">
|
|
<td>
|
|
<big><a href="javascript:retorna('<?php echo $objCliente->get('codCliente'); ?>', '<?php echo $objCliente->get('nome'); ?>')"</a></big>
|
|
<?php echo $objCliente->get('nome'); ?>
|
|
</td>
|
|
<td><?php echo $objCliente->get('logradouro') . " " . $objCliente->get('numero') . ", " . $objCliente->get('bairro') . ", " . $objCliente->get('cidade') ?></td>
|
|
<td><?php echo $objCliente->get('telefone') ?></td>
|
|
<td><?php echo $objCliente->get('celular') ?></td>
|
|
<td><?php echo $objCliente->get('email') ?></td>
|
|
<td><?php echo $objCliente->get('datNascimento') ?></td>
|
|
|
|
<td>
|
|
<table class="acao">
|
|
<tr>
|
|
<form id="alterar" name="alterar" method="post" action="altCliente.php">
|
|
<td width="50%">
|
|
<input name="codCliente" type="hidden" id="codCliente" value="<?php echo $objCliente->get('codCliente'); ?>" />
|
|
<input type="image" src="../Imagens/alterar.png" name="Submit" value="Alterar" />
|
|
</td>
|
|
</form>
|
|
<form id="excluir" name="excluir" method="post" action="excCliente.php">
|
|
<td width="50%">
|
|
<input name="codCliente" type="hidden" id="codCliente" value="<?php echo $objCliente->get('codCliente'); ?>" />
|
|
<input type="image" src="../Imagens/excluir.png" name="Submit2" value="Excluir" />
|
|
</td>
|
|
</form>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</table>
|
|
<?php
|
|
}
|
|
?>
|
|
</div> <!--FIM DA DIV CONTEUDO-->
|
|
</div>
|
|
</body>
|
|
</html>
|
|
|