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); } } } }
$lI = new ListaImagens(); $lI->caminhoEscrita = Sistema::$caminhoDiretorio . Sistema::$caminhoDataProdutos; $lI->caminhoLeitura = $lI->caminhoEscrita; $lI->condicoes('', $_GET['imagem'], ListaImagens::ID); if ($lI->getTotal() > 0) { $lI->deletar($lI->listar()); $javaScript .= Aviso::criar("Imagem removida com sucesso!"); } } elseif (isset($_GET['principal']) && !empty($_GET['imagem'])) { $lI = new ListaImagens(); $lI->caminhoEscrita = Sistema::$caminhoDataProdutos; $lI->caminhoLeitura = $lI->caminhoEscrita; $lI->condicoes('', $_GET['imagem'], ListaImagens::ID); while ($img = $p->getImagens()->listar()) { $img->destaque = false; $lI->alterar($img); } $p->getImagens()->setParametros(0); if ($lI->getTotal() > 0) { $img = $lI->listar(); $img->destaque = true; $lI->alterar($img); $javaScript .= Aviso::criar("Imagem salva com sucesso!"); } } $iAP->createRepeticao("repetir->Imagens.Produto"); $p->getImagens()->setParametros(9999999, 'limite'); while ($img = $p->getImagens()->listar("DESC", ListaImagens::DESTAQUE)) { $iAP->repetir(); if ($img->getImage()->nome != "") { $iAP->enterRepeticao()->trocar("imagem.Imagem.Produto", $img->getImage()->showHTML(150, 150));
public function alterar(Vendedor $t) { parent::alterar($t); $where = "WHERE " . self::ID . " = '" . $t->getId() . "'"; if ($t->getImagem()->getImage()->nome != '') { $lI = new ListaImagens(); $lI->caminhoEscrita = Sistema::$caminhoDiretorio . Sistema::$caminhoDataTextos; $lI->caminhoLeitura = Sistema::$caminhoURL . Sistema::$caminhoDataTextos; $img = $t->getImagem(); if ($img->getId() != '') { $lI->alterar($img); } else { $t->getImagem()->setSessao($this->getTabela(), $t->getId()); $lI->inserir($img); } $t->setImagem($img); } $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::IMAGEM, $t->getImagem()->getId(), $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::NOME, $t->nome, $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::EMAIL, $t->email, $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::MSN, $t->msn, $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::SKYPE, $t->skype, $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::VOIP, $t->voip, $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::TELEFONE, $t->telefone, $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::RAMAL, $t->ramal, $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::ORDEM, $t->ordem, $where); }
public function alterar(Texto $t) { parent::alterar($t); $where = "WHERE " . self::ID . " = '" . $t->getId() . "'"; if ($t->getImagem()->getImage()->nome != '') { $lI = new ListaImagens(); $lI->caminhoEscrita = Sistema::$caminhoDiretorio . Sistema::$caminhoDataTextos; $lI->caminhoLeitura = Sistema::$caminhoURL . Sistema::$caminhoDataTextos; $img = $t->getImagem(); if ($img->getId() != '') { $lI->alterar($img); } else { $t->getImagem()->setSessao($this->getTabela(), $t->getId()); $lI->inserir($img); } $t->setImagem($img); } $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::URL, $t->getURL()->getId(), $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::IMAGEM, $t->getImagem()->getId(), $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::TITULO, $t->titulo, $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::SUBTITULO, $t->subTitulo, $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::TEXTOPEQUENO, str_replace("'", "\\'", $t->textoPequeno), $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::TEXTO, str_replace("'", "\\'", $t->texto), $where); $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::ORDEM, $t->ordem, $where); }