public function listar($ordem = "ASC", $campo = self::ID) { $info = parent::listar($ordem, $campo); if (!empty($info)) { $temp = new Pedido($info[self::ID]); $temp->setIdSessao($info[self::IDSESSAO]); $temp->quantidade = $info[self::QUANTIDADE]; $temp->observacoes = $info[self::OBSERVACOES]; $temp->estoque = $info[self::ESTOQUE]; $temp->setData(new DataHora($info[self::DATA])); $temp->setStatus($info[self::STATUS]); $temp->estoque = $info[self::ESTOQUE]; $temp->setDesconto($info[self::DESCONTO]); $temp->setTipoPagamento($info[self::TIPOPAGAMENTO]); $temp->setValor($info[self::VALOR]); $temp->setVendedor($info[self::VENDEDOR]); $lPEE = new ListaPedidoEnderecoEntregas(); $lPEE->condicoes('', $temp->getId(), ListaPedidoEnderecoEntregas::IDSESSAO); if ($lPEE->getTotal() > 0) { $temp->setEndereco($lPEE->listar()); } $lP = new ListaPessoas(); $lP->condicoes('', $info[self::IDSESSAO], ListaPessoas::ID); if ($lP->getTotal() > 0) { $temp->setCliente($lP->listar()); } return $temp; } }
function repeatTemplateByArray($con) { global $iGR; $lP = new ListaPessoas(); while ($rs = $con->getRegistro()) { if ($rs['valorcompras'] > 0 && ($_POST['ordenar'] == 1 || $_POST['ordenar'] == 2) || $_POST['ordernar'] == null) { $lP->condicoes('', $rs['id'], ListaPessoas::ID); $p = $lP->listar(); $iGR->repetir('repetir->Clientes'); $iGR->enterRepeticao()->trocar('id.Cliente', $p->getId()); $iGR->enterRepeticao()->trocar('nome.Cliente', $p->nome); $iGR->enterRepeticao()->trocar('dataNascimento.Cliente', $p->getDataNasc() ? $p->getDataNasc()->mostrar() : ''); $iGR->enterRepeticao()->trocar('cpf.Cliente', $p->cpf ? $p->cpf : $p->cnpj); if ($p->getTelefone()->getTotal() > 0) { $tel = $p->getTelefone()->listar(); $iGR->enterRepeticao()->trocar('telefone.Telefone.Cliente', $tel->ddd . "-" . $tel->telefone); } if ($p->getEndereco()->getTotal() > 0) { $end = $p->getEndereco()->listar(); $iGR->enterRepeticao()->trocar('logradouro.Endereco.Cliente', $end->logradouro); $iGR->enterRepeticao()->trocar('numero.Endereco.Cliente', $end->numero); $iGR->enterRepeticao()->trocar('bairro.Endereco.Cliente', $end->bairro); $iGR->enterRepeticao()->trocar('cidade.Endereco.Cliente', $end->cidade); $iGR->enterRepeticao()->trocar('estado.Endereco.Cliente', $end->estado); $iGR->enterRepeticao()->trocar('cep.Endereco.Cliente', $end->getCep()); } if ($p->getEmail()->getTotal() > 0) { $email = $p->getEmail()->listar(); $iGR->enterRepeticao()->trocar('email.Email.Cliente', $email->email); } $iGR->enterRepeticao()->trocar('moeda', "R\$"); $iGR->enterRepeticao()->trocar('valorCompras.Cliente', Numero::__CreateNumero($rs['valorcompras'])->moeda()); } } }
public function listar($ordem = "ASC", $campo = self::ID) { $info = parent::listar($ordem, $campo); if (!empty($info)) { $temp = new Ticket($info[self::ID]); parent::resgatarObjetos($info); $lP = new ListaPessoas(); $lP->condicoes('', $info[self::CLIENTE], ListaPessoas::ID); if ($lP->getTotal() > 0) { $temp->setCliente($lP->listar()); } $temp->setNivel($info[self::NIVEL]); $temp->setStatus($info[self::STATUS]); $temp->setSatisfacao($info[self::SATISFACAO]); $temp->titulo = $info[self::TITULO]; $temp->setDataAlteracao(new DataHora($info[self::DATAHORA_ALTERACAO])); return $temp; } }
importar("TemTudoAqui.Usuarios.Lista.ListaPessoas"); $tituloPagina = 'Clientes'; $iTLCL = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaClientes/listarClientes.html")); $iTLCL->trocar("linkDeletar.Cliente", "?p=" . $_GET['p'] . "&a=" . $_GET['a'] . "&"); $iTLCL->trocar("linkBuscar.Cliente", "?p=" . $_GET['p'] . "&"); if (!empty($_GET['deletar'])) { $lP = new ListaPessoas(); $lP->condicoes('', $_GET['deletar'], ListaPessoas::ID); if ($lP->getTotal() > 0) { $lP->deletar($lP->listar()); $javaScript .= Aviso::criar("Cliente deletado com sucesso!"); } } $lP = new ListaPessoas(); $lP->condicoes($aP); $iTLCL->createRepeticao("repetir->Clientes"); if (!empty($_GET['busca'])) { $lP->condicoes('', "", '', '', "SELECT c.* FROM " . Sistema::$BDPrefixo . "pessoas c, " . Sistema::$BDPrefixo . "enderecos e WHERE ((c.nome LIKE '%" . $_GET['busca'] . "%' OR c.email LIKE '%" . $_GET['busca'] . "%') OR ((e.estado LIKE '%" . $_GET['busca'] . "%' OR e.cidade LIKE '%" . $_GET['busca'] . "%') AND c.id = e.ligacao))" . ($_SESSION['nivel'] == 3 ? " AND c.vendedor = '" . $_SESSION['idUsuario'] . "'" : "") . " GROUP BY c.id"); } elseif ($_SESSION['nivel'] == 3) { $lP->condicoes(array(1 => array("campo" => ListaPessoas::VENDEDOR, "valor" => $_SESSION['idUsuario']))); } $iTLCL->condicao("condicaoBusca", !empty($_SESSION['nivel'])); $iTLCL->trocar("linkCadastrar.Cliente", "?p=" . $_GET['p'] . "&a=cadastrarCliente"); $iTLCL->trocar('total.ListaClientes', $lP->getTotal()); $num = 40; $primeiro = $_GET['pag'] * $num; $total = $lP->getTotal(); $max = ceil($total / $num); $lP->setParametros($primeiro)->setParametros($num + $primeiro, 'limite'); while ($p = $lP->listar("ASC", ListaPessoas::NOME)) {
$javaScript .= Aviso::criar("Dados incompletos do telefone!"); } } if (!empty($_POST['email'])) { $e = new Email(); $e->descricao = $_POST['descricaoE']; $e->email = $_POST['email']; $cl->addEmail($e); } $javaScript .= Aviso::criar("Cliente salvo com sucesso!"); } else { $javaScript .= Aviso::criar($erro); } } $lCL = new ListaPessoas(); $cl = $lCL->condicoes('', $_GET['cliente'], ListaPessoas::ID)->listar(); if (!empty($_GET['endereco'])) { $lE = new ListaEnderecos(); $lE->condicoes('', $_GET['endereco'], ListaEnderecos::ID); if ($lE->getTotal() > 0) { $lE->deletar($lE->listar()); $javaScript .= Aviso::criar("Endereço deletado com sucesso!"); } } if (!empty($_GET['telefone'])) { $lT = new ListaTelefones(); $lT->condicoes('', $_GET['telefone'], ListaTelefones::ID); if ($lT->getTotal() > 0) { $lT->deletar($lT->listar()); $javaScript .= Aviso::criar("Telefone deletado com sucesso!"); }
importar("Utilidades.Tickets.Lista.ListaTickets"); $tituloPagina = 'Utilidades > Tickets > Cadastrar'; $iCT = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaUtilidades/ticket.html")); if (!empty($_POST)) { $erro = ''; if (empty($_POST['titulo'])) { $erro = "<b>Titulo</b> não preenchido!<br><br>"; } if (empty($erro)) { $ti = new Ticket(); $ti->titulo = $_POST['titulo']; $ti->setNivel($_POST['nivel']); $ti->setStatus($_POST['status']); $lP = new ListaPessoas(); $lP->condicoes('', $_POST['cliente'], ListaPessoas::ID); if ($lP->getTotal() > 0) { $ti->setCliente($lP->listar()); } $lT = new ListaTickets(); $lT->inserir($ti); if (!empty($_POST['texto'])) { $tP = new TicketPost(); $tP->texto = $_POST['texto']; $tP->nome = Sistema::$nomeEmpresa; $tP->setDataHora(new DataHora()); if (!empty($_FILES['arquivo']['name'])) { $tP->setArquivo(Arquivos::__OpenArquivoByTEMP($_FILES['arquivo'])); } $ti->addPostagem($tP); }