| Server IP : 23.111.136.34 / Your IP : 216.73.216.136 Web Server : Apache System : Linux servidor.eurohost.com.br 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : meusitei ( 1072) PHP Version : 5.6.40 Disable Function : show_source, system, shell_exec, passthru, proc_open MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/meusitei/public_html/painel/geradoresintegracao/ |
Upload File : |
<?php
// Topo
$dom = new DOMDocument("1.0", "utf-8");
$root = $dom->createElement("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_storia = '';
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['dormitorio'] != null) && ($campo['tipo'] != null) && ($campo['cod_referencia'] != null) && ($campo['cep_estado'] != null) && ($campo['cep_cidade'] != null) && ($campo['cep_bairro'] != null) && ($campo['descricaodoimovel'] != null) && ($campo['descricaodoimovel'] != "<br>")){
$imovelvalido = 'sim';
if($campo['status'] != '0'){
$imovelvalido = 'nao';
$imovel_invalido_zap .= 'Status do Imóvel: Arquivado'.'%';
}
if ($imovelvalido == 'sim') {
$validar = '0';
/////////////////////////////////////////////////////////////////////////// OLX - INICIO
// if ($campo['negocio'] == 'Locação') {
// $campo['negocio'] = 'Aluguel';
// }
$imovel = $dom->createElement("Imovel");
$Listings->appendChild($imovel);
$CodigoImovel = $dom->createElement("CodigoImovel");
$imovel->appendChild($CodigoImovel);
$codigoValue = $dom->createTextNode($campo['cod_referencia']);
$CodigoImovel->appendChild($codigoValue);
if ($campo['tipo'] == 'Apartamento') {
$tipoimovel = 'Apartamento';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Padrão')) {
$tipoimovel = 'Apartamento';
$subtipoimovel = 'Apartamento Residencial';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Alto Padrão')) {
$tipoimovel = 'Apartamento';
$subtipoimovel = 'Apartamento Residencial';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Luxo')) {
$tipoimovel = 'Apartamento';
$subtipoimovel = 'Apartamento Residencial';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Kitnet')) {
$tipoimovel = 'Kitnet';
$subtipoimovel = 'Kitnet Residencial';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Cobertura')) {
$tipoimovel = 'Cobertura';
$subtipoimovel = 'Cobertura Residencial';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Duplex')) {
$tipoimovel = 'Apartamento Duplex';
$subtipoimovel = 'Apartamento Duplex Residencial';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Triplex')) {
$tipoimovel = 'Apartamento Triplex';
$subtipoimovel = 'Apartamento Triplex Residencial';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Loft')) {
$tipoimovel = 'Apartamento';
$subtipoimovel = 'Loft';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Loft Duplex')) {
$tipoimovel = 'Apartamento';
$subtipoimovel = 'Loft';
$categoriaImovel = 'Duplex';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Loft Triplex')) {
$tipoimovel = 'Apartamento';
$subtipoimovel = 'Loft';
$categoriaImovel = 'Triplex';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Sobreloja')) {
$tipoimovel = 'Apartamento';
$subtipoimovel = 'Apartamento Residencial';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Flat')) {
$tipoimovel = 'Flat';
$subtipoimovel = 'Flat Residencial';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Apartamento') && ($campo['subtipoimovel'] == 'Village')) {
$tipoimovel = 'Apartamento';
$subtipoimovel = 'Apartamento Residencial';
$categoriaImovel = 'Padrão';
}
if ($campo['tipo'] == 'Casa') {
$tipoimovel = 'Casa';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Padrão')) {
$tipoimovel = 'Casa';
$subtipoimovel = 'Casa Padrão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Alvenaria')) {
$tipoimovel = 'Casa';
$subtipoimovel = 'Casa Padrão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Madeira')) {
$tipoimovel = 'Casa';
$subtipoimovel = 'Casa Padrão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Térreo')) {
$tipoimovel = 'Casa';
$subtipoimovel = 'Casa Padrão';
$categoriaImovel = 'Térrea';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Em condomínio')) {
$tipoimovel = 'Casa';
$subtipoimovel = 'Casa de Condomínio';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Em vila fechada')) {
$tipoimovel = 'Casa';
$subtipoimovel = 'Casa de Vila';
$categoriaImovel = 'Térrea';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Sobrado Padrão')) {
$tipoimovel = 'Sobrado';
$subtipoimovel = 'Sobrado Residencial';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Sobrado em condomínio')) {
$tipoimovel = 'Sobrado';
$subtipoimovel = 'Sobrado Residencial';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Sobrado em vila fechada')) {
$tipoimovel = 'Sobrado';
$subtipoimovel = 'Sobrado Residencial';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Sobrado Duplex')) {
$tipoimovel = 'Casa';
$subtipoimovel = 'Casa Padrão';
$categoriaImovel = 'Sobrado/Duplex';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Sobrado Triplex')) {
$tipoimovel = 'Casa';
$subtipoimovel = 'Casa Padrão';
$categoriaImovel = 'Sobrado/Triplex';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Assobradada')) {
$tipoimovel = 'Casa';
$subtipoimovel = 'Casa Padrão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Geminada')) {
$tipoimovel = 'Casa';
$subtipoimovel = 'Casa Padrão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Casa') && ($campo['subtipoimovel'] == 'Village')) {
$tipoimovel = 'Casa';
$subtipoimovel = 'Casa Padrão';
$categoriaImovel = 'Padrão';
}
if ($campo['tipo'] == 'Comercial') {
$tipoimovel = 'Casa';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Negócio')) {
$tipoimovel = 'Comercial';
$subtipoimovel = 'Conjunto Comercial/sala';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Loja')) {
$tipoimovel = 'Comercial';
$subtipoimovel = 'Loja/Salão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Sala')) {
$tipoimovel = 'Comercial';
$subtipoimovel = 'Conjunto Comercial/sala';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Prédio Inteiro')) {
$tipoimovel = 'Comercial/Industrial';
$subtipoimovel = 'Prédio Inteiro';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Casa')) {
$tipoimovel = 'Comercial';
$subtipoimovel = 'Casa Comercial';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Loja de shopping')) {
$tipoimovel = 'Comercial';
$subtipoimovel = 'Loja/Salão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Sobrado')) {
$tipoimovel = 'Comercial/Industrial';
$subtipoimovel = 'Prédio Inteiro';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Armazém')) {
$tipoimovel = 'Comercial/Industrial';
$subtipoimovel = 'Galpão/Depósito/Armazém';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Depósito')) {
$tipoimovel = 'Comercial/Industrial';
$subtipoimovel = 'Galpão/Depósito/Armazém';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Galpão')) {
$tipoimovel = 'Comercial/Industrial';
$subtipoimovel = 'Galpão/Depósito/Armazém';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Indústria')) {
$tipoimovel = 'Comercial/Industrial';
$subtipoimovel = 'Conjunto Comercial/sala';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Hotel')) {
$tipoimovel = 'Comercial';
$subtipoimovel = 'Hotel';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Motel')) {
$tipoimovel = 'Comercial';
$subtipoimovel = 'Hotel';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Comercial') && ($campo['subtipoimovel'] == 'Pousada')) {
$tipoimovel = 'Comercial';
$subtipoimovel = 'Hotel';
$categoriaImovel = 'Padrão';
}
if ($campo['tipo'] == 'Rural') {
$tipoimovel = 'Casa';
}
if (($campo['tipo'] == 'Rural') && ($campo['subtipoimovel'] == 'Chácara')) {
$tipoimovel = 'Chácara';
$subtipoimovel = 'Chácara Rural';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Rural') && ($campo['subtipoimovel'] == 'Chácara em condomínio')) {
$tipoimovel = 'Chácara';
$subtipoimovel = 'Chácara Rural';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Rural') && ($campo['subtipoimovel'] == 'Fazenda')) {
$tipoimovel = 'Terreno';
$subtipoimovel = 'Terreno Padrão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Rural') && ($campo['subtipoimovel'] == 'Sítio')) {
$tipoimovel = 'Sítio';
$subtipoimovel = 'Sítio Rural';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Rural') && ($campo['subtipoimovel'] == 'Haras')) {
$tipoimovel = 'Terreno';
$subtipoimovel = 'Terreno Padrão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Rural') && ($campo['subtipoimovel'] == 'Comercial')) {
$tipoimovel = 'Terreno';
$subtipoimovel = 'Terreno Padrão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Rural') && ($campo['subtipoimovel'] == 'Estância')) {
$tipoimovel = 'Terreno';
$subtipoimovel = 'Terreno Padrão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Rural') && ($campo['subtipoimovel'] == 'Lavoura')) {
$tipoimovel = 'Terreno';
$subtipoimovel = 'Terreno Padrão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Rural') && ($campo['subtipoimovel'] == 'Granja')) {
$tipoimovel = 'Terreno';
$subtipoimovel = 'Terreno Padrão';
$categoriaImovel = 'Padrão';
}
if ($campo['tipo'] == 'Terreno') {
$tipoimovel = 'Casa';
}
if (($campo['tipo'] == 'Terreno') && ($campo['subtipoimovel'] == 'Em rua')) {
$tipoimovel = 'Terreno';
$subtipoimovel = 'Terreno Padrão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Terreno') && ($campo['subtipoimovel'] == 'Em condomínio')) {
$tipoimovel = 'Terreno';
$subtipoimovel = 'Loteamento/Condomínio';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Terreno') && ($campo['subtipoimovel'] == 'Em loteamento')) {
$tipoimovel = 'Terreno';
$subtipoimovel = 'Loteamento/Condomínio';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Terreno') && ($campo['subtipoimovel'] == 'Comercial')) {
$tipoimovel = 'Terreno';
$subtipoimovel = 'Terreno Padrão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Terreno') && ($campo['subtipoimovel'] == 'Área industrial')) {
$tipoimovel = 'Terreno';
$subtipoimovel = 'Terreno Padrão';
$categoriaImovel = 'Padrão';
}
if (($campo['tipo'] == 'Terreno') && ($campo['subtipoimovel'] == 'Para empreendimento')) {
$tipoimovel = 'Terreno';
$subtipoimovel = 'Terreno Padrão';
$categoriaImovel = 'Padrão';
}
$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("CategoriaImovel");
$imovel->appendChild($Category);
$CategoryValue = $dom->createTextNode($categoriaImovel);
$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("Endereco");
$imovel->appendChild($Category);
$CategoryValue = $dom->createTextNode($campo['cep_logradouro']);
$Category->appendChild($CategoryValue);
$Category = $dom->createElement("Numero");
$imovel->appendChild($Category);
$CategoryValue = $dom->createTextNode($campo['cep_numero']);
$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);
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);
if(($campo['valor_condominio'] != '') && ($campo['valor_condominio'] != '0')){
$precoCondominio = $campo['valor_condominio'];
}else{
$precoCondominio = '1';
}
$Category = $dom->createElement("PrecoCondominio");
$imovel->appendChild($Category);
$CategoryValue = $dom->createTextNode($precoCondominio);
$Category->appendChild($CategoryValue);
$Category = $dom->createElement("QtdVagas");
$imovel->appendChild($Category);
$CategoryValue = $dom->createTextNode($campo['garagem']);
$Category->appendChild($CategoryValue);
$Category = $dom->createElement("AreaUtil");
$imovel->appendChild($Category);
$CategoryValue = $dom->createTextNode($campo['areautil']);
$Category->appendChild($CategoryValue);
$Category = $dom->createElement("QtdDormitorios");
$imovel->appendChild($Category);
$CategoryValue = $dom->createTextNode($campo['dormitorio']);
$Category->appendChild($CategoryValue);
$Category = $dom->createElement("Observacao");
$imovel->appendChild($Category);
$CategoryValue = $dom->createTextNode($campo['descricaodoimovel']);
$Category->appendChild($CategoryValue);
//FIM Bloco 05
//Bloco 06 (Precisa passar o caminho completo do vídeo no Youtube fiz uma gambiarra mas é preciso corrigir)
$fotoss = unserialize($campo['fotos']);
$pictures = $dom->createElement("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);
}
if ($campo['video'] != '') {
$video = $dom->createElement("Videos");
$imovel->appendChild($video);
$videoitem = $dom->createElement("Video");
$video->appendChild($videoitem);
$videoValue = $dom->createTextNode($campo['video']);
$videoitem ->appendChild($videoValue);
}
$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')) {
$Details = $dom->createElement("Churrasqueira");
$imovel->appendChild($Details);
$detalhenomeValue = $dom->createTextNode($detalhe);
$Details->appendChild($detalhenomeValue);
}
if (($detalhe == 'Piscina') || ($detalhe == 'piscina') || ($detalhe == 'Piscina aquecida') || ($detalhe == 'Piscina Coberta') || ($detalhe == 'Piscina Infantil') || ($detalhe == 'Piscina Climatizada')) {
$Details = $dom->createElement("Piscina");
$imovel->appendChild($Details);
$detalhenomeValue = $dom->createTextNode($detalhe);
$Details->appendChild($detalhenomeValue);
}
if (($detalhe == 'Ar Condicionado') || ($detalhe == 'ar condicionado') || ($detalhe == 'Ar condicionado')) {
$Details = $dom->createElement("ArCondicionado");
$imovel->appendChild($Details);
$detalhenomeValue = $dom->createTextNode($detalhe);
$Details->appendChild($detalhenomeValue);
}
if (($detalhe == 'Área de Serviço')) {
$Details = $dom->createElement("AreaServico");
$imovel->appendChild($Details);
$detalhenomeValue = $dom->createTextNode($detalhe);
$Details->appendChild($detalhenomeValue);
}
if (($detalhe == 'Guarita') || ($detalhe == 'Condomínio fechado')) {
$Details = $dom->createElement("Porteiro");
$imovel->appendChild($Details);
$detalhenomeValue = $dom->createTextNode($detalhe);
$Details->appendChild($detalhenomeValue);
}
if (($detalhe == 'Varanda gourmet') || ($detalhe == 'Espaço Gourmet') || ($detalhe == 'Varanda')) {
$Details = $dom->createElement("Varanda");
$imovel->appendChild($Details);
$detalhenomeValue = $dom->createTextNode($detalhe);
$Details->appendChild($detalhenomeValue);
}
if (($detalhe == 'Academia')) {
$Details = $dom->createElement("SalaGinastica");
$imovel->appendChild($Details);
$detalhenomeValue = $dom->createTextNode($detalhe);
$Details->appendChild($detalhenomeValue);
}
if (($detalhe == 'Salão de Festas')) {
$Details = $dom->createElement("SalaoFestas");
$imovel->appendChild($Details);
$detalhenomeValue = $dom->createTextNode($detalhe);
$Details->appendChild($detalhenomeValue);
}
if (($detalhe == 'Armário Embutido')) {
$Details = $dom->createElement("ArmarioEmbutido");
$imovel->appendChild($Details);
$detalhenomeValue = $dom->createTextNode($detalhe);
$Details->appendChild($detalhenomeValue);
}
if (($detalhe == 'Quarto da Empregada')) {
$Details = $dom->createElement("QuartoWCEmpregada");
$imovel->appendChild($Details);
$detalhenomeValue = $dom->createTextNode($detalhe);
$Details->appendChild($detalhenomeValue);
}
}
}
//FIM BLOCO 17 (PROBLEMA)
/////////////////////////////////////////////////////////////////////////// desapega - FIM
}
}else{
if($campo['cod_referencia'] == ''){
$imovel_invalido_storia .= 'Código de Referência'.'%';
}
if($campo['tipo'] == ''){
$imovel_invalido_storia .= 'Tipo do Imóvel'.'%';
}
if($campo['dormitorio'] == ''){
$imovel_invalido_storia .= 'Dormitório'.'%';
}
if($campo['subtipoimovel'] == ''){
$imovel_invalido_storia .= 'Subtipo do Imóvel'.'%';
}
if($campo['valor'] == ''){
$imovel_invalido_storia .= 'Valor do Imóvel'.'%';
}
if($campo['cep_estado'] == null){
$imovel_invalido_storia .= 'CEP'.'%';
}
if($campo['cep_cidade'] == null){
$imovel_invalido_storia .= 'Cidade'.'%';
}
if($campo['cep_bairro'] == null){
$imovel_invalido_storia .= 'Bairro'.'%';
}
if($campo['areautil'] == ''){
$imovel_invalido_storia .= 'Área Útil'.'%';
}
if($campo['status'] != '0'){
$imovel_invalido_storia .= 'Status do Imóvel: Arquivado'.'%';
}
}
if(($validar == '1') || ($imovelvalido == 'nao')){
$cod_referencia_pendente_storiaimoveis .= '-' .$campo['id_imovel'];
}
}
if($imovel_invalido_storia != ''){
$imovel_invalido_id_storia .= $campo['id_imovel'].'%'.$imovel_invalido_storia.'//';
}
}
$get_integracoes = $this->acaoglobal(array('integracoes', 'id'), 'get', 15);
// $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_storiaimoveis,
'pendencias' => $imovel_invalido_id_zap,
'id' => '15'
)
);
$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'] . "/storiaimoveis.xml");
// save tree to string
$order = $dom->save(ABSPATH . "/subdominios/" . $_SESSION['userdata']['contratante'] . "/storiaimoveis.xml");
$file = ABSPATH . "/subdominios/" . $_SESSION['userdata']['contratante'] . "/storiaimoveis.xml";
// set up basic connection
$conn_id = ftp_connect($serv_info['ip_server']);
$dir = 'public_html/integracoes';
$remote_file = $dir.'/storiaimoveis.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);
?>