Arquivos já criados em sala
This commit is contained in:
27
.vscode/ftp-sync.json
vendored
Normal file
27
.vscode/ftp-sync.json
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"remotePath": "./",
|
||||
"host": "bigcell.com.br",
|
||||
"username": "bigcellc_ads2025",
|
||||
"password": "Ads*2025_",
|
||||
"port": 21,
|
||||
"secure": false,
|
||||
"protocol": "ftp",
|
||||
"uploadOnSave": true,
|
||||
"passive": false,
|
||||
"debug": false,
|
||||
"privateKeyPath": null,
|
||||
"passphrase": null,
|
||||
"agent": null,
|
||||
"allow": [],
|
||||
"ignore": [
|
||||
"\\.vscode",
|
||||
"\\.git",
|
||||
"\\.DS_Store"
|
||||
],
|
||||
"generatedFiles": {
|
||||
"extensionsToInclude": [
|
||||
""
|
||||
],
|
||||
"path": ""
|
||||
}
|
||||
}
|
||||
5
Alunos/marcosassuncao/teste.php
Normal file
5
Alunos/marcosassuncao/teste.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
require_once('../../Example/Banco/Banco.php');
|
||||
echo('Teste');
|
||||
|
||||
?>
|
||||
2
Banco/error_log
Normal file
2
Banco/error_log
Normal file
@@ -0,0 +1,2 @@
|
||||
[03-Mar-2026 23:57:52 UTC] PHP Warning: mysqli::mysqli(): Headers and client library minor version mismatch. Headers:101113 Library:100505 in /home/bigcellc/public_html/ads2025/Banco/mostraBanco.php on line 9
|
||||
[04-Mar-2026 00:06:18 UTC] PHP Warning: mysqli::mysqli(): Headers and client library minor version mismatch. Headers:101113 Library:100505 in /home/bigcellc/public_html/ads2025/Banco/mostraBanco.php on line 9
|
||||
55
Banco/mostraBanco.php
Normal file
55
Banco/mostraBanco.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
// Configurações de conexão
|
||||
$host = 'localhost';
|
||||
$dbname = 'bigcellc_ads2025';
|
||||
$user = 'bigcellc_ads2025';
|
||||
$pass = 'Ads*2025_';
|
||||
|
||||
// Estabelece a conexão usando mysqli
|
||||
$conn = new mysqli($host, $user, $pass, $dbname);
|
||||
|
||||
// Verifica se houve algum erro na conexão
|
||||
if ($conn->connect_error) {
|
||||
die("Falha na conexão: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
// Define o charset para evitar problemas com acentuação
|
||||
$conn->set_charset("utf8");
|
||||
|
||||
// Consulta no information_schema para obter as tabelas, colunas e tipos
|
||||
$sql = "SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, COLUMN_TYPE
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = '" . $conn->real_escape_string($dbname) . "'
|
||||
ORDER BY TABLE_NAME, ORDINAL_POSITION";
|
||||
|
||||
$result = $conn->query($sql);
|
||||
|
||||
if ($result->num_rows > 0) {
|
||||
$current_table = "";
|
||||
|
||||
echo "<h1>Estrutura do Banco de Dados: $dbname</h1>";
|
||||
|
||||
// Percorre os resultados e formata a saída em HTML
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
// Sempre que o nome da tabela mudar, cria um novo bloco
|
||||
if ($current_table != $row['TABLE_NAME']) {
|
||||
if ($current_table != "") {
|
||||
echo "</ul><hr>";
|
||||
}
|
||||
$current_table = $row['TABLE_NAME'];
|
||||
echo "<h3>Tabela: $current_table</h3>";
|
||||
echo "<ul>";
|
||||
}
|
||||
|
||||
// Exibe o campo e o tipo de dado (COLUMN_TYPE traz detalhes como tamanho, ex: varchar(255))
|
||||
echo "<li><strong>" . htmlspecialchars($row['COLUMN_NAME']) . "</strong> - " . htmlspecialchars($row['COLUMN_TYPE']) . "</li>";
|
||||
}
|
||||
echo "</ul><hr>"; // Fecha a última lista
|
||||
|
||||
} else {
|
||||
echo "<p>Nenhuma tabela encontrada no banco de dados ou o usuário não tem permissão de leitura no information_schema.</p>";
|
||||
}
|
||||
|
||||
// Fecha a conexão
|
||||
$conn->close();
|
||||
?>
|
||||
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>
|
||||
75
Login/index.php
Normal file
75
Login/index.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-br">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>BigCell Celulares - Login</title>
|
||||
<link rel="stylesheet" href="../Source/login.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="login-container">
|
||||
<h1>BigCell Celulares</h1>
|
||||
|
||||
<form action="login.php" method="POST">
|
||||
|
||||
<div>
|
||||
<label for="usuario">Usuário:</label>
|
||||
<input type="text" id="usuario" name="usuario" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<label for="senha">Senha:</label>
|
||||
<input type="password" id="senha" name="senha" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<label for="loja">Loja:</label>
|
||||
<select id="loja" name="loja">
|
||||
<option value="BigCell">BigCell</option>
|
||||
<option value="Loja1">Loja 1</option>
|
||||
<option value="Loja2">Loja 2</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<label for="computador">Computador:</label>
|
||||
<input
|
||||
type="text"
|
||||
id="computador"
|
||||
name="computador"
|
||||
inputmode="numeric"
|
||||
maxlength="14"
|
||||
required
|
||||
oninput="this.value = this.value
|
||||
.replace(/\D/g,'')
|
||||
.replace(/(\d{3})(\d)/,'$1.$2')
|
||||
.replace(/(\d{3})\.(\d{3})(\d)/,'$1.$2.$3')
|
||||
.replace(/(\d{3})\.(\d{3})\.(\d{3})(\d{1,2})/,'$1.$2.$3-$4')
|
||||
.replace(/(-\d{2})\d+?$/,'$1');">
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<input type="checkbox" id="lembrar" name="lembrar">
|
||||
<label for="lembrar">Lembrar-me</label>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<button type="submit">LOGIN</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
11
Login/login.php
Normal file
11
Login/login.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-br">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
.
|
||||
</body>
|
||||
</html>
|
||||
7
Source/login.css
Normal file
7
Source/login.css
Normal file
@@ -0,0 +1,7 @@
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 100;
|
||||
padding: 0;
|
||||
font-family: 'Segoe UI';
|
||||
color: rgb(14, 18, 255);
|
||||
}
|
||||
173
Source/style.css
Normal file
173
Source/style.css
Normal file
@@ -0,0 +1,173 @@
|
||||
a/* Reset básico e Fonte */
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #f0f2f5;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* Painel de Botões */
|
||||
.painel-topo {
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 10px 15px;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
transition: 0.2s;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-danger { background-color: #e74c3c; }
|
||||
.btn-danger:hover { background-color: #c0392b; }
|
||||
|
||||
.btn-primary { background-color: #3498db; }
|
||||
.btn-success { background-color: #2ecc71; }
|
||||
|
||||
/* Estrutura da Tabela (Grid) */
|
||||
.tabela-container {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
overflow: hidden; /* Arredonda cantos */
|
||||
box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* Sombra suave */
|
||||
border: 1px solid #dcdcdc;
|
||||
}
|
||||
|
||||
/* Configuração das Colunas - IMPORTANTE */
|
||||
/* Define a largura fixa ou flexível de cada coluna */
|
||||
.grid-row {
|
||||
display: grid;
|
||||
/* 8 colunas: Data, Func, Dept, Aparelho(maior), Detalhe, OBS, Qtd, Ações */
|
||||
grid-template-columns: 90px 130px 100px 1.5fr 1fr 120px 80px 80px;
|
||||
border-bottom: 1px solid #eee;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* Cabeçalho Roxo */
|
||||
.header {
|
||||
background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%); /* Roxo para Azul */
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
padding: 12px 5px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.header div {
|
||||
padding: 0 5px;
|
||||
border-right: 1px solid rgba(255,255,255,0.2);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Linhas de Itens */
|
||||
.item {
|
||||
font-size: 13px;
|
||||
color: #333;
|
||||
padding: 10px 5px;
|
||||
transition: background 0.2s;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
/* Efeito Zebrado (Linhas alternadas) */
|
||||
.item:nth-child(even) {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
/* Hover na linha */
|
||||
.item:hover {
|
||||
background-color: #e8f0fe; /* Azulzinho claro ao passar mouse */
|
||||
}
|
||||
|
||||
.item div {
|
||||
padding: 0 8px;
|
||||
word-wrap: break-word; /* Quebra texto longo */
|
||||
}
|
||||
|
||||
.destaque-texto {
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Estilo da Lixeira e Checkbox */
|
||||
.acoes {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
color: #7f8c8d;
|
||||
transition: 0.2s;
|
||||
}
|
||||
|
||||
.btn-icon:hover {
|
||||
color: #e74c3c; /* Vermelho ao passar mouse na lixeira */
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.check-deletar {
|
||||
transform: scale(1.3);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* Responsividade (Celular) */
|
||||
@media (max-width: 992px) {
|
||||
.header { display: none; } /* Esconde cabeçalho no celular */
|
||||
|
||||
.grid-row {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid #ddd;
|
||||
margin-bottom: 15px;
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
.item div {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Cria os rótulos automaticamente no celular (Data:, Funcionario:, etc) */
|
||||
.item div::before {
|
||||
content: attr(data-label);
|
||||
font-weight: bold;
|
||||
color: #6a11cb;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.item div:last-child {
|
||||
border-bottom: none;
|
||||
justify-content: flex-end;
|
||||
padding-top: 15px;
|
||||
}
|
||||
}
|
||||
11
Telas/altFalta.php
Normal file
11
Telas/altFalta.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
Atualizado de novo.
|
||||
</body>
|
||||
</html>
|
||||
371
Telas/listFalta.php
Normal file
371
Telas/listFalta.php
Normal file
@@ -0,0 +1,371 @@
|
||||
<?php
|
||||
// 1. Pegamos a data atual para calcular a regra dos 10 dias no histórico
|
||||
$hoje = new DateTime();
|
||||
|
||||
// 2. Seu Banco de Dados (Array estático)
|
||||
$faltas = [
|
||||
["24/02/2026", "Edwarda Ingrid", "Capa Case", "14 pro max branca", "--", "para ter na loja", "1"],
|
||||
["23/02/2026", "Josiane Fagundes", "Capa Case", "iphone 17 pro max", "lilas, cinza", "para ter na loja", "1 de cada"],
|
||||
["24/02/2026", "Yasmin", "Capa Case", "poco f3", "vermelha, preta", "para ter na loja", "1 de cada"],
|
||||
["24/02/2026", "Yasmin", "Capa Case", "poco x5", "lilas, roxa", "para ter na loja", "1 de cada"],
|
||||
["12/02/2026", "Josiane Fagundes", "Capa Case", "SAMSUNG S26 FE", "todas as cores", "para ter na loja", "1 DE CADA"],
|
||||
["23/02/2026", "Aline Pinheiro", "Outro", "cartão memoria 64 gb", "sandisk", "--", "3 UNIDADES"],
|
||||
// Item Entregue (Identificado pelo ✅)
|
||||
["20/02/2026", "Edwarda Ingrid", "Outro", "CHAVEIRO ROSA", "CONSULTAR", "encomenda", "✅"],
|
||||
// Item antigo (Mais de 10 dias) - Esse não vai aparecer na tela por causa da regra do PHP!
|
||||
["10/01/2026", "Sistema", "Outro", "Item Antigo (Sumiu)", "--", "--", "✅"]
|
||||
];
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-br">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Big Cell - Controle de Faltas</title>
|
||||
|
||||
<link rel="stylesheet" href="lista.css">
|
||||
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="fundo-fluxo"></div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="painel-topo">
|
||||
<button class="btn btn-roxo-escuro" onclick="abrirModal()">
|
||||
<span class="material-icons">add_circle</span> Adicionar Item
|
||||
</button>
|
||||
|
||||
<button class="btn btn-roxo-medio" onclick="entregarSelecionados()">
|
||||
<span class="material-icons">done_all</span> Concluir Selecionados
|
||||
</button>
|
||||
|
||||
<button class="btn btn-cinza" onclick="forcarMobile()">
|
||||
<span class="material-icons">smartphone</span> Versão Móvel
|
||||
</button>
|
||||
|
||||
<div class="divisor"></div>
|
||||
|
||||
<button class="btn-aba ativo" onclick="filtrarAbas('pendente', this)">Pendentes</button>
|
||||
<button class="btn-aba" onclick="filtrarAbas('entregue', this)">Histórico Entregues</button>
|
||||
</div>
|
||||
|
||||
<div class="tabela-container">
|
||||
<div class="grid-row header">
|
||||
<div class="center" style="width: 30px;">
|
||||
<input type="checkbox" onchange="selecionarTodos(this)">
|
||||
</div>
|
||||
<div>Data</div>
|
||||
<div>Funcionário</div>
|
||||
<div>Depto.</div>
|
||||
<div>Aparelho</div>
|
||||
<div>Detalhe</div>
|
||||
<div>OBS Loja</div>
|
||||
<div>Qtd</div>
|
||||
<div class="center">Ações</div>
|
||||
</div>
|
||||
|
||||
<div id="lista-corpo">
|
||||
<?php
|
||||
foreach ($faltas as $index => $item):
|
||||
$isEntregue = strpos($item[6], '✅') !== false;
|
||||
$classeStatus = $isEntregue ? "entregue" : "pendente";
|
||||
|
||||
// REGRA DOS 10 DIAS
|
||||
if ($isEntregue) {
|
||||
$dataItem = DateTime::createFromFormat('d/m/Y', $item[0]);
|
||||
if ($dataItem) {
|
||||
$diasPassados = $hoje->diff($dataItem)->days;
|
||||
if ($diasPassados > 10) {
|
||||
continue; // Pula este item se passou do prazo
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="grid-row item <?php echo $classeStatus; ?>" id="linha-<?php echo $index; ?>">
|
||||
<div class="center" data-label="Sel">
|
||||
<?php if(!$isEntregue): ?>
|
||||
<input type="checkbox" class="check-item">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div data-label="Data"><?php echo $item[0]; ?></div>
|
||||
<div data-label="Funcionário"><?php echo $item[1]; ?></div>
|
||||
<div data-label="Depto."><?php echo $item[2]; ?></div>
|
||||
<div data-label="Aparelho" class="destaque-texto"><?php echo $item[3]; ?></div>
|
||||
<div data-label="Detalhe"><?php echo $item[4]; ?></div>
|
||||
<div data-label="OBS"><?php echo $item[5]; ?></div>
|
||||
<div data-label="Qtd"><?php echo $item[6]; ?></div>
|
||||
|
||||
<div data-label="Ações" class="acoes center">
|
||||
<?php if(!$isEntregue): ?>
|
||||
<button class="btn-icon icone-roxo" onclick="marcarComoEntregue(this)" title="Marcar Entregue">
|
||||
<span class="material-icons">check_circle</span>
|
||||
</button>
|
||||
<?php else: ?>
|
||||
<span style="color: #5B2A86; font-weight: bold; font-size: 12px;">✅</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<button class="btn-icon icone-excluir" onclick="deletarLinha(this)" title="Excluir">
|
||||
<span class="material-icons">delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modal-adicionar" class="modal-overlay">
|
||||
<div class="modal-box">
|
||||
<div class="modal-header">
|
||||
<h2>Adicionar Pedido</h2>
|
||||
<span class="close-btn" onclick="fecharModal()">×</span>
|
||||
</div>
|
||||
|
||||
<div class="form-grid">
|
||||
<div class="campo-full">
|
||||
<label>Data</label>
|
||||
<input type="date" id="inp-data" class="input-form">
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>Funcionário</label>
|
||||
<select id="inp-func" class="input-form">
|
||||
<option value="">Selecione...</option>
|
||||
<option value="Edwarda Ingrid">Edwarda Ingrid</option>
|
||||
<option value="Josiane Fagundes">Josiane Fagundes</option>
|
||||
<option value="Yasmin">Yasmin</option>
|
||||
<option value="Aline Pinheiro">Aline Pinheiro</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>Departamento</label>
|
||||
<select id="inp-depto" class="input-form">
|
||||
<option value="Capa Case">Capa Case</option>
|
||||
<option value="Pelicula">Pelicula</option>
|
||||
<option value="Outro">Outro</option>
|
||||
<option value="Eletrônicos">Eletrônicos</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>Aparelho</label>
|
||||
<input type="text" id="inp-aparelho" placeholder="Ex: iPhone 13 Pro Max" class="input-form">
|
||||
</div>
|
||||
|
||||
<div class="campo-duplo">
|
||||
<div>
|
||||
<label>Detalhe</label>
|
||||
<input type="text" id="inp-detalhe" placeholder="Cor, Tipo..." class="input-form">
|
||||
</div>
|
||||
<div>
|
||||
<label>Qtd</label>
|
||||
<input type="number" id="inp-qtd" value="1" min="1" class="input-form">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>OBS Loja</label>
|
||||
<input type="text" id="inp-obs" value="para ter na loja" class="input-form">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-buttons">
|
||||
<button class="btn btn-cinza" onclick="fecharModal()">Cancelar</button>
|
||||
<button class="btn btn-roxo-escuro" onclick="salvarNovoItem()">Salvar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="listfalta.js"></script>
|
||||
</body>
|
||||
</html><?php
|
||||
// 1. Pegamos a data atual para calcular a regra dos 10 dias no histórico
|
||||
$hoje = new DateTime();
|
||||
|
||||
// 2. Seu Banco de Dados (Array estático)
|
||||
$faltas = [
|
||||
["24/02/2026", "Edwarda Ingrid", "Capa Case", "14 pro max branca", "--", "para ter na loja", "1"],
|
||||
["23/02/2026", "Josiane Fagundes", "Capa Case", "iphone 17 pro max", "lilas, cinza", "para ter na loja", "1 de cada"],
|
||||
["24/02/2026", "Yasmin", "Capa Case", "poco f3", "vermelha, preta", "para ter na loja", "1 de cada"],
|
||||
["24/02/2026", "Yasmin", "Capa Case", "poco x5", "lilas, roxa", "para ter na loja", "1 de cada"],
|
||||
["12/02/2026", "Josiane Fagundes", "Capa Case", "SAMSUNG S26 FE", "todas as cores", "para ter na loja", "1 DE CADA"],
|
||||
["23/02/2026", "Aline Pinheiro", "Outro", "cartão memoria 64 gb", "sandisk", "--", "3 UNIDADES"],
|
||||
// Item Entregue (Identificado pelo ✅)
|
||||
["20/02/2026", "Edwarda Ingrid", "Outro", "CHAVEIRO ROSA", "CONSULTAR", "encomenda", "✅"],
|
||||
// Item antigo (Mais de 10 dias) - Esse não vai aparecer na tela por causa da regra do PHP!
|
||||
["10/01/2026", "Sistema", "Outro", "Item Antigo (Sumiu)", "--", "--", "✅"]
|
||||
];
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-br">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Big Cell - Controle de Faltas</title>
|
||||
|
||||
<link rel="stylesheet" href="lista.css">
|
||||
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="fundo-fluxo"></div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="painel-topo">
|
||||
<button class="btn btn-roxo-escuro" onclick="abrirModal()">
|
||||
<span class="material-icons">add_circle</span> Adicionar Item
|
||||
</button>
|
||||
|
||||
<button class="btn btn-roxo-medio" onclick="entregarSelecionados()">
|
||||
<span class="material-icons">done_all</span> Concluir Selecionados
|
||||
</button>
|
||||
|
||||
<button class="btn btn-cinza" onclick="forcarMobile()">
|
||||
<span class="material-icons">smartphone</span> Versão Móvel
|
||||
</button>
|
||||
|
||||
<div class="divisor"></div>
|
||||
|
||||
<button class="btn-aba ativo" onclick="filtrarAbas('pendente', this)">Pendentes</button>
|
||||
<button class="btn-aba" onclick="filtrarAbas('entregue', this)">Histórico Entregues</button>
|
||||
</div>
|
||||
|
||||
<div class="tabela-container">
|
||||
<div class="grid-row header">
|
||||
<div class="center" style="width: 30px;">
|
||||
<input type="checkbox" onchange="selecionarTodos(this)">
|
||||
</div>
|
||||
<div>Data</div>
|
||||
<div>Funcionário</div>
|
||||
<div>Depto.</div>
|
||||
<div>Aparelho</div>
|
||||
<div>Detalhe</div>
|
||||
<div>OBS Loja</div>
|
||||
<div>Qtd</div>
|
||||
<div class="center">Ações</div>
|
||||
</div>
|
||||
|
||||
<div id="lista-corpo">
|
||||
<?php
|
||||
foreach ($faltas as $index => $item):
|
||||
$isEntregue = strpos($item[6], '✅') !== false;
|
||||
$classeStatus = $isEntregue ? "entregue" : "pendente";
|
||||
|
||||
// REGRA DOS 10 DIAS
|
||||
if ($isEntregue) {
|
||||
$dataItem = DateTime::createFromFormat('d/m/Y', $item[0]);
|
||||
if ($dataItem) {
|
||||
$diasPassados = $hoje->diff($dataItem)->days;
|
||||
if ($diasPassados > 10) {
|
||||
continue; // Pula este item se passou do prazo
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="grid-row item <?php echo $classeStatus; ?>" id="linha-<?php echo $index; ?>">
|
||||
<div class="center" data-label="Sel">
|
||||
<?php if(!$isEntregue): ?>
|
||||
<input type="checkbox" class="check-item">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div data-label="Data"><?php echo $item[0]; ?></div>
|
||||
<div data-label="Funcionário"><?php echo $item[1]; ?></div>
|
||||
<div data-label="Depto."><?php echo $item[2]; ?></div>
|
||||
<div data-label="Aparelho" class="destaque-texto"><?php echo $item[3]; ?></div>
|
||||
<div data-label="Detalhe"><?php echo $item[4]; ?></div>
|
||||
<div data-label="OBS"><?php echo $item[5]; ?></div>
|
||||
<div data-label="Qtd"><?php echo $item[6]; ?></div>
|
||||
|
||||
<div data-label="Ações" class="acoes center">
|
||||
<?php if(!$isEntregue): ?>
|
||||
<button class="btn-icon icone-roxo" onclick="marcarComoEntregue(this)" title="Marcar Entregue">
|
||||
<span class="material-icons">check_circle</span>
|
||||
</button>
|
||||
<?php else: ?>
|
||||
<span style="color: #5B2A86; font-weight: bold; font-size: 12px;">✅</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<button class="btn-icon icone-excluir" onclick="deletarLinha(this)" title="Excluir">
|
||||
<span class="material-icons">delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modal-adicionar" class="modal-overlay">
|
||||
<div class="modal-box">
|
||||
<div class="modal-header">
|
||||
<h2>Adicionar Pedido</h2>
|
||||
<span class="close-btn" onclick="fecharModal()">×</span>
|
||||
</div>
|
||||
|
||||
<div class="form-grid">
|
||||
<div class="campo-full">
|
||||
<label>Data</label>
|
||||
<input type="date" id="inp-data" class="input-form">
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>Funcionário</label>
|
||||
<select id="inp-func" class="input-form">
|
||||
<option value="">Selecione...</option>
|
||||
<option value="Edwarda Ingrid">Edwarda Ingrid</option>
|
||||
<option value="Josiane Fagundes">Josiane Fagundes</option>
|
||||
<option value="Yasmin">Yasmin</option>
|
||||
<option value="Aline Pinheiro">Aline Pinheiro</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>Departamento</label>
|
||||
<select id="inp-depto" class="input-form">
|
||||
<option value="Capa Case">Capa Case</option>
|
||||
<option value="Pelicula">Pelicula</option>
|
||||
<option value="Outro">Outro</option>
|
||||
<option value="Eletrônicos">Eletrônicos</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>Aparelho</label>
|
||||
<input type="text" id="inp-aparelho" placeholder="Ex: iPhone 13 Pro Max" class="input-form">
|
||||
</div>
|
||||
|
||||
<div class="campo-duplo">
|
||||
<div>
|
||||
<label>Detalhe</label>
|
||||
<input type="text" id="inp-detalhe" placeholder="Cor, Tipo..." class="input-form">
|
||||
</div>
|
||||
<div>
|
||||
<label>Qtd</label>
|
||||
<input type="number" id="inp-qtd" value="1" min="1" class="input-form">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="campo-full">
|
||||
<label>OBS Loja</label>
|
||||
<input type="text" id="inp-obs" value="para ter na loja" class="input-form">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-buttons">
|
||||
<button class="btn btn-cinza" onclick="fecharModal()">Cancelar</button>
|
||||
<button class="btn btn-roxo-escuro" onclick="salvarNovoItem()">Salvar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="listfalta.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
164
Telas/lista.css
Normal file
164
Telas/lista.css
Normal file
@@ -0,0 +1,164 @@
|
||||
/* --- Reset e Base --- */
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, sans-serif; }
|
||||
|
||||
body {
|
||||
background-color: #111;
|
||||
padding: 20px;
|
||||
min-height: 100vh;
|
||||
position: relative;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
/* --- O FLUXO ROXO (FUNDO ANIMADO) --- */
|
||||
.fundo-fluxo {
|
||||
position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
|
||||
}
|
||||
|
||||
.fundo-fluxo::after {
|
||||
content: ''; position: absolute;
|
||||
bottom: -150vh; left: 10%; width: 80vw; height: 150vh;
|
||||
background: radial-gradient(ellipse at center, rgba(54, 5, 104, 0.8) 0%, transparent 60%);
|
||||
filter: blur(50px);
|
||||
animation: subirFluxo 15s infinite linear;
|
||||
}
|
||||
|
||||
@keyframes subirFluxo {
|
||||
0% { transform: translateY(50%); opacity: 0.5; }
|
||||
50% { opacity: 1; }
|
||||
100% { transform: translateY(-100%); opacity: 0.5; }
|
||||
}
|
||||
|
||||
/* --- CONTAINER E TABELA --- */
|
||||
.container {
|
||||
max-width: 1200px; margin: 0 auto;
|
||||
}
|
||||
|
||||
.painel-topo {
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
padding: 15px; border-radius: 8px; margin-bottom: 20px;
|
||||
display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
|
||||
box-shadow: 0 4px 10px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
.tabela-container {
|
||||
background: white; border-radius: 8px; overflow: hidden;
|
||||
box-shadow: 0 4px 15px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
/* --- BOTÕES --- */
|
||||
.btn {
|
||||
padding: 10px 15px; border: none; border-radius: 5px; cursor: pointer;
|
||||
font-weight: bold; font-size: 13px; display: flex; align-items: center; gap: 5px;
|
||||
color: white; transition: 0.2s;
|
||||
}
|
||||
.btn:hover { opacity: 0.9; transform: scale(1.02); }
|
||||
|
||||
.btn-roxo-escuro { background-color: #360568; }
|
||||
.btn-roxo-medio { background-color: #5B2A86; }
|
||||
.btn-cinza { background-color: #6c757d; }
|
||||
|
||||
/* Botões de Filtro */
|
||||
.btn-aba {
|
||||
background: transparent; color: #777; border: none; font-weight: bold;
|
||||
padding: 10px; cursor: pointer; border-bottom: 2px solid transparent; transition: 0.2s;
|
||||
}
|
||||
.btn-aba:hover { color: #360568; }
|
||||
.btn-aba.ativo { color: #360568; border-bottom: 2px solid #360568; }
|
||||
|
||||
.divisor { width: 1px; height: 30px; background: #ddd; margin: 0 10px; }
|
||||
|
||||
/* --- A GRID DA TABELA --- */
|
||||
.grid-row {
|
||||
display: grid;
|
||||
grid-template-columns: 30px 90px 130px 100px 1.5fr 1fr 100px 50px 120px;
|
||||
border-bottom: 1px solid #eee; align-items: center;
|
||||
}
|
||||
|
||||
.header {
|
||||
background: #f4f4f4; color: #444; font-weight: bold; font-size: 12px;
|
||||
padding: 15px 10px; text-transform: uppercase; border-bottom: 2px solid #ddd;
|
||||
}
|
||||
|
||||
.item { font-size: 13px; color: #333; padding: 10px; transition: 0.2s; }
|
||||
.item:hover { background-color: #f9f9f9; }
|
||||
|
||||
/* Item Entregue */
|
||||
.item.entregue { background-color: #f0fdf4; opacity: 0.8; }
|
||||
.item.entregue .destaque-texto { color: #888; text-decoration: line-through; }
|
||||
|
||||
.item div { word-wrap: break-word; overflow: hidden; }
|
||||
.destaque-texto { font-weight: bold; color: #360568; }
|
||||
.center { text-align: center; justify-content: center; display: flex; align-items: center; }
|
||||
|
||||
/* --- AÇÕES NA TABELA --- */
|
||||
.acoes { display: flex; gap: 8px; align-items: center; justify-content: center; }
|
||||
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px; border-radius: 4px; transition: 0.2s; }
|
||||
.btn-icon:hover { background: #eee; transform: scale(1.1); }
|
||||
.icone-roxo { color: #5B2A86; }
|
||||
.icone-excluir { color: #555; }
|
||||
.icone-excluir:hover { color: #d32f2f; }
|
||||
|
||||
/* --- MODAL --- */
|
||||
.modal-overlay {
|
||||
display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
|
||||
background: rgba(0,0,0,0.7); justify-content: center; align-items: center; z-index: 999;
|
||||
}
|
||||
.modal-box {
|
||||
background: white; padding: 25px; border-radius: 8px; width: 95%; max-width: 500px;
|
||||
border-top: 5px solid #360568; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
|
||||
}
|
||||
.modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; }
|
||||
.modal-header h2 { color: #360568; font-size: 18px; margin: 0; }
|
||||
.close-btn { font-size: 24px; cursor: pointer; color: #999; }
|
||||
.close-btn:hover { color: #333; }
|
||||
.form-grid { display: flex; flex-direction: column; gap: 12px; }
|
||||
.campo-full { width: 100%; }
|
||||
.campo-duplo { display: flex; gap: 10px; }
|
||||
.campo-duplo div { flex: 1; }
|
||||
label { display: block; font-size: 12px; font-weight: bold; color: #555; margin-bottom: 4px; }
|
||||
.input-form { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
|
||||
.input-form:focus { border-color: #360568; outline: none; }
|
||||
.modal-buttons { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }
|
||||
|
||||
/* =======================================================
|
||||
VERSÃO MÓVEL (SEM ERROS NO VS CODE)
|
||||
======================================================= */
|
||||
.tabela-container.mobile-mode .header { display: none; }
|
||||
|
||||
.tabela-container.mobile-mode .grid-row {
|
||||
display: flex; flex-direction: column; margin-bottom: 15px;
|
||||
border: 1px solid #ccc; border-radius: 8px; padding: 15px; background: white;
|
||||
}
|
||||
|
||||
.tabela-container.mobile-mode .item div {
|
||||
display: flex; justify-content: space-between; padding: 8px 0;
|
||||
border-bottom: 1px solid #eee; width: 100%; text-align: right;
|
||||
}
|
||||
|
||||
.tabela-container.mobile-mode .item div::before {
|
||||
content: attr(data-label); font-weight: bold; color: #360568;
|
||||
text-transform: uppercase; font-size: 11px; margin-right: 10px; text-align: left;
|
||||
}
|
||||
|
||||
.tabela-container.mobile-mode .item div:last-child { border-bottom: none; }
|
||||
.tabela-container.mobile-mode .acoes { justify-content: flex-end; padding-top: 10px; }
|
||||
|
||||
/* Regra para celular real (Media Query) */
|
||||
@media (max-width: 900px) {
|
||||
.header { display: none; }
|
||||
|
||||
.grid-row {
|
||||
display: flex; flex-direction: column; margin-bottom: 15px;
|
||||
border: 1px solid #ccc; border-radius: 8px; padding: 15px; background: white;
|
||||
}
|
||||
.item div {
|
||||
display: flex; justify-content: space-between; padding: 8px 0;
|
||||
border-bottom: 1px solid #eee; width: 100%; text-align: right;
|
||||
}
|
||||
.item div::before {
|
||||
content: attr(data-label); font-weight: bold; color: #360568;
|
||||
text-transform: uppercase; font-size: 11px; margin-right: 10px; text-align: left;
|
||||
}
|
||||
.item div:last-child { border-bottom: none; }
|
||||
.acoes { justify-content: flex-end; padding-top: 10px; }
|
||||
}
|
||||
123
Telas/listfalta.js
Normal file
123
Telas/listfalta.js
Normal file
@@ -0,0 +1,123 @@
|
||||
let abaAtual = 'pendente';
|
||||
|
||||
// --- 1. MODAL ---
|
||||
function abrirModal() {
|
||||
document.getElementById('modal-adicionar').style.display = 'flex';
|
||||
document.getElementById('inp-data').value = new Date().toISOString().split('T')[0];
|
||||
}
|
||||
|
||||
function fecharModal() {
|
||||
document.getElementById('modal-adicionar').style.display = 'none';
|
||||
document.getElementById('inp-aparelho').value = '';
|
||||
document.getElementById('inp-detalhe').value = '';
|
||||
}
|
||||
|
||||
function salvarNovoItem() {
|
||||
let data = document.getElementById('inp-data').value;
|
||||
let func = document.getElementById('inp-func').value;
|
||||
let depto = document.getElementById('inp-depto').value;
|
||||
let aparelho = document.getElementById('inp-aparelho').value;
|
||||
let detalhe = document.getElementById('inp-detalhe').value || "--";
|
||||
let qtd = document.getElementById('inp-qtd').value;
|
||||
let obs = document.getElementById('inp-obs').value;
|
||||
|
||||
if (aparelho === "" || func === "") {
|
||||
alert("Preencha o Funcionário e o Aparelho!");
|
||||
return;
|
||||
}
|
||||
|
||||
let dataFormatada = data ? data.split('-').reverse().join('/') : "Hoje";
|
||||
|
||||
const novaLinha = document.createElement('div');
|
||||
novaLinha.className = 'grid-row item pendente';
|
||||
|
||||
novaLinha.innerHTML = `
|
||||
<div class="center" data-label="Sel"><input type="checkbox" class="check-item"></div>
|
||||
<div data-label="Data">${dataFormatada}</div>
|
||||
<div data-label="Funcionário">${func}</div>
|
||||
<div data-label="Depto.">${depto}</div>
|
||||
<div data-label="Aparelho" class="destaque-texto">${aparelho}</div>
|
||||
<div data-label="Detalhe">${detalhe}</div>
|
||||
<div data-label="OBS">${obs}</div>
|
||||
<div data-label="Qtd">${qtd}</div>
|
||||
<div data-label="Ações" class="acoes center">
|
||||
<button class="btn-icon icone-roxo" onclick="marcarComoEntregue(this)" title="Marcar Entregue">
|
||||
<span class="material-icons">check_circle</span>
|
||||
</button>
|
||||
<button class="btn-icon icone-excluir" onclick="deletarLinha(this)" title="Excluir">
|
||||
<span class="material-icons">delete</span>
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
document.getElementById('lista-corpo').prepend(novaLinha);
|
||||
fecharModal();
|
||||
aplicarFiltro();
|
||||
}
|
||||
|
||||
// --- 2. EXCLUSÃO E BAIXA ---
|
||||
function deletarLinha(botao) {
|
||||
if(confirm("Deseja excluir este registro do sistema?")) {
|
||||
botao.closest('.grid-row').remove();
|
||||
}
|
||||
}
|
||||
|
||||
function marcarComoEntregue(botao) {
|
||||
if(confirm("Confirmar a entrega deste item?")) {
|
||||
let linha = botao.closest('.grid-row');
|
||||
linha.classList.remove('pendente');
|
||||
linha.classList.add('entregue');
|
||||
|
||||
let acoes = linha.querySelector('.acoes');
|
||||
acoes.innerHTML = `
|
||||
<span style="color: #5B2A86; font-weight: bold; font-size: 12px;">✅</span>
|
||||
<button class="btn-icon icone-excluir" onclick="deletarLinha(this)"><span class="material-icons">delete</span></button>
|
||||
`;
|
||||
linha.querySelector('input[type="checkbox"]').style.display = 'none';
|
||||
|
||||
aplicarFiltro();
|
||||
}
|
||||
}
|
||||
|
||||
// --- 3. SELEÇÃO EM MASSA ---
|
||||
function selecionarTodos(chkMestre) {
|
||||
document.querySelectorAll('.check-item').forEach(c => c.checked = chkMestre.checked);
|
||||
}
|
||||
|
||||
function entregarSelecionados() {
|
||||
const checks = document.querySelectorAll('.check-item:checked');
|
||||
if(checks.length > 0 && confirm(`Baixar ${checks.length} itens selecionados?`)) {
|
||||
checks.forEach(chk => {
|
||||
let btn = chk.closest('.grid-row').querySelector('.icone-roxo');
|
||||
if(btn) marcarComoEntregue(btn);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// --- 4. ABAS E MODO MOBILE ---
|
||||
function filtrarAbas(tipo, botao) {
|
||||
abaAtual = tipo;
|
||||
document.querySelectorAll('.btn-aba').forEach(b => b.classList.remove('ativo'));
|
||||
botao.classList.add('ativo');
|
||||
aplicarFiltro();
|
||||
}
|
||||
|
||||
function aplicarFiltro() {
|
||||
const linhas = document.querySelectorAll('.item');
|
||||
const isMobile = document.querySelector('.tabela-container').classList.contains('mobile-mode');
|
||||
|
||||
linhas.forEach(linha => {
|
||||
if(linha.classList.contains(abaAtual)) {
|
||||
linha.style.display = isMobile ? 'flex' : 'grid';
|
||||
} else {
|
||||
linha.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function forcarMobile() {
|
||||
document.querySelector('.tabela-container').classList.toggle('mobile-mode');
|
||||
aplicarFiltro();
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', aplicarFiltro);
|
||||
75
index.php
Normal file
75
index.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-br">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>BigCell Celulares - Login</title>
|
||||
<link rel="stylesheet" href="Source/login.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="login-container">
|
||||
<h1>BigCell Celulares</h1>
|
||||
|
||||
<form action="login.php" method="POST">
|
||||
|
||||
<div>
|
||||
<label for="usuario">Usuário:</label>
|
||||
<input type="text" id="usuario" name="usuario" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<label for="senha">Senha:</label>
|
||||
<input type="password" id="senha" name="senha" required>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<label for="loja">Loja:</label>
|
||||
<select id="loja" name="loja">
|
||||
<option value="BigCell">BigCell</option>
|
||||
<option value="Loja1">Loja 1</option>
|
||||
<option value="Loja2">Loja 2</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<label for="computador">Computador:</label>
|
||||
<input
|
||||
type="text"
|
||||
id="computador"
|
||||
name="computador"
|
||||
inputmode="numeric"
|
||||
maxlength="14"
|
||||
required
|
||||
oninput="this.value = this.value
|
||||
.replace(/\D/g,'')
|
||||
.replace(/(\d{3})(\d)/,'$1.$2')
|
||||
.replace(/(\d{3})\.(\d{3})(\d)/,'$1.$2.$3')
|
||||
.replace(/(\d{3})\.(\d{3})\.(\d{3})(\d{1,2})/,'$1.$2.$3-$4')
|
||||
.replace(/(-\d{2})\d+?$/,'$1');">
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<input type="checkbox" id="lembrar" name="lembrar">
|
||||
<label for="lembrar">Lembrar-me</label>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<button type="submit">LOGIN</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
2
robots.txt
Normal file
2
robots.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow: /
|
||||
Reference in New Issue
Block a user