Exemplo n.º 1
0
function Main()
{
    //header('Content-Type: text/html; charset=iso-8859-1');
    if (isset($_SESSION['casores']) && $_SESSION['casores'] > 0) {
        if ($_POST['k']) {
            $idnodo = $_POST['k'];
            $res = new Resolucao();
            $res->setCodcaso($_SESSION['casores']);
            $hash = $res->BuscaConteudoPelaChave($idnodo);
            if ($hash != false) {
                $res->RegistraVisitaNodo($idnodo);
                if ($hash->ContainsKey("fim")) {
                    if ($hash->getValue("fim") == "S") {
                        // É fim do caso. Deve atualizar status
                        $u = unserialize($_SESSION['usu']);
                        $res->setCodusuario($u->getCodigo());
                        $res->setCodresolucao($_SESSION['codresolucao']);
                        if (!$res->ConcluiResolucao()) {
                            echo $res->getErro();
                        }
                    }
                }
                echo Comuns::Idioma($hash->ToXML());
            } else {
                die(Comuns::Idioma("ERRO: @lng[hash retornou false]"));
            }
        } else {
            die(Comuns::Idioma("ERRO: @lng[Conteúdo não informado]"));
        }
    } else {
        die(Comuns::Idioma("ERRO: @lng[Caso não encontrado]"));
    }
}
Exemplo n.º 2
0
function Main()
{
    if (isset($_SESSION['casores']) && $_SESSION['casores'] > 0) {
        //$arrNodo = split('_', $_POST['k']);
        $res = new Resolucao();
        $res->setCodcaso($_SESSION['casores']);
        $res->setCodresolucao($_SESSION['codresolucao']);
        $salto = $res->BuscaSaltosConteudo($_POST['k']);
        if ($salto !== false) {
            echo $salto;
        } else {
            echo "ERRO: " . $res->getErro();
        }
    } else {
        echo "@lng[Caso não encontrado]";
    }
}
Exemplo n.º 3
0
function Main()
{
    $u = unserialize($_SESSION['usu']);
    $res = new Resolucao();
    $res->setCodcaso($_SESSION['casores']);
    $res->setCodUsuario($u->getCodigo());
    $msg = "";
    if ($u->TemGrupo(1) || $u->TemGrupo(4)) {
        if (Caso::ConsultaSituacao($_SESSION['casores']) == 0) {
            if (!$res->LimpaResolucao()) {
                $msg = "@lng[Erro ao limpar histórico de resoluções.]" . " " . $res->getErro();
            } else {
                $msg = "OK";
            }
        } else {
            $msg = "@lng[Erro. Este caso está publicado e não é possível limpar suas resoluções]";
        }
    }
    echo Comuns::Idioma($msg);
}
Exemplo n.º 4
0
function Main()
{
    header('Content-Type: text/html; charset=iso-8859-1');
    if (isset($_SESSION['casores']) && $_SESSION['casores'] > 0) {
        $intSoma = $_POST['s'];
        $chave = $_POST['k'];
        if ($intSoma > 0) {
            $resolucao = new Resolucao();
            $resolucao->setCodcaso($_SESSION['casores']);
            if ($resolucao->BuscaStatusAndamento() != 3) {
                if ($_POST['p']) {
                    $ret = $resolucao->SalvaResposta($chave, $_POST['p'], $intSoma);
                } else {
                    $ret = $resolucao->SalvaResposta($chave, null, $intSoma);
                }
            } else {
                $ret = true;
            }
            if ($ret) {
                echo "OK";
            } else {
                echo "ERRO: " . $resolucao->getErro();
            }
        } else {
            echo "ERRO: @lng[Resposta não informada]";
        }
    } else {
        die("ERRO: @lng[Caso não informado]");
    }
}
Exemplo n.º 5
0
function Main()
{
    header('Content-Type: text/html; charset=iso-8859-1');
    $arrInfos = split('_', $_POST['chave']);
    $fe = new Fechamento();
    $fe->setCodcaso($_SESSION['casores']);
    $contUnico = 1;
    if ($arrInfos[1] != 'perg' && $arrInfos[1] != 'grupo-perg') {
        $res = new Resolucao();
        $res->setCodcaso($_SESSION['casores']);
        $respostas = $res->BuscaRespostas($arrInfos[3]);
        $alternativas = $fe->RetornaConteudosDoItemDaMontagem($arrInfos[3], $arrInfos[1]);
        if ($alternativas) {
            $htmlInterativas .= '<div><strong>' . Montagem::RetornaDescricaoItem($_SESSION['casores'], 1, $arrInfos[3]) . '</strong></div>';
            $htmlInterativas .= '<div class="det-etapa-int">';
            $htmlInterativas .= '<table class="listadados">';
            $htmlInterativas .= '<tr class="head">';
            $htmlInterativas .= '<td class="td-col-alt">@lng[Alternativa]</td>';
            $htmlInterativas .= '<td class="td-col-correto">@lng[Gabarito]</td>';
            $htmlInterativas .= '<td class="td-col-escolha">@lng[Você marcou]</td>';
            $htmlInterativas .= '<td class="td-col-jus">&nbsp;</td>';
            $htmlInterativas .= '<td class="td-col-compl">&nbsp;</td>';
            $htmlInterativas .= '</tr>';
            $contAlt = 1;
            foreach ($alternativas as $alternativa) {
                $htmlInterativas .= '<tr class="norm">';
                $htmlInterativas .= '<td class="dado td-col-alt">' . $alternativa->Titulo . '</td>';
                $htmlInterativas .= '<td class="td-col-correto">' . ($alternativa->Correto == 1 ? Comuns::IMG_STATUS_CERTO : Comuns::IMG_STATUS_ERRADO) . '</td>';
                $htmlInterativas .= '<td class="td-col-escolha">' . ((intval($respostas) & intval($alternativa->ValorOpt)) > 0 ? Comuns::IMG_ITEM_PINO : '') . '</td>';
                $htmlInterativas .= '<td class="td-col-jus">' . trim(strip_tags(nl2br($alternativa->Justificativa)) != '' ? '<a href="javascript:void(0);" onclick="javascript:fntDetItem(\'j\', \'' . $contUnico . '\', \'' . $contAlt . '\');">@lng[Ver detalhes]</a>' : '') . '</td>';
                $htmlInterativas .= '<td class="td-col-compl">' . trim(strip_tags(nl2br($alternativa->ConteudoAdicional)) != '' ? '<a href="javascript:void(0);" onclick="javascript:fntDetItem(\'c\', \'' . $contUnico . '\', \'' . $contAlt . '\');">@lng[Ver complemento]</a>' : '') . '</td>';
                $htmlInterativas .= '</tr>';
                if (trim(strip_tags($alternativa->Justificativa)) != '') {
                    $htmlInterativas .= '<tr style="display:none;" id="jus-' . $contUnico . '-' . $contAlt . '">';
                    $htmlInterativas .= '<td colspan="5" class="apre-just"><div class="cont-just">' . $alternativa->Justificativa . '</div></td>';
                    $htmlInterativas .= '</tr>';
                }
                if (trim(strip_tags($alternativa->ConteudoAdicional)) != '') {
                    $htmlInterativas .= '<tr style="display:none;" id="contadi-' . $contUnico . '-' . $contAlt . '">';
                    $htmlInterativas .= '<td colspan="5" class="apre-compl"><div class="cont-compl">' . $alternativa->ConteudoAdicional . '</div></td>';
                    $htmlInterativas .= '</tr>';
                }
                $contAlt++;
                $contUnico++;
            }
            $htmlInterativas .= '</table>';
            $htmlInterativas .= '</div>';
        } else {
            die($fe->getErro() . ' Alternativas');
        }
        $htmlInterativas .= '<div class="espacador"></div>';
    } else {
        if ($arrInfos[1] == 'perg') {
            $res = new Resolucao();
            $res->setCodcaso($_SESSION['casores']);
            $itens = $res->BuscaConteudosAgrupador($arrInfos[3]);
            if ($itens) {
                foreach ($itens as $p) {
                    // Chave, TipoConteudo, ChavePai, Organizador, ContReferencia, ValorOpt, Ordem
                    $perg = new Pergunta();
                    $perg->Carregar($p->ContReferencia);
                    if (!is_null($perg->getTextoExplicacaoGeral()) && $perg->getTextoExplicacaoGeral() != '') {
                        $boolExplicacao = true;
                    } else {
                        $boolExplicacao = false;
                    }
                    $htmlInterativas .= '<div>@lng[Etapa:] <strong>' . $perg->getTexto() . '</strong>' . ($boolExplicacao ? '<span style="float:right;"><a href="javascript:void(0);" onclick="javascript:fntMostraOculta(\'exp-' . $perg->getCodigo() . '\');"><img src="img/info.gif" alt="@lng[Mais informações]" title="@lng[Mais informações]" /></a></span>' : '') . '</div>';
                    if ($boolExplicacao) {
                        $htmlInterativas .= '<div class="explicacao-item" id="exp-' . $perg->getCodigo() . '" style="display:none;">' . $perg->getTextoExplicacaoGeral() . '</div>';
                    }
                    $respostas = $res->BuscaRespostas($arrInfos[3], $perg->getCodigo());
                    $alternativas = $fe->RetornaAlternativasDaPergunta($perg->getCodigo());
                    if ($alternativas) {
                        $htmlInterativas .= '<div class="det-etapa-int">';
                        $htmlInterativas .= '<table class="listadados">';
                        $htmlInterativas .= '<tr class="head">';
                        $htmlInterativas .= '<td class="td-col-alt">@lng[Alternativa]</td>';
                        $htmlInterativas .= '<td class="td-col-correto">@lng[Gabarito]</td>';
                        $htmlInterativas .= '<td class="td-col-escolha">@lng[Você marcou]</td>';
                        $htmlInterativas .= '<td class="td-col-jus">&nbsp;</td>';
                        $htmlInterativas .= '<td class="td-col-compl">&nbsp;</td>';
                        $htmlInterativas .= '</tr>';
                        $contAlt = 1;
                        foreach ($alternativas as $alternativa) {
                            $htmlInterativas .= '<tr class="norm">';
                            $htmlInterativas .= '<td class="dado td-col-alt">' . $alternativa->Alternativa . '</td>';
                            $htmlInterativas .= '<td class="td-col-correto">' . ($alternativa->Correto == 1 ? Comuns::IMG_STATUS_CERTO : Comuns::IMG_STATUS_ERRADO) . '</td>';
                            $htmlInterativas .= '<td class="td-col-escolha">' . ((intval($respostas) & intval($alternativa->ValorOpt)) > 0 ? Comuns::IMG_ITEM_PINO : '') . '</td>';
                            $htmlInterativas .= '<td class="td-col-jus">' . (!is_null($alternativa->Explicacao) && strip_tags(trim(nl2br($alternativa->Explicacao))) != '' ? '<a href="javascript:void(0);" onclick="javascript:fntDetItem(\'j\', \'' . $contUnico . '\', \'' . $contAlt . '\');">@lng[Ver detalhes]</a>' : '') . '</td>';
                            $htmlInterativas .= '<td class="td-col-compl">&nbsp;</td>';
                            $htmlInterativas .= '</tr>';
                            if (trim(strip_tags($alternativa->Explicacao)) != '') {
                                $htmlInterativas .= '<tr style="display:none;" id="jus-' . $contUnico . '-' . $contAlt . '">';
                                $htmlInterativas .= '<td colspan="5" class="apre-just"><div class="cont-just">' . $alternativa->Explicacao . '</div></td>';
                                $htmlInterativas .= '</tr>';
                            }
                            $contAlt++;
                            $contUnico++;
                        }
                        $htmlInterativas .= '</table>';
                        $htmlInterativas .= '</div>';
                    } else {
                        die($fe->getErro() . ' Alternativas pergunta');
                    }
                    $htmlInterativas .= '<div class="espacador"></div>';
                }
            } else {
                $htmlInterativas = "Erro linha 34";
            }
        } else {
            if ($arrInfos[1] == 'grupo-perg') {
                $res = new Resolucao();
                $res->setCodcaso($_SESSION['casores']);
                $agrupadores = $res->BuscaConteudosAgrupador($arrInfos[3]);
                if ($agrupadores) {
                    foreach ($agrupadores as $agrup) {
                        $grupo = new GrupoPergunta();
                        if ($grupo->Carrega($agrup->ContReferencia)) {
                            $perguntas = $grupo->getPerguntas();
                            if (!is_null($grupo->getExplicacao()) && trim(strip_tags($grupo->getExplicacao())) != '') {
                                $boolExplicacao = true;
                            } else {
                                $boolExplicacao = false;
                            }
                        } else {
                            die($grupo->getErro());
                        }
                        $htmlInterativas .= '<div class="item-interativo">@lng[Etapa:] <strong>' . $grupo->getTexto() . '</strong>' . ($boolExplicacao ? '<span style="float:right"><a href="javascript:void(0);" onclick="javascript:fntMostraOculta(\'exp-' . $grupo->getCodgrupo() . '\');"><img src="img/info.gif" alt="@lng[Mais informações]" title="@lng[Mais informações]" /></a></span>' : '') . '</div>';
                        if ($boolExplicacao) {
                            $htmlInterativas .= '<div class="explicacao-item" id="exp-' . $grupo->getCodgrupo() . '" style="display:none;">' . $grupo->getExplicacao() . '</div>';
                        }
                        foreach ($perguntas as $perg) {
                            $p = new Pergunta();
                            $p->Carregar($perg);
                            $respostas = $res->BuscaRespostas($arrInfos[3], $perg);
                            $alternativas = $fe->RetornaAlternativasDaPergunta($perg);
                            if ($alternativas) {
                                $htmlInterativas .= '<div class="sub-etapa">' . $p->getTexto() . '</div>';
                                $htmlInterativas .= '<div class="det-etapa-int">';
                                $htmlInterativas .= '<table class="listadados">';
                                $htmlInterativas .= '<tr class="head">';
                                $htmlInterativas .= '<td class="td-col-alt">@lng[Alternativa]</td>';
                                $htmlInterativas .= '<td class="td-col-correto">@lng[Gabarito]</td>';
                                $htmlInterativas .= '<td class="td-col-escolha">@lng[Você marcou]</td>';
                                $htmlInterativas .= '<td class="td-col-jus">&nbsp;</td>';
                                $htmlInterativas .= '<td class="td-col-compl">&nbsp;</td>';
                                $htmlInterativas .= '</tr>';
                                $contAlt = 1;
                                foreach ($alternativas as $alternativa) {
                                    $htmlInterativas .= '<tr class="norm">';
                                    $htmlInterativas .= '<td class="dado td-col-alt">' . $alternativa->Alternativa . '</td>';
                                    $htmlInterativas .= '<td class="td-col-correto">' . ($alternativa->Correto == 1 ? Comuns::IMG_STATUS_CERTO : Comuns::IMG_STATUS_ERRADO) . '</td>';
                                    $htmlInterativas .= '<td class="td-col-escolha">' . ((intval($respostas) & intval($alternativa->ValorOpt)) > 0 ? Comuns::IMG_ITEM_PINO : '') . '</td>';
                                    $htmlInterativas .= '<td class="td-col-jus">' . (trim(strip_tags(nl2br($alternativa->Explicacao))) != '' ? '<a href="javascript:void(0);" onclick="javascript:fntDetItem(\'j\', \'' . $contUnico . '\', \'' . $contAlt . '\');">@lng[Ver detalhes]</a>' : '') . '</td>';
                                    $htmlInterativas .= '<td class="td-col-compl">&nbsp;</td>';
                                    $htmlInterativas .= '</tr>';
                                    if (trim(strip_tags($alternativa->Explicacao)) != '') {
                                        if (!is_null($alternativa->Explicacao)) {
                                            $htmlInterativas .= '<tr style="display:none;" id="jus-' . $contUnico . '-' . $contAlt . '">';
                                            $htmlInterativas .= '<td colspan="5" class="apre-just"><div class="cont-just">' . $alternativa->Explicacao . '</div></td>';
                                            $htmlInterativas .= '</tr>';
                                        }
                                    }
                                    $contAlt++;
                                    $contUnico++;
                                }
                                $htmlInterativas .= '</table>';
                                $htmlInterativas .= '</div>';
                            } else {
                                die($fe->getErro() . ' alternativas grupo pergunta');
                            }
                            $htmlInterativas .= '<div class="espacador"></div>';
                        }
                    }
                } else {
                    $htmlInterativas = "Erro linha 122";
                }
            }
        }
    }
    echo Comuns::Idioma($htmlInterativas);
}
Exemplo n.º 6
0
function Main()
{
    if (isset($_SESSION['casores']) && $_SESSION['casores'] > 0) {
        $u = unserialize($_SESSION['usu']);
        $intCodCaso = $_SESSION['casores'];
        $intResolucao = Resolucao::BuscaUltimaResolucaoCaso($intCodCaso, $u->getCodigo(), 3);
        $_SESSION['codresolucao'] = $intResolucao;
        $tpl = file_get_contents("tpl/aluno/resumo.html");
        $fe = new Fechamento();
        $fe->setCodcaso($intCodCaso);
        $fe->setCodresolucao($intResolucao);
        $basicos = $fe->RetornaDadosBasicos();
        if ($basicos !== false) {
            $strNome = split(' ', $basicos->NomeCompleto);
            $tpl = str_replace('<!--titulocaso-->', $basicos->Caso, $tpl);
            $tpl = str_replace('<!--NomeUsuario-->', $strNome[0], $tpl);
            $tpl = str_replace('<!--DataInicial-->', date("d/m/Y H:i:s", strtotime($basicos->DataInicio)), $tpl);
            $tpl = str_replace('<!--DataFinal-->', date("d/m/Y H:i:s", strtotime($basicos->DataFim)), $tpl);
            $tpl = str_replace('<!--NumAcessos-->', $basicos->NumAcessos, $tpl);
            $tpl = str_replace('<!--ConteudosVistos-->', $basicos->ConteudosVistos, $tpl);
            $trajetoria = $fe->RetornaTrajetoria();
            if ($trajetoria) {
                $caminho = '<table><tr><td class="dado">@lng[Item]</td><td class="dado">@lng[Data/Hora]</td></tr>';
                foreach ($trajetoria as $etapa) {
                    $caminho .= '<tr>';
                    $caminho .= '<td><img src="img/' . $etapa->TipoConteudo . '_mini.png" />' . $etapa->Conteudo . '</td><td>' . date("d/m/Y H:i:s", strtotime($etapa->DataHora)) . '</td>';
                    $caminho .= '</tr>';
                }
                $caminho .= '</table>';
                $tpl = str_replace('<!--ListaTrajeto-->', $caminho, $tpl);
                $interativas = $fe->RetornaEtapasInterativas();
                if ($interativas) {
                    $intNumCertas = 0;
                    $intNumErradas = 0;
                    $intNumTotalAlt = 0;
                    $tpl = str_replace('<!--NumEtapasInterativas-->', count($interativas), $tpl);
                    $contInt = 1;
                    $contUnico = 1;
                    $res = new Resolucao();
                    foreach ($interativas as $item) {
                        //$res = new Resolucao();
                        //$respostas = $res->BuscaRespostas($item->ChaveItem);
                        if ($item->TipoConteudo != 'perg' && $item->TipoConteudo != 'grupo-perg') {
                            $htmlInterativas .= '<div class="item-interativo">@lng[Etapa:] <strong>' . $item->Conteudo . '</strong></div>';
                            $htmlInterativas .= '<div class="det-etapa-int">@lng[Número de tentivas de resposta:] <span class="dado">' . $item->Tentativas . '</span></div>';
                            $respostas = $res->BuscaRespostas($item->ChaveItem);
                            $alternativas = $fe->RetornaConteudosDoItemDaMontagem($item->ChaveItem, $item->TipoConteudo);
                            if ($alternativas) {
                                $htmlInterativas .= '<div class="det-etapa-int">';
                                $htmlInterativas .= '<table class="listadados">';
                                $htmlInterativas .= '<tr class="head">';
                                $htmlInterativas .= '<td class="td-col-alt">@lng[Alternativa]</td>';
                                $htmlInterativas .= '<td class="td-col-correto">@lng[Gabarito]</td>';
                                $htmlInterativas .= '<td class="td-col-escolha">@lng[Você marcou]</td>';
                                $htmlInterativas .= '<td class="td-col-jus">&nbsp;</td>';
                                $htmlInterativas .= '<td class="td-col-compl">&nbsp;</td>';
                                $htmlInterativas .= '</tr>';
                                $contAlt = 1;
                                foreach ($alternativas as $alternativa) {
                                    $htmlInterativas .= '<tr class="norm">';
                                    $htmlInterativas .= '<td class="dado td-col-alt">' . $alternativa->Titulo . '</td>';
                                    $htmlInterativas .= '<td class="td-col-correto">' . ($alternativa->Correto == 1 ? Comuns::IMG_STATUS_CERTO : Comuns::IMG_STATUS_ERRADO) . '</td>';
                                    $htmlInterativas .= '<td class="td-col-escolha">' . ((intval($respostas) & intval($alternativa->ValorOpt)) > 0 ? Comuns::IMG_ITEM_PINO : '') . '</td>';
                                    $htmlInterativas .= '<td class="td-col-jus">' . (strip_tags($alternativa->Justificativa) != '' ? '<a href="javascript:void(0);" onclick="javascript:fntDetItem(\'j\', \'' . $contInt . '\', \'' . $contAlt . '\');">@lng[Ver detalhes]</a>' : '') . '</td>';
                                    $htmlInterativas .= '<td class="td-col-compl">' . (strip_tags($alternativa->ConteudoAdicional) != '' ? '<a href="javascript:void(0);" onclick="javascript:fntDetItem(\'c\', \'' . $contInt . '\', \'' . $contAlt . '\');">@lng[Ver complemento]</a>' : '') . '</td>';
                                    $htmlInterativas .= '</tr>';
                                    if (strip_tags($alternativa->Justificativa) != '') {
                                        $htmlInterativas .= '<tr style="display:none;" id="jus-' . $contInt . '-' . $contAlt . '">';
                                        $htmlInterativas .= '<td colspan="5" class="apre-just"><div class="cont-just">' . $alternativa->Justificativa . '</div></td>';
                                        $htmlInterativas .= '</tr>';
                                    }
                                    if (strip_tags($alternativa->ConteudoAdicional) != '') {
                                        $htmlInterativas .= '<tr style="display:none;" id="contadi-' . $contInt . '-' . $contAlt . '">';
                                        $htmlInterativas .= '<td colspan="5" class="apre-compl"><div class="cont-compl">' . $alternativa->ConteudoAdicional . '</div></td>';
                                        $htmlInterativas .= '</tr>';
                                    }
                                    // Contabilização das respostas certas ou erradas
                                    if ($alternativa->Correto == 1) {
                                        if ((intval($respostas) & intval($alternativa->ValorOpt)) > 0) {
                                            $intNumCertas++;
                                        } else {
                                            $intNumErradas++;
                                        }
                                    } else {
                                        if ((intval($respostas) & intval($alternativa->ValorOpt)) > 0) {
                                            $intNumErradas++;
                                        } else {
                                            $intNumCertas++;
                                        }
                                    }
                                    $contAlt++;
                                    $contUnico++;
                                }
                                $intNumTotalAlt += $contAlt;
                                $htmlInterativas .= '</table>';
                                $htmlInterativas .= '</div>';
                            } else {
                                die($fe->getErro() . ' Alternativas');
                            }
                            $htmlInterativas .= '<div class="espacador"></div>';
                        } else {
                            if ($item->TipoConteudo == 'perg') {
                                $perg = new Pergunta();
                                $perg->Carregar($item->CodPergunta);
                                if (!is_null($perg->getTextoExplicacaoGeral()) && $perg->getTextoExplicacaoGeral() != '') {
                                    $boolExplicacao = true;
                                } else {
                                    $boolExplicacao = false;
                                }
                                $htmlInterativas .= '<div class="item-interativo">@lng[Etapa:] <strong>' . $item->Conteudo . '</strong>' . ($boolExplicacao ? '<span style="float:right;"><a href="javascript:void(0);" onclick="javascript:fntMostraOculta(\'exp-' . $perg->getCodigo() . '\');"><img src="img/info.gif" alt="@lng[Mais informações]" title="@lng[Mais informações]" /></a></span>' : '') . '</div>';
                                if ($boolExplicacao) {
                                    $htmlInterativas .= '<div class="explicacao-item" id="exp-' . $perg->getCodigo() . '" style="display:none;">' . $perg->getTextoExplicacaoGeral() . '</div>';
                                }
                                $htmlInterativas .= '<div class="det-etapa-int">@lng[Número de tentivas de resposta:] <span class="dado">' . $item->Tentativas . '</span></div>';
                                $respostas = $res->BuscaRespostas($item->ChaveItem, $item->CodPergunta);
                                $alternativas = $fe->RetornaAlternativasDaPergunta($item->CodPergunta);
                                if ($alternativas) {
                                    $htmlInterativas .= '<div class="det-etapa-int">';
                                    $htmlInterativas .= '<table class="listadados">';
                                    $htmlInterativas .= '<tr class="head">';
                                    $htmlInterativas .= '<td class="td-col-alt">@lng[Alternativa]</td>';
                                    $htmlInterativas .= '<td class="td-col-correto">@lng[Gabarito]</td>';
                                    $htmlInterativas .= '<td class="td-col-escolha">@lng[Você marcou]</td>';
                                    $htmlInterativas .= '<td class="td-col-jus">&nbsp;</td>';
                                    $htmlInterativas .= '<td class="td-col-compl">&nbsp;</td>';
                                    $htmlInterativas .= '</tr>';
                                    $contAlt = 1;
                                    foreach ($alternativas as $alternativa) {
                                        $htmlInterativas .= '<tr class="norm">';
                                        $htmlInterativas .= '<td class="dado td-col-alt">' . $alternativa->Alternativa . '</td>';
                                        $htmlInterativas .= '<td class="td-col-correto">' . ($alternativa->Correto == 1 ? Comuns::IMG_STATUS_CERTO : Comuns::IMG_STATUS_ERRADO) . '</td>';
                                        $htmlInterativas .= '<td class="td-col-escolha">' . ((intval($respostas) & intval($alternativa->ValorOpt)) > 0 ? Comuns::IMG_ITEM_PINO : '') . '</td>';
                                        $htmlInterativas .= '<td class="td-col-jus">' . (strip_tags($alternativa->Explicacao) != '' ? '<a href="javascript:void(0);" onclick="javascript:fntDetItem(\'j\', \'' . $contInt . '\', \'' . $contAlt . '\');">@lng[Ver detalhes]</a>' : '') . '</td>';
                                        $htmlInterativas .= '<td class="td-col-compl">&nbsp;</td>';
                                        $htmlInterativas .= '</tr>';
                                        if (strip_tags($alternativa->Explicacao) != '') {
                                            $htmlInterativas .= '<tr style="display:none;" id="jus-' . $contInt . '-' . $contAlt . '">';
                                            $htmlInterativas .= '<td colspan="5" class="apre-just"><div class="cont-just">' . $alternativa->Explicacao . '</div></td>';
                                            $htmlInterativas .= '</tr>';
                                        }
                                        // Contabilização das respostas certas ou erradas
                                        if ($alternativa->Correto == 1) {
                                            if ((intval($respostas) & intval($alternativa->ValorOpt)) > 0) {
                                                $intNumCertas++;
                                            } else {
                                                $intNumErradas++;
                                            }
                                        } else {
                                            if ((intval($respostas) & intval($alternativa->ValorOpt)) > 0) {
                                                $intNumErradas++;
                                            } else {
                                                $intNumCertas++;
                                            }
                                        }
                                        $contAlt++;
                                        $contUnico++;
                                    }
                                    $intNumTotalAlt == $contAlt;
                                    $htmlInterativas .= '</table>';
                                    $htmlInterativas .= '</div>';
                                } else {
                                    die($fe->getErro() . ' Alternativas pergunta');
                                }
                                $htmlInterativas .= '<div class="espacador"></div>';
                            } else {
                                if ($item->TipoConteudo == 'grupo-perg') {
                                    $res->setCodcaso($intCodCaso);
                                    $agrupadores = $res->BuscaConteudosAgrupador($item->ChaveItem);
                                    if ($agrupadores) {
                                        foreach ($agrupadores as $agrup) {
                                            $grupo = new GrupoPergunta();
                                            if ($grupo->Carrega($agrup->ContReferencia)) {
                                                $perguntas = $grupo->getPerguntas();
                                                if (!is_null($grupo->getExplicacao()) && strip_tags($grupo->getExplicacao()) != '') {
                                                    $boolExplicacao = true;
                                                } else {
                                                    $boolExplicacao = false;
                                                }
                                            } else {
                                                die($grupo->getErro());
                                            }
                                            $htmlInterativas .= '<div class="item-interativo">Etapa: <strong>' . $grupo->getTexto() . '</strong>' . ($boolExplicacao ? '<span style="float:right"><a href="javascript:void(0);" onclick="javascript:fntMostraOculta(\'exp-' . $grupo->getCodgrupo() . '\');"><img src="img/info.gif" alt="@lng[Mais informações]" title="@lng[Mais informações]" /></a></span>' : '') . '</div>';
                                            if ($boolExplicacao) {
                                                $htmlInterativas .= '<div class="explicacao-item" id="exp-' . $grupo->getCodgrupo() . '" style="display:none;">' . $grupo->getExplicacao() . '</div>';
                                            }
                                            $htmlInterativas .= '<div class="det-etapa-int">@lng[Número de tentivas de resposta:] <span class="dado">' . $item->Tentativas . '</span></div>';
                                            foreach ($perguntas as $perg) {
                                                $p = new Pergunta();
                                                $p->Carregar($perg);
                                                $respostas = $res->BuscaRespostas($item->ChaveItem, $perg);
                                                $alternativas = $fe->RetornaAlternativasDaPergunta($perg);
                                                if ($alternativas) {
                                                    $htmlInterativas .= '<div class="sub-etapa">' . $p->getTexto() . '</div>';
                                                    $htmlInterativas .= '<div class="det-etapa-int">';
                                                    $htmlInterativas .= '<table class="listadados">';
                                                    $htmlInterativas .= '<tr class="head">';
                                                    $htmlInterativas .= '<td class="td-col-alt">@lng[Alternativa]</td>';
                                                    $htmlInterativas .= '<td class="td-col-correto">@lng[Gabarito]</td>';
                                                    $htmlInterativas .= '<td class="td-col-escolha">@lng[Você marcou]</td>';
                                                    $htmlInterativas .= '<td class="td-col-jus">&nbsp;</td>';
                                                    $htmlInterativas .= '<td class="td-col-compl">&nbsp;</td>';
                                                    $htmlInterativas .= '</tr>';
                                                    $contAlt = 1;
                                                    foreach ($alternativas as $alternativa) {
                                                        $htmlInterativas .= '<tr class="norm">';
                                                        $htmlInterativas .= '<td class="dado td-col-alt">' . $alternativa->Alternativa . '</td>';
                                                        $htmlInterativas .= '<td class="td-col-correto">' . ($alternativa->Correto == 1 ? Comuns::IMG_STATUS_CERTO : Comuns::IMG_STATUS_ERRADO) . '</td>';
                                                        $htmlInterativas .= '<td class="td-col-escolha">' . ((intval($respostas) & intval($alternativa->ValorOpt)) > 0 ? Comuns::IMG_ITEM_PINO : '') . '</td>';
                                                        $htmlInterativas .= '<td class="td-col-jus">' . (strip_tags($alternativa->Explicacao) != '' ? '<a href="javascript:void(0);" onclick="javascript:fntDetItem(\'j\', \'' . $contUnico . '\', \'' . $contAlt . '\');">@lng[Ver detalhes]</a>' : '') . '</td>';
                                                        $htmlInterativas .= '<td class="td-col-compl">&nbsp;</td>';
                                                        $htmlInterativas .= '</tr>';
                                                        if (strip_tags($alternativa->Explicacao) != '') {
                                                            $htmlInterativas .= '<tr style="display:none;" id="jus-' . $contUnico . '-' . $contAlt . '">';
                                                            $htmlInterativas .= '<td colspan="5" class="apre-just"><div class="cont-just">' . $alternativa->Explicacao . '</div></td>';
                                                            $htmlInterativas .= '</tr>';
                                                        }
                                                        // Contabilização das respostas certas ou erradas
                                                        if ($alternativa->Correto == 1) {
                                                            if ((intval($respostas) & intval($alternativa->ValorOpt)) > 0) {
                                                                $intNumCertas++;
                                                            } else {
                                                                $intNumErradas++;
                                                            }
                                                        } else {
                                                            if ((intval($respostas) & intval($alternativa->ValorOpt)) > 0) {
                                                                $intNumErradas++;
                                                            } else {
                                                                $intNumCertas++;
                                                            }
                                                        }
                                                        $contAlt++;
                                                        $contUnico++;
                                                    }
                                                    $htmlInterativas .= '</table>';
                                                    $htmlInterativas .= '</div>';
                                                } else {
                                                    die($fe->getErro() . ' alternativas grupo pergunta');
                                                }
                                                $htmlInterativas .= '<div class="espacador"></div>';
                                            }
                                        }
                                    } else {
                                        die($res->getErro() . " agrupadores");
                                    }
                                }
                            }
                        }
                        $contInt++;
                    }
                    $dblNota = round($intNumCertas / $intNumTotalAlt * 10, 2);
                    $tpl = str_replace('<!--DescricaoInterativas-->', $htmlInterativas, $tpl);
                    $tpl = str_replace('<!--DescricaoNota-->', $dblNota, $tpl);
                } else {
                    die($fe->getErro() . ' Interativas');
                }
            } else {
                die($fe->getErro() . ' Trajetórias');
            }
        } else {
            die($fe->getErro() . ' Basicos');
        }
        echo $tpl;
    } else {
        $msg = base64_encode("@lng[Caso não informado]");
        header("Location:aluno.php?msg=" . $msg);
    }
}
Exemplo n.º 7
0
function Main()
{
    $codcaso = $_GET['c'];
    $direcao = $_POST['d'];
    $codcaso = is_null($codcaso) ? "" : $codcaso;
    $direcao = is_null($direcao) ? "f" : $direcao;
    if ($direcao != "p" && $direcao != "f") {
        $direcao = "p";
    }
    if ($codcaso == "") {
        if (!isset($_SESSION['casores']) || is_null('casores')) {
            $msg = base64_encode("@lng[Não foi informado nenhum caso de estudos]");
            header("Location:aluno.php?msg=" . $msg);
        }
    } else {
        $_SESSION['casores'] = base64_decode($codcaso);
        $_SESSION['status'] = false;
        $_SESSION['codresolucao'] = null;
        $_SESSION['chaveanterior'] = null;
        $_SESSION['chaveatual'] = null;
        $_SESSION['tipocont'] = null;
        $_SESSION['organizador'] = null;
        $_SESSION['ordem'] = null;
    }
    $chave = $_GET['k'];
    if (is_null($chave)) {
        $chave = "";
    }
    $tpl = file_get_contents("tpl/aluno/resolve.html");
    $u = unserialize($_SESSION["usu"]);
    //$u = new Usuario();
    $res = new Resolucao();
    $res->setCodcaso($_SESSION['casores']);
    $res->setCodusuario($u->getCodigo());
    if (!$_SESSION['status']) {
        $_SESSION['status'] = $res->BuscaStatusAndamento();
        if ($_SESSION['status'] == 1) {
            $res->IniciaResolucao();
        } else {
            if ($_SESSION['status'] == 2) {
                if ($_SESSION['codresolucao'] == null) {
                    $_SESSION['codresolucao'] = base64_decode($_GET['r']);
                }
                $res->setCodresolucao($_SESSION['codresolucao']);
                $res->RegistraAcesso($u->getIdAcessoAtual());
            } else {
                if ($_SESSION['status'] == 3) {
                    $res->IniciaResolucao();
                } else {
                    $_SESSION['status'] = false;
                    die("Inconsistencia localizada. " . $res->getErro());
                }
            }
        }
    }
    if ($_SESSION['status'] !== false) {
        $c = new Caso();
        $c->setCodigo($_SESSION['casores']);
        $c->CarregarCaso();
        //$conteudo = $c->BuscaProximoConteudo($chave, $direcao);
        $conteudo = $res->BuscaProximoConteudo($direcao);
        if (!$conteudo) {
            echo $res->getErro();
            return;
        }
        $tpl = str_replace("<!--titulocaso-->", $c->getNome(), $tpl);
        $tpl = str_replace("<!--titulosecao-->", $conteudo->getValue("titulosecao"), $tpl);
        $tpl = str_replace("<!--menusecao-->", $conteudo->getValue("menu"), $tpl);
        $tpl = str_replace("<!--conteudosecao-->", $conteudo->getValue("conteudo"), $tpl);
        $tpl = str_replace("<!--chave-->", $conteudo->getValue("chave"), $tpl);
        //$tpl = str_replace("<!--of-->", $conteudo->getValue("Obrigatorio"), $tpl);
        if ($conteudo->ContainsKey("javascript")) {
            $tpl = str_replace("<!--javascriptload-->", $conteudo->getValue("javascript"), $tpl);
        } else {
            $tpl = str_replace("<!--javascriptload-->", "", $tpl);
        }
        echo $tpl;
    } else {
        die("@lng[Status do caso não pode ser localizado. Detalhes:] " . $res->getErro());
    }
}
Exemplo n.º 8
0
function Main()
{
    header('Content-Type: text/html; charset=iso-8859-1');
    if (isset($_SESSION['caso']) && $_SESSION['caso'] > 0) {
        if ($_POST['tip'] == "tree") {
            $mon = new Montagem();
            $mon->setCodCaso($_SESSION['caso']);
            $html = $mon->RetornaArvoreLista();
            if ($html) {
                $html = str_replace('<div id="tree">', '<div id="' . $_POST['id'] . '">', $html);
            } else {
                $html = "ERRO: " . $mon->getErro();
            }
            echo $html;
        } else {
            if ($_POST['tip'] == "opts") {
                if (!$_POST['perg']) {
                    $res = new Resolucao();
                    $res->setCodcaso($_SESSION['caso']);
                    $hash = $res->BuscaConteudoPelaChave($_POST['nodo'], true);
                    if ($hash != false) {
                        echo $hash->ToXML();
                    } else {
                        echo "ERRO. Hash voltou false";
                    }
                } else {
                    $pergunta = new Pergunta();
                    $pergunta->Carregar($_POST['perg']);
                    if ($pergunta->getTipo()->getCodigo() == 1) {
                        $cont = 1;
                        foreach ($pergunta->getAlternativas() as $alternativa) {
                            $html .= '<div class="alt-img">';
                            $html .= '<input type="checkbox" name="rdoAlternativa_' . $pergunta->getCodigo() . '[]" id="rdoAlt_' . $pergunta->getCodigo() . '_' . $cont . '" value="' . $alternativa->getCodBinario() . '" class="opcao-resposta" />' . $alternativa->getTexto();
                            $html .= '<div id="img"><img src="' . $alt->getImagem() . '" alt="' . $alt->getTexto() . '" title="' . $alt->getTexto() . '" class="img-preview" /></div>';
                            $html .= '</div>';
                            $cont++;
                        }
                    } else {
                        $cont = 1;
                        foreach ($pergunta->getAlternativas() as $alternativa) {
                            $html .= '<div class="alt-txt">';
                            $html .= '<input type="checkbox" name="rdoAlternativa_' . $pergunta->getCodigo() . '[]" id="rdoAlt_' . $pergunta->getCodigo() . '_' . $cont . '" value="' . $alternativa->getCodBinario() . '" class="opcao-resposta" />' . $alternativa->getTexto();
                            $html .= '</div>';
                            $cont++;
                        }
                    }
                    echo '<conteudo>' . $html . '</conteudo>';
                }
            } else {
                if ($_POST['tip'] == 'pergs') {
                    //$arrNodo = split("_", $_POST['nodo']);
                    Log::RegistraLog("Vai consultas as perguntas vinculadas ao nodo: " . $arrNodo[3]);
                    $mon = new Montagem();
                    $mon->setCodCaso($_SESSION['caso']);
                    $lista = $mon->ListaPerguntasNodo($_POST['nodo']);
                    if ($lista) {
                        $html .= '<option value="-1">@lng[Selecione]</option>';
                        foreach ($lista as $perg) {
                            $html .= '<option value="' . $perg->Codigo . '">' . substr($perg->Texto, 0, 100) . '</option>';
                        }
                    } else {
                        $html .= '<option>' . $mon->getErro() . '</option>';
                    }
                    echo $html;
                } else {
                    if ($_POST['tip'] == 'salvacond') {
                        $arrNodoAtual = split("_", $_POST['nodoatual']);
                        $arrNodoDestino = split("_", $_POST['nododes']);
                        if ($_POST['nodocond']) {
                            $arrNodoCond = split("_", $_POST['nodocond']);
                            $strChaveCond = $arrNodoCond[3];
                            if ($_POST['perg']) {
                                $intPerg = $_POST['perg'];
                            } else {
                                $intPerg = null;
                            }
                            $intResp = $_POST['resp'];
                        } else {
                            $strChaveCond = null;
                            $intResp = null;
                            $intPerg = null;
                        }
                        $strChaveAtual = $arrNodoAtual[3];
                        $strChaveDestino = $arrNodoDestino[3];
                        $mon = new Montagem();
                        $mon->setCodCaso($_SESSION['caso']);
                        $desvio = $mon->InsereSalto($strChaveAtual, $strChaveDestino, $strChaveCond, $intPerg, $intResp);
                        if ($desvio) {
                            $html = $mon->RetornaListaConfSaltos($strChaveAtual);
                            if ($html) {
                                echo $html;
                            } else {
                                echo "ERRO: " . $mon->getErro();
                            }
                        } else {
                            echo "ERRO: " . $mon->getErro();
                        }
                    } else {
                        if ($_POST['tip'] == 'mudaprior') {
                            $mon = new Montagem();
                            $mon->setCodCaso($_SESSION['caso']);
                            if ($mon->AlteraPrioridadeSalto($_POST['mm'], base64_decode($_POST['chaveOri']), base64_decode($_POST['chaveDest']))) {
                                echo $mon->RetornaListaConfSaltos(base64_decode($_POST['chaveOri']));
                            } else {
                                echo "ERRO: " . $mon->getErro();
                            }
                        } else {
                            if ($_POST['tip'] == 'delsalto') {
                                $mon = new Montagem();
                                $mon->setCodCaso($_SESSION['caso']);
                                if ($mon->DeletaSalto(base64_decode($_POST['chaveOri']), base64_decode($_POST['chaveDest']))) {
                                    echo $mon->RetornaListaConfSaltos(base64_decode($_POST['chaveOri']));
                                } else {
                                    echo "ERRO: " . $mon->getErro();
                                }
                            } else {
                                if ($_POST['tip'] == 'vincanexo') {
                                    $mon = new Montagem();
                                    $mon->setCodCaso($_SESSION['caso']);
                                    $nodo = $_POST['item'];
                                    $cont = $_POST['cont'];
                                    $strTipoCont = substr($cont, 0, 1);
                                    $arr = split("_", $nodo);
                                    $u = unserialize($_SESSION['usu']);
                                    if ($mon->InsereAnexo($arr[3], base64_decode(substr($cont, 1)), $strTipoCont, $u->getCodigo())) {
                                        echo $mon->RetornaListaConfAnexos($arr[3]);
                                    } else {
                                        echo 'ERRO: ' . $mon->getErro();
                                    }
                                } else {
                                    if ($_POST['tip'] == 'delanexo') {
                                        $mon = new Montagem();
                                        $mon->setCodCaso($_SESSION['caso']);
                                        $nodo = base64_decode($_POST['item']);
                                        $cont = $_POST['cont'];
                                        $strTipoCont = substr($cont, 0, 1);
                                        //$arr = split("_", $nodo);
                                        //die("ERRO: " . $nodo . ' ' . base64_decode(substr($cont, 1)));
                                        if ($mon->DeletaAnexo($nodo, base64_decode(substr($cont, 1)), $strTipoCont)) {
                                            $listagem = $mon->RetornaListaConfAnexos($nodo);
                                            if ($listagem !== false) {
                                                echo $listagem;
                                            } else {
                                                echo "ERRO: " . $mon->getErro();
                                            }
                                        } else {
                                            echo 'ERRO: ' . $mon->getErro();
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    } else {
        echo "ERRO: @lng[Caso não informado]";
    }
}
Exemplo n.º 9
0
function Main()
{
    //header('Content-Type: text/html; charset=iso-8859-1');
    if (!$_GET['c']) {
        if (!isset($_SESSION['casores']) || is_null('casores')) {
            $msg = base64_encode("@lng[Não foi informado nenhum caso de estudo]");
            header("Location:aluno.php?msg=" . $msg);
        }
    } else {
        if (Caso::CasoValido(base64_decode($_GET['c']))) {
            $_SESSION['casores'] = base64_decode($_GET['c']);
            $_SESSION['status'] = false;
            $_SESSION['codresolucao'] = null;
        } else {
            $msg = base64_encode("@lng[Caso de estudo informado não é um caso válido]");
            header("Location:aluno.php?msg=" . $msg);
        }
    }
    $u = unserialize($_SESSION['usu']);
    //$u = new Usuario();
    $tpl = file_get_contents("tpl/frm-resolucao-off.html");
    // Armazena a árvore de forma oculta
    $mon = new Montagem();
    $mon->setCodCaso($_SESSION['casores']);
    $arvore = $mon->RetornaArvoreLista();
    $tpl = str_replace("<!--arvore-->", $arvore, $tpl);
    $res = new Resolucao();
    $res->setCodcaso($_SESSION['casores']);
    $res->setCodusuario($u->getCodigo());
    if ($_GET['m'] == 'pre') {
        $tpl = str_replace("<!--region_close_preview-->", file_get_contents("tpl/close-preview.html"), $tpl);
        if ($_GET['t'] == 'I') {
            if ($u->TemGrupo(1) || $u->TemGrupo(4)) {
                if (Caso::ConsultaSituacao($_SESSION['casores']) == 0) {
                    if (!$res->LimpaResolucao()) {
                        echo Comuns::Idioma("@lng[Erro ao limpar histórico de resoluções.]") . " " . $res->getErro();
                        return;
                    }
                } else {
                    echo Comuns::Idioma("@lng[Este caso está publicado e não é possível lipar suas resoluções]");
                    return;
                }
            } else {
                echo Comuns::Idioma("@lng[Você não tem permissõo para excluir as resoluções deste caso]");
                return;
            }
        }
    }
    if (!$_SESSION['status']) {
        $_SESSION['status'] = $res->BuscaStatusAndamento();
        $raiz = "";
        if ($_SESSION['status'] == 1) {
            $raiz = $res->BuscaNodoRaiz();
            $raiz = "fntInicia('raiz_raiz_0_" . $raiz . "');";
            $res->IniciaResolucao();
        } else {
            if ($_SESSION['status'] == 2) {
                if ($_SESSION['codresolucao'] == null) {
                    if ($_GET['r']) {
                        if (Resolucao::ResolucaoValida($_SESSION['casores'], $u->getCodigo(), base64_decode($_GET['r']))) {
                            $_SESSION['codresolucao'] = base64_decode($_GET['r']);
                        } else {
                            $msg = base64_encode("@lng[Dados informados inválidos]");
                            header("Location:aluno.php?msg=" . $msg);
                        }
                    } else {
                        $codresolucao = Resolucao::BuscaUltimaResolucaoCaso($_SESSION['casores'], $u->getCodigo(), $_SESSION['status']);
                        if ($codresolucao !== false) {
                            $_SESSION['codresolucao'] = $codresolucao;
                        } else {
                            $msg = base64_encode("@lng[Não foi possível localilzar a resolução deste caso]");
                            header("Location:aluno.php?msg=" . $msg);
                        }
                    }
                }
                $res->setCodresolucao($_SESSION['codresolucao']);
                $res->RegistraAcesso($u->getIdAcessoAtual());
                $raiz = $res->BuscaUltimoNodoVisitado();
                if ($raiz !== false) {
                    if ($raiz != -1) {
                        $strPossiveis = $res->BuscaTodosMenosUltimoVisitado();
                        if ($strPossiveis !== false) {
                            $strJaVisitados = $res->BuscaTodosNodosVisitados();
                            Log::RegistraLog("Nodos possíveis para o caminho de volta: " . $strPossiveis);
                            $raiz = "fntInicia('" . $raiz . "'); fntGeraCaminhoVolta('" . $strPossiveis . "'); fntGeraVisitados('" . $strJaVisitados . "');";
                        } else {
                            // Se não retornou nenhum é porque o ultimo visto foi a raiz e dai não precisa gerar histórico de volta
                            $raiz = "fntInicia('" . $raiz . "');";
                        }
                    } else {
                        $raiz = $res->BuscaNodoRaiz();
                        $raiz = "fntInicia('raiz_raiz_0_" . $raiz . "');";
                    }
                } else {
                    $msg = base64_encode("@lng[Erro durante a recuperação das informações.]" . $res->getErro());
                    header("Location:aluno.php?msg=" . $msg);
                }
            } else {
                if ($_SESSION['status'] == 3) {
                    if ($_GET['re'] && $_GET['re'] == true) {
                        $raiz = $res->BuscaNodoRaiz();
                        $raiz = "fntInicia('raiz_raiz_0_" . $raiz . "');";
                        $res->IniciaResolucao();
                    } else {
                        header("Location:vwopcoescaso.php?c=" . base64_encode($_SESSION['casores']));
                    }
                } else {
                    $_SESSION['status'] = false;
                    die("Inconsistencia localizada. " . $res->getErro());
                }
            }
        }
        if ($u->getNome() == "Anonimo") {
            $raiz .= "fntOcultaHome();";
        }
        $tpl = str_replace("<!--javascriptload-->", $raiz, $tpl);
    }
    // Busca o nome do caso clínico
    $infos = Caso::ConsultaInfosCaso($_SESSION['casores']);
    $tpl = str_replace("<!--titulocaso-->", $infos['nome'], $tpl);
    echo Comuns::Idioma($tpl);
}