function Editar() { @session_start(); $pessoaFj = $_SESSION['id_pessoa']; session_write_close(); $obj = new clsGrupoModerador($this->cod_pessoa_fj, $this->cod_grupo); $detalhe = $obj->detalhe(); if ($detalhe && $detalhe['ativo'] == 1) { header("Location: otopic_meus_grupos_det.php?cod_grupo={$this->cod_grupo}"); } $objPessoa = new clsPessoa_($this->cod_pessoa_fj, $this->p_nm_pessoa, false, $this->http, false, $pessoaFj, date("Y-m-d H:i:s", time()), $this->email); $objPessoa->edita(); $objFisica = new clsFisica($this->cod_pessoa_fj, false, $this->sexo); $objFisica->edita(); $objTelefone = new clsPessoaTelefone($this->cod_pessoa_fj, 1, $this->telefone_1, $this->ddd_telefone_1); $objTelefone->cadastra(); $objTelefone = new clsPessoaTelefone($this->cod_pessoa_fj, 2, $this->telefone_2, $this->ddd_telefone_2); $objTelefone->cadastra(); $objTelefone = new clsPessoaTelefone($this->cod_pessoa_fj, 3, $this->telefone_mov, $this->ddd_telefone_mov); $objTelefone->cadastra(); $objTelefone = new clsPessoaTelefone($this->cod_pessoa_fj, 4, $this->telefone_fax, $this->ddd_telefone_fax); $objTelefone->cadastra(); if ($this->cep && $this->idbai && $this->idlog) { $objEndereco = new clsPessoaEndereco($this->cod_pessoa_fj); $objEndereco2 = new clsPessoaEndereco($this->cod_pessoa_fj, $this->cep, $this->idlog, $this->idbai, $this->numero, $this->complemento, false, $this->letra, $this->bloco, $this->apartamento, $this->andar); if ($objEndereco->detalhe()) { $objEndereco2->edita(); } else { $objEndereco2->cadastra(); } } else { $this->cep_ = idFederal2int($this->cep_); $objEnderecoExterno = new clsEnderecoExterno($this->cod_pessoa_fj); $objEnderecoExterno2 = new clsEnderecoExterno($this->cod_pessoa_fj, "1", $this->idtlog, $this->logradouro, $this->numero, $this->letra, $this->complemento, $this->bairro, $this->cep_, $this->cidade, $this->sigla_uf, false, $this->bloco, $this->apartamento, $this->andar); if ($objEnderecoExterno->detalhe()) { $objEnderecoExterno2->edita(); } else { $objEnderecoExterno2->cadastra(); } } $obj = new clsGrupoPessoa($this->cod_pessoa_fj, $this->cod_grupo); if (!$obj->detalhe()) { $obj = new clsGrupoPessoa($this->cod_pessoa_fj, $this->cod_grupo, $pessoaFj, false, $this->cod_grupo); if ($obj->cadastra()) { header("Location: otopic_meus_grupos_det.php?cod_grupo={$this->cod_grupo}"); } } else { $obj = new clsGrupoPessoa($this->cod_pessoa_fj, $this->cod_grupo, $pessoaFj, false, $this->cod_grupo, false, 1); if ($obj->edita()) { header("Location: otopic_meus_grupos_det.php?cod_grupo={$this->cod_grupo}"); } } return true; }