Commit de09d7a346dcef755c354aa3fcf2f6da0d007dd3
1 parent
070b8c63
Exists in
master
Refactoring para coding standards (como sempre, interminável)
Showing
4 changed files
with
793 additions
and
788 deletions
Show diff stats
ieducar/intranet/educar_relatorio_professor_disciplina.php
| 1 | 1 | <?php |
| 2 | -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
| 3 | - * * | |
| 4 | - * @author Prefeitura Municipal de Itajaí * | |
| 5 | - * @updated 29/03/2007 * | |
| 6 | - * Pacote: i-PLB Software Público Livre e Brasileiro * | |
| 7 | - * * | |
| 8 | - * Copyright (C) 2006 PMI - Prefeitura Municipal de Itajaí * | |
| 9 | - * ctima@itajai.sc.gov.br * | |
| 10 | - * * | |
| 11 | - * Este programa é software livre, você pode redistribuí-lo e/ou * | |
| 12 | - * modificá-lo sob os termos da Licença Pública Geral GNU, conforme * | |
| 13 | - * publicada pela Free Software Foundation, tanto a versão 2 da * | |
| 14 | - * Licença como (a seu critério) qualquer versão mais nova. * | |
| 15 | - * * | |
| 16 | - * Este programa é distribuído na expectativa de ser útil, mas SEM * | |
| 17 | - * QUALQUER GARANTIA. Sem mesmo a garantia implícita de COMERCIALI- * | |
| 18 | - * ZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM PARTICULAR. Con- * | |
| 19 | - * sulte a Licença Pública Geral GNU para obter mais detalhes. * | |
| 20 | - * * | |
| 21 | - * Você deve ter recebido uma cópia da Licença Pública Geral GNU * | |
| 22 | - * junto com este programa. Se não, escreva para a Free Software * | |
| 23 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * | |
| 24 | - * 02111-1307, USA. * | |
| 25 | - * * | |
| 26 | - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
| 27 | -require_once ("include/clsBase.inc.php"); | |
| 28 | -require_once ("include/clsCadastro.inc.php"); | |
| 29 | -require_once ("include/clsBanco.inc.php"); | |
| 30 | -require_once( "include/pmieducar/geral.inc.php" ); | |
| 31 | -require_once ("include/clsPDF.inc.php"); | |
| 32 | 2 | |
| 3 | +/** | |
| 4 | + * i-Educar - Sistema de gestão escolar | |
| 5 | + * | |
| 6 | + * Copyright (C) 2006 Prefeitura Municipal de Itajaí | |
| 7 | + * <ctima@itajai.sc.gov.br> | |
| 8 | + * | |
| 9 | + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo | |
| 10 | + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free | |
| 11 | + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) | |
| 12 | + * qualquer versão posterior. | |
| 13 | + * | |
| 14 | + * Este programa é distribuído na expectativa de que seja útil, porém, SEM | |
| 15 | + * NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU | |
| 16 | + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral | |
| 17 | + * do GNU para mais detalhes. | |
| 18 | + * | |
| 19 | + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto | |
| 20 | + * com este programa; se não, escreva para a Free Software Foundation, Inc., no | |
| 21 | + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 22 | + * | |
| 23 | + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
| 24 | + * @category i-Educar | |
| 25 | + * @license @@license@@ | |
| 26 | + * @package iEd_Pmieducar | |
| 27 | + * @since Arquivo disponível desde a versão 1.0.0 | |
| 28 | + * @version $Id$ | |
| 29 | + */ | |
| 30 | + | |
| 31 | +require_once 'include/clsBase.inc.php'; | |
| 32 | +require_once 'include/clsCadastro.inc.php'; | |
| 33 | +require_once 'include/clsBanco.inc.php'; | |
| 34 | +require_once 'include/pmieducar/geral.inc.php'; | |
| 35 | +require_once 'include/clsPDF.inc.php'; | |
| 36 | + | |
| 37 | +/** | |
| 38 | + * clsIndexBase class. | |
| 39 | + * | |
| 40 | + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
| 41 | + * @category i-Educar | |
| 42 | + * @license @@license@@ | |
| 43 | + * @package iEd_Pmieducar | |
| 44 | + * @since Classe disponível desde a versão 1.0.0 | |
| 45 | + * @version @@package_version@@ | |
| 46 | + */ | |
| 33 | 47 | class clsIndexBase extends clsBase |
| 34 | 48 | { |
| 35 | - function Formular() | |
| 36 | - { | |
| 37 | - $this->SetTitulo( "{$this->_instituicao} i-Educar - Relatório Professor Disciplina" ); | |
| 38 | - $this->processoAp = "827"; | |
| 39 | - } | |
| 49 | + function Formular() | |
| 50 | + { | |
| 51 | + $this->SetTitulo($this->_instituicao . ' i-Educar - Relatório Professor Disciplina'); | |
| 52 | + $this->processoAp = 827; | |
| 53 | + } | |
| 40 | 54 | } |
| 41 | 55 | |
| 56 | +/** | |
| 57 | + * indice class. | |
| 58 | + * | |
| 59 | + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
| 60 | + * @category i-Educar | |
| 61 | + * @license @@license@@ | |
| 62 | + * @package iEd_Pmieducar | |
| 63 | + * @since Classe disponível desde a versão 1.0.0 | |
| 64 | + * @version @@package_version@@ | |
| 65 | + */ | |
| 42 | 66 | class indice extends clsCadastro |
| 43 | 67 | { |
| 44 | - | |
| 45 | - | |
| 46 | - /** | |
| 47 | - * Referencia pega da session para o idpes do usuario atual | |
| 48 | - * | |
| 49 | - * @var int | |
| 50 | - */ | |
| 51 | - var $pessoa_logada; | |
| 52 | - | |
| 53 | - | |
| 54 | - var $ref_cod_instituicao; | |
| 55 | - var $ref_cod_escola; | |
| 56 | - var $ref_cod_serie; | |
| 57 | - var $ref_cod_turma; | |
| 58 | - var $ref_cod_disciplina; | |
| 59 | - | |
| 60 | - var $nm_escola; | |
| 61 | - var $nm_instituicao; | |
| 62 | - var $ref_cod_curso; | |
| 63 | - | |
| 64 | - | |
| 65 | - var $pdf; | |
| 66 | - | |
| 67 | - var $meses_do_ano = array( | |
| 68 | - "1" => "JANEIRO" | |
| 69 | - ,"2" => "FEVEREIRO" | |
| 70 | - ,"3" => "MARÇO" | |
| 71 | - ,"4" => "ABRIL" | |
| 72 | - ,"5" => "MAIO" | |
| 73 | - ,"6" => "JUNHO" | |
| 74 | - ,"7" => "JULHO" | |
| 75 | - ,"8" => "AGOSTO" | |
| 76 | - ,"9" => "SETEMBRO" | |
| 77 | - ,"10" => "OUTUBRO" | |
| 78 | - ,"11" => "NOVEMBRO" | |
| 79 | - ,"12" => "DEZEMBRO" | |
| 80 | - ); | |
| 81 | - | |
| 82 | - | |
| 83 | - function Inicializar() | |
| 84 | - { | |
| 85 | - $retorno = "Novo"; | |
| 86 | - @session_start(); | |
| 87 | - $this->pessoa_logada = $_SESSION['id_pessoa']; | |
| 88 | - @session_write_close(); | |
| 89 | - | |
| 90 | - $obj_permissoes = new clsPermissoes(); | |
| 91 | - | |
| 92 | - | |
| 93 | - return $retorno; | |
| 94 | - } | |
| 95 | - | |
| 96 | - function Gerar() | |
| 97 | - { | |
| 98 | - | |
| 99 | - $obj_permissoes = new clsPermissoes(); | |
| 100 | - $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); | |
| 101 | - | |
| 102 | - if($_POST){ | |
| 103 | - foreach ($_POST as $key => $value) { | |
| 104 | - $this->$key = $value; | |
| 105 | - | |
| 106 | - } | |
| 107 | - } | |
| 108 | - | |
| 109 | - $get_escola = true; | |
| 110 | - $exibe_nm_escola = true; | |
| 111 | - $get_curso = true; | |
| 112 | - $escola_obrigatorio = false; | |
| 113 | - $curso_obrigatorio = true; | |
| 114 | - $instituicao_obrigatorio = true; | |
| 115 | - | |
| 116 | - include("include/pmieducar/educar_campo_lista.php"); | |
| 117 | - | |
| 118 | - $this->campoLista("ref_cod_disciplina","Disciplina",array('' => 'Selecione'), $this->ref_cod_disciplina,"",false,"","",false,false); | |
| 119 | - | |
| 120 | - | |
| 121 | - if($this->ref_cod_escola) | |
| 122 | - $this->ref_ref_cod_escola = $this->ref_cod_escola; | |
| 123 | - | |
| 124 | - $this->url_cancelar = "educar_index.php"; | |
| 125 | - $this->nome_url_cancelar = "Cancelar"; | |
| 126 | - | |
| 127 | - $this->acao_enviar = 'acao2()'; | |
| 128 | - $this->acao_executa_submit = false; | |
| 129 | - | |
| 130 | - } | |
| 68 | + var $pessoa_logada; | |
| 69 | + | |
| 70 | + var $ref_cod_instituicao; | |
| 71 | + var $ref_cod_escola; | |
| 72 | + var $ref_cod_serie; | |
| 73 | + var $ref_cod_turma; | |
| 74 | + var $ref_cod_disciplina; | |
| 75 | + | |
| 76 | + var $nm_escola; | |
| 77 | + var $nm_instituicao; | |
| 78 | + var $ref_cod_curso; | |
| 79 | + | |
| 80 | + var $pdf; | |
| 81 | + | |
| 82 | + var $meses_do_ano = array( | |
| 83 | + 1 => 'JANEIRO', | |
| 84 | + 2 => 'FEVEREIRO', | |
| 85 | + 3 => 'MARÇO', | |
| 86 | + 4 => 'ABRIL', | |
| 87 | + 5 => 'MAIO', | |
| 88 | + 6 => 'JUNHO', | |
| 89 | + 7 => 'JULHO', | |
| 90 | + 8 => 'AGOSTO', | |
| 91 | + 9 => 'SETEMBRO', | |
| 92 | + 10 => 'OUTUBRO', | |
| 93 | + 11 => 'NOVEMBRO', | |
| 94 | + 12 => 'DEZEMBRO' | |
| 95 | + ); | |
| 96 | + | |
| 97 | + function Inicializar() | |
| 98 | + { | |
| 99 | + $retorno = 'Novo'; | |
| 100 | + @session_start(); | |
| 101 | + $this->pessoa_logada = $_SESSION['id_pessoa']; | |
| 102 | + @session_write_close(); | |
| 103 | + | |
| 104 | + $obj_permissoes = new clsPermissoes(); | |
| 105 | + | |
| 106 | + return $retorno; | |
| 107 | + } | |
| 108 | + | |
| 109 | + function Gerar() | |
| 110 | + { | |
| 111 | + $obj_permissoes = new clsPermissoes(); | |
| 112 | + $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); | |
| 113 | + | |
| 114 | + if ($_POST){ | |
| 115 | + foreach ($_POST as $key => $value) { | |
| 116 | + $this->$key = $value; | |
| 117 | + } | |
| 118 | + } | |
| 119 | + | |
| 120 | + $get_escola = TRUE; | |
| 121 | + $exibe_nm_escola = TRUE; | |
| 122 | + $get_curso = TRUE; | |
| 123 | + $escola_obrigatorio = FALSE; | |
| 124 | + $curso_obrigatorio = TRUE; | |
| 125 | + $instituicao_obrigatorio = TRUE; | |
| 126 | + | |
| 127 | + include 'include/pmieducar/educar_campo_lista.php'; | |
| 128 | + | |
| 129 | + $this->campoLista('ref_cod_disciplina', 'Disciplina', | |
| 130 | + array('' => 'Selecione'), $this->ref_cod_disciplina, '', FALSE, '', '', | |
| 131 | + FALSE, FALSE | |
| 132 | + ); | |
| 133 | + | |
| 134 | + if ($this->ref_cod_escola) { | |
| 135 | + $this->ref_ref_cod_escola = $this->ref_cod_escola; | |
| 136 | + } | |
| 137 | + | |
| 138 | + $this->url_cancelar = 'educar_index.php'; | |
| 139 | + $this->nome_url_cancelar = 'Cancelar'; | |
| 140 | + | |
| 141 | + $this->acao_enviar = 'acao2()'; | |
| 142 | + $this->acao_executa_submit = FALSE; | |
| 143 | + } | |
| 131 | 144 | |
| 132 | 145 | } |
| 133 | 146 | |
| 134 | -// cria uma extensao da classe base | |
| 147 | +// Instancia objeto de página | |
| 135 | 148 | $pagina = new clsIndexBase(); |
| 136 | -// cria o conteudo | |
| 149 | + | |
| 150 | +// Instancia objeto de conteúdo | |
| 137 | 151 | $miolo = new indice(); |
| 138 | -// adiciona o conteudo na clsBase | |
| 139 | -$pagina->addForm( $miolo ); | |
| 140 | -// gera o html | |
| 141 | -$pagina->MakeAll(); | |
| 142 | 152 | |
| 153 | +// Atribui o conteúdo à página | |
| 154 | +$pagina->addForm($miolo); | |
| 143 | 155 | |
| 156 | +// Gera o código HTML | |
| 157 | +$pagina->MakeAll(); | |
| 144 | 158 | ?> |
| 145 | -<script> | |
| 146 | - | |
| 147 | - | |
| 159 | +<script type="text/javascript"> | |
| 148 | 160 | function getDisciplina() |
| 149 | 161 | { |
| 162 | + var campoInstituicao = document.getElementById('ref_cod_instituicao').value; | |
| 163 | + var campoCurso = document.getElementById('ref_cod_curso').value; | |
| 150 | 164 | |
| 151 | - var campoInstituicao = document.getElementById('ref_cod_instituicao').value; | |
| 152 | - var campoCurso = document.getElementById('ref_cod_curso').value; | |
| 153 | - | |
| 154 | - var xml1 = new ajax(getDisciplina_XML); | |
| 155 | - strURL = "educar_disciplina_xml.php?cur="+campoCurso; | |
| 165 | + var xml1 = new ajax(getDisciplina_XML); | |
| 166 | + strURL = 'educar_disciplina_xml.php?cur=' + campoCurso; | |
| 156 | 167 | |
| 157 | - xml1.envia(strURL); | |
| 168 | + xml1.envia(strURL); | |
| 158 | 169 | } |
| 159 | 170 | |
| 160 | 171 | function getDisciplina_XML(xml) |
| 161 | 172 | { |
| 162 | - var disciplinas = xml.getElementsByTagName( "disciplina" ); | |
| 163 | - var campoDisciplina = document.getElementById( 'ref_cod_disciplina' ); | |
| 164 | - | |
| 165 | - campoDisciplina.length = 1; | |
| 166 | - | |
| 167 | - for ( var j = 0; j < disciplinas.length; j++ ) | |
| 168 | - { | |
| 173 | + var disciplinas = xml.getElementsByTagName('disciplina'); | |
| 174 | + var campoDisciplina = document.getElementById('ref_cod_disciplina'); | |
| 169 | 175 | |
| 170 | - campoDisciplina.options[campoDisciplina.options.length] = new Option( disciplinas[j].firstChild.nodeValue, disciplinas[j].getAttribute('cod_disciplina'), false, false ); | |
| 176 | + campoDisciplina.length = 1; | |
| 171 | 177 | |
| 172 | - } | |
| 178 | + for (var j = 0; j < disciplinas.length; j++) { | |
| 179 | + campoDisciplina.options[campoDisciplina.options.length] = | |
| 180 | + new Option(disciplinas[j].firstChild.nodeValue, | |
| 181 | + disciplinas[j].getAttribute('cod_disciplina'), false, false | |
| 182 | + ); | |
| 183 | + } | |
| 173 | 184 | |
| 174 | 185 | } |
| 175 | 186 | |
| 176 | - | |
| 177 | 187 | document.getElementById('ref_cod_curso').onchange = function() |
| 178 | 188 | { |
| 179 | - getDisciplina(); | |
| 189 | + getDisciplina(); | |
| 180 | 190 | } |
| 181 | 191 | |
| 182 | 192 | document.getElementById('ref_cod_escola').onchange = function() |
| 183 | 193 | { |
| 194 | + if (document.getElementById('ref_cod_escola').value) { | |
| 195 | + getEscolaCurso(); | |
| 196 | + } | |
| 197 | + else { | |
| 198 | + getCurso(); | |
| 199 | + } | |
| 200 | +} | |
| 184 | 201 | |
| 185 | - if(document.getElementById('ref_cod_escola').value) | |
| 186 | - getEscolaCurso(); | |
| 187 | - else | |
| 188 | - getCurso(); | |
| 202 | +var func = function() | |
| 203 | +{ | |
| 204 | + document.getElementById('btn_enviar').disabled= false; | |
| 205 | +}; | |
| 189 | 206 | |
| 207 | +if (window.addEventListener) { | |
| 208 | + // Mozilla | |
| 209 | + document.getElementById('btn_enviar').addEventListener('click', func, false); | |
| 210 | +} | |
| 211 | +else if (window.attachEvent) { | |
| 212 | + // IE | |
| 213 | + document.getElementById('btn_enviar').attachEvent('onclick', func); | |
| 190 | 214 | } |
| 191 | - | |
| 192 | -var func = function(){document.getElementById('btn_enviar').disabled= false;}; | |
| 193 | -if( window.addEventListener ) { | |
| 194 | - //mozilla | |
| 195 | - document.getElementById('btn_enviar').addEventListener('click',func,false); | |
| 196 | - } else if ( window.attachEvent ) { | |
| 197 | - //ie | |
| 198 | - document.getElementById('btn_enviar').attachEvent('onclick',func); | |
| 199 | - } | |
| 200 | 215 | |
| 201 | 216 | function acao2() |
| 202 | 217 | { |
| 203 | - | |
| 204 | - if(!acao()) | |
| 205 | - return; | |
| 206 | - | |
| 207 | - showExpansivelImprimir(400, 200,'',[], "Relatório Professor por Disciplina"); | |
| 208 | - | |
| 209 | - document.formcadastro.target = 'miolo_'+(DOM_divs.length-1); | |
| 210 | - | |
| 211 | - document.getElementById( 'btn_enviar' ).disabled =false; | |
| 212 | - | |
| 213 | - document.formcadastro.submit(); | |
| 214 | - | |
| 218 | + if (!acao()) { | |
| 219 | + return; | |
| 220 | + } | |
| 221 | + | |
| 222 | + showExpansivelImprimir(400, 200, '', [], 'Relatório Professor por Disciplina'); | |
| 223 | + document.formcadastro.target = 'miolo_' + (DOM_divs.length-1); | |
| 224 | + document.getElementById( 'btn_enviar' ).disabled = false; | |
| 225 | + document.formcadastro.submit(); | |
| 215 | 226 | } |
| 216 | 227 | |
| 217 | 228 | document.formcadastro.action = 'educar_relatorio_professor_disciplina_proc.php'; |
| 218 | 229 | -</script> |
| 230 | +</script> | |
| 219 | 231 | \ No newline at end of file | ... | ... |
ieducar/intranet/educar_relatorio_professor_disciplina_proc.php
| 1 | 1 | <?php |
| 2 | -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
| 3 | - * * | |
| 4 | - * @author Prefeitura Municipal de Itajaí * | |
| 5 | - * @updated 29/03/2007 * | |
| 6 | - * Pacote: i-PLB Software Público Livre e Brasileiro * | |
| 7 | - * * | |
| 8 | - * Copyright (C) 2006 PMI - Prefeitura Municipal de Itajaí * | |
| 9 | - * ctima@itajai.sc.gov.br * | |
| 10 | - * * | |
| 11 | - * Este programa é software livre, você pode redistribuí-lo e/ou * | |
| 12 | - * modificá-lo sob os termos da Licença Pública Geral GNU, conforme * | |
| 13 | - * publicada pela Free Software Foundation, tanto a versão 2 da * | |
| 14 | - * Licença como (a seu critério) qualquer versão mais nova. * | |
| 15 | - * * | |
| 16 | - * Este programa é distribuído na expectativa de ser útil, mas SEM * | |
| 17 | - * QUALQUER GARANTIA. Sem mesmo a garantia implícita de COMERCIALI- * | |
| 18 | - * ZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM PARTICULAR. Con- * | |
| 19 | - * sulte a Licença Pública Geral GNU para obter mais detalhes. * | |
| 20 | - * * | |
| 21 | - * Você deve ter recebido uma cópia da Licença Pública Geral GNU * | |
| 22 | - * junto com este programa. Se não, escreva para a Free Software * | |
| 23 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * | |
| 24 | - * 02111-1307, USA. * | |
| 25 | - * * | |
| 26 | - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
| 27 | -require_once ("include/clsBase.inc.php"); | |
| 28 | -require_once ("include/clsCadastro.inc.php"); | |
| 29 | -require_once ("include/clsBanco.inc.php"); | |
| 30 | -require_once( "include/pmieducar/geral.inc.php" ); | |
| 31 | -require_once ("include/relatorio.inc.php"); | |
| 32 | 2 | |
| 3 | +/** | |
| 4 | + * i-Educar - Sistema de gestão escolar | |
| 5 | + * | |
| 6 | + * Copyright (C) 2006 Prefeitura Municipal de Itajaí | |
| 7 | + * <ctima@itajai.sc.gov.br> | |
| 8 | + * | |
| 9 | + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo | |
| 10 | + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free | |
| 11 | + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) | |
| 12 | + * qualquer versão posterior. | |
| 13 | + * | |
| 14 | + * Este programa é distribuído na expectativa de que seja útil, porém, SEM | |
| 15 | + * NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU | |
| 16 | + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral | |
| 17 | + * do GNU para mais detalhes. | |
| 18 | + * | |
| 19 | + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto | |
| 20 | + * com este programa; se não, escreva para a Free Software Foundation, Inc., no | |
| 21 | + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 22 | + * | |
| 23 | + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
| 24 | + * @category i-Educar | |
| 25 | + * @license @@license@@ | |
| 26 | + * @package iEd_Pmieducar | |
| 27 | + * @since Arquivo disponível desde a versão 1.0.0 | |
| 28 | + * @version $Id$ | |
| 29 | + */ | |
| 30 | + | |
| 31 | +require_once 'include/clsBase.inc.php'; | |
| 32 | +require_once 'include/clsCadastro.inc.php'; | |
| 33 | +require_once 'include/clsBanco.inc.php'; | |
| 34 | +require_once 'include/pmieducar/geral.inc.php'; | |
| 35 | +require_once 'include/relatorio.inc.php'; | |
| 36 | + | |
| 37 | +/** | |
| 38 | + * clsIndexBase class. | |
| 39 | + * | |
| 40 | + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
| 41 | + * @category i-Educar | |
| 42 | + * @license @@license@@ | |
| 43 | + * @package iEd_Pmieducar | |
| 44 | + * @since Classe disponível desde a versão 1.0.0 | |
| 45 | + * @version @@package_version@@ | |
| 46 | + */ | |
| 33 | 47 | class clsIndexBase extends clsBase |
| 34 | 48 | { |
| 35 | - function Formular() | |
| 36 | - { | |
| 37 | - $this->SetTitulo( " i-Educar - Relação Professores Disciplinas" ); | |
| 38 | - $this->processoAp = "827"; | |
| 39 | - $this->renderMenu = false; | |
| 40 | - $this->renderMenuSuspenso = false; | |
| 41 | - } | |
| 49 | + function Formular() | |
| 50 | + { | |
| 51 | + $this->SetTitulo('i-Educar - Relação Professores Disciplinas'); | |
| 52 | + $this->processoAp = 827; | |
| 53 | + $this->renderMenu = FALSE; | |
| 54 | + $this->renderMenuSuspenso = FALSE; | |
| 55 | + } | |
| 42 | 56 | } |
| 43 | 57 | |
| 58 | +/** | |
| 59 | + * indice class. | |
| 60 | + * | |
| 61 | + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
| 62 | + * @category i-Educar | |
| 63 | + * @license @@license@@ | |
| 64 | + * @package iEd_Pmieducar | |
| 65 | + * @since Classe disponível desde a versão 1.0.0 | |
| 66 | + * @version @@package_version@@ | |
| 67 | + */ | |
| 44 | 68 | class indice extends clsCadastro |
| 45 | 69 | { |
| 46 | - | |
| 47 | - | |
| 48 | - /** | |
| 49 | - * Referencia pega da session para o idpes do usuario atual | |
| 50 | - * | |
| 51 | - * @var int | |
| 52 | - */ | |
| 53 | - var $pessoa_logada; | |
| 54 | - | |
| 55 | - | |
| 56 | - var $ref_cod_instituicao; | |
| 57 | - var $ref_cod_escola; | |
| 58 | - var $ref_cod_curso; | |
| 59 | - var $ref_cod_disciplina; | |
| 60 | - | |
| 61 | - var $get_link; | |
| 62 | - | |
| 63 | - | |
| 64 | - function renderHTML() | |
| 65 | - { | |
| 66 | - | |
| 67 | - if($_POST){ | |
| 68 | - foreach ($_POST as $key => $value) { | |
| 69 | - $this->$key = $value; | |
| 70 | - | |
| 71 | - } | |
| 72 | - } | |
| 73 | - | |
| 74 | - if($this->ref_ref_cod_serie) | |
| 75 | - $this->ref_cod_serie = $this->ref_ref_cod_serie; | |
| 76 | - | |
| 77 | - | |
| 78 | - $fonte = 'arial'; | |
| 79 | - $corTexto = '#000000'; | |
| 80 | - | |
| 81 | - /*if(empty($this->ref_cod_turma)) | |
| 82 | - { | |
| 83 | - echo '<script> | |
| 84 | - alert("Erro ao gerar relatório!\nNenhuma turma selecionada!"); | |
| 85 | - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1)); | |
| 86 | - </script>'; | |
| 87 | - return true; | |
| 88 | - }*/ | |
| 89 | - | |
| 90 | - $obj_instituicao = new clsPmieducarInstituicao($det_escola['ref_cod_instituicao']); | |
| 91 | - $det_instituicao = $obj_instituicao->detalhe(); | |
| 92 | - $this->nm_instituicao = $det_instituicao['nm_instituicao']; | |
| 93 | - | |
| 94 | - if($this->ref_cod_escola) | |
| 95 | - { | |
| 96 | - | |
| 97 | - $obj_escola = new clsPmieducarEscola($this->ref_cod_escola); | |
| 98 | - $det_escola = $obj_escola->detalhe(); | |
| 99 | - $this->nm_escola = $det_escola['nome']; | |
| 100 | - } | |
| 101 | - | |
| 102 | - $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); | |
| 103 | - $det_curso = $obj_curso->detalhe(); | |
| 104 | - $this->nm_curso = $det_curso['nm_curso']; | |
| 105 | - | |
| 106 | - if($this->ref_cod_disciplina) | |
| 107 | - $where = " AND cod_disciplina = {$this->ref_cod_disciplina}"; | |
| 108 | - | |
| 109 | - if($this->ref_cod_escola) | |
| 110 | - { | |
| 111 | - $sql = "SELECT cod_servidor | |
| 112 | - ,nome | |
| 113 | - ,sa.carga_horaria | |
| 114 | - ,CASE periodo | |
| 115 | - WHEN 1 THEN 'Matutino' | |
| 116 | - WHEN 2 THEN 'Vespertino' | |
| 117 | - ELSE 'Noturno' | |
| 118 | - END as turno | |
| 119 | - ,nm_disciplina | |
| 120 | - FROM pmieducar.servidor s | |
| 121 | - ,pmieducar.servidor_disciplina sd | |
| 122 | - ,pmieducar.servidor_alocacao sa | |
| 123 | - ,pmieducar.disciplina | |
| 124 | - ,cadastro.pessoa | |
| 125 | - WHERE cod_servidor = sd.ref_cod_servidor | |
| 126 | - AND cod_servidor = sa.ref_cod_servidor | |
| 127 | - AND ref_cod_instituicao = sd.ref_ref_cod_instituicao | |
| 128 | - AND ref_cod_instituicao = sa.ref_ref_cod_instituicao | |
| 129 | - AND cod_disciplina = ref_cod_disciplina | |
| 130 | - AND cod_servidor = idpes | |
| 131 | - AND ref_cod_instituicao = {$this->ref_cod_instituicao} | |
| 132 | - AND ref_cod_escola = {$this->ref_cod_escola} | |
| 133 | - $where | |
| 134 | - AND sa.ativo = 1 | |
| 135 | - AND s.ativo = 1 | |
| 136 | - ORDER BY nome | |
| 137 | - ,nm_disciplina | |
| 138 | - | |
| 139 | - "; | |
| 140 | - } | |
| 141 | - else | |
| 142 | - { | |
| 143 | - | |
| 144 | - /*$sql = "SELECT cod_servidor | |
| 145 | - ,nome | |
| 146 | - ,CAST(s.carga_horaria || ' hour' as interval) as carga_horaria | |
| 147 | - ,nm_disciplina | |
| 148 | - FROM pmieducar.servidor s | |
| 149 | - ,pmieducar.servidor_disciplina sd | |
| 150 | - ,pmieducar.disciplina | |
| 151 | - ,cadastro.pessoa | |
| 152 | - WHERE cod_servidor = sd.ref_cod_servidor | |
| 153 | - AND cod_servidor = idpes | |
| 154 | - AND ref_cod_instituicao = sd.ref_ref_cod_instituicao | |
| 155 | - AND cod_disciplina = ref_cod_disciplina | |
| 156 | - AND ref_cod_instituicao = {$this->ref_cod_instituicao} | |
| 157 | - $where | |
| 158 | - AND s.ativo = 1 | |
| 159 | - ORDER BY nome | |
| 160 | - ,nm_disciplina | |
| 161 | - ";*/ | |
| 162 | - $sql = "SELECT cod_servidor | |
| 163 | - ,nome | |
| 164 | - ,CAST(s.carga_horaria || ' hour' as interval) as carga_horaria | |
| 165 | - ,nm_disciplina | |
| 166 | - ,cod_disciplina | |
| 167 | - ,CASE periodo | |
| 168 | - WHEN 1 THEN 'Matutino' | |
| 169 | - WHEN 2 THEN 'Vespertino' | |
| 170 | - WHEN 3 THEN 'Noturno' | |
| 171 | - END as turno | |
| 172 | - FROM pmieducar.servidor s | |
| 173 | - ,pmieducar.servidor_disciplina sd | |
| 174 | - ,pmieducar.disciplina | |
| 175 | - ,cadastro.pessoa | |
| 176 | - ,pmieducar.servidor_alocacao sa | |
| 177 | - WHERE cod_servidor = sd.ref_cod_servidor | |
| 178 | - AND cod_servidor = idpes | |
| 179 | - AND ref_cod_instituicao = sd.ref_ref_cod_instituicao | |
| 180 | - AND cod_disciplina = ref_cod_disciplina | |
| 181 | - AND ref_cod_instituicao = {$this->ref_cod_instituicao} | |
| 182 | - $where | |
| 183 | - AND s.ativo = 1 | |
| 184 | - AND cod_servidor = sa.ref_cod_servidor | |
| 185 | - ORDER BY nome | |
| 186 | - ,nm_disciplina | |
| 187 | - "; | |
| 188 | - } | |
| 189 | - | |
| 190 | - | |
| 191 | - $db = new clsBanco(); | |
| 192 | - | |
| 193 | - $db->Consulta($sql); | |
| 194 | - | |
| 195 | - $nm_disciplina = null; | |
| 196 | - if($db->Num_Linhas()) | |
| 197 | - { | |
| 198 | - | |
| 199 | - $relatorio = new relatorios("Professores por Disciplina", 210, false, "Professores por Disciplina", "A4", "{$this->nm_instituicao}\n{$this->nm_escola}\n{$this->nm_curso}"); | |
| 200 | - $relatorio->setMargem(20,20,50,50); | |
| 201 | - $relatorio->exibe_produzido_por = false; | |
| 202 | - | |
| 203 | - while ($db->ProximoRegistro()) | |
| 204 | - { | |
| 205 | - $registro = $db->Tupla(); | |
| 206 | - | |
| 207 | - if($registro['nm_disciplina'] != $nm_disciplina) | |
| 208 | - { | |
| 209 | - $relatorio->novalinha( array( "{$registro['nm_disciplina']}"),0,16,true,"arial",array( 75, 330, 100),"#515151","#d3d3d3","#FFFFFF",false,false); | |
| 210 | - | |
| 211 | - if($this->ref_cod_escola) | |
| 212 | - { | |
| 213 | - $relatorio->novalinha( array( "Matrícula","Nome", "Carga Horária", "Turno"),0,16,true,"arial",array( 75, 320, 100),"#515151","#d3d3d3","#FFFFFF",false,true); | |
| 214 | - } | |
| 215 | - else | |
| 216 | - { | |
| 217 | -// $relatorio->novalinha( array( "Matrícula","Nome", "Carga Horária"),0,16,true,"arial",array( 75, 330, 100),"#515151","#d3d3d3","#FFFFFF",false,true); | |
| 218 | - $relatorio->novalinha( array( "Matrícula","Nome", "Carga Horária", "Turno"),0,16,true,"arial",array( 75, 320, 100),"#515151","#d3d3d3","#FFFFFF",false,true); | |
| 219 | - } | |
| 220 | - $nm_disciplina = $registro['nm_disciplina']; | |
| 221 | - } | |
| 222 | - $relatorio->novalinha( array( "{$registro['cod_servidor']}","{$registro['nome']}", "{$registro['carga_horaria']}", "{$registro['turno']}"),0,16,false,"arial",array( 75, 330, 80),"#515151","#d3d3d3","#FFFFFF",false,false); | |
| 223 | - } | |
| 224 | - | |
| 225 | - /*while ($db->ProximoRegistro()) | |
| 226 | - { | |
| 227 | - $registro = $db->Tupla(); | |
| 228 | - | |
| 229 | - if($registro['nm_disciplina'] != $nm_disciplina) | |
| 230 | - { | |
| 231 | - $relatorio->novalinha( array( "{$registro['nm_disciplina']}"),0,16,true,"arial",array( 75, 330, 100),"#515151","#d3d3d3","#FFFFFF",false,false); | |
| 232 | - | |
| 233 | - if($this->ref_cod_escola) | |
| 234 | - { | |
| 235 | - $relatorio->novalinha( array( "Matrícula","Nome", "Carga Horária", "Turno"),0,16,true,"arial",array( 75, 320, 100),"#515151","#d3d3d3","#FFFFFF",false,true); | |
| 236 | - } | |
| 237 | - else | |
| 238 | - { | |
| 239 | - | |
| 240 | - $relatorio->novalinha( array( "Matrícula","Nome", "Carga Horária"),0,16,true,"arial",array( 75, 330, 100),"#515151","#d3d3d3","#FFFFFF",false,true); | |
| 241 | -// $relatorio->novalinha( array( "Matrícula","Nome", "Carga Horária", "Turno"),0,16,true,"arial",array( 75, 320, 100),"#515151","#d3d3d3","#FFFFFF",false,true); | |
| 242 | - } | |
| 243 | - $nm_disciplina = $registro['nm_disciplina']; | |
| 244 | - } | |
| 245 | - /*if (!$this->ref_cod_escola) | |
| 246 | - { | |
| 247 | - $sql_turno = "SELECT CASE periodo | |
| 248 | - WHEN 1 THEN 'Matutino' | |
| 249 | - WHEN 2 THEN 'Vespertino' | |
| 250 | - ELSE 'Noturno' | |
| 251 | - END as turno | |
| 252 | - FROM | |
| 253 | - pmieducar.servidor_alocacao | |
| 254 | - WHERE | |
| 255 | - ref_cod_servidor = {$registro["cod_servidor"]} | |
| 256 | - AND ativo = 1"; | |
| 257 | - $db2 = new clsBanco(); | |
| 258 | - $registro["turno"] = $db2->CampoUnico($sql_turno); | |
| 259 | - }*/ | |
| 260 | -// $relatorio->novalinha( array( "{$registro['cod_servidor']}","{$registro['nome']}", "{$registro['carga_horaria']}", "{$registro['turno']}"),0,16,false,"arial",array( 75, 330, 80),"#515151","#d3d3d3","#FFFFFF",false,false); | |
| 261 | -// } | |
| 262 | - | |
| 263 | - $this->get_link = $relatorio->fechaPdf(); | |
| 264 | - } | |
| 265 | - | |
| 266 | - | |
| 267 | - echo "<script>window.onload=function(){parent.EscondeDiv('LoadImprimir');window.location='download.php?filename=".$this->get_link."'}</script>"; | |
| 268 | - | |
| 269 | - 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> | |
| 270 | - <span style='font-size: 10px;'>Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br> | |
| 271 | - | |
| 272 | - Clique na Imagem para Baixar o instalador<br><br> | |
| 273 | - <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> | |
| 274 | - </span> | |
| 275 | - </center>"; | |
| 276 | - } | |
| 277 | - | |
| 278 | - | |
| 279 | - function Editar() | |
| 280 | - { | |
| 281 | - return false; | |
| 282 | - } | |
| 283 | - | |
| 284 | - function Excluir() | |
| 285 | - { | |
| 286 | - return false; | |
| 287 | - } | |
| 288 | - | |
| 70 | + var $pessoa_logada; | |
| 71 | + | |
| 72 | + var $ref_cod_instituicao; | |
| 73 | + var $ref_cod_escola; | |
| 74 | + var $ref_cod_curso; | |
| 75 | + var $ref_cod_disciplina; | |
| 76 | + | |
| 77 | + var $get_link; | |
| 78 | + | |
| 79 | + function renderHTML() | |
| 80 | + { | |
| 81 | + if ($_POST) { | |
| 82 | + foreach ($_POST as $key => $value) { | |
| 83 | + $this->$key = $value; | |
| 84 | + } | |
| 85 | + } | |
| 86 | + | |
| 87 | + if ($this->ref_ref_cod_serie) { | |
| 88 | + $this->ref_cod_serie = $this->ref_ref_cod_serie; | |
| 89 | + } | |
| 90 | + | |
| 91 | + $fonte = 'arial'; | |
| 92 | + $corTexto = '#000000'; | |
| 93 | + | |
| 94 | + $obj_instituicao = new clsPmieducarInstituicao($det_escola['ref_cod_instituicao']); | |
| 95 | + $det_instituicao = $obj_instituicao->detalhe(); | |
| 96 | + $this->nm_instituicao = $det_instituicao['nm_instituicao']; | |
| 97 | + | |
| 98 | + if($this->ref_cod_escola) { | |
| 99 | + $obj_escola = new clsPmieducarEscola($this->ref_cod_escola); | |
| 100 | + $det_escola = $obj_escola->detalhe(); | |
| 101 | + $this->nm_escola = $det_escola['nome']; | |
| 102 | + } | |
| 103 | + | |
| 104 | + $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); | |
| 105 | + $det_curso = $obj_curso->detalhe(); | |
| 106 | + $this->nm_curso = $det_curso['nm_curso']; | |
| 107 | + | |
| 108 | + if ($this->ref_cod_disciplina) { | |
| 109 | + $where = ' AND cod_disciplina = ' . $this->ref_cod_disciplina; | |
| 110 | + } | |
| 111 | + | |
| 112 | + if ($this->ref_cod_escola) { | |
| 113 | + $sql = sprintf(' | |
| 114 | + SELECT | |
| 115 | + cod_servidor, | |
| 116 | + nome, | |
| 117 | + sa.carga_horaria, | |
| 118 | + CASE periodo | |
| 119 | + WHEN 1 THEN \'Matutino\' | |
| 120 | + WHEN 2 THEN \'Vespertino\' | |
| 121 | + ELSE \'Noturno\' | |
| 122 | + END AS turno, | |
| 123 | + nm_disciplina | |
| 124 | + FROM | |
| 125 | + pmieducar.servidor s, | |
| 126 | + pmieducar.servidor_disciplina sd, | |
| 127 | + pmieducar.servidor_alocacao sa, | |
| 128 | + pmieducar.disciplina, | |
| 129 | + cadastro.pessoa | |
| 130 | + WHERE | |
| 131 | + cod_servidor = sd.ref_cod_servidor | |
| 132 | + AND cod_servidor = sa.ref_cod_servidor | |
| 133 | + AND ref_cod_instituicao = sd.ref_ref_cod_instituicao | |
| 134 | + AND ref_cod_instituicao = sa.ref_ref_cod_instituicao | |
| 135 | + AND cod_disciplina = ref_cod_disciplina | |
| 136 | + AND cod_servidor = idpes | |
| 137 | + AND ref_cod_instituicao = \'%d\' | |
| 138 | + AND ref_cod_escola = \'%d\' | |
| 139 | + %s | |
| 140 | + AND sa.ativo = 1 | |
| 141 | + AND s.ativo = 1 | |
| 142 | + ORDER BY | |
| 143 | + nome, nm_disciplina', $this->ref_cod_instituicao, $this->ref_cod_escola, $where); | |
| 144 | + } | |
| 145 | + else { | |
| 146 | + $sql = sprintf(' | |
| 147 | + SELECT | |
| 148 | + cod_servidor, | |
| 149 | + nome, | |
| 150 | + CAST(s.carga_horaria || \' hour\' AS interval) AS carga_horaria, | |
| 151 | + nm_disciplina, | |
| 152 | + cod_disciplina, | |
| 153 | + CASE periodo | |
| 154 | + WHEN 1 THEN \'Matutino\' | |
| 155 | + WHEN 2 THEN \'Vespertino\' | |
| 156 | + WHEN 3 THEN \'Noturno\' | |
| 157 | + END as turno | |
| 158 | + FROM | |
| 159 | + pmieducar.servidor s, | |
| 160 | + pmieducar.servidor_disciplina sd, | |
| 161 | + pmieducar.disciplina, | |
| 162 | + cadastro.pessoa, | |
| 163 | + pmieducar.servidor_alocacao sa | |
| 164 | + WHERE | |
| 165 | + cod_servidor = sd.ref_cod_servidor | |
| 166 | + AND cod_servidor = idpes | |
| 167 | + AND ref_cod_instituicao = sd.ref_ref_cod_instituicao | |
| 168 | + AND cod_disciplina = ref_cod_disciplina | |
| 169 | + AND ref_cod_instituicao = \'%d\' | |
| 170 | + %s | |
| 171 | + AND s.ativo = 1 | |
| 172 | + AND cod_servidor = sa.ref_cod_servidor | |
| 173 | + ORDER BY | |
| 174 | + nome, nm_disciplina', $this->ref_cod_instituicao, $where); | |
| 175 | + } | |
| 176 | + | |
| 177 | + $db = new clsBanco(); | |
| 178 | + | |
| 179 | + $db->Consulta($sql); | |
| 180 | + | |
| 181 | + $nm_disciplina = NULL; | |
| 182 | + | |
| 183 | + if ($db->Num_Linhas()) { | |
| 184 | + $relatorio = new relatorios('Professores por Disciplina', 210, FALSE, | |
| 185 | + 'Professores por Disciplina', 'A4', | |
| 186 | + "{$this->nm_instituicao}\n{$this->nm_escola}\n{$this->nm_curso}"); | |
| 187 | + | |
| 188 | + $relatorio->setMargem(20, 20, 50, 50); | |
| 189 | + $relatorio->exibe_produzido_por = FALSE; | |
| 190 | + | |
| 191 | + while ($db->ProximoRegistro()) { | |
| 192 | + $registro = $db->Tupla(); | |
| 193 | + if ($registro['nm_disciplina'] != $nm_disciplina) { | |
| 194 | + $relatorio->novalinha(array($registro['nm_disciplina']), 0, 16, TRUE, | |
| 195 | + 'arial', array(75, 330, 100), '#515151', '#d3d3d3', '#FFFFFF', FALSE, FALSE); | |
| 196 | + | |
| 197 | + if ($this->ref_cod_escola) { | |
| 198 | + $relatorio->novalinha(array('Matrícula', 'Nome', 'Carga Horária', 'Turno'), | |
| 199 | + 0, 16, TRUE, 'arial', array(75, 320, 100), '#515151', '#d3d3d3', | |
| 200 | + '#FFFFFF', FALSE, TRUE); | |
| 201 | + } | |
| 202 | + else { | |
| 203 | + $relatorio->novalinha(array('Matrícula', 'Nome', 'Carga Horária', 'Turno'), | |
| 204 | + 0, 16, TRUE, 'arial', array(75, 320, 100), '#515151', '#d3d3d3', | |
| 205 | + '#FFFFFF', FALSE, TRUE); | |
| 206 | + } | |
| 207 | + | |
| 208 | + $nm_disciplina = $registro['nm_disciplina']; | |
| 209 | + } | |
| 210 | + | |
| 211 | + $relatorio->novalinha(array($registro['cod_servidor'], $registro['nome'], | |
| 212 | + $registro['carga_horaria'], $registro['turno']), 0, 16, FALSE, 'arial', | |
| 213 | + array(75, 330, 80), '#515151', '#d3d3d3', '#FFFFFF', FALSE, FALSE); | |
| 214 | + } | |
| 215 | + | |
| 216 | + $this->get_link = $relatorio->fechaPdf(); | |
| 217 | + } | |
| 218 | + | |
| 219 | + | |
| 220 | + echo sprintf(' | |
| 221 | + <script> | |
| 222 | + window.onload=function() | |
| 223 | + { | |
| 224 | + parent.EscondeDiv("LoadImprimir"); | |
| 225 | + window.location="download.php?filename=%s" | |
| 226 | + } | |
| 227 | + </script>', $this->get_link); | |
| 228 | + | |
| 229 | + echo sprintf(' | |
| 230 | + <html> | |
| 231 | + <center>Se o download não iniciar automaticamente <br /> | |
| 232 | + <a target="blank" href="%s" style="font-size: 16px; color: #000000; text-decoration: underline;">clique aqui!</a><br /><br /> | |
| 233 | + <span style="font-size: 10px;">Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br /> | |
| 234 | + Clique na Imagem para Baixar o instalador<br /><br /> | |
| 235 | + <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> | |
| 236 | + </span> | |
| 237 | + </center>', $this->get_link); | |
| 238 | + } | |
| 239 | + | |
| 240 | + function Editar() | |
| 241 | + { | |
| 242 | + return FALSE; | |
| 243 | + } | |
| 244 | + | |
| 245 | + function Excluir() | |
| 246 | + { | |
| 247 | + return FALSE; | |
| 248 | + } | |
| 289 | 249 | } |
| 290 | 250 | |
| 291 | -// cria uma extensao da classe base | |
| 251 | +// Instancia objeto de página | |
| 292 | 252 | $pagina = new clsIndexBase(); |
| 293 | -// cria o conteudo | |
| 253 | + | |
| 254 | +// Instancia objeto de conteúdo | |
| 294 | 255 | $miolo = new indice(); |
| 295 | -// adiciona o conteudo na clsBase | |
| 296 | -$pagina->addForm( $miolo ); | |
| 297 | -// gera o html | |
| 298 | -$pagina->MakeAll(); | |
| 299 | 256 | |
| 257 | +// Atribui o conteúdo à página | |
| 258 | +$pagina->addForm($miolo); | |
| 300 | 259 | |
| 301 | -?> | |
| 260 | +// Gera o código HTML | |
| 261 | +$pagina->MakeAll(); | |
| 302 | 262 | \ No newline at end of file | ... | ... |
ieducar/intranet/educar_relatorio_quadro_professores.php
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
| 4 | - * * | |
| 5 | - * @author Prefeitura Municipal de Itajaí * | |
| 6 | - * @updated 29/03/2007 * | |
| 7 | - * Pacote: i-PLB Software Público Livre e Brasileiro * | |
| 8 | - * * | |
| 9 | - * Copyright (C) 2006 PMI - Prefeitura Municipal de Itajaí * | |
| 10 | - * ctima@itajai.sc.gov.br * | |
| 11 | - * * | |
| 12 | - * Este programa é software livre, você pode redistribuí-lo e/ou * | |
| 13 | - * modificá-lo sob os termos da Licença Pública Geral GNU, conforme * | |
| 14 | - * publicada pela Free Software Foundation, tanto a versão 2 da * | |
| 15 | - * Licença como (a seu critério) qualquer versão mais nova. * | |
| 16 | - * * | |
| 17 | - * Este programa é distribuído na expectativa de ser útil, mas SEM * | |
| 18 | - * QUALQUER GARANTIA. Sem mesmo a garantia implícita de COMERCIALI- * | |
| 19 | - * ZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM PARTICULAR. Con- * | |
| 20 | - * sulte a Licença Pública Geral GNU para obter mais detalhes. * | |
| 21 | - * * | |
| 22 | - * Você deve ter recebido uma cópia da Licença Pública Geral GNU * | |
| 23 | - * junto com este programa. Se não, escreva para a Free Software * | |
| 24 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * | |
| 25 | - * 02111-1307, USA. * | |
| 26 | - * * | |
| 27 | - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
| 28 | - | |
| 29 | -require_once ("include/clsBase.inc.php"); | |
| 30 | -require_once ("include/clsCadastro.inc.php"); | |
| 31 | -require_once ("include/clsBanco.inc.php"); | |
| 32 | -require_once ("include/pmieducar/geral.inc.php"); | |
| 33 | -require_once ("include/relatorio.inc.php"); | |
| 34 | - | |
| 3 | +/** | |
| 4 | + * i-Educar - Sistema de gestão escolar | |
| 5 | + * | |
| 6 | + * Copyright (C) 2006 Prefeitura Municipal de Itajaí | |
| 7 | + * <ctima@itajai.sc.gov.br> | |
| 8 | + * | |
| 9 | + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo | |
| 10 | + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free | |
| 11 | + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) | |
| 12 | + * qualquer versão posterior. | |
| 13 | + * | |
| 14 | + * Este programa é distribuído na expectativa de que seja útil, porém, SEM | |
| 15 | + * NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU | |
| 16 | + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral | |
| 17 | + * do GNU para mais detalhes. | |
| 18 | + * | |
| 19 | + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto | |
| 20 | + * com este programa; se não, escreva para a Free Software Foundation, Inc., no | |
| 21 | + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 22 | + * | |
| 23 | + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
| 24 | + * @category i-Educar | |
| 25 | + * @license @@license@@ | |
| 26 | + * @package iEd_Pmieducar | |
| 27 | + * @since Arquivo disponível desde a versão 1.0.0 | |
| 28 | + * @version $Id$ | |
| 29 | + */ | |
| 30 | + | |
| 31 | +require_once 'include/clsBase.inc.php'; | |
| 32 | +require_once 'include/clsCadastro.inc.php'; | |
| 33 | +require_once 'include/clsBanco.inc.php'; | |
| 34 | +require_once 'include/pmieducar/geral.inc.php'; | |
| 35 | +require_once 'include/relatorio.inc.php'; | |
| 36 | + | |
| 37 | +/** | |
| 38 | + * clsIndexBase class. | |
| 39 | + * | |
| 40 | + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
| 41 | + * @category i-Educar | |
| 42 | + * @license @@license@@ | |
| 43 | + * @package iEd_Pmieducar | |
| 44 | + * @since Classe disponível desde a versão 1.0.0 | |
| 45 | + * @version @@package_version@@ | |
| 46 | + */ | |
| 35 | 47 | class clsIndexBase extends clsBase |
| 36 | 48 | { |
| 37 | - function Formular() | |
| 38 | - { | |
| 39 | - $this->SetTitulo( "{$this->_instituicao} i-Educar - Quadro de Professores & Funcionários" ); | |
| 40 | - $this->processoAp = "690"; | |
| 41 | - } | |
| 49 | + function Formular() | |
| 50 | + { | |
| 51 | + $this->SetTitulo($this->_instituicao . ' i-Educar - Quadro de Professores & Funcionários'); | |
| 52 | + $this->processoAp = 690; | |
| 53 | + } | |
| 42 | 54 | } |
| 43 | 55 | |
| 56 | +/** | |
| 57 | + * clsIndexBase class. | |
| 58 | + * | |
| 59 | + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
| 60 | + * @category i-Educar | |
| 61 | + * @license @@license@@ | |
| 62 | + * @package iEd_Pmieducar | |
| 63 | + * @since Classe disponível desde a versão 1.0.0 | |
| 64 | + * @version @@package_version@@ | |
| 65 | + */ | |
| 44 | 66 | class indice extends clsCadastro |
| 45 | 67 | { |
| 68 | + var $pessoa_logada; | |
| 69 | + | |
| 70 | + var $ref_cod_instituicao; | |
| 71 | + var $ref_cod_escola; | |
| 72 | + var $ref_ref_cod_escola; | |
| 73 | + var $ref_cod_curso; | |
| 74 | + var $ref_ref_cod_serie; | |
| 75 | + var $ref_cod_turma; | |
| 76 | + | |
| 77 | + var $ano; | |
| 78 | + var $link; | |
| 79 | + | |
| 80 | + function Inicializar() | |
| 81 | + { | |
| 82 | + $retorno = 'Novo'; | |
| 83 | + | |
| 84 | + session_start(); | |
| 85 | + $this->pessoa_logada = $_SESSION['id_pessoa']; | |
| 86 | + session_write_close(); | |
| 87 | + | |
| 88 | + return $retorno; | |
| 89 | + } | |
| 90 | + | |
| 91 | + function Gerar() | |
| 92 | + { | |
| 93 | + $get_escola = TRUE; | |
| 94 | + $obrigatorio = TRUE; | |
| 46 | 95 | |
| 47 | - /** | |
| 48 | - * Referencia pega da session para o idpes do usuario atual | |
| 49 | - * | |
| 50 | - * @var int | |
| 51 | - */ | |
| 52 | - var $pessoa_logada; | |
| 53 | - | |
| 54 | - var $ref_cod_instituicao; | |
| 55 | - var $ref_cod_escola; | |
| 56 | - var $ref_ref_cod_escola; | |
| 57 | - var $ref_cod_curso; | |
| 58 | - var $ref_ref_cod_serie; | |
| 59 | - var $ref_cod_turma; | |
| 60 | - | |
| 61 | - var $ano; | |
| 62 | - var $link; | |
| 63 | - | |
| 64 | - function Inicializar() | |
| 65 | - { | |
| 66 | - $retorno = "Novo"; | |
| 67 | - | |
| 68 | - @session_start(); | |
| 69 | - $this->pessoa_logada = $_SESSION['id_pessoa']; | |
| 70 | - @session_write_close(); | |
| 71 | - | |
| 72 | - return $retorno; | |
| 73 | - } | |
| 74 | - | |
| 75 | - function Gerar() | |
| 76 | - { | |
| 77 | - $get_escola = true; | |
| 78 | - $obrigatorio = true; | |
| 79 | - | |
| 80 | - include("include/pmieducar/educar_campo_lista.php"); | |
| 81 | - | |
| 82 | - if ( $this->ref_cod_escola ) | |
| 83 | - { | |
| 84 | - $this->ref_ref_cod_escola = $this->ref_cod_escola; | |
| 85 | - } | |
| 86 | - | |
| 87 | - $this->campoCheck("professor","Busca somente professores",""); | |
| 88 | - | |
| 89 | - $this->acao_enviar = false; | |
| 90 | - $this->array_botao = array( "Gerar Relatório" ); | |
| 91 | - $this->array_botao_url_script = array( "showExpansivelImprimir(400, 200, 'educar_relatorio_quadro_professores_proc.php',['ref_cod_escola', 'ref_cod_instituicao', 'professor'], 'Relatório i-Educar' )" ); | |
| 92 | - } | |
| 93 | - | |
| 94 | - function Novo() | |
| 95 | - { | |
| 96 | - return true; | |
| 97 | - } | |
| 96 | + include 'include/pmieducar/educar_campo_lista.php'; | |
| 97 | + | |
| 98 | + if ($this->ref_cod_escola) { | |
| 99 | + $this->ref_ref_cod_escola = $this->ref_cod_escola; | |
| 100 | + } | |
| 101 | + | |
| 102 | + $this->campoCheck("professor","Busca somente professores",""); | |
| 103 | + | |
| 104 | + $this->acao_enviar = false; | |
| 105 | + $this->array_botao = array("Gerar Relatório"); | |
| 106 | + $this->array_botao_url_script = array("showExpansivelImprimir(400, 200, 'educar_relatorio_quadro_professores_proc.php',['ref_cod_escola', 'ref_cod_instituicao', 'professor'], 'Relatório i-Educar' )"); | |
| 107 | + } | |
| 108 | + | |
| 109 | + function Novo() | |
| 110 | + { | |
| 111 | + return TRUE; | |
| 112 | + } | |
| 98 | 113 | } |
| 99 | 114 | |
| 100 | -// cria uma extensao da classe base | |
| 115 | +// Instancia objeto de página | |
| 101 | 116 | $pagina = new clsIndexBase(); |
| 102 | -// cria o conteudo | |
| 117 | + | |
| 118 | +// Instancia objeto de conteúdo | |
| 103 | 119 | $miolo = new indice(); |
| 104 | -// adiciona o conteudo na clsBase | |
| 105 | -$pagina->addForm( $miolo ); | |
| 106 | -// gera o html | |
| 107 | -$pagina->MakeAll(); | |
| 108 | -?> | |
| 120 | + | |
| 121 | +// Atribui o conteúdo à página | |
| 122 | +$pagina->addForm($miolo); | |
| 123 | + | |
| 124 | +// Gera o código HTML | |
| 125 | +$pagina->MakeAll(); | |
| 109 | 126 | \ No newline at end of file | ... | ... |
ieducar/intranet/educar_relatorio_quadro_professores_proc.php
| 1 | 1 | <?php |
| 2 | - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
| 3 | - * * | |
| 4 | - * @author Prefeitura Municipal de Itajaí * | |
| 5 | - * @updated 29/03/2007 * | |
| 6 | - * Pacote: i-PLB Software Público Livre e Brasileiro * | |
| 7 | - * * | |
| 8 | - * Copyright (C) 2006 PMI - Prefeitura Municipal de Itajaí * | |
| 9 | - * ctima@itajai.sc.gov.br * | |
| 10 | - * * | |
| 11 | - * Este programa é software livre, você pode redistribuí-lo e/ou * | |
| 12 | - * modificá-lo sob os termos da Licença Pública Geral GNU, conforme * | |
| 13 | - * publicada pela Free Software Foundation, tanto a versão 2 da * | |
| 14 | - * Licença como (a seu critério) qualquer versão mais nova. * | |
| 15 | - * * | |
| 16 | - * Este programa é distribuído na expectativa de ser útil, mas SEM * | |
| 17 | - * QUALQUER GARANTIA. Sem mesmo a garantia implícita de COMERCIALI- * | |
| 18 | - * ZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM PARTICULAR. Con- * | |
| 19 | - * sulte a Licença Pública Geral GNU para obter mais detalhes. * | |
| 20 | - * * | |
| 21 | - * Você deve ter recebido uma cópia da Licença Pública Geral GNU * | |
| 22 | - * junto com este programa. Se não, escreva para a Free Software * | |
| 23 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * | |
| 24 | - * 02111-1307, USA. * | |
| 25 | - * * | |
| 26 | - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
| 27 | -?> | |
| 28 | - | |
| 29 | -<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | |
| 30 | -<html lang="pt"> | |
| 31 | - <head> | |
| 32 | - | |
| 33 | - <title> <!-- #&TITULO&# --> </title> | |
| 34 | - <link rel=stylesheet type='text/css' href='styles/styles.css' /> | |
| 35 | - <link rel=stylesheet type='text/css' href='styles/novo.css' /> | |
| 36 | - <link rel=stylesheet type='text/css' href='styles/menu.css' /> | |
| 37 | - <!-- #&ESTILO&# --> | |
| 38 | - | |
| 39 | - <script type='text/javascript' src='scripts/padrao.js'></script> | |
| 40 | - <script type='text/javascript' src='scripts/novo.js'></script> | |
| 41 | - <script type='text/javascript' src='scripts/dom.js'></script> | |
| 42 | - <script type='text/javascript' src='scripts/menu.js'></script> | |
| 43 | - | |
| 44 | - <!-- #&SCRIPT&# --> | |
| 45 | - | |
| 46 | - <meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1' /> | |
| 47 | - <meta http-equiv="Pragma" content="no-cache" /> | |
| 48 | - <meta http-equiv="Expires" content="-1" /> | |
| 49 | - <!-- #&REFRESH&# --> | |
| 50 | 2 | |
| 51 | - <meta name='Author' content='Prefeitura de Itajaí' /> | |
| 52 | - <meta name='Description' content='Portal da Prefeitura de Itajaí' /> | |
| 53 | - <meta name='Keywords' content='portal, prefeitura, itajaí, serviço, cidadão' /> | |
| 3 | +/** | |
| 4 | + * i-Educar - Sistema de gestão escolar | |
| 5 | + * | |
| 6 | + * Copyright (C) 2006 Prefeitura Municipal de Itajaí | |
| 7 | + * <ctima@itajai.sc.gov.br> | |
| 8 | + * | |
| 9 | + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo | |
| 10 | + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free | |
| 11 | + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) | |
| 12 | + * qualquer versão posterior. | |
| 13 | + * | |
| 14 | + * Este programa é distribuído na expectativa de que seja útil, porém, SEM | |
| 15 | + * NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU | |
| 16 | + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral | |
| 17 | + * do GNU para mais detalhes. | |
| 18 | + * | |
| 19 | + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto | |
| 20 | + * com este programa; se não, escreva para a Free Software Foundation, Inc., no | |
| 21 | + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 22 | + * | |
| 23 | + * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
| 24 | + * @category i-Educar | |
| 25 | + * @license @@license@@ | |
| 26 | + * @package iEd_Pmieducar | |
| 27 | + * @since Arquivo disponível desde a versão 1.0.0 | |
| 28 | + * @version $Id$ | |
| 29 | + */ | |
| 54 | 30 | |
| 55 | - <link rel="icon" href="imagens/logo_itajai.ico" type="image/x-icon"> | |
| 56 | - </head> | |
| 57 | - <body onload="parent.EscondeDiv('LoadImprimir');"> | |
| 31 | +?> | |
| 32 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | |
| 33 | +<html lang="pt"> | |
| 34 | +<head> | |
| 35 | + <title><!-- #&TITULO&# --></title> | |
| 36 | + <link rel=stylesheet type='text/css' href='styles/styles.css' /> | |
| 37 | + <link rel=stylesheet type='text/css' href='styles/novo.css' /> | |
| 38 | + <link rel=stylesheet type='text/css' href='styles/menu.css' /> | |
| 39 | + <!-- #&ESTILO&# --> | |
| 40 | + | |
| 41 | + <script type='text/javascript' src='scripts/padrao.js'></script> | |
| 42 | + <script type='text/javascript' src='scripts/novo.js'></script> | |
| 43 | + <script type='text/javascript' src='scripts/dom.js'></script> | |
| 44 | + <script type='text/javascript' src='scripts/menu.js'></script> | |
| 45 | + <!-- #&SCRIPT&# --> | |
| 46 | + | |
| 47 | + <meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1' /> | |
| 48 | + <meta http-equiv='Pragma' content='no-cache' /> | |
| 49 | + <meta http-equiv='Expires' content='-1' /> | |
| 50 | + <!-- #&REFRESH&# --> | |
| 51 | +</head> | |
| 52 | +<body onload="parent.EscondeDiv('LoadImprimir');"> | |
| 58 | 53 | <?php |
| 59 | - require_once ("include/clsBase.inc.php"); | |
| 60 | - require_once ("include/clsCadastro.inc.php"); | |
| 61 | - require_once ("include/relatorio.inc.php"); | |
| 62 | - require_once ("include/pmieducar/geral.inc.php"); | |
| 63 | - | |
| 64 | - $ref_cod_instituicao = $_GET['ref_cod_instituicao']; | |
| 65 | - $ref_cod_escola = $_GET['ref_cod_escola']; | |
| 66 | - $professor = $_GET['professor'] ? true: null; | |
| 67 | - | |
| 68 | - if ($ref_cod_escola) | |
| 69 | - { | |
| 70 | - | |
| 71 | - $obj_servidor = new clsPmieducarServidorAlocacao (); | |
| 72 | - $obj_servidor->setCamposLista ("ref_ref_cod_instituicao,ref_cod_escola,sa.ref_cod_servidor,sum(carga_horaria) as carga_horaria"); | |
| 73 | - $obj_servidor->setOrderby ("sa.ref_ref_cod_instituicao,sa.ref_cod_escola,p.nome,sa.ref_cod_servidor"); | |
| 74 | - $obj_servidor->setGroupBy ("ref_ref_cod_instituicao,ref_cod_escola,sa.ref_cod_servidor,p.nome"); | |
| 75 | - $lst_servidor = $obj_servidor->lista (null, $ref_cod_instituicao, null, null, $ref_cod_escola, null, null, null, null, null, 1, null, null, true,$professor); | |
| 76 | - | |
| 77 | - if ( is_array($lst_servidor) ) | |
| 78 | - { | |
| 79 | - | |
| 80 | - $total_servidor = count($lst_servidor); | |
| 81 | - | |
| 82 | - $relatorio = new relatorios ( "RELAÇÃO DO QUADRO DE PROFESSORES - Total de Funcionário/Professores = {$total_servidor}", 120, false, "i-Educar", "A4", "Prefeitura COBRA Tecnologia\n\nSecretaria da Educação", "#515151"); | |
| 83 | - $relatorio->exibe_produzido_por = false; | |
| 84 | - | |
| 85 | - $get_nome_escola = new clsPmieducarEscola($ref_cod_escola); | |
| 86 | - $det_nome_escola = $get_nome_escola->detalhe(); | |
| 87 | - | |
| 88 | - if (is_array($det_nome_escola)) | |
| 89 | - { | |
| 90 | - $relatorio->novalinha ( array( $det_nome_escola['nome'] ), 0, 16, true, "arial", array(), "#515151", "#d3d3d3", "#FFFFFF", false, true); | |
| 91 | - } | |
| 92 | - | |
| 93 | - $relatorio->novalinha ( array( "Nome", "Matrícula", "Turno", "Carga Horária Disponível"), 0, 16, true, "arial", array( 210, 90, 100), "#515151", "#d3d3d3", "#FFFFFF", false, true); | |
| 94 | -// $relatorio->novalinha ( array( "Nome", "Matrícula", "Turno", "Carga Horária Disponível"), 0, 16, true, "arial", array( 210, 50, 50), "#515151", "#d3d3d3", "#FFFFFF", false, true); | |
| 95 | - | |
| 96 | - $array_turnos = array( "1" => "M", "2" => "V", "3" => "N" ); | |
| 97 | - | |
| 98 | - $cor = "#FFFFFF"; | |
| 99 | - | |
| 100 | - foreach ($lst_servidor as $servidor) | |
| 101 | - { | |
| 102 | - $get_turnos = new clsPmieducarServidorAlocacao(); | |
| 103 | - $get_turnos->setCamposLista("periodo"); | |
| 104 | - $get_turnos->setGroupBy("periodo, p.nome"); | |
| 105 | - | |
| 106 | - $turnos = $get_turnos->lista(null, $ref_cod_instituicao, null, null, $ref_cod_escola, $servidor['ref_cod_servidor'], null, null, null, null, 1, null, null, true); | |
| 107 | - | |
| 108 | - $turnos_txt = ""; | |
| 109 | - | |
| 110 | - if (is_array($turnos)) | |
| 111 | - { | |
| 112 | - $completar = ""; | |
| 113 | - foreach ($turnos as $turno) | |
| 114 | - { | |
| 115 | - $turnos_txt .= "{$completar}{$array_turnos[$turno['periodo']]}"; | |
| 116 | - $completar = "/"; | |
| 117 | - } | |
| 118 | - } | |
| 119 | - $sql = "SELECT nm_funcao FROM pmieducar.servidor_funcao, pmieducar.funcao WHERE ref_cod_funcao = cod_funcao AND ref_cod_servidor = {$servidor["ref_cod_servidor"]}"; | |
| 120 | - $db = new clsBanco(); | |
| 121 | -// die($sql); | |
| 122 | - $nm_funcao = $db->CampoUnico($sql); | |
| 123 | - $cor = $cor == "#FFFFFF" ? "#D3D3D3" : "#FFFFFF"; | |
| 124 | - $relatorio->novalinha( array( minimiza_capitaliza($servidor['nome']), $servidor['ref_cod_servidor'], $turnos_txt, $servidor['carga_horaria']) , 5, 17, false, "arial", array( 215, 90, 100 )); | |
| 125 | - if (!empty($nm_funcao)) | |
| 126 | - $relatorio->novalinha( array("Função: {$nm_funcao}") , 20, 17, false, "arial", array( 300 ));//, "#000000", $cor); | |
| 127 | -// $relatorio->novalinha( array( minimiza_capitaliza($servidor['nome']), $servidor['ref_cod_servidor'], $turnos_txt, $servidor['carga_horaria']) , 5, 17, false, "arial", array( 215, 50, 100 )); | |
| 128 | - } | |
| 129 | - | |
| 130 | - // pega o link e exibe ele ao usuario | |
| 131 | - $link = $relatorio->fechaPdf(); | |
| 132 | - | |
| 133 | - echo "<center><a target='blank' href='" . $link . "' style='font-size: 16px; color: #000000; text-decoration: underline;'>Clique aqui para visualizar o arquivo!</a><br><br> | |
| 134 | - <span style='font-size: 10px;'>Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br> | |
| 135 | - | |
| 136 | - Clique na Imagem para Baixar o instalador<br><br> | |
| 137 | - <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> | |
| 138 | - </span> | |
| 139 | - </center><script>window.onload=function(){parent.EscondeDiv('LoadImprimir');window.location='download.php?filename=" . $link . "'}</script>"; | |
| 140 | - | |
| 141 | - } | |
| 142 | - else | |
| 143 | - { | |
| 144 | - echo "<center>Não existem servidores a serem listados!</center>"; | |
| 145 | - } | |
| 146 | - } | |
| 147 | - else | |
| 148 | - { | |
| 149 | - | |
| 150 | - $entrou = false; | |
| 151 | - | |
| 152 | - $get_escolas = new clsPmieducarServidorAlocacao (); | |
| 153 | - $lst_escolas = $get_escolas->listaEscolas($ref_cod_instituicao); | |
| 154 | - | |
| 155 | - if (is_array($lst_escolas)) | |
| 156 | - { | |
| 157 | - | |
| 158 | - $relatorio = new relatorios ( "RELAÇÃO DO QUADRO DE PROFESSORES", 120, false, "i-Educar", "A4", "Prefeitura COBRA Tecnologia\n\nSecretaria da Educação", "#515151"); | |
| 159 | - $relatorio->exibe_produzido_por = false; | |
| 160 | - | |
| 161 | - foreach ($lst_escolas as $escolas) | |
| 162 | - { | |
| 163 | - | |
| 164 | - $obj_servidor = new clsPmieducarServidorAlocacao (); | |
| 165 | - $obj_servidor->setCamposLista ("ref_ref_cod_instituicao,ref_cod_escola,sa.ref_cod_servidor,sum(carga_horaria) as carga_horaria"); | |
| 166 | - $obj_servidor->setOrderby ("sa.ref_ref_cod_instituicao,sa.ref_cod_escola,p.nome,sa.ref_cod_servidor"); | |
| 167 | - $obj_servidor->setGroupBy ("ref_ref_cod_instituicao,ref_cod_escola,sa.ref_cod_servidor,p.nome"); | |
| 168 | - $lst_servidor = $obj_servidor->lista (null, $ref_cod_instituicao, null, null, $escolas['ref_cod_escola'], null, null, null, null, null, 1, null, null, true); | |
| 169 | - | |
| 170 | - if ( is_array($lst_servidor) ) | |
| 171 | - { | |
| 172 | - | |
| 173 | - $get_nome_escola = new clsPmieducarEscola($escolas['ref_cod_escola']); | |
| 174 | - $det_nome_escola = $get_nome_escola->detalhe(); | |
| 175 | - | |
| 176 | - if (is_array($det_nome_escola)) | |
| 177 | - { | |
| 178 | - $total_servidor = count($lst_servidor); | |
| 179 | - $relatorio->novalinha ( array( "{$det_nome_escola['nome']} - Total de Professores: {$total_servidor}" ), 0, 16, true, "arial", array(), "#515151", "#d3d3d3", "#FFFFFF", false, true); | |
| 180 | - } | |
| 181 | - | |
| 182 | - $relatorio->novalinha ( array( "Nome", "Matrícula", "Turno", "Carga Horária Disponível"), 0, 16, true, "arial", array( 210, 90, 100), "#515151", "#d3d3d3", "#FFFFFF", false, true); | |
| 183 | - | |
| 184 | - $array_turnos = array( "1" => "M", "2" => "V", "3" => "N" ); | |
| 185 | - | |
| 186 | - foreach ($lst_servidor as $servidor) | |
| 187 | - { | |
| 188 | - $get_turnos = new clsPmieducarServidorAlocacao (); | |
| 189 | - $get_turnos->setCamposLista ("periodo"); | |
| 190 | - $get_turnos->setGroupBy ("periodo, p.nome"); | |
| 191 | - $turnos = $get_turnos->lista (null, $ref_cod_instituicao, null, null, $escolas['ref_cod_escola'], $servidor['ref_cod_servidor'], null, null, null, null, 1, null, null, true); | |
| 192 | - | |
| 193 | - $turnos_txt = ""; | |
| 194 | - | |
| 195 | - if (is_array($turnos)) | |
| 196 | - { | |
| 197 | - $completar = ""; | |
| 198 | - foreach ($turnos as $turno) | |
| 199 | - { | |
| 200 | - $turnos_txt .= "{$completar}{$array_turnos[$turno['periodo']]}"; | |
| 201 | - $completar = "/"; | |
| 202 | - } | |
| 203 | - } | |
| 204 | - | |
| 205 | - $relatorio->novalinha( array( minimiza_capitaliza($servidor['nome']), $servidor['ref_cod_servidor'], $turnos_txt, $servidor['carga_horaria']) , 5, 17, false, "arial", array( 215, 90, 100 )); | |
| 206 | - } | |
| 207 | - | |
| 208 | - $entrou = true; | |
| 209 | - | |
| 210 | - | |
| 211 | - } | |
| 212 | - } | |
| 213 | - } | |
| 214 | - | |
| 215 | - // pega o link e exibe ele ao usuario | |
| 216 | - $link = $relatorio->fechaPdf(); | |
| 217 | - | |
| 218 | - if ($entrou) | |
| 219 | - { | |
| 220 | - echo "<center><a target='blank' href='" . $link . "' style='font-size: 16px; color: #000000; text-decoration: underline;'>Clique aqui para visualizar o arquivo!</a><br><br> | |
| 221 | - <span style='font-size: 10px;'>Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br> | |
| 222 | - | |
| 223 | - Clique na Imagem para Baixar o instalador<br><br> | |
| 224 | - <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> | |
| 225 | - </span> | |
| 226 | - </center><script>window.onload=function(){parent.EscondeDiv('LoadImprimir');window.location='download.php?filename=" . $link . "'}</script>"; | |
| 227 | - } | |
| 228 | - else | |
| 229 | - { | |
| 230 | - echo "<center>Não existem alunos enturmados!</center>"; | |
| 231 | - } | |
| 232 | - | |
| 233 | - | |
| 234 | - } | |
| 235 | - | |
| 54 | + require_once ("include/clsBase.inc.php"); | |
| 55 | + require_once ("include/clsCadastro.inc.php"); | |
| 56 | + require_once ("include/relatorio.inc.php"); | |
| 57 | + require_once ("include/pmieducar/geral.inc.php"); | |
| 58 | + | |
| 59 | +$ref_cod_instituicao = $_GET['ref_cod_instituicao']; | |
| 60 | +$ref_cod_escola = $_GET['ref_cod_escola']; | |
| 61 | +$professor = $_GET['professor'] ? TRUE : NULL; | |
| 62 | + | |
| 63 | +if ($ref_cod_escola) { | |
| 64 | + $obj_servidor = new clsPmieducarServidorAlocacao (); | |
| 65 | + $obj_servidor->setCamposLista('ref_ref_cod_instituicao, ref_cod_escola, sa.ref_cod_servidor, SUM(carga_horaria) AS carga_horaria'); | |
| 66 | + $obj_servidor->setOrderby('sa.ref_ref_cod_instituicao, sa.ref_cod_escola, p.nome, sa.ref_cod_servidor'); | |
| 67 | + $obj_servidor->setGroupBy('ref_ref_cod_instituicao, ref_cod_escola, sa.ref_cod_servidor, p.nome'); | |
| 68 | + $lst_servidor = $obj_servidor->lista(NULL, $ref_cod_instituicao, NULL, NULL, | |
| 69 | + $ref_cod_escola, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, TRUE, $professor); | |
| 70 | + | |
| 71 | + if (is_array($lst_servidor)) { | |
| 72 | + $total_servidor = count($lst_servidor); | |
| 73 | + | |
| 74 | + $relatorio = new relatorios('RELAÇÃO DO QUADRO DE PROFESSORES - Total de Funcionário/Professores = ' . $total_servidor, | |
| 75 | + 120, FALSE, 'i-Educar', 'A4', "Prefeitura COBRA Tecnologia\n\nSecretaria da Educação", | |
| 76 | + '#515151'); | |
| 77 | + | |
| 78 | + $relatorio->exibe_produzido_por = FALSE; | |
| 79 | + | |
| 80 | + $get_nome_escola = new clsPmieducarEscola($ref_cod_escola); | |
| 81 | + $det_nome_escola = $get_nome_escola->detalhe(); | |
| 82 | + | |
| 83 | + if (is_array($det_nome_escola)) { | |
| 84 | + $relatorio->novalinha(array($det_nome_escola['nome']), 0, 16, TRUE, | |
| 85 | + 'arial', array(), '#515151', '#D3D3D3', '#FFFFFF', FALSE, TRUE); | |
| 86 | + } | |
| 87 | + | |
| 88 | + $relatorio->novalinha(array('Nome', 'Matrícula', 'Turno', 'Carga Horária Disponível'), | |
| 89 | + 0, 16, TRUE, 'arial', array(210, 90, 100), '#515151', '#D3D3D3', '#FFFFFF', | |
| 90 | + FALSE, TRUE); | |
| 91 | + | |
| 92 | + $array_turnos = array( | |
| 93 | + '1' => 'M', | |
| 94 | + '2' => 'V', | |
| 95 | + '3' => 'N' | |
| 96 | + ); | |
| 97 | + | |
| 98 | + $cor = '#FFFFFF'; | |
| 99 | + | |
| 100 | + foreach ($lst_servidor as $servidor) { | |
| 101 | + $get_turnos = new clsPmieducarServidorAlocacao(); | |
| 102 | + $get_turnos->setCamposLista('periodo'); | |
| 103 | + $get_turnos->setGroupBy('periodo, p.nome'); | |
| 104 | + | |
| 105 | + $turnos = $get_turnos->lista(NULL, $ref_cod_instituicao, NULL, NULL, | |
| 106 | + $ref_cod_escola, $servidor['ref_cod_servidor'], NULL, NULL, NULL, | |
| 107 | + NULL, 1, NULL, NULL, TRUE); | |
| 108 | + | |
| 109 | + $turnos_txt = ''; | |
| 110 | + | |
| 111 | + if (is_array($turnos)) { | |
| 112 | + $completar = ''; | |
| 113 | + foreach ($turnos as $turno) { | |
| 114 | + $turnos_txt .= $completar . $array_turnos[$turno['periodo']]; | |
| 115 | + $completar = '/'; | |
| 116 | + } | |
| 117 | + } | |
| 118 | + | |
| 119 | + $sql = 'SELECT nm_funcao FROM pmieducar.servidor_funcao, pmieducar.funcao WHERE ref_cod_funcao = cod_funcao AND ref_cod_servidor = ' . $servidor['ref_cod_servidor']; | |
| 120 | + $db = new clsBanco(); | |
| 121 | + | |
| 122 | + $nm_funcao = $db->CampoUnico($sql); | |
| 123 | + $cor = $cor == '#FFFFFF' ? '#D3D3D3' : '#FFFFFF'; | |
| 124 | + | |
| 125 | + $relatorio->novalinha(array(minimiza_capitaliza($servidor['nome']), | |
| 126 | + $servidor['ref_cod_servidor'], $turnos_txt, $servidor['carga_horaria']), | |
| 127 | + 5, 17, FALSE, 'arial', array(215, 90, 100)); | |
| 128 | + | |
| 129 | + if (!empty($nm_funcao)) { | |
| 130 | + $relatorio->novalinha(array('Função: ' . $nm_funcao) , 20, 17, FALSE, | |
| 131 | + 'arial', array(300)); | |
| 132 | + } | |
| 133 | + } | |
| 134 | + | |
| 135 | + // Pega o link e exibe ele ao usuário | |
| 136 | + $link = $relatorio->fechaPdf(); | |
| 137 | + | |
| 138 | + echo sprintf(' | |
| 139 | + <script> | |
| 140 | + window.onload = function() | |
| 141 | + { | |
| 142 | + parent.EscondeDiv("LoadImprimir"); | |
| 143 | + window.location="download.php?filename=%s" | |
| 144 | + } | |
| 145 | + </script>', $link); | |
| 146 | + | |
| 147 | + echo sprintf(' | |
| 148 | + <html> | |
| 149 | + <center> | |
| 150 | + 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> | |
| 151 | + <span style="font-size: 10px;">Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br> | |
| 152 | + Clique na Imagem para Baixar o instalador<br><br> | |
| 153 | + <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> | |
| 154 | + </span> | |
| 155 | + </center> | |
| 156 | + </html>', $link); | |
| 157 | + } | |
| 158 | + else { | |
| 159 | + echo '<center>Não existem servidores a serem listados!</center>'; | |
| 160 | + } | |
| 161 | +} | |
| 162 | +else { | |
| 163 | + $entrou = FALSE; | |
| 164 | + | |
| 165 | + $get_escolas = new clsPmieducarServidorAlocacao(); | |
| 166 | + $lst_escolas = $get_escolas->listaEscolas($ref_cod_instituicao); | |
| 167 | + | |
| 168 | + if (is_array($lst_escolas)) { | |
| 169 | + $relatorio = new relatorios('RELAÇÃO DO QUADRO DE PROFESSORES', 120, FALSE, | |
| 170 | + 'i-Educar', 'A4', "Prefeitura COBRA Tecnologia\n\nSecretaria da Educação", | |
| 171 | + '#515151'); | |
| 172 | + | |
| 173 | + $relatorio->exibe_produzido_por = FALSE; | |
| 174 | + | |
| 175 | + foreach ($lst_escolas as $escolas) { | |
| 176 | + $obj_servidor = new clsPmieducarServidorAlocacao (); | |
| 177 | + $obj_servidor->setCamposLista('ref_ref_cod_instituicao, ref_cod_escola, sa.ref_cod_servidor, SUM(carga_horaria) AS carga_horaria'); | |
| 178 | + $obj_servidor->setOrderby('sa.ref_ref_cod_instituicao, sa.ref_cod_escola, p.nome, sa.ref_cod_servidor'); | |
| 179 | + $obj_servidor->setGroupBy('ref_ref_cod_instituicao, ref_cod_escola, sa.ref_cod_servidor, p.nome'); | |
| 180 | + $lst_servidor = $obj_servidor->lista(NULL, $ref_cod_instituicao, NULL, | |
| 181 | + NULL, $escolas['ref_cod_escola'], NULL, NULL, NULL, NULL, NULL, 1, | |
| 182 | + NULL, NULL, TRUE); | |
| 183 | + | |
| 184 | + if (is_array($lst_servidor)) { | |
| 185 | + $get_nome_escola = new clsPmieducarEscola($escolas['ref_cod_escola']); | |
| 186 | + $det_nome_escola = $get_nome_escola->detalhe(); | |
| 187 | + | |
| 188 | + if (is_array($det_nome_escola)) { | |
| 189 | + $total_servidor = count($lst_servidor); | |
| 190 | + $relatorio->novalinha (array($det_nome_escola['nome'] . ' - Total de Professores: ' . $total_servidor), | |
| 191 | + 0, 16, TRUE, 'arial', array(), '#515151', '#d3d3d3', '#FFFFFF', | |
| 192 | + FALSE, TRUE); | |
| 193 | + } | |
| 194 | + | |
| 195 | + $relatorio->novalinha(array('Nome', 'Matrícula', 'Turno', 'Carga Horária Disponível'), | |
| 196 | + 0, 16, TRUE, 'arial', array(210, 90, 100), '#515151', '#d3d3d3', | |
| 197 | + '#FFFFFF', FALSE, TRUE); | |
| 198 | + | |
| 199 | + $array_turnos = array( | |
| 200 | + '1' => 'M', | |
| 201 | + '2' => 'V', | |
| 202 | + '3' => 'N' | |
| 203 | + ); | |
| 204 | + | |
| 205 | + foreach ($lst_servidor as $servidor) { | |
| 206 | + $get_turnos = new clsPmieducarServidorAlocacao(); | |
| 207 | + $get_turnos->setCamposLista('periodo'); | |
| 208 | + $get_turnos->setGroupBy('periodo, p.nome'); | |
| 209 | + $turnos = $get_turnos->lista (NULL, $ref_cod_instituicao, NULL, | |
| 210 | + NULL, $escolas['ref_cod_escola'], $servidor['ref_cod_servidor'], | |
| 211 | + NULL, NULL, NULL, NULL, 1, NULL, NULL, TRUE); | |
| 212 | + | |
| 213 | + $turnos_txt = ''; | |
| 214 | + | |
| 215 | + if (is_array($turnos)) { | |
| 216 | + $completar = ''; | |
| 217 | + foreach ($turnos as $turno) { | |
| 218 | + $turnos_txt .= $completar . $array_turnos[$turno['periodo']]; | |
| 219 | + $completar = '/'; | |
| 220 | + } | |
| 221 | + } | |
| 222 | + | |
| 223 | + $relatorio->novalinha( | |
| 224 | + array( | |
| 225 | + minimiza_capitaliza($servidor['nome']), | |
| 226 | + $servidor['ref_cod_servidor'], | |
| 227 | + $turnos_txt, $servidor['carga_horaria'] | |
| 228 | + ), | |
| 229 | + 5, 17, FALSE, 'arial', array(215, 90, 100)); | |
| 230 | + } | |
| 231 | + | |
| 232 | + $entrou = TRUE; | |
| 233 | + } | |
| 234 | + } | |
| 235 | + } | |
| 236 | + | |
| 237 | + // Pega o link e exibe ele ao usuário | |
| 238 | + $link = $relatorio->fechaPdf(); | |
| 239 | + | |
| 240 | + if ($entrou) { | |
| 241 | + echo "<center><a target='blank' href='" . $link . "' style='font-size: 16px; color: #000000; text-decoration: underline;'>Clique aqui para visualizar o arquivo!</a><br><br> | |
| 242 | + <span style='font-size: 10px;'>Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br> | |
| 243 | + | |
| 244 | + Clique na Imagem para Baixar o instalador<br><br> | |
| 245 | + <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> | |
| 246 | + </span> | |
| 247 | + </center><script>window.onload=function(){parent.EscondeDiv('LoadImprimir');window.location='download.php?filename=" . $link . "'}</script>"; | |
| 248 | + } | |
| 249 | + else { | |
| 250 | + echo '<center>Não existem alunos enturmados!</center>'; | |
| 251 | + } | |
| 252 | +} | |
| 236 | 253 | ?> |
| 237 | 254 | </body> |
| 238 | 255 | -</html> |
| 256 | +</html> | |
| 239 | 257 | \ No newline at end of file | ... | ... |