コード例 #1
0
ファイル: ajaxexamefisico.php プロジェクト: GoPlaceIn/siacc
function Main()
{
    header('Content-Type: text/html; charset=iso-8859-1');
    if (isset($_SESSION['casores']) && $_SESSION['casores'] > 0) {
        try {
            $ef = new ExameFisico();
            //unset($_SESSION['examefisicoaluno']);
            if (!isset($_SESSION['examefisicoaluno'])) {
                $ef->Carrega($_SESSION['casores']);
                $_SESSION['ef_cab'] = nl2br($ef->getCabeca());
                $_SESSION['ef_pes'] = nl2br($ef->getPescoco());
                $_SESSION['ef_cor'] = nl2br($ef->getAuscultacardiaca());
                $_SESSION['ef_pul'] = nl2br($ef->getAuscultapulmonar());
                $_SESSION['ef_abd'] = nl2br($ef->getAbdomen());
                $_SESSION['ef_sin'] = nl2br($ef->getSinaisvitais());
                $_SESSION['ef_pel'] = nl2br($ef->getPele());
                $_SESSION['ef_ext'] = nl2br($ef->getExtremidades());
                $_SESSION['ef_ger'] = nl2br($ef->getEstadoGeral());
                $_SESSION['ef_mid_cab'] = $ef->getMidiasCabeca();
                $_SESSION['ef_mid_pes'] = $ef->getMidiasPescoco();
                $_SESSION['ef_mid_cor'] = $ef->getMidiasAuscultaCardiaca();
                $_SESSION['ef_mid_pul'] = $ef->getMidiasAuscultaPulmonar();
                $_SESSION['ef_mid_abd'] = $ef->getMidiasAbdomen();
                $_SESSION['ef_mid_sin'] = $ef->getMidiasSinaisVitais();
                $_SESSION['ef_mid_pel'] = $ef->getMidiasPele();
                $_SESSION['ef_mid_ext'] = $ef->getMidiasExtremidades();
                $_SESSION['ef_mid_ger'] = $ef->getMidiasEstadoGeral();
                $_SESSION['examefisicoaluno'] = "sim";
            }
            switch ($_POST['p']) {
                case "cab":
                    $html = '<strong>@lng[Cabeça]</strong><br /><span>' . $_SESSION['ef_cab'] . '</span>';
                    $html .= $_SESSION['ef_mid_cab'] > 0 ? '<br /><div class="cont-multimidia"><a href="javascript:void(0);" onclick="javascript:fntCarregaMidias(\'' . base64_encode($_SESSION['ef_mid_cab']) . '\');">' . Comuns::IMG_MIDIA_MULTIMIDIA . '</a></div>' : '';
                    break;
                case "pes":
                    $html = '<strong>@lng[Pescoço]</strong><br /><span>' . $_SESSION['ef_pes'] . '</span>';
                    $html .= $_SESSION['ef_mid_pes'] > 0 ? '<br /><div class="cont-multimidia"><a href="javascript:void(0);" onclick="javascript:fntCarregaMidias(\'' . base64_encode($_SESSION['ef_mid_pes']) . '\');">' . Comuns::IMG_MIDIA_MULTIMIDIA . '</a></div>' : '';
                    break;
                case "cor":
                    $html = '<strong>@lng[Ausculta cardiaca]</strong><br /><span>' . $_SESSION['ef_cor'] . '</span>';
                    $html .= $_SESSION['ef_mid_cor'] > 0 ? '<br /><div class="cont-multimidia"><a href="javascript:void(0);" onclick="javascript:fntCarregaMidias(\'' . base64_encode($_SESSION['ef_mid_cor']) . '\');">' . Comuns::IMG_MIDIA_MULTIMIDIA . '</a></div>' : '';
                    break;
                case "pul":
                    $html = '<strong>@lng[Ausculta pulmonar]</strong><br /><span>' . $_SESSION['ef_pul'] . '</span>';
                    $html .= $_SESSION['ef_mid_pul'] > 0 ? '<br /><div class="cont-multimidia"><a href="javascript:void(0);" onclick="javascript:fntCarregaMidias(\'' . base64_encode($_SESSION['ef_mid_pul']) . '\');">' . Comuns::IMG_MIDIA_MULTIMIDIA . '</a></div>' : '';
                    break;
                case "abd":
                    $html = '<strong>@lng[Abdomen]</strong><br /><span>' . $_SESSION['ef_abd'] . '</span>';
                    $html .= $_SESSION['ef_mid_abd'] > 0 ? '<br /><div class="cont-multimidia"><a href="javascript:void(0);" onclick="javascript:fntCarregaMidias(\'' . base64_encode($_SESSION['ef_mid_abd']) . '\');">' . Comuns::IMG_MIDIA_MULTIMIDIA . '</a></div>' : '';
                    break;
                case "ext":
                    $html = '<strong>@lng[Extremidades]</strong><br /><span>' . $_SESSION['ef_ext'] . '</span>';
                    $html .= $_SESSION['ef_mid_ext'] > 0 ? '<br /><div class="cont-multimidia"><a href="javascript:void(0);" onclick="javascript:fntCarregaMidias(\'' . base64_encode($_SESSION['ef_mid_ext']) . '\');">' . Comuns::IMG_MIDIA_MULTIMIDIA . '</a></div>' : '';
                    break;
                case "pel":
                    $html = '<strong>@lng[Pele]</strong><br /><span>' . $_SESSION['ef_pel'] . '</span>';
                    $html .= $_SESSION['ef_mid_pel'] > 0 ? '<br /><div class="cont-multimidia"><a href="javascript:void(0);" onclick="javascript:fntCarregaMidias(\'' . base64_encode($_SESSION['ef_mid_pel']) . '\');">' . Comuns::IMG_MIDIA_MULTIMIDIA . '</a></div>' : '';
                    break;
                case "sin":
                    $html = '<strong>@lng[Sinais vitais]</strong><br /><span>' . $_SESSION['ef_sin'] . '</span>';
                    $html .= $_SESSION['ef_mid_sin'] > 0 ? '<br /><div class="cont-multimidia"><a href="javascript:void(0);" onclick="javascript:fntCarregaMidias(\'' . base64_encode($_SESSION['ef_mid_sin']) . '\');">' . Comuns::IMG_MIDIA_MULTIMIDIA . '</a></div>' : '';
                    break;
                case "ger":
                    $html = '<strong>@lng[Estado geral]</strong><br /><span>' . $_SESSION['ef_ger'] . '</span>';
                    $html .= $_SESSION['ef_mid_ger'] > 0 ? '<br /><div class="cont-multimidia"><a href="javascript:void(0);" onclick="javascript:fntCarregaMidias(\'' . base64_encode($_SESSION['ef_mid_ger']) . '\');">' . Comuns::IMG_MIDIA_MULTIMIDIA . '</a></div>' : '';
                    break;
            }
        } catch (Exception $e) {
            $html = "ERRO: " . $e->getMessage();
        }
    } else {
        $html = "ERRO: @lng[Não foi informado o caso clínico]";
    }
    echo Comuns::Idioma($html);
}
コード例 #2
0
ファイル: ajaxcasoparte.php プロジェクト: GoPlaceIn/siacc
function TratarDadosExameFisico($template)
{
    if (isset($_SESSION['caso']) && $_SESSION['caso'] != 0) {
        $ef = new ExameFisico();
        $mid = new Midia();
        $ef->Carrega($_SESSION['caso']);
        $template = str_replace("<!--txtExaFisCabeca-->", $ef->getCabeca(), $template);
        $template = str_replace("<!--txtExaFisPescoco-->", $ef->getPescoco(), $template);
        $template = str_replace("<!--txtExaFisAusPulmonar-->", $ef->getAuscultapulmonar(), $template);
        $template = str_replace("<!--txtExaFisAusCardiaca-->", $ef->getAuscultacardiaca(), $template);
        $template = str_replace("<!--txtExaFisSinVit-->", $ef->getSinaisvitais(), $template);
        $template = str_replace("<!--txtExaFisAbdomen-->", $ef->getAbdomen(), $template);
        $template = str_replace("<!--txtExaFisPele-->", $ef->getPele(), $template);
        $template = str_replace("<!--txtExaFisExtrem-->", $ef->getExtremidades(), $template);
        $template = str_replace("<!--txtExaFisGeral-->", $ef->getEstadoGeral(), $template);
        $template = str_replace("<!--midCabeca-->", $ef->getMidiasCabeca(), $template);
        $template = str_replace("<!--midPescoco-->", $ef->getMidiasPescoco(), $template);
        $template = str_replace("<!--midAusPulmonar-->", $ef->getMidiasAuscultaPulmonar(), $template);
        $template = str_replace("<!--midAusCardiaca-->", $ef->getMidiasAuscultaCardiaca(), $template);
        $template = str_replace("<!--midAbdomen-->", $ef->getMidiasAbdomen(), $template);
        $template = str_replace("<!--midExtrem-->", $ef->getMidiasExtremidades(), $template);
        $template = str_replace("<!--midPele-->", $ef->getMidiasPele(), $template);
        $template = str_replace("<!--midSinVit-->", $ef->getMidiasSinaisVitais(), $template);
        $template = str_replace("<!--midGeral-->", $ef->getMidiasEstadoGeral(), $template);
        $mid->setCodCaso($_SESSION['caso']);
        $lista_midias = $mid->ListaRecordSet();
        if ($lista_midias) {
            $tabmidias = Comuns::TopoTabelaListagem("", "tabMidias", array('&nbsp;', 'Mídia', 'Tipo'));
            foreach ($lista_midias as $midia) {
                $tabmidias .= '<tr>';
                $tabmidias .= '<td><input type="checkbox" name="chkMidia[]" id="chkMidia_' . $midia->CodMidia . '" value="' . $midia->CodMidia . '" class="chkmidias"></td>';
                $tabmidias .= '<td>' . $midia->Descricao . '</td>';
                $tabmidias .= '<td>' . ($midia->CodTipo == 1 ? Comuns::IMG_MIDIA_IMAGEM : ($midia->CodTipo == 2 ? Comuns::IMG_MIDIA_VIDEO : Comuns::IMG_MIDIA_AUDIO)) . '</td>';
                $tabmidias .= '</tr>';
            }
            $tabmidias .= '</body></table>';
            $template = str_replace("<!--midias-->", $tabmidias, $template);
        } else {
            $template = str_replace("<!--midias-->", $mid->getErro(), $template);
        }
    } else {
        $template = str_replace("<!--txtExaFisCabeca-->", "", $template);
        $template = str_replace("<!--txtExaFisPescoco-->", "", $template);
        $template = str_replace("<!--txtExaFisAusPulmonar-->", "", $template);
        $template = str_replace("<!--txtExaFisAusCardiaca-->", "", $template);
        $template = str_replace("<!--txtExaFisSinVit-->", "", $template);
        $template = str_replace("<!--txtExaFisAbdomen-->", "", $template);
        $template = str_replace("<!--txtExaFisPele-->", "", $template);
        $template = str_replace("<!--txtExaFisExtrem-->", "", $template);
        $template = str_replace("<!--txtExaFisGeral-->", "", $template);
        $template = str_replace("<!--midCabeca-->", "0", $template);
        $template = str_replace("<!--midPescoco-->", "0", $template);
        $template = str_replace("<!--midAusPulmonar-->", "0", $template);
        $template = str_replace("<!--midAusCardiaca-->", "0", $template);
        $template = str_replace("<!--midAbdomen-->", "0", $template);
        $template = str_replace("<!--midExtrem-->", "0", $template);
        $template = str_replace("<!--midPele-->", "0", $template);
        $template = str_replace("<!--midSinVit-->", "0", $template);
        $template = str_replace("<!--midGeral-->", "0", $template);
    }
    return $template;
}