public function inserir(PerguntaCategoria &$t)
 {
     parent::inserir($t);
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::TITULO . ", " . self::ORDEM . ") VALUES('" . $t->titulo . "','" . $t->ordem . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
 }
 public function inserir(NoticiaUrgente &$t)
 {
     parent::inserir($t);
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::NOTICIA . ", " . self::ORDEM . ", " . self::DATA . ") VALUES('" . $t->noticia . "','" . $t->ordem . "','" . $t->getData()->mostrar('YmdHi') . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
 }
Exemplo n.º 3
0
 public function inserir(Email &$email, $ligacao)
 {
     parent::inserir($email);
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::PESSOA . ", " . self::DESCRICAO . ", " . self::EMAIL . ", " . self::PRINCIPAL . ") VALUES('" . $ligacao->getId() . "','" . $email->descricao . "','" . $email->email . "','" . ($email->principal ? self::VALOR_PRINCIPAL_TRUE : self::VALOR_PRINCIPAL_FALSE) . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $email = $l->listar();
     parent::alterar($email);
 }
Exemplo n.º 4
0
 public function inserir(Galeria &$g)
 {
     parent::inserir($g);
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::TITULO . ", " . parent::URL . ", " . self::DESCRICAO . ", " . self::LOCAL . ", " . self::TIPO . ", " . self::DATA . ", " . self::VIDEO . ") VALUES('" . $g->titulo . "','" . $g->getURL()->getId() . "','" . $g->descricao . "','" . $g->local . "','" . $g->tipo . "','" . $g->getData()->mostrar("YmdHi") . "','" . $g->getVideo() . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $g = $l->listar();
     parent::alterar($g);
 }
 public function inserir(BannerCategoria &$t)
 {
     parent::inserir($t);
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::TITULO . ", " . self::LARGURA . ", " . self::ALTURA . ") VALUES('" . $t->titulo . "','" . $t->getLargura()->formatar() . "','" . $t->getAltura()->formatar() . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
 }
 public function inserir(OfertaColetiva &$p)
 {
     parent::inserir($p);
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . parent::URL . ", " . self::EMPRESA . ", " . self::TITULO . ", " . self::SUBTITULO . ", " . self::DESTAQUES . ", " . self::REGULAMENTO . ", " . self::VALORORIGINAL . ", " . self::DESCONTO . ", " . self::ECONOMIA . ", " . self::VALOR . ", " . self::DATAINICIO . ", " . self::DATAFIM . ", " . self::QUANTIDADE . ", " . self::COMPRASMINIMA . ", " . self::COMPRASMAXIMA . ") VALUES('" . $p->getURL()->getId() . "','" . $p->getEmpresa()->getId() . "','" . $p->titulo . "','" . $p->subTitulo . "','" . $p->destaques . "','" . $p->regulamento . "','" . $p->valorOriginal->formatar() . "','" . $p->desconto->formatar() . "','" . $p->economia->formatar() . "','" . $p->valor->formatar() . "','" . $p->getDataInicio()->mostrar("YmdHi") . "','" . $p->getDataFim()->mostrar("YmdHi") . "','" . $p->quantidade . "','" . $p->comprasMinima . "','" . $p->comprasMaxima . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $p = $l->listar();
     parent::alterar($p);
 }
Exemplo n.º 7
0
 public function inserir(Telefone &$tel, $ligacao)
 {
     parent::inserir($tel);
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::IDSESSAO . ", " . self::LOCAL . ", " . self::DDD . ", " . self::TELEFONE . ", " . self::RAMAL . ") VALUES('" . $ligacao->getId() . "','" . $tel->local . "','" . $tel->ddd . "','" . $tel->telefone . "','" . $tel->ramal . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $tel = $l->listar();
     parent::alterar($tel);
 }
