コード例 #1
0
ファイル: ajaxcasoparte.php プロジェクト: GoPlaceIn/siacc
function TrataDadosBasicos($template)
{
    header('Content-Type: text/html; charset=iso-8859-1');
    if (isset($_SESSION['caso']) && $_SESSION['caso'] != 0) {
        $c = new Caso();
        $c->setCodigo($_SESSION['caso']);
        $c->CarregarCaso();
        $selAreas = AreaConhecimento::MontaSelect($c->getArea()->getCodigo());
        $selNiveis = NivelPergunta::MontaSelect($c->getNivelDificuldade()->getCodigo());
        $template = str_replace("<!--txtnome-->", $c->getNome(), $template);
        $template = str_replace("<!--txtdescricao-->", $c->getDescricao(), $template);
        $template = str_replace("<!--opcoesarea-->", $selAreas, $template);
        $template = str_replace("<!--opcoesnivel-->", $selNiveis, $template);
        $template = str_replace("<!--opcoesativo-->", SimNao::SelectSimNao($c->getAtivo()), $template);
        $template = str_replace("<!--txtidade-->", $c->getIdadePac(), $template);
        $template = str_replace("<!--opcoessexo-->", Sexo::SelectSexo($c->getSexoPac()), $template);
        $template = str_replace("<!--txtidpaciente-->", $c->getIdPac(), $template);
        $template = str_replace("<!--opcoesetnia-->", Etnia::SelectEtnia($c->getEtnia()), $template);
        $template = str_replace("<!--txtNomePac-->", $c->getNomePaciente(), $template);
        $template = str_replace("<!--opcoesimagem-->", ImgPaciente::SelectImagem($c->getImagemPaciente()), $template);
        $template = str_replace("<!--txtcid10-->", $c->getCid10(), $template);
        $template = str_replace("<!--chkPublico-->", $c->getPublico() == "1" ? "checked=\"checked\"" : "", $template);
        $template = str_replace("<!--chkExigeLogin-->", $c->getExigeLogin() == "0" ? "checked=\"checked\"" : "", $template);
    } else {
        $template = str_replace("<!--txtnome-->", "", $template);
        $template = str_replace("<!--txtdescricao-->", "", $template);
        $template = str_replace("<!--opcoesarea-->", AreaConhecimento::MontaSelect(), $template);
        $template = str_replace("<!--opcoesnivel-->", NivelPergunta::MontaSelect(), $template);
        $template = str_replace("<!--opcoesativo-->", SimNao::SelectSimNao(), $template);
        $template = str_replace("<!--txtidade-->", "", $template);
        $template = str_replace("<!--opcoessexo-->", Sexo::SelectSexo(), $template);
        $template = str_replace("<!--txtidpaciente-->", "", $template);
        $template = str_replace("<!--opcoesetnia-->", Etnia::SelectEtnia(), $template);
        $template = str_replace("<!--txtNomePac-->", "", $template);
        $template = str_replace("<!--opcoesimagem-->", ImgPaciente::SelectImagem(), $template);
        $template = str_replace("<!--txtcid10-->", "", $template);
        $template = str_replace("<!--chkPublico-->", "", $template);
        $template = str_replace("<!--chkExigeLogin-->", "", $template);
    }
    return $template;
}