Last active
August 29, 2015 13:57
-
-
Save ricardofiorani/9740762 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Funções que variam de projeto para projeto */ | |
class Site extends CNucleo { | |
public $template = 'template_padrao'; | |
public function control_home() { | |
$txthome = $this->listar('tbl_txthome', '', 1, 1)->registros; | |
$empreendimentos = $this->listar('tbl_empreendimentos', '', 1, 4)->registros; | |
$banner = $this->listar('tbl_banner')->registros; | |
$this->renderizar('home', array( | |
'txthome' => $txthome, | |
'empreendimentos' => $empreendimentos, | |
'banner' => $banner, | |
)); | |
} | |
public function control_sobre() { | |
$sobre = $this->listar('tbl_sobre')->registros; | |
$galeria = $this->listar('tbl_galeria_sobre')->registros; | |
$this->renderizar('sobre', array( | |
'sobre' => $sobre, | |
'galeria' => $galeria, | |
)); | |
} | |
public function control_sobre_empreendedor() { | |
$sobre = $this->listar('tbl_empreendedor')->registros; | |
$foto = $this->ver('tbl_galeria_empreendedor', 1); | |
$this->renderizar('sobre-empreendedor', array( | |
'sobre' => $sobre, | |
'foto' => $foto, | |
)); | |
} | |
public function control_nossa_historia() { | |
$this->renderizar('nossa-historia'); | |
} | |
public function control_ofereca_seu_terreno() { | |
$this->titulo = 'Ofereça seu Terreno'; | |
if ($_POST) { | |
if ($this->enviaEmail($_POST, $this->site()->email_ofereca, 'Ofereça seu terreno : Via site')) { | |
$this->redirect('ofereca-sucesso'); | |
} else { | |
$this->redirect('ofereca-erro'); | |
} | |
} else { | |
$this->renderizar('ofereca-seu-terreno'); | |
} | |
} | |
public function control_ofereca_sucesso() { | |
$this->renderizar('ofereca-sucesso'); | |
} | |
public function control_ofereca_erro() { | |
$this->renderizar('ofereca-erro'); | |
} | |
public function control_fale_conosco() { | |
$this->titulo = 'Contato via site'; | |
if ($_POST) { | |
if ($this->enviaEmail($_POST)) { | |
$this->redirect('contato-sucesso'); | |
} else { | |
$this->redirect('contato-erro'); | |
} | |
} else { | |
$this->renderizar('fale-conosco'); | |
} | |
} | |
public function control_contato_sucesso() { | |
$this->renderizar('contato-sucesso'); | |
} | |
public function control_contato_erro() { | |
$this->renderizar('contato-erro'); | |
} | |
public function control_noticias($id = '') { | |
$this->titulo = 'Notícias'; | |
$listagem = $this->listar('tbl_noticias'); | |
$atual = $this->ver('tbl_noticias', $id); | |
$this->renderizar('noticias', array( | |
'listagem' => $listagem, 'atual' => $atual)); | |
} | |
public function control_noticias_lista($pagina = 1) { | |
$this->titulo = 'Notícias'; | |
$listagem = $this->listar('tbl_noticias',$this->html_href(array('control_noticias_lista')),$pagina,8); | |
$this->renderizar('noticias-lista', array( | |
'listagem' => $listagem)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="pag-padrao"> | |
<div class="titulo grid_16"> | |
<h1>Todas as Notícias</h1> | |
</div> | |
<div class="box-noticias grid_16"> | |
<!-- Item --> | |
<?php | |
foreach ((array) $listagem->registros as $item) { | |
?> | |
<div class="noticia"> | |
<a href="<?= $this->html_href(array('noticias', $item->id, $item->nome_url)) ?>"> | |
<h2><?= $item->nome ?> <span><?= $this->dataAgenda($item->data, 'd/m/Y') ?></span></h2> | |
<p> | |
<?= $item->resumo ?> | |
</p> | |
</a> | |
</div> | |
<?php | |
} | |
?> | |
<!-- Fim Item --> | |
</div> | |
<div class="paginacao grid_5 right"> | |
<?=$listagem->paginacao?> | |
</div> | |
<?php $this->renderizarParcial('inc_box-bottom') ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment