Viewing file: noticias.php (3.04 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include "load_ipanel.php";
$noticiaCtrl = new NoticiaCtrl();
$pag = $_GET['page'];
$maximo = 15;
if(empty($pag)){
$pag = 1;
}
$start = ($pag - 1) * $maximo;
$ttNoticias = $noticiaCtrl->getNoticias("", array(), false, false, true);
$ttPaginas = ceil($ttNoticias/ $maximo);
$noticias = $noticiaCtrl->getNoticias("", array(), $maximo, $start);
?>
<!DOCTYPE HTML>
<html lang="pt-br">
<?php include "mod_head.php" ?>
<body class="homepage">
<div id="page-wrapper">
<!-- Bot�o para abrir o login -->
<?php include "mod_login.php" ?>
<?php include "mod_menu.php" ?>
<div id="banner-wrapper">
<div id="banner" class="container">
<div class="row">
<h2 class="titulo_page">NOTÍCIAS</h2>
</div>
</div>
</div>
<div class="wrapper-style1 wrapper-featured">
<div class="container">
<div class="row">
<div class="12u">
<?php
foreach($noticias as $noticia){
if(!empty($noticia['url']) && $noticia['url'] != "#"){
$url = $noticia['url'];
$target = "_blank";
}else{
$url = "conteudo-noticia/" . $noticia['id'];
$target = "_self";
}
echo "<div class=\"lista_noticias\">";
if(!empty($noticia['imagem']) && file_exists("ipanel/uploads/noticias/".$noticia['id']."/".$noticia['imagem'])) {
echo "<a href=\"". $url . "\" target=\"".$target."\" style=\"text-decoration: none;\"><img class=\"image-lista-noticias\" src=\"".$noticiaCtrl->showImage($noticia, "Capa")."\"></a>";
}
echo "<p>(".$data->convertDateSQLToDateBR($noticia['notdata']).") - <a href=\"". $url . "\" target=\"".$target."\" style=\"text-decoration: none;\"><strong>".$noticia['titulo']."</strong></a></p>";
echo "<p>".$noticia['gravata']."</p>";
echo "<a href=\"". $url . "\" target=\"".$target."\"><button class=\"new_button\">VEJA +</button></a>";
echo "</div>";
}
?>
</div>
<?php
if($ttPaginas > 1){
for($i = 1; $i <= $ttPaginas; $i++){
echo "<a href=\"lista-noticias/page/".$i."\">".$i."</a> ";
}
}
?>
</div>
</div>
</div>
<!-- Banners -->
<?php include "mod_banners.php" ?>
<?php include "mod_footer.php" ?>
</div>
</body>
</html>
<?php include "scripts.php" ?>
|