Example #1
0
function Main()
{
    header('Content-Type: text/html; charset=iso-8859-1');
    $ht = new HashTable();
    $e = new Exame();
    $retorno = "";
    if ($_POST['context'] == 'N') {
        $ht->AddItem("imgs", $e->ListaArquivosExame($_SESSION['caso'], $_SESSION['exame'], "img"));
        $ht->AddItem("docs", $e->ListaArquivosExame($_SESSION['caso'], $_SESSION['exame'], "doc"));
        $retorno = $ht->ToXML();
    } else {
        $c = new Conteudo();
        $retorno = $c->Lista($_SESSION['caso']);
    }
    echo Comuns::Idioma($retorno);
}
Example #2
0
function TrataDadosExamesDetalhes($template)
{
    if (isset($_SESSION['caso']) && $_SESSION['caso'] != 0) {
        $codexame = base64_decode($_POST['r']);
        $_SESSION['exame'] = $codexame;
        $e = new Exame();
        $t = new TipoExame();
        $e->Carrega($_SESSION['caso'], $codexame);
        $t->Carrega($e->getTipo());
        if ($t->getPodeImgs()) {
            $listaimgs = '<h4>@lng[Imagens anexadas ao exame] <span class="nomeexame">"' . $e->getDescricao() . '"</span></h4>';
            $listaimgs .= '<div id="lista-imgs">';
            $listaimgs .= $e->ListaArquivosExame($_SESSION['caso'], $codexame, "img");
            $listaimgs .= '</div>';
            $template = str_replace("<!--listaimagens-->", $listaimgs, $template);
        } else {
            $template = str_replace("<!--listaimagens-->", "", $template);
        }
        if ($t->getPodeDocs()) {
            $listadocs = '<h4>@lng[Documentos anexados ao exame] <span class="nomeexame">"' . $e->getDescricao() . '"</span></h4>';
            $listadocs .= '<div id="lista-docs">';
            $listadocs .= $e->ListaArquivosExame($_SESSION['caso'], $codexame, "doc");
            $listadocs .= '</div>';
            $template = str_replace("<!--listadocs-->", $listadocs, $template);
        } else {
            $template = str_replace("<!--listadocs-->", "", $template);
        }
        if ($t->getPodeVals()) {
            $listavalref = '<div id="divLancaValores">';
            $listavalref .= $e->ListaValoresReferencia($_SESSION['caso'], $codexame);
            $listavalref .= '</div>';
            $template = str_replace("<!--lancavaloresrefexame-->", $listavalref, $template);
        } else {
            $template = str_replace("<!--lancavaloresrefexame-->", "", $template);
        }
        $template = str_replace("<!--laudo-->", is_null($e->getLaudo()) ? "" : $e->getLaudo(), $template);
        return $template;
    } else {
        return "@lng[Erro ao localizar o caso de estudo]";
    }
}