function Inicializar()
 {
     $retorno = "Novo";
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     @session_write_close();
     //** Verificacao de permissao para exclusao
     $obj_permissao = new clsPermissoes();
     $obj_permissao->permissao_cadastra(558, $this->pessoa_logada, 7, "educar_tipo_ensino_lst.php");
     //**
     $this->cod_tipo_ensino = $_GET["cod_tipo_ensino"];
     if (is_numeric($this->cod_tipo_ensino)) {
         $obj = new clsPmieducarTipoEnsino($this->cod_tipo_ensino, null, null, null, null, null, 1);
         if (!($registro = $obj->detalhe())) {
             header("Location: educar_tipo_ensino_lst.php");
         }
         if (!$registro["ativo"]) {
             header("Location: educar_tipo_ensino_lst.php");
         }
         if ($registro) {
             foreach ($registro as $campo => $val) {
                 // passa todos os valores obtidos no registro para atributos do objeto
                 $this->{$campo} = $val;
             }
             //** verificao de permissao para exclusao
             $this->fexcluir = $obj_permissao->permissao_excluir(558, $this->pessoa_logada, 7);
             //**
             $retorno = "Editar";
         }
     }
     //		$this->url_cancelar = ($retorno == "Editar") ? "educar_tipo_ensino_det.php?cod_tipo_ensino={$registro["cod_tipo_ensino"]}" : "educar_tipo_ensino_lst.php";
     $this->nome_url_cancelar = "Cancelar";
     $this->script_cancelar = "window.parent.fechaExpansivel(\"div_dinamico_\"+(parent.DOM_divs.length-1));";
     return $retorno;
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Tipo Ensino - Detalhe";
     $this->cod_tipo_ensino = $_GET["cod_tipo_ensino"];
     $tmp_obj = new clsPmieducarTipoEnsino($this->cod_tipo_ensino, null, null, null, null, null, 1);
     if (!($registro = $tmp_obj->detalhe())) {
         header("Location: educar_tipo_ensino_lst.php");
     }
     if (!$registro["ativo"]) {
         header("Location: educar_tipo_ensino_lst.php");
     }
     if ($registro["cod_tipo_ensino"]) {
         $this->addDetalhe(array("Tipo Ensino", "{$registro["cod_tipo_ensino"]}"));
     }
     if ($registro["ref_cod_instituicao"]) {
         if (class_exists("clsPmieducarInstituicao")) {
             $obj_cod_instituicao = new clsPmieducarInstituicao($registro["ref_cod_instituicao"]);
             $obj_cod_instituicao_det = $obj_cod_instituicao->detalhe();
             $registro["ref_cod_instituicao"] = $obj_cod_instituicao_det["nm_instituicao"];
         } else {
             $registro["ref_cod_instituicao"] = "Erro na geração";
             echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarInstituicao\n-->";
         }
         $this->addDetalhe(array("Institui&ccedil;&atilde;o", "{$registro["ref_cod_instituicao"]}"));
     }
     if ($registro["nm_tipo"]) {
         $this->addDetalhe(array("Nome Tipo", "{$registro["nm_tipo"]}"));
     }
     //** Verificacao de permissao para cadastro ou edicao
     $obj_permissao = new clsPermissoes();
     if ($obj_permissao->permissao_cadastra(558, $this->pessoa_logada, 7)) {
         $this->url_novo = "educar_tipo_ensino_cad.php";
         $this->url_editar = "educar_tipo_ensino_cad.php?cod_tipo_ensino={$registro["cod_tipo_ensino"]}";
     }
     //**
     $this->url_cancelar = "educar_tipo_ensino_lst.php";
     $this->largura = "100%";
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "educar_index.php" => "i-Educar - Escola", "" => "Detalhe do tipo de ensino"));
     $this->enviaLocalizacao($localizacao->montar());
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Tipo Ensino - Detalhe";
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
     $this->cod_tipo_ensino = $_GET["cod_tipo_ensino"];
     $tmp_obj = new clsPmieducarTipoEnsino($this->cod_tipo_ensino, null, null, null, null, null, 1);
     if (!($registro = $tmp_obj->detalhe())) {
         header("Location: educar_tipo_ensino_lst.php");
     }
     if (!$registro["ativo"]) {
         header("Location: educar_tipo_ensino_lst.php");
     }
     if ($registro["cod_tipo_ensino"]) {
         $this->addDetalhe(array("Tipo Ensino", "{$registro["cod_tipo_ensino"]}"));
     }
     if ($registro["ref_cod_instituicao"]) {
         if (class_exists("clsPmieducarInstituicao")) {
             $obj_cod_instituicao = new clsPmieducarInstituicao($registro["ref_cod_instituicao"]);
             $obj_cod_instituicao_det = $obj_cod_instituicao->detalhe();
             $registro["ref_cod_instituicao"] = $obj_cod_instituicao_det["nm_instituicao"];
         } else {
             $registro["ref_cod_instituicao"] = "Erro na gera&ccedil;&atilde;o";
             echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarInstituicao\n-->";
         }
         $this->addDetalhe(array("Institui&ccedil;&atilde;o", "{$registro["ref_cod_instituicao"]}"));
     }
     if ($registro["nm_tipo"]) {
         $this->addDetalhe(array("Nome Tipo", "{$registro["nm_tipo"]}"));
     }
     //** Verificacao de permissao para cadastro ou edicao
     $obj_permissao = new clsPermissoes();
     if ($obj_permissao->permissao_cadastra(558, $this->pessoa_logada, 7)) {
         $this->url_novo = "educar_tipo_ensino_cad.php";
         $this->url_editar = "educar_tipo_ensino_cad.php?cod_tipo_ensino={$registro["cod_tipo_ensino"]}";
     }
     //**
     $this->url_cancelar = "educar_tipo_ensino_lst.php";
     $this->largura = "100%";
 }
 function Inicializar()
 {
     $retorno = "Novo";
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     @session_write_close();
     //** Verificacao de permissao para exclusao
     $obj_permissao = new clsPermissoes();
     $obj_permissao->permissao_cadastra(558, $this->pessoa_logada, 7, "educar_tipo_ensino_lst.php");
     //**
     $this->cod_tipo_ensino = $_GET["cod_tipo_ensino"];
     if (is_numeric($this->cod_tipo_ensino)) {
         $obj = new clsPmieducarTipoEnsino($this->cod_tipo_ensino, null, null, null, null, null, 1);
         if (!($registro = $obj->detalhe())) {
             header("Location: educar_tipo_ensino_lst.php");
         }
         if (!$registro["ativo"]) {
             header("Location: educar_tipo_ensino_lst.php");
         }
         if ($registro) {
             foreach ($registro as $campo => $val) {
                 // passa todos os valores obtidos no registro para atributos do objeto
                 $this->{$campo} = $val;
             }
             //** verificao de permissao para exclusao
             $this->fexcluir = $obj_permissao->permissao_excluir(558, $this->pessoa_logada, 7);
             //**
             $retorno = "Editar";
         }
     }
     $this->url_cancelar = $retorno == "Editar" ? "educar_tipo_ensino_det.php?cod_tipo_ensino={$registro["cod_tipo_ensino"]}" : "educar_tipo_ensino_lst.php";
     $nomeMenu = $retorno == "Editar" ? $retorno : "Cadastrar";
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "educar_index.php" => "i-Educar - Escola", "" => "{$nomeMenu} tipo de ensino"));
     $this->enviaLocalizacao($localizacao->montar());
     $this->nome_url_cancelar = "Cancelar";
     return $retorno;
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = 'Curso - Listagem';
     // passa todos os valores obtidos no GET para atributos do objeto
     foreach ($_GET as $var => $val) {
         $this->{$var} = $val === '' ? NULL : $val;
     }
     $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet');
     $lista_busca = array('Curso', 'N&iacute;vel Ensino', 'Tipo Ensino');
     $obj_permissoes = new clsPermissoes();
     $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada);
     if ($nivel_usuario == 1) {
         $lista_busca[] = 'Institui&ccedil;&atilde;o';
     }
     $this->addCabecalhos($lista_busca);
     include 'include/pmieducar/educar_campo_lista.php';
     // outros Filtros
     $this->campoTexto('nm_curso', 'Curso', $this->nm_curso, 30, 255, FALSE);
     // outros de Foreign Keys
     $opcoes = array('' => 'Selecione');
     $todos_niveis_ensino = "nivel_ensino = new Array();\n";
     $objTemp = new clsPmieducarNivelEnsino();
     $lista = $objTemp->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             $todos_niveis_ensino .= "nivel_ensino[nivel_ensino.length] = new Array({$registro["cod_nivel_ensino"]},'{$registro["nm_nivel"]}', {$registro["ref_cod_instituicao"]});\n";
         }
     }
     echo "<script>{$todos_niveis_ensino}</script>";
     if ($this->ref_cod_instituicao) {
         $objTemp = new clsPmieducarNivelEnsino();
         $lista = $objTemp->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao);
         if (is_array($lista) && count($lista)) {
             foreach ($lista as $registro) {
                 $opcoes[$registro['cod_nivel_ensino']] = $registro['nm_nivel'];
             }
         }
     }
     $this->campoLista('ref_cod_nivel_ensino', 'N&iacute;vel Ensino', $opcoes, $this->ref_cod_nivel_ensino, NULL, NULL, NULL, NULL, NULL, FALSE);
     $opcoes = array('' => 'Selecione');
     $todos_tipos_ensino = "tipo_ensino = new Array();\n";
     $objTemp = new clsPmieducarTipoEnsino();
     $objTemp->setOrderby('nm_tipo');
     $lista = $objTemp->lista(NULL, NULL, NULL, NULL, NULL, NULL, 1);
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             $todos_tipos_ensino .= "tipo_ensino[tipo_ensino.length] = new Array({$registro["cod_tipo_ensino"]},'{$registro["nm_tipo"]}', {$registro["ref_cod_instituicao"]});\n";
         }
     }
     echo "<script>{$todos_tipos_ensino}</script>";
     if ($this->ref_cod_instituicao) {
         $objTemp = new clsPmieducarTipoEnsino();
         $objTemp->setOrderby("nm_tipo");
         $lista = $objTemp->lista(NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao);
         if (is_array($lista) && count($lista)) {
             foreach ($lista as $registro) {
                 $opcoes["{$registro['cod_tipo_ensino']}"] = $registro['nm_tipo'];
             }
         }
     }
     $this->campoLista('ref_cod_tipo_ensino', 'Tipo Ensino', $opcoes, $this->ref_cod_tipo_ensino, '', FALSE, '', '', '', FALSE);
     // Paginador
     $this->limite = 20;
     $this->offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->limite - $this->limite : 0;
     $obj_curso = new clsPmieducarCurso();
     $obj_curso->setOrderby('nm_curso ASC');
     $obj_curso->setLimite($this->limite, $this->offset);
     $lista = $obj_curso->lista(NULL, NULL, NULL, $this->ref_cod_nivel_ensino, $this->ref_cod_tipo_ensino, NULL, $this->nm_curso, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, $this->ref_cod_instituicao);
     $total = $obj_curso->_total;
     // monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             $obj_ref_cod_nivel_ensino = new clsPmieducarNivelEnsino($registro['ref_cod_nivel_ensino']);
             $det_ref_cod_nivel_ensino = $obj_ref_cod_nivel_ensino->detalhe();
             $registro['ref_cod_nivel_ensino'] = $det_ref_cod_nivel_ensino['nm_nivel'];
             $obj_ref_cod_tipo_ensino = new clsPmieducarTipoEnsino($registro['ref_cod_tipo_ensino']);
             $det_ref_cod_tipo_ensino = $obj_ref_cod_tipo_ensino->detalhe();
             $registro['ref_cod_tipo_ensino'] = $det_ref_cod_tipo_ensino['nm_tipo'];
             $obj_cod_instituicao = new clsPmieducarInstituicao($registro['ref_cod_instituicao']);
             $obj_cod_instituicao_det = $obj_cod_instituicao->detalhe();
             $registro['ref_cod_instituicao'] = $obj_cod_instituicao_det['nm_instituicao'];
             $lista_busca = array("<a href=\"educar_curso_det.php?cod_curso={$registro["cod_curso"]}\">{$registro["nm_curso"]}</a>", "<a href=\"educar_curso_det.php?cod_curso={$registro["cod_curso"]}\">{$registro["ref_cod_nivel_ensino"]}</a>", "<a href=\"educar_curso_det.php?cod_curso={$registro["cod_curso"]}\">{$registro["ref_cod_tipo_ensino"]}</a>");
             if ($nivel_usuario == 1) {
                 $lista_busca[] = "<a href=\"educar_curso_det.php?cod_curso={$registro["cod_curso"]}\">{$registro["ref_cod_instituicao"]}</a>";
             }
             $this->addLinhas($lista_busca);
         }
     }
     $this->addPaginador2("educar_curso_lst.php", $total, $_GET, $this->nome, $this->limite);
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(566, $this->pessoa_logada, 3)) {
         $this->acao = "go(\"educar_curso_cad.php\")";
         $this->nome_acao = "Novo";
     }
     $this->largura = "100%";
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "educar_index.php" => "i-Educar - Escola", "" => "Listagem de cursos"));
     $this->enviaLocalizacao($localizacao->montar());
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "Curso - Detalhe";
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
     $this->cod_curso = $_GET["cod_curso"];
     $tmp_obj = new clsPmieducarCurso($this->cod_curso);
     $registro = $tmp_obj->detalhe();
     if (!$registro) {
         header("location: educar_curso_lst.php");
         die;
     }
     if (class_exists("clsPmieducarInstituicao")) {
         $obj_ref_cod_instituicao = new clsPmieducarInstituicao($registro["ref_cod_instituicao"]);
         $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
         $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
     } else {
         $registro["ref_cod_instituicao"] = "Erro na geracao";
         echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->";
     }
     if (class_exists("clsPmieducarTipoRegime")) {
         $obj_ref_cod_tipo_regime = new clsPmieducarTipoRegime($registro["ref_cod_tipo_regime"]);
         $det_ref_cod_tipo_regime = $obj_ref_cod_tipo_regime->detalhe();
         $registro["ref_cod_tipo_regime"] = $det_ref_cod_tipo_regime["nm_tipo"];
     } else {
         $registro["ref_cod_tipo_regime"] = "Erro na geracao";
         echo "<!--\nErro\nClasse nao existente: clsPmieducarTipoRegime\n-->";
     }
     if (class_exists("clsPmieducarTipoEnsino")) {
         $obj_ref_cod_tipo_ensino = new clsPmieducarTipoEnsino($registro["ref_cod_tipo_ensino"]);
         $det_ref_cod_tipo_ensino = $obj_ref_cod_tipo_ensino->detalhe();
         $registro["ref_cod_tipo_ensino"] = $det_ref_cod_tipo_ensino["nm_tipo"];
     } else {
         $registro["ref_cod_tipo_ensino"] = "Erro na geracao";
         echo "<!--\nErro\nClasse nao existente: clsPmieducarTipoEnsino\n-->";
     }
     if (class_exists("clsPmieducarTipoAvaliacao")) {
         $obj_ref_cod_tipo_avaliacao = new clsPmieducarTipoAvaliacao($registro["ref_cod_tipo_avaliacao"]);
         $det_ref_cod_tipo_avaliacao = $obj_ref_cod_tipo_avaliacao->detalhe();
         $registro["ref_cod_tipo_avaliacao"] = $det_ref_cod_tipo_avaliacao["nm_tipo"];
     } else {
         $registro["ref_cod_tipo_avaliacao"] = "Erro na geracao";
         echo "<!--\nErro\nClasse nao existente: clsPmieducarTipoAvaliacao\n-->";
     }
     if (class_exists("clsPmieducarNivelEnsino")) {
         $obj_ref_cod_nivel_ensino = new clsPmieducarNivelEnsino($registro["ref_cod_nivel_ensino"]);
         $det_ref_cod_nivel_ensino = $obj_ref_cod_nivel_ensino->detalhe();
         $registro["ref_cod_nivel_ensino"] = $det_ref_cod_nivel_ensino["nm_nivel"];
     } else {
         $registro["ref_cod_nivel_ensino"] = "Erro na geracao";
         echo "<!--\nErro\nClasse nao existente: clsPmieducarNivelEnsino\n-->";
     }
     if (class_exists("clsPmieducarUsuario")) {
         $obj_ref_usuario_cad = new clsPmieducarUsuario($registro["ref_usuario_cad"]);
         $det_ref_usuario_cad = $obj_ref_usuario_cad->detalhe();
         $registro["ref_usuario_cad"] = $det_ref_usuario_cad["data_cadastro"];
     } else {
         $registro["ref_usuario_cad"] = "Erro na geracao";
         echo "<!--\nErro\nClasse nao existente: clsPmieducarUsuario\n-->";
     }
     if (class_exists("clsPmieducarUsuario")) {
         $obj_ref_usuario_exc = new clsPmieducarUsuario($registro["ref_usuario_exc"]);
         $det_ref_usuario_exc = $obj_ref_usuario_exc->detalhe();
         $registro["ref_usuario_exc"] = $det_ref_usuario_exc["data_cadastro"];
     } else {
         $registro["ref_usuario_exc"] = "Erro na geracao";
         echo "<!--\nErro\nClasse nao existente: clsPmieducarUsuario\n-->";
     }
     if ($registro["ref_cod_nivel_ensino"]) {
         $this->addDetalhe(array("Nivel Ensino", "{$registro["ref_cod_nivel_ensino"]}"));
     }
     if ($registro["ref_cod_tipo_ensino"]) {
         $this->addDetalhe(array("Tipo Ensino", "{$registro["ref_cod_tipo_ensino"]}"));
     }
     if ($registro["ref_cod_tipo_avaliacao"]) {
         $this->addDetalhe(array("Tipo Avaliac&atilde;o", "{$registro["ref_cod_tipo_avaliacao"]}"));
     }
     if ($registro["nm_curso"]) {
         $this->addDetalhe(array("Nome Curso", "{$registro["nm_curso"]}"));
     }
     if ($registro["sgl_curso"]) {
         $this->addDetalhe(array("Sgl Curso", "{$registro["sgl_curso"]}"));
     }
     if ($registro["qtd_etapas"]) {
         $this->addDetalhe(array("Qtd Etapas", "{$registro["qtd_etapas"]}"));
     }
     if ($registro["frequencia_minima"]) {
         $this->addDetalhe(array("Frequencia Minima", number_format($registro["frequencia_minima"], 2, ",", ".")));
     }
     if ($registro["media"]) {
         $this->addDetalhe(array("Media", number_format($registro["media"], 2, ",", ".")));
     }
     if ($registro["falta_ch_globalizada"]) {
         $this->addDetalhe(array("Falta Ch Globalizada", $registro["falta_ch_globalizada"] == 1 ? "sim" : "n&atilde;o"));
     }
     if ($registro["carga_horaria"]) {
         $this->addDetalhe(array("Carga Horaria", number_format($registro["carga_horaria"], 2, ",", ".")));
     }
     if ($registro["ato_poder_publico"]) {
         $this->addDetalhe(array("Ato Poder Publico", "{$registro["ato_poder_publico"]}"));
     }
     if ($registro["edicao_final"]) {
         $this->addDetalhe(array("Edic&atilde;o Final", $registro["edicao_final"] == 1 ? "sim" : "n&atilde;o"));
     }
     if ($registro["objetivo_curso"]) {
         $this->addDetalhe(array("Objetivo Curso", "{$registro["objetivo_curso"]}"));
     }
     if ($registro["publico_alvo"]) {
         $this->addDetalhe(array("Publico Alvo", "{$registro["publico_alvo"]}"));
     }
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(0, $this->pessoa_logada, 0)) {
         $this->url_novo = "educar_curso_cad.php";
         $this->url_editar = "educar_curso_cad.php?cod_curso={$registro["cod_curso"]}";
     }
     $this->url_cancelar = "educar_curso_lst.php";
     $this->largura = "100%";
 }
 function Gerar()
 {
     @session_start();
     $this->__pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->__titulo = "Curso - Listagem";
     foreach ($_GET as $var => $val) {
         // passa todos os valores obtidos no GET para atributos do objeto
         $this->{$var} = $val === "" ? null : $val;
     }
     $this->addCabecalhos(array("Curso", "Nivel Ensino", "Tipo Ensino", "Instituic&atilde;o"));
     $this->campoTexto("nm_curso", "Curso", $this->nm_curso, 30, 255, false);
     $opcoes = array("" => "Selecione");
     if (class_exists("clsPmieducarNivelEnsino")) {
         $objTemp = new clsPmieducarNivelEnsino();
         $lista = $objTemp->lista();
         if (is_array($lista) && count($lista)) {
             foreach ($lista as $registro) {
                 $opcoes["{$registro['cod_nivel_ensino']}"] = "{$registro['nm_nivel']}";
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsPmieducarNivelEnsino nao encontrada\n-->";
         $opcoes = array("" => "Erro na geracao");
     }
     $this->campoLista("ref_cod_nivel_ensino", "Nivel Ensino", $opcoes, $this->ref_cod_nivel_ensino);
     $opcoes = array("" => "Selecione");
     if (class_exists("clsPmieducarTipoEnsino")) {
         $objTemp = new clsPmieducarTipoEnsino();
         $lista = $objTemp->lista();
         if (is_array($lista) && count($lista)) {
             foreach ($lista as $registro) {
                 $opcoes["{$registro['cod_tipo_ensino']}"] = "{$registro['nm_ensino']}";
             }
         }
     } else {
         echo "<!--\nErro\nClasse clsPmieducarTipoAvaliacao nao encontrada\n-->";
         $opcoes = array("" => "Erro na geracao");
     }
     $this->campoLista("ref_cod_tipo_ensino", "Tipo Ensino", $opcoes, $this->ref_cod_tipo_ensino);
     // Paginador
     $this->__limite = 20;
     $this->__offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->__limite - $this->__limite : 0;
     $obj_curso = new clsPmieducarCurso();
     $obj_curso->setOrderby("nm_curso ASC");
     $obj_curso->setLimite($this->__limite, $this->__offset);
     $lista = $obj_curso->lista(null, null, $this->ref_cod_nivel_ensino, $this->ref_cod_tipo_ensino, null, $this->nm_curso, null, null, null, null, null, null, null, null, null, null, null, null, null, 1, null, null, null, null);
     $total = $obj_curso->_total;
     // monta a lista
     if (is_array($lista) && count($lista)) {
         foreach ($lista as $registro) {
             // muda os campos data
             $registro["data_cadastro_time"] = strtotime(substr($registro["data_cadastro"], 0, 16));
             $registro["data_cadastro_br"] = date("d/m/Y H:i", $registro["data_cadastro_time"]);
             $registro["data_exclusao_time"] = strtotime(substr($registro["data_exclusao"], 0, 16));
             $registro["data_exclusao_br"] = date("d/m/Y H:i", $registro["data_exclusao_time"]);
             if (class_exists("clsPmieducarNivelEnsino")) {
                 $obj_ref_cod_nivel_ensino = new clsPmieducarNivelEnsino($registro["ref_cod_nivel_ensino"]);
                 $det_ref_cod_nivel_ensino = $obj_ref_cod_nivel_ensino->detalhe();
                 $registro["ref_cod_nivel_ensino"] = $det_ref_cod_nivel_ensino["nm_nivel"];
             } else {
                 $registro["ref_cod_nivel_ensino"] = "Erro na geracao";
                 echo "<!--\nErro\nClasse nao existente: clsPmieducarNivelEnsino\n-->";
             }
             if (class_exists("clsPmieducarTipoEnsino")) {
                 $obj_ref_cod_tipo_ensino = new clsPmieducarTipoEnsino($registro["ref_cod_tipo_ensino"]);
                 $det_ref_cod_tipo_ensino = $obj_ref_cod_tipo_ensino->detalhe();
                 $registro["ref_cod_tipo_ensino"] = $det_ref_cod_tipo_ensino["nm_tipo"];
             } else {
                 $registro["ref_cod_tipo_ensino"] = "Erro na geracao";
                 echo "<!--\nErro\nClasse nao existente: clsPmieducarTipoEnsino\n-->";
             }
             if (class_exists("clsPmieducarInstituicao")) {
                 $obj_ref_cod_instituicao = new clsPmieducarInstituicao($registro["ref_cod_instituicao"]);
                 $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
                 $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
             } else {
                 $registro["ref_cod_instituicao"] = "Erro na geracao";
                 echo "<!--\nErro\nClasse nao existente: clsPmieducarInstuicao\n-->";
             }
             $this->addLinhas(array("<a href=\"educar_curso_det.php?cod_curso={$registro["cod_curso"]}\">{$registro["nm_curso"]}</a>", "<a href=\"educar_curso_det.php?cod_curso={$registro["cod_curso"]}\">{$registro["ref_cod_nivel_ensino"]}</a>", "<a href=\"educar_curso_det.php?cod_curso={$registro["cod_curso"]}\">{$registro["ref_cod_tipo_ensino"]}</a>", "<a href=\"educar_curso_det.php?cod_curso={$registro["cod_curso"]}\">{$registro["ref_cod_instituicao"]}</a>"));
         }
     }
     $this->addPaginador2("educar_curso_lst.php", $total, $_GET, $this->nome, $this->__limite);
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(0, $this->pessoa_logada, 0)) {
         $this->acao = "go(\"educar_curso_cad.php\")";
         $this->nome_acao = "Novo";
     }
     $this->largura = "100%";
 }
Example #8
0
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = 'Curso - Detalhe';
     $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet');
     $this->cod_curso = $_GET['cod_curso'];
     $tmp_obj = new clsPmieducarCurso($this->cod_curso);
     $registro = $tmp_obj->detalhe();
     if (!$registro) {
         header('Location: educar_curso_lst.php');
         die;
     }
     $obj_instituicao = new clsPmieducarInstituicao($registro['ref_cod_instituicao']);
     $obj_instituicao_det = $obj_instituicao->detalhe();
     $registro['ref_cod_instituicao'] = $obj_instituicao_det['nm_instituicao'];
     $obj_ref_cod_tipo_regime = new clsPmieducarTipoRegime($registro['ref_cod_tipo_regime']);
     $det_ref_cod_tipo_regime = $obj_ref_cod_tipo_regime->detalhe();
     $registro['ref_cod_tipo_regime'] = $det_ref_cod_tipo_regime['nm_tipo'];
     $obj_ref_cod_nivel_ensino = new clsPmieducarNivelEnsino($registro['ref_cod_nivel_ensino']);
     $det_ref_cod_nivel_ensino = $obj_ref_cod_nivel_ensino->detalhe();
     $registro['ref_cod_nivel_ensino'] = $det_ref_cod_nivel_ensino['nm_nivel'];
     $obj_ref_cod_tipo_ensino = new clsPmieducarTipoEnsino($registro['ref_cod_tipo_ensino']);
     $det_ref_cod_tipo_ensino = $obj_ref_cod_tipo_ensino->detalhe();
     $registro['ref_cod_tipo_ensino'] = $det_ref_cod_tipo_ensino['nm_tipo'];
     $obj_permissoes = new clsPermissoes();
     $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada);
     if ($nivel_usuario == 1) {
         if ($registro['ref_cod_instituicao']) {
             $this->addDetalhe(array('Institui&ccedil;&atilde;o', $registro['ref_cod_instituicao']));
         }
     }
     if ($registro['ref_cod_tipo_regime']) {
         $this->addDetalhe(array('Tipo Regime', $registro['ref_cod_tipo_regime']));
     }
     if ($registro['ref_cod_nivel_ensino']) {
         $this->addDetalhe(array('N&iacute;vel Ensino', $registro['ref_cod_nivel_ensino']));
     }
     if ($registro['ref_cod_tipo_ensino']) {
         $this->addDetalhe(array('Tipo Ensino', $registro['ref_cod_tipo_ensino']));
     }
     if ($registro['nm_curso']) {
         $this->addDetalhe(array('Curso', $registro['nm_curso']));
     }
     if ($registro['sgl_curso']) {
         $this->addDetalhe(array('Sigla Curso', $registro['sgl_curso']));
     }
     if ($registro['qtd_etapas']) {
         $this->addDetalhe(array('Quantidade Etapas', $registro['qtd_etapas']));
     }
     if ($registro['hora_falta']) {
         $registro['hora_falta'] = number_format($registro['hora_falta'], 2, ',', '.');
         $this->addDetalhe(array('Hora/Falta', $registro['hora_falta']));
     }
     if ($registro['carga_horaria']) {
         $registro['carga_horaria'] = number_format($registro['carga_horaria'], 2, ',', '.');
         $this->addDetalhe(array('Carga Hor&aacute;ria', $registro['carga_horaria']));
     }
     if ($registro['ato_poder_publico']) {
         $this->addDetalhe(array('Ato Poder P&uacute;blico', $registro['ato_poder_publico']));
     }
     $obj = new clsPmieducarHabilitacaoCurso(NULL, $this->cod_curso);
     $lst = $obj->lista(NULL, $this->cod_curso);
     if ($lst) {
         $tabela = '<TABLE>
              <TR align=center>
                  <TD bgcolor=#A1B3BD><B>Nome</B></TD>
              </TR>';
         $cont = 0;
         foreach ($lst as $valor) {
             if ($cont % 2 == 0) {
                 $color = ' bgcolor=#E4E9ED ';
             } else {
                 $color = ' bgcolor=#FFFFFF ';
             }
             $obj = new clsPmieducarHabilitacao($valor['ref_cod_habilitacao']);
             $obj_habilitacao = $obj->detalhe();
             $habilitacao = $obj_habilitacao['nm_tipo'];
             $tabela .= "<TR>\n                  <TD {$color} align=left>{$habilitacao}</TD>\n              </TR>";
             $cont++;
         }
         $tabela .= '</TABLE>';
     }
     if ($habilitacao) {
         $this->addDetalhe(array('Habilita&ccedil;&atilde;o', $tabela));
     }
     if ($registro['padrao_ano_escolar']) {
         if ($registro['padrao_ano_escolar'] == 0) {
             $registro['padrao_ano_escolar'] = 'n&atilde;o';
         } else {
             if ($registro['padrao_ano_escolar'] == 1) {
                 $registro['padrao_ano_escolar'] = 'sim';
             }
         }
         $this->addDetalhe(array('Padr&atilde;o Ano Escolar', $registro['padrao_ano_escolar']));
     }
     if ($registro['objetivo_curso']) {
         $this->addDetalhe(array('Objetivo Curso', $registro['objetivo_curso']));
     }
     if ($registro['publico_alvo']) {
         $this->addDetalhe(array('P&uacute;blico Alvo', $registro['publico_alvo']));
     }
     if ($obj_permissoes->permissao_cadastra(566, $this->pessoa_logada, 3)) {
         $this->url_novo = 'educar_curso_cad.php';
         $this->url_editar = "educar_curso_cad.php?cod_curso={$registro["cod_curso"]}";
     }
     $this->url_cancelar = 'educar_curso_lst.php';
     $this->largura = '100%';
 }