Arquivos já criados em sala

This commit is contained in:
2026-04-07 20:57:21 -03:00
parent d8cde2eb68
commit 37f5b39995
29 changed files with 2858 additions and 0 deletions

View File

@@ -0,0 +1,284 @@
<?php
//include '../Includes/valida_sessao.inc';
require_once("../Controle/ControleCliente.php");
$objCliente = new Cliente;
$objCliente = $objCliente->buscarPorId($_POST['codCliente']);
/*require_once ("../Controle/ControleEstado.php");
$objEstado = new Estado;
$objEstados = $objEstado->buscarTodos();
$contadorEstado = count($objEstados);
require_once ("../Controle/ControleCidade.php");
$objCidade = new Cidade;
$objCidades = $objCidade->buscarTodos();
$contadorCidade = count($objCidades);
*/
?>
<!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>Alteração de Cliente</title>
<script language="JavaScript" type="text/javascript" src="../Js/ajaxInit.js"></script>
<script src="../AJAX/BibliotecaAJAX.js"></script>
<script language="JavaScript" type="text/javascript">
$(document).ready(function() {
$('input').keypress(function(e) {
var code = null;
code = (e.keyCode ? e.keyCode : e.which);
return (code == 13) ? false : true;
});
});
function voltar(){
location.href = 'listCliente.php';
}
function mascaraTel(telefone){
if(telefone.value.length == '0'){
document.form.telefone.value = '(' + telefone.value;
}
if(telefone.value.length == '3'){
document.form.telefone.value = telefone.value + ') ';
}
if(telefone.value.length == '9'){
document.form.telefone.value = telefone.value + '-';
}
}
function mascaraCel(celular){
if(celular.value.length == '0'){
document.form.celular.value = '(' + celular.value;
}
if(celular.value.length == '3'){
document.form.celular.value = celular.value + ') ';
}
if(celular.value.length == '9'){
document.form.celular.value = celular.value + '-';
}
}
function mascaraCPF(cpf){
if(cpf.value.length == '3'){
document.form.cpf.value = cpf.value + '.';
}
if(cpf.value.length == '7'){
document.form.cpf.value = cpf.value + '.';
}
if(cpf.value.length == '11'){
document.form.cpf.value = cpf.value + '-';
}
}
function mascaraCEP(cep){
if(cep.value.length == '2'){
document.form.cep.value = cep.value + '.';
}
if(cep.value.length == '6'){
document.form.cep.value = cep.value + '-';
}
}
function mascaraData(datNascimento){
if(datNascimento.value.length == '2'){
document.form.datNascimento.value = datNascimento.value + '/';
}
if(datNascimento.value.length == '5'){
document.form.datNascimento.value = datNascimento.value + '/';
}
}
//AJAX DAS CIDADES
function selecionaCidade() {
// //alert("alterou estado");
objHTTPRequest = ajaxInit();
if(objHTTPRequest){
// //alert("criou httprequest");
document.getElementById("caixaCidade").innerHTML = "<select name=\"cidade\" id=\"cidade\" disabled=\"disabled\"><option value=\"Todos\" selected=\"selected\">Carregando...</option></select>";
var estado = document.getElementById("estado").value;
var cidade = encodeURI("<?php echo $objCliente->get('cidade'); ?>");
objHTTPRequest.onreadystatechange = escreveCidades;
var url = "../Js/CidadesAjax.php?estado=" + estado + "&cidade=" + cidade;
// //alert(url);
objHTTPRequest.open('GET', url, true);
objHTTPRequest.send(null);
}
}
function escreveCidades() {
if(objHTTPRequest.readyState == 0) {
document.getElementById("carregando").innerHTML = "<img src=\"../Imagens/spinner_small.gif\" />";
}
if(objHTTPRequest.readyState == 1) {
document.getElementById("carregando").innerHTML = "<img src=\"../Imagens/spinner_small.gif\" />";
}
if(objHTTPRequest.readyState == 2) {
document.getElementById("carregando").innerHTML = "<img src=\"../Imagens/spinner_small.gif\" />";
}
if(objHTTPRequest.readyState == 3) {
document.getElementById("carregando").innerHTML = "<img src=\"../Imagens/spinner_small.gif\" />";
}
if(objHTTPRequest.readyState == 4) {
if (objHTTPRequest.status == 200) {
document.getElementById("caixaCidade").innerHTML = objHTTPRequest.responseText;
document.getElementById("carregando").innerHTML = "";
}
}
}
function contOBS(qtCaracteres){
if (qtCaracteres > 1000){
document.getElementById("contOBS").innerHTML = (1000 - qtCaracteres) * (-1) + " caracteres excedidos";
}else{
document.getElementById("contOBS").innerHTML = 1000 - qtCaracteres + " caracteres restantes";
}
}
function buscaAJAX(busca, idResultado){
////busca é o atributo informado para buscaAJAX.php
//idResultado é o id do elemento que receberá a resposta.
$('#' + idResultado).html('<progress></progress>');
$('#' + idResultado).load("../AJAX/verificaCPF.php?campo1=" + busca, "",
function(responseText, textStatus, XMLHttpRequest) {
if(textStatus == 'error') {
$('#' + idResultado).html('<font color="red">(Erro de conexão com servidor. Tente novamente)</font>');
}
}
);
}
</script>
</head>
<body onload="selecionaCidade();">
<div id="menuInterno">
<?php
include '../Includes/MenuPrincipal.php';
?>
</div>
<div id="geral">
<div id="topo">
<div id="rodape">
</div>
</div>
<div id="conteudo">
<form id="form" name="form" method="post" action="../FilesOk/altClienteOK.php">
<div id="menuInterno">
<input type="submit" name="Submit" value="Alterar" class="gmailButton"/>
<input type="button" name="Submit2" value="Voltar" onclick="voltar()" class="gmailButton"/>
</div>
<table class="list">
<tr>
<td width="17%">Nome:</td>
<td width="36%">
<input name="nome" type="text" id="nome" value="<?php echo $objCliente->get('nome'); ?>" size="45" maxlength="45" />
<input name="codCliente" type="hidden" id="codCliente" value="<?php echo $_POST['codCliente']; ?>" />
</td>
<td width="9%">CPF:</td>
<td width="38%">
<input name="cpf" type="text" id="cpf" value="<?php echo $objCliente->get('cpf'); ?>" size="14" maxlength="14" onkeypress="mascaraCPF(this);" onblur="buscaAJAX(this.value, 'infoCPF');" />
<span id="infoCPF"></span>
</td>
</tr>
<tr>
<td>Logradouro:</td>
<td><input name="logradouro" type="text" id="logradouro" value="<?php echo $objCliente->get('logradouro'); ?>" size="45" maxlength="45" /></td>
<td>Número:</td>
<td><input name="numero" type="text" id="numero" value="<?php echo $objCliente->get('numero'); ?>" size="10" maxlength="10" /></td>
</tr>
<tr>
<td>Bairro:</td>
<td><input name="bairro" type="text" id="bairro" value="<?php echo $objCliente->get('bairro'); ?>" size="45" maxlength="45" /></td>
<td>Estado:</td>
<td><select name="estado" id="estado" onchange="selecionaCidade();">
<?php
for ($x = 0; $x < $contadorEstado; $x++) {
$objEstado = $objEstados[$x];
?>
<option value="<?php echo $objEstado->get('uf'); ?>" <?php
if ($objEstado->get('uf') == $objCliente->get("estado")) {
echo ('selected="selected"');
}
?>><?php echo $objEstado->get('nome'); ?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>Cidade:</td>
<td><label id="caixaCidade">
<select name="cidade" id="cidade" disabled="disabled">
<option value="Todos" selected="selected">Carregando...</option>
</select>
</label><label id="carregando"><img src="../Imagens/spinner_small.gif" width="16" height="16" /></label>
</td>
<td>Email:</td>
<td><input name="email" type="text" id="email" value="<?php echo $objCliente->get('email'); ?>" size="45" maxlength="45" /></td>
</tr>
<tr>
<td>CEP:</td>
<td colspan="3">
<input name="cep" type="text" id="cep" value="<?php echo $objCliente->get('cep'); ?>" size="10" maxlength="10" onkeypress="mascaraCEP(this);" />
<input type="button" onClick="open('buscaCEP.php', 'new', '')" value="Buscar..." class="gmailButton"/>
</td>
</tr>
<tr>
<td>Telefone:</td>
<td><input name="telefone" type="text" id="telefone" value="<?php echo $objCliente->get('telefone'); ?>" size="14" maxlength="14" onkeypress="mascaraTel(this);" /></td>
<td>Celular:</td>
<td><input name="celular" type="text" id="celular" value="<?php echo $objCliente->get('celular'); ?>" size="14" maxlength="14" onkeypress="mascaraCel(this);" /></td>
</tr>
<tr>
<td>Data de Nascimento:</td>
<td><input name="datNascimento" type="text" id="datNascimento" value="<?php echo $objCliente->get('datNascimento'); ?>" size="10" maxlength="10" onkeypress="mascaraData(this)" /></td>
<td>Identidade:</td>
<td><input name="identidade" type="text" id="identidade" value="<?php echo $objCliente->get('identidade'); ?>" size="15" maxlength="15" /></td>
</tr>
<tr>
<td>Sexo:</td>
<td>
<select name="sexo" id="sexo">
<option <?php
if ($objCliente->get('sexo') == "F")
echo "selected";
?> value="F">Feminino</option>
<option <?php
if ($objCliente->get('sexo') == "M")
echo "selected";
?> value="M">Masculino</option>
</select>
</td>
<td>Profissão:</td>
<td><input name="profissao" type="text" id="profissao" value="<?php echo $objCliente->get('profissao'); ?>" size="15" maxlength="30" /></td>
</tr>
<tr>
<td> </td>
<td>
<label for="usuario">Usuário:</label>
<input type="text" name="usuario" id="usuario" value="<?php echo $objCliente->get('usuario'); ?>" maxlength="10"/>
</td>
<td>
<label for="senha">Senha:</label>
<input type="text" name="senha" id="senha" maxlength="10"
value="<?php echo $objCliente->get('senha'); ?>"
/>
</td>
</tr>
<tr>
<td>OBS:</td>
<td colspan="3">
<textarea name="obs" id="obs" cols="60" rows="7" onkeyup="contOBS(this.value.length)"><?php echo $objCliente->get('obs'); ?></textarea><span id="contOBS" ></span>
</td>
</tr>
</table>
</form>
<a class="gmailButton" href="listAparelhoWhere.php?campo=cliente&operador==&&ordenar=dtVenda&valor=<?php echo $_POST['codCliente']; ?>">Listar Aparelhos</a>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,93 @@
<?php
//include '../Includes/valida_sessao.inc';
require_once("../Controle/ControleCliente.php");
//header("Content-Type: text/html; charset=utf-8", true);
$nome = $_GET["cliente"];
$objCliente = new Cliente;
$objClientes = $objCliente->buscarPorNome($nome);
$contador = count($objClientes)
?>
<!--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-->
<!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"
}
</script>
</head>
<body>
<div id="menuInterno">
<?php
include '../Includes/MenuPrincipal.php';
?>
</div>
<div id="geral">
<div id="conteudo">
<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&ccedil;&otilde;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><?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>
<form id="ordens" name="ordens" method="post" action="listOrdem.php?campo=cliente&valorBusca=<?php echo $objCliente->get("codCliente"); ?>">
<td width="50%">
<input name="codCliente" type="hidden" id="codCliente" value="<?php echo $objCliente->get('codCliente'); ?>" />
<input type="image" class="acaoLista" src="../Imagens/list.jpg" name="Submit3" value="Ordens" class="botaoAcao" />
</td>
</form>
<form id="ordens" name="criaordem" method="get" action="cadOrdem.php?codCliente=<?php echo $objCliente->get("codCliente"); ?>" >
<td>
<input name="codCliente" type="hidden" id="codCliente" value="<?php echo $objCliente->get('codCliente'); ?>" />
<input type="image" class="acaoLista" src="../Imagens/add.png" name="Submit" value="addMovimentacao" title="Criar OS"/>
</td>
</form>
</tr>
</table>
</td>
</tr>
<?php
}
?>
</table>
</div> <!--FIM DA DIV CONTEUDO-->
</div>
</body>
</html>

