Exemple #1
0
function fntDeletaHipoteses()
{
    $t = new Hipoteses();
    $t->setCodcaso($_SESSION['caso']);
    $t->setCodhipotese(base64_decode($_POST['id']));
    if ($t->Deleta()) {
        return "@lng[Hipótese diagnóstica deletada com sucesso!]";
    } else {
        return "ERRO. @lng[Não foi possível excluir a hipótese diagnóstica.] " . $t->getErro();
    }
}
Exemple #2
0
function fntProcessaDadosHipoteses()
{
    if ($_SESSION['caso'] > 0) {
        $descricao = urldecode($_POST['txtDescricao']);
        $correto = $_POST['selCorreto'];
        $justificativa = stripcslashes(urldecode($_POST['txtJustificativa']));
        $adicional = stripcslashes(urldecode($_POST['txtAdicional']));
        $h = new Hipoteses();
        $h->setCodcaso($_SESSION['caso']);
        if ($descricao != "") {
            $h->setDescricao($descricao);
        }
        if ($correto != "") {
            $h->setCorreto($correto);
        }
        if ($justificativa != "") {
            $h->setJustificativa($justificativa);
        }
        if ($adicional != "") {
            $h->setConteudoadicional($adicional);
        }
        $ret = "";
        if ($_SESSION['hipotese'] > 0) {
            $h->setCodhipotese($_SESSION['hipotese']);
            $ret = $h->Atualiza();
            $_SESSION['hipotese'] = 0;
        } else {
            $ret = $h->Insere();
            $_SESSION['hipotese'] = 0;
        }
        if ($ret == true) {
            echo "OK";
        } else {
            echo $h->getErro();
        }
    }
}