From 6dfd264a454928319a3e736c6964c6df7d221dc5 Mon Sep 17 00:00:00 2001 From: Eriksen Costa Paixão Date: Mon, 10 May 2010 20:07:23 +0000 Subject: [PATCH] Refactoring para coding standards --- ieducar/intranet/educar_relatorio_diario_classe_avaliacao.php | 576 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ieducar/intranet/educar_relatorio_diario_classe_avaliacao_conceitual_proc.php | 629 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ieducar/intranet/educar_relatorio_diario_classe_avaliacao_proc.php | 872 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3 files changed, 976 insertions(+), 1101 deletions(-) diff --git a/ieducar/intranet/educar_relatorio_diario_classe_avaliacao.php b/ieducar/intranet/educar_relatorio_diario_classe_avaliacao.php index 688e205..b9f6ec6 100644 --- a/ieducar/intranet/educar_relatorio_diario_classe_avaliacao.php +++ b/ieducar/intranet/educar_relatorio_diario_classe_avaliacao.php @@ -1,383 +1,319 @@ + * + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) + * qualquer versão posterior. + * + * Este programa é distribuí­do na expectativa de que seja útil, porém, SEM + * NENHUMA GARANTIA; nem mesmo a garantia implí­cita de COMERCIABILIDADE OU + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral + * do GNU para mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto + * com este programa; se não, escreva para a Free Software Foundation, Inc., no + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. + * + * @author Prefeitura Municipal de Itajaí + * @category i-Educar + * @license @@license@@ + * @package iEd_Pmieducar + * @since Arquivo disponível desde a versão 1.0.0 + * @version $Id$ + */ + +require_once 'include/clsBase.inc.php'; +require_once 'include/clsCadastro.inc.php'; +require_once 'include/clsBanco.inc.php'; +require_once 'include/pmieducar/geral.inc.php'; +require_once 'include/clsPDF.inc.php'; + +/** + * clsIndexBase class. + * + * @author Prefeitura Municipal de Itajaí + * @category i-Educar + * @license @@license@@ + * @package iEd_Pmieducar + * @since Classe disponível desde a versão 1.0.0 + * @version @@package_version@@ + */ class clsIndexBase extends clsBase { - function Formular() - { - $this->SetTitulo( "{$this->_instituicao} i-Educar - Diário de Classe - Avaliações" ); - $this->processoAp = "670"; - } + function Formular() + { + $this->SetTitulo($this->_instituicao . ' i-Educar - Diário de Classe - Avaliações'); + $this->processoAp = 670; + } } +/** + * indice class. + * + * @author Prefeitura Municipal de Itajaí + * @category i-Educar + * @license @@license@@ + * @package iEd_Pmieducar + * @since Classe disponível desde a versão 1.0.0 + * @version @@package_version@@ + */ class indice extends clsCadastro { - - - /** - * Referencia pega da session para o idpes do usuario atual - * - * @var int - */ - var $pessoa_logada; - - - var $ref_cod_instituicao; - var $ref_cod_escola; - var $ref_cod_serie; - var $ref_cod_turma; - - var $ano; - var $mes; - - var $nm_escola; - var $nm_instituicao; - var $ref_cod_curso; - var $sequencial; - var $pdf; - var $pagina_atual = 1; - var $total_paginas = 1; - var $nm_professor; - var $nm_turma; - var $nm_serie; - var $nm_disciplina; - var $avaliacao_globalizada; - - var $page_y = 139; - - var $get_file; - - var $cursos = array(); - - var $get_link; - - var $total; - - //var $array_disciplinas = array(); - - var $ref_cod_modulo; - - var $meses_do_ano = array( - "1" => "JANEIRO" - ,"2" => "FEVEREIRO" - ,"3" => "MARÇO" - ,"4" => "ABRIL" - ,"5" => "MAIO" - ,"6" => "JUNHO" - ,"7" => "JULHO" - ,"8" => "AGOSTO" - ,"9" => "SETEMBRO" - ,"10" => "OUTUBRO" - ,"11" => "NOVEMBRO" - ,"12" => "DEZEMBRO" - ); - - - function Inicializar() - { - $retorno = "Novo"; - @session_start(); - $this->pessoa_logada = $_SESSION['id_pessoa']; - @session_write_close(); - - //$obj_permissoes = new clsPermissoes(); - //if($obj_permissoes->nivel_acesso($this->pessoa_logada) > 7) - //header("location: index.php"); - - return $retorno; - } - - function Gerar() - { - - $obj_permissoes = new clsPermissoes(); - $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); - - //if(!$nivel_usuario) - //header("location: index.php"); - @session_start(); - $this->pessoa_logada = $_SESSION['id_pessoa']; - @session_write_close(); - - if($_POST){ - foreach ($_POST as $key => $value) { - $this->$key = $value; - - } - } - - - - $this->ano = $ano_atual = date("Y"); - //$this->mes = $mes_atual = date("n"); - /* - $lim = 5; - for($a = date('Y') ; $a < $ano_atual + $lim ; $a++ ) - $anos["{$a}"] = "{$a}"; - - $this->campoLista( "ano", "Ano",$anos, $this->ano,"",false ); - */ - $this->campoNumero( "ano", "Ano", $this->ano, 4, 4, true ); - - $this->campoRadio("tipo_relatorio","Tipo Relatório",array('c' => 'Conceitual','p' => 'Padrão'),'p'); - - $this->campoCheck("em_branco","Relatório em branco",""); - $this->campoNumero("numero_registros","Número de linhas","",3,3); - //$this->campoLista( "mes", "Mês",$this->meses_do_ano, $this->mes,"",false ); - - $get_escola = true; - $obrigatorio = true; - $exibe_nm_escola = true; -// $get_escola_curso = true; - $get_curso = true; - $get_escola_curso_serie = true; - //$get_turma = true; - //$curso_padrao_ano_escolar = 1; - //$exibe_campo_lista_curso_escola = true; - include("include/pmieducar/educar_campo_lista.php"); - - /*$db = new clsBanco(); - $consulta ="SELECT distinct - m.cod_turma - ,m.nm_turma - ,s.cod_serie - ,s.nm_serie - ,m.ref_ref_cod_escola - FROM pmieducar.turma m - ,pmieducar.serie s - WHERE m.ref_ref_cod_serie = s.cod_serie"; - - $db->Consulta($consulta); - - $script = ""; -*/ - $opcoes_turma = array('' => 'Selecione'); - if ( ($this->ref_ref_cod_serie && $this->ref_cod_escola) || $this->ref_cod_curso ) - { - $obj_turma = new clsPmieducarTurma(); - $obj_turma->setOrderby("nm_turma ASC"); - $lst_turma = $obj_turma->lista( null, null, null, $this->ref_ref_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, $this->ref_cod_curso ); - if ( is_array( $lst_turma ) && count( $lst_turma ) ) - { - foreach ( $lst_turma as $turma ) - { - $opcoes_turma["{$turma['cod_turma']}"] = "{$turma['nm_turma']}"; - } - } - } - $this->campoLista("ref_cod_turma","Turma",$opcoes_turma,$this->ref_cod_turma); - - $this->campoLista("ref_cod_modulo","Módulo",array('' => 'Selecione'),""); - - //$this->campoCheck("avaliacao_globalizada","Avaliação Globalizada",$this->avaliacao_globalizada); - - - if($this->ref_cod_escola) - $this->ref_ref_cod_escola = $this->ref_cod_escola; - - if($this->get_link) - $this->campoRotulo("rotulo11", "-", "Baixar Relatório"); - - $this->url_cancelar = "educar_index.php"; - $this->nome_url_cancelar = "Cancelar"; - - $this->acao_enviar = 'acao2()'; - $this->acao_executa_submit = false; - - } - - - + var $pessoa_logada; + + var $ref_cod_instituicao; + var $ref_cod_escola; + var $ref_cod_serie; + var $ref_cod_turma; + + var $ano; + var $mes; + + var $nm_escola; + var $nm_instituicao; + var $ref_cod_curso; + var $sequencial; + var $pdf; + var $pagina_atual = 1; + var $total_paginas = 1; + var $nm_professor; + var $nm_turma; + var $nm_serie; + var $nm_disciplina; + var $avaliacao_globalizada; + + var $page_y = 139; + var $get_file; + var $cursos = array(); + var $get_link; + var $total; + + var $ref_cod_modulo; + + var $meses_do_ano = array( + 1 => 'JANEIRO', + 2 => 'FEVEREIRO', + 3 => 'MARÇO', + 4 => 'ABRIL', + 5 => 'MAIO', + 6 => 'JUNHO', + 7 => 'JULHO', + 8 => 'AGOSTO', + 9 => 'SETEMBRO', + 10 => 'OUTUBRO', + 11 => 'NOVEMBRO', + 12 => 'DEZEMBRO' + ); + + function Inicializar() + { + $retorno = 'Novo'; + + @session_start(); + $this->pessoa_logada = $_SESSION['id_pessoa']; + @session_write_close(); + + return $retorno; + } + + function Gerar() + { + $obj_permissoes = new clsPermissoes(); + $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); + + @session_start(); + $this->pessoa_logada = $_SESSION['id_pessoa']; + @session_write_close(); + + if ($_POST){ + foreach ($_POST as $key => $value) { + $this->$key = $value; + } + } + + $this->ano = $ano_atual = date('Y'); + $this->campoNumero('ano', 'Ano', $this->ano, 4, 4, TRUE); + + $this->campoRadio('tipo_relatorio', 'Tipo Relatório', + array( + 'c' => 'Conceitual', + 'p' => 'Padrão' + ), 'p'); + + $this->campoCheck('em_branco', 'Relatório em branco', ''); + $this->campoNumero('numero_registros', 'Número de linhas', '', 3, 3); + + $get_escola = true; + $obrigatorio = true; + $exibe_nm_escola = true; + $get_curso = true; + $get_escola_curso_serie = true; + + include 'include/pmieducar/educar_campo_lista.php'; + + $opcoes_turma = array('' => 'Selecione'); + + if (($this->ref_ref_cod_serie && $this->ref_cod_escola) || $this->ref_cod_curso) { + $obj_turma = new clsPmieducarTurma(); + $obj_turma->setOrderby('nm_turma ASC'); + $lst_turma = $obj_turma->lista(NULL, NULL, NULL, $this->ref_ref_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, + $this->ref_cod_curso); + + if (is_array($lst_turma) && count($lst_turma)) { + foreach ($lst_turma as $turma) { + $opcoes_turma[$turma['cod_turma']] = $turma['nm_turma']; + } + } + } + + $this->campoLista('ref_cod_turma','Turma',$opcoes_turma,$this->ref_cod_turma); + $this->campoLista('ref_cod_modulo','Módulo', array('' => 'Selecione'), ''); + + if ($this->ref_cod_escola) { + $this->ref_ref_cod_escola = $this->ref_cod_escola; + } + + if ($this->get_link) { + $this->campoRotulo('rotulo11', '-', + sprintf('Baixar Relatório', $this->get_link) + ); + } + + $this->url_cancelar = 'educar_index.php'; + $this->nome_url_cancelar = 'Cancelar'; + + $this->acao_enviar = 'acao2()'; + $this->acao_executa_submit = FALSE; + } } -// cria uma extensao da classe base +// Instancia objeto de página $pagina = new clsIndexBase(); -// cria o conteudo + +// Instancia objeto de conteúdo $miolo = new indice(); -// adiciona o conteudo na clsBase -$pagina->addForm( $miolo ); -// gera o html -$pagina->MakeAll(); +// Atribui o conteúdo à página +$pagina->addForm($miolo); +// Gera o código HTML +$pagina->MakeAll(); ?> - + \ No newline at end of file diff --git a/ieducar/intranet/educar_relatorio_diario_classe_avaliacao_conceitual_proc.php b/ieducar/intranet/educar_relatorio_diario_classe_avaliacao_conceitual_proc.php index 27057f9..5274c1f 100644 --- a/ieducar/intranet/educar_relatorio_diario_classe_avaliacao_conceitual_proc.php +++ b/ieducar/intranet/educar_relatorio_diario_classe_avaliacao_conceitual_proc.php @@ -1,6 +1,6 @@ - * @license http://creativecommons.org/licenses/GPL/2.0/legalcode.pt CC GNU GPL - * @package Core - * @subpackage Relatório - * @since Arquivo disponível desde a versão 1.0.0 - * @version $Id$ + * @author Prefeitura Municipal de Itajaí + * @category i-Educar + * @license @@license@@ + * @package iEd_Pmieducar + * @since Arquivo disponível desde a versão 1.0.0 + * @version $Id$ */ require_once 'include/clsBase.inc.php'; @@ -38,259 +34,254 @@ require_once 'include/clsBanco.inc.php'; require_once 'include/pmieducar/geral.inc.php'; require_once 'include/clsPDF.inc.php'; - +/** + * clsIndexBase class. + * + * @author Prefeitura Municipal de Itajaí + * @category i-Educar + * @license @@license@@ + * @package iEd_Pmieducar + * @since Classe disponível desde a versão 1.0.0 + * @version @@package_version@@ + */ class clsIndexBase extends clsBase { - function Formular() - { - $this->SetTitulo( "{$this->_instituicao} i-Educar - Diário de Classe - Avaliações" ); - $this->processoAp = "670"; - $this->renderMenu = false; - $this->renderMenuSuspenso = false; - } + function Formular() + { + $this->SetTitulo($this->_instituicao . ' i-Educar - Diário de Classe - Avaliações'); + $this->processoAp = 670; + $this->renderMenu = FALSE; + $this->renderMenuSuspenso = FALSE; + } } +/** + * indice class. + * + * @author Prefeitura Municipal de Itajaí + * @category i-Educar + * @license @@license@@ + * @package iEd_Pmieducar + * @since Classe disponível desde a versão 1.0.0 + * @version @@package_version@@ + */ class indice extends clsCadastro { + var $pessoa_logada; + + var $ref_cod_instituicao; + var $ref_cod_escola; + var $ref_cod_serie; + var $ref_cod_turma; + + var $ano; + var $mes; + + var $nm_escola; + var $nm_instituicao; + var $ref_cod_curso; + var $sequencial; + var $pdf; + var $pagina_atual = 1; + var $total_paginas = 1; + var $nm_professor; + var $nm_turma; + var $nm_serie; + var $nm_disciplina; + var $avaliacao_globalizada; + + var $page_y = 139; + var $get_file; + var $cursos = array(); + var $get_link; + var $total; + var $ref_cod_modulo; + var $numero_registros; + var $em_branco; + + var $meses_do_ano = array( + 1 => 'JANEIRO', + 2 => 'FEVEREIRO', + 3 => 'MARÇO', + 4 => 'ABRIL', + 5 => 'MAIO', + 6 => 'JUNHO', + 7 => 'JULHO', + 8 => 'AGOSTO', + 9 => 'SETEMBRO', + 10 => 'OUTUBRO', + 11 => 'NOVEMBRO', + 12 => 'DEZEMBRO' + ); + + function renderHTML() + { + if ($_POST) { + foreach ($_POST as $key => $value) { + $this->$key = $value; + } + } + $this->ref_cod_modulo = explode('-', $this->ref_cod_modulo); + $this->ref_cod_modulo = $this->ref_cod_modulo[1]; - /** - * Referencia pega da session para o idpes do usuario atual - * - * @var int - */ - var $pessoa_logada; - - - var $ref_cod_instituicao; - var $ref_cod_escola; - var $ref_cod_serie; - var $ref_cod_turma; - - var $ano; - var $mes; - - var $nm_escola; - var $nm_instituicao; - var $ref_cod_curso; - var $sequencial; - var $pdf; - var $pagina_atual = 1; - var $total_paginas = 1; - var $nm_professor; - var $nm_turma; - var $nm_serie; - var $nm_disciplina; - var $avaliacao_globalizada; - - var $page_y = 139; - - var $get_file; - - var $cursos = array(); - - var $get_link; - - var $total; - - //var $array_disciplinas = array(); - - var $ref_cod_modulo; - - var $numero_registros; - var $em_branco; - - var $meses_do_ano = array( - "1" => "JANEIRO" - ,"2" => "FEVEREIRO" - ,"3" => "MARÇO" - ,"4" => "ABRIL" - ,"5" => "MAIO" - ,"6" => "JUNHO" - ,"7" => "JULHO" - ,"8" => "AGOSTO" - ,"9" => "SETEMBRO" - ,"10" => "OUTUBRO" - ,"11" => "NOVEMBRO" - ,"12" => "DEZEMBRO" - ); - - - - - function renderHTML() - { - - if($_POST){ - foreach ($_POST as $key => $value) { - $this->$key = $value; - - } - } - - $this->ref_cod_modulo = explode("-",$this->ref_cod_modulo); - $this->ref_cod_modulo = $this->ref_cod_modulo[1]; - - - if($this->ref_ref_cod_serie) - $this->ref_cod_serie = $this->ref_ref_cod_serie; - - $fonte = 'arial'; - $corTexto = '#000000'; - - if(empty($this->ref_cod_turma)) - { - echo ''; - return true; - } - - - 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($det_escola['ref_cod_instituicao']); - $det_instituicao = $obj_instituicao->detalhe(); - $this->nm_instituicao = $det_instituicao['nm_instituicao']; - - } - - $obj_calendario = new clsPmieducarEscolaAnoLetivo(); - $lista_calendario = $obj_calendario->lista($this->ref_cod_escola,$this->ano,null,null,null,null,null,null,null,1,null); - - $obj_turma = new clsPmieducarTurma($this->ref_cod_turma); - $det_turma = $obj_turma->detalhe(); - $this->nm_turma = $det_turma['nm_turma']; - - $obj_serie = new clsPmieducarSerie($this->ref_cod_serie); - $det_serie = $obj_serie->detalhe(); - $this->nm_serie = $det_serie['nm_serie']; - - $obj_pessoa = new clsPessoa_($det_turma["ref_cod_regente"]); - $det = $obj_pessoa->detalhe(); - $this->nm_professor = $det["nome"]; - - if(!$lista_calendario) - { - echo ''; - return true; - } - - $prox_mes = $this->mes + 1; - $this->pdf = new clsPDF("Diário de Classe - {$this->ano}", "Diário de Classe - {$this->meses_do_ano[$this->mes]} e {$this->meses_do_ano[$prox_mes]} de {$this->ano}", "A4", "", false, false); - - //$this->pdf->largura = 842.0; - //$this->pdf->altura = 595.0; - - - $altura_linha = 15; - $inicio_escrita_y = 175; - $altura_pagina = 760; - - - $obj = new clsPmieducarSerie(); - $obj->setOrderby('cod_serie,etapa_curso'); - $lista_serie_curso = $obj->lista(null,null,null,$this->ref_cod_curso,null,null,null,null,null,null,null,null,1,$this->ref_cod_instituicao); - - $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); - $det_curso = $obj_curso->detalhe(); - - $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); - $det_curso = $obj_curso->detalhe(); + if ($this->ref_ref_cod_serie) { + $this->ref_cod_serie = $this->ref_ref_cod_serie; + } - if(!$this->em_branco) - { - $obj_matricula_turma = new clsPmieducarMatriculaTurma(); - $obj_matricula_turma->setOrderby("nome_aluno"); - $lista_matricula = $obj_matricula_turma->lista(null,$this->ref_cod_turma,null,null,null,null,null,null,1,$this->ref_cod_serie,$this->ref_cod_curso,$this->ref_cod_escola,$this->ref_cod_instituicao,null,null,null,null,null,$this->ano,null,true,null,null,true); - } + $fonte = 'arial'; + $corTexto = '#000000'; - if($lista_matricula || $this->em_branco) - { - $this->pdf->OpenPage(); - $this->addCabecalho(); - $num_aluno = 1; + if (empty($this->ref_cod_turma)) { + echo ' + '; - if($this->em_branco) - { - $lista_matricula = array(); - $this->numero_registros = $this->numero_registros? $this->numero_registros : 20; - for ($i = 0 ; $i < $this->numero_registros; $i++) - { - $lista_matricula[] = ''; - } - } + return TRUE; + } - foreach ($lista_matricula as $matricula) - { + if ($this->ref_cod_escola) { + $obj_escola = new clsPmieducarEscola($this->ref_cod_escola); + $det_escola = $obj_escola->detalhe(); + $this->nm_escola = $det_escola['nome']; - if($this->page_y > $altura_pagina) - { - $this->desenhaLinhasVertical(); - $this->pdf->ClosePage(); - $this->pdf->OpenPage(); - $this->page_y = 139; - $this->addCabecalho(); + $obj_instituicao = new clsPmieducarInstituicao($det_escola['ref_cod_instituicao']); + $det_instituicao = $obj_instituicao->detalhe(); + $this->nm_instituicao = $det_instituicao['nm_instituicao']; + } + $obj_calendario = new clsPmieducarEscolaAnoLetivo(); + $lista_calendario = $obj_calendario->lista($this->ref_cod_escola, $this->ano, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL); + + $obj_turma = new clsPmieducarTurma($this->ref_cod_turma); + $det_turma = $obj_turma->detalhe(); + $this->nm_turma = $det_turma['nm_turma']; + + $obj_serie = new clsPmieducarSerie($this->ref_cod_serie); + $det_serie = $obj_serie->detalhe(); + $this->nm_serie = $det_serie['nm_serie']; + + $obj_pessoa = new clsPessoa_($det_turma['ref_cod_regente']); + $det = $obj_pessoa->detalhe(); + $this->nm_professor = $det['nome']; + + if(!$lista_calendario) { + echo ' + '; + return true; + } - } + $prox_mes = $this->mes + 1; + $this->pdf = new clsPDF(sprintf('Diário de Classe - %s', $this->ano), + sprintf('Diário de Classe - %s e %s de %s', $this->meses_do_ano[$this->mes], $this->meses_do_ano[$prox_mes], $this->ano), + 'A4', '', FALSE, FALSE); - //$obj_matricula = new clsPmieducarMatricula($matricula['ref_cod_matricula']); - //$det_matricula = $obj_matricula->detalhe(); + $altura_linha = 15; + $inicio_escrita_y = 175; + $altura_pagina = 760; + $obj = new clsPmieducarSerie(); + $obj->setOrderby('cod_serie, etapa_curso'); + $lista_serie_curso = $obj->lista(NULL, NULL, NULL, $this->ref_cod_curso, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao); - $this->pdf->quadrado_relativo( 30, $this->page_y , 540, $altura_linha); - $this->pdf->escreve_relativo(sprintf("%02d",$num_aluno) , 38 ,$this->page_y + 4,30, 15, $fonte, 7, $corTexto, 'left' ); - $this->pdf->escreve_relativo($matricula['nome_aluno'] , 55 ,$this->page_y + 4,160, 15, $fonte, 7, $corTexto, 'left' ); - $num_aluno++; - $this->page_y +=$altura_linha; + $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); + $det_curso = $obj_curso->detalhe(); + $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); + $det_curso = $obj_curso->detalhe(); + if (!$this->em_branco) { + $obj_matricula_turma = new clsPmieducarMatriculaTurma(); + $obj_matricula_turma->setOrderby('nome_aluno'); - } + $lista_matricula = $obj_matricula_turma->lista(null, $this->ref_cod_turma, + NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_serie, $this->ref_cod_curso, + $this->ref_cod_escola, $this->ref_cod_instituicao, NULL, NULL, NULL, NULL, + NULL, $this->ano, NULL, TRUE, NULL, NULL, TRUE); + } - $this->desenhaLinhasVertical(); + if ($lista_matricula || $this->em_branco) { + $this->pdf->OpenPage(); + $this->addCabecalho(); + $num_aluno = 1; - $this->rodape(); - $this->pdf->ClosePage(); - } - else - { + if ($this->em_branco) { + $lista_matricula = array(); + $this->numero_registros = $this->numero_registros ? $this->numero_registros : 20; - echo ''; + for ($i = 0; $i < $this->numero_registros; $i++) { + $lista_matricula[] = ''; + } + } - return; - } + foreach ($lista_matricula as $matricula) { + if($this->page_y > $altura_pagina) { + $this->desenhaLinhasVertical(); + $this->pdf->ClosePage(); + $this->pdf->OpenPage(); + $this->page_y = 139; + $this->addCabecalho(); + } + $this->pdf->quadrado_relativo(30, $this->page_y, 540, $altura_linha); - //header( "location: " . $this->pdf->GetLink() ); - $this->pdf->CloseFile(); - $this->get_link = $this->pdf->GetLink(); + $this->pdf->escreve_relativo(sprintf('%02d', $num_aluno), 38, $this->page_y + 4, + 30, 15, $fonte, 7, $corTexto, 'left'); + $this->pdf->escreve_relativo($matricula['nome_aluno'], 55, $this->page_y + 4, + 160, 15, $fonte, 7, $corTexto, 'left'); + $num_aluno++; + $this->page_y += $altura_linha; + } + $this->desenhaLinhasVertical(); - echo ""; + $this->rodape(); + $this->pdf->ClosePage(); + } + else { + echo ' + '; - echo "
Se o download não iniciar automaticamente
clique aqui!

- Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.
+ return; + } - Clique na Imagem para Baixar o instalador

