示例#1
0
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new Banner($info[self::ID]);
         parent::resgatarObjetos($info);
         $temp->titulo = $info[self::TITULO];
         $temp->clicks = $info[self::CLICKS];
         $temp->enderecoURL = $info[self::ENDERECOURL];
         $temp->ativo = $info[self::ATIVO] == self::VALOR_ATIVO_TRUE ? true : false;
         $temp->tipo = $info[self::TIPO];
         if (!empty($info[self::IMAGEM])) {
             $temp->setImagem(new Image(new Arquivos(Sistema::$caminhoURL . Sistema::$caminhoDataBanners . $info[self::IMAGEM])));
         }
         $temp->setFlash($info[self::FLASH]);
         $temp->setDataInicio(new DataHora($info[self::DATAINICIO]));
         $temp->setDataFim(new DataHora($info[self::DATAFIM]));
         $temp->setLargura($info[self::LARGURA]);
         $temp->setAltura($info[self::ALTURA]);
         return $temp;
     }
 }
示例#2
0
 $b = new Banner();
 $b->titulo = $_POST['titulo'];
 $b->enderecoURL = $_POST['enderecoURL'];
 $b->tipo = $_POST['tipo'];
 $b->setDataInicio(new DataHora($_POST['dataInicio']));
 $b->setDataFim(new DataHora($_POST['dataFim']));
 $b->ativo = $_POST['ativo'] == ListaBanners::VALOR_ATIVO_TRUE ? true : false;
 if (!empty($_FILES['flash']['name'])) {
     $arq = Arquivos::__OpenArquivoByTEMP($_FILES['flash']);
     $arq->saveArquivo(Sistema::$caminhoDiretorio . Sistema::$caminhoDataBanners);
     $b->setFlash($_FILES['flash']['name']);
     $b->setLargura($_POST['largura']);
     $b->setAltura($_POST['altura']);
 }
 if (!empty($_FILES['imagem']['name'])) {
     $b->setImagem(new Image(Arquivos::__OpenArquivoByTEMP($_FILES['imagem'])));
 }
 $lB = new ListaBanners();
 $lB->inserir($b);
 while ($i = $lI->listar()) {
     $t = new Traducao();
     $t->setIdConteudo($b->getId());
     $t->setCampoConteudo(ListaBanners::TITULO);
     $t->setTabelaConteudo($lB->getTabela());
     $t->conteudo = $b->titulo;
     $t->traducao = $_POST['ititulo'][$i->getId()];
     $i->addTraducao($t);
 }
 $_POST = '';
 header("Location: " . Sistema::$adminCaminhoURL . "?p=SistemaUtilidades&a=alterarBanner&banner=" . $b->getId());
 //$javaScript .= Aviso::criar("Banner salvo com sucesso!");