Exemplo n.º 8
0
 public function inserir(Mailing &$t)
 {
     parent::inserir($t);
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::PACOTE . ", " . parent::TEXTO . ", " . self::STATUS . ", " . self::DATA . ") VALUES('" . $t->getPacote()->getId() . "','" . $t->getTexto()->getId() . "','" . $t->getStatus() . "','" . $t->getData()->mostrar("YmdHi") . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
 }
Exemplo n.º 9
0
 public function inserir(Evento &$t)
 {
     parent::inserir($t);
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . parent::URL . ", " . parent::TEXTO . ", " . self::DATA . ", " . self::LOCAL . ") VALUES('" . $t->getURL()->getId() . "','" . $t->getTexto()->getId() . "','" . $t->getData()->mostrar("Ymd") . "','" . $t->local . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
 }
Exemplo n.º 10
0
 public function inserir(Recado &$t)
 {
     parent::inserir($t);
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::SESSAO . ", " . self::IDSESSAO . ", " . parent::TEXTO . ", " . self::DATA . ", " . self::LOCAL . ", " . self::NOME . ", " . self::EMAIL . ", " . self::LIBERADO . ") VALUES('" . $t->getSessao() . "','" . $t->getIdSessao() . "','" . $t->getTexto()->getId() . "','" . $t->getData()->mostrar("YmdHi") . "','" . $t->local . "','" . $t->nome . "','" . $t->email . "','" . ($t->getSituacao() ? self::VALOR_LIBERADO_TRUE : self::VALOR_LIBERADO_FALSE) . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
 }
Exemplo n.º 11
0
 public function inserir(Ticket &$t)
 {
     parent::inserir($t);
     $dT = new DataHora();
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::CLIENTE . ", " . self::TITULO . ", " . self::NIVEL . ", " . self::STATUS . ", " . self::SATISFACAO . ", " . self::DATAHORA_CRIACAO . ", " . self::DATAHORA_ALTERACAO . ") VALUES('" . $t->getCliente()->getId() . "','" . $t->titulo . "','" . $t->getNivel() . "','" . $t->getStatus() . "','" . $t->getSatisfacao() . "','" . $dT->mostrar("YmdHi") . "','" . $dT->mostrar("YmdHi") . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
 }
Exemplo n.º 12
0
 public function inserir(Pedido &$p)
 {
     parent::inserir($p);
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::IDSESSAO . ", " . self::QUANTIDADE . ", " . self::OBSERVACOES . ", " . self::TIPOPAGAMENTO . ", " . self::VALOR . ", " . self::DESCONTO . ", " . self::DATA . ", " . self::STATUS . ") VALUES('" . $p->getCliente()->getId() . "','" . $p->quantidade . "','" . $p->observacoes . "','" . $p->getTipoPagamento() . "','" . $p->calcular()->getValor()->formatar() . "','" . $p->getDesconto()->num . "','" . $p->getData()->mostrar('YmdHi') . "','" . $p->getStatus()->getStatus() . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $lP = new $class();
     $temp = $lP->condicoes('', $id, self::ID)->listar();
     $p = $temp;
     $lPEE = new ListaPedidoEnderecoEntregas();
     $lPEE->inserir($p->getEndereco(), $p);
     parent::alterar($p);
 }
 public function inserir(&$pes)
 {
     parent::inserir($pes);
     if ($pes->getFoto()->nome != '') {
         $foto = $pes->getFoto()->saveImage(Sistema::$caminhoDiretorio . Sistema::$caminhoDataPessoasPerfil);
     }
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . parent::URL . "," . parent::TEXTO . "," . self::TIPO . ", " . self::NOME . ", " . self::EMAIL . ", " . self::USUARIO . ", " . self::SENHA . ", " . self::EMAILSECUNDARIO . ", " . self::SEXO . ", " . self::RG . ", " . self::CPF . ", " . self::DATANASC . ", " . self::RAZAOSOCIAL . ", " . self::CNPJ . ", " . self::SITE . ", " . self::DATACADASTRO . ", " . self::FOTO . ") VALUES('" . $pes->getURL()->getId() . "','" . $pes->getTexto()->getId() . "','" . $tipo . "','" . $pes->nome . "','" . $pes->emailPrimario . "','" . $pes->usuario . "','" . $pes->senha . "','" . $pes->emailSecundario . "','" . $pes->sexo . "','" . $pes->rg . "','" . $pes->cpf . "','" . ($tipo == self::VALOR_TIPO_PESSOA_FISICA ? $pes->getDataNasc()->mostrar("Ymd") : '') . "','" . $pes->razaoSocial . "','" . $pes->cnpj . "','" . $pes->site . "','" . $pes->getDataCadastro()->mostrar("YmdHi") . "','" . $foto . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $pes = $l->listar();
     parent::alterar($pes);
 }
