function fntRetornaHipoteses() { if (isset($_SESSION['caso']) && $_SESSION['caso'] > 0) { $hipoteses = new Hipoteses(); $lista = $hipoteses->ListaRecordSet($_SESSION['caso']); if ($lista != false && count($lista) > 0) { $html = Comuns::TopoTabelaListagem("", "tabHipoteses", array(' ', 'Hipótese diagnóstica', 'Correto')); foreach ($lista as $hip) { $html .= '<tr>'; $html .= '<td><input type="checkbox" id="chk_hip_' . $hip->CodHipotese . '" class="item_arvore"></td>'; $html .= '<td><span id="spn_hip_' . $hip->CodHipotese . '">' . $hip->Descricao . '</span></td>'; $html .= '<td>' . SimNao::Descreve($hip->Correto) . '</td>'; $html .= '</tr>'; } $html .= "</tbody></table>"; return $html; } else { return "@lng[Nenhuma hipótese diagnóstica cadastrada]"; } } else { return "@lng[Caso não encontrado]"; } }
private function BuscaConteudoHipoteses($prefixo, $chave, $tipocaso) { $hash = new HashTable(); $hip = new Hipoteses(); $sql = "select GrupoHipotese, Texto "; $sql .= "from mescasohipotdiagnperguntaguia "; $sql .= "where CodCaso = :pCodCaso and chave = :pChave;"; $cnn = Conexao2::getInstance(); $cmd = $cnn->prepare($sql); $cmd->bindParam(":pCodCaso", $this->codigo, PDO::PARAM_INT); $cmd->bindParam(":pChave", $chave, PDO::PARAM_STR); $cmd->execute(); $rs = $cmd->fetch(PDO::FETCH_OBJ); $pergunta = $rs->Texto; $grupohip = $rs->GrupoHipotese; //$hip->CarregaPerguntaNorteadora($this->codigo, $chave); $hipoteses = $hip->ListaRecordSet($this->codigo, $grupohip); if (count($hipoteses) > 0) { $conteudo .= '<div class="item-cont">' . $pergunta . "</div>"; $cont = 0; $conteudo .= '<div class="options">'; foreach ($hipoteses as $reg) { $cont++; $conteudo .= '<div class="item-option"><label for="chkRespHip_' . $cont . '"><input type="checkbox" name="chkRespHip[]" id="chkRespHip_' . $cont . '" value="' . base64_encode($reg->CodHipotese) . '" onclick="javascript:fntMarcaDesmarca(\'chkRespHip_' . $cont . '\');" class="opcao-resposta" /> ' . $reg->Descricao . '</label></div>'; } $conteudo .= '</div>'; $conteudo .= '<div class="organizador"></div>'; } else { $conteudo = "Erro"; } $comandos = $this->MontaAcoesVisualizacaoCaso($prefixo, $tipocaso, $chave); $hash->AddItem("titulosecao", "@lng[Hipóteses diagnósticas]"); $hash->AddItem("conteudo", $conteudo); $hash->AddItem("menu", $comandos); $hash->AddItem("Obrigatorio", true); return $hash; }