$cl->atacadista = $_POST['atacadista'] == ListaPessoas::VALOR_ATACADISTA_TRUE ? true : false; if (!empty($_FILES['imagem']['name'])) { $cl->setFoto(new Image(Arquivos::__OpenArquivoByTEMP($_FILES['imagem']))); } $lCL->alterar($cl); if (!empty($_POST['cep'])) { if (!empty($_POST['logradouro']) && !empty($_POST['numero']) && !empty($_POST['bairro']) && !empty($_POST['pais']) && !empty($_POST['estado']) && !empty($_POST['cidade']) && !empty($_POST['cep'])) { $end = new Endereco(); $end->logradouro = $_POST['logradouro']; $end->numero = $_POST['numero']; $end->complemento = $_POST['complemento']; $end->bairro = $_POST['bairro']; $end->cidade = $_POST['cidade']; $end->estado = $_POST['estado']; $end->pais = $_POST['pais']; $end->setCEP($_POST['cep']); $cl->addEndereco($end); } else { $javaScript .= Aviso::criar("Dados incompletos do endereço!"); } } if (!empty($_POST['telefone'])) { if (!empty($_POST['descricaoT']) && !empty($_POST['telefone'])) { $tel = new Telefone(); $tel->local = $_POST['descricaoT']; $tel->telefone = eregi_replace('-', '', substr($_POST['telefone'], 5, 9)); $tel->ddd = substr($_POST['telefone'], 1, 2); $tel->ramal = $_POST['ramal']; $cl->addTelefone($tel); } else { $javaScript .= Aviso::criar("Dados incompletos do telefone!");