View File

@@ -0,0 +1,100 @@
<!--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&ccedil;&otilde;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>

View File

@@ -0,0 +1 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

View File

@@ -0,0 +1,292 @@
<?php
header("Content-Type: text/html; charset=utf-8", true);
//include '../Includes/valida_sessao.inc';
//include '../Includes/geradorAleatorio.inc';
require_once ("../Controle/ControleEstado.php");
$objEstado = new Estado;
$objEstados = $objEstado->buscarTodos();
$contadorEstado = count($objEstados);
require_once ("../Controle/ControleCidade.php");
$objCidade = new Cidade;
$objCidades = $objCidade->buscarTodos();
$contadorCidade = count($objCidades);
?>
<!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>Cadastro de Cliente</title>
<script language="JavaScript" type="text/javascript" src="../AJAX/BibliotecaAJAX.js"></script>
<script language="JavaScript" type="text/javascript" src="../Js/ajaxInit.js"></script>
<script language="JavaScript" type="text/javascript" src="../Js/FuncoesAjaxCidades.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$('input').keypress(function(e) {
var code = null;
code = (e.keyCode ? e.keyCode : e.which);
return (code == 13) ? false : true;
});
});
function voltar() {
location.href = 'listCliente.php';
}
function mascaraTel(telefone) {
if (telefone.value.length == '0') {
document.form.telefone.value = '(' + telefone.value;
}
if (telefone.value.length == '3') {
document.form.telefone.value = telefone.value + ') ';
}
if (telefone.value.length == '9') {
document.form.telefone.value = telefone.value + '-';
}
}
function mascaraCel(celular) {
if (celular.value.length == '0') {
document.form.celular.value = '(' + celular.value;
}
if (celular.value.length == '3') {
document.form.celular.value = celular.value + ') ';
}
if (celular.value.length == '9') {
document.form.celular.value = celular.value + '-';
}
}
function mascaraCPF(cpf) {
if (cpf.value.length == '3') {
document.form.cpf.value = cpf.value + '.';
}
if (cpf.value.length == '7') {
document.form.cpf.value = cpf.value + '.';
}
if (cpf.value.length == '11') {
document.form.cpf.value = cpf.value + '-';
}
}
function mascaraData(datNascimento) {
if (datNascimento.value.length == '2') {
document.form.datNascimento.value = datNascimento.value + '/';
}
if (datNascimento.value.length == '5') {
document.form.datNascimento.value = datNascimento.value + '/';
}
}
function mascaraCEP(cep) {
if (cep.value.length == '2') {
document.form.cep.value = cep.value + '.';
}
if (cep.value.length == '6') {
document.form.cep.value = cep.value + '-';
}
}
function buscaEndereco(CEP) {
if (CEP != "") {
$('#spanLogradouro').html('<progress></progress>');
$('#spanLogradouro').load("../AJAX/enderecoPorCEP.php?cep=" + CEP + "&campo=logradouro", "",
function(responseText, textStatus, XMLHttpRequest) {
if (textStatus == 'error') {
$('#spanLogradouro').html('<font color="red">(Erro de conexão com servidor. Tente novamente)</font>');
}
}
);
$('#spanBairro').html('<progress></progress>');
$('#spanBairro').load("../AJAX/enderecoPorCEP.php?cep=" + CEP + "&campo=bairro", "",
function(responseText, textStatus, XMLHttpRequest) {
if (textStatus == 'error') {
$('#spanBairro').html('<font color="red">(Erro de conexão com servidor. Tente novamente)</font>');
}
}
);
$('#spanEstado').html('<progress></progress>');
$('#spanEstado').load("../AJAX/enderecoPorCEP.php?cep=" + CEP + "&campo=uf_sigla", "",
function(responseText, textStatus, XMLHttpRequest) {
if (textStatus == 'error') {
$('#spanEstado').html('<font color="red">(Erro de conexão com servidor. Tente novamente)</font>');
}
}
);
$('#spanCidade').html('<progress></progress>');
$('#spanCidade').load("../AJAX/enderecoPorCEP.php?cep=" + CEP + "&campo=cidade", "",
function(responseText, textStatus, XMLHttpRequest) {
if (textStatus == 'error') {
$('#spanCidade').html('<font color="red">(Erro de conexão com servidor. Tente novamente)</font>');
}
}
);
document.getElementById('numero').focus();
}
}
function contOBS(qtCaracteres) {
if (qtCaracteres > 1000) {
document.getElementById("contOBS").innerHTML = (1000 - qtCaracteres) * (-1) + " caracteres excedidos";
} else {
document.getElementById("contOBS").innerHTML = 1000 - qtCaracteres + " caracteres restantes";
}
}
function buscaAJAX(busca, idResultado) {
////busca é o atributo informado para buscaAJAX.php
//idResultado é o id do elemento que receberá a resposta.
$('#' + idResultado).html('<progress></progress>');
$('#' + idResultado).load("../AJAX/verificaCPF.php?campo1=" + busca, "",
function(responseText, textStatus, XMLHttpRequest) {
if (textStatus == 'error') {
$('#' + idResultado).html('<font color="red">(Erro de conexão com servidor. Tente novamente)</font>');
}
}
);
}
function validaForm() {
d = document.form;
if (d.cpf.value == "") {
alert("O campo CPF deve ser preenchido!");
d.cpf.focus();
return false;
}
if (document.getElementById("contCPF").value != 0){
alert("CPF já cadastrado!");
return false;
}
}
function geraUsuario2(campo) {
var frase = campo.value;
var palavras = frase.split(" ");
tamanho = palavras.length;
var usuario = (palavras[0]);
usuario = usuario.substr(0, 4);
numero = parseInt(Math.random() * 10000);
usuario = usuario + numero;
usuario = usuario.toUpperCase();
document.getElementById('usuario').value = usuario;
}
</script>
</head>
<body>
<div id="menuInterno">
<?php
include '../Includes/MenuPrincipal.php';
?>
</div>
<div id="topo">
<div id="rodape">
</div>
</div>
<div id="conteudo">
<form id="form" name="form" method="post" action="../FilesOk/cadClienteOK.php" onsubmit=" return validaForm(this);">
<div id="menuInterno">
<input type="submit" name="btnCadastrar" value="Cadastrar" class="gmailButton"/>
<input type="button" name="btnVoltar" value="Voltar" onclick="voltar()" class="gmailButton"/>
</div>
<table class="list">
<tr>
<td>Nome:</td>
<td><input name="nome" type="text" id="nome" autofocus onblur="geraUsuario2(this);" /></td>
<td>Logradouro:</td>
<td><span id="spanLogradouro"><input name="logradouro" type="text" id="logradouro" /></span></td>
</tr>
<tr>
<td>Número da casa:</td>
<td><input name="numero" type="text" id="numero" /></td>
<td>Bairro:</td>
<td><span id="spanBairro"><input name="bairro" type="text" id="bairro" /></span></td>
</tr>
<tr>
<td>Estado:</td>
<td>
<!--<span id="spanEstado"><select name="estado" id="estado" onchange="selecionaCidade();">
<option value="">Selecione um Estado</option>
<?php
for ($x = 0; $x < $contadorEstado; $x++) {
$objEstado = $objEstados[$x];
?>
<option value="<?php echo $objEstado->get('uf'); ?>"><?php echo $objEstado->get('nome'); ?></option>
<?php
}
?>
</select>
</span>-->
<span id="spanEstado"><input type="text" name="estado" id="estado" value="MG" /></span>
</td>
<td>Cidade:</td>
<td>
<!--<span id="spanCidade"><label id="caixaCidade">
<select name="cidade" id="cidade" disabled="disabled">
<option value="Todos" selected="selected">Selecione um estado</option>
</select>
</label>
<label id="carregando"></label>
</span>-->
<span id="spanCidade"><input type="text" name="cidade" id="cidade" value="Ribeirao das Neves" /></span>
</td>
</tr>
<tr>
<td>Telefone:</td>
<td><input name="telefone" type="text" id="telefone" maxlength="14" onkeypress="mascaraTel(this);" /></td>
<td>Celular:</td>
<td><input name="celular" type="text" id="celular" maxlength="14" onkeypress="mascaraCel(this);" /></td>
</tr>
<tr>
<td>CPF:</td>
<td>
<input name="cpf" type="text" id="cpf" maxlength="14" onkeypress="mascaraCPF(this);" onblur="buscaAJAX(this.value, 'infoCPF')"/>
<span id="infoCPF"><input type='hidden' value='0' id='contCPF'/></span>
</td>
<td>Email:</td>
<td><input name="email" type="text" id="email" /></td>
</tr>
<tr>
<td>CEP:</td>
<td colspan="3">
<input name="cep" type="text" id="cep" size="10" maxlength="10" onkeypress="mascaraCEP(this);" />
<a href="#" class="gmailButton" onClick="window.open('buscaCEP.php', 'Janela', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1000, height=400');
return false;" title="Clique aqui para buscar um CEP">Buscar...</a>
<a href="#" class="gmailButton" onClick="buscaEndereco(cep.value)" title="Clique aqui para preencher os campos com dados referentes ao CEP informado">Preencher...</a>
</td>
</tr>
<tr>
<td>Data de Nascimento:</td>
<td><input name="datNascimento" type="date" id="datNascimento" maxlength="10" onkeypress="mascaraData(this);" /></td>
<td>Identidade:</td>
<td><input name="identidade" type="text" id="identidade" size="15" maxlength="15" /></td>
</tr>
<tr>
<td>Sexo:</td>
<td>
<select name="sexo" id="sexo">
<option></option>
<option value="F">Feminino</option>
<option value="M">Masculino</option>
</select>
</td>
<td>Profissão:</td>
<td><input name="profissao" type="text" id="profissao" size="15" maxlength="30" /></td>
</tr>
<tr>
<td>
<label for="usuario">Usuário:</label>
<input type="text" name="usuario" id="usuario" maxlength="10" />
</td><td>
<label for="senha">Senha:</label>
<input type="text" name="senha" id="senha" maxlength="10"
value="<?php echo gerar_sequencia(6, true, false, true, false); ?>"
/>
</td>
</tr>
<tr>
<td>OBS:</td>
<td colspan="3">
<textarea name="obs" id="obs" cols="60" rows="7" onkeyup="contOBS(this.value.length)"></textarea><span id="contOBS" ></span>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>