Exemplo n.º 14
0
 public function inserir(MusicaCategoria &$t)
 {
     parent::inserir($t);
     if ($t->getCapa()->nome != "") {
         $imagem = $t->getCapa()->saveImage(Sistema::$caminhoDiretorio . Sistema::$caminhoDataDiscografia);
     }
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::TITULO . ", " . self::SUBTITULO . ", " . self::GRAVADORA . ", " . self::DATALANCAMENTO . ", " . self::CAPA . ", " . self::ORDEM . ") VALUES('" . $t->titulo . "','" . $t->subTitulo . "','" . $t->gravadora . "','" . $t->getDataLancamento()->mostrar("Ymd") . "','" . $imagem . "','" . $t->ordem . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
 }
Exemplo n.º 15
0
 public function inserir(Musica &$t)
 {
     parent::inserir($t);
     if ($t->getMusica()->nome != '') {
         $arquivo = $t->getMusica()->nome . "." . $t->getMusica()->extensao;
         $t->getMusica()->saveArquivo(Sistema::$caminhoDiretorio . Sistema::$caminhoDataDiscografia);
     }
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::TITULO . ", " . self::MUSICA . ", " . self::ORDEM . ") VALUES('" . $t->titulo . "','" . $arquivo . "','" . $t->ordem . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
 }
Exemplo n.º 16
0
 public function inserir(Slide &$t)
 {
     parent::inserir($t);
     if ($t->getImagem()->nome != '') {
         $t->getImagem()->open();
         $imagem = $t->getImagem()->saveImage(Sistema::$caminhoDiretorio . Sistema::$caminhoDataSlides);
     }
     $ativo = $t->ativo ? self::VALOR_ATIVO_TRUE : self::VALOR_ATIVO_FALSE;
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::TITULO . ", " . self::IMAGEM . ", " . self::FLASH . ", " . self::SEGUNDOS . ", " . self::ENDERECOURL . ", " . self::ATIVO . ", " . self::TIPO . ", " . self::LEGENDA . ", " . self::CORFUNDO . ", " . self::ORDEM . ") VALUES('" . $t->titulo . "','" . $imagem . "','" . $t->getFlash() . "','" . $t->segundos . "','" . $t->enderecoURL . "','" . $ativo . "','" . $t->tipo . "','" . $t->legenda . "','" . $t->corfundo . "','" . $t->ordem . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
 }
Exemplo n.º 17
0
 public function inserir(TicketPost &$t, Ticket $ti)
 {
     parent::inserir($t);
     if ($t->getArquivo()->nome != '') {
         $arquivo = $t->getArquivo()->saveArquivo(Sistema::$caminhoDiretorio . Sistema::$caminhoDataTickets);
     }
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::TICKET . ", " . self::TEXTO . ", " . self::ARQUIVO . ", " . self::DATAHORA . ", " . self::NOME . ") VALUES('" . $ti->getId() . "','" . $t->texto . "','" . $arquivo . "','" . $t->getDataHora()->mostrar("YmdHi") . "','" . $t->nome . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     $lT = new ListaTickets();
     $lT->alterar($ti);
     parent::alterar($t);
 }
