| 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/front/tema01/model/ |
Upload File : |
<?php
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);
}
$imob_load = $banco_geral->query('SELECT * FROM paginas where id > 2 and id < 8');
$imov_pag = $imob_load->fetchAll(PDO::FETCH_ASSOC);
$imob_load = $banco_geral->query('SELECT DISTINCT cep_cidade, cep_estado FROM imoveis order by cep_cidade asc');
$imov_cep_cidade = $imob_load->fetchAll(PDO::FETCH_ASSOC);
$imob_load = $banco_geral->query('SELECT DISTINCT cep_cidade, cep_bairro FROM imoveis order by cep_bairro asc');
$imov_cep_bairro = $imob_load->fetchAll(PDO::FETCH_ASSOC);
$imob_load = $banco_geral->query('SELECT DISTINCT cep_cidade, cep_bairro FROM imoveis order by cep_bairro asc');
$imov_cepbairro = $imob_load->fetchAll(PDO::FETCH_ASSOC);
$imob_load = $banco_geral->query('SELECT sis_numero_imoveispaginas FROM configuracoes');
$total_imovel_pag = $imob_load->fetch(PDO::FETCH_ASSOC)['sis_numero_imoveispaginas'];
$_GET['controller'] = "Imóveis";
?>