Example #1
0
<?php

if (!AutenticaController::logado()) {
    header("Location: login");
    exit;
}
include "helper/cabecalho.php";
$postCategorias = PostController::getAllPostCategoria($_GET['id'], "", "");
$arrayCategorias = array();
if (count($postCategorias) > 0) {
    foreach ($postCategorias as $postCategoria) {
        $arrayCategorias[] = $postCategoria->IdCategoria;
    }
}
$postTags = PostController::getAllPostTag($_GET['id'], "", "");
$arrayTags = array();
if (count($postTags) > 0) {
    foreach ($postTags as $postTag) {
        $arrayTags[] = $postTag->IdTag;
    }
}
?>

	<div id="wrapper">
	
<?php 
include "helper/menu.php";
?>
	
		<div id="page-wrapper">
			
Example #2
0
<?php

if ($_POST['action'] == "login") {
    if (AutenticaController::login($_POST['email'], $_POST['senha'])) {
        header("Location: ./");
        exit;
    } else {
        echo "\t<script>\n\t\t\t\t\t\talert('E-mail e senha não conferem. Por favor, tente novamente.');\n\t\t\t\t\t\tlocation.href = 'login';\n\t\t\t\t\t</script>";
        exit;
    }
} elseif ($_GET['action'] == "logout") {
    if (AutenticaController::logout()) {
        header("Location: login");
        exit;
    } else {
        echo "\t<script>\n\t\t\t\t\t\talert('Erro de conexão. Por favor, tente novamente.');\n\t\t\t\t\t\tlocation.href = './';\n\t\t\t\t\t</script>";
        exit;
    }
}