Commit 6e20b1e0a43817f66076549ce1b6ecd1d25190fd
1 parent
1d95e57d
Exists in
master
Atualizado código para redirecionar para a listagem de vagas reservadas da mesma escola e série
Showing
1 changed file
with
27 additions
and
15 deletions
Show diff stats
ieducar/intranet/educar_reservada_vaga_det.php
... | ... | @@ -105,21 +105,6 @@ class indice extends clsDetalhe |
105 | 105 | |
106 | 106 | $this->cod_reserva_vaga = $_GET['cod_reserva_vaga']; |
107 | 107 | |
108 | - if ($_GET['desativa'] == true) { | |
109 | - $obj = new clsPmieducarReservaVaga($this->cod_reserva_vaga, NULL, NULL, | |
110 | - $this->pessoa_logada, NULL, NULL, NULL, NULL, 0); | |
111 | - $excluiu = $obj->excluir(); | |
112 | - | |
113 | - if ($excluiu) { | |
114 | - $this->mensagem .= 'Exclusão efetuada com sucesso.<br>'; | |
115 | - header('Location: educar_reservada_vaga_lst.php'); | |
116 | - die(); | |
117 | - } | |
118 | - | |
119 | - $this->mensagem = 'Exclusão não realizada.<br>'; | |
120 | - return FALSE; | |
121 | - } | |
122 | - | |
123 | 108 | $obj_reserva_vaga = new clsPmieducarReservaVaga(); |
124 | 109 | $lst_reserva_vaga = $obj_reserva_vaga->lista($this->cod_reserva_vaga); |
125 | 110 | |
... | ... | @@ -138,6 +123,11 @@ class indice extends clsDetalhe |
138 | 123 | $this->ref_cod_serie = $registro['ref_ref_cod_serie']; |
139 | 124 | $this->ref_cod_instituicao = $registro['ref_cod_instituicao']; |
140 | 125 | |
126 | + // Desativa o pedido de reserva de vaga | |
127 | + if ($_GET['desativa'] == true) { | |
128 | + $this->_desativar(); | |
129 | + } | |
130 | + | |
141 | 131 | // Instituição |
142 | 132 | $obj_instituicao = new clsPmieducarInstituicao($registro['ref_cod_instituicao']); |
143 | 133 | $det_instituicao = $obj_instituicao->detalhe(); |
... | ... | @@ -209,6 +199,28 @@ class indice extends clsDetalhe |
209 | 199 | $this->ref_cod_escola . '&ref_cod_serie=' . $this->ref_cod_serie; |
210 | 200 | $this->largura = '100%'; |
211 | 201 | } |
202 | + | |
203 | + /** | |
204 | + * Desativa o pedido de reserva de vaga. | |
205 | + * @return bool Retorna FALSE em caso de erro | |
206 | + */ | |
207 | + private function _desativar() | |
208 | + { | |
209 | + $obj = new clsPmieducarReservaVaga($this->cod_reserva_vaga, NULL, NULL, | |
210 | + $this->pessoa_logada, NULL, NULL, NULL, NULL, 0); | |
211 | + $excluiu = $obj->excluir(); | |
212 | + | |
213 | + if ($excluiu) { | |
214 | + $this->mensagem .= 'Exclusão efetuada com sucesso.<br>'; | |
215 | + header('Location: educar_reservada_vaga_lst.php?ref_cod_escola=' . | |
216 | + $this->ref_cod_escola . '&ref_cod_serie=' . $this->ref_cod_serie); | |
217 | + die(); | |
218 | + } | |
219 | + | |
220 | + $this->mensagem = 'Exclusão não realizada.<br>'; | |
221 | + return FALSE; | |
222 | + } | |
223 | + | |
212 | 224 | } |
213 | 225 | |
214 | 226 | // Instancia objeto de página | ... | ... |