function Inicializar()
 {
     $retorno = "Novo";
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     @session_write_close();
     $this->cod_nivel_ensino = $_GET["cod_nivel_ensino"];
     $obj_permissoes = new clsPermissoes();
     $obj_permissoes->permissao_cadastra(571, $this->pessoa_logada, 3, "educar_nivel_ensino_lst.php");
     if (is_numeric($this->cod_nivel_ensino)) {
         $obj = new clsPmieducarNivelEnsino($this->cod_nivel_ensino);
         $registro = $obj->detalhe();
         if ($registro) {
             foreach ($registro as $campo => $val) {
                 // passa todos os valores obtidos no registro para atributos do objeto
                 $this->{$campo} = $val;
             }
             $this->fexcluir = $obj_permissoes->permissao_excluir(571, $this->pessoa_logada, 3);
             $retorno = "Editar";
         }
     }
     //		$this->url_cancelar = ($retorno == "Editar") ? "educar_nivel_ensino_det.php?cod_nivel_ensino={$registro["cod_nivel_ensino"]}" : "educar_nivel_ensino_lst.php";
     $this->nome_url_cancelar = "Cancelar";
     $this->script_cancelar = "window.parent.fechaExpansivel(\"div_dinamico_\"+(parent.DOM_divs.length-1));";
     return $retorno;
 }
 function Inicializar()
 {
     $retorno = "Novo";
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     @session_write_close();
     $this->cod_nivel_ensino = $_GET["cod_nivel_ensino"];
     $obj_permissoes = new clsPermissoes();
     $obj_permissoes->permissao_cadastra(571, $this->pessoa_logada, 3, "educar_nivel_ensino_lst.php");
     if (is_numeric($this->cod_nivel_ensino)) {
         $obj = new clsPmieducarNivelEnsino($this->cod_nivel_ensino);
         $registro = $obj->detalhe();
         if ($registro) {
             foreach ($registro as $campo => $val) {
                 // passa todos os valores obtidos no registro para atributos do objeto
                 $this->{$campo} = $val;
             }
             $this->fexcluir = $obj_permissoes->permissao_excluir(571, $this->pessoa_logada, 3);
             $retorno = "Editar";
         }
     }
     $this->url_cancelar = $retorno == "Editar" ? "educar_nivel_ensino_det.php?cod_nivel_ensino={$registro["cod_nivel_ensino"]}" : "educar_nivel_ensino_lst.php";
     $nomeMenu = $retorno == "Editar" ? $retorno : "Cadastrar";
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_index.php" => "i-Educar - Escola", "" => "{$nomeMenu} nível 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 = "Nível Ensino - Detalhe";
     $this->cod_nivel_ensino = $_GET["cod_nivel_ensino"];
     $tmp_obj = new clsPmieducarNivelEnsino($this->cod_nivel_ensino);
     $registro = $tmp_obj->detalhe();
     if (!$registro) {
         header("location: educar_nivel_ensino_lst.php");
         die;
     }
     if (class_exists("clsPmieducarInstituicao")) {
         $obj_instituicao = new clsPmieducarInstituicao($registro["ref_cod_instituicao"]);
         $obj_instituicao_det = $obj_instituicao->detalhe();
         $registro["ref_cod_instituicao"] = $obj_instituicao_det["nm_instituicao"];
     } else {
         $registro["ref_cod_instituicao"] = "Erro na geração";
         echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarInstituicao\n-->";
     }
     $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["nm_nivel"]) {
         $this->addDetalhe(array("N&iacute;vel Ensino", "{$registro["nm_nivel"]}"));
     }
     if ($registro["descricao"]) {
         $this->addDetalhe(array("Descri&ccedil;&atilde;o", "{$registro["descricao"]}"));
     }
     if ($obj_permissoes->permissao_cadastra(571, $this->pessoa_logada, 3)) {
         $this->url_novo = "educar_nivel_ensino_cad.php";
         $this->url_editar = "educar_nivel_ensino_cad.php?cod_nivel_ensino={$registro["cod_nivel_ensino"]}";
     }
     $this->url_cancelar = "educar_nivel_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 n&iacute;vel de ensino"));
     $this->enviaLocalizacao($localizacao->montar());
 }
 function Gerar()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = "N&iacute;vel Ensino - Detalhe";
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
     $this->cod_nivel_ensino = $_GET["cod_nivel_ensino"];
     $tmp_obj = new clsPmieducarNivelEnsino($this->cod_nivel_ensino);
     $registro = $tmp_obj->detalhe();
     if (!$registro) {
         header("location: educar_nivel_ensino_lst.php");
         die;
     }
     if (class_exists("clsPmieducarInstituicao")) {
         $obj_instituicao = new clsPmieducarInstituicao($registro["ref_cod_instituicao"]);
         $obj_instituicao_det = $obj_instituicao->detalhe();
         $registro["ref_cod_instituicao"] = $obj_instituicao_det["nm_instituicao"];
     } else {
         $registro["ref_cod_instituicao"] = "Erro na gera&ccedil;&atilde;o";
         echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarInstituicao\n-->";
     }
     $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["nm_nivel"]) {
         $this->addDetalhe(array("N&iacute;vel Ensino", "{$registro["nm_nivel"]}"));
     }
     if ($registro["descricao"]) {
         $this->addDetalhe(array("Descri&ccedil;&atilde;o", "{$registro["descricao"]}"));
     }
     if ($obj_permissoes->permissao_cadastra(571, $this->pessoa_logada, 3)) {
         $this->url_novo = "educar_nivel_ensino_cad.php";
         $this->url_editar = "educar_nivel_ensino_cad.php?cod_nivel_ensino={$registro["cod_nivel_ensino"]}";
     }
     $this->url_cancelar = "educar_nivel_ensino_lst.php";
     $this->largura = "100%";
 }
