Пример #1
0
<?php

require_once '../configs/sm.php';
include_once '../model/Mural.php';
include_once '../model/Usuario.php';
session_start();
if ($_SESSION['login'] == "true") {
    $usuario = Usuario::listaUsuario($_SESSION['usuario']);
    $mural = Mural::listaMural(1);
    $sm->assign("usuario", $usuario);
    $sm->assign("mural", $mural);
    $sm->display('../view/home.html');
} else {
    header("location:../index.php?&erro=\"Login\"");
}
Пример #2
0
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
include_once '../model/Mural.php';
session_start();
if ($_SESSION['login'] == "true") {
    $mural = addslashes(trim($_POST['mural']));
    $muralNovo = new Mural(1, $mural);
    $muralAntigo = Mural::listaMural(1);
    Mural::deletaMural(1);
    Mural::insereMural($muralNovo);
    header("location:../controller/controllerHome.php");
} else {
    header("location:../index.php?&erro=\"Login\"");
}