403Webshell
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/meusitei/public_html/painel/geradoresintegracao/grupospimovel_bkp050625.php
<?php

// Topo
$dom = new DOMDocument("1.0", "utf-8");
$root = $dom->createElement("Carga");
$dom->appendChild($root);
$dom->formatOutput = true;

$oo = $dom->createAttribute("xmlns:xsd");
$root->appendChild($oo);
$o2 = $dom->createTextNode('http://www.w3.org/2001/XMLSchema');
$oo->appendChild($o2);

$oo = $dom->createAttribute("xmlns:xsi");
$root->appendChild($oo);
$o2 = $dom->createTextNode('http://www.w3.org/2001/XMLSchema-instance');
$oo->appendChild($o2);

$Listings = $dom->createElement("Imoveis");
$root->appendChild($Listings);

$imoveisintegrados = explode('-', $portal['imoveis']);
 
foreach ($imoveisintegrados as $campo) {
    $imovel_invalido_sp = '';
    if (@$infoimovel[$campo] != null) {

//echo $campo.'1';
// create child element
    $campo = $infoimovel[$campo]; 
    $imovelvalido = 'nao';
    $validar = '1';
   
    if ($campo['valor'] != '') {
        $imovelvalido = 'sim';

        /*if ($campo['tipo'] == 'Rural') {
            if ($campo['areatotal-medida'] != 'ha') {
                $imovelvalido = 'nao';
                $imovel_invalido_sp .= 'Área Total Medida'.'%';
            }
        }*/
        if ($campo['areautil'] == '') {
                $imovelvalido = 'nao';
                $imovel_invalido_sp .= 'Área Útil'.'%';
        }
        if($campo['status'] != '0'){
            $imovelvalido = 'nao';
             $imovel_invalido_sp .= 'Status do Imóvel: Arquivado'.'%';
        }
        if ($imovelvalido == 'sim') {
            $validar = '0';
            /////
            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) {
                $campo['suite'] = 'Mais de 5';
            } else {
                if (($campo['suite'] == null) || ($campo['suite'] == 0)) {
                    $campo['suite'] = 'Não tem';
                }
            }

            if ($campo['garagem'] > 5) {
                $campo['garagem'] = 'Mais de 5';
            } else {
                if (($campo['garagem'] == null) || ($campo['garagem'] == 0)) {
                    $campo['garagem'] = 'Não tem';
                }
            }

            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';
            }*/

            /////

            if ($campo['negocio'] == 'Locação') {
                $campo['negocio'] = 'Aluguel';
            }
            $imovel = $dom->createElement("Imovel");
            $Listings->appendChild($imovel);

            $tiponegocio = $campo['negocio'];
            if ($campo['negocio'] == 'Lançamento') {
                $tiponegocio = 'venda';
            } elseif ($campo['negocio'] == 'Venda') {
                $tiponegocio = 'venda';
            } elseif ($campo['negocio'] == 'Locação') {
                $tiponegocio = 'aluguel';
            } else {
                $tiponegocio = 'aluguel';
            }

            $Title = $dom->createElement("CodigoImovel");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['cod_referencia']);
            $Title->appendChild($TitleValue);
            
            $tipoimovel = $campo['tipo'];
            /*if ($campo['subtipoimovel'] == 'Flat') {
                $tipoimovel = 'Flat';
            }*/
            
            $CodigoImovel = $dom->createElement("TipoImovel");
            $imovel->appendChild($CodigoImovel);
            $codigoValue = $dom->createTextNode($tipoimovel);
            $CodigoImovel->appendChild($codigoValue);

            if ($campo['tipo'] == 'Apartamento') {
                if ($campo['subtipoimovel'] == 'Kitnete') {
                    $subtipoimovel = 'Kitchenette/Conjugados';
                } elseif (($campo['subtipoimovel'] == 'Loft') || ($campo['subtipoimovel'] == 'Loft Duplex') || ($campo['subtipoimovel'] == 'Loft Triplex')) {
                    $subtipoimovel = 'Loft';
                } else {
                    $subtipoimovel = 'Apartamento Padrão';
                }
            }
            
            if ($campo['tipo'] == 'Casa') {
                if ($campo['subtipoimovel'] == 'Em condomínio') {
                    $subtipoimovel = 'Casa de Condomínio';
                } elseif ($campo['subtipoimovel'] == 'Em vila fechada') {
                    $subtipoimovel = 'Casa de Vila';
                } else {
                    $subtipoimovel = 'Casa Padrão';
                }
            }
            
            if ($campo['tipo'] == 'Terreno') {
                if (($campo['subtipoimovel'] == 'Em condomínio') || ($campo['subtipoimovel'] == ' Em loteamento')) {
                    $subtipoimovel = 'Loteamento/Condomínio';
                } elseif (($campo['subtipoimovel'] == 'Em rua') || ($campo['subtipoimovel'] == 'Comercial') || ($campo['subtipoimovel'] == 'Área industrial') || ($campo['subtipoimovel'] == 'Para empreendimento')) {
                    $subtipoimovel = 'Terreno Padrão';
                }
            }
            
            if ($campo['tipo'] == 'Rural') {
                if (($campo['subtipoimovel'] == 'Chácara') || ($campo['subtipoimovel'] == 'Chácara em condomínio')) {
                    $subtipoimovel = 'Chácara';
                } elseif ($campo['subtipoimovel'] == 'Fazenda') {
                    $subtipoimovel = 'Fazenda';
                } elseif ($campo['subtipoimovel'] == 'Sítio') {
                    $subtipoimovel = 'Sítio';
                } elseif ($campo['subtipoimovel'] == 'Haras') {
                    $subtipoimovel = 'Haras';
                } else {
                    $subtipoimovel = 'Fazenda';
                }
            }

            if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Negócio')) {
                $subtipoimovel = 'Box/Garagem';
            } elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Prédio Inteiro')) {
                $subtipoimovel = 'Prédio Inteiro';
            } elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Sala')) {
                $subtipoimovel = 'Conjunto Comercial/sala';
            } elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Casa') || ($campo['subtipoimovel'] == 'Sobrado')) {
                $subtipoimovel = 'Casa Comercial';
            } elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Loja de shopping')) {
                $subtipoimovel = 'Loja de Shopping/Centro Comercial';
            } elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Loja')) {
                $subtipoimovel = 'Loja/Salão';
            } elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Galpão') || ($campo['subtipoimovel'] == 'Déposito') || ($campo['subtipoimovel'] == 'Armazém')) {
                $subtipoimovel = 'Galpão/Depósito/Armazém';
            } elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Hotel')) {
                $subtipoimovel = 'Hotel';
            } elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Motel')) {
                $subtipoimovel = 'Motel';
            } elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Pousada')) {
                $subtipoimovel = 'Pousada/Chalé';
            } elseif (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Indústria')) {
                $subtipoimovel = 'Indústria';
            }
            
            /*
            if ($campo['subtipoimovel'] == 'Kitnet') {
                $subtipoimovel = 'Kitchenette/Studio';
            } elseif ($campo['subtipoimovel'] == 'Duplex') {
                $subtipoimovel = 'Duplex';
            } elseif ($campo['subtipoimovel'] == 'Triplex') {
                $subtipoimovel = 'Triplex';
            } elseif ($campo['subtipoimovel'] == 'Flat') {
                $subtipoimovel = 'Flat Padrão';
            } elseif ($campo['subtipoimovel'] == 'em condomínio') {
                $subtipoimovel = 'Casa de Condomínio';
            } elseif ($campo['subtipoimovel'] == 'Sobrado') {
                $subtipoimovel = 'Sobrado';
            } elseif ($campo['subtipoimovel'] == 'Em vila fechada') {
                $subtipoimovel = 'Casa de Vila';
            } elseif (($campo['subtipoimovel'] == 'Depósito')||($campo['subtipoimovel'] == 'Armazém')||($campo['subtipoimovel'] == 'Galpão')) {
                $subtipoimovel = 'Galpão/Depósito/Armazém';
            } elseif ($campo['subtipoimovel'] == 'Hotel') {
                $subtipoimovel = 'Hotel';
            } elseif ($campo['subtipoimovel'] == 'Motel') {
                $subtipoimovel = 'Motel';
            } elseif ($campo['subtipoimovel'] == 'Pousada') {
                $subtipoimovel = 'Pousada/Chalé';
            } elseif ($campo['subtipoimovel'] == 'Indústria') {
                $subtipoimovel = 'Indústria';
            } elseif ($campo['subtipoimovel'] == 'Loja') {
                $subtipoimovel = 'Loja/Salão';
            } elseif ($campo['subtipoimovel'] == 'Sala') {
                $subtipoimovel = 'Sala comercial';
            } elseif ($campo['subtipoimovel'] == 'Prédio Inteiro') {
                $subtipoimovel = 'Prédio Inteiro';
            } elseif ($campo['subtipoimovel'] == 'Loja de Shopping') {
                $subtipoimovel = 'Loja de Shopping/Centro Comercial';
            } elseif ($campo['subtipoimovel'] == 'Chácara') {
                $subtipoimovel = 'Chácara';
            } elseif ($campo['subtipoimovel'] == 'Sítio') {
                $subtipoimovel = 'Sítio';
            } elseif ($campo['subtipoimovel'] == 'Fazenda') {
                $subtipoimovel = 'Fazenda';
            } elseif ($campo['subtipoimovel'] == 'Haras') {
                $subtipoimovel = 'Haras';
            }
            
            if ($campo['subtipoimovel'] == 'Terreno') {
                $subtipoimovel = 'Loteamento/Condomínio';
            }
            if ($campo['tipo'] == 'Terreno') {
                $subtipoimovel = 'Terreno Padrão';
            }
            if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Comercial')) {
                $subtipoimovel = 'Casa Comercial';
            }
            if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Padrão')) {
                $subtipoimovel = 'Casa Padrão';
            }*/
            
            $CodigoImovel = $dom->createElement("SubTipoImovel");
            $imovel->appendChild($CodigoImovel);
            $codigoValue = $dom->createTextNode($subtipoimovel);
            $CodigoImovel->appendChild($codigoValue);

            /////////////////////////////////////////////////////////////////////////// CONTINUAR DAQUI A INTEGRAÇÃO //////////////////////////////
            /////////////////////////////////////////////////////////////////////////// CONTINUAR DAQUI A INTEGRAÇÃO //////////////////////////////
            /////////////////////////////////////////////////////////////////////////// CONTINUAR DAQUI A INTEGRAÇÃO //////////////////////////////
            /////////////////////////////////////////////////////////////////////////// CONTINUAR DAQUI A INTEGRAÇÃO //////////////////////////////
            /////////////////////////////////////////////////////////////////////////// CONTINUAR DAQUI A INTEGRAÇÃO //////////////////////////////
            $Category = $dom->createElement("Finalidade");
            $imovel->appendChild($Category);
            $CategoryValue = $dom->createTextNode($tiponegocio);
            $Category->appendChild($CategoryValue);

                $portal_info = $this->acaoglobal(array('integracoes', 'id'), 'get', 14);
                $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') || ($list_info_imoveis_tipo[$cont_info_imovel] == 'Básico')){
                            $info = '0';
                        }else if($list_info_imoveis_tipo[$cont_info_imovel] == 'Destaque'){
                            $info = 'Destaque Home';
                        }else{
                           $info = 'Super Destaque';
                       }                     
                    }

                    if ($info_imovel != '') {
                        $cont_info_imovel++;
                    }
                }
                
                $Category = $dom->createElement("DestaqueTipo");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($info);
                $Category->appendChild($CategoryValue);

            $Category = $dom->createElement("AceitaPermuta");
            $imovel->appendChild($Category);
            $CategoryValue = $dom->createTextNode('Não'); // A DEFINIR
            $Category->appendChild($CategoryValue);

            $Title = $dom->createElement("Estado");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['cep_estado']);
            $Title->appendChild($TitleValue);

            $Title = $dom->createElement("Cidade");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['cep_cidade']);
            $Title->appendChild($TitleValue);

                $Neighborhood = $dom->createElement("Bairro");
                $imovel->appendChild($Neighborhood);
                $NeighborhoodValue = $dom->createTextNode($campo['cep_bairro']);
                $Neighborhood->appendChild($NeighborhoodValue);
                
                if ($campo['ocultarend'] == 0) {
                    if ($campo['cep_logradouro'] != '') {
                        $Neighborhood = $dom->createElement("Endereco");
                        $imovel->appendChild($Neighborhood);
                        $NeighborhoodValue = $dom->createTextNode($campo['cep_logradouro']);
                        $Neighborhood->appendChild($NeighborhoodValue);
                    }
                    if ($campo['cep_numero'] != "") {
                        $Neighborhood = $dom->createElement("Numero");
                        $imovel->appendChild($Neighborhood);
                        $NeighborhoodValue = $dom->createTextNode($campo['cep_numero']);
                        $Neighborhood->appendChild($NeighborhoodValue);
                    }
                    if ($campo['cep_complemento'] != "") {
                        $Neighborhood = $dom->createElement("Complemento");
                        $imovel->appendChild($Neighborhood);
                        $NeighborhoodValue = $dom->createTextNode($campo['cep_complemento']);
                        $Neighborhood->appendChild($NeighborhoodValue);
                    }
                    if ($campo['cep'] != "") {
                        if(strpos($campo['cep'],"-")){
                         $cep =  explode("-", $campo['cep']);
                         $cep = $cep[0].$cep[1];
                        }else{
                            $cep = $campo['cep'];
                        }
                        
                        $PostalCode = $dom->createElement("CEP");
                        $imovel->appendChild($PostalCode);
                        $PostalCodeValue = $dom->createTextNode($cep);
                        $PostalCode->appendChild($PostalCodeValue);
                    }
                }

            if (($campo['negocio'] == 'Venda') || ($campo['negocio'] == 'Lançamento')) {
            $Title = $dom->createElement("PrecoVenda");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['valor']);
            $Title->appendChild($TitleValue);
            } else {
            $Title = $dom->createElement("PrecoLocacao");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['valor']);
            $Title->appendChild($TitleValue);
            }

            $Title = $dom->createElement("PrecoCondominio");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['valor_condominio']);
            $Title->appendChild($TitleValue);

            $Title = $dom->createElement("ValorIptu");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['valor_iptu']);
            $Title->appendChild($TitleValue);

            $Title = $dom->createElement("AreaUtil");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['areautil']);
            $Title->appendChild($TitleValue);

            /*$Title = $dom->createElement("AreaTotal");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['areatotal']);
            $Title->appendChild($TitleValue);*/

            $Title = $dom->createElement("AreaTerreno");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['areaterreno']);
            $Title->appendChild($TitleValue);


            $Title = $dom->createElement("QtdDormitorios");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['dormitorio']);
            $Title->appendChild($TitleValue);

            $Title = $dom->createElement("QtdBanheiros");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['banheiro']);
            $Title->appendChild($TitleValue);

            $Title = $dom->createElement("QtdSuites");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['suite']);
            $Title->appendChild($TitleValue);

            $Title = $dom->createElement("QtdVagas");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['garagem']);
            $Title->appendChild($TitleValue);

            $Title = $dom->createElement("Observacao");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createCDATASection($campo['descricaodoimovel']);
            $Title->appendChild($TitleValue);

            $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  = 'Germinada';
                            }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  = 'Salão de 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ça na Rua';
                            }if($detalhe == '569'){
                                $detalhe  = 'Segurança Patrimonial';
                            }if($detalhe == '570'){
                                $detalhe  = 'Semigerminada';
                            }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 == '587'){
                                $detalhe  = 'Terra';
                            }if($detalhe == '588'){
                                $detalhe  = 'Sacada';
                            }if($detalhe == '589'){
                                $detalhe  = 'Depósito';
                            }if($detalhe == '590'){
                                $detalhe  = 'Cabeamento estruturado';
                            }if($detalhe == '591'){
                                $detalhe  = 'Garagem';
                            }if($detalhe == '593'){
                                $detalhe  = 'Vista exterior';
                            }if($detalhe == '594'){
                                $detalhe  = 'Gramado';
                            }if($detalhe == '595'){
                                $detalhe  = 'Espelhos dágua';
                            }if($detalhe == '596'){
                                $detalhe  = 'Mais de um andar';
                            }if($detalhe == '597'){
                                $detalhe  = 'Serviço pay per use';
                            }if($detalhe == '598'){
                                $detalhe  = 'Vigia';
                            }if($detalhe == '599'){
                                $detalhe  = 'Espaço verde / Parque';
                            }if($detalhe == '600'){
                                $detalhe  = 'Recepção';
                            }if($detalhe == '601'){
                                $detalhe  = 'Garage band';
                            }if($detalhe == '602'){
                                $detalhe  = 'Massagem';
                            }if($detalhe == '603'){
                                $detalhe  = 'Spa';
                            }if($detalhe == '604'){
                                $detalhe  = 'Vista para a montanha';
                            }if($detalhe == '605'){
                                $detalhe  = 'Vista para lago';
                            }if($detalhe == '606'){
                                $detalhe  = 'Andar Inteiro';
                            }if($detalhe == '607'){
                                $detalhe  = 'Casa Principal';
                            }if($detalhe == '608'){
                                $detalhe  = 'Casa Mista';
                            }if($detalhe == '609'){
                                $detalhe  = 'Casa de Alvenaria';
                            }if($detalhe == '610'){
                                $detalhe  = 'Casa de Madeira';
                            }if($detalhe == '611'){
                                $detalhe  = 'Com Serviço';
                            }if($detalhe == '612'){
                                $detalhe  = 'Clube';
                            }if($detalhe == '613'){
                                $detalhe  = 'Deposito Privativo no Subsolo';
                            }if($detalhe == '614'){
                                $detalhe  = 'Energia Elétrica';
                            }if($detalhe == '615'){
                                $detalhe  = 'Entrada de Serviço Independente';
                            }if($detalhe == '616'){
                                $detalhe  = 'Entrada Facilitada';
                            }if($detalhe == '617'){
                                $detalhe  = 'Freezer';
                            }if($detalhe == '618'){
                                $detalhe  = 'Geladeira';
                            }if($detalhe == '619'){
                                $detalhe  = 'Home Theater';
                            }if($detalhe == '620'){
                                $detalhe  = 'Living Tabuas Largas';
                            }if($detalhe == '621'){
                                $detalhe  = 'Lava Roupas';
                            }if($detalhe == '622'){
                                $detalhe  = 'Lavanderia Coletiva';
                            }if($detalhe == '623'){
                                $detalhe  = 'Meio Andar';
                            }if($detalhe == '624'){
                                $detalhe  = 'Microondas';
                            }if($detalhe == '625'){
                                $detalhe  = 'Poço';
                            }if($detalhe == '626'){
                                $detalhe  = 'Recuo';
                            }if($detalhe == '627'){
                                $detalhe  = 'Roupa de Banho';
                            }if($detalhe == '628'){
                                $detalhe  = 'Roupa de Cama';
                            }if($detalhe == '629'){
                                $detalhe  = 'Roupa de Mesa';
                            }if($detalhe == '630'){
                                $detalhe  = 'Utensílios de Cozinha';
                            }
                        
                        if (($detalhe == 'Coffee Shop')) { 
                            $Title = $dom->createElement("CoffeeShop");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);  
                        }if (($detalhe == 'Closet')) { 
                            $Title = $dom->createElement("Closet");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);  
                        }if (($detalhe == 'Cinema')) { 
                            $Title = $dom->createElement("Cinema");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);  
                        }if (($detalhe == 'Churrasqueira')) { 
                            $Title = $dom->createElement("Churrasqueira");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);  
                        }if (($detalhe == 'Children Care')) { 
                            $Title = $dom->createElement("ChildrenCare");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);  
                        }if (($detalhe == 'Cerca')) { 
                            $Title = $dom->createElement("Cerca");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);  
                        }if (($detalhe == 'Centro de estética')) { 
                            $Title = $dom->createElement("CentroDeEstetica");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);  
                        }if (($detalhe == 'Central telefônica')) { 
                            $Title = $dom->createElement("CentralTelefonica");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);  
                        }if (($detalhe == 'Caseiro')) { 
                            $Title = $dom->createElement("Caseiro");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);  
                        }if (($detalhe == 'Casa de Fundo')) { 
                            $Title = $dom->createElement("CasaDeFundo");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);  
                        }if (($detalhe == 'Casa de Caseiro')) { 
                            $Title = $dom->createElement("CasaDeCaseiro");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);  
                        }if (($detalhe == 'Casa de Boneca')) { 
                            $Title = $dom->createElement("CasaDeBoneca");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);  
                        }if (($detalhe == 'Carpete')) { 
                            $Title = $dom->createElement("Carpete");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);  
                        }if (($detalhe == 'Car Wash')) {  
                            $Title = $dom->createElement("CarWash");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Campo de Golfe')) {  
                            $Title = $dom->createElement("CampoDeGolfe");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        } if (($detalhe == 'Campo de futebol')) {  
                            $Title = $dom->createElement("CampoDeFutebol");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Cameras de segurança')) {  
                            $Title = $dom->createElement("CamerasDeSeguranca");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Canil')) {  
                            $Title = $dom->createElement("Canil");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        } if (($detalhe == 'Business Center')) {  
                            $Title = $dom->createElement("BusinessCenter");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Bosque')) {  
                            $Title = $dom->createElement("Bosque");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Brinquedoteca')) {  
                            $Title = $dom->createElement("Brinquedoteca");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Bicicletário')) {  
                            $Title = $dom->createElement("Bicicletario");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Bar')) {  
                            $Title = $dom->createElement("Bar");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Armário Embutido')) {  
                            $Title = $dom->createElement("ArmarioEmbutido");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Armário Cozinha')) {  
                            $Title = $dom->createElement("ArmarioCozinha");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Área de Serviço')) {  
                            $Title = $dom->createElement("AreaDeServiço");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Ar Condicionado')) {  
                            $Title = $dom->createElement("ArCondicionado");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Água')) {  
                            $Title = $dom->createElement("Agua");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Aquecimento Central')) {  
                            $Title = $dom->createElement("AquecimentoCentral");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Aquecedor')) {  
                            $Title = $dom->createElement("Aquecedor");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Acesso para deficientes')) {  
                            $Title = $dom->createElement("AcessoParaDeficientes");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Acesso 24 Horas')) {  
                            $Title = $dom->createElement("Acesso24Horas");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Academia')) {  
                            $Title = $dom->createElement("Academia");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Entrada de Caminhões')) {  
                            $Title = $dom->createElement("EntradaDeCaminhoes");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Elevador')) {  
                            $Title = $dom->createElement("Elevador");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Edícula')) {  
                            $Title = $dom->createElement("Edicula");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Despensa')) {  
                            $Title = $dom->createElement("Despensa");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Dependência de empregados')) {  
                            $Title = $dom->createElement("DependenciaDeEmpregados");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Curral')) {  
                            $Title = $dom->createElement("Curral");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Cozinha Gourmet')) {  
                            $Title = $dom->createElement("CozinhaGourmet");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Cozinha americana')) {  
                            $Title = $dom->createElement("CozinhaAmericana");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Copa')) {  
                            $Title = $dom->createElement("Copa");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Convenções')) {  
                            $Title = $dom->createElement("Convencoes");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Entrada lateral')) {  
                            $Title = $dom->createElement("EntradaLateral");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Escritório')) {  
                            $Title = $dom->createElement("Escritorio");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Escritório Virtual')) {  
                            $Title = $dom->createElement("EscritorioVirtual");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Esgoto')) {  
                            $Title = $dom->createElement("Esgoto");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Espaço Gourmet')) {  
                            $Title = $dom->createElement("EspacoGourmet");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Espaço zen')) {  
                            $Title = $dom->createElement("EspacoZen");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Esquina')) {  
                            $Title = $dom->createElement("Esquina");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Estacionamento para visitantes')) {  
                            $Title = $dom->createElement("EstacionamentoParaVisitantes");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Estacionamento Rotativo')) {  
                            $Title = $dom->createElement("EstacionamentoRotativo");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Estacionamento Visitantes')) {  
                            $Title = $dom->createElement("EstacionamentoVisitantes");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Estrada Asfaltada')) {  
                            $Title = $dom->createElement("EstradaAsfaltada");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Fitness')) {  
                            $Title = $dom->createElement("Fitness");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Forno de pizza')) {  
                            $Title = $dom->createElement("FornoDePizza");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Frente para o Mar')) {  
                            $Title = $dom->createElement("FrenteParaMar");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Fogão elétrico')) {  
                            $Title = $dom->createElement("FogaoEletrico");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Galpão')) {  
                            $Title = $dom->createElement("Galpao");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Garagem para Barcos')) {  
                            $Title = $dom->createElement("GaragemParaBarcos");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Gerador')) {  
                            $Title = $dom->createElement("Gerador");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Germinada')) {  
                            $Title = $dom->createElement("Germinada");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Guarita')) {  
                            $Title = $dom->createElement("Guarita");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Heliponto')) {  
                            $Title = $dom->createElement("Heliponto");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Hidromassagem')) {  
                            $Title = $dom->createElement("Hidromassagem");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Infra-estrutura Internet')) {  
                            $Title = $dom->createElement("InfraEstruturaInternet");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Interfone')) {  
                            $Title = $dom->createElement("Interfone");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Jardim')) {  
                            $Title = $dom->createElement("Jardim");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Lago')) {  
                            $Title = $dom->createElement("Lago");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Lan House')) {  
                            $Title = $dom->createElement("LanHouse");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Lareira')) {  
                            $Title = $dom->createElement("Lareira");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Lavabo')) {  
                            $Title = $dom->createElement("Lavabo");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Lavanderia')) {  
                            $Title = $dom->createElement("Lavanderia");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Lavoura')) {  
                            $Title = $dom->createElement("Lavoura");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Luminárias')) {  
                            $Title = $dom->createElement("Luminarias");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Luz')) {  
                            $Title = $dom->createElement("Luz");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Marina')) {  
                            $Title = $dom->createElement("Marina");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Mezanino')) {  
                            $Title = $dom->createElement("Mezanino");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Mobiliado')) {  
                            $Title = $dom->createElement("Mobiliado");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Paiol')) {  
                            $Title = $dom->createElement("Paiol");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Pasto')) {  
                            $Title = $dom->createElement("Pasto");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Pátio Estacionamento')) {  
                            $Title = $dom->createElement("PatioEstacionamento");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Permite Animais')) {  
                            $Title = $dom->createElement("PermiteAnimais");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Pet Care')) {  
                            $Title = $dom->createElement("PetCare");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Píer')) {  
                            $Title = $dom->createElement("Pier");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Piscina')) {  
                            $Title = $dom->createElement("Piscina");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Piscina aquecida')) {  
                            $Title = $dom->createElement("PiscinaAquecida");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Piscina Climatizada')) {  
                            $Title = $dom->createElement("PiscinaClimatizada");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Piscina Coberta')) {  
                            $Title = $dom->createElement("PiscinaCoberta");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Piscina Infantil')) {  
                            $Title = $dom->createElement("PiscinaInfantil");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);           
                        }if (($detalhe == 'Piso Elevado')) {  
                            $Title = $dom->createElement("PisoElevado");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Pista de cooper')) {  
                            $Title = $dom->createElement("PistaDeCooper");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Pista de Pouso')) {  
                            $Title = $dom->createElement("PistaDePouso");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Pista de Skate')) {  
                            $Title = $dom->createElement("PistaDeSkate");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Playground')) {  
                            $Title = $dom->createElement("Playground");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Poço Artesiano')) {  
                            $Title = $dom->createElement("PocoArtesiano");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Pomar')) {  
                            $Title = $dom->createElement("Pomar");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Ponte Rolante')) {  
                            $Title = $dom->createElement("PonteRolante");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Portão Eletrônico')) {  
                            $Title = $dom->createElement("PortaoEletronico");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Portaria 24 horas')) {  
                            $Title = $dom->createElement("Portaria24Horas");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Porteira Fechada')) {  
                            $Title = $dom->createElement("PorteiraFechada");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Quadra de futebol de salão')) {  
                            $Title = $dom->createElement("QuadraDeFutebolDeSalao");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Quadra Poliesportiva')) {  
                            $Title = $dom->createElement("QuadraPoliesportiva");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Quadra de Squash')) {  
                            $Title = $dom->createElement("QuadraDeSquash");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Quadra de Tênis')) {  
                            $Title = $dom->createElement("QuadraDeTenis");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Quarto da Empregada')) {  
                            $Title = $dom->createElement("QuartoDaEmpregada");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Quintal')) {  
                            $Title = $dom->createElement("Quintal");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Redario')) {  
                            $Title = $dom->createElement("Redario");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Rede de Telefone')) {  
                            $Title = $dom->createElement("RedeDeTelefone");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Refeitório')) {  
                            $Title = $dom->createElement("Refeitorio");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Reservatório de Água')) {  
                            $Title = $dom->createElement("ReservatorioDeAgua");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Restaurante')) {  
                            $Title = $dom->createElement("Restaurante");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Rio')) {  
                            $Title = $dom->createElement("Rio");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Ronda/Vigilância')) {  
                            $Title = $dom->createElement("RondaVigilancia");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Rua Asfaltada')) {  
                            $Title = $dom->createElement("RuaAsfaltada");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Sala de Almoço')) {  
                            $Title = $dom->createElement("SalaDeAlmoco");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Sala de Ginástica')) {  
                            $Title = $dom->createElement("SalaDeGinastica");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Sala de Jantar')) {  
                            $Title = $dom->createElement("SalaDeJantar");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Sala íntima')) {  
                            $Title = $dom->createElement("SalaIntima");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Salão de convenções')) {  
                            $Title = $dom->createElement("SalaoDeConvencoes");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Salão de Festas')) {  
                            $Title = $dom->createElement("SalaoDeFestas");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Salão de Jogos')) {  
                            $Title = $dom->createElement("SalaoDeJogos");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);         
                        }if (($detalhe == 'Salão de Vídeo/Cinema')) {  
                            $Title = $dom->createElement("SalaoDeVideoCinema");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Sauna')) {  
                            $Title = $dom->createElement("Sauna");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Sede')) {  
                            $Title = $dom->createElement("Sede");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Segurança Interna')) {  
                            $Title = $dom->createElement("SegurancaInterna");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Segurança na Rua')) {  
                            $Title = $dom->createElement("SegurancaNaRua");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Segurança Patrimonial')) {  
                            $Title = $dom->createElement("SegurancaPatrimonial");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Semigerminada')) {  
                            $Title = $dom->createElement("Semigerminada");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Silos')) {  
                            $Title = $dom->createElement("Silos");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Sistema de alarme')) {  
                            $Title = $dom->createElement("SistemaDeAlarme");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Sistema de Incêndio')) {  
                            $Title = $dom->createElement("SistemaDeIncendio");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Solariam')) {  
                            $Title = $dom->createElement("Solariam");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Telefone')) {  
                            $Title = $dom->createElement("Telefone");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Terraço')) {  
                            $Title = $dom->createElement("Terraco");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'TV')) {  
                            $Title = $dom->createElement("TV");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'TV a cabo')) {  
                            $Title = $dom->createElement("TvCabo");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Varanda')) {  
                            $Title = $dom->createElement("Varanda");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Varanda Goumert')) {  
                            $Title = $dom->createElement("VarandaGoumert");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Ventilador de Teto')) {  
                            $Title = $dom->createElement("VentiladorDeTeto");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Vestiário')) {  
                            $Title = $dom->createElement("Vestiario");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Vigilância 24hs')) {  
                            $Title = $dom->createElement("Vigilancia24hs");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'WC Empregada')) {  
                            $Title = $dom->createElement("WCEmpregada");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Cascalho')) {  
                            $Title = $dom->createElement("Cascalho");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Terra')) {  
                            $Title = $dom->createElement("Terra");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Sacada')) {  
                            $Title = $dom->createElement("Sacada");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Depósito')) {  
                            $Title = $dom->createElement("Deposito");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Cabeamento estruturado')) {  
                            $Title = $dom->createElement("CabeamentoEstruturado");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Garagem')) {  
                            $Title = $dom->createElement("Garagem");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Vista exterior')) {  
                            $Title = $dom->createElement("VistaExterior");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Gramado')) {  
                            $Title = $dom->createElement("Gramado");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Espelhos dágua')) {  
                            $Title = $dom->createElement("EspelhosDagua");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Mais de um andar')) {  
                            $Title = $dom->createElement("MaisDeUmAndar");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Serviço pay per use')) {  
                            $Title = $dom->createElement("ServicoPayPerUse");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Vigia')) {  
                            $Title = $dom->createElement("Vigia");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Espaço verde / Parque')) {  
                            $Title = $dom->createElement("EspaçoVerde");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Recepção')) {  
                            $Title = $dom->createElement("Recepcao");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Garage band')) {  
                            $Title = $dom->createElement("GarageBand");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Massagem')) {  
                            $Title = $dom->createElement("Massagem");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Spa')) {  
                            $Title = $dom->createElement("Spa");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Vista para a montanha')) {  
                            $Title = $dom->createElement("VistaParaMontanha");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Vista para lago')) {  
                            $Title = $dom->createElement("VistaParaLago");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Andar Inteiro')) {  
                            $Title = $dom->createElement("AndarInteiro");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Casa Principal')) {  
                            $Title = $dom->createElement("CasaPrincipal");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Casa Mista')) {  
                            $Title = $dom->createElement("CasaMista");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Casa de Alvenaria')) {  
                            $Title = $dom->createElement("CasaDeAlvenaria");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Casa de Madeira')) {  
                            $Title = $dom->createElement("CasaDeMadeira");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Com Serviço')) {  
                            $Title = $dom->createElement("ComServiço");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Clube')) {  
                            $Title = $dom->createElement("Clube");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Deposito Privativo no Subsolo')) {  
                            $Title = $dom->createElement("DepositoPrivativoNoSubsolo");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Energia Elétrica')) {  
                            $Title = $dom->createElement("EnergiaEletrica");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Entrada de Serviço Independente')) {  
                            $Title = $dom->createElement("EntradaDeServicoIndependente");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Entrada Facilitada')) {  
                            $Title = $dom->createElement("EntradaFacilitada");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Freezer')) {  
                            $Title = $dom->createElement("Freezer");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Geladeira')) {  
                            $Title = $dom->createElement("Geladeira");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Home Theater')) {  
                            $Title = $dom->createElement("HomeTheater");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Living Tabuas Largas')) {  
                            $Title = $dom->createElement("LivingTabuasLargas");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Lava Roupas')) {  
                            $Title = $dom->createElement("LavaRoupas");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Lavanderia Coletiva')) {  
                            $Title = $dom->createElement("LavanderiaColetiva");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Meio Andar')) {  
                            $Title = $dom->createElement("MeioAndar");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Microondas')) {  
                            $Title = $dom->createElement("Microondas");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Poço')) {  
                            $Title = $dom->createElement("Poco");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Recuo')) {  
                            $Title = $dom->createElement("Recuo");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Roupa de Banho')) {  
                            $Title = $dom->createElement("RoupaDeBanho");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Roupa de Cama')) {  
                            $Title = $dom->createElement("RoupaDeCama");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Roupa de Mesa')) {  
                            $Title = $dom->createElement("RoupaDeMesa");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }if (($detalhe == 'Utensílios de Cozinha')) {  
                            $Title = $dom->createElement("UtensiliosDeCozinha");
                            $imovel->appendChild($Title);
                            $TitleValue = $dom->createTextNode('1');
                            $Title->appendChild($TitleValue);          
                        }
                } 
            }

            $fotoss = unserialize($campo['fotos']);

            if ($fotoss[0] != '') {
                $pictures = $dom->createElement("Fotos");
                $imovel->appendChild($pictures);
                $contfotos = 0;
                foreach ($fotoss as $imagem) {
                    $imageURL = $dom->createElement("Foto");
                    $pictures->appendChild($imageURL);

                    $imageURLlink = $dom->createElement("NomeArquivo");
                    $imageURL->appendChild($imageURLlink);
                    $imageURLValue = $dom->createTextNode($imagem);
                    $imageURLlink->appendChild($imageURLValue);

                    $imageURLlink = $dom->createElement("URLArquivo");
                    $imageURL->appendChild($imageURLlink);
                    $imageURLValue = $dom->createTextNode(HOME_URI . 'subdominios/' . $_SESSION['userdata']['contratante'] . '/fotos/' . $campo['id_imovel'] . '/' . $imagem);
                    $imageURLlink->appendChild($imageURLValue);

                    $imageURLlink = $dom->createElement("Legenda");
                    $imageURL->appendChild($imageURLlink);
                    $imageURLValue = $dom->createTextNode('');
                    $imageURLlink->appendChild($imageURLValue);

                    $fotoprincipal = 0;
                    if ($campo['icone'] == $imagem) {
                        $fotoprincipal = 1;
                    }

                    $imageURLlink = $dom->createElement("Principal");
                    $imageURL->appendChild($imageURLlink);
                    $imageURLValue = $dom->createTextNode($fotoprincipal);
                    $imageURLlink->appendChild($imageURLValue);

                    $contfotos++;
                }

                $pictures = $dom->createElement("Numero_total_fotos");
                $imovel->appendChild($pictures);
                $imageURLValue = $dom->createTextNode($contfotos);
                $pictures->appendChild($imageURLValue);
            }

            $Title = $dom->createElement("Videos");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['video']);
            $Title->appendChild($TitleValue);

            /*$Title = $dom->createElement("UnidadeMetrica");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['areatotal_medida']);
            $Title->appendChild($TitleValue);*/

            $Title = $dom->createElement("UnidadeMetricaAreaTerreno");
            $imovel->appendChild($Title);
            $TitleValue = $dom->createTextNode($campo['areaterreno_medida']);
            $Title->appendChild($TitleValue);

        }
        
    }else{
        if($campo['valor'] == ''){
                $imovel_invalido_sp .= 'Valor do Imóvel '.'%';
            }
        /*if ($campo['tipo'] == 'Rural') {
            if ($campo['areatotal-medida'] != 'ha') {
                $imovel_invalido_sp .= 'Área Total Medida'.'%';
            }
        }*/
        if($campo['status'] != '0'){
            $imovel_invalido_sp .= 'Status do Imóvel: Arquivado'.'%';           
        }
    }
    $cod_referencia_pendente_gruposp = ''; // inicializa com string vazia

