Example #1
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]";
    }
}