From 6e20b1e0a43817f66076549ce1b6ecd1d25190fd Mon Sep 17 00:00:00 2001 From: Eriksen Costa Paixão Date: Thu, 30 Jul 2009 18:19:52 +0000 Subject: [PATCH] Atualizado código para redirecionar para a listagem de vagas reservadas da mesma escola e série --- ieducar/intranet/educar_reservada_vaga_det.php | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/ieducar/intranet/educar_reservada_vaga_det.php b/ieducar/intranet/educar_reservada_vaga_det.php index 9f2b739..a3ec234 100644 --- a/ieducar/intranet/educar_reservada_vaga_det.php +++ b/ieducar/intranet/educar_reservada_vaga_det.php @@ -105,21 +105,6 @@ class indice extends clsDetalhe $this->cod_reserva_vaga = $_GET['cod_reserva_vaga']; - if ($_GET['desativa'] == true) { - $obj = new clsPmieducarReservaVaga($this->cod_reserva_vaga, NULL, NULL, - $this->pessoa_logada, NULL, NULL, NULL, NULL, 0); - $excluiu = $obj->excluir(); - - if ($excluiu) { - $this->mensagem .= 'Exclusão efetuada com sucesso.
'; - header('Location: educar_reservada_vaga_lst.php'); - die(); - } - - $this->mensagem = 'Exclusão não realizada.
'; - return FALSE; - } - $obj_reserva_vaga = new clsPmieducarReservaVaga(); $lst_reserva_vaga = $obj_reserva_vaga->lista($this->cod_reserva_vaga); @@ -138,6 +123,11 @@ class indice extends clsDetalhe $this->ref_cod_serie = $registro['ref_ref_cod_serie']; $this->ref_cod_instituicao = $registro['ref_cod_instituicao']; + // Desativa o pedido de reserva de vaga + if ($_GET['desativa'] == true) { + $this->_desativar(); + } + // Instituição $obj_instituicao = new clsPmieducarInstituicao($registro['ref_cod_instituicao']); $det_instituicao = $obj_instituicao->detalhe(); @@ -209,6 +199,28 @@ class indice extends clsDetalhe $this->ref_cod_escola . '&ref_cod_serie=' . $this->ref_cod_serie; $this->largura = '100%'; } + + /** + * Desativa o pedido de reserva de vaga. + * @return bool Retorna FALSE em caso de erro + */ + private function _desativar() + { + $obj = new clsPmieducarReservaVaga($this->cod_reserva_vaga, NULL, NULL, + $this->pessoa_logada, NULL, NULL, NULL, NULL, 0); + $excluiu = $obj->excluir(); + + if ($excluiu) { + $this->mensagem .= 'Exclusão efetuada com sucesso.
'; + header('Location: educar_reservada_vaga_lst.php?ref_cod_escola=' . + $this->ref_cod_escola . '&ref_cod_serie=' . $this->ref_cod_serie); + die(); + } + + $this->mensagem = 'Exclusão não realizada.
'; + return FALSE; + } + } // Instancia objeto de página -- libgit2 0.21.2