<?php
// $Id: excluirpergunta.php,v 1.5 2007/03/24 14:41:40 marcellobrandao Exp $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <http://www.xoops.org/> //
// ------------------------------------------------------------------------ //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
include '../../../include/cp_header.php';
include_once(XOOPS_ROOT_PATH."/Frameworks/art/functions.admin.php");
include("../class/nivelamento_perguntas.php");
include("../class/nivelamento_provas.php");
include("../class/nivelamento_respostas.php");
include_once("../../../class/criteria.php");
/**
* Verificação de segurança validando o TOKEN
*/
if (!($GLOBALS['xoopsSecurity']->check())){
redirect_header($_SERVER['HTTP_REFERER'], 5, _MD_NIV_TOKENEXPIRED);
}
$cod_pergunta = $_POST['cod_pergunta'];
$fabrica_de_respostas = new Xoopsnivelamento_respostasHandler($xoopsDB);
$criteria = new Criteria ('cod_pergunta',$cod_pergunta);
if ($fabrica_de_respostas->deleteAll($criteria)){
$fabrica_de_perguntas = new Xoopsnivelamento_perguntasHandler($xoopsDB);
$pergunta = $fabrica_de_perguntas->get($cod_pergunta);
$cod_prova = $pergunta->getVar('cod_prova');
if($fabrica_de_perguntas->delete($pergunta)){
redirect_header("index.php?op=editar_prova&cod_prova=$cod_prova", 2, _MD_NIV_SUCESSO);
}
}
?>