Пример #5
0
 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());
 }
Пример #6
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;
     }
     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%";
 }
Пример #7
0
 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%";
 }
 function renderHTML()
 {
     $ok = false;
     if (is_numeric($_GET['cod_matricula'])) {
         $this->ref_cod_matricula = $_GET['cod_matricula'];
         $obj_mat = new clsPmieducarMatricula($this->ref_cod_matricula);
         $det_matricula = $obj_mat->detalhe();
         $this->nm_aluno = $det_matricula['nome_upper'];
         if ($det_matricula['aprovado'] == 4) {
             $ok = true;
         }
         $obj_transferencia = new clsPmieducarTransferenciaSolicitacao();
         $lst_transferencia = $obj_transferencia->lista(null, null, null, null, null, $this->ref_cod_matricula, null, null, null, null, null, 1, null, null, $det_matricula['ref_cod_aluno'], false);
         // verifica se existe uma solicitacao de transferencia INTERNA
         if (is_array($lst_transferencia)) {
             $ok = true;
         }
     }
     if (!$ok) {
         echo "<script>alert('Não é possível gerar atestado de freqüência para esta matrícula');window.location='educar_index.php';</script>";
         die('Não é possível gerar atestado de freqüência para esta matrícula');
     }
     $obj_curso = new clsPmieducarCurso($det_matricula['ref_cod_curso']);
     $det_curso = $obj_curso->detalhe();
     $obj_serie = new clsPmieducarSerie($det_matricula['ref_ref_cod_serie']);
     $det_serie = $obj_serie->detalhe();
     $this->nm_serie = $det_serie['nm_serie'];
     $obj_instituicao = new clsPmieducarInstituicao($det_curso['ref_cod_instituicao']);
     $det_instituicao = $obj_instituicao->detalhe();
     $this->nm_instituicao = $det_instituicao['nm_instituicao'];
     $obj_escola = new clsPmieducarEscola($det_matricula['ref_ref_cod_escola']);
     $det_escola = $obj_escola->detalhe();
     $this->nm_escola = $det_escola['nome'];
     $this->ref_cod_escola = $det_escola['cod_escola'];
     $obj_nivel_ensino = new clsPmieducarNivelEnsino($det_curso['ref_cod_nivel_ensino']);
     $det_nivel_ensino = $obj_nivel_ensino->detalhe();
     $this->nm_ensino = $det_nivel_ensino['nm_nivel'];
     $fonte = 'arial';
     $corTexto = '#000000';
     $this->pdf = new clsPDF("Atestado de Frequência - {$this->ano}", "Atestado de Frequência", "A4", "", false, false);
     $this->pdf->OpenPage();
     $obj_escola_complemento = new clsPmieducarEscolaComplemento($this->ref_cod_escola);
     $det_escola_complemento = $obj_escola_complemento->detalhe();
     if ($det_escola_complemento) {
         // NOME DA ESCOLA
         $nm_escola = str2upper($det_escola_complemento['nm_escola']);
         // ENDERECO DA ESCOLA
         $logradouro = str2upper($det_escola_complemento['logradouro']);
         $numero = $det_escola_complemento['numero'];
         $complemento = str2upper($det_escola_complemento['complemento']);
         $bairro = str2upper($det_escola_complemento['bairro']);
         $municipio = str2upper($det_escola_complemento['municipio']);
         $cep = $det_escola_complemento['cep'];
         $cep = int2CEP($cep);
         $this->endereco = "{$logradouro} {$complemento},{$numero} CEP {$cep} {$municipio}";
     } else {
         $obj_escola = new clsPmieducarEscola($this->ref_cod_escola);
         $det_escola = $obj_escola->detalhe();
         $obj_juridica = new clsJuridica($det_escola['ref_idpes']);
         $det_juridica = $obj_juridica->detalhe();
         $nm_escola = $det_juridica['fantasia'];
         if (!$nm_escola) {
             if ($det_escola['ref_idpes']) {
                 $obj_pessoa_ = new clsPessoa_($det_escola['ref_idpes']);
                 $det_pessoa_ = $obj_pessoa_->detalhe();
                 $nm_escola = $det_pessoa_['nome'];
             }
         }
         $this->nm_escola = $nm_escola;
         $obj_endereco = new clsPessoaEndereco($det_escola["ref_idpes"]);
         if ($det_escola["ref_idpes"]) {
             $tipo = 1;
             $endereco_lst = $obj_endereco->lista($det_escola["ref_idpes"]);
             if ($endereco_lst) {
                 foreach ($endereco_lst as $endereco) {
                     $cep = $endereco["cep"]->cep;
                     $idlog = $endereco["idlog"]->idlog;
                     $obj = new clsLogradouro($idlog);
                     $obj_det = $obj->detalhe();
                     $logradouro = $obj_det["nome"];
                     $idtlog = $obj_det["idtlog"]->detalhe();
                     $tipo_logradouro = strtoupper($idtlog["descricao"]);
                     $bairro = $idbai = $endereco["idbai"]->detalhe();
                     $idbai = $idbai['nome'];
                     $numero = $endereco["numero"];
                     $complemento = $endereco["complemento"];
                     $andar = $endereco["andar"];
                 }
                 $obj_log = new clsLogradouro($idlog);
                 $obj_log_det = $obj_log->detalhe();
                 if ($obj_log_det) {
                     $logradouro = str2upper($obj_log_det["nome"]);
                     $obj_mun = new clsMunicipio($obj_log_det["idmun"]);
                     $det_mun = $obj_mun->detalhe();
                     if ($det_mun) {
                         $municipio = str2upper($det_mun["nome"]);
                     }
                     $estado = $det_mun['sigla_uf']->sigla_uf;
                 }
                 $cep = int2CEP($cep);
                 $this->endereco = "{$tipo_logradouro} {$logradouro} {$complemento},{$numero} CEP {$cep} {$municipio} {$estado}";
             } else {
                 if (class_exists("clsEnderecoExterno")) {
                     $tipo = 2;
                     $obj_endereco = new clsEnderecoExterno();
                     $endereco_lst = $obj_endereco->lista(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, $det_escola["ref_idpes"]);
                     if ($endereco_lst) {
                         foreach ($endereco_lst as $endereco) {
                             $cep = $endereco["cep"];
                             $estado = $endereco["sigla_uf"]->sigla_uf;
                             $sigla_uf = $endereco["sigla_uf"]->detalhe();
                             $sigla_uf = $sigla_uf["nome"];
                             $cidade = $endereco["cidade"];
                             $idtlog = $endereco["idtlog"]->detalhe();
                             $tipo_logradouro = $idtlog["descricao"];
                             $logradouro = $endereco["logradouro"];
                             $bairro = $endereco["bairro"];
                             $numero = $endereco["numero"];
                             $complemento = $endereco["complemento"];
                             $andar = $endereco["andar"];
                             $municipio = str2upper($endereco['cidade']);
                             $bairro = str2upper($endereco_lst['bairro']);
                         }
                     }
                     $cep = int2CEP($cep);
                     $this->endereco = "{$tipo_logradouro} {$logradouro} {$complemento},{$numero}{$bairro} CEP {$cep} {$municipio} - {$sigla_uf}";
                 }
             }
         }
     }
     $this->addCabecalho();
     //titulo
     $this->pdf->escreve_relativo("Atestado de Freqüência", 30, 220, 535, 80, $fonte, 16, $corTexto, 'center');
     $texto = "Atesto para os devidos fins que o aluno {$this->nm_aluno}, código de aluno nº {$det_matricula['ref_cod_aluno']}, matriculado regularmente no {$this->nm_ensino}, frequentou a {$this->nm_serie} até a presente data.";
     $this->pdf->escreve_relativo($texto, 30, 350, 535, 80, $fonte, 14, $corTexto, 'justify');
     $mes = date('n');
     $mes = strtolower($this->meses_do_ano["{$mes}"]);
     $data = date('d') . " de {$mes} de " . date('Y');
     $this->pdf->escreve_relativo("Brasilia, {$data}", 30, 600, 535, 80, $fonte, 14, $corTexto, 'center');
     $this->rodape();
     $this->pdf->CloseFile();
     $this->get_link = $this->pdf->GetLink();
     //echo "<script>window.location='$this->get_link';</script>";
     //header("location:download.php?filename=".$this->get_link);
     //echo "location:download.php?filename=".$this->get_link;die;
     echo "<script>window.onload=function(){parent.EscondeDiv('LoadImprimir');window.location='download.php?filename=" . $this->get_link . "'}</script>";
     echo "<center><a target='blank' href='" . $this->get_link . "' style='font-size: 16px; color: #000000; text-decoration: underline;'>Clique aqui para visualizar o arquivo!</a><br><br>\n\t\t\t<span style='font-size: 10px;'>Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br>\n\n\t\t\tClique na Imagem para Baixar o instalador<br><br>\n\t\t\t<a href=\"http://www.adobe.com.br/products/acrobat/readstep2.html\" target=\"new\"><br><img src=\"imagens/acrobat.gif\" width=\"88\" height=\"31\" border=\"0\"></a>\n\t\t\t</span>\n\t\t\t</center>";
 }
Пример #9
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%';
 }