| 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/cpanel3-skel/public_html/ |
Upload File : |
<?php
//print_r($_SERVER);
$url_atual_consult = $_SERVER[HTTP_HOST];
$iphone = strpos($_SERVER['HTTP_USER_AGENT'], "iPhone");
$ipad = strpos($_SERVER['HTTP_USER_AGENT'], "iPad");
$android = strpos($_SERVER['HTTP_USER_AGENT'], "Android");
$palmpre = strpos($_SERVER['HTTP_USER_AGENT'], "webOS");
$berry = strpos($_SERVER['HTTP_USER_AGENT'], "BlackBerry");
$ipod = strpos($_SERVER['HTTP_USER_AGENT'], "iPod");
$symbian = strpos($_SERVER['HTTP_USER_AGENT'], "Symbian");
if ($iphone || $ipad || $android || $palmpre || $ipod || $berry || $symbian == true) {
$mobile_what = 'api';
} else {
$mobile_what = 'web';
}
function brancoString($string) {
// matriz de entrada
$what = array( '-' );
// matriz de saída
$by = array( ' ' );
// devolver a string
return str_replace($what, $by, $string);
}
function brancoStringCodReferencia($string) {
// matriz de entrada
$what = array( '_-_' );
// matriz de saída
$by = array( ' ' );
// devolver a string
return str_replace($what, $by, $string);
}
//session_start();
$_SESSION['url_atual_consult'];
$caracteres = (strlen($url_atual_consult) - 4);
$rest = substr($url_atual_consult, 0,-$caracteres);
if($rest == 'www.'){
$url_atual_consult = substr($url_atual_consult, 4);
}
$banco_base = 'brgestor'; //connecta com o banco do gestor
$banco_dom = new PDO("mysql:host=localhost;dbname=".$banco_base."_base;charset=utf8", $banco_base.'_base', 'aiBdnE5oLu3M');
$banco_dom->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // <== add this line
$dominio = $url_atual_consult;
$dominio_cliente_load = $banco_dom->query('SELECT * FROM cliente WHERE subdominio = "' . $dominio . '"');
$dominio_dados_cliente = $dominio_cliente_load->fetch(PDO::FETCH_ASSOC);
if(!$dominio_dados_cliente){
$dominio_prod_load = $banco_dom->query('SELECT * FROM produtos WHERE dominio = "' . $dominio . '"');
$dominio_dados_prod = $dominio_prod_load->fetch(PDO::FETCH_ASSOC);
$dominio_cliente_load = $banco_dom->query('SELECT * FROM cliente WHERE user_id = "' . $dominio_dados_prod['id_cliente'] . '"');
$dominio_dados_cliente = $dominio_cliente_load->fetch(PDO::FETCH_ASSOC);
}
$url = $dominio_dados_cliente['subdominio'];
$idsistema = $dominio_dados_cliente['user_id'];
//require_once "config_front.php";
//require_once '../../front/config_front.php';
$base_sis_load = $banco_dom->query('SELECT * FROM gerais WHERE id_gerais = "1"');
$base_sis = $base_sis_load->fetch(PDO::FETCH_ASSOC);
// BUSCA OS DADOS DE CPANEL DO SERVIDOR 2 NO BANCO servidores ( ONDE ATUALMENTE FICA O SISTEMA IMOBILIARIO )
$base_server_load = $banco_dom->query('SELECT * FROM servidores WHERE id_servidores = "2"');
$base_server = $base_server_load->fetch(PDO::FETCH_ASSOC);
// BUSCA OS DADOS DE CPANEL NO BANCO sistemas
$sis_base_load = $banco_dom->query('SELECT * FROM sistemas WHERE id = "1"');
$sis_base = $sis_base_load->fetch(PDO::FETCH_ASSOC);
define( 'ABSPATH', '../'.$sis_base['base'] );
define( 'UP_ABSPATH', ABSPATH . '/views/_uploads' );
define( 'PASTA_BASE', $sis_base['base']);
define( 'HOME_URI', $sis_base['dominio'].'/'.PASTA_BASE.'/' );
define( 'HOSTNAME', 'localhost' );
define( 'DB_NAME', $sis_base['prefixo'].'_'.$idsistema );
define( 'DB_USER', $sis_base['prefixo'].'_msi' );
define( 'DB_PASSWORD', 'UX*9ZHQ+amI,' );
define( 'DB_CHARSET', 'utf8' );
define( 'DEBUG', true );
define( 'DEFAULT_LANGUAGE', 'pt-br');
define( 'BUTTONDISABLE', '1');
$banco_geral = new PDO("mysql:host=localhost;dbname=".$sis_base['prefixo']."_". $idsistema .";charset=utf8", $sis_base['prefixo'].'_msi', 'aiBdnE5oLu3M');
$banco_geral->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // <== add this line
$imob_load = $banco_geral->query('SELECT * FROM imoveis');
$imov_favoritos = $imob_load->fetchAll(PDO::FETCH_ASSOC);
foreach ($imov_favoritos as $fa) {
$au = 'favoritos'.$fa['id_imovel'];
if($fa['id_imovel'] == $_COOKIE[$au]){
$cokie .= '/' . $fa['id_imovel'] ;
$idfavorito++;
}
$i++;
}
//echo $cookie;
//echo 'Sistema de '.$dominio_dados_cliente['usuario'].'<br><br>';
//$home = file_get_contents('http://' . $url);
//echo $home;
//echo $_GET["cep_bairro"];
if(isset($_GET["controller"])){
//echo $_GET["controller"];
if($_GET["controller"] == "faleconosco" ){
$_GET["controller"] = "fale_conosco";
}
if($_GET["controller"] == "finaciamentoimoveis" ){
$_GET["controller"] = "finaciamento_imoveis";
}
if($_GET["controller"] == "encomendeseuimovel" ){
$_GET["controller"] = "encomende_seu_imovel";
}
if($_GET["controller"] == "envieparaumamigo" ){
$_GET["controller"] = "envie_para_um_amigo";
}
if($_GET["controller"] == "falecomcorretor" ){
$_GET["controller"] = "fale_com_corretor";
}
if($_GET["controller"] == "anuncieseuimovel" ){
$_GET["controller"] = "anuncie_seu_imovel";
}
if($_GET["controller"] == "detalhesimovel" ){
$_GET["controller"] = "detalhes_imovel";
}
if(($_GET["controller"] == "home" ) || ($_GET["controller"] == "quemsomos")
|| ($_GET["controller"] == "encomende_seu_imovel") || ($_GET["controller"] == "fale_conosco")
|| ($_GET["controller"] == "anuncie_seu_imovel") || ($_GET["controller"] == "finaciamento_imoveis") || ($_GET["controller"] == "contact")){
$mobile_what;
$home = file_get_contents('https://' . $url .'/index.php?controller=' . $_GET["controller"].'&mobile='.$mobile_what);
echo $home;
}elseif (($_GET["controller"] == 'imoveis' )) {
if($_GET['negocio'] == 'Tipo-de-negocio'){
$_GET['negocio'] = '';
}
if($_GET['subtipoimovel'] == 'Tipo-de-imovel'){
$_GET['subtipoimovel'] = 'null';
}
if($_GET['cep_cidade'] == 'Cidade'){
$_GET['cep_cidade'] = '';
}
if(($_GET['cep_bairro'] == 'Bairro') || ($_GET['cep_bairro'] == 'Selecione a cidade')){
$_GET['cep_bairro'] = '';
}
if($_GET['cod_referencia'] == 'Codigo'){
$_GET['cod_referencia'] = '';
}
$minimo = explode('_',$_GET['valor_minimo']);
$_GET['valor_minimo'] = $minimo[0];
$_GET['area_minima'] = $minimo[1];
if($_GET['valor_minimo'] == 'Minimo'){
$_GET['valor_minimo'] = '';
}
$maximo = explode('_',$_GET['valor_maximo']);
$_GET['valor_maximo'] = $maximo[0];
$_GET['area_maximo'] = $maximo[1];
if($_GET['valor_maximo'] == 'Maximo'){
$_GET['valor_maximo'] = '';
}
$quartos_garagem_busca = explode('-',$_GET['quartos_garagem']);
$_GET['quartos'] = $quartos_garagem_busca[0];
$_GET['garagem'] = $quartos_garagem_busca[1];
$_GET['banheiro'] = $quartos_garagem_busca[2];
$negocio = $_GET['negocio'];
$tipoimovel = $_GET['tipo'];
$tipoimovel_pag = $_GET['tipo'];
$subtipoimovel = $_GET['subtipoimovel'];
$subtipoimovel_pag = $_GET['subtipoimovel'];
$cep_cidade = $_GET['cep_cidade'];
$cep_bairro = $_GET['cep_bairro'];
$cep_bairro_pag = $_GET['cep_bairro'];
$cod_referencia = $_GET['cod_referencia'];
$valor_minimo = $_GET['valor_minimo'];
$valor_maximo = $_GET['valor_maximo'];
$garagem_busca = $_GET['garagem'];
$quartos_busca = $_GET['garagem'];
if($garagem_busca == 'Garagem'){
$garagem_busca = '';
}
$quartos_busca = $_GET['quartos'];
if($quartos_busca == 'Quartos'){
$quartos_busca = '';
}
$banheiro_busca = $_GET['banheiro'];
if($banheiro_busca == 'Banheiros'){
$banheiro_busca = '';
}
$area_minima_busca = $_GET['area_minima'];
if($area_minima_busca == 'Area-minima'){
$area_minima_busca = '';
}
$area_maximo_busca = $_GET['area_maximo'];
if($area_maximo_busca == 'Area-maxima'){
$area_maximo_busca = '';
}
$session = $_GET['session'];
$cont = $_GET['cont'];
if($subtipoimovel == 'Destaque'){
$destaque = '1';
$subtipoimovel = '';
}else{
$destaque = $_GET['destaque'];
}
$i_imov = $_GET['cookie'];
$id_imoveis = explode('/', $_GET['id']);
$ids_ord = $_GET['id'];
$busca = $_GET['busca'];
if(($ids_ord == '') || ($ids_ord == null)){
if(($subtipoimovel != '') && ($subtipoimovel != 'null') ){
$subtipoimovel = explode(',', $subtipoimovel);
}
// if(($cep_bairro != '') && ($cep_bairro != 'null') ){
// $cep_bairro = explode(',', $cep_bairro);
// }
$cont_start = '0';
$whereCustom = '';
if($destaque == "null"){
$destaque = 0;
}
if($negocio == "null"){
$negocio = 0;
}
if($cep_cidade == "null"){
$cep_cidade = 0;
}
if($cod_referencia == "null"){
$cod_referencia = 0;
}
if($tipoimovel == "null"){
$tipoimovel = 0;
}
if($subtipoimovel == "null"){
$subtipoimovel = 0;
}
if(($garagem_busca == "null") || ($garagem_busca == '')){
$garagem_busca = 0;
}
if(($quartos_busca == "null") || ($quartos_busca == '')){
$quartos_busca = 0;
}
if(($banheiro_busca == "null") || ($banheiro_busca == '')){
$banheiro_busca = 0;
}
if($area_minima_busca == "null"){
$area_minima_busca = 0;
}
if($area_maximo == "null"){
$area_maximo = 0;
}
$cont_start = 0;
if (($subtipoimovel != '') || ($subtipoimovel != 0)) {
if ($cont_start != '0') {
$whereCustom .= ' AND ';
}
$whereCustom .= '(';
$cont_start = 1;
$cont_ids = 0;
foreach ($subtipoimovel as $value) {
$value = explode('_', $value);
$subtipoimovel = brancoString($value[1]);
$tipo = brancoString($value[0]);
if ($cont_ids == 0) {
if($subtipoimovel != ''){
$buscaidmulti .= 'subtipoimovel = "' . $subtipoimovel . '"';
$buscaidmulti .= ' AND ';
}
$buscaidmulti .= 'tipo = "' . $tipo . '"';
}
if ($cont_ids > 0) {
$buscaidmulti .= ' OR ';
if($subtipoimovel != ''){
$buscaidmulti .= 'subtipoimovel = "' . $subtipoimovel . '"';
$buscaidmulti .= ' AND ';
}
$buscaidmulti .= 'tipo = "' . $tipo . '"';
}
$cont_ids++;
}
$whereCustom .= $buscaidmulti;
$whereCustom .= ')';
}
if(($negocio != '') || ($negocio != 0)) {
if ($cont_start != '0') {
$whereCustom .= ' AND ';
}
$cont_start = 1;
$whereCustom .= 'negocio = "' . $negocio . '"';
}
if(($garagem_busca != '') || ($garagem_busca != 0)) {
if ($cont_start != '0') {
$whereCustom .= ' AND ';
}
$cont_start = 1;
$whereCustom .= 'garagem = "' . $garagem_busca . '"';
}
if(($quartos_busca != '') || ($quartos_busca != 0)) {
if ($cont_start != '0') {
$whereCustom .= ' AND ';
}
$cont_start = 1;
$whereCustom .= 'dormitorio = "' . $quartos_busca . '"';
}
if(($banheiro_busca != '') || ($banheiro_busca != 0)) {
if ($cont_start != '0') {
$whereCustom .= ' AND ';
}
$cont_start = 1;
$whereCustom .= 'banheiro = "' . $banheiro_busca . '"';
}
$buscaarea_minima = $area_minima_busca;
$buscaarea_maximo = $area_maximo_busca;
@$buscaarea_minima = str_replace(".", "", @$buscaarea_minima);
@$buscaarea_minima = str_replace(",", "", @$buscaarea_minima);
//@$buscaValorMin = number_format(@$buscaValorMin,2,",", ".");
@$buscaarea_minima = (int)$buscaarea_minima;
@$buscaarea_maximo = str_replace(".", "", @$buscaarea_maximo);
@$buscaarea_maximo = str_replace(",", "", @$buscaarea_maximo);
//@$buscaValorMax = number_format(@$buscaValorMax,2,",", ".");
@$buscaarea_maximo = (int)$buscaarea_maximo;
if (($buscaarea_minima != '') || ($buscaarea_maximo != '')) {
if ($buscaarea_minima == '') {
$buscaarea_minima = 0;
}
if ($buscaarea_maximo == '') {
$buscaarea_maximo = 999999999999999999;
}
$imob_load = $banco_geral->query('SELECT * FROM imoveis');
$imo = $imob_load->fetchAll(PDO::FETCH_ASSOC);
if ($cont_start != '0') {
$whereCustom .= ' AND ';
}
$cont_ids = 0;
$cont_start = 1;
$buscaid = 'id_imovel = ""';
$buscaidmulti = '';
foreach ($imo as $contar_imoveis_verificar) {
$valorpegar = unserialize($contar_imoveis_verificar['areas']);
if($contar_imoveis_verificar['tipo'] == "Apartamento"){
$valorpegar = $valorpegar['areaprivativa'] ;
}elseif ($contar_imoveis_verificar['tipo'] == "Casa") {
$valorpegar = $valorpegar['areatotal'];
}elseif ($contar_imoveis_verificar['tipo'] == "Terreno") {
$valorpegar = $valorpegar['areaterreno'];
}elseif ($contar_imoveis_verificar['tipo'] == "Rural") {
$valorpegar = $valorpegar['areatotal'];
}elseif ($contar_imoveis_verificar['tipo'] == "Comercial") {
$valorpegar = $valorpegar['areatotal'];
}
$valorpegar = str_replace(".", "", $valorpegar );
$valorpegar = str_replace(",", "", $valorpegar );
$valorpegar = (int)$valorpegar ;
if ($cont_ids > 0) {
$buscaidmulti .= ' OR ';
}
if ($buscaarea_minima <= $valorpegar) {
if ($buscaarea_maximo >= $valorpegar) {
$buscaidmulti .= 'id_imovel = "' . $contar_imoveis_verificar['id_imovel'] . '"';
$cont_ids++;
}else{
$buscaidmulti .= 'id_imovel = ""';
$cont_ids++;
}
}else{
$buscaidmulti .= 'id_imovel = ""';
$cont_ids++;
}
}
$whereCustom .= '(';
if ($cont_ids == 0) {
$cont_start = '1';
$whereCustom .= $buscaid;
} else {
$whereCustom .= $buscaidmulti;
}
$whereCustom .= ')';
}
if(($destaque != '') || ($destaque != 0)) {
if ($cont_start != '0') {
$whereCustom .= ' AND ';
}
$cont_start = 1;
$whereCustom .= 'publicacao_destaque = "' . $destaque . '"';
}
if(($tipoimovel != '') || ($tipoimovel != 0)) {
if ($cont_start != '0') {
$whereCustom .= ' AND ';
}
$cont_start = 1;
$whereCustom .= 'tipo = "' . $tipoimovel . '"';
}
if (($cep_cidade != '') || ($cep_cidade != 0)) {
if($cont_start != '0'){
$whereCustom .= ' AND ';
}
$cont_start = 1;
$whereCustom .= 'cep_cidade = "' . brancoString($cep_cidade) . '"';
}
if (($cep_bairro != '')) {
$cep_bairro = explode(',', $cep_bairro);
if($cep_bairro[0] != ''){
if ($cont_start != '0') {
$whereCustom .= ' AND ';
}
// $cont_ids = 0;
// $whereCustom .= 'cep_bairro = "' . $cep_bairro . '"';
$cont_ids = 0;
$cont_start = 1;
$buscaidmulti = '';
foreach ($cep_bairro as $cep_bairros) {
if ($cont_ids > 0) {
$buscaidmulti .= ' OR ';
}
$buscaidmulti .= 'cep_bairro = "' . brancoString($cep_bairros) . '"';
$cont_ids++;
}
$whereCustom .= '(';
$whereCustom .= $buscaidmulti;
$whereCustom .= ')';
}
}
if (($cod_referencia != '') || ($cod_referencia != 0)) {
if($cont_start == 1){
$whereCustom .= ' AND ';
}
$cont_start = 1;
$whereCustom .= 'cod_referencia = "' . brancoStringCodReferencia($cod_referencia) . '"';
}
$buscaValorMin = $valor_minimo;
$buscaValorMax = $valor_maximo;
@$buscaValorMin = str_replace(".", "", @$buscaValorMin);
@$buscaValorMin = str_replace(",", "", @$buscaValorMin);
//@$buscaValorMin = number_format(@$buscaValorMin,2,",", ".");
@$buscaValorMin = (int)$buscaValorMin;
@$buscaValorMax = str_replace(".", "", @$buscaValorMax);
@$buscaValorMax = str_replace(",", "", @$buscaValorMax);
//@$buscaValorMax = number_format(@$buscaValorMax,2,",", ".");
@$buscaValorMax = (int)$buscaValorMax;
if (($valor_minimo != '') || ($valor_maximo != '')) {
if ($buscaValorMin == '') {
$buscaValorMin = 0;
}
if ($buscaValorMax == '') {
$buscaValorMax = 999999999999999999;
}
$imob_load = $banco_geral->query('SELECT * FROM imoveis');
$imo = $imob_load->fetchAll(PDO::FETCH_ASSOC);
if ($cont_start != '0') {
$whereCustom .= ' AND ';
}
$cont_ids = 0;
$cont_start = 1;
$buscaid = 'id_imovel = ""';
$buscaidmulti = '';
foreach ($imo as $contar_imoveis_verificar) {
$valorpegar = $contar_imoveis_verificar['valor'];
$valorpegar = str_replace(".", "", $valorpegar );
$valorpegar = str_replace(",", "", $valorpegar );
$valorpegar = (int)$valorpegar ;
if ($cont_ids > 0) {
$buscaidmulti .= ' OR ';
}
if ($buscaValorMin <= $valorpegar) {
if ($buscaValorMax >= $valorpegar) {
$buscaidmulti .= 'id_imovel = "' . $contar_imoveis_verificar['id_imovel'] . '"';
$cont_ids++;
}else{
$buscaidmulti .= 'id_imovel = ""';
$cont_ids++;
}
}else{
$buscaidmulti .= 'id_imovel = ""';
$cont_ids++;
}
}
$whereCustom .= '(';
if ($cont_ids == 0) {
$cont_start = '1';
$whereCustom .= $buscaid;
} else {
$whereCustom .= $buscaidmulti;
}
$whereCustom .= ')';
}
}else{
$cont_ids = 0;
$cont_start = 1;
$buscaidmulti = '';
foreach ($id_imoveis as $contar_imoveis) {
if ($cont_ids > 0) {
$buscaidmulti .= ' OR ';
}
$buscaidmulti .= 'id_imovel = "' . $contar_imoveis . '"';
$cont_ids++;
}
$whereCustom .= '(';
$whereCustom .= $buscaidmulti;
$whereCustom .= ')';
}
// echo $whereCustom;
if($whereCustom != ''){
$imob_load = $banco_geral->query('SELECT * FROM imoveis WHERE ' . $whereCustom . 'and status = "0" ORDER BY `id_imovel` DESC');
$imov = $imob_load->fetchAll(PDO::FETCH_ASSOC);
$res = count($imov);
}
if($whereCustom != ''){
$imob_load = $banco_geral->query('SELECT * FROM imoveis WHERE ' . $whereCustom . 'and status= "0"');
$imov = $imob_load->fetchAll(PDO::FETCH_ASSOC);
$res = count($imov);
foreach ($imov as $value) {
$imoveis .= '/';
$imoveis .= $value['id_imovel'];
}
}
$home = file_get_contents('https://' . $url .'/index.php?controller=imoveis&id=' . $imoveis.'&mobile='.$mobile_what);
echo $home;
}elseif (($_GET["controller"] == '' )) {
//include_once('controllers/controller_erro.php');
$home = file_get_contents('https://' . $url .'/index.php?controller=controller_erro'.'&mobile='.$mobile_what);
echo $home;
}elseif (($_GET["controller"] == 'ver_mais' )) {
//include_once('controllers/controller_erro.php');
$home = file_get_contents('https://' . $url .'/index.php?controller=ver_mais&negocio=' . $_GET["negocio"] . '&destaque=1'.'&mobile='.$mobile_what);
echo $home;
}elseif (($_GET["controller"] == "detalhes_imovel" )) {
//include_once('controllers/controller_erro.php');
$home = file_get_contents('https://' . $url .'/index.php?controller=detalhes_imovel&negocio=' . $_GET["negocio"].'&mobile='.$mobile_what);
echo $home;
}elseif (($_GET["controller"] == "detalhes_imovel_impressao" )) {
//include_once('controllers/controller_erro.php');
$home = file_get_contents('https://' . $url .'/index.php?controller=detalhes_imovel_impressao&negocio=' . $_GET["negocio"].'&mobile='.$mobile_what);
echo $home;
}elseif (($_GET["controller"] == 'imoveis_favoritos' )) {
//include_once('controllers/controller_erro.php');
/*
$cokie = explode(',', $_GET['cokie']);
for($i = 0; $i < count($cokie); $i++){
$cokie_aux = explode('=', $cokie[$i]);
$cokie_aux[0] = SUBSTR($cokie_aux[0],1,9);
if($cokie_aux[0] == "favoritos"){
$cook .= '/' . $cokie_aux[1];
}
}
*/
$aux = "0";
foreach ($_COOKIE as $key => $value) {
// print($key.' - '.$value.'<br>');
$cokie_aux = explode('s', $key);
if($cokie_aux[0] == "favorito"){
$cook.= '/' . $value;
}
$aux++;
};
//echo $cook;
$home = file_get_contents('https://' . $url .'/index.php?controller=imoveis_favoritos&cokie='.$cook.'&mobile='.$mobile_what);
echo $home;
}else{
//include_once('controllers/controller_novas_paginas.php');
$home = file_get_contents('https://' . $url .'/index.php?controller=' . urlencode($_GET["controller"]).'&mobile='.$mobile_what);
//$home = file_get_contents('https://' . $url .'/index.php?controller=' . $_GET["controller"]);
echo $home;
}
}else{
//include_once('controllers/controller_home.php');
$home = file_get_contents('https://' . $url .'/index.php?mobile='.$mobile_what);
echo $home;
}
?>