From 99815b08ef8f6281c27d31b2d50dde6b56d236ff Mon Sep 17 00:00:00 2001 From: Eriksen Costa Paixão Date: Tue, 4 May 2010 19:14:40 +0000 Subject: [PATCH] Refactoring para conding standards --- ieducar/intranet/educar_relatorio_alunos_nota_semestre_disc.php | 625 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ieducar/intranet/educar_relatorio_alunos_nota_semestre_disc_proc.php | 657 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2 files changed, 655 insertions(+), 627 deletions(-) diff --git a/ieducar/intranet/educar_relatorio_alunos_nota_semestre_disc.php b/ieducar/intranet/educar_relatorio_alunos_nota_semestre_disc.php index 6095e00..24b0576 100644 --- a/ieducar/intranet/educar_relatorio_alunos_nota_semestre_disc.php +++ b/ieducar/intranet/educar_relatorio_alunos_nota_semestre_disc.php @@ -1,409 +1,410 @@ + * + * 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 - Relação de alunos/nota bimestres" ); - $this->processoAp = "811"; - } + function Formular() + { + $this->SetTitulo($this->_instituicao . ' i-Educar - Espelho de Nota Bimestral'); + $this->processoAp = 811; + } } +/** + * 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 $curso_com_exame = 0; - var $ref_cod_matricula; - - var $page_y = 135; - - var $nm_aluno; - var $array_modulos = array(); - var $nm_curso; - var $get_link = false; - //var $cursos = array(); - - 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($_POST){ - foreach ($_POST as $key => $value) { - $this->$key = $value; - - } - } - - - - $this->ano = $ano_atual = date("Y"); - $this->mes = $mes_atual = date("n"); - - $this->campoNumero( "ano", "Ano", $this->ano, 4, 4, true ); - - $this->campoRadio("tipo","Tipo Relatório",array('n' => 'Notas', 'f' => 'Faltas'),'n'); - - - $get_escola = true; - //$obrigatorio = true; - $exibe_nm_escola = true; - $get_curso = true; - $get_escola_curso_serie = true; - $escola_obrigatorio = false; - $curso_obrigatorio = true; - $instituicao_obrigatorio = true; - -// $get_semestre = true; - - include("include/pmieducar/educar_campo_lista.php"); - - $this->campoLista("ref_cod_turma","Turma",array('' => 'Selecione'),''); - - $this->campoLista("ref_cod_modulo","Módulo",array('' => 'Selecione'),""); - - if($this->ref_cod_escola) - $this->ref_ref_cod_escola = $this->ref_cod_escola; - $this->campoLista( "ref_cod_matricula", "Aluno",array(''=>'Selecione'), "","",false,"Campo não obrigatório","",false,false ); - 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 $curso_com_exame = 0; + var $ref_cod_matricula; + + var $page_y = 135; + + var $nm_aluno; + var $array_modulos = array(); + var $nm_curso; + var $get_link = false; + + 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(); + + $obj_permissoes = new clsPermissoes(); + + return $retorno; + } + + function Gerar() + { + $obj_permissoes = new clsPermissoes(); + $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada); + + if ($_POST){ + foreach ($_POST as $key => $value) { + $this->$key = $value; + } + } + + $this->ano = $ano_atual = date('Y'); + $this->mes = $mes_atual = date('n'); + + $this->campoNumero("ano", "Ano", $this->ano, 4, 4, TRUE); + + $tipo = array( + 'n' => 'Notas', + 'f' => 'Faltas' + ); + $this->campoRadio("tipo", "Tipo Relatório", $tipo, 'n'); + + $get_escola = TRUE; + $exibe_nm_escola = TRUE; + $get_curso = TRUE; + $get_escola_curso_serie = TRUE; + $escola_obrigatorio = FALSE; + $curso_obrigatorio = TRUE; + $instituicao_obrigatorio = TRUE; + + include 'include/pmieducar/educar_campo_lista.php'; + + $opcaoDefault = array('' => 'Selecione'); + + $this->campoLista('ref_cod_turma', 'Turma', $opcaoDefault, ''); + + $this->campoLista('ref_cod_modulo', 'Módulo', $opcaoDefault, ''); + + if($this->ref_cod_escola) { + $this->ref_ref_cod_escola = $this->ref_cod_escola; + } + + $this->campoLista('ref_cod_matricula', 'Aluno', $opcaoDefault, '', '', + FALSE, 'Campo não obrigatório', '', FALSE, FALSE); + + 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 $pagina = new clsIndexBase(); + // cria o conteudo $miolo = new indice(); + // adiciona o conteudo na clsBase -$pagina->addForm( $miolo ); +$pagina->addForm($miolo); + // gera o html $pagina->MakeAll(); - - ?> - + \ No newline at end of file diff --git a/ieducar/intranet/educar_relatorio_alunos_nota_semestre_disc_proc.php b/ieducar/intranet/educar_relatorio_alunos_nota_semestre_disc_proc.php index 754f663..59071fc 100644 --- a/ieducar/intranet/educar_relatorio_alunos_nota_semestre_disc_proc.php +++ b/ieducar/intranet/educar_relatorio_alunos_nota_semestre_disc_proc.php @@ -1,329 +1,356 @@ + * + * 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/relatorio.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 - Relação de alunos/nota bimestres" ); - $this->processoAp = "811"; - $this->renderMenu = false; - $this->renderMenuSuspenso = false; - } + function Formular() + { + $this->SetTitulo($this->_instituicao . ' i-Educar - Espelho de Notas Bimestral'); + $this->processoAp = 811; + $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 { - - - /** - * 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 $ref_cod_curso; - var $ref_cod_modulo; - - var $ano; - - var $is_padrao; - var $semestre; - - var $cursos = array(); - - var $get_link; - - - 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; - - $this->ref_cod_modulo = explode("-",$this->ref_cod_modulo); - $this->ref_cod_modulo = array_pop($this->ref_cod_modulo); - - $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; - } - - $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(); - $this->nm_curso = $det_curso['nm_curso']; - - $obj_tipo_avaliacao = new clsPmieducarTipoAvaliacao($det_curso['ref_cod_tipo_avaliacao']); - $det_tipo_avaliacao = $obj_tipo_avaliacao->detalhe(); - $conceitual = $det_tipo_avaliacao['conceitual']; - - if ($this->is_padrao || $this->ano == 2007) { - $this->semestre = null; - } - - $obj_matricula_turma = new clsPmieducarMatriculaTurma(); - $obj_matricula_turma->setOrderby('nome_ascii'); -// $lst_matricula_turma = $obj_matricula_turma->lista($this->ref_cod_matricula, $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,null,null,null,true); - $lst_matricula_turma = $obj_matricula_turma->lista($this->ref_cod_matricula, $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,null,null,null,true, null, null, true, null, $this->semestre); - //$obj_disciplinas = new clsPmieducarDisciplinaSerie(); - $obj_disciplinas = new clsPmieducarEscolaSerieDisciplina(); - $lst_disciplinas = $obj_disciplinas->lista($this->ref_cod_serie,$this->ref_cod_escola,null,1); - - if($lst_matricula_turma) - { - - $relatorio = new relatorios("Espelho de Notas Bimestral {$this->ref_cod_modulo}º Bimestre Ano {$this->ano}", 210, false, "Espelho de Notas Bimestral", "A4", "{$this->nm_instituicao}\n{$this->nm_escola}\n{$this->nm_curso}\n{$this->nm_serie} - Turma: $this->nm_turma ".date("d/m/Y")); - $relatorio->setMargem(20,20,50,50); - $relatorio->exibe_produzido_por = false; - - - //$relatorio->novalinha( array( "Cód. Aluno", "Nome do Aluno", "1Mº", "M.Parcial", "Exame", "M.Final", "Faltas"),0,16,true,"arial",array( 75, 160, 120, 55, 50, 50),"#515151","#d3d3d3","#FFFFFF",false,true); - //$relatorio->novalinha( array( "Cód. Aluno", "Nome do Aluno", "1Mº", "2Mº", "M.Parcial", "Exame", "M.Final", "Faltas"),0,16,true,"arial",array( 75, 160, 60, 60, 55, 50, 50),"#515151","#d3d3d3","#FFFFFF",false,true); - //$relatorio->novalinha( array( "Cód. Aluno", "Nome do Aluno", "1Mº", "2Mº", "3Mº", "M.Parcial", "Exame", "M.Final", "Faltas"),0,16,true,"arial",array( 75, 160, 40, 40, 40, 55, 50, 50),"#515151","#d3d3d3","#FFFFFF",false,true); - - $db = new clsBanco(); - - foreach ($lst_disciplinas as $disciplina) - { - $obj_disciplina = new clsPmieducarDisciplina($disciplina['ref_cod_disciplina']); - $det_disciplina = $obj_disciplina->detalhe(); - - $array_disc[$det_disciplina['cod_disciplina']] = ($det_disciplina['abreviatura']); - $array_cab[] = str2upper($det_disciplina['abreviatura']); - } - - //if($conceitual) - { - asort($array_disc); - sort($array_cab); - $array_cab = array_merge(array( "Cód.", "Nome do Aluno" ),$array_cab); - } - - - $divisoes = array( 40, 165 ); - $divisoes_texto = array( 40, 165 ); - - if(!$conceitual) - $tamanho_divisao = 32 + ( 10 - count($array_disc) ) * 5; - else - $tamanho_divisao = 23 + ( 15 - count($array_disc) ) * 5; - for($ct=0;$ct<20;$ct++) - { - $divisoes[] = $tamanho_divisao; - $divisoes_texto[] = $tamanho_divisao; - } - $relatorio->novalinha( $array_cab ,0,16,true,"arial",$divisoes,"#515151","#d3d3d3","#ffffff",false,true); - - if(!$conceitual) - { - $campo_nota = "COALESCE(nota,valor) "; - } - else - { - $campo_nota = "nome "; - } - - if($conceitual) - { - $tam_fonte = 8; - $tam_linha = 11; - } - else - { - $tam_fonte = null; - $tam_linha = 16; - } - foreach ($lst_matricula_turma as $matricula) - { - - $consulta = "SELECT ref_cod_disciplina - ,$campo_nota as nota - ,modulo - FROM pmieducar.nota_aluno - LEFT OUTER JOIN - pmieducar.tipo_avaliacao_valores - ON ( ref_ref_cod_tipo_avaliacao = ref_cod_tipo_avaliacao - AND ref_sequencial = sequencial ) - WHERE ref_cod_matricula = {$matricula['ref_cod_matricula']} - AND ref_cod_escola = {$this->ref_cod_escola} - AND ref_cod_serie = {$this->ref_cod_serie} - AND modulo = {$this->ref_cod_modulo} - AND nota_aluno.ativo = 1 - GROUP BY ref_cod_disciplina - ,modulo - ,$campo_nota - ORDER BY ref_cod_disciplina ASC "; - - $db->Consulta($consulta); - - unset($notas); - while ($db->ProximoRegistro()) - { - $registro = $db->Tupla(); - - $notas[$registro['ref_cod_disciplina']] = $registro['nota']; - - } - - if( strlen( $matricula['nome'] ) > 24 ) - { - $matricula['nome'] = explode(" ",$matricula['nome']); - if(is_array($matricula['nome'] )) - { - $nome_aluno = array_shift($matricula['nome']); - } - if(is_array($matricula['nome'] )) - { - $nome_aluno .= " ".array_shift($matricula['nome']); - } - if(is_array($matricula['nome'] )) - { - $nome_aluno .= " ".array_pop($matricula['nome']); - } - $matricula['nome'] = $nome_aluno; - } - - unset($array_val); - $array_val = array(); - $array_val[] = $matricula['ref_cod_aluno']; - $array_val[] = $matricula['nome']; - foreach ($array_disc as $cod_disc => $disc) - { - if(!$conceitual) - $array_val[] = $notas[$cod_disc] ? number_format( $notas[$cod_disc] ,2,'.','') : $notas[$cod_disc]; - else - $array_val[] = $notas[$cod_disc]; - - } - - $relatorio->novalinha($array_val,0,$tam_linha,false,"arial",$divisoes_texto,"#515151","#d3d3d3","#FFFFFF",false,true,null,$tam_fonte); - - } - - $this->get_link = $relatorio->fechaPdf(); - } - - - echo ""; - - echo "
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

-
-
-
"; - } - - - function Editar() - { - return false; - } - - function Excluir() - { - return false; - } - + var $pessoa_logada; + + var $ref_cod_instituicao; + var $ref_cod_escola; + var $ref_cod_serie; + var $ref_cod_turma; + var $ref_cod_curso; + var $ref_cod_modulo; + + var $ano; + + var $is_padrao; + var $semestre; + + var $cursos = array(); + + var $get_link; + + 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; + } + + $this->ref_cod_modulo = explode('-', $this->ref_cod_modulo); + $this->ref_cod_modulo = array_pop($this->ref_cod_modulo); + + $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; + } + + $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(); + $this->nm_curso = $det_curso['nm_curso']; + + $obj_tipo_avaliacao = new clsPmieducarTipoAvaliacao($det_curso['ref_cod_tipo_avaliacao']); + $det_tipo_avaliacao = $obj_tipo_avaliacao->detalhe(); + $conceitual = $det_tipo_avaliacao['conceitual']; + + // @todo Ano 2007 porque? Remover + if ($this->is_padrao || $this->ano == 2007) { + $this->semestre = NULL; + } + + $obj_matricula_turma = new clsPmieducarMatriculaTurma(); + $obj_matricula_turma->setOrderby('nome_ascii'); + $lst_matricula_turma = $obj_matricula_turma->lista($this->ref_cod_matricula, + $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, NULL, NULL, NULL, TRUE, NULL, NULL, TRUE, NULL, $this->semestre); + + $obj_disciplinas = new clsPmieducarEscolaSerieDisciplina(); + $lst_disciplinas = $obj_disciplinas->lista($this->ref_cod_serie, + $this->ref_cod_escola, NULL, 1); + + if($lst_matricula_turma) { + $relatorio = new relatorios("Espelho de Notas Bimestral {$this->ref_cod_modulo}º Bimestre Ano {$this->ano}", 210, false, "Espelho de Notas Bimestral", "A4", "{$this->nm_instituicao}\n{$this->nm_escola}\n{$this->nm_curso}\n{$this->nm_serie} - Turma: $this->nm_turma ".date("d/m/Y")); + $relatorio->setMargem(20, 20, 50, 50); + $relatorio->exibe_produzido_por = FALSE; + + $db = new clsBanco(); + + foreach ($lst_disciplinas as $disciplina) { + $obj_disciplina = new clsPmieducarDisciplina($disciplina['ref_cod_disciplina']); + $det_disciplina = $obj_disciplina->detalhe(); + + $array_disc[$det_disciplina['cod_disciplina']] = ($det_disciplina['abreviatura']); + $array_cab[] = str2upper($det_disciplina['abreviatura']); + } + + asort($array_disc); + sort($array_cab); + $array_cab = array_merge(array( "Cód.", "Nome do Aluno" ),$array_cab); + + $divisoes = array(40, 165); + $divisoes_texto = array(40, 165); + + if (!$conceitual) { + $tamanho_divisao = 32 + (10 - count($array_disc)) * 5; + } + else { + $tamanho_divisao = 23 + (15 - count($array_disc)) * 5; + } + + for ($ct = 0; $ct < 20; $ct++) { + $divisoes[] = $tamanho_divisao; + $divisoes_texto[] = $tamanho_divisao; + } + + $relatorio->novalinha($array_cab, 0, 16, TRUE, 'arial', $divisoes, + '#515151', '#d3d3d3', '#FFFFFF', FALSE, TRUE); + + if(!$conceitual) { + $campo_nota = 'COALESCE(nota, valor) '; + } + else { + $campo_nota = 'nome '; + } + + if ($conceitual) { + $tam_fonte = 8; + $tam_linha = 11; + } + else { + $tam_fonte = NULL; + $tam_linha = 16; + } + + foreach ($lst_matricula_turma as $matricula) { + $consulta = sprintf(" + SELECT + ref_cod_disciplina, + %s AS nota, + modulo + FROM + pmieducar.nota_aluno + LEFT OUTER JOIN + pmieducar.tipo_avaliacao_valores + ON ( + ref_ref_cod_tipo_avaliacao = ref_cod_tipo_avaliacao + AND ref_sequencial = sequencial + ) + WHERE + ref_cod_matricula = %d + AND ref_cod_escola = %d + AND ref_cod_serie = %d + AND modulo = %d + AND nota_aluno.ativo = 1 + GROUP BY + ref_cod_disciplina, + modulo, + %s + ORDER BY + ref_cod_disciplina ASC", $campo_nota, $matricula['ref_cod_matricula'], + $this->ref_cod_escola, $this->ref_cod_serie, $this->ref_cod_modulo, + $campo_nota); + + $db->Consulta($consulta); + + unset($notas); + + while ($db->ProximoRegistro()) { + $registro = $db->Tupla(); + $notas[$registro['ref_cod_disciplina']] = $registro['nota']; + } + + // @todo WTF?! + if (strlen($matricula['nome']) > 24) { + $matricula['nome'] = explode(' ', $matricula['nome']); + + if (is_array($matricula['nome'])) { + $nome_aluno = array_shift($matricula['nome']); + } + + if (is_array($matricula['nome'])) { + $nome_aluno .= ' ' . array_shift($matricula['nome']); + } + + if (is_array($matricula['nome'])) { + $nome_aluno .= ' ' . array_pop($matricula['nome']); + } + + $matricula['nome'] = $nome_aluno; + } + + unset($array_val); + $array_val = array(); + $array_val[] = $matricula['ref_cod_aluno']; + $array_val[] = $matricula['nome']; + + foreach ($array_disc as $cod_disc => $disc) { + if (!$conceitual) { + $array_val[] = $notas[$cod_disc] ? + number_format($notas[$cod_disc], 2, '.', '') : $notas[$cod_disc]; + } + else { + $array_val[] = $notas[$cod_disc]; + } + } + + $relatorio->novalinha($array_val, 0, $tam_linha, FALSE, 'arial', + $divisoes_texto, '#515151', '#d3d3d3', '#FFFFFF', FALSE, TRUE, NULL, $tam_fonte); + } + + $this->get_link = $relatorio->fechaPdf(); + } + + 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); + } + + 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