if (($validar == '1') || ($imovelvalido == 'nao')) {
    $cod_referencia_pendente_gruposp .= '-' . $campo['id_imovel'];
}
    } 
$imovel_invalido_id_sp = ''; // inicialização segura

if ($imovel_invalido_sp != '') { 
    $imovel_invalido_id_sp .= $campo['id_imovel'].'%'.$imovel_invalido_sp.'//';
}

}

$get_integracoes = $this->acaoglobal(array('integracoes', 'id'), 'get', 14);    
    
//                $get_integracoes = explode('-', $get_integracoes['pendentes']);  
//                $get_integracoes = array_unique($get_integracoes);
//                
//                foreach ($get_integracoes as $get_integracoes) {
//                         $get_integra.= $get_integracoes;
//                          //$get_integra.= '-';
//                }

$this->acaoglobal(array('integracoes', 'id'), 'update', array(
                                                    'pendentes' => $cod_referencia_pendente_gruposp,
                                                    'pendencias' => $imovel_invalido_id_sp,
                                                    'id' => '14'
                                                        )
                                                );

$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'] . "/spimovel.xml");
// save tree to string
$order = $dom->save(ABSPATH . "/subdominios/" . $_SESSION['userdata']['contratante'] . "/spimovel.xml");


$file = ABSPATH . "/subdominios/" . $_SESSION['userdata']['contratante'] . "/spimovel.xml";

// set up basic connection
$conn_id = ftp_connect($serv_info['ip_server']);
$dir = 'public_html/integracoes';
$remote_file = $dir.'/spimovel.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);
?>

Youez - 2016 - github.com/yon3zu
LinuXploit