<?php

include "../../model/Conecta.php";
include "../../model/beans/Noticia.php";
include "../../model/dao/DaoNoticia.php";
$noticia = new Noticia();
$noticia->setTitulo($_POST["titulo"]);
$noticia->setResumo($_POST["resumo"]);
$noticia->setConteudo($_POST["conteudo"]);
$conexao = new Conecta();
$daoNoticia = new DaoNoticia($noticia, $conexao);
$daoNoticia->atualizar($_GET['id']);
header("Location: ../../home.php");
예제 #2
0
    header('Location:login.php');
    return;
}
$noticia = new Noticia();
$count = NULL;
if (isset($_POST['txtCveNoticia'])) {
    if ($_POST['txtCveNoticia'] != 0) {
        $noticia = new Noticia($_POST['txtCveNoticia']);
    }
}
if (isset($_POST['xAccion'])) {
    if ($_POST['xAccion'] == 'grabar') {
        $noticia->setCveReata($_SESSION['cve_usuario']);
        $noticia->setTipoEvento(1);
        // Tipo boletin
        $noticia->setTitulo($_POST['txtTitulo']);
        $noticia->setNoticiaCorta($_POST['txtNoticiaCorta']);
        $noticia->setNoticia($_POST['txtNoticia']);
        $noticia->setCveModifico($_SESSION['cve_usuario']);
        $noticia->setActivo(isset($_POST['cbxActivo']) ? 1 : 0);
        $count = $noticia->grabar();
    }
    if ($_POST['xAccion'] == 'eliminar') {
        $noticia->borrar($_POST['txtCveNoticia']);
    }
    if ($_POST['xAccion'] == 'logout') {
        unset($_SESSION['cve_usuario']);
        unset($_SESSION['nombre']);
        header('Location:login.php');
        return;
    }