Exemplo n.º 1
0
function Main()
{
    $cod = $_POST["txtCodigo"];
    $des = urldecode($_POST["txtTexto"]);
    $exp = urldecode($_POST["txtExplicacao"]);
    header('Content-Type: text/html; charset=iso-8859-1');
    $gp = new GrupoPergunta();
    if ($cod != "") {
        $gp->setCodgrupo($cod);
    }
    if ($des != "") {
        $gp->setTexto($des);
    }
    if ($exp != "") {
        $gp->setExplicacao($exp);
    }
    if ($cod == "") {
        if ($gp->Insere()) {
            echo "OK";
        } else {
            echo $gp->getErro();
        }
    } else {
        if ($gp->Atualiza()) {
            echo "OK";
        } else {
            echo $gp->getErro();
        }
    }
}
Exemplo n.º 2
0
function fntDeletaGrupoPergunta()
{
    $t = new GrupoPergunta();
    $t->setCodgrupo(base64_decode($_POST['id']));
    if ($t->Deleta()) {
        echo Comuns::Idioma("@lng[Excluído com sucesso.]");
    } else {
        echo Comuns::Idioma("@lng[Não foi possível deletar o agrupador de pergunta.] " . $t->getErro());
    }
}