Exemplo n.º 18
0
 public function inserir(Banner &$t)
 {
     parent::inserir($t);
     if ($t->getImagem()->nome != '') {
         $t->getImagem()->open();
         $imagem = $t->getImagem()->saveImage(Sistema::$caminhoDiretorio . Sistema::$caminhoDataBanners);
     }
     $ativo = $t->ativo ? self::VALOR_ATIVO_TRUE : self::VALOR_ATIVO_FALSE;
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::TITULO . ", " . self::IMAGEM . ", " . self::FLASH . ", " . self::DATAINICIO . ", " . self::DATAFIM . ", " . self::CLICKS . ", " . self::ENDERECOURL . ", " . self::ATIVO . ", " . self::TIPO . ", " . self::LARGURA . ", " . self::ALTURA . ") VALUES('" . $t->titulo . "','" . $imagem . "','" . $t->getFlash() . "','" . $t->getDataInicio()->mostrar("YmdHis") . "','" . $t->getDataFim()->mostrar("YmdHis") . "','" . $t->clicks . "','" . $t->enderecoURL . "','" . $ativo . "','" . $t->tipo . "','" . $t->getLargura()->formatar() . "','" . $t->getAltura()->formatar() . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
 }
 public function inserir(UploadDownloadArquivo &$t)
 {
     parent::inserir($t);
     if ($t->getArquivo()->nome != '') {
         $t->getArquivo()->open();
         $arquivo = $t->getArquivo()->nome . "." . $t->getArquivo()->extensao;
         $t->getArquivo()->saveArquivo(Sistema::$caminhoDiretorio . Sistema::$caminhoDataUploadsDownloads);
     }
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::ARQUIVO . ", " . self::PRODUTOS . ", " . self::ORDEM . ") VALUES('" . $arquivo . "','" . $t->produtos . "','" . $t->ordem . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
 }
 public function inserir(ProdutoCategoria &$pC)
 {
     parent::inserir($pC);
     if (!empty($pC->getImagem()->url)) {
         $pC->getImagem()->open();
         $imagem = $pC->getImagem()->saveImage(Sistema::$caminhoDiretorio . Sistema::$caminhoDataProdutoCategorias, $id);
     } else {
         $imagem = '';
     }
     $disponivel = $pC->disponivel ? self::VALOR_DISPONIVEL_TRUE : self::VALOR_DISPONIVEL_FALSE;
     $visaoUnica = $pC->visaoUnica ? self::VALOR_VISAOUNICA_TRUE : self::VALOR_VISAOUNICA_FALSE;
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::NOME . ", " . self::URL . ", " . self::IMAGEM . ", " . self::ORDEM . ", " . self::SUBREFERENCIA . ", " . self::DISPONIVEL . ", " . self::VISAOUNICA . ", " . self::DESCRICAOPEQUENA . "," . self::DESCRICAO . ", " . self::CATEGORIAPAI . ") VALUES('" . $pC->nome . "','" . $pC->getURL()->getId() . "','" . $imagem . "','" . $pC->ordem . "','" . $pC->subreferencia . "','" . $disponivel . "','" . $visaoUnica . "',\"" . str_replace('"', '\'', $pC->descricaoPequena) . "\",\"" . str_replace('"', '\'', $pC->descricao) . "\",'" . $pC->getIdCategoriaPai() . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $pC = $l->listar();
     parent::alterar($pC);
 }
 public function inserir(GaleriaCategoria &$t)
 {
     parent::inserir($t);
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::TITULO . ", " . parent::URL . ", " . parent::TEXTO . ", " . self::PROTEGIDO . ", " . self::ALTURA . ", " . self::LARGURA . ", " . self::ALTURAMEDIA . ", " . self::LARGURAMEDIA . ", " . self::ALTURAPEQUENA . ", " . self::LARGURAPEQUENA . ") VALUES('" . $t->titulo . "','" . $t->getURL()->getId() . "','" . $t->getTexto()->getId() . "','" . ($t->protegido ? self::VALOR_PROTEGIDO_TRUE : self::VALOR_PROTEGIDO_FALSE) . "','" . $t->getAltura()->formatar() . "','" . $t->getLargura()->formatar() . "','" . $t->getAlturaMedia()->formatar() . "','" . $t->getLarguraMedia()->formatar() . "','" . $t->getAlturaPequena()->formatar() . "','" . $t->getLarguraPequena()->formatar() . "')");
     $id = $this->con->getId();
     if (!file_exists(Sistema::$caminhoDiretorio . Sistema::$caminhoDataGalerias . $t->getLargura()->formatar('', '', 0))) {
         mkdir(Sistema::$caminhoDiretorio . Sistema::$caminhoDataGalerias . $t->getLargura()->formatar('', '', 0));
     }
     if (!file_exists(Sistema::$caminhoDiretorio . Sistema::$caminhoDataGalerias . $t->getAlturaMedia()->formatar('', '', 0))) {
         mkdir(Sistema::$caminhoDiretorio . Sistema::$caminhoDataGalerias . $t->getLarguraMedia()->formatar('', '', 0));
     }
     if (!file_exists(Sistema::$caminhoDiretorio . Sistema::$caminhoDataGalerias . $t->getAlturaPequena()->formatar('', '', 0))) {
         mkdir(Sistema::$caminhoDiretorio . Sistema::$caminhoDataGalerias . $t->getLarguraPequena()->formatar('', '', 0));
     }
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
 }