-
-
-
"; - } + $this->pdf->CloseFile(); + $this->get_link = $this->pdf->GetLink(); + + echo sprintf(' + ', $this->get_link); + + echo sprintf(' + +
+ Se o download não iniciar automaticamente
+ clique aqui!

+ + Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.
+ Clique na Imagem para Baixar o instalador

+
+
+
+ ', $this->get_link); + } public function addCabecalho() { @@ -316,19 +307,23 @@ class indice extends clsCadastro // Título principal $titulo = $config->get($config->titulo, 'i-Educar'); - $this->pdf->escreve_relativo($titulo, 30, 30, 782, 80, $fonte, 18, - $corTexto, 'center'); - $this->pdf->escreve_relativo(date("d/m/Y"), 510, 100, 782, 80, $fonte, 10, + + $this->pdf->escreve_relativo($titulo, 30, 30, 782, 80, $fonte, 18, $corTexto, 'center'); + + $this->pdf->escreve_relativo(date('d/m/Y'), 510, 100, 782, 80, $fonte, 10, $corTexto, 'left'); // Dados escola - $this->pdf->escreve_relativo("Instituição:$this->nm_instituicao", 120, 52, + $this->pdf->escreve_relativo("Instituição: $this->nm_instituicao", 120, 52, 300, 80, $fonte, 7, $corTexto, 'left' ); - $this->pdf->escreve_relativo("Escola:{$this->nm_escola}",132, 64, 300, 80, + + $this->pdf->escreve_relativo("Escola: {$this->nm_escola}", 132, 64, 300, 80, $fonte, 7, $corTexto, 'left'); + $dif = 0; + if ($this->nm_professor) { - $this->pdf->escreve_relativo("Prof.Regente:{$this->nm_professor}",111, 76, + $this->pdf->escreve_relativo("Prof. Regente: {$this->nm_professor}", 111, 76, 300, 80, $fonte, 7, $corTexto, 'left'); } else { @@ -337,10 +332,12 @@ class indice extends clsCadastro $this->pdf->escreve_relativo("Série: {$this->nm_serie}", 138, 88 - $dif, 300, 80, $fonte, 7, $corTexto, 'left'); + $this->pdf->escreve_relativo("Turma: {$this->nm_turma}", 134, 100 - $dif, 300, 80, $fonte, 7, $corTexto, 'left'); - $this->pdf->escreve_relativo("BIMESTRE {$this->ref_cod_modulo}/2007",134, - 100 , 300, 80, $fonte, 7, $corTexto, 'right'); + + $this->pdf->escreve_relativo("BIMESTRE {$this->ref_cod_modulo}/2007", 134, + 100, 300, 80, $fonte, 7, $corTexto, 'right'); $this->pdf->escreve_relativo("D I Á R I O D E A V A L I A Ç Ã O - $this->nm_serie", 30, 75, 782, 80, $fonte, 12, $corTexto, 'center'); @@ -348,122 +345,102 @@ class indice extends clsCadastro $obj_modulo = new clsPmieducarModulo($this->ref_cod_modulo); $det_modulo = $obj_modulo->detalhe(); - $this->pdf->linha_relativa(201,125,0,14); - $this->pdf->linha_relativa(201,125,369,0); - $this->pdf->escreve_relativo("COMPETÊNCIAS", 195, 128, 350, 80, $fonte, + $this->pdf->linha_relativa(201, 125, 0, 14); + $this->pdf->linha_relativa(201, 125, 369, 0); + $this->pdf->escreve_relativo('COMPETÊNCIAS', 195, 128, 350, 80, $fonte, 7, $corTexto, 'center'); - $this->pdf->linha_relativa(30,139,0,20); + $this->pdf->linha_relativa(30, 139, 0, 20); - $this->pdf->linha_relativa(30,139,540,0); + $this->pdf->linha_relativa(30, 139, 540, 0); - $this->pdf->escreve_relativo("Nº", 36, 145, 100, 80, $fonte, 7, $corTexto, + $this->pdf->escreve_relativo('Nº', 36, 145, 100, 80, $fonte, 7, $corTexto, 'left'); - $this->pdf->escreve_relativo("Nome", 110, 145, 100, 80, $fonte, 7, - $corTexto, 'left' ); - - $this->page_y +=19; - $this->pdf->escreve_relativo("Dias de aula: {$this->total}", 715, 100, - 535, 80, $fonte, 10, $corTexto, 'left'); - } - - - function desenhaLinhasVertical() - { - $corTexto = '#000000'; - /** - * - */ - $this->total = 16; - $largura_anos = 396; - - if($this->total >= 1) - { - - $incremental = floor($largura_anos/ ($this->total )) ; - - }else { - - $incremental = 1; - } - - $reta_ano_x = 200 ; - - - $resto = $largura_anos - ($incremental * $this->total); - - for($linha = 0;$linha <$this->total-1;$linha++) - { + $this->pdf->escreve_relativo('Nome', 110, 145, 100, 80, $fonte, 7, + $corTexto, 'left'); - if(( $resto > 0) /*|| ($linha + 1 == $total && $resto >= 1) */|| $linha == 0) - { - $reta_ano_x++; - $resto--; - } + $this->page_y += 19; + $this->pdf->escreve_relativo('Dias de aula: ' . $this->total, 715, 100, 535, + 80, $fonte, 10, $corTexto, 'left'); + } - $this->pdf->linha_relativa($reta_ano_x,139,0,$this->page_y - 139); - $this->pdf->escreve_relativo( $linha + 1,$reta_ano_x , 145, $incremental, 80, $fonte, 7, $corTexto, 'center' ); + function desenhaLinhasVertical() + { + $corTexto = '#000000'; + $this->total = 16; + $largura_anos = 396; - $reta_ano_x += $incremental; + if ($this->total >= 1) { + $incremental = floor($largura_anos / ($this->total)); + } + else { + $incremental = 1; + } - } + $reta_ano_x = 200 ; + $resto = $largura_anos - ($incremental * $this->total); - $this->pdf->linha_relativa(50,139,0,$this->page_y - 139); - $this->pdf->linha_relativa(812,125,0,$this->page_y - 139); + for ($linha = 0; $linha < $this->total - 1; $linha++) { + if (($resto > 0) || $linha == 0) { + $reta_ano_x++; + $resto--; + } + $this->pdf->linha_relativa($reta_ano_x, 139, 0, $this->page_y - 139); + $this->pdf->escreve_relativo($linha + 1, $reta_ano_x, 145, $incremental, + 80, $fonte, 7, $corTexto, 'center'); - $this->pdf->linha_relativa(570,125,0,$this->page_y - 139); - //$this->pdf->escreve_relativo( "Faltas",40, 128, 100, 80, $fonte, 7, $corTexto, 'left' ); + $reta_ano_x += $incremental; + } + $this->pdf->linha_relativa(50, 139, 0, $this->page_y - 139); + $this->pdf->linha_relativa(812, 125, 0, $this->page_y - 139); + $this->pdf->linha_relativa(570, 125, 0, $this->page_y - 139); + } - /** - * - */ - } + function rodape() + { + $corTexto = '#000000'; + $fonte = 'arial'; + $dataAtual = date('d/m/Y'); - function rodape() - { - $corTexto = '#000000'; - $fonte = 'arial'; - $dataAtual = date("d/m/Y"); - $this->pdf->escreve_relativo( "LEGENDA: \n + $this->pdf->escreve_relativo("LEGENDA: \n D = Desenvolvida PD = Parcialmente Desenvolvida ID = Iniciando o Desenvolvimento ND = Não Desenvolvida -CNA = Competência Não Avaliada", 36,750, 200, 50, $fonte, 7, $corTexto, 'left' ); +CNA = Competência Não Avaliada", 36,750, 200, 50, $fonte, 7, $corTexto, 'left'); - $this->pdf->escreve_relativo( "Data: ____/____/_______", 200,810, 100, 50, $fonte, 7, $corTexto, 'left' ); + $this->pdf->escreve_relativo('Data: ____/____/_______', 200, 810, 100, 50, + $fonte, 7, $corTexto, 'left'); - //$this->pdf->escreve_relativo( "Assinatura do Professor(a)", 450,660, 100, 50, $fonte, 7, $corTexto, 'left' ); - //$this->pdf->escreve_relativo( "Assinatura do Diretor(a)", 68,520, 100, 50, $fonte, 7, $corTexto, 'left' ); - $this->pdf->escreve_relativo( "Assinatura do Professor(a)", 450,780, 100, 50, $fonte, 7, $corTexto, 'left' ); - //$this->pdf->linha_relativa(52,517,130,0); - $this->pdf->linha_relativa(430,775,130,0); - } + $this->pdf->escreve_relativo('Assinatura do Professor(a)', 450, 780, 100, 50, + $fonte, 7, $corTexto, 'left'); - function Editar() - { - return false; - } + $this->pdf->linha_relativa(430, 775, 130, 0); + } - function Excluir() - { - return false; - } + function Editar() + { + return FALSE; + } + function Excluir() + { + return FALSE; + } } -// cria uma extensao da classe base +// Instancia objeto de página $pagina = new clsIndexBase(); -// cria o conteudo + +// Instancia objeto de conteúdo $miolo = new indice(); -// adiciona o conteudo na clsBase -$pagina->addForm( $miolo ); -// gera o html -$pagina->MakeAll(); +// Atribui o conteúdo à página +$pagina->addForm($miolo); -?> +// Gera o código HTML +$pagina->MakeAll(); \ No newline at end of file diff --git a/ieducar/intranet/educar_relatorio_diario_classe_avaliacao_proc.php b/ieducar/intranet/educar_relatorio_diario_classe_avaliacao_proc.php index bc41f68..fff2c42 100644 --- a/ieducar/intranet/educar_relatorio_diario_classe_avaliacao_proc.php +++ b/ieducar/intranet/educar_relatorio_diario_classe_avaliacao_proc.php @@ -1,6 +1,6 @@ - * @license http://creativecommons.org/licenses/GPL/2.0/legalcode.pt CC GNU GPL - * @package Core - * @subpackage Relatório - * @since Arquivo disponível desde a versão 1.0.0 - * @version $Id$ + * @author Prefeitura Municipal de Itajaí + * @category i-Educar + * @license @@license@@ + * @package iEd_Pmieducar + * @since Arquivo disponível desde a versão 1.0.0 + * @version $Id$ */ require_once 'include/clsBase.inc.php'; @@ -38,382 +34,366 @@ require_once 'include/clsBanco.inc.php'; require_once 'include/pmieducar/geral.inc.php'; require_once 'include/clsPDF.inc.php'; - +/** + * clsIndexBase class. + * + * @author Prefeitura Municipal de Itajaí + * @category i-Educar + * @license @@license@@ + * @package iEd_Pmieducar + * @since Classe disponível desde a versão 1.0.0 + * @version @@package_version@@ + */ class clsIndexBase extends clsBase { - function Formular() - { - $this->SetTitulo( "{$this->_instituicao} i-Educar - Diário de Classe - Avaliações" ); - $this->processoAp = "670"; - $this->renderMenu = false; - $this->renderMenuSuspenso = false; - } + function Formular() + { + $this->SetTitulo($this->_instituicao . ' i-Educar - Diário de Classe - Avaliações'); + $this->processoAp = 670; + $this->renderMenu = FALSE; + $this->renderMenuSuspenso = FALSE; + } } +/** + * indice class. + * + * @author Prefeitura Municipal de Itajaí + * @category i-Educar + * @license @@license@@ + * @package iEd_Pmieducar + * @since Classe disponível desde a versão 1.0.0 + * @version @@package_version@@ + */ class indice extends clsCadastro { + var $pessoa_logada; + + var $ref_cod_instituicao; + var $ref_cod_escola; + var $ref_cod_serie; + var $ref_cod_turma; + + var $ano; + var $mes; + + var $nm_escola; + var $nm_instituicao; + var $ref_cod_curso; + var $sequencial; + var $pdf; + var $pagina_atual = 1; + var $total_paginas = 1; + var $nm_professor; + var $nm_turma; + var $nm_serie; + var $nm_disciplina; + var $avaliacao_globalizada; + + var $page_y = 139; + + var $get_file; + + var $cursos = array(); + + var $get_link; + + var $total; + + var $ref_cod_modulo; + + var $numero_registros; + var $em_branco; + + var $meses_do_ano = array( + 1 => 'JANEIRO', + 2 => 'FEVEREIRO', + 3 => 'MARÇO', + 4 => 'ABRIL', + 5 => 'MAIO', + 6 => 'JUNHO', + 7 => 'JULHO', + 8 => 'AGOSTO', + 9 => 'SETEMBRO', + 10 => 'OUTUBRO', + 11 => 'NOVEMBRO', + 12 => 'DEZEMBRO' + ); + + 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; + } - /** - * Referencia pega da session para o idpes do usuario atual - * - * @var int - */ - var $pessoa_logada; - - - var $ref_cod_instituicao; - var $ref_cod_escola; - var $ref_cod_serie; - var $ref_cod_turma; - - var $ano; - var $mes; - - var $nm_escola; - var $nm_instituicao; - var $ref_cod_curso; - var $sequencial; - var $pdf; - var $pagina_atual = 1; - var $total_paginas = 1; - var $nm_professor; - var $nm_turma; - var $nm_serie; - var $nm_disciplina; - var $avaliacao_globalizada; - - var $page_y = 139; - - var $get_file; - - var $cursos = array(); - - var $get_link; - - var $total; - - //var $array_disciplinas = array(); - - var $ref_cod_modulo; - - var $numero_registros; - var $em_branco; - - var $meses_do_ano = array( - "1" => "JANEIRO" - ,"2" => "FEVEREIRO" - ,"3" => "MARÇO" - ,"4" => "ABRIL" - ,"5" => "MAIO" - ,"6" => "JUNHO" - ,"7" => "JULHO" - ,"8" => "AGOSTO" - ,"9" => "SETEMBRO" - ,"10" => "OUTUBRO" - ,"11" => "NOVEMBRO" - ,"12" => "DEZEMBRO" - ); - - - 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; - - $fonte = 'arial'; - $corTexto = '#000000'; - - if(empty($this->ref_cod_turma)) - { - echo ''; - return true; - } - - - 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($det_escola['ref_cod_instituicao']); - $det_instituicao = $obj_instituicao->detalhe(); - $this->nm_instituicao = $det_instituicao['nm_instituicao']; - - } + $fonte = 'arial'; + $corTexto = '#000000'; - $obj_calendario = new clsPmieducarEscolaAnoLetivo(); - $lista_calendario = $obj_calendario->lista($this->ref_cod_escola,$this->ano,null,null,null,null,null,null,null,1,null); + if (empty($this->ref_cod_turma)) + { + echo ' + '; - $obj_turma = new clsPmieducarTurma($this->ref_cod_turma); - $det_turma = $obj_turma->detalhe(); - $this->nm_turma = $det_turma['nm_turma']; + return TRUE; + } - $obj_serie = new clsPmieducarSerie($this->ref_cod_serie); - $det_serie = $obj_serie->detalhe(); - $this->nm_serie = $det_serie['nm_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_pessoa = new clsPessoa_($det_turma["ref_cod_regente"]); - $det = $obj_pessoa->detalhe(); - $this->nm_professor = $det["nome"]; + $obj_instituicao = new clsPmieducarInstituicao($det_escola['ref_cod_instituicao']); + $det_instituicao = $obj_instituicao->detalhe(); + $this->nm_instituicao = $det_instituicao['nm_instituicao']; + } - if(!$lista_calendario) - { - echo ''; - return true; - } + $obj_calendario = new clsPmieducarEscolaAnoLetivo(); + $lista_calendario = $obj_calendario->lista($this->ref_cod_escola, $this->ano, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL); - $prox_mes = $this->mes + 1; - $this->pdf = new clsPDF("Diário de Classe - {$this->ano}", "Diário de Classe - {$this->meses_do_ano[$this->mes]} e {$this->meses_do_ano[$prox_mes]} de {$this->ano}", "A4", "", false, false); + $obj_turma = new clsPmieducarTurma($this->ref_cod_turma); + $det_turma = $obj_turma->detalhe(); + $this->nm_turma = $det_turma['nm_turma']; - //$this->pdf->largura = 842.0; - //$this->pdf->altura = 595.0; + $obj_serie = new clsPmieducarSerie($this->ref_cod_serie); + $det_serie = $obj_serie->detalhe(); + $this->nm_serie = $det_serie['nm_serie']; - $altura_linha = 15; - $inicio_escrita_y = 175; - $altura_pagina = 760; + $obj_pessoa = new clsPessoa_($det_turma["ref_cod_regente"]); + $det = $obj_pessoa->detalhe(); + $this->nm_professor = $det["nome"]; + if (!$lista_calendario) { + echo ' + '; - $obj = new clsPmieducarSerie(); - $obj->setOrderby('cod_serie,etapa_curso'); - $lista_serie_curso = $obj->lista(null,null,null,$this->ref_cod_curso,null,null,null,null,null,null,null,null,1,$this->ref_cod_instituicao); - - $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); - $det_curso = $obj_curso->detalhe(); - - $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); - $det_curso = $obj_curso->detalhe(); - - //if($det_curso['falta_ch_globalizada']) - if($det_curso['falta_ch_globalizada'] && $det_curso['avaliacao_globalizada'] == 't') - { - if(!$this->em_branco) - { - $obj_matricula_turma = new clsPmieducarMatriculaTurma(); - $obj_matricula_turma->setOrderby("nome_aluno"); - $lista_matricula = $obj_matricula_turma->lista(null,$this->ref_cod_turma,null,null,null,null,null,null,1,$this->ref_cod_serie,$this->ref_cod_curso,$this->ref_cod_escola,$this->ref_cod_instituicao,null,null,null,null,null,$this->ano,null,true,null,null,true); - } - if($lista_matricula || $this->em_branco) - { - $this->pdf->OpenPage(); - $this->addCabecalho(); - $num_aluno = 1; - - if($this->em_branco) - { - $lista_matricula = array(); - $this->numero_registros = $this->numero_registros? $this->numero_registros : 20; - for ($i = 0 ; $i < $this->numero_registros; $i++) - { - $lista_matricula[] = ''; - } - } - - foreach ($lista_matricula as $matricula) - { - - if($this->page_y > $altura_pagina) - { - $this->desenhaLinhasVertical(); - $this->pdf->ClosePage(); - $this->pdf->OpenPage(); - $this->page_y = 139; - $this->addCabecalho(); - - - } - - //$obj_matricula = new clsPmieducarMatricula($matricula['ref_cod_matricula']); - //$det_matricula = $obj_matricula->detalhe(); - - //$obj_aluno = new clsPmieducarAluno(); - - //$det_aluno = array_shift($obj_aluno->lista($det_matricula['ref_cod_aluno'])); - - $this->pdf->quadrado_relativo( 30, $this->page_y , 540, $altura_linha); - $this->pdf->escreve_relativo(sprintf("%02d",$num_aluno) , 38 ,$this->page_y + 4,30, 15, $fonte, 7, $corTexto, 'left' ); - $this->pdf->escreve_relativo($matricula['nome_aluno'] , 55 ,$this->page_y + 4,160, 15, $fonte, 7, $corTexto, 'left' ); - $num_aluno++; - $this->page_y +=$altura_linha; - - - - } - - $this->desenhaLinhasVertical(); - - $this->rodape(); - $this->pdf->ClosePage(); - } - else - { - - echo ''; - - return; - } - - - //header( "location: " . $this->pdf->GetLink() ); - $this->pdf->CloseFile(); - $this->get_link = $this->pdf->GetLink(); - - } - else - { - /** - * CARGA HORARIA NAO GLOBALIZADA - * GERAR UMA PAGINA PARA CADA DISICIPLINA - */ - - //$obj_turma_disc = new clsPmieducarTurmaDisciplina(); - $obj_turma_disc = new clsPmieducarDisciplinaSerie(); - $obj_turma_disc->setCamposLista("ref_cod_disciplina"); - $lst_turma_disc = $obj_turma_disc->lista(null,$this->ref_cod_serie,1); - if($lst_turma_disc) - { - foreach ($lst_turma_disc as $disciplina) { - $obj_disc = new clsPmieducarDisciplina($disciplina); - $det_disc = $obj_disc->detalhe(); - $this->nm_disciplina = $det_disc['nm_disciplina']; - $this->page_y = 139; - - /** - * numero de semanas dos meses - */ - $obj_quadro = new clsPmieducarQuadroHorario(); - $obj_quadro->setCamposLista("cod_quadro_horario"); - $quadro_horario = $obj_quadro->lista(null,null,null,$this->ref_cod_turma, null, null, null, null,1); - if(!$quadro_horario && $det_curso['avaliacao_globalizada'] == 't') - { - echo ''; - break; - } - - $obj_quadro_horarios = new clsPmieducarQuadroHorarioHorarios(); - $obj_quadro_horarios->setCamposLista("dia_semana"); - $obj_quadro_horarios->setOrderby("1 asc"); - - $lista_quadro_horarios = $obj_quadro_horarios->lista($quadro_horario,$this->ref_cod_serie,$this->ref_cod_escola,$disciplina,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1); - - if(!$this->em_branco) - { - $obj_matricula_turma = new clsPmieducarMatriculaTurma(); - $obj_matricula_turma->setOrderby("nome_ascii"); - $lista_matricula = $obj_matricula_turma->lista(null,$this->ref_cod_turma,null,null,null,null,null,null,1,$this->ref_cod_serie,$this->ref_cod_curso,$this->ref_cod_escola,$this->ref_cod_instituicao,null,null,array( 1, 2, 3 ),null,null,$this->ano,null,true,null,null,true); - } - $num_aluno = 1; - if($lista_matricula || $this->em_branco) - { - $this->pdf->OpenPage(); - $this->addCabecalho(); - - if($this->em_branco) - { - $lista_matricula = array(); - $this->numero_registros = $this->numero_registros? $this->numero_registros : 20; - for ($i = 0 ; $i < $this->numero_registros; $i++) - { - $lista_matricula[] = ''; - } - } - foreach ($lista_matricula as $matricula) - { - - if($this->page_y > $altura_pagina) - { - $this->desenhaLinhasVertical(); - $this->pdf->ClosePage(); - $this->pdf->OpenPage(); - $this->page_y = 139; - $this->addCabecalho(); - - - } - - //$obj_matricula = new clsPmieducarMatricula($matricula['ref_cod_matricula']); - //$det_matricula = $obj_matricula->detalhe(); - - //$obj_aluno = new clsPmieducarAluno(); - //$det_aluno = array_shift($obj_aluno->lista($det_matricula['ref_cod_aluno'])); - - $this->pdf->quadrado_relativo( 30, $this->page_y , 540, $altura_linha); - $this->pdf->escreve_relativo($num_aluno , 38 ,$this->page_y + 4,30, 15, $fonte, 7, $corTexto, 'left' ); - $this->pdf->escreve_relativo($matricula['nome_aluno'] , 55 ,$this->page_y + 4,160, 15, $fonte, 7, $corTexto, 'left' ); - - $num_aluno++; - $this->page_y +=$altura_linha; - - - - } - $this->desenhaLinhasVertical(); - $this->rodape(); - $this->pdf->ClosePage(); - } - else - { - - echo ''; - - return; - } - - - } - /** - * gera diario de clase de avaliacoes - */ - $this->pdf->CloseFile(); - $this->get_link = $this->pdf->GetLink(); - } - else - { - - echo ''; - - return; - } - - - //header( "location: " . $this->pdf->GetLink() ); - - } - - echo ""; + return TRUE; + } - echo "
Se o download não iniciar automaticamente
clique aqui!

- Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.
+ $prox_mes = $this->mes + 1; + $this->pdf = new clsPDF('Diário de Classe - ' . $this->ano, + "Diário de Classe - {$this->meses_do_ano[$this->mes]} e {$this->meses_do_ano[$prox_mes]} de {$this->ano}", + 'A4', '', FALSE, FALSE); + + $altura_linha = 15; + $inicio_escrita_y = 175; + $altura_pagina = 760; + + $obj = new clsPmieducarSerie(); + $obj->setOrderby('cod_serie, etapa_curso'); + $lista_serie_curso = $obj->lista(NULL, NULL, NULL,$this->ref_cod_curso, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao); + + $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); + $det_curso = $obj_curso->detalhe(); + + $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); + $det_curso = $obj_curso->detalhe(); + + if ($det_curso['falta_ch_globalizada'] && $det_curso['avaliacao_globalizada'] == 't') { + if (!$this->em_branco) { + $obj_matricula_turma = new clsPmieducarMatriculaTurma(); + $obj_matricula_turma->setOrderby('nome_aluno'); + $lista_matricula = $obj_matricula_turma->lista(NULL, $this->ref_cod_turma, + NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_serie, $this->ref_cod_curso, + $this->ref_cod_escola, $this->ref_cod_instituicao, NULL, NULL, NULL, NULL, + NULL, $this->ano, NULL, TRUE, NULL, NULL, TRUE); + } + + if($lista_matricula || $this->em_branco) { + $this->pdf->OpenPage(); + $this->addCabecalho(); + $num_aluno = 1; + + if ($this->em_branco) { + $lista_matricula = array(); + $this->numero_registros = $this->numero_registros? $this->numero_registros : 20; + + for ($i = 0 ; $i < $this->numero_registros; $i++) { + $lista_matricula[] = ''; + } + } + + foreach ($lista_matricula as $matricula) { + if($this->page_y > $altura_pagina) { + $this->desenhaLinhasVertical(); + $this->pdf->ClosePage(); + $this->pdf->OpenPage(); + $this->page_y = 139; + $this->addCabecalho(); + } + + $this->pdf->quadrado_relativo( 30, $this->page_y , 540, $altura_linha); + $this->pdf->escreve_relativo(sprintf("%02d",$num_aluno) , 38 ,$this->page_y + 4,30, 15, $fonte, 7, $corTexto, 'left' ); + $this->pdf->escreve_relativo($matricula['nome_aluno'] , 55 ,$this->page_y + 4,160, 15, $fonte, 7, $corTexto, 'left' ); + + $num_aluno++; + $this->page_y +=$altura_linha; + } + + $this->desenhaLinhasVertical(); + + $this->rodape(); + $this->pdf->ClosePage(); + } + else { + echo ' + '; + + return; + } + + $this->pdf->CloseFile(); + $this->get_link = $this->pdf->GetLink(); + } + else { + $obj_turma_disc = new clsPmieducarDisciplinaSerie(); + $obj_turma_disc->setCamposLista('ref_cod_disciplina'); + $lst_turma_disc = $obj_turma_disc->lista(NULL, $this->ref_cod_serie, 1); + + if ($lst_turma_disc) { + foreach ($lst_turma_disc as $disciplina) { + $obj_disc = new clsPmieducarDisciplina($disciplina); + $det_disc = $obj_disc->detalhe(); + $this->nm_disciplina = $det_disc['nm_disciplina']; + $this->page_y = 139; + + // Número de semanas dos meses + $obj_quadro = new clsPmieducarQuadroHorario(); + $obj_quadro->setCamposLista("cod_quadro_horario"); + $quadro_horario = $obj_quadro->lista(NULL, NULL, NULL,$this->ref_cod_turma, + NULL, NULL, NULL, NULL, 1); + + if (!$quadro_horario && $det_curso['avaliacao_globalizada'] == 't') { + echo ' + '; + break; + } + + $obj_quadro_horarios = new clsPmieducarQuadroHorarioHorarios(); + $obj_quadro_horarios->setCamposLista('dia_semana'); + $obj_quadro_horarios->setOrderby('1 asc'); + + $lista_quadro_horarios = $obj_quadro_horarios->lista($quadro_horario, + $this->ref_cod_serie, $this->ref_cod_escola, $disciplina, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1); + + if (!$this->em_branco) { + $obj_matricula_turma = new clsPmieducarMatriculaTurma(); + $obj_matricula_turma->setOrderby('nome_ascii'); + $lista_matricula = $obj_matricula_turma->lista( NULL, $this->ref_cod_turma, + NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_serie, + $this->ref_cod_curso, $this->ref_cod_escola, $this->ref_cod_instituicao, + NULL, NULL, array(1, 2, 3), NULL, NULL, $this->ano, NULL, TRUE, + NULL, NULL, TRUE); + } + + $num_aluno = 1; + + if ($lista_matricula || $this->em_branco) { + $this->pdf->OpenPage(); + $this->addCabecalho(); + + if ($this->em_branco) { + $lista_matricula = array(); + $this->numero_registros = $this->numero_registros ? + $this->numero_registros : 20; + + for ($i = 0 ; $i < $this->numero_registros; $i++) { + $lista_matricula[] = ''; + } + } + + foreach ($lista_matricula as $matricula) { + if($this->page_y > $altura_pagina) { + $this->desenhaLinhasVertical(); + $this->pdf->ClosePage(); + $this->pdf->OpenPage(); + $this->page_y = 139; + $this->addCabecalho(); + } + + $this->pdf->quadrado_relativo(30, $this->page_y , 540, $altura_linha); + + $this->pdf->escreve_relativo($num_aluno, 38 ,$this->page_y + 4, + 30, 15, $fonte, 7, $corTexto, 'left'); + + $this->pdf->escreve_relativo($matricula['nome_aluno'] , 55, + $this->page_y + 4, 160, 15, $fonte, 7, $corTexto, 'left'); + + $num_aluno++; + $this->page_y +=$altura_linha; + } + + $this->desenhaLinhasVertical(); + $this->rodape(); + $this->pdf->ClosePage(); + } + else { + echo ' + '; + + return; + } + } + + $this->pdf->CloseFile(); + $this->get_link = $this->pdf->GetLink(); + } + else { + echo ' + '; + + return; + } + } - Clique na Imagem para Baixar o instalador

-
-
-
"; - } + echo sprintf(' + ', $this->get_link); + + echo sprintf(' + +
+ Se o download não iniciar automaticamente
+ clique aqui!

+ + Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.
+ Clique na Imagem para Baixar o instalador

+
+
+
+ ', $this->get_link); + } public function addCabecalho() { @@ -434,7 +414,7 @@ class indice extends clsCadastro // Cabeçalho $logo = $config->get($config->logo, 'imagens/brasao.gif'); - $this->pdf->quadrado_relativo( 30, $altura, 540, 85 ); + $this->pdf->quadrado_relativo(30, $altura, 540, 85); $this->pdf->insertImageScaled('gif', $logo, 50, 95, 41); // Título principal @@ -443,25 +423,29 @@ class indice extends clsCadastro $corTexto, 'center'); // Dados escola - $this->pdf->escreve_relativo("Instituição:$this->nm_instituicao", 120, 52, + $this->pdf->escreve_relativo('Instituição: ' . $this->nm_instituicao, 120, 52, 300, 80, $fonte, 7, $corTexto, 'left' ); - $this->pdf->escreve_relativo("Escola:{$this->nm_escola}",132, 64, 300, 80, + + $this->pdf->escreve_relativo('Escola: ' . $this->nm_escola,132, 64, 300, 80, $fonte, 7, $corTexto, 'left'); + $dif = 0; if($this->nm_professor) { - $this->pdf->escreve_relativo( "Prof.Regente:{$this->nm_professor}",111, 76, 300, 80, $fonte, 7, $corTexto, 'left' ); + $this->pdf->escreve_relativo('Prof. Regente: ' . $this->nm_professor,111, + 76, 300, 80, $fonte, 7, $corTexto, 'left'); } else { $dif = 12; } - $this->pdf->escreve_relativo("Série:{$this->nm_serie}",138, 88 - $dif, 300, - 80, $fonte, 7, $corTexto, 'left' ); - $this->pdf->escreve_relativo("Turma:{$this->nm_turma}",134, 100 - $dif, 300, - 80, $fonte, 7, $corTexto, 'left' ); + $this->pdf->escreve_relativo('Série: ' . $this->nm_serie, 138, 88 - $dif, + 300, 80, $fonte, 7, $corTexto, 'left'); + + $this->pdf->escreve_relativo('Turma: ' . $this->nm_turma, 134, 100 - $dif, + 300, 80, $fonte, 7, $corTexto, 'left'); - $this->pdf->escreve_relativo("Diário de Classe - {$this->nm_disciplina}", + $this->pdf->escreve_relativo('Diário de Classe - ' . $this->nm_disciplina, 30, 75, 782, 80, $fonte, 12, $corTexto, 'center'); $obj_modulo = new clsPmieducarModulo($this->ref_cod_modulo); @@ -469,114 +453,92 @@ class indice extends clsCadastro $this->pdf->linha_relativa(201, 125, 0, 14); $this->pdf->linha_relativa(201, 125, 369, 0); - $this->pdf->escreve_relativo("Avaliações", 195, 128, 350, 80, $fonte, 7, + $this->pdf->escreve_relativo('Avaliações', 195, 128, 350, 80, $fonte, 7, $corTexto, 'center'); $this->pdf->linha_relativa(543, 125, 0, 14); $this->pdf->linha_relativa(30, 139, 0, 20); $this->pdf->linha_relativa(30, 139, 513, 0); - $this->pdf->escreve_relativo("Média", 538, 137, 35, 80, $fonte, 7, + $this->pdf->escreve_relativo('Média', 538, 137, 35, 80, $fonte, 7, $corTexto, 'center'); - $this->pdf->escreve_relativo("Nº", 36, 145, 100, 80, $fonte, 7, - $corTexto, 'left'); - $this->pdf->escreve_relativo("Nome",110, 145, 100, 80, $fonte, 7, $corTexto, - 'left'); + $this->pdf->escreve_relativo('Nº', 36, 145, 100, 80, $fonte, 7, $corTexto, 'left'); + $this->pdf->escreve_relativo('Nome', 110, 145, 100, 80, $fonte, 7, $corTexto, 'left'); $this->page_y +=19; - $this->pdf->escreve_relativo("Dias de aula: {$this->total}", 715, 100, 535, + + $this->pdf->escreve_relativo('Dias de aula: ' . $this->total, 715, 100, 535, 80, $fonte, 10, $corTexto, 'left'); } + function desenhaLinhasVertical() + { + $corTexto = '#000000'; - function desenhaLinhasVertical() - { - $corTexto = '#000000'; - /** - * - */ - - $this->total = 10; - $largura_anos = 380; - - if($this->total >= 1) - { - - $incremental = floor($largura_anos/ ($this->total )) ; - - }else { - - $incremental = 1; - } - - $reta_ano_x = 200 ; - - - $resto = $largura_anos - ($incremental * $this->total); - - for($linha = 0;$linha <$this->total;$linha++) - { - - if(( $resto > 0) /*|| ($linha + 1 == $total && $resto >= 1) */|| $linha == 0) - { - $reta_ano_x++; - $resto--; - } - - $this->pdf->linha_relativa($reta_ano_x,139,0,$this->page_y - 139); - + $this->total = 10; + $largura_anos = 380; - $reta_ano_x += $incremental; + if ($this->total >= 1) { + $incremental = floor($largura_anos/ ($this->total)) ; + } + else { + $incremental = 1; + } - } + $reta_ano_x = 200 ; - $this->pdf->linha_relativa(50,139,0,$this->page_y - 139); - $this->pdf->linha_relativa(812,125,0,$this->page_y - 139); + $resto = $largura_anos - ($incremental * $this->total); + for ($linha = 0; $linha < $this->total; $linha++) { + if (($resto > 0) || $linha == 0) { + $reta_ano_x++; + $resto--; + } - $this->pdf->linha_relativa(570,125,0,$this->page_y - 139); - //$this->pdf->escreve_relativo( "Faltas",40, 128, 100, 80, $fonte, 7, $corTexto, 'left' ); + $this->pdf->linha_relativa($reta_ano_x, 139, 0, $this->page_y - 139); + $reta_ano_x += $incremental; + } - /** - * - */ - } + $this->pdf->linha_relativa(50, 139, 0, $this->page_y - 139); + $this->pdf->linha_relativa(812, 125, 0, $this->page_y - 139); + $this->pdf->linha_relativa(570, 125, 0, $this->page_y - 139); + } - function rodape() - { - $corTexto = '#000000'; - $fonte = 'arial'; - $dataAtual = date("d/m/Y"); - $this->pdf->escreve_relativo( "Data: $dataAtual", 36,795, 100, 50, $fonte, 7, $corTexto, 'left' ); + function rodape() + { + $corTexto = '#000000'; + $fonte = 'arial'; + $dataAtual = date('d/m/Y'); + $this->pdf->escreve_relativo('Data: ' . $dataAtual, 36,795, 100, 50, $fonte, + 7, $corTexto, 'left'); - //$this->pdf->escreve_relativo( "Assinatura do Diretor(a)", 68,520, 100, 50, $fonte, 7, $corTexto, 'left' ); - $this->pdf->escreve_relativo( "Assinatura do Professor(a)", 677,520, 100, 50, $fonte, 7, $corTexto, 'left' ); - //$this->pdf->linha_relativa(52,517,130,0); - $this->pdf->linha_relativa(660,517,130,0); - } + $this->pdf->escreve_relativo('Assinatura do Professor(a)', 677, 520, 100, 50, + $fonte, 7, $corTexto, 'left'); - function Editar() - { - return false; - } + $this->pdf->linha_relativa(660, 517, 130, 0); + } - function Excluir() - { - return false; - } + function Editar() + { + return FALSE; + } + function Excluir() + { + return FALSE; + } } -// cria uma extensao da classe base +// Instancia objeto de página $pagina = new clsIndexBase(); -// cria o conteudo + +// Instancia objeto de conteúdo $miolo = new indice(); -// adiciona o conteudo na clsBase -$pagina->addForm( $miolo ); -// gera o html -$pagina->MakeAll(); +// Atribui o conteúdo à página +$pagina->addForm($miolo); -?> +// Gera o código HTML +$pagina->MakeAll(); \ No newline at end of file -- libgit2 0.21.2