function Gerar() { $obj_permissoes = new clsPermissoes(); $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); $this->campoOculto("serie_origem_old", $this->ref_serie_origem); $this->campoOculto("serie_destino_old", $this->ref_serie_destino); // foreign keys if ($nivel_usuario == 1) { // echo "<pre>"; print_r($GLOBALS); die(); $GLOBALS["nivel_usuario_fora"] = 1; $objInstituicao = new clsPmieducarInstituicao(); $opcoes = array("" => "Selecione"); $objInstituicao->setOrderby("nm_instituicao ASC"); $lista = $objInstituicao->lista(); if (is_array($lista)) { foreach ($lista as $linha) { $opcoes[$linha["cod_instituicao"]] = $linha["nm_instituicao"]; } } $this->campoLista("ref_cod_instituicao", "Instituição", $opcoes, $this->ref_cod_instituicao); } else { $obj_usuario = new clsPmieducarUsuario($this->pessoa_logada); $obj_usuario_det = $obj_usuario->detalhe(); $this->ref_cod_instituicao = $obj_usuario_det["ref_cod_instituicao"]; } $opcoes = array("" => "Selecione"); $opcoes_ = array("" => "Selecione"); if (class_exists("clsPmieducarCurso")) { /*$todos_cursos = "curso = new Array();\n"; $objTemp = new clsPmieducarCurso(); $objTemp->setOrderby("nm_curso"); $lista = $objTemp->lista( null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1 ); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todos_cursos .= "curso[curso.length] = new Array({$registro["cod_curso"]},'{$registro["nm_curso"]}', {$registro["ref_cod_instituicao"]});\n"; } } echo "<script>{$todos_cursos}</script>";*/ // EDITAR if ($this->ref_cod_instituicao) { $objTemp = new clsPmieducarCurso(); $objTemp->setOrderby("nm_curso"); $lista = $objTemp->lista(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1, null, $this->ref_cod_instituicao); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes[$registro["cod_curso"]] = $registro["nm_curso"]; $opcoes_[$registro["cod_curso"]] = $registro["nm_curso"]; } } } } else { echo "<!--\nErro\nClasse clsPmieducarCurso não encontrada\n-->"; $opcoes = array("" => "Erro na geração"); } $this->campoLista("ref_curso_origem", "Curso Origem", $opcoes, $this->ref_curso_origem, "", true); $this->campoLista("ref_curso_destino", " Curso Destino", $opcoes_, $this->ref_curso_destino); // primary keys $opcoes = array("" => "Selecione"); $opcoes_ = array("" => "Selecione"); if (class_exists("clsPmieducarSerie")) { /*$todas_series = "serie = new Array();\n"; $objTemp = new clsPmieducarSerie(); $objTemp->setOrderby( "nm_serie ASC" ); $lista = $objTemp->lista( null,null,null,null,null,null,null,null,null,null,null,null,1 ); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todas_series .= "serie[serie.length] = new Array({$registro["cod_serie"]},'{$registro["nm_serie"]}', {$registro["ref_cod_curso"]});\n"; } } echo "<script>{$todas_series}</script>";*/ if ($this->ref_curso_origem) { $objTemp = new clsPmieducarSerie(); $objTemp->setOrderby("nm_serie ASC"); $lista = $objTemp->lista(null, null, null, $this->ref_curso_origem, null, null, null, null, null, null, null, null, 1); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes[$registro["cod_serie"]] = $registro["nm_serie"]; } } } if ($this->ref_curso_destino) { $objTemp = new clsPmieducarSerie(); $objTemp->setOrderby("nm_serie ASC"); $lista = $objTemp->lista(null, null, null, $this->ref_curso_destino, null, null, null, null, null, null, null, null, 1); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes_[$registro["cod_serie"]] = $registro["nm_serie"]; } } } } else { echo "<!--\nErro\nClasse clsPmieducarSerie não encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); $opcoes_ = array("" => "Erro na geracao"); } $this->campoLista("ref_serie_origem", "Série Origem", $opcoes, $this->ref_serie_origem, null, true); $this->campoLista("ref_serie_destino", " Série Destino", $opcoes_, $this->ref_serie_destino); $this->campoOculto("nivel_usuario", $nivel_usuario); }
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ível Ensino', 'Tipo Ensino'); $obj_permissoes = new clsPermissoes(); $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); if ($nivel_usuario == 1) { $lista_busca[] = 'Instituiçã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í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ício", "educar_index.php" => "i-Educar - Escola", "" => "Listagem de cursos")); $this->enviaLocalizacao($localizacao->montar()); }
if ($get_curso) { $opcoes_curso = array("" => "Selecione"); // EDITAR if ($this->ref_cod_escola) { $obj_escola_curso = new clsPmieducarEscolaCurso(); $lst_escola_curso = $obj_escola_curso->lista($this->ref_cod_escola, null, null, null, null, null, null, null, 1); if (is_array($lst_escola_curso) && count($lst_escola_curso)) { foreach ($lst_escola_curso as $escola_curso) { $opcoes_curso["{$escola_curso["ref_cod_curso"]}"] = $escola_curso['nm_curso']; } } } else { if ($this->ref_cod_instituicao) { $opcoes_curso = array("" => "Selecione"); $obj_curso = new clsPmieducarCurso(); $obj_curso->setOrderby("nm_curso ASC"); if ($sem_padrao) { $lista = $obj_curso->lista(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1, null, $this->ref_cod_instituicao, 0); } else { $lista = $obj_curso->lista(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1, null, $this->ref_cod_instituicao); } if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes_curso["{$registro['cod_curso']}"] = "{$registro['nm_curso']}"; } } } } $this->campoLista("ref_cod_curso", "Curso", $opcoes_curso, $this->ref_cod_curso, null, null, null, null, $curso_desabilitado, $curso_obrigatorio); if ($get_semestre) { $this->campoRotulo("semestres", "Semestre", "<div id='div_semestre'>Selecione um Curso</div>");
function Gerar() { $obj_permissoes = new clsPermissoes(); // echo "<pre>";print_r($_POST);die; if (!$this->sem_cnpj && !$this->com_cnpj) { $parametros = new clsParametrosPesquisas(); $parametros->setSubmit(1); $parametros->setPessoa('J'); $parametros->setPessoaCampo('sem_cnpj'); $parametros->setPessoaNovo("S"); $parametros->setPessoaCPF("N"); $parametros->setPessoaTela('window'); $this->campoOculto("sem_cnpj", ""); $parametros->setCodSistema(13); $parametros->adicionaCampoTexto("cnpj", "cnpj"); $this->campoCnpjPesq("cnpj", "CNPJ", $this->cnpj, "pesquisa_pessoa_lst.php", $parametros->serializaCampos(), true); // $this->acao_enviar = "obj = document.getElementById(\"cnpj\");if(obj.value != \"\" ) {document.getElementById(\"formcadastro\").submit(); } else { acao(); }"; $this->acao_enviar = false; $this->url_cancelar = false; $this->array_botao = array("Continuar", "Cancelar"); $this->array_botao_url_script = array("obj = document.getElementById('cnpj');if(obj.value != '' ) { acao(); } else { acao(); }", "go('educar_escola_lst.php');"); } else { if ($_POST) { foreach ($_POST as $campo => $val) { if ($campo != 'tipoacao' && $campo != 'sem_cnpj') { $this->{$campo} = $this->{$campo} ? $this->{$campo} : $val; } } } if ($this->sem_cnpj) { $this->campoOculto("sem_cnpj", $this->sem_cnpj); // cadastro novo sem CNPJ $this->p_ddd_telefone_1 = $this->p_ddd_telefone_1 == null ? "" : $this->p_ddd_telefone_1; $this->p_ddd_telefone_fax = $this->p_ddd_telefone_fax == null ? "" : $this->p_ddd_telefone_fax; if ($this->ref_idpes) { $objTemp = new clsPessoaJuridica($this->ref_idpes); $detalhe = $objTemp->detalhe(); } // $this->campoOculto( "passo", 4 ); // $this->campoOculto( "sem_cnpj", 0 ); $this->campoOculto("cod_escola", $this->cod_escola); // text $this->campoTexto("fantasia", "Escola", $this->fantasia, 30, 255, true); $this->campoTexto("sigla", "Sigla", $this->sigla, 30, 255, true); // foreign keys $nivel = $obj_permissoes->nivel_acesso($this->pessoa_logada); if ($nivel == 1) { $cabecalhos[] = "Instituicao"; $objInstituicao = new clsPmieducarInstituicao(); $opcoes = array("" => "Selecione"); $objInstituicao->setOrderby("nm_instituicao ASC"); $lista = $objInstituicao->lista(); if (is_array($lista)) { foreach ($lista as $linha) { $opcoes[$linha["cod_instituicao"]] = $linha["nm_instituicao"]; } } $this->campoLista("ref_cod_instituicao", "Instituição", $opcoes, $this->ref_cod_instituicao); } else { $this->ref_cod_instituicao = $obj_permissoes->getInstituicao($this->pessoa_logada); if ($this->ref_cod_instituicao) { $this->campoOculto("ref_cod_instituicao", $this->ref_cod_instituicao); } else { die("Usu�rio n�o � do nivel poli-institucional e n�o possui uma institui��o"); } } $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarEscolaRedeEnsino")) { /*$todas_redes_ensino = "rede_ensino = new Array();\n"; $objTemp = new clsPmieducarEscolaRedeEnsino(); $lista = $objTemp->lista(); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todas_redes_ensino .= "rede_ensino[rede_ensino.length] = new Array( {$registro["cod_escola_rede_ensino"]}, '{$registro['nm_rede']}', {$registro["ref_cod_instituicao"]} );\n"; } } echo "<script>{$todas_redes_ensino}</script>";*/ // EDITAR $script = "javascript:showExpansivelIframe(520, 120, 'educar_escola_rede_ensino_cad_pop.php');"; if ($this->ref_cod_instituicao) { $objTemp = new clsPmieducarEscolaRedeEnsino(); $lista = $objTemp->lista(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_escola_rede_ensino']}"] = "{$registro['nm_rede']}"; } } $script = "<img id='img_rede_ensino' style='display: \\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } else { $script = "<img id='img_rede_ensino' style='display: none;' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } } else { echo "<!--\nErro\nClasse clsPmieducarEscolaRedeEnsino nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_escola_rede_ensino", "Rede Ensino", $opcoes, $this->ref_cod_escola_rede_ensino, "", false, "", $script); $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarEscolaLocalizacao")) { /*$todas_escolas_localizacao = "escola_localizacao = new Array();\n"; $objTemp = new clsPmieducarEscolaLocalizacao(); $lista = $objTemp->lista(); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todas_escolas_localizacao .= "escola_localizacao[escola_localizacao.length] = new Array( {$registro["cod_escola_localizacao"]}, '{$registro['nm_localizacao']}', {$registro["ref_cod_instituicao"]} );\n"; } } echo "<script>{$todas_escolas_localizacao}</script>";*/ // EDITAR $script = "javascript:showExpansivelIframe(520, 120, 'educar_escola_localizacao_cad_pop.php');"; if ($this->ref_cod_instituicao) { $objTemp = new clsPmieducarEscolaLocalizacao(); $lista = $objTemp->lista(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_escola_localizacao']}"] = "{$registro['nm_localizacao']}"; } } $script = "<img id='img_localizacao' style='display: \\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } else { $script = "<img id='img_localizacao' style='display: none;' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } } else { echo "<!--\nErro\nClasse clsPmieducarEscolaLocalizacao nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_escola_localizacao", "Escola Localização", $opcoes, $this->ref_cod_escola_localizacao, "", false, "", $script); if (is_numeric($this->cep)) { $this->cep = int2CEP($this->cep); } // $this->campoCep( "cep","CEP", $this->cep,true,"-",false,false ); $this->campoCep("cep", "CEP", $this->cep, true, "-", false, false); $this->campoTexto("cidade", "Cidade", $this->cidade, "50", "255", true); $this->campoTexto("bairro", "Bairro", $this->bairro, "50", "20", true); $this->campoTexto("logradouro", "Logradouro", $this->logradouro, "50", "255", true); $this->campoTexto("complemento", "Complemento", $this->complemento, "22", "20", false); $this->campoNumero("numero", "Número", $this->numero, "6", "6", true); $this->campoTexto("p_ddd_telefone_1", "DDD Telefone 1", $this->p_ddd_telefone_1, "2", "2", false); $this->campoTexto("p_telefone_1", "Telefone 1", $this->p_telefone_1, "10", "15", false); $this->campoTexto("p_ddd_telefone_fax", "DDD Fax", $this->p_ddd_telefone_fax, "2", "2", false); $this->campoTexto("p_telefone_fax", "Fax", $this->p_telefone_fax, "10", "15", false); $this->campoTexto("p_email", "E-mail", $this->p_email, "50", "255", false); } if ($this->com_cnpj) { $this->campoOculto("com_cnpj", $this->com_cnpj); // die("com CNPJ"); // echo "<br>cep: ".$this->cep; // echo "<br>cep_: ".$this->cep_; if (!$this->cod_escola) { $this->cnpj = urldecode($_POST['cnpj']); $this->cnpj = idFederal2int($this->cnpj); // echo int2IdFederal($this->cnpj); $this->cnpj = int2IdFederal($this->cnpj); } // echo "sakdmk: ".$this->cnpj;die; // cadastro novo com CNPJ //echo "hehehe".idFederal2int($this->cnpj);echo "kiki".int2IdFederal($this->cnpj);die; $objJuridica = new clsPessoaJuridica(false, idFederal2int($this->cnpj)); $det = $objJuridica->detalhe(); $this->ref_idpes = $det["idpes"]; // if( $this->ref_idpes ) // { // $this->p_ddd_telefone_1 = ( $this->p_ddd_telefone_1 == null ) ? "": is_numeric( $this->p_ddd_telefone_1 ); // $this->p_ddd_telefone_2 = ( $this->p_ddd_telefone_2 == null ) ? "": is_numeric( $this->p_ddd_telefone_2 ); // $this->p_ddd_telefone_3 = ( $this->p_ddd_telefone_3 == null ) ? "": is_numeric( $this->p_ddd_telefone_3 ); // $obj_pessoa = new clsPessoa_( $this->ref_idpes ); // $det_pessoa = $obj_pessoa->detalhe(); //$this->fantasia = $det_pessoa["nome"]; // $this->nm_escola = $det["nome"]; if (!$this->fantasia) { $this->fantasia = $det["fantasia"]; } if ($this->passou) { $this->cnpj = is_numeric($this->cnpj) ? $this->cnpj : idFederal2int($this->cnpj); $this->cnpj = int2IdFederal($this->cnpj); } // $this->campoRotulo("cnpj_", "CNPJ", $this->cnpj); $this->campoOculto("cnpj", idFederal2int($this->cnpj)); $this->campoOculto("ref_idpes", $this->ref_idpes); // $this->campoOculto( "passo", 3 ); $this->campoOculto("cod_escola", $this->cod_escola); // text $this->campoTexto("fantasia", "Escola", $this->fantasia, 30, 255, true); $this->campoTexto("sigla", "Sigla", $this->sigla, 30, 255, true); // foreign keys $nivel = $obj_permissoes->nivel_acesso($this->pessoa_logada); if ($nivel == 1) { $cabecalhos[] = "Instituicao"; $objInstituicao = new clsPmieducarInstituicao(); $opcoes = array("" => "Selecione"); $objInstituicao->setOrderby("nm_instituicao ASC"); $lista = $objInstituicao->lista(); if (is_array($lista)) { foreach ($lista as $linha) { $opcoes[$linha["cod_instituicao"]] = $linha["nm_instituicao"]; } } $this->campoLista("ref_cod_instituicao", "Instituicao", $opcoes, $this->ref_cod_instituicao); } else { $this->ref_cod_instituicao = $obj_permissoes->getInstituicao($this->pessoa_logada); if ($this->ref_cod_instituicao) { $this->campoOculto("ref_cod_instituicao", $this->ref_cod_instituicao); } else { die("Usu�rio n�o � do nivel poli-institucional e n�o possui uma institui��o"); } } $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarEscolaRedeEnsino")) { /*$todas_redes_ensino = "rede_ensino = new Array();\n"; $objTemp = new clsPmieducarEscolaRedeEnsino(); $lista = $objTemp->lista( null,null,null,null,null,null,null,null,1 ); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todas_redes_ensino .= "rede_ensino[rede_ensino.length] = new Array( {$registro["cod_escola_rede_ensino"]}, '{$registro['nm_rede']}', {$registro["ref_cod_instituicao"]} );\n"; } } echo "<script>{$todas_redes_ensino}</script>";*/ // EDITAR $script = "javascript:showExpansivelIframe(520, 120, 'educar_escola_rede_ensino_cad_pop.php');"; if ($this->ref_cod_instituicao) { $objTemp = new clsPmieducarEscolaRedeEnsino(); $lista = $objTemp->lista(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_escola_rede_ensino']}"] = "{$registro['nm_rede']}"; } } $script = "<img id='img_rede_ensino' style='display:\\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } else { $script = "<img id='img_rede_ensino' style='display: none;' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } } else { echo "<!--\nErro\nClasse clsPmieducarEscolaRedeEnsino nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_escola_rede_ensino", "Rede Ensino", $opcoes, $this->ref_cod_escola_rede_ensino, "", false, "", $script); $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarEscolaLocalizacao")) { /*$todas_escolas_localizacao = "escola_localizacao = new Array();\n"; $objTemp = new clsPmieducarEscolaLocalizacao(); $lista = $objTemp->lista( null,null,null,null,null,null,null,null,1 ); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todas_escolas_localizacao .= "escola_localizacao[escola_localizacao.length] = new Array( {$registro["cod_escola_localizacao"]}, '{$registro['nm_localizacao']}', {$registro["ref_cod_instituicao"]} );\n"; } } echo "<script>{$todas_escolas_localizacao}</script>";*/ // EDITAR $script = "javascript:showExpansivelIframe(520, 120, 'educar_escola_localizacao_cad_pop.php');"; if ($this->ref_cod_instituicao) { $objTemp = new clsPmieducarEscolaLocalizacao(); $lista = $objTemp->lista(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_escola_localizacao']}"] = "{$registro['nm_localizacao']}"; } } $script = "<img id='img_localizacao' style='display:\\'\\'' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } else { $script = "<img id='img_localizacao' style='display: none;' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"{$script}\">"; } } else { echo "<!--\nErro\nClasse clsPmieducarEscolaLocalizacao nao encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); } $this->campoLista("ref_cod_escola_localizacao", "Escola Localização", $opcoes, $this->ref_cod_escola_localizacao, "", false, "", $script); // Detalhes do Endereco $objUf = new clsUf(); $listauf = $objUf->lista(); $listaEstado = array("" => "Selecione"); if ($listauf) { foreach ($listauf as $uf) { $listaEstado[$uf['sigla_uf']] = $uf['sigla_uf']; } } $objTipoLog = new clsTipoLogradouro(); $listaTipoLog = $objTipoLog->lista(); $listaTLog = array("" => "Selecione"); if ($listaTipoLog) { foreach ($listaTipoLog as $tipoLog) { $listaTLog[urldecode($tipoLog['idtlog'])] = $tipoLog['descricao']; } } $this->campoOculto("isEnderecoExterno", $this->isEnderecoExterno); // echo "$this->cep ,$this->sigla_uf "; $this->campoOculto("cep_", $this->cep_); $this->campoOculto("sigla_uf_", $this->sigla_uf_); $this->campoOculto("cidade_", $this->cidade_); $this->campoOculto("bairro_", $this->bairro_); $this->campoOculto("idbai", $this->idbai); $this->campoOculto("logradouro_", $this->logradouro_); $this->campoOculto("idlog", $this->idlog); $this->campoOculto("idtlog_", $this->idtlog_); $disabled = $this->isEnderecoExterno ? false : true; if ($this->idlog && $this->idbai && $this->cep && $this->ref_idpes) { $this->campoOculto("cep_", $this->cep); $this->cep_ = int2CEP($this->cep); //$this->campoLista( "ref_cod_escola_localizacao", "Escola Localizacão", $opcoes, $this->ref_cod_escola_localizacao ); // $this->campoCep("cep_","CEP", int2CEP($this->cep),true,"-"," <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f('pesquisa_cep3.php', 'enderecos')\" style=\"cursor: hand;\">",true); // $this->campoCep( "cep_", "CEP", int2CEP( $this->cep ), true, "-", " <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f( 'pesquisa_cep_lst.php', 'enderecos' )\" style=\"cursor: hand;\">", false ); //$this->campoCep( "cep", "CEP", int2CEP( $this->cep ), true, "-", " <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_popless('pesquisa_cep_lst.php', 'enderecos')\" style=\"cursor: hand;\">", true ); $this->campoCep("cep", "CEP", $this->cep_, true, "-", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'educar_pesquisa_cep_log_bairro.php?campo1=bairro&campo2=idbai&campo3=cep_&campo4=logradouro&campo5=idlog&campo6=sigla_uf_&campo7=cidade&campo8=idtlog_&campo9=isEnderecoExterno&campo10=cep&campo11=sigla_uf&campo12=idtlog&campo13=cidade_\\'></iframe>');\">", $disabled); $this->campoLista("sigla_uf", "Estado", $listaEstado, $this->sigla_uf, false, false, false, false, true, true); $this->campoTexto("cidade", "Cidade", $this->cidade, "50", "255", true, false, false, "", "", "", "onKeyUp", true); $this->campoTexto("bairro", "Bairro", $this->bairro, "50", "255", true, false, false, "", "", "", "onKeyUp", true); $this->campoLista("idtlog", "Tipo Logradouro", $listaTLog, $this->idtlog, false, false, false, false, true, true); $this->campoTexto("logradouro", "Logradouro", $this->logradouro, "50", "255", true, false, false, "", "", "", "onKeyUp", true); $this->campoTexto("complemento", "Complemento", $this->complemento, "22", "20", false, false); $this->campoNumero("numero", "Número", $this->numero, "6", "6", false); $this->campoNumero("andar", "Andar", $this->andar, "2", "2", false); } elseif ($this->ref_idpes && $this->cep) { $this->cep = is_numeric($this->cep) ? int2CEP($this->cep) : $this->cep; // $this->campoCep("cep_","CEP", int2CEP($this->cep),true,"-"," <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f('pesquisa_cep3.php', 'enderecos')\" style=\"cursor: hand;\">",false); // $this->campoCep( "cep_", "CEP", int2CEP( $this->cep ), true, "-", " <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f( 'pesquisa_cep_lst.php', 'enderecos' )\" style=\"cursor: hand;\">", false ); //$this->campoCep( "cep", "CEP", int2CEP( $this->cep ), true, "-", " <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_popless('pesquisa_cep_lst.php', 'enderecos')\" style=\"cursor: hand;\">", false ); $this->campoCep("cep", "CEP", $this->cep, true, "-", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'educar_pesquisa_cep_log_bairro.php?campo1=bairro&campo2=idbai&campo3=cep_&campo4=logradouro&campo5=idlog&campo6=sigla_uf_&campo7=cidade&campo8=idtlog_&campo9=isEnderecoExterno&campo10=cep&campo11=sigla_uf&campo12=idtlog&campo13=cidade_\\'></iframe>');\">"); $this->campoLista("sigla_uf", "Estado", $listaEstado, $this->sigla_uf, "", false, "", "", false, true); $this->campoTexto("cidade", "Cidade", $this->cidade, "50", "255", true, false, false, "", "", "", "onKeyUp", false); $this->campoTexto("bairro", "Bairro", $this->bairro, "50", "255", true, false, false, "", "", "", "onKeyUp", false); $this->campoLista("idtlog", "Tipo Logradouro", $listaTLog, $this->idtlog, "", false, "", "", false, true); $this->campoTexto("logradouro", "Logradouro", $this->logradouro, "50", "255", true, false, false, "", "", "", "onKeyUp", false); $this->campoTexto("complemento", "Complemento", $this->complemento, "22", "20", false, false, false, "", "", "", "onKeyUp", false); $this->campoNumero("numero", "Número", $this->numero, 6, 6, false, "", ""); $this->campoNumero("andar", "Andar", $this->andar, "2", "2", false); } else { if (!$this->isEnderecoExterno) { $obj_bairro = new clsBairro($this->idbai); $this->cep_ = int2CEP($this->cep_); $obj_bairro_det = $obj_bairro->detalhe(); if ($obj_bairro_det) { $this->bairro = $obj_bairro_det["nome"]; } $obj_log = new clsLogradouro($this->idlog); $obj_log_det = $obj_log->detalhe(); if ($obj_log_det) { $this->logradouro = $obj_log_det["nome"]; $this->idtlog = $obj_log_det["idtlog"]->idtlog; $obj_mun = new clsMunicipio($obj_log_det["idmun"]); $det_mun = $obj_mun->detalhe(); if ($det_mun) { $this->cidade = strtoupper(ucfirst(strtolower($det_mun["nome"]))); } $this->sigla_uf = $this->sigla_uf_ = $det_mun['sigla_uf']->sigla_uf; } } else { $this->cep_ = $this->cep; } /*$obj_bairro = new clsBairro($obj_endereco_det["ref_idbai"]); $obj_bairro_det = $obj_bairro->detalhe(); if($obj_bairro_det){ $this->bairro = $obj_bairro_det["nome"]; }*/ // $this->campoCep("cep_","CEP", int2CEP($this->cep),true,"-"," <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f('pesquisa_cep3.php', 'enderecos')\" style=\"cursor: hand;\">",true); // $this->campoCep( "cep_", "CEP", int2CEP( $this->cep ), true, "-", " <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_f( 'pesquisa_cep_lst.php', 'enderecos' )\" style=\"cursor: hand;\">", false ); // $this->campoCep( "cep_", "CEP", int2CEP( $this->cep ), true, "-", " <img src=\"imagens/lupa.png\" border=\"0\" onclick=\"pesquisa_valores_popless('pesquisa_cep_lst.php', 'enderecos')\" style=\"cursor: hand;\">", false ); $this->campoCep("cep", "CEP", $this->cep_, true, "-", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\\'miolo\\' id=\\'miolo\\' frameborder=\\'0\\' height=\\'100%\\' width=\\'500\\' marginheight=\\'0\\' marginwidth=\\'0\\' src=\\'educar_pesquisa_cep_log_bairro.php?campo1=bairro&campo2=idbai&campo3=cep_&campo4=logradouro&campo5=idlog&campo6=sigla_uf_&campo7=cidade&campo8=idtlog_&campo9=isEnderecoExterno&campo10=cep&campo11=sigla_uf&campo12=idtlog&campo13=cidade_\\'></iframe>');\">", $disabled); // $this->campoCep("cep_", "CEP", $this->cep_, true, "-", "<img id='lupa' src=\"imagens/lupa.png\" border=\"0\" onclick=\"showExpansivel( 500,500, '<iframe name=\'miolo\' id=\'miolo\' frameborder=\'0\' height=\'100%\' width=\'500\' marginheight=\'0\' marginwidth=\'0\' src=\'educar_pesquisa_cep_log_bairro.php?campo1=nm_bairro&campo2=id_bairro&campo3=id_cep&campo4=nm_logradouro&campo5=id_logradouro&campo6=ref_sigla_uf&campo7=cidade&campo8=ref_idtlog_&campo9=isEnderecoExterno&campo10=cep_&campo11=ref_sigla_uf_&campo12=ref_idtlog&campo13=id_cidade\'></iframe>');\">", $disabled); $this->campoLista("sigla_uf", "Estado", $listaEstado, $this->sigla_uf, false, false, false, false, $disabled, true); $this->campoTexto("cidade", "Cidade", $this->cidade, "50", "255", true, false, false, "", "", "", "", $disabled, true); $this->campoTexto("bairro", "Bairro", $this->bairro, "50", "20", true, false, false, "", "", "", "", $disabled, true); $this->campoLista("idtlog", "Tipo Logradouro", $listaTLog, $this->idtlog, false, false, false, false, $disabled, true); $this->campoTexto("logradouro", "Logradouro", $this->logradouro, "50", "255", true, false, false, "", "", "", "", $disabled, true); $this->campoTexto("complemento", "Complemento", $this->complemento, "22", "20", false, false, false); $this->campoNumero("numero", "Número", $this->numero, "6", "6", false); $this->campoNumero("andar", "Andar", $this->andar, "2", "2", false); } $this->campoNumero("p_ddd_telefone_1", "DDD Telefone 1", $this->p_ddd_telefone_1, 2, 2, false); $this->campoNumero("p_telefone_1", "Telefone 1", $this->p_telefone_1, 10, 15, false); $this->campoNumero("p_ddd_telefone_2", "DDD Telefone 2", $this->p_ddd_telefone_2, 2, 2, false); $this->campoNumero("p_telefone_2", "Telefone", $this->p_telefone_2, 10, 15, false); $this->campoNumero("p_ddd_telefone_fax", "DDD Fax", $this->p_ddd_telefone_fax, 2, 2, false); $this->campoNumero("p_telefone_fax", "Fax", $this->p_telefone_fax, 10, 15, false); $this->campoTexto("p_http", "Site", $this->p_http, "50", "255", false); $this->campoTexto("p_email", "E-mail", $this->p_email, "50", "255", false); // } // else // { // $this->mensagem = "nop"; // } $this->passou = true; $this->campoOculto("passou", $this->passou); } // else if ( $this->passo == 3 ) // { // // // // } if ($_POST["escola_curso"]) { $this->escola_curso = unserialize(urldecode($_POST["escola_curso"])); } if (is_numeric($this->cod_escola) && !$_POST) { $obj = new clsPmieducarEscolaCurso($this->cod_escola); $registros = $obj->lista($this->cod_escola); if ($registros) { foreach ($registros as $campo) { $this->escola_curso[$campo["ref_cod_curso"]] = $campo["ref_cod_curso"]; } } } if ($_POST["ref_cod_curso"]) { $this->escola_curso[$_POST["ref_cod_curso"]] = $_POST["ref_cod_curso"]; unset($this->ref_cod_curso); } $this->campoQuebra(); $this->campoOculto("excluir_curso", ""); unset($aux); if ($this->escola_curso) { // echo "<pre>";print_r($this->escola_curso); foreach ($this->escola_curso as $curso) { if ($this->excluir_curso == $curso) { unset($this->escola_curso[$curso]); // = null; $this->excluir_curso = null; } else { $obj_curso = new clsPmieducarCurso($curso); $obj_curso_det = $obj_curso->detalhe(); $nm_curso = $obj_curso_det["nm_curso"]; $this->campoTextoInv("ref_cod_curso_{$curso}", "", $nm_curso, 30, 255, false, false, false, "", "<a href='#' onclick=\"getElementById('excluir_curso').value = '{$curso}'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bola_xis.gif' title='Excluir' border=0></a>"); $aux[$curso] = $curso; } } unset($this->escola_curso); $this->escola_curso = $aux; } $this->campoOculto("escola_curso", serialize($this->escola_curso)); $opcoes = array("" => "Selecione"); if (class_exists("clsPmieducarCurso")) { /*$todos_cursos = "curso = new Array();\n"; $objTemp = new clsPmieducarCurso(); $objTemp->setOrderby("nm_curso"); $lista = $objTemp->lista( null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1 ); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todos_cursos .= "curso[curso.length] = new Array({$registro["cod_curso"]},'{$registro["nm_curso"]}', {$registro["ref_cod_instituicao"]});\n"; } } echo "<script>{$todos_cursos}</script>";*/ // EDITAR if ($this->cod_escola || $this->ref_cod_instituicao) { $objTemp = new clsPmieducarCurso(); $objTemp->setOrderby("nm_curso"); $lista = $objTemp->lista(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1, null, $this->ref_cod_instituicao); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes["{$registro['cod_curso']}"] = "{$registro['nm_curso']}"; } } } } else { echo "<!--\nErro\nClasse clsPmieducarCurso não encontrada\n-->"; $opcoes = array("" => "Erro na geração"); } if ($aux) { $this->campoLista("ref_cod_curso", "Curso", $opcoes, $this->ref_cod_curso, "", false, "", "<a href='#' onclick=\"getElementById('incluir_curso').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>", false, false); } else { $this->campoLista("ref_cod_curso", "Curso", $opcoes, $this->ref_cod_curso, "", false, "", "<a href='#' onclick=\"getElementById('incluir_curso').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>"); } $this->campoOculto("incluir_curso", ""); $this->campoQuebra(); } }
function Gerar() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; session_write_close(); $this->titulo = "Sequência Enturmação - Listagem"; foreach ($_GET as $var => $val) { // passa todos os valores obtidos no GET para atributos do objeto $this->{$var} = $val === "" ? null : $val; } $lista_busca = array("Curso Origem", "Série Origem", "Curso Destino", "Série Destino"); $obj_permissoes = new clsPermissoes(); $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); if ($nivel_usuario == 1) { $lista_busca[] = "Instituição"; } $this->addCabecalhos($lista_busca); // Filtros de Foreign Keys if ($nivel_usuario == 1) { $objInstituicao = new clsPmieducarInstituicao(); $opcoes = array("" => "Selecione"); $objInstituicao->setOrderby("nm_instituicao ASC"); $lista = $objInstituicao->lista(); if (is_array($lista)) { foreach ($lista as $linha) { $opcoes[$linha["cod_instituicao"]] = $linha["nm_instituicao"]; } } $this->campoLista("ref_cod_instituicao", "Instituição", $opcoes, $this->ref_cod_instituicao, "", null, null, null, null, false); } else { $obj_usuario = new clsPmieducarUsuario($this->pessoa_logada); $obj_usuario_det = $obj_usuario->detalhe(); $this->ref_cod_instituicao = $obj_usuario_det["ref_cod_instituicao"]; } $opcoes = array("" => "Selecione"); $opcoes_ = array("" => "Selecione"); if (class_exists("clsPmieducarCurso")) { /*$todos_cursos = "curso = new Array();\n"; $objTemp = new clsPmieducarCurso(); $objTemp->setOrderby("nm_curso"); $lista = $objTemp->lista( null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1 ); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todos_cursos .= "curso[curso.length] = new Array({$registro["cod_curso"]},'{$registro["nm_curso"]}', {$registro["ref_cod_instituicao"]});\n"; } } echo "<script>{$todos_cursos}</script>";*/ // EDITAR if ($this->ref_cod_instituicao) { $objTemp = new clsPmieducarCurso(); $objTemp->setOrderby("nm_curso"); $lista = $objTemp->lista(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1, null, $this->ref_cod_instituicao); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes[$registro["cod_curso"]] = $registro["nm_curso"]; $opcoes_[$registro["cod_curso"]] = $registro["nm_curso"]; } } } } else { echo "<!--\nErro\nClasse clsPmieducarCurso não encontrada\n-->"; $opcoes = array("" => "Erro na geração"); } $this->campoLista("ref_curso_origem", "Curso Origem", $opcoes, $this->ref_curso_origem, "", true, "", "", false, false); $this->campoLista("ref_curso_destino", " Curso Destino", $opcoes_, $this->ref_curso_destino, "", false, "", "", false, false); // primary keys $opcoes = array("" => "Selecione"); $opcoes_ = array("" => "Selecione"); if (class_exists("clsPmieducarSerie")) { /*$todas_series = "serie = new Array();\n"; $objTemp = new clsPmieducarSerie(); $lista = $objTemp->lista( null,null,null,null,null,null,null,null,null,null,null,null,1 ); if ( is_array( $lista ) && count( $lista ) ) { foreach ( $lista as $registro ) { $todas_series .= "serie[serie.length] = new Array({$registro["cod_serie"]},'{$registro["nm_serie"]}', {$registro["ref_cod_curso"]});\n"; } } echo "<script>{$todas_series}</script>";*/ if ($this->ref_curso_origem) { $objTemp = new clsPmieducarSerie(); $lista = $objTemp->lista(null, null, null, $this->ref_curso_origem, null, null, null, null, null, null, null, null, 1); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes[$registro["cod_serie"]] = $registro["nm_serie"]; } } } if ($this->ref_curso_destino) { $objTemp = new clsPmieducarSerie(); $lista = $objTemp->lista(null, null, null, $this->ref_curso_destino, null, null, null, null, null, null, null, null, 1); if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { $opcoes_[$registro["cod_serie"]] = $registro["nm_serie"]; } } } } else { echo "<!--\nErro\nClasse clsPmieducarSerie não encontrada\n-->"; $opcoes = array("" => "Erro na geracao"); $opcoes_ = array("" => "Erro na geracao"); } $this->campoLista("ref_serie_origem", "Série Origem", $opcoes, $this->ref_serie_origem, null, true, "", "", false, false); $this->campoLista("ref_serie_destino", " Série Destino", $opcoes_, $this->ref_serie_destino, "", false, "", "", false, false); // Paginador $this->limite = 20; $this->offset = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $this->limite - $this->limite : 0; $obj_sequencia_serie = new clsPmieducarSequenciaSerie(); $obj_sequencia_serie->setOrderby("data_cadastro ASC"); $obj_sequencia_serie->setLimite($this->limite, $this->offset); $lista = $obj_sequencia_serie->lista($this->ref_serie_origem, $this->ref_serie_destino, null, null, null, null, null, null, 1, $this->ref_curso_origem, $this->ref_curso_destino, $this->ref_cod_instituicao); $total = $obj_sequencia_serie->_total; // monta a lista if (is_array($lista) && count($lista)) { foreach ($lista as $registro) { // pega detalhes de foreign_keys if (class_exists("clsPmieducarSerie")) { $obj_ref_serie_origem = new clsPmieducarSerie($registro["ref_serie_origem"]); $det_ref_serie_origem = $obj_ref_serie_origem->detalhe(); $serie_origem = $det_ref_serie_origem["nm_serie"]; $registro["ref_curso_origem"] = $det_ref_serie_origem["ref_cod_curso"]; if (class_exists("clsPmieducarCurso")) { $obj_ref_curso_origem = new clsPmieducarCurso($registro["ref_curso_origem"]); $det_ref_curso_origem = $obj_ref_curso_origem->detalhe(); $registro["ref_curso_origem"] = $det_ref_curso_origem["nm_curso"]; $registro["ref_cod_instituicao"] = $det_ref_curso_origem["ref_cod_instituicao"]; if (class_exists("clsPmieducarInstituicao")) { $obj_instituicao = new clsPmieducarInstituicao($registro["ref_cod_instituicao"]); $det_instituicao = $obj_instituicao->detalhe(); $registro["ref_cod_instituicao"] = $det_instituicao["nm_instituicao"]; } else { $registro["ref_cod_instituicao"] = "Erro na geração"; echo "<!--\nErro\nClasse não existente: clsPmieducarInstituicao\n-->"; } } else { $registro["ref_cod_origem"] = "Erro na geração"; echo "<!--\nErro\nClasse não existente: clsPmieducarCurso\n-->"; } } else { $registro["ref_serie_origem"] = "Erro na geração"; echo "<!--\nErro\nClasse não existente: clsPmieducarSerie\n-->"; } if (class_exists("clsPmieducarSerie")) { $obj_ref_serie_destino = new clsPmieducarSerie($registro["ref_serie_destino"]); $det_ref_serie_destino = $obj_ref_serie_destino->detalhe(); $serie_destino = $det_ref_serie_destino["nm_serie"]; $registro["ref_curso_destino"] = $det_ref_serie_destino["ref_cod_curso"]; if (class_exists("clsPmieducarCurso")) { $obj_ref_curso_destino = new clsPmieducarCurso($registro["ref_curso_destino"]); $det_ref_curso_destino = $obj_ref_curso_destino->detalhe(); $registro["ref_curso_destino"] = $det_ref_curso_destino["nm_curso"]; } else { $registro["ref_cod_destino"] = "Erro na geração"; echo "<!--\nErro\nClasse não existente: clsPmieducarCurso\n-->"; } } else { $registro["ref_serie_destino"] = "Erro na geração"; echo "<!--\nErro\nClasse não existente: clsPmieducarSerie\n-->"; } $lista_busca = array("<a href=\"educar_sequencia_serie_det.php?ref_serie_origem={$registro["ref_serie_origem"]}&ref_serie_destino={$registro["ref_serie_destino"]}\">{$registro["ref_curso_origem"]}</a>", "<a href=\"educar_sequencia_serie_det.php?ref_serie_origem={$registro["ref_serie_origem"]}&ref_serie_destino={$registro["ref_serie_destino"]}\">{$serie_origem}</a>", "<a href=\"educar_sequencia_serie_det.php?ref_serie_origem={$registro["ref_serie_origem"]}&ref_serie_destino={$registro["ref_serie_destino"]}\">{$registro["ref_curso_destino"]}</a>", "<a href=\"educar_sequencia_serie_det.php?ref_serie_origem={$registro["ref_serie_origem"]}&ref_serie_destino={$registro["ref_serie_destino"]}\">{$serie_destino}</a>"); if ($nivel_usuario == 1) { $lista_busca[] = "<a href=\"educar_sequencia_serie_det.php?ref_serie_origem={$registro["ref_serie_origem"]}&ref_serie_destino={$registro["ref_serie_destino"]}\">{$registro["ref_cod_instituicao"]}</a>"; } $this->addLinhas($lista_busca); } } $this->addPaginador2("educar_sequencia_serie_lst.php", $total, $_GET, $this->nome, $this->limite); $obj_permissoes = new clsPermissoes(); if ($obj_permissoes->permissao_cadastra(587, $this->pessoa_logada, 3)) { $this->acao = "go(\"educar_sequencia_serie_cad.php\")"; $this->nome_acao = "Novo"; } $this->largura = "100%"; $localizacao = new LocalizacaoSistema(); $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "Início", "educar_index.php" => "i-Educar - Escola", "" => "Listagem de sequências de enturmação")); $this->enviaLocalizacao($localizacao->montar()); }
function renderHTML() { if ($_POST) { foreach ($_POST as $key => $value) { $this->{$key} = $value; } } if ($this->ref_ref_cod_serie) { $this->ref_cod_serie = $this->ref_ref_cod_serie; } if ($this->ref_cod_escola) { $obj_escola = new clsPmieducarEscola($this->ref_cod_escola); $det_escola = $obj_escola->detalhe(); $this->nm_escola = $det_escola['nome']; } $obj_instituicao = new clsPmieducarInstituicao($this->ref_cod_instituicao); $det_instituicao = $obj_instituicao->detalhe(); $this->nm_instituicao = $det_instituicao['nm_instituicao']; $fonte = 'arial'; $corTexto = '#000000'; $obj_curso = new clsPmieducarCurso(); $obj_curso->setOrderby('nm_curso'); $lst_curso = $obj_curso->lista($this->ref_cod_curso, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, $this->ref_cod_instituicao); if ($lst_curso) { foreach ($lst_curso as $curso) { $obj_serie = new clsPmieducarSerie(); $obj_serie->setOrderby('nm_serie'); $lst_serie = $obj_serie->lista($this->ref_cod_serie, NULL, NULL, $curso['cod_curso'], NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao, NULL, NULL, NULL, $this->ref_cod_escola); $quadro_horario = 0; if ($lst_serie) { foreach ($lst_serie as $serie) { $obj_turma = new clsPmieducarTurma(); $obj_turma->setOrderby('nm_turma'); $lst_turma = $obj_turma->lista($this->ref_cod_turma, NULL, NULL, $serie['cod_serie'], $this->ref_cod_escola, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $curso['cod_curso'], $this->ref_cod_instituicao); if ($lst_turma) { foreach ($lst_turma as $turma) { $obj_quadro = new clsPmieducarQuadroHorario(NULL, NULL, NULL, $turma['cod_turma'], NULL, NULL, 1); $det_quadro = $obj_quadro->detalhe(); if ($det_quadro) { if (!$this->pdf) { $this->pdf = new clsPDF('Quadro Horarios', 'Quadro Horarios', 'A4', '', FALSE, FALSE); } if ($quadro_horario % 3 == 0) { $this->page_y = 15; $this->pdf->OpenPage(); $this->addCabecalho(); $quadro_horario = 0; } $this->pdf->escreve_relativo($turma['nm_turma'] . ' - ' . $serie['nm_serie'], 20, $this->page_y - 7, 550, 20, $fonte, 11, $corTexto, 'center'); $this->page_y += 10; $this->pdf->quadrado_relativo(35, $this->page_y, 525, 20, 0.3, '#777777', '#777777'); $inicio_x = 35; for ($dia_semana = 1; $dia_semana <= 7; $dia_semana++) { $this->pdf->linha_relativa($inicio_x, $this->page_y, 0, 20); $this->pdf->escreve_relativo($this->array_dias_semana[$dia_semana], $inicio_x, $this->page_y + 3, 75, 20, $fonte, 11, $corTexto, 'center'); $inicio_x += 75; } $this->page_y += 20; $inicio_y = $this->page_y; $inicio_x = 35; $this->pdf->quadrado_relativo($inicio_x, $this->page_y, 525, 200, 0.3); for ($dia_semana = 1; $dia_semana <= 7; $dia_semana++) { $obj_horarios = new clsPmieducarQuadroHorarioHorarios(); $resultado = $obj_horarios->retornaHorario($this->ref_cod_instituicao, $this->ref_cod_escola, $serie['cod_serie'], $turma['cod_turma'], $dia_semana); if (is_array($resultado)) { foreach ($resultado as $registro) { $this->pdf->quadrado_relativo($inicio_x, $this->page_y, 75, 50, 0.3); $componenteMapper = new ComponenteCurricular_Model_ComponenteDataMapper(); $componente = $componenteMapper->find($registro['ref_cod_disciplina']); $obj_servidor = new clsPmieducarServidor(); $det_servidor = array_shift($obj_servidor->lista($registro['ref_servidor'], NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TRUE)); $det_servidor['nome'] = array_shift(explode(' ', $det_servidor['nome'])); $texto = sprintf("%s - %s\n%s\n%s", substr($registro['hora_inicial'], 0, 5), substr($registro["hora_final"], 0, 5), $componente->abreviatura, $det_servidor['nome']); $this->pdf->escreve_relativo($texto, $inicio_x, $this->page_y + 12, 75, 50, $fonte, 10, $corTexto, 'center'); $this->page_y += 50; } } $inicio_x += 75; $this->page_y = $inicio_y; } $this->page_y += 220; } $quadro_horario++; } } } } } } if ($this->pdf) { $this->pdf->CloseFile(); $this->get_link = $this->pdf->GetLink(); } else { echo ' <script> alert("A(s) turma(s) não possui(em) quadro de horário(s)."); window.parent.fechaExpansivel("div_dinamico_" + (window.parent.DOM_divs.length-1)); </script>'; return; } echo sprintf(' <script> window.onload=function() { parent.EscondeDiv("LoadImprimir"); window.location="download.php?filename=%s" } </script>', $this->get_link); echo sprintf(' <html> <center>Se o download não iniciar automaticamente <br /> <a target="blank" href="%s" style="font-size: 16px; color: #000000; text-decoration: underline;">clique aqui!</a><br /><br /> <span style="font-size: 10px;">Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br /> Clique na Imagem para Baixar o instalador<br /><br /> <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> </span> </center>', $this->get_link); }
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ã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 Gerar() { $this->campoOculto('ref_cod_instituicao', $this->ref_cod_instituicao); $opcoes = $opcoes_curso = array('' => 'Selecione'); $obj_cursos = new clsPmieducarCurso(); $obj_cursos->setOrderby('nm_curso'); $lst_cursos = $obj_cursos->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, $this->ref_cod_instituicao); if ($lst_cursos) { foreach ($lst_cursos as $curso) { $opcoes_curso[$curso['cod_curso']] = $curso['nm_curso']; } } $obj_disciplina = new clsPmieducarDisciplina(); $obj_disciplina->setOrderby('nm_disciplina'); $lst_opcoes = array(); $arr_valores = array(); if ($this->cursos_disciplina) { foreach ($this->cursos_disciplina as $curso => $disciplinas) { if ($disciplinas) { foreach ($disciplinas as $disciplina) { $arr_valores[] = array($curso, $disciplina); } } } } if ($this->ref_cod_curso) { foreach ($this->ref_cod_curso as $curso) { $lst_disciplinas = $obj_disciplina->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, $curso, $this->ref_cod_instituicao); $componenteAnoDataMapper = new ComponenteCurricular_Model_AnoEscolarDataMapper(); $componentes = $componenteAnoDataMapper->findComponentePorCurso($curso); $opcoes_disc = array(); foreach ($componentes as $componente) { $opcoes_disc[$componente->id] = $componente->nome; } $lst_opcoes[] = array($opcoes_curso, $opcoes_disc); } } $this->campoTabelaInicio('funcao', 'Componentes Curriculares', array('Curso', 'Componente Curricular'), $arr_valores, '', $lst_opcoes); // Cursos $this->campoLista('ref_cod_curso', 'Curso', $opcoes_curso, $this->ref_cod_curso, 'trocaCurso(this)', '', '', ''); // Disciplinas $this->campoLista('ref_cod_disciplina', 'Componente Curricular', $opcoes, $this->ref_cod_disciplina, '', '', '', ''); $this->campoTabelaFim(); }
function renderHTML() { if ($_POST) { foreach ($_POST as $key => $value) { $this->{$key} = $value; } } @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; @session_write_close(); if ($this->ref_ref_cod_serie) { $this->ref_cod_serie = $this->ref_ref_cod_serie; } $fonte = 'arial'; $corTexto = '#000000'; if ($this->escola_sem_avaliacao == 1) { $this->escola_sem_avaliacao = true; } elseif ($this->escola_sem_avaliacao == 2) { $this->escola_sem_avaliacao = false; } else { $this->escola_sem_avaliacao = null; } $obj_escola_instituicao = new clsPmieducarEscola(); $lst_escola_instituicao = $obj_escola_instituicao->lista($this->ref_cod_escola, null, null, $this->ref_cod_instituicao, null, null, null, null, null, null, 1, null, $this->escola_sem_avaliacao); $this->pdf = new clsPDF("Alunos Matriculados - Sintético - {$this->ano}", "Alunos Matriculados - Sintético", "A4", "", false, false); if ($this->is_padrao || $this->ano == 2007) { $this->semestre = null; } if (is_array($lst_escola_instituicao) && count($lst_escola_instituicao)) { foreach ($lst_escola_instituicao as $escola) { $page_open = false; $this->ref_cod_escola = $escola['cod_escola']; if ($this->ref_cod_escola) { $obj_escola = new clsPmieducarEscola($this->ref_cod_escola); $det_escola = $obj_escola->detalhe(); $this->nm_escola = $det_escola['nome']; $obj_instituicao = new clsPmieducarInstituicao($this->ref_cod_instituicao); $det_instituicao = $obj_instituicao->detalhe(); $this->nm_instituicao = $det_instituicao['nm_instituicao']; if ($det_escola['ref_idpes']) { $obj_endereco_escola = new clsEndereco($det_escola['ref_idpes']); $det_enderedo_escola = $obj_endereco_escola->detalhe(); $this->nm_localidade = $this->nm_municipio = $det_enderedo_escola['cidade']; if (!$det_enderedo_escola) { $obj_endereco_externo_escola = new clsEnderecoExterno($det_escola['ref_idpes']); $det_enderedo_externo_escola = $obj_endereco_externo_escola->detalhe(); $this->nm_localidade = $this->nm_municipio = $det_enderedo_externo_escola['cidade']; } } else { $obj_escola_complemento = new clsPmieducarEscolaComplemento($this->ref_cod_escola); $det_escola_complemento = $obj_escola_complemento->detalhe(); $this->nm_localidade = $this->nm_municipio = $det_escola_complemento['municipio']; } } $total_geral_escola_nao_enturmado_feminino = 0; $total_geral_escola_nao_enturmado_masculino = 0; $total_geral_escola_enturmado_feminino = 0; $total_geral_escola_enturmado_masculino = 0; $obj_cursos = new clsPmieducarCurso(); $obj_cursos->setOrderby("cod_curso asc"); $lst_cursos = $obj_cursos->lista($this->ref_cod_curso, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1, null, $this->ref_cod_instituicao); if ($lst_cursos) { foreach ($lst_cursos as $curso) { $obj_serie_curso = new clsPmieducarSerie(); $obj_serie_curso->setOrderby('etapa_curso asc'); $lst_serie_curso = $obj_serie_curso->lista($this->ref_cod_serie, null, null, $curso['cod_curso'], null, null, null, null, null, null, null, null, 1, $this->ref_cod_instituicao, null, null, null, $this->ref_cod_escola); $existe_matriculas = false; if ($lst_serie_curso) { $total = 0; foreach ($lst_serie_curso as $key_serie => $serie) { $obj_turmas = new clsPmieducarTurma(); $lst_turmas = $obj_turmas->lista(null, null, null, $serie['cod_serie'], $escola['cod_escola'], null, null, null, null, null, null, null, null, null, 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, true); if (!$lst_turmas) { $obj_turmas = new clsPmieducarTurma(); $lst_turmas = $obj_turmas->lista(null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1, null, null, null, null, null, null, null, null, null, null, null, null, null, $escola['cod_escola'], $serie['cod_serie']); } if ($lst_turmas) { if (!$page_open) { $x_quadrado = 30; $this->page_y = 80; $altura_caixa = 20; $this->pdf->OpenPage(); $this->addCabecalho(); $this->addCabecalho2(); $page_open = true; } $existe_matriculas = true; $total_enturmados_turma_masculino = 0; $total_enturmados_turma_feminino = 0; $total_nao_enturmados_turma_masculino = 0; $total_nao_enturmados_turma_feminino = 0; foreach ($lst_turmas as $key_turma => $turma) { if ($turma['hora_inicial']) { if ($turma['hora_inicial'] <= '12:00') { $turno = 'Matutino'; } elseif ($turma['hora_inicial'] > '12:00' && $turma['hora_inicial'] <= '18:00') { $turno = 'Vespert.'; } else { $turno = 'Noturno'; } } $this->pdf->quadrado_relativo($x_quadrado, $this->page_y, 535, $altura_caixa); $this->pdf->escreve_relativo("{$escola['cod_escola']}", 25, $this->page_y + 5, 45, $altura_caixa, $fonte, 8, $corTexto, 'center'); $this->pdf->linha_relativa(60, $this->page_y, 0, $altura_caixa, '0.1'); $this->pdf->escreve_relativo("{$curso['nm_curso']}", 67, $this->page_y + 5, 258, $altura_caixa, $fonte, 8, $corTexto, 'left'); $this->pdf->linha_relativa(250, $this->page_y, 0, $altura_caixa, '0.1'); $this->pdf->escreve_relativo("{$serie['nm_serie']} / {$turma['nm_turma']}", 250, $this->page_y + 2, 70, $altura_caixa, $fonte, 8, $corTexto, 'center'); $this->pdf->linha_relativa(320, $this->page_y, 0, $altura_caixa, '0.1'); $this->pdf->escreve_relativo("{$turno}", 323, $this->page_y + 5, 258, $altura_caixa, $fonte, 8, $corTexto, 'left'); $this->pdf->linha_relativa(360, $this->page_y, 0, $altura_caixa, '0.1'); $obj_matriculas_turma = new clsPmieducarMatriculaTurma(); $lst_matriculas_turma = $obj_matriculas_turma->lista(null, $turma['cod_turma'], null, null, null, null, null, null, 1, $serie['cod_serie'], $curso['cod_curso'], $escola['cod_escola'], $this->ref_cod_instituicao, null, null, array(1, 2, 3), null, null, $this->ano, null, null, null, 1, true, null, null, null, null, $this->semestre); $enturmados_turma_masculino = 0; $enturmados_turma_feminino = 0; if ($lst_matriculas_turma) { $total_enturmados_turma_geral = count($lst_matriculas_turma); //aqui verificar aluno que estao na multiseriada foreach ($lst_matriculas_turma as $matricula) { $obj_matricula = new clsPmieducarMatricula($matricula['ref_cod_matricula']); $det_matricula = $obj_matricula->detalhe(); $obj_aluno = new clsPmieducarAluno($det_matricula['ref_cod_aluno']); $det_aluno = $obj_aluno->detalhe(); $obj_pessoa = new clsFisica($det_aluno['ref_idpes']); $det_pessoa = $obj_pessoa->detalhe(); /** * verifica se o aluno possui transferencia * e nao exibe na enturmacao */ //$obj_transf = new clsPmieducarTransferenciaSolicitacao(); //$lst_transf = $obj_transf->lista(null,null,null,null,null,$matricula['ref_cod_matricula'],null,null,null,null,null,null,null,null,null,null,$this->ref_cod_escola,$this->ref_ref_cod_serie); //if($lst_transf) // continue; if (strtoupper($det_pessoa['sexo']) == 'M') { $enturmados_turma_masculino++; } else { $enturmados_turma_feminino++; } } } $total_enturmados_turma_masculino += $enturmados_turma_masculino; $total_enturmados_turma_feminino += $enturmados_turma_feminino; $total_geral_escola_enturmado_masculino += $enturmados_turma_masculino; $total_geral_escola_enturmado_feminino += $enturmados_turma_feminino; /***************************INVERTIDO ABAIXO*******************************************************/ //enturmados /*$this->pdf->escreve_relativo( "{$enturmados_turma_feminino}", 355, $this->page_y + 5 , 40, $altura_caixa, $fonte, 8, $corTexto, 'center' ); $this->pdf->escreve_relativo( "{$enturmados_turma_masculino}", 385, $this->page_y + 5 , 40, $altura_caixa, $fonte, 8, $corTexto, 'center' );*/ $this->pdf->escreve_relativo("{$enturmados_turma_masculino}", 355, $this->page_y + 5, 40, $altura_caixa, $fonte, 8, $corTexto, 'center'); $this->pdf->escreve_relativo("{$enturmados_turma_feminino}", 385, $this->page_y + 5, 40, $altura_caixa, $fonte, 8, $corTexto, 'center'); /**************************************************************************************************/ $this->pdf->escreve_relativo($enturmados_turma_masculino + $enturmados_turma_feminino, 425, $this->page_y + 5, 30, $altura_caixa, $fonte, 8, $corTexto, 'center'); $this->pdf->linha_relativa(460, $this->page_y, 0, $altura_caixa, '0.1'); $this->pdf->linha_relativa(390, $this->page_y, 0, $altura_caixa, '0.1'); $this->pdf->linha_relativa(420, $this->page_y, 0, $altura_caixa, '0.1'); //$obj_matriculas = new clsPmieducarMatricula(); // $lst_matriculas = $obj_matriculas->lista(null, null, $escola['cod_escola'], $serie['cod_serie'], null, null, null, null, null, null, null, null, 1, $this->ano, $curso['cod_curso'], $this->ref_cod_instituicao ); if (!$executou) { $obj_nao_enturmados = new clsPmieducarMatriculaTurma(); $lst_nao_enturmados = $obj_nao_enturmados->dadosAlunosNaoEnturmados($escola['cod_escola'], $serie['cod_serie'], $curso['cod_curso'], $this->ano, true); $executou = true; //$total_nao_enturmados_turma_masculino = $total_nao_enturmados_turma_feminino = 0; if ($lst_nao_enturmados) { foreach ($lst_nao_enturmados as $matricula) { ////$obj_aluno = new clsPmieducarAluno($matricula['ref_cod_aluno']); //$det_aluno = $obj_aluno->detalhe(); //$obj_pessoa = new clsFisica($det_aluno['ref_idpes']); //$det_pessoa = $obj_pessoa->detalhe(); if (strtoupper($matricula['sexo']) == 'M') { $total_nao_enturmados_turma_masculino++; } else { $total_nao_enturmados_turma_feminino++; } } } } if ($this->page_y + $altura_caixa >= 800) { $this->page_y = 80; $this->pdf->ClosePage(); $this->pdf->OpenPage(); $page_open = true; $this->addCabecalho(); $this->addCabecalho2(); } $this->page_y += $altura_caixa; } if ($key_serie < count($lst_serie_curso)) { $mult = count($lst_turmas); $centraliza = $altura_caixa * ($mult + 1) / 2; $this->pdf->quadrado_relativo(460, $this->page_y - $altura_caixa * $mult, 105, $altura_caixa * $mult); $this->pdf->linha_relativa(498, $this->page_y - $altura_caixa * $mult, 0, $altura_caixa * $mult, '0.1'); //nao enturmados $total_geral_escola_nao_enturmado_feminino += $tot_fem = $total_nao_enturmados_turma_feminino; $total_geral_escola_nao_enturmado_masculino += $tot_masc = $total_nao_enturmados_turma_masculino; /**********************************INVERTIDO********************************************/ /*$this->pdf->escreve_relativo( $tot_fem , 463, $this->page_y + 5 - $centraliza , 35, $altura_caixa, $fonte, 8, $corTexto, 'center' ); $this->pdf->escreve_relativo( $tot_masc, 500, $this->page_y + 5 - $centraliza, 35, $altura_caixa, $fonte, 8, $corTexto, 'center' );*/ $this->pdf->escreve_relativo($tot_masc, 463, $this->page_y + 5 - $centraliza, 35, $altura_caixa, $fonte, 8, $corTexto, 'center'); $this->pdf->escreve_relativo($tot_fem, 500, $this->page_y + 5 - $centraliza, 35, $altura_caixa, $fonte, 8, $corTexto, 'center'); /***************************************************************************************/ $this->pdf->linha_relativa(538, $this->page_y - $altura_caixa * $mult, 0, $altura_caixa * $mult, '0.1'); $this->pdf->escreve_relativo($tot_fem + $tot_masc, 530, $this->page_y + 5 - $centraliza, 40, $altura_caixa, $fonte, 8, $corTexto, 'center'); } } } } } } if ($page_open) { //total geral $this->pdf->quadrado_relativo(320, $this->page_y, 40, $altura_caixa); $this->pdf->escreve_relativo("TOTAL", 327, $this->page_y + 5, 258, $altura_caixa, $fonte, 9, $corTexto, 'left'); $this->pdf->quadrado_relativo(360, $this->page_y, 205, $altura_caixa); /***************************************INVERTIDO******************************************/ //enturmados /*$this->pdf->escreve_relativo( "{$total_geral_escola_enturmado_feminino}", 355, $this->page_y + 5 , 40, $altura_caixa, $fonte, 8, $corTexto, 'center' ); $this->pdf->escreve_relativo( "{$total_geral_escola_enturmado_masculino}", 385, $this->page_y + 5 , 40, $altura_caixa, $fonte, 8, $corTexto, 'center' );*/ $this->pdf->escreve_relativo("{$total_geral_escola_enturmado_masculino}", 355, $this->page_y + 5, 40, $altura_caixa, $fonte, 8, $corTexto, 'center'); $this->pdf->escreve_relativo("{$total_geral_escola_enturmado_feminino}", 385, $this->page_y + 5, 40, $altura_caixa, $fonte, 8, $corTexto, 'center'); /******************************************************************************************/ $this->pdf->escreve_relativo($total_geral_escola_enturmado_feminino + $total_geral_escola_enturmado_masculino, 425, $this->page_y + 5, 30, $altura_caixa, $fonte, 8, $corTexto, 'center'); $this->pdf->linha_relativa(460, $this->page_y, 0, $altura_caixa, '0.1'); $this->pdf->linha_relativa(390, $this->page_y, 0, $altura_caixa, '0.1'); $this->pdf->linha_relativa(420, $this->page_y, 0, $altura_caixa, '0.1'); $this->pdf->linha_relativa(498, $this->page_y, 0, $altura_caixa, '0.1'); /***************************************INVERTIDO******************************************/ //nao enturmados /*$this->pdf->escreve_relativo( "$total_geral_escola_nao_enturmado_feminino", 463, $this->page_y + 5 , 35, $altura_caixa, $fonte, 8, $corTexto, 'center' ); $this->pdf->escreve_relativo( "$total_geral_escola_nao_enturmado_masculino", 500, $this->page_y + 5, 35, $altura_caixa, $fonte, 8, $corTexto, 'center' );*/ $this->pdf->escreve_relativo("{$total_geral_escola_nao_enturmado_masculino}", 463, $this->page_y + 5, 35, $altura_caixa, $fonte, 8, $corTexto, 'center'); $this->pdf->escreve_relativo("{$total_geral_escola_nao_enturmado_feminino}", 500, $this->page_y + 5, 35, $altura_caixa, $fonte, 8, $corTexto, 'center'); /******************************************************************************************/ $this->pdf->linha_relativa(538, $this->page_y, 0, $altura_caixa, '0.1'); $this->pdf->escreve_relativo($total_geral_escola_nao_enturmado_masculino + $total_geral_escola_nao_enturmado_feminino, 530, $this->page_y + 5, 40, $altura_caixa, $fonte, 8, $corTexto, 'center'); if ($page_open && $existe_matriculas) { $this->pdf->ClosePage(); $page_open = false; } } } $this->pdf->CloseFile(); $this->get_link = $this->pdf->GetLink(); echo "<script>window.onload=function(){parent.EscondeDiv('LoadImprimir');window.location='download.php?filename=" . $this->get_link . "'}</script>"; echo "<html><center>Se o download não iniciar automaticamente <br /><a target='_blank' href='" . $this->get_link . "' style='font-size: 16px; color: #000000; text-decoration: underline;'>clique aqui!</a><br><br>\n\t\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\t\tClique na Imagem para Baixar o instalador<br><br>\n\t\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\t</span>\n\t\t\t\t</center>"; } else { echo "<script>window.onload=function(){parent.EscondeDiv('LoadImprimir');}</script>"; echo "<script>\n\t\t\t\t\t\t\talert('Nenhuma informação a ser apresentada');\n\t\t\t\t\t\t\twindow.parent.fechaExpansivel('div_dinamico_'+(window.parent.DOM_divs.length-1));\n\t\t\t\t\t </script>"; } }
function Gerar() { $this->campoOculto('ref_cod_instituicao', $this->ref_cod_instituicao); $opcoes = $opcoes_curso = array('' => 'Selecione'); $obj_cursos = new clsPmieducarCurso(); $obj_cursos->setOrderby('nm_curso'); $lst_cursos = $obj_cursos->lista(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, $this->ref_cod_instituicao); if ($lst_cursos) { foreach ($lst_cursos as $curso) { $opcoes_curso[$curso['cod_curso']] = $curso['nm_curso']; } } $arr_valores = array(); if ($this->cursos_servidor) { foreach ($this->cursos_servidor as $curso) { $arr_valores[] = array($curso); } } $this->campoTabelaInicio('cursos_ministra', 'Cursos Ministrados', array('Curso'), $arr_valores, ''); $this->campoLista('ref_cod_curso', 'Curso', $opcoes_curso, $this->ref_cod_curso, '', '', '', ''); $this->campoTabelaFim(); }