10
Example/Telas/error_log Normal file
View File

@@ -0,0 +1,10 @@
[10-Mar-2026 20:58:17 UTC] PHP Warning: include(../Includes/valida_sessao.inc): failed to open stream: No such file or directory in /home/bigcellc/public_html/ads2025/Example/Telas/listCliente.php on line 2
[10-Mar-2026 20:58:17 UTC] PHP Warning: include(../Includes/valida_sessao.inc): failed to open stream: No such file or directory in /home/bigcellc/public_html/ads2025/Example/Telas/listCliente.php on line 2
[10-Mar-2026 20:58:17 UTC] PHP Warning: include(): Failed opening '../Includes/valida_sessao.inc' for inclusion (include_path='.:/opt/alt/php54/usr/share/pear:/opt/alt/php54/usr/share/php') in /home/bigcellc/public_html/ads2025/Example/Telas/listCliente.php on line 2
[10-Mar-2026 20:58:17 UTC] PHP Warning: require_once(../Includes/Funcoes.php): failed to open stream: No such file or directory in /home/bigcellc/public_html/ads2025/Example/Controle/ControleCliente.php on line 4
[10-Mar-2026 20:58:17 UTC] PHP Fatal error: require_once(): Failed opening required '../Includes/Funcoes.php' (include_path='.:/opt/alt/php54/usr/share/pear:/opt/alt/php54/usr/share/php') in /home/bigcellc/public_html/ads2025/Example/Controle/ControleCliente.php on line 4
[10-Mar-2026 20:58:20 UTC] PHP Warning: include(../Includes/valida_sessao.inc): failed to open stream: No such file or directory in /home/bigcellc/public_html/ads2025/Example/Telas/listCliente.php on line 2
[10-Mar-2026 20:58:20 UTC] PHP Warning: include(../Includes/valida_sessao.inc): failed to open stream: No such file or directory in /home/bigcellc/public_html/ads2025/Example/Telas/listCliente.php on line 2
[10-Mar-2026 20:58:20 UTC] PHP Warning: include(): Failed opening '../Includes/valida_sessao.inc' for inclusion (include_path='.:/opt/alt/php54/usr/share/pear:/opt/alt/php54/usr/share/php') in /home/bigcellc/public_html/ads2025/Example/Telas/listCliente.php on line 2
[10-Mar-2026 20:58:20 UTC] PHP Warning: require_once(../Includes/Funcoes.php): failed to open stream: No such file or directory in /home/bigcellc/public_html/ads2025/Example/Controle/ControleCliente.php on line 4
[10-Mar-2026 20:58:20 UTC] PHP Fatal error: require_once(): Failed opening required '../Includes/Funcoes.php' (include_path='.:/opt/alt/php54/usr/share/pear:/opt/alt/php54/usr/share/php') in /home/bigcellc/public_html/ads2025/Example/Controle/ControleCliente.php on line 4

