<?
include_once('header.php');
require("acesso/config.php");	

if(isset($_GET['id'])){
	$id = base64_decode($_GET['id']);
}

include("acesso/utf8.php");

//SELECIONA A NOTÍCIA
$sql = "SELECT *, date_format(n_data,'%d/%m/%Y') as data FROM ctd_noticias WHERE n_id = $id";
$consulta = mysqli_query($conn, $sql);
$registro = mysqli_fetch_array($consulta);
?>
<title><?=$registro['n_titulo']?></title>
<meta name="keywords" content="<? if($registro['n_keywords']) {echo $registro['n_keywords'];} else {require('keywords.php');} ?>" />
<meta name="description" content="<? if($registro['n_description']) {echo $registro['n_description'];} else {require('description.php');} ?>" />
<? include_once('cabecalho.php');?>

<div class="int">
<h1><?=$registro['n_titulo']?></h1>

<? if($registro['n_foto']!=""){ ?>
<img src="<?=$registro['n_foto']?>" alt="<?=$registro['n_titulo']?>" class="noticia_foto" />
<? }else{ } ?>

<?=$registro['n_texto']?>
<p class="data">Data: <?=$registro['data']?></p>
<p class="voltar"><a href="javascript:history.back()">Voltar</a></p>
</div>

<?
if(isset($conn)) { mysqli_close($conn); }
include_once("rodape.php");
?>