Exemplo n.º 22
0
 public function inserir(&$pes)
 {
     if (is_a($pes, "PessoaFisica")) {
         $tipo = self::VALOR_TIPO_PESSOA_FISICA;
     } elseif (is_a($pes, "PessoaJuridica")) {
         $tipo = self::VALOR_TIPO_PESSOA_JURIDICA;
     }
     parent::inserir($pes);
     if ($pes->getFoto()->nome != '') {
         $foto = $pes->getFoto()->saveImage(Sistema::$caminhoDiretorio . Sistema::$caminhoDataPessoasPerfil);
     }
     $atacadista = $pes->atacadista ? self::VALOR_ATACADISTA_TRUE : self::VALOR_ATACADISTA_FALSE;
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::TIPO . ", " . self::NOME . ", " . self::SOBRENOME . ", " . self::EMAIL . ", " . self::USUARIO . ", " . self::SENHA . ", " . self::EMAILSECUNDARIO . ", " . self::SEXO . ", " . self::RG . ", " . self::CPF . ", " . self::DATANASC . ", " . self::RAZAOSOCIAL . ", " . self::CNPJ . ", " . self::SITE . ", " . self::DATACADASTRO . ", " . self::FOTO . ", " . self::ATACADISTA . ", " . self::ORIGEMCADASTRO . ") VALUES('" . $tipo . "','" . $pes->nome . "','" . $pes->sobreNome . "','" . $pes->emailPrimario . "','" . $pes->usuario . "','" . $pes->senha . "','" . $pes->emailSecundario . "','" . $pes->sexo . "','" . $pes->rg . "','" . $pes->cpf . "','" . ($tipo == self::VALOR_TIPO_PESSOA_FISICA ? $pes->getDataNasc()->mostrar("Ymd") : '') . "','" . $pes->razaoSocial . "','" . $pes->cnpj . "','" . $pes->site . "','" . $pes->getDataCadastro()->mostrar("YmdHi") . "','" . $foto . "','" . $atacadista . "','" . $pes->origemCadastro . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $pes = $l->listar();
     parent::alterar($pes);
 }
