| Server IP : 23.111.136.34 / Your IP : 216.73.216.136 Web Server : Apache System : Linux servidor.eurohost.com.br 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : meusitei ( 1072) PHP Version : 5.6.40 Disable Function : show_source, system, shell_exec, passthru, proc_open MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/meusitei/public_html/painel/geradoresintegracao/ |
Upload File : |
<?php
// Topo
$dom = new DOMDocument("1.0", "utf-8");
$root = $dom->createElement("ListingDataFeed");
$dom->appendChild($root);
$dom->formatOutput = true;
$o = $dom->createAttribute("xmlns");
$root->appendChild($o);
$o1 = $dom->createTextNode("http://www.vivareal.com/schemas/1.0/VRSync");
//$o1 = $dom->createTextNode("http://www.desapega.com/schemas/1.0/VRSync");
$o->appendChild($o1);
$oo = $dom->createAttribute("xmlns:xsi");
$root->appendChild($oo);
$o2 = $dom->createTextNode("http://www.w3.org/2001/XMLSchema-instance");
$oo->appendChild($o2);
$ooo = $dom->createAttribute("xsi:schemaLocation");
$root->appendChild($ooo);
$o3 = $dom->createTextNode("http://www.vivareal.com/schemas/1.0/VRSync http://xml.vivareal.com/vrsync.xsd");
//$o3 = $dom->createTextNode("http://www.desapega.com/schemas/1.0/VRSync");
$ooo->appendChild($o3);
// header
///// OBRIGATORIO - INICIO
$header = $dom->createElement("Header");
$root->appendChild($header);
$Provider = $dom->createElement("Provider");
$header->appendChild($Provider);
$titulositee = $dom->createTextNode('Meu Site Imobiliário');
$Provider->appendChild($titulositee);
$emaill = $dom->createElement("Email");
$header->appendChild($emaill);
$emailHeader = $dom->createTextNode('integracao@meusiteimobiliario.com.br');
$emaill->appendChild($emailHeader);
$contato = $dom->createElement("ContactName");
$header->appendChild($contato);
$contatoHeader = $dom->createTextNode($contactsistema);
$contato->appendChild($contatoHeader);
$data = $dom->createElement("PublishDate");
$header->appendChild($data);
$dataHeader = $dom->createTextNode(date('Y-m-dH:i:s'));
$data->appendChild($dataHeader);
$telephone = $dom->createElement("Telephone");
$header->appendChild($telephone);
$telephoneHeader = $dom->createTextNode($sis_fone1);
$telephone->appendChild($telephoneHeader);
///// OBRIGATORIO - FIM
//fim do header
//inicio do Listings
$Listings = $dom->createElement("Listings");
$root->appendChild($Listings);
$imoveisintegrados = explode('-', $portal['imoveis']);
//echo 'keko';
foreach ($imoveisintegrados as $campo) {
$imovel_invalido_desapega = '';
if (@$infoimovel[$campo] != null) {
echo $campo . '////' . serialize($infoimovel[$campo]) . '//////////';
// create child element
@$campo = $infoimovel[$campo];
$imovelvalido = 'nao';
$validar = '1';
if (($campo['valor'] != '') && ($campo['cep'] != null) && ($campo['cep_estado'] != null) && ($campo['cep_cidade'] != null) && ($campo['cep_bairro'] != null) && ($campo['descricaodoimovel_desapega'] != null) && ($campo['descricaodoimovel_desapega'] != "<br>")){
$imovelvalido = 'sim';
if($campo['negocio'] == 'Temporada'){
if(($campo['ciclo'] != 'Diária') && ($campo['ciclo'] != 'Semanal') && ($campo['ciclo'] != 'Mensal') && ($campo['ciclo'] != 'Trimestral')){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Ciclo'.'%';
}
}
if(($campo['tipo'] == 'Apartamento') || ($campo['tipo'] == 'Casa')){
if($campo['areautil'] == ''){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Área Útil'.'%';
}
if (($campo['dormitorio'] == '0')){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Dormitório'.'%';
}
if (($campo['banheiro'] == '0')){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Banheiro'.'%';
}
/*if($campo['tipo'] != 'Terreno') {
if (($campo['dormitorio'] == '0')){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Dormitório'.'%';
}
if (($campo['banheiro'] == '0')){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Banheiro'.'%';
}
}*/
}
if($campo['tipo'] == 'Comercial'){
if(($campo['subtipoimovel'] == 'Galpão') || ($campo['subtipoimovel'] == 'Déposito') || ($campo['subtipoimovel'] == 'Armazém')){
if($campo['areatotal'] == ''){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Área Total'.'%';
}
}else{
if($campo['areautil'] == ''){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Área Útil'.'%';
}
if (($campo['banheiro'] == '0')){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Banheiro'.'%';
}
}
}
if($campo['tipo'] == 'Rural'){
if (($campo['dormitorio'] == '0')){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Dormitório'.'%';
}
if (($campo['banheiro'] == '0')){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Banheiro'.'%';
}
if(($campo['subtipoimovel'] == 'Fazenda') || ($campo['subtipoimovel'] == 'Sítio') || ($campo['subtipoimovel'] == 'Chácara') || ($campo['subtipoimovel'] == 'Chácara em condomínio')){
if($campo['areatotal'] == ''){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Área Total'.'%';
}
}else{
if($campo['areautil'] == ''){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Área Útil'.'%';
}
}
}
if($campo['tipo'] == 'Terreno'){
if($campo['areatotal'] == ''){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Área Total'.'%';
}
}
if($campo['status'] != '0'){
$imovelvalido = 'nao';
$imovel_invalido_desapega .= 'Status do Imóvel: Arquivado'.'%';
}
if ($imovelvalido == 'sim') {
$validar = '0';
/////////////////////////////////////////////////////////////////////////// VIVA REAL - INICIO
//Bloco 01
if ($campo['dormitorio'] > 5) {
} else {
if (($campo['dormitorio'] == null) || ($campo['dormitorio'] == 0)) {
$campo['dormitorio'] = 0;
}
}
if ($campo['banheiro'] > 5) {
} else {
if (($campo['banheiro'] == null) || ($campo['banheiro'] == 0)) {
$campo['banheiro'] = 0;
}
}
if ($campo['suite'] > 5) {
} else {
if (($campo['suite'] == null) || ($campo['suite'] == 0)) {
$campo['suite'] = 0;
}
}
if ($campo['garagem'] > 5) {
} else {
if (($campo['garagem'] == null) || ($campo['garagem'] == 0)) {
$campo['garagem'] = 0;
}
}
if ($campo['cozinha'] > 0) {
$campo['cozinha'] = 'Sim';
} else {
$campo['cozinha'] = 'Não';
}
if ($campo['garagem'] == null) {
$campo['garagem'] = '0';
}
if ($campo['dormitorio'] == null) {
$campo['dormitorio'] = '0';
}
if ($campo['banheiro'] == null) {
$campo['banheiro'] = '0';
}
if ($campo['suite'] == null) {
$campo['suite'] = '0';
}
if ($campo['areautil'] == null) {
$campo['areautil'] = '0';
}
if ($campo['areatotal'] == null) {
$campo['areatotal'] = '0';
}
//FIM Bloco 01
//Bloco 02
if ($campo['negocio'] == 'Locação') {
$campo['negocio'] = 'Aluguel';
}
$imovel = $dom->createElement("Listing");
$Listings->appendChild($imovel);
$CodigoImovel = $dom->createElement("ListingID");
$imovel->appendChild($CodigoImovel);
$codigoValue = $dom->createTextNode($campo['cod_referencia']);
$CodigoImovel->appendChild($codigoValue);
//FIM Bloco 02
//Bloco 03
if (($campo['tipo'] == 'Rural') || ($campo['tipo'] == 'Comercial')) {
$tiponegocio = $campo['subtipoimovel'];
} else {
$tiponegocio = $campo['tipo'];
}
//FIM Bloco 03
//Bloco 04
$Title = $dom->createElement("Title");
//Apartamento com 2 Quartos e 2 banheiros para Alugar, 63 m² por R$ 2.600/Mês
//$TitleValue = $dom->createTextNode($tiponegocio . ' para ' . $campo['negocio'] . ' com ' . $campo['dormitorio'] . ' quartos em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
$imovel->appendChild($Title);
if ($campo['tipo'] == 'Apartamento' and $campo['negocio'] == 'Venda') {
$TitleValue = $dom->createCDATASection($tiponegocio . ' (' . $campo['subtipoimovel'] . '),' . ' com ' . $campo['dormitorio'] . ' quartos e ' . $campo['banheiro'] . ' banheiros à ' . $campo['negocio'] . ', ' . $campo['areautil'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif ($campo['tipo'] == 'Apartamento' and $campo['negocio'] == 'Aluguel') {
$TitleValue = $dom->createCDATASection($tiponegocio . ' (' . $campo['subtipoimovel'] . '),' . ' com ' . $campo['dormitorio'] . ' quartos e ' . $campo['banheiro'] . ' banheiros para ' . $campo['negocio'] . ', ' . $campo['areautil'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif ($campo['tipo'] == 'Casa' and $campo['negocio'] == 'Venda') {
$TitleValue = $dom->createCDATASection($tiponegocio . ' (' . $campo['subtipoimovel'] . '),' . ' com ' . $campo['dormitorio'] . ' quartos e ' . $campo['banheiro'] . ' banheiros à ' . $campo['negocio'] . ', ' . $campo['areautil'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif ($campo['tipo'] == 'Casa' and $campo['negocio'] == 'Aluguel') {
$TitleValue = $dom->createCDATASection($tiponegocio . ' (' . $campo['subtipoimovel'] . '),' . ' com ' . $campo['dormitorio'] . ' quartos e ' . $campo['banheiro'] . ' banheiros para ' . $campo['negocio'] . ', ' . $campo['areautil'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif ($campo['tipo'] == 'Terreno' and $campo['negocio'] == 'Venda') {
$TitleValue = $dom->createCDATASection($tiponegocio . ' (' . $campo['subtipoimovel'] . ')' . ' à ' . $campo['negocio'] . ', ' . $campo['areatotal'] . 'm² - Bairro ' . $campo['cep_bairro'] . ' em ' . $campo['cep_cidade']);
}
elseif ($campo['tipo'] == 'Terreno' and $campo['negocio'] == 'Aluguel') {
$TitleValue = $dom->createCDATASection($tiponegocio . ' (' . $campo['subtipoimovel'] . ')' . ' para ' . $campo['negocio'] . ', ' . $campo['areatotal'] . 'm² - Bairro ' . $campo['cep_bairro'] . ' em ' . $campo['cep_cidade']);
}
elseif ($campo['tipo'] == 'Rural' and $campo['negocio'] == 'Venda') {
$TitleValue = $dom->createCDATASection($tiponegocio . ' com ' . $campo['dormitorio'] . ' quartos à ' . $campo['negocio'] . ', ' . $campo['areatotal'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif ($campo['tipo'] == 'Rural' and $campo['negocio'] == 'Aluguel') {
$TitleValue = $dom->createCDATASection($tiponegocio . ' com ' . $campo['dormitorio'] . ' quartos para ' . $campo['negocio'] . ', ' . $campo['areatotal'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif ($campo['tipo'] == 'Rural' or $campo['subtipoimovel'] == 'Haras' or $campo['subtipoimovel'] == 'Comercial' or $campo['subtipoimovel'] == 'Estância' or $campo['subtipoimovel'] == 'Lavoura' or $campo['subtipoimovel'] == 'Granja' and $campo['negocio'] == 'Venda') {
$TitleValue = $dom->createCDATASection($tiponegocio . ' à ' . $campo['negocio'] . ', ' . $campo['areatotal'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif ($campo['tipo'] == 'Rural' or $campo['subtipoimovel'] == 'Haras' or $campo['subtipoimovel'] == 'Comercial' or $campo['subtipoimovel'] == 'Estância' or $campo['subtipoimovel'] == 'Lavoura' or $campo['subtipoimovel'] == 'Granja' and $campo['negocio'] == 'Aluguel') {
$TitleValue = $dom->createCDATASection($tiponegocio . ' para ' . $campo['negocio'] . ', ' . $campo['areatotal'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Sala') and ($campo['negocio'] == 'Venda')) {
$TitleValue = $dom->createCDATASection($tiponegocio . ' com ' . $campo['banheiro'] . ' banheiros à ' . $campo['negocio'] . ', ' . $campo['areatotal'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Sala') and ($campo['negocio'] == 'Aluguel')) {
$TitleValue = $dom->createCDATASection($tiponegocio . ' com ' . $campo['banheiro'] . ' banheiros para ' . $campo['negocio'] . ', ' . $campo['areatotal'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Loja') and ($campo['negocio'] == 'Venda')) {
$TitleValue = $dom->createCDATASection($tiponegocio . ' com ' . $campo['banheiro'] . ' banheiros à ' . $campo['negocio'] . ', ' . $campo['areatotal'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Loja') and ($campo['negocio'] == 'Aluguel')) {
$TitleValue = $dom->createCDATASection($tiponegocio . ' com ' . $campo['banheiro'] . ' banheiros para ' . $campo['negocio'] . ', ' . $campo['areatotal'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Prédio Inteiro') and ($campo['negocio'] == 'Venda')) {
$TitleValue = $dom->createCDATASection($tiponegocio . ' com ' . $campo['banheiro'] . ' banheiros à ' . $campo['negocio'] . ', ' . $campo['areatotal'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Prédio Inteiro') and ($campo['negocio'] == 'Aluguel')) {
$TitleValue = $dom->createCDATASection($tiponegocio . ' com ' . $campo['banheiro'] . ' banheiros para ' . $campo['negocio'] . ', ' . $campo['areatotal'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif ($campo['tipo'] == 'Comercial' || $campo['subtipoimovel'] == 'Galpão' || $campo['subtipoimovel'] == 'Depósito' || $campo['subtipoimovel'] == 'Armazém' and $campo['negocio'] == 'Venda') {
$TitleValue = $dom->createCDATASection($tiponegocio . ' à ' . $campo['negocio'] . ', ' . $campo['areatotal'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
elseif ($campo['tipo'] == 'Comercial' || $campo['subtipoimovel'] == 'Galpão' || $campo['subtipoimovel'] == 'Depósito' || $campo['subtipoimovel'] == 'Armazém' and $campo['negocio'] == 'Aluguel') {
$TitleValue = $dom->createCDATASection($tiponegocio . ' para ' . $campo['negocio'] . ', ' . $campo['areatotal'] . ' m² em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
else {
$TitleValue = $dom->createCDATASection($tiponegocio . ' para ' . $campo['negocio'] . ' em ' . $campo['cep_cidade'] . '/' . $campo['cep_estado']);
}
$Title->appendChild($TitleValue);
$tiponegocio = 'For Sale';
if ($campo['negocio'] == 'Lançamento') {
$tiponegocio = 'For Sale';
}
if ($campo['negocio'] == 'Temporada') {
$tiponegocio = 'For Rent';
}
if ($campo['negocio'] == 'Aluguel') {
$tiponegocio = 'For Rent';
}
//FIM Bloco 04
//Bloco 05 (Feature deve pegar a codição de true para destaque e false para nao destaque / e o campo update a data da atualizacao do imovel)
$Category = $dom->createElement("TransactionType");
$imovel->appendChild($Category);
$CategoryValue = $dom->createTextNode($tiponegocio);
$Category->appendChild($CategoryValue);
$portal_info = $this->acaoglobal(array('integracoes', 'id'), 'get', 7);
$portal_info_imoveis = $portal_info['imoveis'];
$portal_info_imoveis_tipo = $portal_info['imoveis_tipo'];
$list_info_imoveis = explode('-', $portal_info_imoveis);
$list_info_imoveis_tipo = explode('-', $portal_info_imoveis_tipo);
$cont_info_imovel = 0;
foreach ($list_info_imoveis as $info_imovel) {
if (($list_info_imoveis[$cont_info_imovel] == $campo['id_imovel'])) {
if($list_info_imoveis_tipo[$cont_info_imovel] == 'Normal'){
$info = 'STANDARD';
}
else if($list_info_imoveis_tipo[$cont_info_imovel] == 'Destaque'){
$info = 'PREMIUM';
}else{
$info = 'SUPER_PREMIUM';
}
//if($list_info_imoveis_tipo[$cont_info_imovel] == 'Simples'){
// $info = 'STANDARD';
//}if($list_info_imoveis_tipo[$cont_info_imovel] == 'Básico'){
// $info = 'STANDARD';
//}if($list_info_imoveis_tipo[$cont_info_imovel] == 'Normal'){
// $info = 'STANDARD';
//}if($list_info_imoveis_tipo[$cont_info_imovel] == 'Destaque'){
// $info = 'PREMIUM1';
//}if($list_info_imoveis_tipo[$cont_info_imovel] == 'Super Destaque'){
// $info = 'SUPER_PREMIUM';
//}
}
if ($info_imovel != '') {
$cont_info_imovel++;
}
}
$Category = $dom->createElement("PublicationType");
$imovel->appendChild($Category);
$CategoryValue = $dom->createTextNode($info);
$Category->appendChild($CategoryValue);
$Category = $dom->createElement("LastUpdateDate");
$imovel->appendChild($Category);
$CategoryValue = $dom->createTextNode($campo['updateimob']);
$Category->appendChild($CategoryValue);
//FIM Bloco 05
//Bloco 06 (Precisa passar o caminho completo do vídeo no Youtube fiz uma gambiarra mas é preciso corrigir)
$fotoss = unserialize($campo['fotos']);
$pictures = $dom->createElement("Media");
$imovel->appendChild($pictures);
if ($campo['video'] != '') {
$video = $dom->createElement("Item");
$pictures->appendChild($video);
$attrimagem = $dom->createAttribute("medium");
$video->appendChild($attrimagem);
$attrimagemValue = $dom->createTextNode("video");
$attrimagem->appendChild($attrimagemValue);
$videoValue = $dom->createTextNode($campo['video']);
$video->appendChild($videoValue);
}
//FIM Bloco 06
//Bloco 07 (Verificar o caminha das imagens com https com os portais)
//if ($fotoss[0] != '') {
if (isset($fotoss)) {
$contfotos = 0;
foreach ($fotoss as $imagem) {
if ($contfotos < 35) {
$imageURL = $dom->createElement("Item");
$pictures->appendChild($imageURL);
$attrimagem = $dom->createAttribute("medium");
$imageURL->appendChild($attrimagem);
$attrimagemValue = $dom->createTextNode("image");
$attrimagem->appendChild($attrimagemValue);
$attrimagem = $dom->createAttribute("caption");
$imageURL->appendChild($attrimagem);
$attrimagemValue = $dom->createTextNode($imagem);
$attrimagem->appendChild($attrimagemValue);
if ($campo['icone'] == $imagem) {
$attrimagem = $dom->createAttribute("primary");
$imageURL->appendChild($attrimagem);
$attrimagemValue = $dom->createTextNode("true");
$attrimagem->appendChild($attrimagemValue);
}
$imageURLValue = $dom->createTextNode(HOME_URI . 'subdominios/' . $_SESSION['userdata']['contratante'] . '/fotos/' . $campo['id_imovel'] . '/' . $imagem);
$imageURL->appendChild($imageURLValue);
$contfotos++;
}
}
} else {
$imageURL = $dom->createElement("Item");
$pictures->appendChild($imageURL);
$attrimagem = $dom->createAttribute("medium");
$imageURL->appendChild($attrimagem);
$attrimagemValue = $dom->createTextNode("image");
$attrimagem->appendChild($attrimagemValue);
$imageURLValue = $dom->createTextNode(HOME_URI . 'views/_images/semfoto_800x600.jpg');
$imageURL->appendChild($imageURLValue);
}
//FIM Bloco 07
$VirtualTourLink = $dom->createElement("VirtualTourLink");
$imovel->appendChild($VirtualTourLink);
$PropertyVirtual = $dom->createTextNode($campo['tour_virtual']);
$VirtualTourLink->appendChild($PropertyVirtual);
//Bloco 08
$Details = $dom->createElement("Details");
$imovel->appendChild($Details);
$tipoimovel = 'Residential / Home';
if ($campo['tipo'] == 'Apartamento') {
$tipoimovel = 'Residential / Apartment';
}
if ($campo['tipo'] == 'Casa') {
$tipoimovel = 'Residential / Home';
}
if ($campo['subtipoimovel'] == 'Chácara') {
$tipoimovel = 'Residential / Farm Ranch';
}
if ($campo['subtipoimovel'] == 'Chácara em condomínio') {
$tipoimovel = 'Residential / Farm Ranch';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Em condomínio')) {
$tipoimovel = 'Residential / Condo';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Sobrado Padrão') || ($campo['subtipoimovel'] == 'Sobrado em condomínio') || ($campo['subtipoimovel'] == 'Sobrado em vila fechada') || ($campo['subtipoimovel'] == 'Sobrado Duplex') || ($campo['subtipoimovel'] == 'Sobrado Triplex')) {
$tipoimovel = 'Residential / Sobrado';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Flat')) {
$tipoimovel = 'Residential / Flat';
}
if ($campo['tipo'] == 'Terreno') {
$tipoimovel = 'Residential / Land Lot';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Cobertura')) {
$tipoimovel = 'Residential / Penthouse';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Kitnete')) {
$tipoimovel = 'Residential / Kitnet';
}
$tipoo = 'Residential';
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Consultório')) {
$tipoimovel = 'Commercial / Consultorio';
$tipoo = 'Commercial';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Sala')) {
$tipoimovel = 'Commercial / Office';
$tipoo = 'Commercial';
}
if (($campo['subtipoimovel'] == 'Fazenda') || ($campo['subtipoimovel'] == 'Sítio') || ($campo['subtipoimovel'] == 'Haras') || ($campo['subtipoimovel'] == 'Comercial') || ($campo['subtipoimovel'] == 'Estância') || ($campo['subtipoimovel'] == 'Lavoura') || ($campo['subtipoimovel'] == 'Granja')) {
$tipoimovel = 'Commercial / Agricultural';
$tipoo = 'Commercial';
}
if (($campo['subtipoimovel'] == 'Galpão') || ($campo['subtipoimovel'] == 'Depósito') || ($campo['subtipoimovel'] == 'Armazém')) {
$tipoimovel = 'Commercial / Industrial';
$tipoo = 'Commercial';
}
if ($campo['tipo'] == 'Comercial'){
if(($campo['subtipoimovel'] == 'Sobrado') || ($campo['subtipoimovel'] == 'Casa')) {
$tipoimovel = 'Commercial / Building';
$tipoo = 'Commercial';
}
}
if ($campo['tipo'] == 'Comercial'){
if(($campo['subtipoimovel'] == 'Indústria') || ($campo['subtipoimovel'] == 'Hotel') || ($campo['subtipoimovel'] == 'Motel') || ($campo['subtipoimovel'] == 'Pousada')) {
$tipoimovel = 'Commercial / Building';
$tipoo = 'Commercial';
}
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Negócio')) {
$tipoimovel = 'Commercial / Building';
$tipoo = 'Commercial';
}
if ($campo['tipo'] == 'Comercial'){
if(($campo['subtipoimovel'] == 'Loja') || ($campo['subtipoimovel'] == 'Loja de shopping')) {
$tipoimovel = 'Commercial / Business';
$tipoo = 'Commercial';
}
}
if ($campo['tipo'] == 'Terreno'){
if(($campo['subtipoimovel'] == 'Comercial') || ($campo['subtipoimovel'] == 'Área industrial') || ($campo['subtipoimovel'] == 'Para empreendimento')) {
$tipoimovel = 'Commercial / Land Lot';
$tipoo = 'Commercial';
}
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Prédio Inteiro')) {
$tipoimovel = 'Commercial / Edificio Comercial';
$tipoo = 'Commercial';
}
$UsageTypeType = $dom->createElement("UsageType");
$Details->appendChild($UsageTypeType);
$UsageTypeTypeValue = $dom->createTextNode($tipoo);
$UsageTypeType->appendChild($UsageTypeTypeValue);
if ($campo['anoconstrucao'] != '0') {
$AnoConstrucao = $dom->createElement("YearBuilt");
$Details->appendChild($AnoConstrucao);
$AnoConstrucaoValue = $dom->createTextNode($campo['anoconstrucao']);
$AnoConstrucao->appendChild($AnoConstrucaoValue);
}
$PropertyType = $dom->createElement("PropertyType");
$Details->appendChild($PropertyType);
$PropertyTypeValue = $dom->createTextNode($tipoimovel);
$PropertyType->appendChild($PropertyTypeValue);
$PropertyType = $dom->createElement("Description");
$Details->appendChild($PropertyType);
$descricaofinal = $campo['descricaodoimovel_desapega'];
$PropertyTypeValue = $dom->createTextNode($descricaofinal);
$PropertyType->appendChild($PropertyTypeValue);
//FIM Bloco 08
//Bloco 09 (PROBLEMA)
//FIM Bloco 09
//Bloco 10
/* $Category = $dom->createElement("Description");
$Details->appendChild($Category);
if ($campo['descricaodoimovel'] == '') {
$descricaofinal = $campo['descricaodoimovel'] . ' - O imóvel possui: ' . $adddetalhes . ' - O imóvel é próximo de: ' . $addproximidades;
$CategoryValue = $dom->createCDATASection($descricaofinal);
} else {
$campo['descricaodoimovel'] = str_replace('<br>','<br>', $campo['descricaodoimovel']);
$campo['descricaodoimovel'] = str_replace('<b>','<b>', $campo['descricaodoimovel']);
$campo['descricaodoimovel'] = str_replace('</b>','</b>', $campo['descricaodoimovel']);
$campo['descricaodoimovel'] = str_replace('<i>','<i>', $campo['descricaodoimovel']);
$campo['descricaodoimovel'] = str_replace('</i>','</i>', $campo['descricaodoimovel']);
$campo['descricaodoimovel'] = str_replace('<u>','', $campo['descricaodoimovel']);
$campo['descricaodoimovel_desapega'] = str_replace('</u>','', $campo['descricaodoimovel']);
$CategoryValue = $dom->createCDATASection($campo['descricaodoimovel']);
// }
$Category->appendChild($CategoryValue);
*/
//FIM Bloco 10
//Bloco 11
if ($tiponegocio == 'For Sale') {
$PropertyType = $dom->createElement("ListPrice");
$Details->appendChild($PropertyType);
$attrimagem = $dom->createAttribute("currency");
$PropertyType->appendChild($attrimagem);
$attrimagemValue = $dom->createTextNode('BRL');
$attrimagem->appendChild($attrimagemValue);
$PropertyTypeValue = $dom->createTextNode((int) $campo['valor']);
$PropertyType->appendChild($PropertyTypeValue);
} else {
$PropertyType = $dom->createElement("RentalPrice");
$Details->appendChild($PropertyType);
$attrimagem = $dom->createAttribute("currency");
$PropertyType->appendChild($attrimagem);
$attrimagemValue = $dom->createTextNode('BRL');
$attrimagem->appendChild($attrimagemValue);
$attrimagem = $dom->createAttribute("period");
$PropertyType->appendChild($attrimagem);
if($campo['negocio'] == 'Temporada'){
if($campo['ciclo'] == 'Diária'){
$ciclo = 'Daily';
}elseif($campo['ciclo'] == 'Semanal') {
$ciclo = 'Weekly';
}elseif($campo['ciclo'] == 'Mensal') {
$ciclo = 'Monthly';
}elseif($campo['ciclo'] == 'Trimestral') {
$ciclo = 'Quarterly';
}
}else{
$ciclo = 'Monthly';
}
$attrimagemValue = $dom->createTextNode($ciclo);
$attrimagem->appendChild($attrimagemValue);
$PropertyTypeValue = $dom->createTextNode((int) $campo['valor']);
$PropertyType->appendChild($PropertyTypeValue);
}
if($campo['valor_condominio'] != "") {
$PropertyAdministrationFee = $dom->createElement("PropertyAdministrationFee");
$Details->appendChild($PropertyAdministrationFee);
$attrimagem = $dom->createAttribute("currency");
$PropertyAdministrationFee->appendChild($attrimagem);
$attrimagemValue = $dom->createTextNode('BRL');
$attrimagem->appendChild($attrimagemValue);
$PropertyAdministrationFeeValue = $dom->createTextNode($campo['valor_condominio']);
$PropertyAdministrationFee->appendChild($PropertyAdministrationFeeValue);
}
if ($campo['valor_iptu'] != "") {
$YearlyTax = $dom->createElement("YearlyTax");
$Details->appendChild($YearlyTax);
$attrimagem = $dom->createAttribute("currency");
$YearlyTax->appendChild($attrimagem);
$attrimagemValue = $dom->createTextNode('BRL');
$attrimagem->appendChild($attrimagemValue);
$YearlyTaxValue = $dom->createTextNode($campo['valor_iptu']);
$YearlyTax->appendChild($YearlyTaxValue);
}
//FIM Bloco 11
//Bloco 12
$LotArea = $dom->createElement("LotArea");
$Details->appendChild($LotArea);
$attrimagem = $dom->createAttribute("unit");
$LotArea->appendChild($attrimagem);
$attrimagemValue = $dom->createTextNode('square metres');
$attrimagem->appendChild($attrimagemValue);
$LotAreaValue = $dom->createTextNode((int) $campo['areatotal']);
$LotArea->appendChild($LotAreaValue);
$LivingArea = $dom->createElement("LivingArea");
$Details->appendChild($LivingArea);
$attrimagem = $dom->createAttribute("unit");
$LivingArea->appendChild($attrimagem);
$attrimagemValue = $dom->createTextNode('square metres');
$attrimagem->appendChild($attrimagemValue);
$LivingAreaValue = $dom->createTextNode((int) $campo['areautil']);
$LivingArea->appendChild($LivingAreaValue);
//FIM Bloco 12
//Bloco 13
$Exclusividade = $dom->createElement("Exclusive");
$Details->appendChild($Exclusividade);
$ExclusividadeValue = $dom->createTextNode($campo['exclusiva']);
$Exclusividade->appendChild($ExclusividadeValue);
$Bedrooms = $dom->createElement("Bedrooms");
$Details->appendChild($Bedrooms);
$BedroomsValue = $dom->createTextNode($campo['dormitorio']);
$Bedrooms->appendChild($BedroomsValue);
$Bathrooms = $dom->createElement("Bathrooms");
$Details->appendChild($Bathrooms);
$BathroomsValue = $dom->createTextNode($campo['banheiro']);
$Bathrooms->appendChild($BathroomsValue);
if ($campo['suite'] != '0') {
$Suites = $dom->createElement("Suites");
$Details->appendChild($Suites);
$SuitesValue = $dom->createTextNode($campo['suite']);
$Suites->appendChild($SuitesValue);
}
if ($campo['garagem'] != '0') {
$Garage = $dom->createElement("Garage");
$Details->appendChild($Garage);
$GarageValue = $dom->createTextNode($campo['garagem']);
$Garage->appendChild($GarageValue);
}
if ($campo['andar'] != '0') {
$Andar = $dom->createElement("Floors");
$Details->appendChild($Andar);
$AndarValue = $dom->createTextNode($campo['andar']);
$Andar->appendChild($AndarValue);
}
//FIM Bloco 13
//BLOCO 14
$ContactInfo = $dom->createElement("ContactInfo");
$imovel->appendChild($ContactInfo);
$Email = $dom->createElement("Email");
$ContactInfo->appendChild($Email);
$EmailValue = $dom->createTextNode($emailsistema);
$Email->appendChild($EmailValue);
$Name = $dom->createElement("Name");
$ContactInfo->appendChild($Name);
$NameValue = $dom->createTextNode($contactsistema);
$Name->appendChild($NameValue);
$Website = $dom->createElement("Website");
$ContactInfo->appendChild($Website);
$WebsiteValue = $dom->createTextNode("https://".$dominiosistema);
$Website->appendChild($WebsiteValue);
$Logo = $dom->createElement("Logo");
$ContactInfo->appendChild($Logo);
$LogoValue = $dom->createTextNode(HOME_URI . 'subdominios/' . $_SESSION['userdata']['contratante'] . '/layout/logo/'.$logo);
$Logo->appendChild($LogoValue);
$Fone = $dom->createElement("Telephone");
$ContactInfo->appendChild($Fone);
$FoneValue = $dom->createTextNode($sis_fone1);
$Fone->appendChild($FoneValue);
//FIM BLOCO 14
//BLOCO 15
$Location = $dom->createElement("Location");
$imovel->appendChild($Location);
$ooo = $dom->createAttribute("displayAddress");
$Location->appendChild($ooo);
if ($campo['ocultarend'] == 2) {
$o3 = $dom->createTextNode("Neighborhood");
} else {
$o3 = $dom->createTextNode("All");
}
$ooo->appendChild($o3);
$Country = $dom->createElement("Country");
$Location->appendChild($Country);
$SiglaPais = $dom->createAttribute("abbreviation");
$Country->appendChild($SiglaPais);
$SiglaPaisVal = $dom->createTextNode("BR");
$SiglaPais->appendChild($SiglaPaisVal);
$CountryValue = $dom->createTextNode($campo['cep_pais']);
$Country->appendChild($CountryValue);
$State = $dom->createElement("State");
$Location->appendChild($State);
$SiglaEstado = $dom->createAttribute("abbreviation");
$State->appendChild($SiglaEstado);
$SiglaEstadoVal = $dom->createTextNode($campo['cep_estado']);
$SiglaEstado->appendChild($SiglaEstadoVal);
$estadonome = $campo['cep_estado'];
if ($campo['cep_estado'] == 'AC') {
$estadonome = 'Acre';
}
if ($campo['cep_estado'] == 'AL') {
$estadonome = 'Alagoas';
}
if ($campo['cep_estado'] == 'AP') {
$estadonome = 'Amapá';
}
if ($campo['cep_estado'] == 'AM') {
$estadonome = 'Amazonas';
}
if ($campo['cep_estado'] == 'BA') {
$estadonome = 'Bahia';
}
if ($campo['cep_estado'] == 'CE') {
$estadonome = 'Ceará';
}
if ($campo['cep_estado'] == 'DF') {
$estadonome = 'Distrito Federal';
}
if ($campo['cep_estado'] == 'ES') {
$estadonome = 'Espírito Santo';
}
if ($campo['cep_estado'] == 'GO') {
$estadonome = 'Goiás';
}
if ($campo['cep_estado'] == 'MA') {
$estadonome = 'Maranhão';
}
if ($campo['cep_estado'] == 'MT') {
$estadonome = 'Mato Grosso';
}
if ($campo['cep_estado'] == 'MS') {
$estadonome = 'Mato Grosso do Sul';
}
if ($campo['cep_estado'] == 'MG') {
$estadonome = 'Minas Gerais';
}
if ($campo['cep_estado'] == 'PA') {
$estadonome = 'Pará';
}
if ($campo['cep_estado'] == 'PB') {
$estadonome = 'Paraíba';
}
if ($campo['cep_estado'] == 'PR') {
$estadonome = 'Paraná';
}
if ($campo['cep_estado'] == 'PE') {
$estadonome = 'Pernambuco';
}
if ($campo['cep_estado'] == 'PI') {
$estadonome = 'Piauí';
}
if ($campo['cep_estado'] == 'RJ') {
$estadonome = 'Rio de Janeiro';
}
if ($campo['cep_estado'] == 'RN') {
$estadonome = 'Rio Grande do Norte';
}
if ($campo['cep_estado'] == 'RS') {
$estadonome = 'Rio Grande do Sul';
}
if ($campo['cep_estado'] == 'RO') {
$estadonome = 'Rondônia';
}
if ($campo['cep_estado'] == 'RR') {
$estadonome = 'Roraima';
}
if ($campo['cep_estado'] == 'SC') {
$estadonome = 'Santa Catarina';
}
if ($campo['cep_estado'] == 'SP') {
$estadonome = 'São Paulo';
}
if ($campo['cep_estado'] == 'SE') {
$estadonome = 'Sergipe';
}
if ($campo['cep_estado'] == 'TO') {
$estadonome = 'Tocantins';
}
$StateValue = $dom->createCDATASection($estadonome);
$State->appendChild($StateValue);
$City = $dom->createElement("City");
$Location->appendChild($City);
$CityValue = $dom->createCDATASection($campo['cep_cidade']);
$City->appendChild($CityValue);
$Neighborhood = $dom->createElement("Neighborhood");
$Location->appendChild($Neighborhood);
$NeighborhoodValue = $dom->createTextNode($campo['cep_bairro']);
$Neighborhood->appendChild($NeighborhoodValue);
if ($campo['cep_logradouro'] != '') {
$Neighborhood = $dom->createElement("Address");
$Location->appendChild($Neighborhood);
$NeighborhoodValue = $dom->createTextNode($campo['cep_logradouro']);
$Neighborhood->appendChild($NeighborhoodValue);
}
if ($campo['cep_numero'] != "") {
$Neighborhood = $dom->createElement("StreetNumber");
$Location->appendChild($Neighborhood);
$NeighborhoodValue = $dom->createTextNode($campo['cep_numero']);
$Neighborhood->appendChild($NeighborhoodValue);
}
if ($campo['cep_complemento'] != "") {
$Neighborhood = $dom->createElement("Complement");
$Location->appendChild($Neighborhood);
$NeighborhoodValue = $dom->createTextNode($campo['cep_complemento']);
$Neighborhood->appendChild($NeighborhoodValue);
}
if ($campo['cep'] != "") {
if(strpos($campo['cep'],"-")){
$cep = $campo['cep'];
}else{
$cep1 = substr_replace( $campo['cep'], '-', 5, 5 );
$cep2 = substr( $campo['cep'], -3 );
$cep = $cep1 . $cep2;
}
$PostalCode = $dom->createElement("PostalCode");
$Location->appendChild($PostalCode);
$PostalCodeValue = $dom->createTextNode($cep);
$PostalCode->appendChild($PostalCodeValue);
}
$Latitude = $dom->createElement("Latitude");
$Location->appendChild($Latitude);
$latitudeCodeValue = $dom->createTextNode($campo['latitude']);
$Latitude->appendChild($latitudeCodeValue);
$Longitude = $dom->createElement("Longitude");
$Location->appendChild($Longitude);
$LongitudeCodeValue = $dom->createTextNode($campo['longitude']);
$Longitude->appendChild($LongitudeCodeValue);
//FIM BLOCO 15
//BLOCO 16 (Estudar essa parte)
//if(($campo['andar']!=null)||($campo['valor_condominio']!=null)||($campo['valor_iptu']!=null)||($campo['dormitorio']!=null)||($campo['suite']!=null)||($campo['garagem']!=null)||($campo['areautil']!=null)||($campo['areatotal']!=null)){
//FIM BLOCO 16
//BLOCO 17
// $attribute = $dom->createElement("Feature");
// $imovel->appendChild($attribute);
$detalhess = $dom->createElement("Features");
$Details->appendChild($detalhess);
$caracteristicas = unserialize($campo['caracteristicas']);
if ($caracteristicas[0] != null) {
foreach ($caracteristicas as $detalhe) {
//$buscaDetalhe = $this->acaoglobal(array('detalhes', 'id'), 'get', $detalhee);
//$detalhe = $buscaDetalhe['nome'];
if ($detalhe == '474'){
$detalhe = 'Coffee Shop';
}if($detalhe == '473'){
$detalhe = 'Closet';
}if($detalhe == '472'){
$detalhe = 'Cinema';
}if($detalhe == '471'){
$detalhe = 'Churrasqueira';
}if($detalhe == '470'){
$detalhe = 'Children Care';
}if($detalhe == '469'){
$detalhe = 'Cerca';
}if($detalhe == '468'){
$detalhe = 'Centro de estética';
}if($detalhe == '467'){
$detalhe = 'Central telefônica';
}if($detalhe == '466'){
$detalhe = 'Caseiro';
}if($detalhe == '465'){
$detalhe = 'Casa de Fundo';
}if($detalhe == '464'){
$detalhe = 'Casa de Caseiro';
}if($detalhe == '463'){
$detalhe = 'Casa de Boneca';
}if($detalhe == '462'){
$detalhe = 'Carpete';
}if($detalhe == '461'){
$detalhe = 'Car Wash';
}if($detalhe == '460'){
$detalhe = 'Campo de Golfe';
}if($detalhe == '459'){
$detalhe = 'Campo de futebol';
}if($detalhe == '458'){
$detalhe = 'Cameras de segurança';
}if($detalhe == '457'){
$detalhe = 'Canil';
}if($detalhe == '456'){
$detalhe = 'Business Center';
}if($detalhe == '455'){
$detalhe = 'Bosque';
}if($detalhe == '454'){
$detalhe = 'Brinquedoteca';
}if($detalhe == '453'){
$detalhe = 'Bicicletário';
}if($detalhe == '452'){
$detalhe = 'Bar';
}if($detalhe == '451'){
$detalhe = 'Armário Embutido';
}if($detalhe == '450'){
$detalhe = 'Armário Cozinha';
}if($detalhe == '449'){
$detalhe = 'Área de serviço';
}if($detalhe == '448'){
$detalhe = 'Ar Condicionado';
}if($detalhe == '447'){
$detalhe = 'Água';
}if($detalhe == '446'){
$detalhe = 'Aquecimento Central';
}if($detalhe == '445'){
$detalhe = 'Aquecedor';
}if($detalhe == '444'){
$detalhe = 'Acesso para deficientes';
}if($detalhe == '443'){
$detalhe = 'Acesso 24 Horas';
}if($detalhe == '442'){
$detalhe = 'Academia';
}if($detalhe == '484'){
$detalhe = 'Entrada de Caminhões';
}if($detalhe == '483'){
$detalhe = 'Elevador';
}if($detalhe == '482'){
$detalhe = 'Edícula';
}if($detalhe == '481'){
$detalhe = 'Despensa';
}if($detalhe == '480'){
$detalhe = 'Dependência de empregados';
}if($detalhe == '479'){
$detalhe = 'Curral';
}if($detalhe == '478'){
$detalhe = 'Cozinha Gourmet';
}if($detalhe == '477'){
$detalhe = 'Cozinha americana';
}if($detalhe == '476'){
$detalhe = 'Copa';
}if($detalhe == '475'){
$detalhe = 'Convenções';
}if($detalhe == '485'){
$detalhe = 'Entrada lateral';
}if($detalhe == '486'){
$detalhe = 'Escritório';
}if($detalhe == '487'){
$detalhe = 'Escritório Virtual';
}if($detalhe == '488'){
$detalhe = 'Esgoto';
}if($detalhe == '489'){
$detalhe = 'Espaço Gourmet';
}if($detalhe == '490'){
$detalhe = 'Espaço zen';
}if($detalhe == '491'){
$detalhe = 'Esquina';
}if($detalhe == '492'){
$detalhe = 'Estacionamento para visitantes';
}if($detalhe == '493'){
$detalhe = 'Estacionamento Rotativo';
}if($detalhe == '494'){
$detalhe = 'Estacionamento Visitantes';
}if($detalhe== '495'){
$detalhe = 'Estrada Asfaltada';
}if($detalhe == '496'){
$detalhe = 'Fitness';
}if($detalhe == '497'){
$detalhe = 'Forno de pizza';
}if($detalhe == '498'){
$detalhe = 'Frente para o Mar';
}if($detalhe == '499'){
$detalhe = 'Fogão elétrico';
}if($detalhe == '500'){
$detalhe = 'Galpão';
}if($detalhe == '501'){
$detalhe = 'Garagem para Barcos';
}if($detalhe == '502'){
$detalhe = 'Gerador';
}if($detalhe == '503'){
$detalhe = 'Geminada';
}if($detalhe == '504'){
$detalhe = 'Guarita';
}if($detalhe == '505'){
$detalhe = 'Heliponto';
}if($detalhe == '506'){
$detalhe = 'Hidromassagem';
}if($detalhe == '507'){
$detalhe = 'Infra-estrutura Internet';
}if($detalhe == '508'){
$detalhe = 'Interfone';
}if($detalhe == '509'){
$detalhe = 'Jardim';
}if($detalhe == '510'){
$detalhe = 'Lago';
}if($detalhe == '511'){
$detalhe = 'Lan House';
}if($detalhe == '512'){
$detalhe = 'Lareira';
}if($detalhe == '513'){
$detalhe = 'Lavabo';
}if($detalhe == '514'){
$detalhe = 'Lavanderia';
}if($detalhe == '515'){
$detalhe = 'Lavoura';
}if($detalhe == '516'){
$detalhe = 'Luminárias';
}if($detalhe == '517'){
$detalhe = 'Luz';
}if($detalhe == '518'){
$detalhe = 'Marina';
}if($detalhe == '519'){
$detalhe = 'Mezanino';
}if($detalhe == '520'){
$detalhe = 'Mobiliado';
}if($detalhe == '521'){
$detalhe = 'Paiol';
}if($detalhe == '522'){
$detalhe = 'Pasto';
}if($detalhe == '523'){
$detalhe = 'Pátio Estacionamento';
}if($detalhe == '524'){
$detalhe = 'Permite Animais';
}if($detalhe == '525'){
$detalhe = 'Pet Care';
}if($detalhe == '526'){
$detalhe = 'Píer';
}if($detalhe == '527'){
$detalhe = 'Piscina';
}if($detalhe == '528'){
$detalhe = 'Piscina aquecida';
}if($detalhe == '529'){
$detalhe = 'Pscina Climatizada';
}if($detalhe == '530'){
$detalhe = 'Piscina Coberta';
}if($detalhe == '531'){
$detalhe = 'Piscina Infantil';
}if($detalhe == '532'){
$detalhe = 'Piso Elevado';
}if($detalhe == '533'){
$detalhe = 'Pista de cooper';
}if($detalhe == '534'){
$detalhe = 'Pista de Pouso';
}if($detalhe == '535'){
$detalhe = 'Pista de Skate';
}if($detalhe == '536'){
$detalhe = 'Playground';
}if($detalhe == '537'){
$detalhe = 'Poço Artesiano';
}if($detalhe == '538'){
$detalhe = 'Pomar';
}if($detalhe == '539'){
$detalhe = 'Ponte Rolante';
}if($detalhe == '540'){
$detalhe = 'Portão Eletrônico';
}if($detalhe == '541'){
$detalhe = 'Portaria 24 horas';
}if($detalhe == '542'){
$detalhe = 'Porteira Fechada';
}if($detalhe == '543'){
$detalhe = 'Quadra de futebol de salão';
}if($detalhe == '544'){
$detalhe = 'Quadra Poliesportiva';
}if($detalhe == '545'){
$detalhe = 'Quadra de Squash';
}if($detalhe == '546'){
$detalhe = 'Quadra de Tênis';
}if($detalhe == '547'){
$detalhe = 'Quarto da Empregada';
}if($detalhe == '548'){
$detalhe = 'Quintal';
}if($detalhe == '549'){
$detalhe = 'Redario';
}if($detalhe == '550'){
$detalhe = 'Rede de Telefone';
}if($detalhe == '551'){
$detalhe = 'Refeitório';
}if($detalhe == '552'){
$detalhe = 'Reservatório de Água';
}if($detalhe == '553'){
$detalhe = 'Restaurante';
}if($detalhe == '554'){
$detalhe = 'Rio';
}if($detalhe == '555'){
$detalhe = 'Ronda/Vigilância';
}if($detalhe == '556'){
$detalhe = 'Rua Asfaltada';
}if($detalhe == '557'){
$detalhe = 'Sala de Almoço';
}if($detalhe == '558'){
$detalhe = 'Sala de Ginástica';
}if($detalhe == '559'){
$detalhe = 'Sala de Jantar';
}if($detalhe == '560'){
$detalhe = 'Sala íntima';
}if($detalhe == '561'){
$detalhe = 'convenções';
}if($detalhe == '562'){
$detalhe = 'Salão de Festas';
}if($detalhe == '563'){
$detalhe = 'Salão de Jogos';
}if($detalhe == '564'){
$detalhe = 'Salão de Vídeo/Cinema';
}if($detalhe == '565'){
$detalhe = 'Sauna';
}if($detalhe == '566'){
$detalhe = 'Sede';
}if($detalhe == '567'){
$detalhe = 'Segurança Interna';
}if($detalhe == '568'){
$detalhe = 'Segurançaa na Rua';
}if($detalhe == '569'){
$detalhe = 'Segurança Patrimonial';
}if($detalhe == '570'){
$detalhe = 'Semigeminada';
}if($detalhe == '571'){
$detalhe = 'Silos';
}if($detalhe == '572'){
$detalhe = 'Sistema de alarme';
}if($detalhe == '573'){
$detalhe = 'Sistema de Incêndio';
}if($detalhe == '574'){
$detalhe = 'Solariam';
}if($detalhe == '575'){
$detalhe = 'Telefone';
}if($detalhe == '576'){
$detalhe = 'Terraço';
}if($detalhe == '577'){
$detalhe = 'TV';
}if($detalhe == '578'){
$detalhe = 'TV a cabo';
}if($detalhe == '579'){
$detalhe = 'Varanda';
}if($detalhe == '580'){
$detalhe = 'Varanda Goumert';
}if($detalhe == '581'){
$detalhe = 'Ventilador de Teto';
}if($detalhe == '582'){
$detalhe = 'Vestiário';
}if($detalhe == '583'){
$detalhe = 'Vigilância 24hs';
}if($detalhe == '584'){
$detalhe = 'WC Empregada';
}if($detalhe == '586'){
$detalhe = 'Cascalho';
}if($detalhe == '585'){
$detalhe = 'Terra';
}if($detalhe == '586'){
$detalhe = 'Sacada';
}if($detalhe == '587'){
$detalhe = 'Depósito';
}if($detalhe == '588'){
$detalhe = 'Cabeamento estruturado';
}if($detalhe == '589'){
$detalhe = 'Garagem';
}if($detalhe == '590'){
$detalhe = 'Vista exterior';
}if($detalhe == '591'){
$detalhe = 'Vista exterior';
}if($detalhe == '592'){
$detalhe = 'Gramado';
}if($detalhe == '593'){
$detalhe = 'Espelhos dágua';
}if($detalhe == '594'){
$detalhe = 'Mais de um andar';
}if($detalhe == '595'){
$detalhe = 'Serviço pay per use';
}if($detalhe == '596'){
$detalhe = 'Vigia';
}if($detalhe == '597'){
$detalhe = 'Espaço verde / Parque';
}if($detalhe == '598'){
$detalhe = 'Recepção';
}if($detalhe == '599'){
$detalhe = 'Garage band';
}if($detalhe == '600'){
$detalhe = 'Massagem';
}if($detalhe == '601'){
$detalhe = 'Spa';
}if($detalhe == '602'){
$detalhe = 'Vista para a montanha';
}if($detalhe == '603'){
$detalhe = 'Vista para lago';
}if($detalhe == '604'){
$detalhe = 'Cascalho';
}
if (($detalhe == 'Churrasqueira') || ($detalhe == 'churrasqueira')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('BBQ');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Aquecedor') || ($detalhe == 'aquecimento') || ($detalhe == 'Aquecimento')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Heating');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Piscina') || ($detalhe == 'piscina') || ($detalhe == 'Piscina aquecida') || ($detalhe == 'Piscina Coberta') || ($detalhe == 'Piscina Infantil') || ($detalhe == 'Piscina Climatizada')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Pool');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Quintal') || ($detalhe == 'quintal')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Fenced Yard');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Sistema de alarme') || ($detalhe == 'Alarme')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Alarm System');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'TV a Cabo') || ($detalhe == 'Tv a cabo') || ($detalhe == 'tv a cabo') || ($detalhe == 'TV a cabo')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Cable Television');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Salão de Jogos') || ($detalhe == 'Salão de jogos') || ($detalhe == 'salão de jogos')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Game Room');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Sauna') || ($detalhe == 'sauna')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Sauna');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Segurança 24h') || ($detalhe == 'Vigilância 24hs')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Security Guard on Duty');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Spa') || ($detalhe == 'spa')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Spa');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Playground') || ($detalhe == 'playground')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Playground');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Quadra de Tênis') || ($detalhe == 'Quadra de tênis') || ($detalhe == 'quadra de tenis')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Tennis court');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Quadra Poliesportiva') || ($detalhe == 'Quadra poliesportiva') || ($detalhe == 'quadra poliesportiva')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Sports court');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Conexão à internet') || ($detalhe == 'Infra-estrutura Internet')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Internet Connection');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Jardim') || ($detalhe == 'jardim')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Garden Area');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Lareira') || ($detalhe == 'lareira')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Fireplace');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Lavanderia') || ($detalhe == 'lavanderia')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Laundry');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Elevador') || ($detalhe == 'elevador')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Elevator');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Depósito') || ($detalhe == 'depósito')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Warehouse');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Ar Condicionado') || ($detalhe == 'ar condicionado') || ($detalhe == 'Ar condicionado')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Cooling');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Area de Serviço') || ($detalhe == 'Area de serviço') || ($detalhe == 'area de serviço')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Maid\'s Quarters');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Frente para o Mar') || ($detalhe == 'Vista para o mar')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Ocean View');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Espaço gourmet') || ($detalhe == 'Espaço Gourmet')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Gourmet Area');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Escritório') || ($detalhe == 'Escritório')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Home Office');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Gerador') || ($detalhe == 'Gerador elétrico')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Generator');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Guarita') || ($detalhe == 'Condomínio fechado')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Fenced Yard');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Interfone')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Intercom');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Mobiliado')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Furnished');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Pista de cooper')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Jogging track');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Quadra de Squash')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Squash');
$detalhenome->appendChild($detalhenomeValue);
}
/*if (($detalhe == 'Cinema') || ($detalhe == 'Salão de Vídeo/Cinema')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Movie Theater');
$detalhenome->appendChild($detalhenomeValue);
}*/
if (($detalhe == 'Varanda gourmet') || ($detalhe == 'Espaço Gourmet')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Veranda');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Circuito de segurança') || ($detalhe == 'Cameras de segurança')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('TV Security');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Cascalho')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Gravel');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Terra')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Land');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Sacada')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Balcony');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Depósito')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Warehouse');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Cabeamento estruturado')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Fully wired');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Garagem')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Parking Garage');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Vista exterior')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Exterior View');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Gramado')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Lawn');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Espelhos dágua')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Reflective Pool');
$detalhenome->appendChild($detalhenomeValue);
}
/*if (($detalhe == 'Mais de um andar')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Year Built');
$detalhenome->appendChild($detalhenomeValue);
}*/
if (($detalhe == 'Serviço pay per use')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Pay-per-use Services');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Vigia')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Controlled Access');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Espaço verde / Parque')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Green space / Park');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Recepção')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Reception room');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Garage band')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Band Practice Room');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Massagem')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Massage Room');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Spa')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Spa');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Vista para a montanha ')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Mountain View');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Vista para lago')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Lake View');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Academia')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Gym');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Cozinha Gourmet') ||($detalhe == 'Cozinha americana')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Kitchen');
$detalhenome->appendChild($detalhenomeValue);
}
if (($detalhe == 'Salão de Festas')) {
$detalhenome = $dom->createElement("Feature");
$detalhess->appendChild($detalhenome);
$detalhenomeValue = $dom->createTextNode('Party Room');
$detalhenome->appendChild($detalhenomeValue);
}
}
}
//FIM BLOCO 17 (PROBLEMA)
/////////////////////////////////////////////////////////////////////////// VIVA REAL - FIM
}
}else{
if($campo['valor'] == ''){
$imovel_invalido_desapega .= 'Valor do Imóvel '.'%';
}
if($campo['cep'] == null){
$imovel_invalido_desapega .= 'CEP'.'%';
}
if($campo['cep_estado'] == null){
$imovel_invalido_desapega .= 'Estado'.'%';
}
if($campo['cep_cidade'] == null){
$imovel_invalido_desapega .= 'Cidade'.'%';
}
if($campo['cep_bairro'] == null){
$imovel_invalido_desapega .= 'Bairro'.'%';
}
if($campo['descricaodoimovel'] == null){
$imovel_invalido_desapega .= 'Descrição do Imóvel'.'%';
}
if($campo['descricaodoimovel'] == '<br>'){
$imovel_invalido_desapega .= 'Descrição do Imóvel'.'%';
}
if($campo['negocio'] == 'Temporada'){
if(($campo['ciclo'] != 'Diária') && ($campo['ciclo'] != 'Semanal') && ($campo['ciclo'] != 'Mensal') && ($campo['ciclo'] != 'Trimestral')){
$imovel_invalido_desapega .= 'Ciclo'.'%';
}
}
if(($campo['tipo'] == 'Apartamento') || ($campo['tipo'] == 'Casa')){
if($campo['areautil'] == ''){
$imovel_invalido_desapega .= 'Área Útil'.'%';
}
if (($campo['dormitorio'] == '0')){
$imovel_invalido_desapega .= 'Dormitório'.'%';
}
if (($campo['banheiro'] == '0')){
$imovel_invalido_desapega .= 'Banheiro'.'%';
}
/*if($campo['tipo'] != 'Terreno') {
if (($campo['dormitorio'] == '0')){
$imovel_invalido_desapega .= 'Dormitório'.'%';
}
if (($campo['banheiro'] == '0')){
$imovel_invalido_desapega .= 'Banheiro'.'%';
}
}*/
}
if($campo['tipo'] == 'Comercial'){
if(($campo['subtipoimovel'] == 'Galpão') || ($campo['subtipoimovel'] == 'Déposito') || ($campo['subtipoimovel'] == 'Armazém')){
if($campo['areatotal'] == ''){
$imovel_invalido_desapega .= 'Área Total'.'%';
}
}else{
if($campo['areautil'] == ''){
$imovel_invalido_desapega .= 'Área Útil'.'%';
}
if (($campo['banheiro'] == '0')){
$imovel_invalido_desapega .= 'Banheiro'.'%';
}
}
}
if($campo['tipo'] == 'Rural'){
if (($campo['dormitorio'] == '0')){
$imovel_invalido_desapega .= 'Dormitório'.'%';
}
if (($campo['banheiro'] == '0')){
$imovel_invalido_desapega .= 'Banheiro'.'%';
}
if(($campo['subtipoimovel'] == 'Fazenda') || ($campo['subtipoimovel'] == 'Sítio') || ($campo['subtipoimovel'] == 'Chácara') || ($campo['subtipoimovel'] == 'Chácara em condomínio')){
if($campo['areatotal'] == ''){
$imovel_invalido_desapega .= 'Área Total'.'%';
}
}else{
if($campo['areautil'] == ''){
$imovel_invalido_desapega .= 'Área Útil'.'%';
}
}
}
if($campo['tipo'] == 'Terreno'){
if($campo['areatotal'] == ''){
$imovel_invalido_desapega .= 'Área Total'.'%';
}
}
if($campo['status'] != '0'){
$imovel_invalido_desapega .= 'Status do Imóvel: Arquivado'.'%';
}
}
$cod_referencia_pendente_desapega = ''; // inicializa com string vazia
if (($validar == '1') || ($imovelvalido == 'nao')) {
$cod_referencia_pendente_desapega .= '-' . $campo['id_imovel'];
}
}
$imovel_invalido_id_desapega = ''; // inicialização segura
if ($imovel_invalido_desapega != '') {
$imovel_invalido_id_desapega .= $campo['id_imovel'].'%'.$imovel_invalido_desapega.'//';
}
}
$get_integracoes = $this->acaoglobal(array('integracoes', 'id'), 'get', 7);
// $get_integracoes = explode('-', $get_integracoes['pendentes']);
// $get_integracoes = array_unique($get_integracoes);
//
// foreach ($get_integracoes as $get_integracoes) {
// $get_integra.= $get_integracoes;
// //$get_integra.= '-';
// }
$variavel_nome = $imovel_invalido_id_desapega;
$valor_pendencia = isset($$variavel_nome) ? $$variavel_nome : null;
$this->acaoglobal(array('integracoes', 'id'), 'update', array(
'pendentes' => $cod_referencia_pendente_desapega,
'pendencias' => $valor_pendencia,
'id' => '7'
));
$prod_dom_load = $banco->query('SELECT * FROM produtos WHERE id_cliente = "' . $_SESSION['userdata']['contratante'] . '" AND produto_servico < 6');
$prod_dom = $prod_dom_load->fetch(PDO::FETCH_ASSOC);
$prod_dom_info_load = $banco->query('SELECT * FROM produtos WHERE dominio = "' . $prod_dom['dominio'] . '" AND produto_servico = 8');
$prod_dom_info = $prod_dom_info_load->fetch(PDO::FETCH_ASSOC);
$serv_info_load = $banco->query('SELECT * FROM servidores WHERE id_servidores = 2');
$serv_info = $serv_info_load->fetch(PDO::FETCH_ASSOC);
$prod_info = unserialize($prod_dom_info['dados_cpanel']);
//final do imovel
// save tree to file
$dom->save(ABSPATH . "/subdominios/" . $_SESSION['userdata']['contratante'] . "/desapega.xml");
// save tree to string
$order = $dom->save(ABSPATH . "/subdominios/" . $_SESSION['userdata']['contratante'] . "/desapega.xml");
$file = ABSPATH . "/subdominios/" . $_SESSION['userdata']['contratante'] . "/desapega.xml";
// set up basic connection
$conn_id = ftp_connect($serv_info['ip_server']);
$dir = 'public_html/integracoes';
$remote_file = $dir.'/desapega.xml';
// login with username and password
$login_result = ftp_login($conn_id, $prod_info['user'], $prod_info['senha']);
// upload a file
if (@ftp_mkdir($conn_id, $dir)) {
echo "successfully created $dir\n";
} else {
echo "There was a problem while creating $dir\n";
}
if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
echo "successfully uploaded $file\n";
} else {
echo "There was a problem while uploading $file\n";
}
// close the connection
unlink($file);
ftp_close($conn_id);
/*
//final do imovel
// save tree to file
$dom->save(ABSPATH . "/subdominios/" . $_SESSION['userdata']['contratante'] . "/desapega.xml");
// save tree to string
$order = $dom->save(ABSPATH . "/subdominios/" . $_SESSION['userdata']['contratante'] . "/desapega.xml");
*/
?>