Arquivos já criados em sala
This commit is contained in:
43
Example/Banco/Banco.php
Normal file
43
Example/Banco/Banco.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
class Banco
|
||||
{
|
||||
var $nomeBanco;
|
||||
var $nomeUsuario;
|
||||
var $senha;
|
||||
var $localBanco;
|
||||
var $conexao;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
if (($_SERVER['SERVER_NAME'] == "www.bigcell.com.br") or ($_SERVER['SERVER_NAME'] == "bigcell.com.br")) {
|
||||
$this->nomeBanco = "bigcellc_ads2025";
|
||||
$this->nomeUsuario = "bigcellc_ads2025";
|
||||
$this->senha = "Ads*2025_";
|
||||
$this->localBanco = "localhost";
|
||||
} else {
|
||||
$this->nomeBanco = "";
|
||||
$this->nomeUsuario = "";
|
||||
$this->senha = "";
|
||||
$this->localBanco = "localhost";
|
||||
}
|
||||
|
||||
$this->conexao = mysql_connect($this->localBanco, $this->nomeUsuario, $this->senha);
|
||||
mysql_select_db($this->nomeBanco, $this->conexao);
|
||||
}
|
||||
|
||||
function executar($sql)
|
||||
{
|
||||
@$retorno = mysql_query($sql, $this->conexao);
|
||||
if (!$retorno) {
|
||||
die('Erro na consulta: ' . mysql_error());
|
||||
mail("mvassuncao10@gmail.com", "Erro em consulta SQL www.bigcell.com.br", mysql_errno() . ": " . mysql_error());
|
||||
return $retorno;
|
||||
}
|
||||
mysql_close($this->conexao);
|
||||
return $retorno;
|
||||
}
|
||||
function backup($tabela, $codRegistro)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
101
Example/Controle/ControleCliente.php
Normal file
101
Example/Controle/ControleCliente.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
require_once("../Entidade/Cliente.php");
|
||||
//require_once("../Includes/Funcoes.php");
|
||||
|
||||
class ControleCliente {
|
||||
|
||||
function inserir($dados) {
|
||||
$objCliente = new Cliente;
|
||||
$nome = removeAcentos($dados['nome']);
|
||||
$objCliente->set('nome', $nome);
|
||||
$objCliente->set('logradouro', $dados['logradouro']);
|
||||
$objCliente->set('numero', $dados['numero']);
|
||||
$objCliente->set('bairro', $dados['bairro']);
|
||||
$objCliente->set('cidade', $dados['cidade']);
|
||||
$objCliente->set('estado', $dados['estado']);
|
||||
$objCliente->set('cep', $dados['cep']);
|
||||
$objCliente->set('telefone', $dados['telefone']);
|
||||
$objCliente->set('celular', $dados['celular']);
|
||||
$objCliente->set('cpf', $dados['cpf']);
|
||||
$objCliente->set('email', $dados['email']);
|
||||
$novaDat = explode('/', $dados['datNascimento']);
|
||||
$novaData = $novaDat[2] . $novaDat[1] . $novaDat[0];
|
||||
$objCliente->set('datNascimento', $novaData);
|
||||
$objCliente->set('sexo', $dados['sexo']);
|
||||
$objCliente->set('profissao', $dados['profissao']);
|
||||
$objCliente->set('identidade', $dados['identidade']);
|
||||
$objCliente->set('obs', $dados['obs']);
|
||||
$objCliente->set('usuario', $dados['usuario']);
|
||||
$objCliente->set('senha', $dados['senha']);
|
||||
|
||||
return $retorno = $objCliente->inserir();
|
||||
}
|
||||
|
||||
function alterar($dados) {
|
||||
$novaDat = explode('/', $dados['datNascimento']);
|
||||
$novaData = $novaDat[2] . $novaDat[1] . $novaDat[0];
|
||||
$objCliente = new Cliente;
|
||||
$nome = removeAcentos($dados['nome']);
|
||||
$objCliente->set('nome', $nome);
|
||||
$objCliente->set('codCliente', $dados['codCliente']);
|
||||
$objCliente->set('nome', $dados['nome']);
|
||||
$objCliente->set('logradouro', $dados['logradouro']);
|
||||
$objCliente->set('numero', $dados['numero']);
|
||||
$objCliente->set('bairro', $dados['bairro']);
|
||||
$objCliente->set('cidade', $dados['cidade']);
|
||||
$objCliente->set('estado', $dados['estado']);
|
||||
$objCliente->set('cep', $dados['cep']);
|
||||
$objCliente->set('telefone', $dados['telefone']);
|
||||
$objCliente->set('celular', $dados['celular']);
|
||||
$objCliente->set('cpf', $dados['cpf']);
|
||||
$objCliente->set('email', $dados['email']);
|
||||
$objCliente->set('datNascimento', $novaData);
|
||||
$objCliente->set('sexo', $dados['sexo']);
|
||||
$objCliente->set('profissao', $dados['profissao']);
|
||||
$objCliente->set('identidade', $dados['identidade']);
|
||||
$objCliente->set('obs', $dados['obs']);
|
||||
$objCliente->set('usuario', $dados['usuario']);
|
||||
$objCliente->set('senha', $dados['senha']);
|
||||
return $retorno = $objCliente->alterar();
|
||||
}
|
||||
|
||||
function excluir($dados) {
|
||||
$objCliente = new Cliente;
|
||||
$objCliente->set('codCliente', $dados['codCliente']);
|
||||
return $retorno = $objCliente->excluir();
|
||||
}
|
||||
|
||||
function buscarTodos() {
|
||||
$objCliente = new Cliente;
|
||||
return $retorno = $objCliente->buscarTodos();
|
||||
}
|
||||
|
||||
function buscarWhere($campo, $operador, $valor, $ordenar, $extra) {
|
||||
$objCliente = new Cliente;
|
||||
return $retorno = $objCliente->buscarWhere($campo, $operador, $valor, $ordenar, $extra);
|
||||
}
|
||||
|
||||
function buscarPorNome($nome) {
|
||||
$objCliente = new Cliente;
|
||||
return $retorno = $objCliente->buscarPorNome($nome);
|
||||
}
|
||||
|
||||
function buscarPorId($codCliente) {
|
||||
$objCliente = new Cliente;
|
||||
$objCliente->set('codCliente', $codCliente);
|
||||
return $retorno = $objCliente->buscarPorId();
|
||||
}
|
||||
|
||||
function buscarData() {
|
||||
$objCliente = new Cliente;
|
||||
return $retorno = $objCliente->buscarData();
|
||||
}
|
||||
|
||||
function selectClientes($codCliente) {
|
||||
$objCliente = new Cliente;
|
||||
return $retorno = $objCliente->selectClientes($codCliente);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
630
Example/Entidade/Cliente.php
Normal file
630
Example/Entidade/Cliente.php
Normal file
@@ -0,0 +1,630 @@
|
||||
<?php
|
||||
require_once('../Banco/Banco.php');
|
||||
|
||||
class Cliente
|
||||
{
|
||||
|
||||
private $codCliente;
|
||||
private $nome;
|
||||
private $logradouro;
|
||||
private $numero;
|
||||
private $bairro;
|
||||
private $cidade;
|
||||
private $estado;
|
||||
private $cep;
|
||||
private $telefone;
|
||||
private $celular;
|
||||
private $cpf;
|
||||
private $email;
|
||||
private $datNascimento;
|
||||
private $sexo;
|
||||
private $profissao;
|
||||
private $identidade;
|
||||
private $obs;
|
||||
private $usuario;
|
||||
private $senha;
|
||||
|
||||
function get($atributo)
|
||||
{
|
||||
return $this->$atributo;
|
||||
}
|
||||
|
||||
function set($atributo, $valor)
|
||||
{
|
||||
$this->$atributo = $valor;
|
||||
}
|
||||
|
||||
function inserir()
|
||||
{
|
||||
$sql = "
|
||||
insert into
|
||||
Cliente
|
||||
(
|
||||
nome,
|
||||
logradouro,
|
||||
numero,
|
||||
bairro,
|
||||
cidade,
|
||||
estado,
|
||||
cep,
|
||||
telefone,
|
||||
celular,
|
||||
cpf,
|
||||
email,
|
||||
datNascimento,
|
||||
sexo,
|
||||
profissao,
|
||||
identidade,
|
||||
obs,
|
||||
usuario,
|
||||
senha
|
||||
)
|
||||
values
|
||||
(
|
||||
'" . $this->nome . "',
|
||||
'" . $this->logradouro . "',
|
||||
'" . $this->numero . "',
|
||||
'" . $this->bairro . "',
|
||||
'" . $this->cidade . "',
|
||||
'" . $this->estado . "',
|
||||
'" . $this->cep . "',
|
||||
'" . $this->telefone . "',
|
||||
'" . $this->celular . "',
|
||||
'" . $this->cpf . "',
|
||||
'" . $this->email . "',
|
||||
'" . $this->datNascimento . "',
|
||||
'" . $this->sexo . "',
|
||||
'" . $this->profissao . "',
|
||||
'" . $this->identidade . "',
|
||||
'" . $this->obs . "',
|
||||
'" . $this->usuario . "',
|
||||
'" . $this->senha . "'
|
||||
)";
|
||||
|
||||
$objBanco = new Banco();
|
||||
return $retorno = $objBanco->executar($sql);
|
||||
}
|
||||
|
||||
function excluir()
|
||||
{
|
||||
|
||||
$sql = "
|
||||
delete
|
||||
from
|
||||
Cliente
|
||||
where
|
||||
codCliente = '" . $this->codCliente . "'";
|
||||
|
||||
$objBanco = new Banco();
|
||||
return $retorno = $objBanco->executar($sql);
|
||||
}
|
||||
|
||||
function alterar()
|
||||
{
|
||||
|
||||
$sql = "update Cliente set
|
||||
nome = '" . $this->nome . "',
|
||||
logradouro = '" . $this->logradouro . "',
|
||||
numero = '" . $this->numero . "',
|
||||
bairro = '" . $this->bairro . "',
|
||||
cidade = '" . $this->cidade . "',
|
||||
estado = '" . $this->estado . "',
|
||||
cep = '" . $this->cep . "',
|
||||
telefone = '" . $this->telefone . "',
|
||||
celular = '" . $this->celular . "',
|
||||
cpf = '" . $this->cpf . "',
|
||||
email = '" . $this->email . "',
|
||||
datNascimento = '" . $this->datNascimento . "',
|
||||
sexo = '" . $this->sexo . "',
|
||||
profissao = '" . $this->profissao . "',
|
||||
identidade = '" . $this->identidade . "',
|
||||
obs = '" . $this->obs . "',
|
||||
usuario = '" . $this->usuario . "',
|
||||
senha = '" . $this->senha . "'
|
||||
where
|
||||
codCliente = '" . $this->codCliente . "'";
|
||||
|
||||
$objBanco = new Banco();
|
||||
return $retorno = $objBanco->executar($sql);
|
||||
}
|
||||
|
||||
function buscarTodos()
|
||||
{
|
||||
|
||||
//$sql = "select * from Cliente where nome like _utf8 '%assuncão%' COLLATE utf8_unicode_ci";
|
||||
$sql = "
|
||||
select
|
||||
codCliente,
|
||||
nome,
|
||||
logradouro,
|
||||
numero,
|
||||
bairro,
|
||||
cidade,
|
||||
estado,
|
||||
cep,
|
||||
telefone,
|
||||
celular,
|
||||
cpf,
|
||||
email,
|
||||
datNascimento,
|
||||
sexo,
|
||||
profissao,
|
||||
identidade,
|
||||
obs,
|
||||
usuario,
|
||||
senha
|
||||
from
|
||||
Cliente
|
||||
order by
|
||||
nome ASC
|
||||
";
|
||||
//$sql = "SELECT * from Cliente WHERE nome LIKE '%s Assunçao%' COLLATE Latin1_bin";
|
||||
|
||||
$objBanco = new Banco();
|
||||
$dados = $objBanco->executar($sql);
|
||||
$linhas = mysql_num_rows($dados);
|
||||
|
||||
$objClientes = array();
|
||||
|
||||
for ($i = 0; $i < $linhas; $i++) {
|
||||
|
||||
$codCliente = mysql_result($dados, $i, 'codCliente');
|
||||
$nome = mysql_result($dados, $i, 'nome');
|
||||
$logradouro = mysql_result($dados, $i, 'logradouro');
|
||||
$numero = mysql_result($dados, $i, 'numero');
|
||||
$bairro = mysql_result($dados, $i, 'bairro');
|
||||
$cidade = mysql_result($dados, $i, 'cidade');
|
||||
$estado = mysql_result($dados, $i, 'estado');
|
||||
$cep = mysql_result($dados, $i, 'cep');
|
||||
$telefone = mysql_result($dados, $i, 'telefone');
|
||||
$celular = mysql_result($dados, $i, 'celular');
|
||||
$cpf = mysql_result($dados, $i, 'cpf');
|
||||
$email = mysql_result($dados, $i, 'email');
|
||||
$datNascimento = mysql_result($dados, $i, 'datNascimento');
|
||||
$sexo = mysql_result($dados, $i, 'sexo');
|
||||
$profissao = mysql_result($dados, $i, 'profissao');
|
||||
$identidade = mysql_result($dados, $i, 'identidade');
|
||||
$obs = mysql_result($dados, $i, 'obs');
|
||||
$usuario = mysql_result($dados, $i, 'usuario');
|
||||
$senha = mysql_result($dados, $i, 'senha');
|
||||
|
||||
$novaDat = explode('-', $datNascimento);
|
||||
$novaData = $novaDat[2] . '/' . $novaDat[1] . '/' . $novaDat[0];
|
||||
|
||||
$objCliente = new Cliente;
|
||||
$objCliente->set('codCliente', $codCliente);
|
||||
$objCliente->set('nome', $nome);
|
||||
$objCliente->set('logradouro', $logradouro);
|
||||
$objCliente->set('numero', $numero);
|
||||
$objCliente->set('bairro', $bairro);
|
||||
$objCliente->set('cidade', $cidade);
|
||||
$objCliente->set('estado', $estado);
|
||||
$objCliente->set('cep', $cep);
|
||||
$objCliente->set('telefone', $telefone);
|
||||
$objCliente->set('celular', $celular);
|
||||
$objCliente->set('cpf', $cpf);
|
||||
$objCliente->set('email', $email);
|
||||
$objCliente->set('datNascimento', $novaData);
|
||||
$objCliente->set('sexo', $sexo);
|
||||
$objCliente->set('profissao', $profissao);
|
||||
$objCliente->set('identidade', $identidade);
|
||||
$objCliente->set('obs', $obs);
|
||||
$objCliente->set('usuario', $usuario);
|
||||
$objCliente->set('senha', $senha);
|
||||
|
||||
array_push($objClientes, $objCliente);
|
||||
}
|
||||
return $objClientes;
|
||||
}
|
||||
|
||||
function buscarWhere($campo, $operador, $valor, $ordenar, $extra)
|
||||
{
|
||||
if ($operador == "like") {
|
||||
$valor = "%" . $valor . "%";
|
||||
}
|
||||
if ($operador == "letra") {
|
||||
$valor = $valor . "%";
|
||||
$operador = "like";
|
||||
}
|
||||
$sql = "
|
||||
select
|
||||
codCliente,
|
||||
nome,
|
||||
logradouro,
|
||||
numero,
|
||||
bairro,
|
||||
cidade,
|
||||
estado,
|
||||
cep,
|
||||
telefone,
|
||||
celular,
|
||||
cpf,
|
||||
email,
|
||||
datNascimento,
|
||||
sexo,
|
||||
profissao,
|
||||
identidade,
|
||||
obs,
|
||||
usuario,
|
||||
senha
|
||||
from
|
||||
Cliente
|
||||
where
|
||||
" . $campo . " " . $operador . " '" . $valor . "'
|
||||
order by
|
||||
" . $ordenar . " ASC
|
||||
";
|
||||
|
||||
$objBanco = new Banco();
|
||||
$dados = $objBanco->executar($sql);
|
||||
$linhas = mysql_num_rows($dados);
|
||||
|
||||
$objClientes = array();
|
||||
|
||||
for ($i = 0; $i < $linhas; $i++) {
|
||||
|
||||
$codCliente = mysql_result($dados, $i, 'codCliente');
|
||||
$nome = mysql_result($dados, $i, 'nome');
|
||||
$logradouro = mysql_result($dados, $i, 'logradouro');
|
||||
$numero = mysql_result($dados, $i, 'numero');
|
||||
$bairro = mysql_result($dados, $i, 'bairro');
|
||||
$cidade = mysql_result($dados, $i, 'cidade');
|
||||
$estado = mysql_result($dados, $i, 'estado');
|
||||
$cep = mysql_result($dados, $i, 'cep');
|
||||
$telefone = mysql_result($dados, $i, 'telefone');
|
||||
$celular = mysql_result($dados, $i, 'celular');
|
||||
$cpf = mysql_result($dados, $i, 'cpf');
|
||||
$email = mysql_result($dados, $i, 'email');
|
||||
$datNascimento = mysql_result($dados, $i, 'datNascimento');
|
||||
$sexo = mysql_result($dados, $i, 'sexo');
|
||||
$profissao = mysql_result($dados, $i, 'profissao');
|
||||
$identidade = mysql_result($dados, $i, 'identidade');
|
||||
$obs = mysql_result($dados, $i, 'obs');
|
||||
$usuario = mysql_result($dados, $i, 'usuario');
|
||||
$senha = mysql_result($dados, $i, 'senha');
|
||||
|
||||
$novaDat = explode('-', $datNascimento);
|
||||
$novaData = $novaDat[2] . '/' . $novaDat[1] . '/' . $novaDat[0];
|
||||
|
||||
$objCliente = new Cliente;
|
||||
$objCliente->set('codCliente', $codCliente);
|
||||
$objCliente->set('nome', $nome);
|
||||
$objCliente->set('logradouro', $logradouro);
|
||||
$objCliente->set('numero', $numero);
|
||||
$objCliente->set('bairro', $bairro);
|
||||
$objCliente->set('cidade', $cidade);
|
||||
$objCliente->set('estado', $estado);
|
||||
$objCliente->set('cep', $cep);
|
||||
$objCliente->set('telefone', $telefone);
|
||||
$objCliente->set('celular', $celular);
|
||||
$objCliente->set('cpf', $cpf);
|
||||
$objCliente->set('email', $email);
|
||||
$objCliente->set('datNascimento', $novaData);
|
||||
$objCliente->set('sexo', $sexo);
|
||||
$objCliente->set('profissao', $profissao);
|
||||
$objCliente->set('identidade', $identidade);
|
||||
$objCliente->set('obs', $obs);
|
||||
$objCliente->set('usuario', $usuario);
|
||||
$objCliente->set('senha', $senha);
|
||||
|
||||
array_push($objClientes, $objCliente);
|
||||
}
|
||||
return $objClientes;
|
||||
}
|
||||
|
||||
function buscarPorId($codClienteBusca)
|
||||
{
|
||||
|
||||
$sql = "
|
||||
select
|
||||
nome,
|
||||
logradouro,
|
||||
numero,
|
||||
bairro,
|
||||
cidade,
|
||||
estado,
|
||||
cep,
|
||||
telefone,
|
||||
celular,
|
||||
cpf,
|
||||
email,
|
||||
datNascimento,
|
||||
sexo,
|
||||
profissao,
|
||||
identidade,
|
||||
obs,
|
||||
usuario,
|
||||
senha
|
||||
from
|
||||
Cliente
|
||||
where
|
||||
codCliente = '" . $codClienteBusca . "'
|
||||
";
|
||||
|
||||
$objBanco = new Banco();
|
||||
$dados = $objBanco->executar($sql);
|
||||
$linhas = mysql_num_rows($dados);
|
||||
if ($linhas > 0) {
|
||||
|
||||
$nome = mysql_result($dados, 0, 'nome');
|
||||
$logradouro = mysql_result($dados, 0, 'logradouro');
|
||||
$numero = mysql_result($dados, 0, 'numero');
|
||||
$bairro = mysql_result($dados, 0, 'bairro');
|
||||
$cidade = mysql_result($dados, 0, 'cidade');
|
||||
$estado = mysql_result($dados, 0, 'estado');
|
||||
$cep = mysql_result($dados, 0, 'cep');
|
||||
$telefone = mysql_result($dados, 0, 'telefone');
|
||||
$celular = mysql_result($dados, 0, 'celular');
|
||||
$cpf = mysql_result($dados, 0, 'cpf');
|
||||
$email = mysql_result($dados, 0, 'email');
|
||||
$datNascimento = mysql_result($dados, 0, 'datNascimento');
|
||||
$sexo = mysql_result($dados, 0, 'sexo');
|
||||
$profissao = mysql_result($dados, 0, 'profissao');
|
||||
$identidade = mysql_result($dados, 0, 'identidade');
|
||||
$obs = mysql_result($dados, 0, 'obs');
|
||||
$usuario = mysql_result($dados, 0, 'usuario');
|
||||
$senha = mysql_result($dados, 0, 'senha');
|
||||
|
||||
$novaDat = explode('-', $datNascimento);
|
||||
$novaData = $novaDat[2] . '/' . $novaDat[1] . '/' . $novaDat[0];
|
||||
|
||||
$objCliente = new Cliente;
|
||||
$objCliente->set('nome', $nome);
|
||||
$objCliente->set('logradouro', $logradouro);
|
||||
$objCliente->set('numero', $numero);
|
||||
$objCliente->set('bairro', $bairro);
|
||||
$objCliente->set('cidade', $cidade);
|
||||
$objCliente->set('estado', $estado);
|
||||
$objCliente->set('cep', $cep);
|
||||
$objCliente->set('telefone', $telefone);
|
||||
$objCliente->set('celular', $celular);
|
||||
$objCliente->set('cpf', $cpf);
|
||||
$objCliente->set('email', $email);
|
||||
$objCliente->set('datNascimento', $novaData);
|
||||
$objCliente->set('sexo', $sexo);
|
||||
$objCliente->set('profissao', $profissao);
|
||||
$objCliente->set('identidade', $identidade);
|
||||
$objCliente->set('obs', $obs);
|
||||
$objCliente->set('usuario', $usuario);
|
||||
$objCliente->set('senha', $senha);
|
||||
|
||||
return $objCliente;
|
||||
} else {
|
||||
$objCliente = new Cliente;
|
||||
$objCliente->set('nome', "(Cliente não encontrado!)");
|
||||
$objCliente->set('logradouro', "(Cliente não encontrado!)");
|
||||
$objCliente->set('numero', "(Cliente não encontrado!)");
|
||||
$objCliente->set('bairro', "(Cliente não encontrado!)");
|
||||
$objCliente->set('cidade', "(Cliente não encontrado!)");
|
||||
$objCliente->set('estado', "(Cliente não encontrado!)");
|
||||
$objCliente->set('cep', "(Cliente não encontrado!)");
|
||||
$objCliente->set('telefone', "(Cliente não encontrado!)");
|
||||
$objCliente->set('celular', "(Cliente não encontrado!)");
|
||||
$objCliente->set('cpf', "(Cliente não encontrado!)");
|
||||
$objCliente->set('email', "(Cliente não encontrado!)");
|
||||
$objCliente->set('datNascimento', "(Cliente não encontrado!)");
|
||||
$objCliente->set('sexo', "(Cliente não encontrado!)");
|
||||
$objCliente->set('profissao', "(Cliente não encontrado!)");
|
||||
$objCliente->set('identidade', "(Cliente não encontrado!)");
|
||||
$objCliente->set('obs', "(Cliente não encontrado!)");
|
||||
$objCliente->set('usuario', "(Cliente não encontrado!)");
|
||||
$objCliente->set('senha', "(Cliente não encontrado!)");
|
||||
|
||||
return $objCliente;
|
||||
}
|
||||
}
|
||||
|
||||
function buscarPorNome($nome)
|
||||
{
|
||||
|
||||
$sql = "
|
||||
select
|
||||
codCliente,
|
||||
nome,
|
||||
logradouro,
|
||||
numero,
|
||||
bairro,
|
||||
cidade,
|
||||
estado,
|
||||
cep,
|
||||
telefone,
|
||||
celular,
|
||||
cpf,
|
||||
email,
|
||||
datNascimento,
|
||||
sexo,
|
||||
profissao,
|
||||
identidade,
|
||||
obs,
|
||||
usuario,
|
||||
senha
|
||||
from
|
||||
Cliente
|
||||
where
|
||||
nome like '%" . $nome . "%'
|
||||
order by
|
||||
nome ASC
|
||||
";
|
||||
|
||||
$objBanco = new Banco();
|
||||
$dados = $objBanco->executar($sql);
|
||||
$linhas = mysql_num_rows($dados);
|
||||
|
||||
$objClientes = array();
|
||||
|
||||
for ($i = 0; $i < $linhas; $i++) {
|
||||
|
||||
$codCliente = mysql_result($dados, $i, 'codCliente');
|
||||
$nome = mysql_result($dados, $i, 'nome');
|
||||
$logradouro = mysql_result($dados, $i, 'logradouro');
|
||||
$numero = mysql_result($dados, $i, 'numero');
|
||||
$bairro = mysql_result($dados, $i, 'bairro');
|
||||
$cidade = mysql_result($dados, $i, 'cidade');
|
||||
$estado = mysql_result($dados, $i, 'estado');
|
||||
$cep = mysql_result($dados, $i, 'cep');
|
||||
$telefone = mysql_result($dados, $i, 'telefone');
|
||||
$celular = mysql_result($dados, $i, 'celular');
|
||||
$cpf = mysql_result($dados, $i, 'cpf');
|
||||
$email = mysql_result($dados, $i, 'email');
|
||||
$datNascimento = mysql_result($dados, $i, 'datNascimento');
|
||||
$sexo = mysql_result($dados, $i, 'sexo');
|
||||
$profissao = mysql_result($dados, $i, 'profissao');
|
||||
$identidade = mysql_result($dados, $i, 'identidade');
|
||||
$obs = mysql_result($dados, $i, 'obs');
|
||||
$usuario = mysql_result($dados, $i, 'usuario');
|
||||
$senha = mysql_result($dados, $i, 'senha');
|
||||
|
||||
$novaDat = explode('-', $datNascimento);
|
||||
$novaData = $novaDat[2] . '/' . $novaDat[1] . '/' . $novaDat[0];
|
||||
|
||||
$objCliente = new Cliente;
|
||||
$objCliente->set('codCliente', $codCliente);
|
||||
$objCliente->set('nome', $nome);
|
||||
$objCliente->set('logradouro', $logradouro);
|
||||
$objCliente->set('numero', $numero);
|
||||
$objCliente->set('bairro', $bairro);
|
||||
$objCliente->set('cidade', $cidade);
|
||||
$objCliente->set('estado', $estado);
|
||||
$objCliente->set('cep', $cep);
|
||||
$objCliente->set('telefone', $telefone);
|
||||
$objCliente->set('celular', $celular);
|
||||
$objCliente->set('cpf', $cpf);
|
||||
$objCliente->set('email', $email);
|
||||
$objCliente->set('datNascimento', $novaData);
|
||||
$objCliente->set('sexo', $sexo);
|
||||
$objCliente->set('profissao', $profissao);
|
||||
$objCliente->set('identidade', $identidade);
|
||||
$objCliente->set('obs', $obs);
|
||||
$objCliente->set('usuario', $usuario);
|
||||
$objCliente->set('senha', $senha);
|
||||
|
||||
array_push($objClientes, $objCliente);
|
||||
}
|
||||
return $objClientes;
|
||||
}
|
||||
|
||||
function buscarData()
|
||||
{
|
||||
$data = date('Ymd');
|
||||
$month = substr($data, 4, 2);
|
||||
$sql = "
|
||||
select
|
||||
codCliente,
|
||||
nome,
|
||||
logradouro,
|
||||
numero,
|
||||
bairro,
|
||||
cidade,
|
||||
estado,
|
||||
cep,
|
||||
telefone,
|
||||
celular,
|
||||
cpf,
|
||||
email,
|
||||
datNascimento,
|
||||
sexo,
|
||||
profissao,
|
||||
identidade,
|
||||
obs,
|
||||
usuario,
|
||||
senha
|
||||
from
|
||||
Cliente
|
||||
where
|
||||
MONTH(datNascimento) = '" . $month . "'
|
||||
order by
|
||||
nome ASC
|
||||
";
|
||||
|
||||
$objBanco = new Banco();
|
||||
$dados = $objBanco->executar($sql);
|
||||
$linhas = mysql_num_rows($dados);
|
||||
|
||||
$objClientes = array();
|
||||
|
||||
for ($i = 0; $i < $linhas; $i++) {
|
||||
|
||||
$codCliente = mysql_result($dados, $i, 'codCliente');
|
||||
$nome = mysql_result($dados, $i, 'nome');
|
||||
$logradouro = mysql_result($dados, $i, 'logradouro');
|
||||
$numero = mysql_result($dados, $i, 'numero');
|
||||
$bairro = mysql_result($dados, $i, 'bairro');
|
||||
$cidade = mysql_result($dados, $i, 'cidade');
|
||||
$estado = mysql_result($dados, $i, 'estado');
|
||||
$cep = mysql_result($dados, $i, 'cep');
|
||||
$telefone = mysql_result($dados, $i, 'telefone');
|
||||
$celular = mysql_result($dados, $i, 'celular');
|
||||
$cpf = mysql_result($dados, $i, 'cpf');
|
||||
$email = mysql_result($dados, $i, 'email');
|
||||
$datNascimento = mysql_result($dados, $i, 'datNascimento');
|
||||
$sexo = mysql_result($dados, $i, 'sexo');
|
||||
$profissao = mysql_result($dados, $i, 'profissao');
|
||||
$identidade = mysql_result($dados, $i, 'identidade');
|
||||
$obs = mysql_result($dados, $i, 'obs');
|
||||
$usuario = mysql_result($dados, $i, 'usuario');
|
||||
$senha = mysql_result($dados, $i, 'senha');
|
||||
|
||||
$novaDat = explode('-', $datNascimento);
|
||||
$novaData = $novaDat[2] . '/' . $novaDat[1] . '/' . $novaDat[0];
|
||||
|
||||
$objCliente = new Cliente;
|
||||
$objCliente->set('codCliente', $codCliente);
|
||||
$objCliente->set('nome', $nome);
|
||||
$objCliente->set('logradouro', $logradouro);
|
||||
$objCliente->set('numero', $numero);
|
||||
$objCliente->set('bairro', $bairro);
|
||||
$objCliente->set('cidade', $cidade);
|
||||
$objCliente->set('estado', $estado);
|
||||
$objCliente->set('cep', $cep);
|
||||
$objCliente->set('telefone', $telefone);
|
||||
$objCliente->set('celular', $celular);
|
||||
$objCliente->set('cpf', $cpf);
|
||||
$objCliente->set('email', $email);
|
||||
$objCliente->set('datNascimento', $novaData);
|
||||
$objCliente->set('sexo', $sexo);
|
||||
$objCliente->set('profissao', $profissao);
|
||||
$objCliente->set('identidade', $identidade);
|
||||
$objCliente->set('obs', $obs);
|
||||
$objCliente->set('usuario', $usuario);
|
||||
$objCliente->set('senha', $senha);
|
||||
|
||||
array_push($objClientes, $objCliente);
|
||||
}
|
||||
return $objClientes;
|
||||
}
|
||||
|
||||
function selectClientes($codClienteSelecionado)
|
||||
{
|
||||
|
||||
$sql = "
|
||||
select
|
||||
codCliente,
|
||||
nome
|
||||
from
|
||||
Cliente
|
||||
order by
|
||||
nome ASC
|
||||
";
|
||||
|
||||
$objBanco = new Banco();
|
||||
$dados = $objBanco->executar($sql);
|
||||
$linhas = mysql_num_rows($dados);
|
||||
|
||||
$selectClientes = "<select name ='cliente'>";
|
||||
$selectClientes .= "<option>Selecione o Cliente</option>";
|
||||
for ($i = 0; $i < $linhas; $i++) {
|
||||
|
||||
$codCliente = mysql_result($dados, $i, 'codCliente');
|
||||
$nome = mysql_result($dados, $i, 'nome');
|
||||
if ($codCliente == $codClienteSelecionado) {
|
||||
$selected = " selected=selected";
|
||||
} else {
|
||||
$selected = "";
|
||||
}
|
||||
$selectClientes .= "<option value='$codCliente'" . $selected . ">$nome</option>";
|
||||
}
|
||||
$selectClientes .= "</select>";
|
||||
|
||||
echo $selectClientes;
|
||||
}
|
||||
}
|
||||
21
Example/FilesOk/altClienteOK.php
Normal file
21
Example/FilesOk/altClienteOK.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
header("Content-Type: text/html; charset=utf-8", true);
|
||||
|
||||
$dados = $_POST;
|
||||
|
||||
require_once("../Controle/ControleCliente.php");
|
||||
|
||||
|
||||
|
||||
$objControleCliente = new ControleCliente;
|
||||
|
||||
$retorno = $objControleCliente->alterar($dados);
|
||||
|
||||
|
||||
|
||||
if ($retorno == true)
|
||||
|
||||
echo '
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
1
Example/FilesOk/cadClienteOK.php
Normal file
1
Example/FilesOk/cadClienteOK.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php
|
||||
1
Example/FilesOk/excClienteOK.php
Normal file
1
Example/FilesOk/excClienteOK.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php
|
||||
284
Example/Telas/altCliente.php
Normal file
284
Example/Telas/altCliente.php
Normal 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>
|
||||
93
Example/Telas/buscaCliente.php
Normal file
93
Example/Telas/buscaCliente.php
Normal 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çõ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>
|
||||
100
Example/Telas/buscaClienteParaTermoCompromisso.php
Normal file
100
Example/Telas/buscaClienteParaTermoCompromisso.php
Normal 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çõ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>
|
||||
|
||||
1
Example/Telas/buscaOrdemCliente.php
Normal file
1
Example/Telas/buscaOrdemCliente.php
Normal file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
292
Example/Telas/cadCliente.php
Normal file
292
Example/Telas/cadCliente.php
Normal 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
10
Example/Telas/error_log
Normal 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
|
||||
35
Example/Telas/excCliente.php
Normal file
35
Example/Telas/excCliente.php
Normal 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>
|
||||
|
||||
|
||||
|
||||
145
Example/Telas/listCliente.php
Normal file
145
Example/Telas/listCliente.php
Normal 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çõ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>
|
||||
Reference in New Issue
Block a user