Exemplo n.º 23
0
 public function inserir(Endereco &$end, $ligacao)
 {
     parent::inserir($end);
     $e = $end->getEstado();
     if ($e->getId() <= 0) {
         $lE = new ListaEstados();
         $lE->inserir($e);
         $end->setEstado($e);
     }
     $end->getCidade()->setEstado($e);
     $c = $end->getCidade();
     if ($c->getId() <= 0) {
         $lC = new ListaCidades();
         $lC->inserir($c);
         $end->setCidade($c);
     } else {
         $lC = new ListaCidades();
         $lC->condicoes('', $c->getId(), ListaCidades::ID);
         if ($lC->getTotal() <= 0) {
             if ($c->getPais()->getId() <= 0) {
                 $c->setPais($end->getPais());
             }
             if ($c->getEstado()->getId() <= 0) {
                 $c->setEstado($end->getEstado());
             }
             $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $lC->getTabela() . "(" . ListaCidades::ID . ", " . ListaCidades::PAIS . ", " . ListaCidades::ESTADO . ", " . ListaCidades::NOME . ", " . ListaCidades::DDD . ") VALUES('" . $c->getId() . "','" . $c->getPais()->getId() . "','" . $c->getEstado()->getId() . "','" . $c->nome . "','" . $c->ddd . "')");
             $id = $this->con->getId();
             $lC->condicoes('', $id, ListaCidades::ID);
             if ($lC->getTotal() > 0) {
                 $end->setCidade($lC->listar());
             }
         }
     }
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::IDSESSAO . ", " . self::LOGRADOURO . ", " . self::NUMERO . ", " . self::COMPLEMENTO . ", " . self::BAIRRO . ", " . self::CIDADE . ", " . self::ESTADO . ", " . self::PAIS . ", " . self::CEP . ") VALUES('" . $ligacao->getId() . "','" . $end->logradouro . "','" . $end->numero . "','" . $end->complemento . "','" . $end->bairro . "','" . $end->getCidade()->getId() . "','" . $end->getEstado()->getId() . "','" . $end->getPais()->getId() . "','" . $end->getCep() . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $end = $l->listar();
     parent::alterar($end);
 }
Exemplo n.º 24
0
 public function inserir(ProdutoMarca &$m)
 {
     parent::inserir($m);
     $disponivel = $m->disponivel ? self::VALOR_DISPONIVEL_TRUE : self::VALOR_DISPOINVEL_FALSE;
     if (!empty($m->getImagem()->url)) {
         $m->getImagem()->open();
         $imagem = $m->getImagem()->saveImage(Sistema::$caminhoDiretorio . Sistema::$caminhoDataProdutoMarcas, $id);
     } else {
         $imagem = '';
     }
     if ($m->getId() != '') {
         $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::ID . ", " . self::NOME . ", " . self::URL . ", " . self::IMAGEM . "," . self::DESCRICAO . ", " . self::ENDERECOURL . ", " . self::DISPONIVEL . ") VALUES('" . $m->getId() . "','" . $m->nome . "','" . $m->getURL()->getId() . "','" . $imagem . "',\"" . str_replace('"', '\'', $m->descricao) . "\",'" . $m->enderecoURL . "','" . $disponivel . "')");
     } else {
         $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::NOME . ", " . self::URL . ", " . self::IMAGEM . "," . self::DESCRICAO . ", " . self::ENDERECOURL . ", " . self::DISPONIVEL . ") VALUES('" . $m->nome . "','" . $m->getURL()->getId() . "','" . $imagem . "',\"" . str_replace('"', '\'', $m->descricao) . "\",'" . $m->enderecoURL . "','" . $disponivel . "')");
     }
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $m = $l->listar();
     parent::alterar($m);
 }
