function Editar() { session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; session_write_close(); if ($this->idbai[0] != '' && $this->cep[0] != '') { foreach ($this->cep as $id => $cep) { $cep = idFederal2int($cep); $obj = new clsUrbanoCepLogradouro($cep, $this->idlog, NULL, NULL, NULL, NULL, 'U', $this->pessoa_logada, NULL, 'I', NULL, 9); if (!$obj->existe()) { if (!$obj->cadastra()) { $this->mensagem = 'Cadastro não realizado.<br>'; echo "<!--\nErro ao editar clsUrbanoCepLogradouro\nvalores obrigatorios\nif( is_numeric( {$cep} ) && is_numeric( {$this->idlog} ) && is_numeric( {$this->pessoa_logada} ) )\n-->"; return FALSE; } } $obj_cep_log_bairro = new clsUrbanoCepLogradouroBairro($this->idlog, $cep, $this->idbai[$id], NULL, NULL, 'U', $this->pessoa_logada, NULL, 'I', NULL, 9); if (!$obj_cep_log_bairro->existe()) { if (!$obj_cep_log_bairro->cadastra()) { $this->mensagem = 'Cadastro não realizado.<br>'; echo "<!--\nErro ao editar clsUrbanoCepLogradouroBairro\nvalores obrigatorios\nif( is_numeric( {$cep} ) && is_numeric( {$this->idlog} ) && is_numeric( {$this->idbai[$id]} ) && is_numeric( {$this->pessoa_logada} ) )\n-->"; return FALSE; } } } $this->mensagem .= 'Edição efetuada com sucesso.<br>'; header('Location: urbano_cep_logradouro_lst.php'); die; } else { $this->mensagem = 'É necessario adicionar pelo menos um CEP e bairro.<br>'; return FALSE; } }