Commit c91b404e7fddc638886d402e10e84b3acf6bce04
1 parent
6e96203a
Exists in
master
Removido código desnecessário
Showing
1 changed file
with
0 additions
and
119 deletions
Show diff stats
ieducar/intranet/educar_matricula_cad.php
| ... | ... | @@ -303,13 +303,6 @@ class indice extends clsCadastro |
| 303 | 303 | |
| 304 | 304 | $cadastrou = $obj->cadastra(); |
| 305 | 305 | if ($cadastrou) { |
| 306 | - /** | |
| 307 | - * @todo Remover | |
| 308 | - */ | |
| 309 | - if ($this->pessoa_logada == 21317) { | |
| 310 | - $this->desativaMatriculasSequencia($cadastrou); | |
| 311 | - } | |
| 312 | - | |
| 313 | 306 | $obj_transferencia = new clsPmieducarTransferenciaSolicitacao(); |
| 314 | 307 | $lst_transferencia = $obj_transferencia->lista(NULL, NULL, NULL, NULL, |
| 315 | 308 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, |
| ... | ... | @@ -640,118 +633,6 @@ class indice extends clsCadastro |
| 640 | 633 | $this->mensagem = 'Exclusão não realizada.<br />'; |
| 641 | 634 | return FALSE; |
| 642 | 635 | } |
| 643 | - | |
| 644 | - /** | |
| 645 | - * Marca como zero o campo ultima_matricula das matriculas da sequência. | |
| 646 | - * @param int $ultima_matricula | |
| 647 | - * @todo Remover, apenas um código condicional chama o método (L310). | |
| 648 | - */ | |
| 649 | - function desativaMatriculasSequencia($ultima_matricula) | |
| 650 | - { | |
| 651 | - $db2 = new clsBanco(); | |
| 652 | - | |
| 653 | - $db2->Consulta(' | |
| 654 | - SELECT | |
| 655 | - so.ref_cod_curso as curso_origem, | |
| 656 | - ss.ref_serie_origem as serie_origem, | |
| 657 | - sd.ref_cod_curso as curso_destino, | |
| 658 | - ss.ref_serie_destino as serie_destino | |
| 659 | - FROM | |
| 660 | - pmieducar.sequencia_serie ss, | |
| 661 | - pmieducar.serie so, | |
| 662 | - pmieducar.serie sd | |
| 663 | - WHERE | |
| 664 | - ss.ativo = 1 | |
| 665 | - AND ref_serie_origem = so.cod_serie | |
| 666 | - AND ref_serie_destino = sd.cod_serie | |
| 667 | - ORDER BY | |
| 668 | - ss.ref_serie_origem ASC'); | |
| 669 | - | |
| 670 | - if ($db2->numLinhas()) { | |
| 671 | - while ($db2->ProximoRegistro()) { | |
| 672 | - $sequencias[] = $db2->Tupla(); | |
| 673 | - } | |
| 674 | - } | |
| 675 | - | |
| 676 | - $db2->Consulta(' | |
| 677 | - SELECT | |
| 678 | - DISTINCT(o.ref_serie_origem) | |
| 679 | - FROM | |
| 680 | - pmieducar.sequencia_serie o, | |
| 681 | - pmieducar.escola_serie es | |
| 682 | - WHERE | |
| 683 | - NOT EXISTS ( | |
| 684 | - SELECT | |
| 685 | - 1 | |
| 686 | - FROM | |
| 687 | - pmieducar.sequencia_serie d | |
| 688 | - WHERE | |
| 689 | - o.ref_serie_origem = d.ref_serie_destino | |
| 690 | - )'); | |
| 691 | - | |
| 692 | - if ($db2->numLinhas()) | |
| 693 | - { | |
| 694 | - $pertence_sequencia = FALSE; | |
| 695 | - $achou_serie = FALSE; | |
| 696 | - $reset = FALSE; | |
| 697 | - | |
| 698 | - $serie_sequencia[] = $this->ref_ref_cod_serie; | |
| 699 | - | |
| 700 | - while ($db2->ProximoRegistro()) { | |
| 701 | - list($ini_sequencia) = $db2->Tupla(); | |
| 702 | - | |
| 703 | - $ini_serie = $ini_sequencia; | |
| 704 | - reset($sequencias); | |
| 705 | - | |
| 706 | - do { | |
| 707 | - if ($reset) { | |
| 708 | - reset($sequencias); | |
| 709 | - $reset = FALSE; | |
| 710 | - } | |
| 711 | - | |
| 712 | - $sequencia = current($sequencias); | |
| 713 | - $aux_serie = $sequencia['serie_origem']; | |
| 714 | - | |
| 715 | - if ($ini_serie == $aux_serie) { | |
| 716 | - if ($this->ref_ref_cod_serie == $aux_serie) { | |
| 717 | - // Achou série da matricula | |
| 718 | - $achou_serie = TRUE; | |
| 719 | - } | |
| 720 | - | |
| 721 | - if ($sequencia['curso_destino'] == $this->ref_cod_curso) { | |
| 722 | - // Curso pertence a sequência | |
| 723 | - $pertence_sequencia = TRUE; | |
| 724 | - $serie_sequencia[] = $sequencia['serie_destino']; | |
| 725 | - $ini_serie = $sequencia['serie_destino']; | |
| 726 | - $reset = TRUE; | |
| 727 | - } | |
| 728 | - else { | |
| 729 | - $ini_serie = $sequencia['serie_destino']; | |
| 730 | - $reset = TRUE; | |
| 731 | - } | |
| 732 | - } | |
| 733 | - } while (each($sequencias)); | |
| 734 | - | |
| 735 | - if ($achou_serie && $pertence_sequencia) { | |
| 736 | - // Curso escolhido pertence a sequência da série da matrícula | |
| 737 | - $series = implode(',', $serie_sequencia); | |
| 738 | - $db2->Consulta(sprintf(" | |
| 739 | - UPDATE | |
| 740 | - pmieducar.matricula | |
| 741 | - SET | |
| 742 | - ultima_matricula = 0 | |
| 743 | - WHERE | |
| 744 | - ref_ref_cod_serie IN (%s) | |
| 745 | - AND ref_cod_aluno = %d | |
| 746 | - AND cod_matricula != %d", | |
| 747 | - $series, $this->ref_cod_aluno, $ultima_matricula | |
| 748 | - )); | |
| 749 | - | |
| 750 | - die(); | |
| 751 | - } | |
| 752 | - } | |
| 753 | - } | |
| 754 | - } | |
| 755 | 636 | } |
| 756 | 637 | |
| 757 | 638 | // Instancia objeto de página | ... | ... |