function Editar()
 {
     $obj_servidor = new clsPmieducarServidor($this->cod_servidor, NULL, NULL, NULL, NULL, NULL, NULL, $this->ref_cod_instituicao, $this->ref_cod_subnivel);
     $obj_servidor->edita();
     echo sprintf('<script>parent.fechaExpansivel("%s");window.parent.location.reload(true);</script>', $_GET['div']);
     die;
 }
예제 #2
0
 function Editar()
 {
     $timesep = explode(':', $this->carga_horaria);
     $hour = $timesep[0] + (int) ($timesep[1] / 60);
     $min = abs((int) ($timesep[1] / 60) - $timesep[1] / 60) . '<br>';
     $this->carga_horaria = $hour + $min;
     $this->carga_horaria = $hour + $min;
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     @session_write_close();
     $obj_permissoes = new clsPermissoes();
     $obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7, 'educar_servidor_lst.php');
     if ($this->ref_cod_instituicao == $this->ref_cod_instituicao_original) {
         $this->carga_horaria = str_replace(',', '.', $this->carga_horaria);
         $obj = new clsPmieducarServidor($this->cod_servidor, $this->ref_cod_deficiencia, $this->ref_idesco, $this->carga_horaria, NULL, NULL, 1, $this->ref_cod_instituicao);
         $editou = $obj->edita();
         if ($editou) {
             $this->cadastraFuncoes();
             include 'educar_limpa_sessao_curso_disciplina_servidor.php';
             $this->mensagem .= 'Edição efetuada com sucesso.<br>';
             header("Location: educar_servidor_det.php?cod_servidor={$this->cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}");
             die;
         }
     } else {
         $obj_quadro_horario = new clsPmieducarQuadroHorarioHorarios(NULL, NULL, NULL, NULL, NULL, NULL, $this->cod_servidor, NULL, NULL, NULL, NULL, NULL, NULL, 1, $this->ref_cod_instituicao);
         if ($obj_quadro_horario->detalhe()) {
             $this->mensagem = "Edição não realizada. O servidor está vinculado a um quadro de horários.<br>";
             return FALSE;
         } else {
             $obj_quadro_horario = new clsPmieducarQuadroHorarioHorarios(NULL, NULL, NULL, NULL, NULL, NULL, NULL, $this->cod_servidor, NULL, NULL, NULL, NULL, NULL, 1, NULL, $this->ref_cod_instituicao);
             if ($obj_quadro_horario->detalhe()) {
                 $this->mensagem = "Edição não realizada. O servidor está vinculado a um quadro de horários.<br>";
                 return FALSE;
             } else {
                 $this->carga_horaria = str_replace(',', '.', $this->carga_horaria);
                 $obj = new clsPmieducarServidor($this->cod_servidor, $this->ref_cod_deficiencia, $this->ref_idesco, $this->carga_horaria, NULL, NULL, 0, $this->ref_cod_instituicao_original);
                 $editou = $obj->edita();
                 if ($editou) {
                     $obj = new clsPmieducarServidor($this->cod_servidor, $this->ref_cod_deficiencia, $this->ref_idesco, $this->carga_horaria, NULL, NULL, 1, $this->ref_cod_instituicao);
                     if ($obj->existe()) {
                         $cadastrou = $obj->edita();
                     } else {
                         $cadastrou = $obj->cadastra();
                     }
                     if ($cadastrou) {
                         $this->cadastraFuncoes();
                         include 'educar_limpa_sessao_curso_disciplina_servidor.php';
                         $this->mensagem .= "Edição efetuada com sucesso.<br>";
                         header("Location: educar_servidor_det.php?cod_servidor={$this->cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}");
                         die;
                     }
                 }
             }
         }
     }
     $this->mensagem = "Edição não realizada.<br>";
     return FALSE;
 }