Exemplo n.º 25
0
 public function inserir(Vendedor &$t)
 {
     parent::inserir($t);
     if ($t->getImagem()) {
         if ($t->getImagem()->getImage()) {
             if ($t->getImagem()->getImage()->nome != '') {
                 $lI = new ListaImagens();
                 $lI->caminhoEscrita = Sistema::$caminhoDiretorio . Sistema::$caminhoDataTextos;
                 $lI->caminhoLeitura = Sistema::$caminhoURL . Sistema::$caminhoDataTextos;
                 $img = $t->getImagem();
                 $lI->inserir($img);
                 $t->setImagem($img);
             }
         }
     }
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::NOME . ", " . self::EMAIL . ", " . self::MSN . ", " . self::SKYPE . ", " . self::VOIP . ", " . self::TELEFONE . ", " . self::RAMAL . ", " . self::IMAGEM . ", " . self::ORDEM . ") VALUES('" . $t->nome . "','" . $t->email . "','" . $t->msn . "','" . $t->skype . "','" . $t->voip . "','" . $t->telefone . "','" . $t->ramal . "','" . $t->getImagem()->getId() . "', '" . $t->ordem . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
     if ($t->getImagem()) {
         if ($t->getImagem()->getImage()) {
             if ($t->getImagem()->getImage()->nome != '') {
                 $lI = new ListaImagens();
                 $lI->caminhoEscrita = Sistema::$caminhoDiretorio . Sistema::$caminhoDataTextos;
                 $lI->caminhoLeitura = Sistema::$caminhoURL . Sistema::$caminhoDataTextos;
                 $t->getImagem()->setSessao($this->getTabela(), $t->getId());
                 $img = $t->getImagem();
                 $lI->alterar($img);
                 $t->setImagem($img);
             }
         }
     }
 }
Exemplo n.º 26
0
 public function inserir(Pergunta &$t)
 {
     parent::inserir($t);
     if ($t->getImagem()) {
         if ($t->getImagem()->getImage()) {
             if ($t->getImagem()->getImage()->nome != '') {
                 $lI = new ListaImagens();
                 $lI->caminhoEscrita = Sistema::$caminhoDiretorio . Sistema::$caminhoDataFAQ;
                 $lI->caminhoLeitura = Sistema::$caminhoURL . Sistema::$caminhoDataFAQ;
                 $img = $t->getImagem();
                 $lI->inserir($img);
                 $t->setImagem($img);
             }
         }
     }
     $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::CATEGORIA . ", " . self::URL . ", " . self::TITULO . ", " . self::TEXTO . ", " . self::IMAGEM . ", " . self::ORDEM . ") VALUES('" . $t->getIdCategoria() . "','" . $t->getURL()->getId() . "','" . $t->titulo . "','" . $t->texto . "','" . $t->getImagem()->getId() . "','" . $t->ordem . "')");
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $t = $l->listar();
     parent::alterar($t);
     if ($t->getImagem()) {
         if ($t->getImagem()->getImage()) {
             if ($t->getImagem()->getImage()->nome != '') {
                 $lI = new ListaImagens();
                 $lI->caminhoEscrita = Sistema::$caminhoDiretorio . Sistema::$caminhoDataFAQ;
                 $lI->caminhoLeitura = Sistema::$caminhoURL . Sistema::$caminhoDataFAQ;
                 $t->getImagem()->setSessao($this->getTabela(), $t->getId());
                 $img = $t->getImagem();
                 $lI->alterar($img);
                 $t->setImagem($img);
             }
         }
     }
 }
