Commit fad656b04202d240c880d1a291834b746327cc8a
1 parent
f376aeba
Exists in
master
Atualizado relatório '''Ata de Resultado Final''' para usar {{{Avaliacao_Service…
…_Boletim}}} e classes do módulo ComponenteCurricular e RegraAvaliacao
Showing
3 changed files
with
351 additions
and
545 deletions
Show diff stats
ieducar/intranet/educar_relatorio_ata_resultado_final_proc.php
... | ... | @@ -34,6 +34,9 @@ require_once 'include/clsBanco.inc.php'; |
34 | 34 | require_once 'include/pmieducar/geral.inc.php'; |
35 | 35 | require_once 'include/clsPDF.inc.php'; |
36 | 36 | |
37 | +require_once 'ComponenteCurricular/Model/AnoEscolarDataMapper.php'; | |
38 | +require_once 'Avaliacao/Service/Boletim.php'; | |
39 | + | |
37 | 40 | /** |
38 | 41 | * clsIndexBase class. |
39 | 42 | * |
... | ... | @@ -69,6 +72,11 @@ class indice extends clsCadastro |
69 | 72 | { |
70 | 73 | var $pessoa_logada; |
71 | 74 | |
75 | + /** | |
76 | + * @var RegraAvaliacao_Model_Regra | |
77 | + */ | |
78 | + var $regra = NULL; | |
79 | + | |
72 | 80 | var $ref_cod_instituicao; |
73 | 81 | var $ref_cod_escola; |
74 | 82 | var $ref_cod_serie; |
... | ... | @@ -76,7 +84,7 @@ class indice extends clsCadastro |
76 | 84 | var $ref_cod_curso; |
77 | 85 | var $ref_cod_turma; |
78 | 86 | |
79 | - var $disciplinas = array(); | |
87 | + var $componentes = array(); | |
80 | 88 | |
81 | 89 | var $ano; |
82 | 90 | var $nm_escola; |
... | ... | @@ -92,9 +100,8 @@ class indice extends clsCadastro |
92 | 100 | var $campo_assinatura; |
93 | 101 | var $total = 0; |
94 | 102 | |
95 | - var $array_modulos = array(); | |
96 | 103 | var $dias_letivos; |
97 | - var $falta_ch_globalizada; | |
104 | + var $presencaGeral; | |
98 | 105 | |
99 | 106 | function renderHTML() |
100 | 107 | { |
... | ... | @@ -111,436 +118,280 @@ class indice extends clsCadastro |
111 | 118 | $fonte = 'arial'; |
112 | 119 | $corTexto = '#000000'; |
113 | 120 | |
114 | - if (is_numeric($this->ref_cod_instituicao) && is_numeric($this->ref_cod_escola) && | |
115 | - is_numeric($this->ref_cod_curso) && is_numeric($this->ref_cod_serie) && | |
116 | - is_numeric($this->ref_cod_turma) && is_numeric($this->ano)) | |
121 | + if (!is_numeric($this->ref_cod_instituicao) || !is_numeric($this->ref_cod_escola) || | |
122 | + !is_numeric($this->ref_cod_curso) || !is_numeric($this->ref_cod_serie) || | |
123 | + !is_numeric($this->ref_cod_turma) || !is_numeric($this->ano)) | |
117 | 124 | { |
118 | - $sql = " | |
119 | - SELECT | |
120 | - cod_matricula, | |
121 | - aprovado, | |
122 | - ref_ref_cod_serie, | |
123 | - (SELECT | |
124 | - nome | |
125 | - FROM | |
126 | - pmieducar.aluno a, | |
127 | - cadastro.pessoa p | |
128 | - WHERE | |
129 | - a.cod_aluno = m.ref_cod_aluno | |
130 | - AND p.idpes = a.ref_idpes | |
131 | - ) as nome | |
132 | - FROM | |
133 | - pmieducar.matricula m, | |
134 | - pmieducar.matricula_turma mt | |
135 | - WHERE | |
136 | - mt.ref_cod_turma = {$this->ref_cod_turma} | |
137 | - AND mt.ref_cod_matricula = m.cod_matricula | |
138 | - AND m.ativo = 1 | |
139 | - AND mt.ativo = 1 | |
140 | - AND aprovado IN (1, 2) | |
141 | - AND ano = {$this->ano} | |
142 | - ORDER BY | |
143 | - ref_ref_cod_serie, nome"; | |
144 | - | |
145 | - //verificar se a turma é multiseriada | |
146 | - $obj_turma = new clsPmieducarTurma($this->ref_cod_turma); | |
147 | - $det_turma = $obj_turma->detalhe(); | |
148 | - $ref_ref_cod_serie_mult = $det_turma['ref_ref_cod_serie_mult']; | |
149 | - | |
150 | - $db = new clsBanco(); | |
151 | - $db->Consulta($sql); | |
152 | - | |
153 | - if ($db->numLinhas()) { | |
154 | - $numAlunos = $db->numLinhas(); | |
155 | - | |
156 | - $obj_instituicao = new clsPmieducarInstituicao($this->ref_cod_instituicao); | |
157 | - $det_instituicao = $obj_instituicao->detalhe(); | |
158 | - $this->nm_instituicao = $det_instituicao['nm_instituicao']; | |
159 | - | |
160 | - $obj_escola = new clsPmieducarEscola($this->ref_cod_escola); | |
161 | - $det_escola = $obj_escola->detalhe(); | |
162 | - $this->nm_escola = $det_escola['nome']; | |
163 | - | |
164 | - $obj_escola_serie_disciplina = new clsPmieducarEscolaSerieDisciplina(); | |
165 | - $obj_escola_serie_disciplina->setCamposLista('ref_cod_disciplina'); | |
166 | - $lst_escola_serie_disciplina = $obj_escola_serie_disciplina->lista( | |
167 | - $this->ref_cod_serie, $this->ref_cod_escola, NULL, 1); | |
168 | - | |
169 | - foreach ($lst_escola_serie_disciplina as $escola_serie_disciplina) { | |
170 | - $obj_disciplina = new clsPmieducarDisciplina($escola_serie_disciplina); | |
171 | - $obj_disciplina->setCamposLista('cod_disciplina, carga_horaria, nm_disciplina, abreviatura'); | |
172 | - $det_disciplina = $obj_disciplina->detalhe(); | |
173 | - | |
174 | - $this->disciplinas[$det_disciplina['cod_disciplina']]['nm_disciplina'] = $det_disciplina['nm_disciplina']; | |
175 | - $this->disciplinas[$det_disciplina['cod_disciplina']]['abreviatura'] = $det_disciplina['abreviatura']; | |
176 | - $this->disciplinas[$det_disciplina['cod_disciplina']]['carga_horaria'] = $det_disciplina['carga_horaria']; | |
177 | - } | |
178 | - | |
179 | - $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); | |
180 | - $det_curso = $obj_curso->detalhe(); | |
181 | - | |
182 | - $this->nm_curso = $det_curso['nm_curso']; | |
183 | - $this->falta_ch_globalizada = $det_curso['falta_ch_globalizada']; | |
184 | - | |
185 | - $obj_tipo_avaliacao = new clsPmieducarTipoAvaliacao($det_curso['ref_cod_tipo_avaliacao']); | |
186 | - $det_tipo_avaliacao = $obj_tipo_avaliacao->detalhe(); | |
187 | - $curso_conceitual = $det_tipo_avaliacao['conceitual']; | |
188 | - | |
189 | - $obj_serie = new clsPmieducarSerie($this->ref_cod_serie); | |
190 | - $obj_serie->setOrderby('nm_serie'); | |
191 | - $det_serie = $obj_serie->detalhe(); | |
192 | - $this->nm_serie = $det_serie['nm_serie']; | |
193 | - | |
194 | - $obj_turma = new clsPmieducarTurma($this->ref_cod_turma); | |
195 | - $obj_turma->setCamposLista('nm_turma, hora_inicial'); | |
196 | - $det_turma = $obj_turma->detalhe(); | |
125 | + echo ' | |
126 | + <script> | |
127 | + alert("A turma não possui nenhum aluno com situação final definida"); | |
128 | + window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1)); | |
129 | + </script>'; | |
197 | 130 | |
198 | - if ($det_turma['hora_inicial'] < '12:00') { | |
199 | - $this->nm_turno = 'Matutino'; | |
200 | - } | |
201 | - elseif ($det_turma['hora_inicial'] < '18:00') { | |
202 | - $this->nm_turno = 'Vespertino'; | |
203 | - } | |
204 | - else { | |
205 | - $this->nm_turno = 'Noturno'; | |
206 | - } | |
131 | + return TRUE; | |
132 | + } | |
207 | 133 | |
208 | - $this->nm_turma = $det_turma["nm_turma"]; | |
209 | - $this->buscaDiasLetivos(); | |
134 | + $sql = sprintf(" | |
135 | + SELECT | |
136 | + cod_matricula, | |
137 | + aprovado, | |
138 | + ref_ref_cod_serie, | |
139 | + (SELECT | |
140 | + nome | |
141 | + FROM | |
142 | + pmieducar.aluno a, | |
143 | + cadastro.pessoa p | |
144 | + WHERE | |
145 | + a.cod_aluno = m.ref_cod_aluno | |
146 | + AND p.idpes = a.ref_idpes | |
147 | + ) AS nome | |
148 | + FROM | |
149 | + pmieducar.matricula m, | |
150 | + pmieducar.matricula_turma mt | |
151 | + WHERE | |
152 | + mt.ref_cod_turma = %d | |
153 | + AND mt.ref_cod_matricula = m.cod_matricula | |
154 | + AND m.ativo = 1 | |
155 | + AND mt.ativo = 1 | |
156 | + AND aprovado IN (1, 2) | |
157 | + AND ano = %d | |
158 | + ORDER BY | |
159 | + ref_ref_cod_serie, nome", $this->ref_cod_turma, $this->ano); | |
160 | + | |
161 | + //verificar se a turma é multiseriada | |
162 | + $obj_turma = new clsPmieducarTurma($this->ref_cod_turma); | |
163 | + $det_turma = $obj_turma->detalhe(); | |
164 | + $ref_ref_cod_serie_mult = $det_turma['ref_ref_cod_serie_mult']; | |
165 | + | |
166 | + $db = new clsBanco(); | |
167 | + $db->Consulta($sql); | |
168 | + | |
169 | + if (!$db->numLinhas()) { | |
170 | + echo ' | |
171 | + <script> | |
172 | + alert("A turma não possui nenhum aluno com situação final definida"); | |
173 | + window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length - 1)); | |
174 | + </script>'; | |
210 | 175 | |
211 | - asort($this->disciplinas); | |
176 | + return TRUE; | |
177 | + } | |
212 | 178 | |
213 | - $this->pdf = new clsPDF('Ata de Resultado Final - ' . $this->ano, | |
214 | - 'Ata de Resultado Final', 'A4', '', FALSE, FALSE); | |
179 | + $numAlunos = $db->numLinhas(); | |
215 | 180 | |
216 | - $this->pdf->largura = 842.0; | |
217 | - $this->pdf->altura = 595.0; | |
181 | + // Nome da instituição | |
182 | + $obj_instituicao = new clsPmieducarInstituicao($this->ref_cod_instituicao); | |
183 | + $det_instituicao = $obj_instituicao->detalhe(); | |
184 | + $this->nm_instituicao = $det_instituicao['nm_instituicao']; | |
218 | 185 | |
219 | - $this->pdf->OpenFile(); | |
220 | - $this->addCabecalho(); | |
186 | + // Nome da escola | |
187 | + $obj_escola = new clsPmieducarEscola($this->ref_cod_escola); | |
188 | + $det_escola = $obj_escola->detalhe(); | |
189 | + $this->nm_escola = $det_escola['nome']; | |
221 | 190 | |
222 | - $esquerda = 3; | |
223 | - $altura = 30; | |
224 | - $direita = 834; | |
225 | - $tam_texto = 10; | |
226 | - $altura = 130; | |
227 | - | |
228 | - if ($det_curso['padrao_ano_escolar'] == 1) { | |
229 | - $this->array_modulos = array( | |
230 | - array('nm_tipo' => 'Bimestre'), | |
231 | - array('nm_tipo' => 'Bimestre'), | |
232 | - array('nm_tipo' => 'Bimestre'), | |
233 | - array('nm_tipo' => 'Bimestre') | |
234 | - ); | |
235 | - } | |
236 | - else { | |
237 | - $obj_turma_modulo = new clsPmieducarTurmaModulo(); | |
238 | - $lst_turma_modulo = $obj_turma_modulo->lista($this->ref_cod_turma); | |
191 | + // Nome do curso | |
192 | + $obj_curso = new clsPmieducarCurso($this->ref_cod_curso); | |
193 | + $det_curso = $obj_curso->detalhe(); | |
194 | + $this->nm_curso = $det_curso['nm_curso']; | |
239 | 195 | |
240 | - foreach ($lst_turma_modulo as $modulo) { | |
241 | - $obj_modulo = new clsPmieducarModulo($modulo); | |
242 | - $det_modulo = $obj_modulo->detalhe(); | |
243 | - $this->array_modulos[] = $det_modulo; | |
244 | - } | |
245 | - } | |
196 | + // Série | |
197 | + $obj_serie = new clsPmieducarSerie($this->ref_cod_serie); | |
198 | + $obj_serie->setOrderby('nm_serie'); | |
199 | + $det_serie = $obj_serie->detalhe(); | |
200 | + $this->nm_serie = $det_serie['nm_serie']; | |
246 | 201 | |
247 | - $altura += 50; | |
248 | - $espessura_linha = 0.3; | |
249 | - | |
250 | - $alunos_matriculados = array(); | |
251 | - while ($db->ProximoRegistro()) { | |
252 | - list($cod_matricula, $aprovado, $ref_cod_serie, $nome) = $db->Tupla(); | |
253 | - $alunos_matriculados[$cod_matricula] = | |
254 | - array( | |
255 | - 'aprovado' => $aprovado, | |
256 | - 'nome' => $nome, | |
257 | - 'ref_cod_serie' => $ref_cod_serie | |
258 | - ); | |
259 | - } | |
202 | + // Seleciona a regra de avaliação da série | |
203 | + $regraMapper = new RegraAvaliacao_Model_RegraDataMapper(); | |
204 | + $this->regra = $regraMapper->find($det_serie['regra_avaliacao_id']); | |
260 | 205 | |
261 | - if (is_array($alunos_matriculados) && count($alunos_matriculados)) { | |
262 | - if ($this->falta_ch_globalizada) { | |
263 | - $this->montaAlunoGlobalizados($alunos_matriculados, $det_curso, $curso_conceitual); | |
264 | - } else { | |
265 | - $this->montaAlunoNaoGlobalizados($alunos_matriculados, $det_curso, $curso_conceitual); | |
266 | - } | |
267 | - } | |
206 | + // Carrega as definições de disciplina | |
207 | + $escolaSerieDisciplina = new clsPmieducarEscolaSerieDisciplina(); | |
208 | + $escolaSerieDisciplina = $escolaSerieDisciplina->lista( | |
209 | + $this->ref_cod_serie, $this->ref_cod_escola, NULL, 1); | |
268 | 210 | |
269 | - $this->rodape(); | |
211 | + // Instancia mapper para ano escolar | |
212 | + $anoEscolarMapper = new ComponenteCurricular_Model_AnoEscolarDataMapper(); | |
270 | 213 | |
271 | - $this->pdf->CloseFile(); | |
272 | - $this->get_link = $this->pdf->GetLink(); | |
214 | + foreach ($escolaSerieDisciplina as $disciplina) { | |
215 | + $id = $disciplina['ref_cod_disciplina']; | |
216 | + $anoEscolar = $anoEscolarMapper->find(array($id)); | |
273 | 217 | |
274 | - echo " | |
275 | - <script> | |
276 | - window.onload=function() { | |
277 | - parent.EscondeDiv('LoadImprimir'); | |
278 | - window.location='download.php?filename=".$this->get_link."' | |
279 | - } | |
280 | - </script>"; | |
281 | - | |
282 | - echo " | |
283 | - <html> | |
284 | - <center> | |
285 | - 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> | |
286 | - <span style='font-size: 10px;'> | |
287 | - Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br> | |
288 | - Clique na Imagem para Baixar o instalador<br><br> | |
289 | - <a href=\"http://www.adobe.com.br/products/acrobat/readstep2.html\" target=\"new\"><br> | |
290 | - <img src=\"imagens/acrobat.gif\" width=\"88\" height=\"31\" border=\"0\"> | |
291 | - </a> | |
292 | - </span> | |
293 | - </center>"; | |
294 | - } | |
295 | - else { | |
296 | - echo ' | |
297 | - <script> | |
298 | - alert("A turma não possui nenhum aluno com situação final definida"); | |
299 | - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length - 1)); | |
300 | - </script>'; | |
218 | + $cargaHoraria = !is_null($disciplina['carga_horaria']) ? | |
219 | + $disciplina['carga_horaria'] : $anoEscolar->cargaHoraria; | |
301 | 220 | |
302 | - return TRUE; | |
303 | - } | |
221 | + $anoEscolar->componenteCurricular->cargaHoraria = $cargaHoraria; | |
222 | + $this->componentes[$id] = $anoEscolar->componenteCurricular; | |
304 | 223 | } |
305 | - else | |
306 | - { | |
307 | - echo ' | |
308 | - <script> | |
309 | - alert("A turma não possui nenhum aluno com situação final definida"); | |
310 | - window.parent.fechaExpansivel(\'div_dinamico_\'+(window.parent.DOM_divs.length-1)); | |
311 | - </script>'; | |
312 | - | |
313 | - return TRUE; | |
314 | - } | |
315 | - } | |
316 | - | |
317 | - function rodape() | |
318 | - { | |
319 | - $texto = ''; | |
320 | - $esquerda = 3; | |
321 | - $altura = 22; | |
322 | - $direita = 834; | |
323 | - $tam_texto = 10; | |
324 | - $this->pdf->escreve_relativo('Legenda', $esquerda + 2, $this->page_y += 30, | |
325 | - 150, 100, $fonte, $tam_texto); | |
326 | 224 | |
327 | - if (count($this->disciplinas) > 10) { | |
328 | - $legenda_por_linha = true; | |
329 | - } else { | |
330 | - $legenda_por_linha = false; | |
331 | - } | |
332 | 225 | |
333 | - foreach ($this->disciplinas as $disciplina) { | |
334 | - $texto .= $disciplina['abreviatura'] . ':' . $disciplina['nm_disciplina'] . ' '; | |
335 | - | |
336 | - if ($legenda_por_linha) { | |
337 | - $this->pdf->escreve_relativo($texto, $esquerda + 2, $this->page_y += $altura, | |
338 | - $direita, 200, $fonte, $tam_texto + 1); | |
226 | + $this->presencaGeral = ($this->regra->get('tipoPresenca') == RegraAvaliacao_Model_TipoPresenca::GERAL); | |
339 | 227 | |
340 | - $texto = ""; | |
228 | + $obj_turma = new clsPmieducarTurma($this->ref_cod_turma); | |
229 | + $obj_turma->setCamposLista('nm_turma, hora_inicial'); | |
230 | + $det_turma = $obj_turma->detalhe(); | |
341 | 231 | |
342 | - if ($this->page_y > $this->pdf->altura - 50) { | |
343 | - $texto = ''; | |
344 | - $esquerda = 3; | |
345 | - $altura = 18; | |
346 | - $direita = 834; | |
347 | - $tam_texto = 10; | |
348 | - $this->pdf->ClosePage(); | |
349 | - $this->pdf->OpenPage(); | |
350 | - $this->addCabecalho(); | |
351 | - } | |
352 | - } | |
232 | + if ($det_turma['hora_inicial'] < '12:00') { | |
233 | + $this->nm_turno = 'Matutino'; | |
353 | 234 | } |
354 | - | |
355 | - if (! $legenda_por_linha) { | |
356 | - $this->pdf->escreve_relativo($texto, $esquerda + 2, $this->page_y += $altura, | |
357 | - $direita, 200, $fonte, $tam_texto + 1); | |
235 | + elseif ($det_turma['hora_inicial'] < '18:00') { | |
236 | + $this->nm_turno = 'Vespertino'; | |
358 | 237 | } |
359 | - | |
360 | - if ($this->page_y + $altura * 2 > $this->pdf->altura - 50) { | |
361 | - $texto = ''; | |
362 | - $esquerda = 3; | |
363 | - $altura = 18; | |
364 | - $direita = 834; | |
365 | - $tam_texto = 10; | |
366 | - $this->pdf->ClosePage(); | |
367 | - $this->pdf->OpenPage(); | |
368 | - $this->addCabecalho(); | |
238 | + else { | |
239 | + $this->nm_turno = 'Noturno'; | |
369 | 240 | } |
370 | 241 | |
371 | - $this->pdf->quadrado_relativo($esquerda, $this->page_y += $altura * 2, $direita, 60); | |
242 | + $this->nm_turma = $det_turma["nm_turma"]; | |
243 | + $this->buscaDiasLetivos(); | |
372 | 244 | |
373 | - $this->pdf->escreve_relativo('Observações:', $esquerda + 1, $this->page_y + 1, 150, 200, $fonte, $tam_texto); | |
245 | + asort($this->componentes); | |
374 | 246 | |
375 | - $this->pdf->linha_relativa($esquerda + 200, $this->page_y += 120, 150, 0); | |
247 | + $this->pdf = new clsPDF('Ata de Resultado Final - ' . $this->ano, | |
248 | + 'Ata de Resultado Final', 'A4', '', FALSE, FALSE); | |
376 | 249 | |
377 | - $this->pdf->escreve_relativo('Assinatura do(a) Secretário(a)', $esquerda + 220, | |
378 | - $this->page_y + 2, 150, 200, $fonte, 7); | |
250 | + $this->pdf->largura = 842.0; | |
251 | + $this->pdf->altura = 595.0; | |
379 | 252 | |
380 | - $this->pdf->linha_relativa($esquerda + 450, $this->page_y, 150, 0); | |
253 | + $this->pdf->OpenPage(); | |
254 | + $this->addCabecalho(); | |
381 | 255 | |
382 | - $this->pdf->escreve_relativo('Assinatura do(a) Diretor(a)', $esquerda + 480, | |
383 | - $this->page_y + 2, 150, 200, $fonte, 7); | |
384 | - } | |
256 | + $esquerda = 3; | |
257 | + $direita = 834; | |
258 | + $tam_texto = 10; | |
259 | + $altura = 130; | |
385 | 260 | |
386 | - //monta alunos que a serie nao tem falta globalizada | |
387 | - function montaAlunoNaoGlobalizados($alunos_matriculados, $det_curso, $curso_conceitual) | |
388 | - { | |
389 | - $fonte = 'arial'; | |
390 | - $corTexto = '#000000'; | |
391 | - $esquerda_original = 3; | |
392 | - $espessura_linha = 0.3; | |
393 | - $tam_texto = 9; | |
394 | - $direita = 834; | |
395 | - $altura = 20; | |
261 | + $altura += 50; | |
262 | + $espessura_linha = 0.3; | |
396 | 263 | |
397 | - $obj_serie = new clsPmieducarSerie($this->ref_cod_serie); | |
398 | - $det_serie = $obj_serie->detalhe(); | |
264 | + $alunos_matriculados = array(); | |
399 | 265 | |
400 | - foreach ($alunos_matriculados as $matricula => $aluno) { | |
401 | - $esquerda = $esquerda_original; | |
266 | + while ($db->ProximoRegistro()) { | |
267 | + list($cod_matricula, $aprovado, $ref_cod_serie, $nome) = $db->Tupla(); | |
268 | + $alunos_matriculados[$cod_matricula] = | |
269 | + array( | |
270 | + 'aprovado' => $aprovado, | |
271 | + 'nome' => $nome, | |
272 | + 'ref_cod_serie' => $ref_cod_serie | |
273 | + ); | |
274 | + } | |
402 | 275 | |
403 | - $this->pdf->quadrado_relativo($esquerda, $this->page_y, $direita, $altura); | |
276 | + if (is_array($alunos_matriculados) && count($alunos_matriculados)) { | |
277 | + $this->getAlunoNotasFaltasTable($alunos_matriculados, $det_curso, $curso_conceitual); | |
278 | + } | |
404 | 279 | |
405 | - $this->pdf->escreve_relativo($matricula, $esquerda, $this->page_y + 2, 45, | |
406 | - 45, $fonte, $tam_texto, $corTexto, 'center'); | |
280 | + $this->rodape(); | |
407 | 281 | |
408 | - $this->pdf->linha_relativa($esquerda += 45, $this->page_y, 0, $altura); | |
282 | + $this->pdf->CloseFile(); | |
283 | + $this->get_link = $this->pdf->GetLink(); | |
409 | 284 | |
410 | - $espaco_nome = 150; | |
285 | + echo sprintf(" | |
286 | + <script> | |
287 | + window.onload=function() { | |
288 | + parent.EscondeDiv('LoadImprimir'); | |
289 | + window.location='download.php?filename=%s' | |
290 | + } | |
291 | + </script>", $this->get_link); | |
292 | + | |
293 | + echo sprintf(" | |
294 | + <html> | |
295 | + <center> | |
296 | + 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> | |
297 | + <span style='font-size: 10px;'> | |
298 | + Para visualizar os arquivos PDF, é necessário instalar o Adobe Acrobat Reader.<br> | |
299 | + Clique na Imagem para Baixar o instalador<br><br> | |
300 | + <a href=\"http://www.adobe.com.br/products/acrobat/readstep2.html\" target=\"new\"><br> | |
301 | + <img src=\"imagens/acrobat.gif\" width=\"88\" height=\"31\" border=\"0\"> | |
302 | + </a> | |
303 | + </span> | |
304 | + </center> | |
305 | + </html>", $this->get_link); | |
306 | + } | |
411 | 307 | |
412 | - $this->pdf->escreve_relativo($aluno['nome'], $esquerda, $this->page_y + 2, | |
413 | - $espaco_nome, 45, $fonte, $tam_texto, $corTexto, 'center'); | |
308 | + function getComponentesTableHeader($esquerda, $espacoComponente) | |
309 | + { | |
310 | + $tam_texto = 9; | |
311 | + $altura = 20; | |
312 | + $tam_texto = 9; | |
313 | + $fonte = 'arial'; | |
314 | + $corTexto = '#000000'; | |
315 | + $carga_global = 0; | |
414 | 316 | |
415 | - $this->pdf->linha_relativa($esquerda += $espaco_nome, $this->page_y, 0, $altura); | |
317 | + $espacoDiv = $this->presencaGeral ? 1 : 2; | |
416 | 318 | |
417 | - $this->pdf->escreve_relativo($aluno['aprovado'] == 1 ? 'Aprovado' : 'Reprovado', | |
418 | - $esquerda, $this->page_y + 4, 45, 45, $fonte, $tam_texto, $corTexto, 'center'); | |
319 | + $componentesTotal = count($this->componentes) + ($this->presencaGeral ? 1 : 0); | |
320 | + $espacoComponentes = ceil($espacoComponente / $componentesTotal); | |
419 | 321 | |
420 | - $this->pdf->linha_relativa($esquerda += 45, $this->page_y, 0, $altura); | |
322 | + foreach ($this->componentes as $componente) { | |
323 | + $carga_global += $componente->cargaHoraria; | |
421 | 324 | |
422 | - $espaco_disciplinas = ceil(($direita - $esquerda) / (count($this->disciplinas))); | |
325 | + $this->pdf->escreve_relativo($componente->abreviatura, $esquerda, | |
326 | + $this->page_y - $altura, $espacoComponentes, 100, $fonte, $tam_texto, $corTexto, 'center'); | |
423 | 327 | |
424 | - foreach ($this->disciplinas as $cod_disciplina => $disciplina) { | |
425 | - $obj_dispensa_disciplina = new clsPmieducarDispensaDisciplina($matricula, | |
426 | - $aluno['ref_cod_serie'], $this->ref_cod_escola, $cod_disciplina); | |
328 | + $this->pdf->escreve_relativo($componente->cargaHoraria . ' hrs', $esquerda, | |
329 | + $this->page_y + 10 - $altura, $espacoComponentes, 50, $fonte, | |
330 | + $tam_texto - 2, $corTexto, 'center'); | |
427 | 331 | |
428 | - if ($obj_dispensa_disciplina->detalhe()) { | |
429 | - $media = $faltas = 'D'; | |
430 | - } | |
431 | - else { | |
432 | - $nota_exame = FALSE; | |
433 | - | |
434 | - if ($curso_conceitual) { | |
435 | - $obj_nota_aluno = new clsPmieducarNotaAluno(); | |
436 | - $obj_nota_aluno->setOrderby('modulo ASC'); | |
437 | - $lst_nota_aluno = $obj_nota_aluno->lista(NULL, NULL, NULL, $aluno['ref_cod_serie'], $this->ref_cod_escola, | |
438 | - $cod_disciplina, $matricula, NULL, NULL, NULL, NULL, NULL, NULL, 1); | |
439 | - | |
440 | - if (is_array($lst_nota_aluno) && count($lst_nota_aluno)) { | |
441 | - foreach ($lst_nota_aluno as $key => $nota) { | |
442 | - $obj_tipo_av_val = new clsPmieducarTipoAvaliacaoValores( | |
443 | - $nota['ref_ref_cod_tipo_avaliacao'], $nota['ref_sequencial'], | |
444 | - NULL, NULL, NULL, NULL, 1); | |
445 | - | |
446 | - $det_tipo_av_val = $obj_tipo_av_val->detalhe(); | |
447 | - $media = $det_tipo_av_val['nome']; | |
448 | - } | |
449 | - } | |
450 | - } else { | |
451 | - if (dbBool($det_serie['ultima_nota_define'])) { | |
452 | - $obj_nota_aluno = new clsPmieducarNotaAluno(); | |
453 | - | |
454 | - $media = $obj_nota_aluno->getUltimaNotaModulo($matricula, $cod_disciplina, | |
455 | - $aluno['ref_cod_serie'], count($this->array_modulos)); | |
456 | - } else { | |
457 | - $obj_nota_aluno = new clsPmieducarNotaAluno(); | |
458 | - $obj_nota_aluno->setOrderby('modulo ASC'); | |
459 | - | |
460 | - $lst_nota_aluno = $obj_nota_aluno->lista(NULL, NULL, NULL, | |
461 | - $aluno['ref_cod_serie'], $this->ref_cod_escola, $cod_disciplina, | |
462 | - $matricula, NULL, NULL, NULL, NULL, NULL, NULL, 1); | |
463 | - | |
464 | - $qtd_modulos = count($this->array_modulos); | |
465 | - $notas = 0; | |
466 | - | |
467 | - if (is_array($lst_nota_aluno) && count($lst_nota_aluno)) { | |
468 | - foreach ($lst_nota_aluno as $key => $nota) { | |
469 | - if ($key < $qtd_modulos) { | |
470 | - $obj_tipo_av_val = new clsPmieducarTipoAvaliacaoValores( | |
471 | - $nota['ref_ref_cod_tipo_avaliacao'], $nota['ref_sequencial'], | |
472 | - NULL, NULL, NULL, NULL); | |
473 | - | |
474 | - $det_tipo_av_val = $obj_tipo_av_val->detalhe(); | |
475 | - $notas += $det_tipo_av_val['valor']; | |
476 | - } else { | |
477 | - $notas += $nota['nota'] * 2; | |
478 | - $nota_exame = true; | |
479 | - } | |
480 | - } | |
481 | - } | |
482 | - | |
483 | - $media = $nota_exame ? $notas / (count($lst_nota_aluno) + 1) : | |
484 | - $notas / count($lst_nota_aluno); | |
485 | - | |
486 | - $obj_media = new clsPmieducarTipoAvaliacaoValores(); | |
487 | - $det_media = $obj_media->lista($det_curso['ref_cod_tipo_avaliacao'], | |
488 | - $det_curso['ref_sequencial'], NULL, NULL, $media, $media); | |
489 | - | |
490 | - if (is_array($det_media) && count($det_media)) { | |
491 | - $det_media = array_shift($det_media); | |
492 | - $media = $det_media['valor']; | |
493 | - $media = str_replace('.', ',', sprintf('%01.1f', $media)); | |
494 | - } | |
495 | - } | |
496 | - } | |
332 | + $this->pdf->escreve_relativo('Nota / Conceito', $esquerda, $this->page_y + 3, | |
333 | + $espacoComponentes / $espacoDiv, 50, $fonte, $tam_texto - 2, $corTexto, 'center'); | |
497 | 334 | |
498 | - $obj_falta = new clsPmieducarFaltaAluno(); | |
499 | - $faltas = $obj_falta->total_faltas_disciplina($matricula, $cod_disciplina, $aluno['ref_cod_serie']); | |
500 | - } | |
335 | + if (!$this->presencaGeral) { | |
336 | + $this->pdf->escreve_relativo('Falta', $esquerda + $espacoComponentes / 2, | |
337 | + $this->page_y + 3, $espacoComponentes / $espacoDiv, 50, $fonte, $tam_texto - 2, | |
338 | + $corTexto, 'center'); | |
339 | + } | |
501 | 340 | |
502 | - $this->pdf->escreve_relativo($media, $esquerda, $this->page_y + 4, | |
503 | - $espaco_disciplinas / 2, 100, $fonte, $tam_texto + 1, $corTexto, 'center'); | |
341 | + $this->pdf->linha_relativa($esquerda, $this->page_y - $altura, 0, $altura * 2); | |
504 | 342 | |
505 | - $this->pdf->linha_relativa($esquerda + $espaco_disciplinas / 2, | |
506 | - $this->page_y, 0, $altura); | |
343 | + $esquerda += $espacoComponentes; | |
344 | + $this->pdf->linha_relativa($esquerda + $espacoComponentes / $espacoDiv, | |
345 | + $this->page_y, 0, $altura); | |
346 | + } | |
507 | 347 | |
508 | - $this->pdf->escreve_relativo($faltas, $esquerda + $espaco_disciplinas / 2, | |
509 | - $this->page_y + 4, $espaco_disciplinas / 2, 100, $fonte, $tam_texto + 1, | |
510 | - $corTexto, 'center'); | |
348 | + if ($this->presencaGeral) { | |
349 | + $this->pdf->linha_relativa($esquerda, $this->page_y - $altura, 0, $altura * 2); | |
511 | 350 | |
512 | - $esquerda += $espaco_disciplinas; | |
351 | + $this->pdf->escreve_relativo('Faltas', $esquerda, $this->page_y, $espacoComponentes, | |
352 | + 50, $fonte, $tam_texto, $corTexto, 'center'); | |
513 | 353 | |
514 | - $this->pdf->linha_relativa($esquerda, $this->page_y, 0, $altura); | |
515 | - } | |
354 | + $this->pdf->linha_relativa($esquerda += $espacoComponentes, | |
355 | + $this->page_y - $altura, 0, $altura * 2); | |
356 | + } | |
516 | 357 | |
517 | - $this->page_y += $altura; | |
358 | + $this->page_y += $altura; | |
518 | 359 | |
519 | - if ($this->page_y > $this->pdf->altura - $altura * 2) { | |
520 | - $this->pdf->ClosePage(); | |
521 | - $this->pdf->OpenPage(); | |
522 | - $this->addCabecalho(); | |
523 | - } | |
524 | - } | |
360 | + return $carga_global; | |
525 | 361 | } |
526 | 362 | |
527 | - //monta alunos que a serie tem falta globalizada | |
528 | - function montaAlunoGlobalizados($alunos_matriculados, $det_curso, $curso_conceitual) | |
363 | + function getAlunoNotasFaltasTable($alunos_matriculados, $det_curso, $curso_conceitual) | |
529 | 364 | { |
530 | 365 | $fonte = 'arial'; |
531 | 366 | $corTexto = '#000000'; |
532 | 367 | $esquerda_original = 3; |
533 | 368 | $espessura_linha = 0.3; |
534 | - $tam_texto = 7; | |
369 | + $tam_texto = 9; | |
535 | 370 | $direita = 834; |
536 | 371 | $altura = 20; |
537 | 372 | |
538 | 373 | $obj_serie = new clsPmieducarSerie($this->ref_cod_serie); |
539 | 374 | $det_serie = $obj_serie->detalhe(); |
540 | 375 | |
376 | + $espacoDiv = $this->presencaGeral ? 1 : 2; | |
377 | + | |
541 | 378 | foreach ($alunos_matriculados as $matricula => $aluno) { |
379 | + $boletim = new Avaliacao_Service_Boletim(array('matricula' => $matricula)); | |
380 | + $medias = $boletim->getMediasComponentes(); | |
381 | + | |
382 | + if ($this->presencaGeral) { | |
383 | + // Soma as faltas do aluno | |
384 | + $faltas = array_sum(CoreExt_Entity::entityFilterAttr( | |
385 | + $boletim->getFaltasGerais(), 'etapa', 'quantidade') | |
386 | + ); | |
387 | + } | |
388 | + else { | |
389 | + $faltas = $boletim->getFaltasComponentes(); | |
390 | + } | |
391 | + | |
542 | 392 | $esquerda = $esquerda_original; |
543 | 393 | |
394 | + // Matrícula | |
544 | 395 | $this->pdf->quadrado_relativo($esquerda, $this->page_y, $direita, $altura); |
545 | 396 | |
546 | 397 | $this->pdf->escreve_relativo($matricula, $esquerda, $this->page_y + 2, 45, |
... | ... | @@ -548,6 +399,7 @@ class indice extends clsCadastro |
548 | 399 | |
549 | 400 | $this->pdf->linha_relativa($esquerda += 45, $this->page_y, 0, $altura); |
550 | 401 | |
402 | + // Nome do aluno | |
551 | 403 | $espaco_nome = 150; |
552 | 404 | |
553 | 405 | $this->pdf->escreve_relativo($aluno['nome'], $esquerda, $this->page_y + 2, |
... | ... | @@ -555,108 +407,67 @@ class indice extends clsCadastro |
555 | 407 | |
556 | 408 | $this->pdf->linha_relativa($esquerda += $espaco_nome, $this->page_y, 0, $altura); |
557 | 409 | |
558 | - $this->pdf->escreve_relativo($aluno['aprovado'] == 1 ? 'Aprovado' : 'Reprovado', | |
410 | + // Situação da matrícula | |
411 | + $this->pdf->escreve_relativo(App_Model_MatriculaSituacao::getInstance()->getValue($aluno['aprovado']), | |
559 | 412 | $esquerda, $this->page_y + 4, 45, 45, $fonte, $tam_texto, $corTexto, 'center'); |
560 | 413 | |
561 | 414 | $this->pdf->linha_relativa($esquerda += 45, $this->page_y, 0, $altura); |
562 | 415 | |
563 | - $espaco_disciplinas = ceil(($direita - $esquerda) / (count($this->disciplinas) + 1)); | |
564 | - | |
565 | - foreach ($this->disciplinas as $cod_disciplina => $disciplina) { | |
566 | - $obj_dispensa_disciplina = new clsPmieducarDispensaDisciplina($matricula, | |
567 | - $aluno['ref_cod_serie'], $this->ref_cod_escola, $cod_disciplina); | |
416 | + $espacoComponentes = ceil( | |
417 | + ($direita - $esquerda) / (count($this->componentes) + ($this->presencaGeral ? 1 : 0)) | |
418 | + ); | |
568 | 419 | |
569 | - if ($obj_dispensa_disciplina->detalhe()) { | |
570 | - $media = $faltas = 'D'; | |
420 | + // Exibe as médias e faltas do aluno | |
421 | + foreach ($this->componentes as $id => $componente) { | |
422 | + // Se não tem média, foi dispensado do componente | |
423 | + if (!isset($medias[$id])) { | |
424 | + $media = 'D'; | |
425 | + $faltas = 'D'; | |
571 | 426 | } |
572 | 427 | else { |
573 | - $nota_exame = false; | |
574 | - | |
575 | - if ($curso_conceitual) { | |
576 | - $obj_nota_aluno = new clsPmieducarNotaAluno(); | |
577 | - $obj_nota_aluno->setOrderby('modulo ASC'); | |
578 | - $lst_nota_aluno = $obj_nota_aluno->lista(NULL, NULL, | |
579 | - $det_curso['ref_cod_tipo_avaliacao'], $aluno['ref_cod_serie'], | |
580 | - $this->ref_cod_escola, $cod_disciplina, $matricula, NULL, NULL, | |
581 | - NULL, NULL, NULL, NULL, 1); | |
582 | - | |
583 | - if (is_array($lst_nota_aluno) && count($lst_nota_aluno)) { | |
584 | - foreach ($lst_nota_aluno as $key => $nota) { | |
585 | - $obj_tipo_av_val = new clsPmieducarTipoAvaliacaoValores( | |
586 | - $nota['ref_ref_cod_tipo_avaliacao'], $nota['ref_sequencial'], | |
587 | - NULL, NULL, NULL, NULL, 1); | |
588 | - | |
589 | - $det_tipo_av_val = $obj_tipo_av_val->detalhe(); | |
590 | - $media = $det_tipo_av_val['nome']; | |
591 | - } | |
592 | - } | |
593 | - } else { | |
594 | - if (dbBool($det_serie['ultima_nota_define'])) { | |
595 | - $obj_nota_aluno = new clsPmieducarNotaAluno(); | |
596 | - | |
597 | - $media = $obj_nota_aluno->getUltimaNotaModulo($matricula, | |
598 | - $cod_disciplina, $aluno['ref_cod_serie'], count($this->array_modulos)); | |
599 | - } else { | |
600 | - $obj_nota_aluno = new clsPmieducarNotaAluno(); | |
601 | - | |
602 | - $obj_nota_aluno->setOrderby('modulo ASC'); | |
603 | - | |
604 | - $lst_nota_aluno = $obj_nota_aluno->lista(NULL, NULL, | |
605 | - $det_curso['ref_cod_tipo_avaliacao'], $aluno['ref_cod_serie'], | |
606 | - $this->ref_cod_escola, $cod_disciplina, $matricula, NULL, NULL, | |
607 | - NULL, NULL, NULL, NULL, 1); | |
608 | - | |
609 | - $qtd_modulos = count($this->array_modulos); | |
610 | - | |
611 | - $notas = 0; | |
612 | - if (is_array($lst_nota_aluno) && count($lst_nota_aluno)) { | |
613 | - foreach ($lst_nota_aluno as $key => $nota) { | |
614 | - if ($key < $qtd_modulos) { | |
615 | - $obj_tipo_av_val = new clsPmieducarTipoAvaliacaoValores( | |
616 | - $nota['ref_ref_cod_tipo_avaliacao'], $nota['ref_sequencial'], | |
617 | - NULL, NULL, NULL, NULL); | |
618 | - | |
619 | - $det_tipo_av_val = $obj_tipo_av_val->detalhe(); | |
620 | - $notas += $det_tipo_av_val['valor']; | |
621 | - } else { | |
622 | - $notas += $nota['nota'] * 2; | |
623 | - $nota_exame = true; | |
624 | - } | |
625 | - } | |
626 | - } | |
627 | - | |
628 | - $media = $nota_exame ? $notas / (count($lst_nota_aluno) + 1) : | |
629 | - $notas / count($lst_nota_aluno); | |
630 | - | |
631 | - $obj_media = new clsPmieducarTipoAvaliacaoValores(); | |
632 | - $det_media = $obj_media->lista($det_curso['ref_cod_tipo_avaliacao'], | |
633 | - $det_curso['ref_sequencial'], NULL, NULL, $media, $media); | |
634 | - | |
635 | - if (is_array($det_media) && count($det_media)) { | |
636 | - $det_media = array_shift($det_media); | |
637 | - $media = $det_media['valor']; | |
638 | - $media = str_replace('.', ',', sprintf('%01.1f', $media)); | |
639 | - } | |
428 | + $media = $medias[$id][0]; | |
429 | + $media = $media->mediaArredondada; | |
430 | + | |
431 | + if (!$this->presencaGeral) { | |
432 | + if (isset($faltas[$id])) { | |
433 | + $faltas = array_sum(CoreExt_Entity::entityFilterAttr( | |
434 | + $faltas[$id], 'id', 'quantidade') | |
435 | + ); | |
640 | 436 | } |
641 | 437 | } |
438 | + } | |
439 | + | |
440 | + // Média | |
441 | + $this->pdf->escreve_relativo($media, $esquerda, $this->page_y + 4, | |
442 | + $espacoComponentes / $espacoDiv, 50, $fonte, $tam_texto + 1, $corTexto, 'center'); | |
443 | + | |
444 | + $this->pdf->linha_relativa($esquerda + $espacoComponentes / $espacoDiv, | |
445 | + $this->page_y, 0, $altura); | |
642 | 446 | |
643 | - $this->pdf->escreve_relativo($media, $esquerda, $this->page_y + 4, | |
644 | - $espaco_disciplinas, 50, $fonte, $tam_texto + 1, $corTexto, 'center'); | |
645 | - $esquerda += $espaco_disciplinas; | |
646 | - $this->pdf->linha_relativa($esquerda, $this->page_y, 0, $altura); | |
447 | + // Exibe as faltas no componente curricular, caso a presença não seja geral | |
448 | + if (!$this->presencaGeral) { | |
449 | + $this->pdf->escreve_relativo($faltas, $esquerda + $espacoComponentes / $espacoDiv, | |
450 | + $this->page_y + 4, $espacoComponentes / $espacoDiv, 100, $fonte, $tam_texto + 1, | |
451 | + $corTexto, 'center'); | |
647 | 452 | } |
648 | 453 | |
649 | - $obj_falta = new clsPmieducarFaltas(); | |
454 | + $esquerda += $espacoComponentes; | |
455 | + $this->pdf->linha_relativa($esquerda, $this->page_y, 0, $altura); | |
456 | + } | |
457 | + | |
458 | + // Exibe as faltas no total, caso a presença seja geral | |
459 | + if ($this->presencaGeral) { | |
460 | + $this->pdf->escreve_relativo($faltas, $esquerda, | |
461 | + $this->page_y + 4, $espacoComponentes, 50, $fonte, $tam_texto + 1, | |
462 | + $corTexto, 'center'); | |
650 | 463 | |
651 | - $faltas = $obj_falta->somaFaltas($matricula); | |
652 | - $this->pdf->escreve_relativo($faltas ? $faltas : '0', $esquerda, $this->page_y + 4, | |
653 | - $espaco_disciplinas, 50, $fonte, $tam_texto + 1, $corTexto, 'center'); | |
464 | + $esquerda += $espacoComponentes; | |
654 | 465 | |
655 | - $esquerda += $espaco_disciplinas; | |
656 | 466 | $this->pdf->linha_relativa($esquerda, $this->page_y, 0, $altura); |
657 | 467 | } |
658 | 468 | |
659 | 469 | $this->page_y += $altura; |
470 | + | |
660 | 471 | if ($this->page_y > $this->pdf->altura - $altura * 2) { |
661 | 472 | $this->pdf->ClosePage(); |
662 | 473 | $this->pdf->OpenPage(); |
... | ... | @@ -709,31 +520,36 @@ class indice extends clsCadastro |
709 | 520 | 78, $direita, 80, $fonte, 12, $corTexto, 'center'); |
710 | 521 | |
711 | 522 | $this->pdf->quadrado_relativo($esquerda, $this->page_y += 100, $direita, $altura); |
523 | + | |
712 | 524 | $this->pdf->escreve_relativo('Disciplina', $esquerda + 30, $this->page_y + 1, |
713 | 525 | 150, 50, $fonte, 9, $corTexto, 'center'); |
526 | + | |
714 | 527 | $this->pdf->escreve_relativo('Carga Horária', $esquerda + 35, $this->page_y + 10, |
715 | 528 | 150, 50, $fonte, 7, $corTexto, 'center'); |
716 | 529 | |
717 | 530 | $this->page_y += $altura; |
531 | + | |
718 | 532 | $this->pdf->quadrado_relativo($esquerda, $this->page_y, $direita, $altura); |
533 | + | |
719 | 534 | $this->pdf->escreve_relativo('Matrícula', $esquerda, $this->page_y + 2, 45, |
720 | 535 | 45, $fonte, $tam_texto, $corTexto, 'center'); |
536 | + | |
721 | 537 | $this->pdf->linha_relativa($esquerda += 45, $this->page_y, 0, $altura); |
722 | 538 | |
723 | 539 | $espaco_nome = 150; |
540 | + | |
724 | 541 | $this->pdf->escreve_relativo('Nome do Aluno', $esquerda, $this->page_y + 2, |
725 | 542 | $espaco_nome, 45, $fonte, $tam_texto, $corTexto, 'center'); |
543 | + | |
726 | 544 | $this->pdf->linha_relativa($esquerda += $espaco_nome, $this->page_y, 0, $altura); |
545 | + | |
727 | 546 | $this->pdf->escreve_relativo('Situação', $esquerda, $this->page_y + 2, 45, |
728 | 547 | 45, $fonte, $tam_texto, $corTexto, 'center'); |
548 | + | |
729 | 549 | $this->pdf->linha_relativa($esquerda += 45, $this->page_y, 0, $altura); |
730 | 550 | |
731 | - if ($this->falta_ch_globalizada) { | |
732 | - $carga_global = $this->montaDisciplinasGlobalizada($esquerda, $direita - $esquerda); | |
733 | - } | |
734 | - else { | |
735 | - $carga_global = $this->montaDisciplinasNaoGlobalizada($esquerda, $direita - $esquerda); | |
736 | - } | |
551 | + // Gera o header da tabela e calcula a carga horária global | |
552 | + $carga_global = $this->getComponentesTableHeader($esquerda, $direita - $esquerda); | |
737 | 553 | |
738 | 554 | $nm_curso = sprintf('Curso: %s Série: %s Turma: %s Dias Letivos: %d Carga Global: %s Turno: %s', |
739 | 555 | $this->nm_curso, $this->nm_serie, $this->nm_turma, $this->dias_letivos, $carga_global, $this->nm_turno); |
... | ... | @@ -746,88 +562,6 @@ class indice extends clsCadastro |
746 | 562 | $this->page_y += $altura; |
747 | 563 | } |
748 | 564 | |
749 | - | |
750 | - function montaDisciplinasGlobalizada($esquerda, $espaco_disciplina) | |
751 | - { | |
752 | - $tam_texto = 9; | |
753 | - $altura = 20; | |
754 | - $tam_texto = 9; | |
755 | - $fonte = 'arial'; | |
756 | - $corTexto = '#000000'; | |
757 | - $carga_global = 0; | |
758 | - | |
759 | - $espaco_disciplinas = ceil($espaco_disciplina / (count($this->disciplinas) + 1)); | |
760 | - | |
761 | - foreach ($this->disciplinas as $disciplina) { | |
762 | - $carga_global += $disciplina['carga_horaria']; | |
763 | - | |
764 | - $this->pdf->escreve_relativo($disciplina['abreviatura'], $esquerda, | |
765 | - $this->page_y - $altura, $espaco_disciplinas, 100, $fonte, $tam_texto, | |
766 | - $corTexto, 'center'); | |
767 | - | |
768 | - $this->pdf->escreve_relativo($disciplina['carga_horaria'] . ' hrs', | |
769 | - $esquerda, $this->page_y + 10 - $altura, $espaco_disciplinas, 50, | |
770 | - $fonte, $tam_texto - 2, $corTexto, 'center'); | |
771 | - | |
772 | - $this->pdf->escreve_relativo('Nota / Conceito', $esquerda, $this->page_y + 3, | |
773 | - $espaco_disciplinas, 50, $fonte, $tam_texto - 2, $corTexto, 'center'); | |
774 | - | |
775 | - $this->pdf->linha_relativa($esquerda, $this->page_y - $altura, 0, $altura * 2); | |
776 | - | |
777 | - $esquerda += $espaco_disciplinas; | |
778 | - } | |
779 | - | |
780 | - $this->pdf->linha_relativa($esquerda, $this->page_y - $altura, 0, $altura * 2); | |
781 | - $this->pdf->escreve_relativo('Faltas', $esquerda, $this->page_y, $espaco_disciplinas, | |
782 | - 50, $fonte, $tam_texto, $corTexto, 'center'); | |
783 | - | |
784 | - $this->pdf->linha_relativa($esquerda += $espaco_disciplinas, | |
785 | - $this->page_y - $altura, 0, $altura * 2); | |
786 | - | |
787 | - $this->page_y += $altura; | |
788 | - | |
789 | - return $carga_global; | |
790 | - } | |
791 | - | |
792 | - function montaDisciplinasNaoGlobalizada($esquerda, $espaco_disciplina) | |
793 | - { | |
794 | - $espaco_disciplinas = ceil($espaco_disciplina / (count($this->disciplinas))); | |
795 | - | |
796 | - $tam_texto = 9; | |
797 | - $altura = 20; | |
798 | - $tam_texto = 9; | |
799 | - $fonte = 'arial'; | |
800 | - $corTexto = '#000000'; | |
801 | - $carga_global = 0; | |
802 | - | |
803 | - foreach ($this->disciplinas as $disciplina) { | |
804 | - $carga_global += $disciplina['carga_horaria']; | |
805 | - | |
806 | - $this->pdf->escreve_relativo($disciplina['abreviatura'], $esquerda, | |
807 | - $this->page_y - $altura, $espaco_disciplinas, 100, $fonte, $tam_texto, $corTexto, 'center'); | |
808 | - | |
809 | - $this->pdf->escreve_relativo($disciplina['carga_horaria'] . ' hrs', $esquerda, | |
810 | - $this->page_y + 10 - $altura, $espaco_disciplinas, 50, $fonte, | |
811 | - $tam_texto - 2, $corTexto, 'center'); | |
812 | - | |
813 | - $this->pdf->escreve_relativo('Nota / Conceito', $esquerda, $this->page_y + 3, | |
814 | - $espaco_disciplinas / 2, 50, $fonte, $tam_texto - 2, $corTexto, 'center'); | |
815 | - | |
816 | - $this->pdf->escreve_relativo('Falta', $esquerda + $espaco_disciplinas / 2, | |
817 | - $this->page_y + 3, $espaco_disciplinas / 2, 50, $fonte, $tam_texto - 2, | |
818 | - $corTexto, 'center'); | |
819 | - | |
820 | - $this->pdf->linha_relativa($esquerda, $this->page_y - $altura, 0, $altura * 2); | |
821 | - | |
822 | - $this->pdf->linha_relativa($esquerda + $espaco_disciplinas / 2, $this->page_y, 0, $altura); | |
823 | - | |
824 | - $esquerda += $espaco_disciplinas; | |
825 | - } | |
826 | - $this->page_y += $altura; | |
827 | - | |
828 | - return $carga_global; | |
829 | - } | |
830 | - | |
831 | 565 | function buscaDiasLetivos() |
832 | 566 | { |
833 | 567 | $obj_calendario = new clsPmieducarEscolaAnoLetivo(); |
... | ... | @@ -847,13 +581,13 @@ class indice extends clsCadastro |
847 | 581 | $inicio = $lst_ano_letivo_modulo['0']; |
848 | 582 | $fim = $lst_ano_letivo_modulo[count($lst_ano_letivo_modulo) - 1]; |
849 | 583 | |
850 | - $mes_inicial = explode("-", $inicio['data_inicio']); | |
584 | + $mes_inicial = explode('-', $inicio['data_inicio']); | |
851 | 585 | $mes_inicial = $mes_inicial[1]; |
852 | 586 | $dia_inicial = $mes_inicial[2]; |
853 | 587 | |
854 | - $mes_final = explode("-", $fim['data_fim']); | |
855 | - $mes_final = $mes_final[1]; | |
856 | - $dia_final = $mes_final[2]; | |
588 | + $mes_final = explode('-', $fim['data_fim']); | |
589 | + $mes_final = $mes_final[1]; | |
590 | + $dia_final = $mes_final[2]; | |
857 | 591 | } |
858 | 592 | |
859 | 593 | for ($mes = $mes_inicial;$mes <= $mes_final; $mes++) { |
... | ... | @@ -911,11 +645,11 @@ class indice extends clsCadastro |
911 | 645 | } |
912 | 646 | |
913 | 647 | if ($DiaSemana != 0 && $DiaSemana != 6) { |
914 | - if (!(key_exists($dia,$dias_mes) && $dias_mes[$dia] == strtolower('n'))) { | |
648 | + if (!(key_exists($dia, $dias_mes) && $dias_mes[$dia] == strtolower('n'))) { | |
915 | 649 | $totalDiasUteis++; |
916 | 650 | } |
917 | 651 | } |
918 | - elseif (key_exists($dia,$dias_mes) && $dias_mes[$dia] == strtolower('e')) { | |
652 | + elseif (key_exists($dia, $dias_mes) && $dias_mes[$dia] == strtolower('e')) { | |
919 | 653 | $totalDiasUteis++; |
920 | 654 | } |
921 | 655 | |
... | ... | @@ -926,6 +660,75 @@ class indice extends clsCadastro |
926 | 660 | $this->dias_letivos = $totalDiasUteis; |
927 | 661 | } |
928 | 662 | |
663 | + function rodape() | |
664 | + { | |
665 | + $texto = ''; | |
666 | + $esquerda = 3; | |
667 | + $altura = 22; | |
668 | + $direita = 834; | |
669 | + $tam_texto = 10; | |
670 | + $this->pdf->escreve_relativo('Legenda', $esquerda + 2, $this->page_y += 30, | |
671 | + 150, 100, $fonte, $tam_texto); | |
672 | + | |
673 | + if (count($this->componentes) > 10) { | |
674 | + $legenda_por_linha = TRUE; | |
675 | + } else { | |
676 | + $legenda_por_linha = FALSE; | |
677 | + } | |
678 | + | |
679 | + foreach ($this->componentes as $componente) { | |
680 | + $texto .= $componente->abreviatura . ': ' . $componente->nome . ' '; | |
681 | + | |
682 | + if ($legenda_por_linha) { | |
683 | + $this->pdf->escreve_relativo($texto, $esquerda + 2, $this->page_y += $altura, | |
684 | + $direita, 200, $fonte, $tam_texto + 1); | |
685 | + | |
686 | + $texto = ''; | |
687 | + | |
688 | + if ($this->page_y > $this->pdf->altura - 50) { | |
689 | + $texto = ''; | |
690 | + $esquerda = 3; | |
691 | + $altura = 18; | |
692 | + $direita = 834; | |
693 | + $tam_texto = 10; | |
694 | + $this->pdf->ClosePage(); | |
695 | + $this->pdf->OpenPage(); | |
696 | + $this->addCabecalho(); | |
697 | + } | |
698 | + } | |
699 | + } | |
700 | + | |
701 | + if (! $legenda_por_linha) { | |
702 | + $this->pdf->escreve_relativo($texto, $esquerda + 2, $this->page_y += $altura, | |
703 | + $direita, 200, $fonte, $tam_texto + 1); | |
704 | + } | |
705 | + | |
706 | + if ($this->page_y + $altura * 2 > $this->pdf->altura - 50) { | |
707 | + $texto = ''; | |
708 | + $esquerda = 3; | |
709 | + $altura = 18; | |
710 | + $direita = 834; | |
711 | + $tam_texto = 10; | |
712 | + $this->pdf->ClosePage(); | |
713 | + $this->pdf->OpenPage(); | |
714 | + $this->addCabecalho(); | |
715 | + } | |
716 | + | |
717 | + $this->pdf->quadrado_relativo($esquerda, $this->page_y += $altura * 2, $direita, 60); | |
718 | + | |
719 | + $this->pdf->escreve_relativo('Observações:', $esquerda + 1, $this->page_y + 1, 150, 200, $fonte, $tam_texto); | |
720 | + | |
721 | + $this->pdf->linha_relativa($esquerda + 200, $this->page_y += 120, 150, 0); | |
722 | + | |
723 | + $this->pdf->escreve_relativo('Assinatura do(a) Secretário(a)', $esquerda + 220, | |
724 | + $this->page_y + 2, 150, 200, $fonte, 7); | |
725 | + | |
726 | + $this->pdf->linha_relativa($esquerda + 450, $this->page_y, 150, 0); | |
727 | + | |
728 | + $this->pdf->escreve_relativo('Assinatura do(a) Diretor(a)', $esquerda + 480, | |
729 | + $this->page_y + 2, 150, 200, $fonte, 7); | |
730 | + } | |
731 | + | |
929 | 732 | function Editar() |
930 | 733 | { |
931 | 734 | return FALSE; | ... | ... |
ieducar/lib/App/Model/MatriculaSituacao.php
... | ... | @@ -54,7 +54,7 @@ class App_Model_MatriculaSituacao extends CoreExt_Enum |
54 | 54 | |
55 | 55 | protected $_data = array( |
56 | 56 | self::APROVADO => 'Aprovado', |
57 | - self::REPROVADO => 'Reprovado', | |
57 | + self::REPROVADO => 'Retido', | |
58 | 58 | self::EM_ANDAMENTO => 'Em andamento', |
59 | 59 | self::TRANSFERIDO => 'Transferido', |
60 | 60 | self::RECLASSIFICADO => 'Reclassificado', | ... | ... |
ieducar/modules/Avaliacao/Service/Boletim.php
... | ... | @@ -49,6 +49,9 @@ require_once 'App/Model/MatriculaSituacao.php'; |
49 | 49 | * @since Classe disponível desde a versão 1.1.0 |
50 | 50 | * @todo Substituir todos os usos literais de 'Rc' e 'An' por constantes |
51 | 51 | * ou por um novo CoreExt_Enum |
52 | + * @todo Criar método que retorna o conjunto de faltas de acordo com o | |
53 | + * tipo de presença da regra, refatorando a série de condicionais | |
54 | + * existentes em métodos como getSituacaoFaltas() | |
52 | 55 | * @version @@package_version@@ |
53 | 56 | */ |
54 | 57 | class Avaliacao_Service_Boletim implements CoreExt_Configurable | ... | ... |