View File

@@ -0,0 +1,35 @@
<?php
//include '../Includes/valida_sessao.inc';
?>
<!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>Excluir Cliente</title>
<script language="javascript" type="text/javascript">
function voltar(){
location.href = 'listCliente.php';
}
</script>
</head>
<body>
<div id="menuInterno">
<?php
include '../Includes/MenuPrincipal.php';
?>
</div>
<form id="form1" name="form1" method="post" action="../FilesOk/excClienteOK.php">
<p>Tem certeza que deseja excluir este registro?
<input name="codCliente" type="hidden" id="codCliente" value="<?php echo $_POST['codCliente']; ?>" />
</p>
<p>
<input type="submit" name="btnExcluir" value="Excluir" autofocus class="gmailButton"/>
<input type="button" name="btnVoltar" value="Voltar" onclick="voltar()" class="gmailButton"/>
</p>
</form>
</body>
</html>

View File

@@ -0,0 +1,145 @@
<?php
//include '../Includes/valida_sessao.inc';
header("Content-Type: text/html; charset=utf-8", true);
require_once("../Controle/ControleCliente.php");
$objCliente = new Cliente;
if (isset($_GET["letra"])){
$valor = $_GET["letra"];
}else{
$valor = "a";
}
$objClientes = $objCliente->buscarWhere("nome", "letra", $valor, "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 novo(){
location.href = 'cadCliente.php';
}
function voltar(){
location.href = 'index.php';
}
</script>
</head>
<body>
<div id="menuInterno">
<?php
//include '../Includes/MenuPrincipal.php';
?>
</div>
<fieldset id="IniciaisCliente">
<a href="listCliente.php?letra=a" class="gmailButton">A</a>
<a href="listCliente.php?letra=b" class="gmailButton">B</a>
<a href="listCliente.php?letra=c" class="gmailButton">C</a>
<a href="listCliente.php?letra=d" class="gmailButton">D</a>
<a href="listCliente.php?letra=e" class="gmailButton">E</a>
<a href="listCliente.php?letra=f" class="gmailButton">F</a>
<a href="listCliente.php?letra=g" class="gmailButton">G</a>
<a href="listCliente.php?letra=h" class="gmailButton">H</a>
<a href="listCliente.php?letra=i" class="gmailButton">I</a>
<a href="listCliente.php?letra=j" class="gmailButton">J</a>
<a href="listCliente.php?letra=k" class="gmailButton">K</a>
<a href="listCliente.php?letra=l" class="gmailButton">L</a>
<a href="listCliente.php?letra=m" class="gmailButton">M</a>
<a href="listCliente.php?letra=n" class="gmailButton">N</a>
<a href="listCliente.php?letra=o" class="gmailButton">O</a>
<a href="listCliente.php?letra=p" class="gmailButton">P</a>
<a href="listCliente.php?letra=q" class="gmailButton">Q</a>
<a href="listCliente.php?letra=r" class="gmailButton">R</a>
<a href="listCliente.php?letra=s" class="gmailButton">S</a>
<a href="listCliente.php?letra=t" class="gmailButton">T</a>
<a href="listCliente.php?letra=u" class="gmailButton">U</a>
<a href="listCliente.php?letra=v" class="gmailButton">V</a>
<a href="listCliente.php?letra=w" class="gmailButton">W</a>
<a href="listCliente.php?letra=x" class="gmailButton">X</a>
<a href="listCliente.php?letra=y" class="gmailButton">Y</a>
<a href="listCliente.php?letra=z" class="gmailButton">Z</a>
</fieldset>
<fieldset id="buscarCliente">
<legend>Buscar Cliente</legend>
<form action="buscaCliente.php" method="get">
<input size="40" type="text" name="cliente" placeholder="Digite o nome do cliente para busca..." />
<input type="submit" value="Buscar!" />
</form>
</fieldset>
<table class="list">
<tr>
<th width="13%" class="titulo" >Nome</th>
<th width="23%" class="titulo" >Endereço</th>
<th width="5%" class="titulo" >Telefone</th>
<th width="5%" class="titulo" >Celular</th>
<th width="13%" class="titulo" >Email</th>
<th width="7%" class="titulo" >Nascimento</th>
<th width="5%" class="titulo" >A&ccedil;&otilde;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><?php echo $objCliente->get('nome'); ?></td>
<td>
<?php
if ($objCliente->get('logradouro') != "") {
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
if ($objCliente->get('datNascimento') != "00/00/0000") {
echo $objCliente->get('datNascimento');
}
?>
</td>
<td>
<table class="acao">
<tr>
<form id="alterar" name="alterar" method="post" action="altCliente.php">
<td>
<input name="codCliente" type="hidden" id="codCliente" value="<?php echo $objCliente->get('codCliente'); ?>" />
<input type="image" class="acaoLista" src="../Imagens/alterar.png" name="Submit" value="Alterar" class="botaoAcao" title="Alterar"/>
</td>
</form>
<form id="excluir" name="excluir" method="post" action="excCliente.php">
<td>
<input name="codCliente" type="hidden" id="codCliente" value="<?php echo $objCliente->get('codCliente'); ?>" />
<input type="image" class="acaoLista" src="../Imagens/excluir.png" name="Submit2" value="Excluir" class="botaoAcao" title="Excluir"/>
</td>
</form>
<form id="ordens" name="ordens" method="post" action="listOrdem.php?campo=cliente&valorBusca=<?php echo $objCliente->get("codCliente"); ?>" >
<td>
<input name="codCliente" type="hidden" id="codCliente" value="<?php echo $objCliente->get('codCliente'); ?>" />
<input type="image" class="acaoLista" src="../Imagens/list.png" name="Submit3" value="Ordens" class="botaoAcao" title="Listar Ordens de Serviço"/>
</td>
</form>
<form id="ordens" name="criatermo" method="get" action="cadTermoCompromisso.php?codCliente=<?php echo $objCliente->get("codCliente"); ?>" >
<td>
<input name="codCliente" type="hidden" id="codCliente" value="<?php echo $objCliente->get('codCliente'); ?>" />
<input type="image" class="acaoLista" src="../Imagens/add.png" name="Submit" value="addTermo" title="Criar Termo"/>
</td>
</form>
</tr>
</table>
</td>
</tr>
<?php
}
?>
</table>
</body>
</html>