Exemplo n.º 27
0
 public function inserir(Produto &$p)
 {
     parent::inserir($p);
     $disponivel = $p->disponivel ? self::VALOR_DISPONIVEL_TRUE : self::VALOR_DISPONIVEL_FALSE;
     $promocao = $p->promocao ? self::VALOR_DISPONIVEL_TRUE : self::VALOR_DISPONIVEL_FALSE;
     $lancamento = $p->lancamento ? self::VALOR_DISPONIVEL_TRUE : self::VALOR_DISPONIVEL_FALSE;
     $destaque = $p->destaque ? self::VALOR_DISPONIVEL_TRUE : self::VALOR_DISPONIVEL_FALSE;
     if ($p->getId() != '') {
         $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::ID . ", " . self::PRODUTOPAI . ", " . self::NOME . ", " . self::URL . ", " . self::PESO . ", " . self::LARGURA . ", " . self::ALTURA . ", " . self::COMPRIMENTO . ", " . self::VALORCUSTO . ", " . self::VALORREAL . ", " . self::VALORVENDA . ", " . self::ESTOQUE . ", " . self::DESCRICAOPEQUENA . ", " . self::DESCRICAO . ", " . self::DISPONIVEL . ", " . self::PROMOCAO . ", " . self::LANCAMENTO . ", " . self::DESTAQUE . ", " . self::ORDEM . ", " . self::TIPOUNIDADE . ", " . self::QUANTIDADEU . ", " . self::DATACADASTRO . ", " . self::VIDEO . ", " . self::MARCA . ", " . self::CODIGO . ", " . self::FRETE . ", " . self::TIPOPEDIDO . ") VALUES('" . $p->getId() . "','" . $p->getProdutoPai() . "','" . addslashes(str_replace("\"", "'", $p->nome)) . "','" . $p->getURL()->getId() . "','" . $p->peso->formatar(".", "", 3) . "','" . $p->largura->formatar() . "','" . $p->altura->formatar() . "','" . $p->comprimento->formatar() . "','" . $p->valorCusto->formatar() . "','" . $p->valorReal->formatar() . "','" . $p->valorVenda->formatar() . "','" . $p->estoque . "','" . addslashes($p->descricaoPequena) . "','" . addslashes($p->descricao) . "','" . $disponivel . "','" . $promocao . "','" . $lancamento . "','" . $destaque . "','" . $p->ordem . "','" . addslashes(str_replace("\"", "'", $p->tipoUnidade)) . "','" . $p->quantidadeu . "','" . $p->getDataCadastro()->mostrar("Ymd") . "','" . $p->getVideo() . "','" . $p->getMarca()->getId() . "','" . $p->codigo . "','" . $p->frete . "','" . $p->tipoPedido . "')");
     } else {
         $this->con->executar("INSERT INTO " . Sistema::$BDPrefixo . $this->tabela . "(" . self::PRODUTOPAI . ", " . self::NOME . ", " . self::URL . ", " . self::PESO . ", " . self::LARGURA . ", " . self::ALTURA . ", " . self::COMPRIMENTO . ", " . self::VALORCUSTO . ", " . self::VALORREAL . ", " . self::VALORVENDA . ", " . self::ESTOQUE . ", " . self::DESCRICAOPEQUENA . ", " . self::DESCRICAO . ", " . self::DISPONIVEL . ", " . self::PROMOCAO . ", " . self::LANCAMENTO . ", " . self::DESTAQUE . ", " . self::ORDEM . ", " . self::TIPOUNIDADE . ", " . self::QUANTIDADEU . ", " . self::DATACADASTRO . ", " . self::VIDEO . ", " . self::MARCA . ", " . self::CODIGO . ", " . self::FRETE . ", " . self::TIPOPEDIDO . ") VALUES('" . $p->getProdutoPai() . "','" . addslashes(str_replace("\"", "'", $p->nome)) . "','" . $p->getURL()->getId() . "','" . $p->peso->formatar(".", "", 3) . "','" . $p->largura->formatar() . "','" . $p->altura->formatar() . "','" . $p->comprimento->formatar() . "','" . $p->valorCusto->formatar() . "','" . $p->valorReal->formatar() . "','" . $p->valorVenda->formatar() . "','" . $p->estoque . "','" . addslashes($p->descricaoPequena) . "','" . addslashes($p->descricao) . "','" . $disponivel . "','" . $promocao . "','" . $lancamento . "','" . $destaque . "','" . $p->ordem . "','" . addslashes(str_replace("\"", "'", $p->tipoUnidade)) . "','" . $p->quantidadeu . "','" . $p->getDataCadastro()->mostrar("Ymd") . "','" . $p->getVideo() . "','" . $p->getMarca()->getId() . "','" . $p->codigo . "','" . $p->frete . "','" . $p->tipoPedido . "')");
     }
     $id = $this->con->getId();
     $class = __CLASS__;
     $l = new $class();
     $l->condicoes('', $id, self::ID);
     $p = $l->listar();
     parent::alterar($p);
 }