query($sql); if ($query->rowCount() > 0){ setcookie("kazulloidTEMP", $kazulloID, strtotime( '+30 days' ),"/"); setcookie("kazulloid", $authHash, strtotime( '+15 minutes' ),"/"); $_SESSION["kazulloid"] = $authHash; $_SESSION["idKazulloUser"] = "0"; } }else{ $kazulloID = (isset($_COOKIE["kazulloidTEMP"])) ? $_COOKIE["kazulloidTEMP"] : $kazulloID; setcookie("kazulloid", $kazulloID, strtotime( '+30 days' ),"/"); $_SESSION["kazulloid"] = $kazulloID; $_SESSION["idKazulloUser"] = "0"; } //Login Session if (!isset($_SESSION["isAuth"])){ $_SESSION["isAuth"] = 0; } $uri = $_SERVER['REQUEST_URI']; $uri = explode("/",$uri); if ($uri[1] == "embed"){ include "embed/index.php"; die(); } if (($uri[1] == "us") || ($uri[1] == "es")){ $m1 = (isset($uri[2])) ? $uri[2] : ""; $m2 = (isset($uri[3])) ? $uri[3] : ""; $m3 = (isset($uri[4])) ? $uri[4] : ""; $m4 = (isset($uri[5])) ? $uri[5] : ""; $m5 = (isset($uri[6])) ? $uri[6] : ""; $m6 = (isset($uri[7])) ? $uri[7] : ""; $m7 = (isset($uri[8])) ? $uri[8] : ""; $m8 = (isset($uri[9])) ? $uri[9] : ""; $m9 = (isset($uri[10])) ? $uri[10] : ""; $lang = $uri[1]; $langDB = strtoupper($uri[1]); $langLink = $lang."/"; switch($lang){ case "us": $langFacebook = "en_US"; $langGoogle = array("en","US"); break; case "es": $langFacebook = "es_LA"; $langGoogle = array("es","LA"); break; } $alternate = $uri; unset ($alternate[0]); unset ($alternate[1]); $alternate = implode("/",$alternate); }else{ $m1 = $uri[1]; $m2 = (isset($uri[2])) ? $uri[2] : ""; $m3 = (isset($uri[3])) ? $uri[3] : ""; $m4 = (isset($uri[4])) ? $uri[4] : ""; $m5 = (isset($uri[5])) ? $uri[5] : ""; $m6 = (isset($uri[6])) ? $uri[6] : ""; $m7 = (isset($uri[7])) ? $uri[7] : ""; $m8 = (isset($uri[8])) ? $uri[8] : ""; $m9 = (isset($uri[9])) ? $uri[9] : ""; $lang = "pt-BR"; $langLink = ""; $langFacebook = "pt_BR"; $langGoogle = array("pt","BR"); $langDB = ""; $alternate = $uri; unset ($alternate[0]); $alternate = implode("/",$alternate); } $_SESSION["langLink"] = $langLink; define("__langLink__",$langLink); define("__sitename__","Kazullo"); define("__siteurl__","kazullo.com.br"); define("__cityname__","Ponta Grossa"); define("__uf__","PR"); ?> */ ?> isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'desktop'); $myLikes = loadMyLikes(); $myAdds = loadMyAdds(); $_SESSION["myLikes"] = $myLikes; $_SESSION["myAdds"] = $myAdds; $error404 = false; $menuType=""; $menuCity=(isset($_COOKIE["kazulloCity"])) ? $_COOKIE["kazulloCity"] : ""; $menuUF=(isset($_COOKIE["kazulloUF"])) ? $_COOKIE["kazulloUF"] : "";; $menuActive=""; if (($m1 == "imoveis") && (is_numeric($m2))){ if (is_numeric($m2)){ $sql = "SELECT * FROM imoveis_imoveis WHERE idEmpresa>=20 and id=".$m2; }else{ $sql = "select * from v_imoveis_buscaSimples where idEmpresa>=20 and slug='".$m2."' limit 1"; } $query = $db->query($sql); if ($query->rowCount() > 0){ $dataI = $query->fetch(); $m3 = explode("?",$m3); if (($m3[0]==1) || ($m3[0]=="")){ $sqlU = "SELECT * FROM imoveis_informacoes WHERE idEmpresa=".$dataI["idEmpresa"]." and idImovel=".$dataI["id"]." and showOnline=1 and idStatus=4"; }else{ $sqlU = "SELECT * FROM imoveis_informacoes WHERE idEmpresa=".$dataI["idEmpresa"]." and codRef='".$dataI["codRef"].".".str_pad($m3[0],3,0,STR_PAD_LEFT)."' and showOnline=1 and idStatus=4"; } $r = $db->query($sqlU); if ($r->rowCount() > 0) { $dataU = $r->fetch(); $menuType=$dataI["tipoNegocio"]; $menuCity=$dataI["cidadeSku"]; $menuUF=checkUF($dataI["uf"],1); $menuActive=$dataI["tipoImovel"]; $menuActive=($menuActive == "sobrado") ? "casa" : $menuActive; $sqlEmpresa = "select * from main_empresas where id='".$dataI["idEmpresa"]."' limit 1"; $queryEmpresa = $db->query($sqlEmpresa); $dataEmpresa = $queryEmpresa->fetch(); $imovelTitle = ucfirst($dataI["tipoImovel"]); $imovelTitle.= ($dataI["tipoNegocio"]=="venda") ? " à venda": "para locação"; $imovelTitle.= ($dataI["idCondominio"]!="0") ? " em Condominio" : ""; $imovelTitle.= " na ".utf8_encode($dataI["endereco"].", ".$dataI["bairro"]." - ".$dataI["cidade"]); $imovelDescription = ($dataI["tipoNegocio"]=="venda") ? "Compre ": "Alugue "; $imovelDescription.= $dataI["tipoImovel"]; $imovelDescription.= ($dataU["dormitorios"]>0) ? ($dataU["dormitorios"]>1) ? ' com '.$dataU["dormitorios"].' quartos' : 'com 1 quarto' : ''; $imovelDescription.= ($dataU["areaPrivativa"]>0) ? ' e '.value_BRL($dataU["areaPrivativa"],0).' m²' : ''; $imovelDescription.= ($dataI["idCondominio"]!="0") ? " em Condominio " : ""; $imovelDescription.= " na ".utf8_encode($dataI["endereco"].", ".$dataI["num"]." - ".$dataI["bairro"]." - ".$dataI["cidade"]." - ".$dataI["uf"]); $imovelDescription.= ". Fale com ".utf8_encode($dataEmpresa["nome"]); if ($dataI["seoPermalink"]!=""){ $seoPermalink = $dataI["seoPermalink"]; }else{ $seolink=""; $seolink.= ucfirst($dataI["tipoImovel"]); $seolink.= ($dataI["idCondominio"]!="0") ? " em Condominio" : ""; $seolink.= ($dataU["dormitorios"]>0) ? ($dataU["dormitorios"]>1) ? " ".$dataU["dormitorios"].' quartos' : ' 1 quarto' : ''; $seolink.= ($dataU["suites"]>0) ? ' com suite' : ''; $seolink.= ($dataU["garagens"]>0) ? ' com garagem' : ''; $seolink.= " ".utf8_encode($dataI["bairro"]." ".$dataI["cidade"]); $seolink.= " ".$dataI["tipoNegocio"]; $seolink.= " ".utf8_encode($dataEmpresa["nome"]); $seoPermalink = permalinkThis($seolink); $sqlU = "update imoveis_imoveis set seoPermalink='".$seoPermalink."' where id=".$dataI["id"]; $db->query($sqlU); } }else{ $error404 = true; } }else{ $error404 = true; } if ($error404 == false){ $cod = explode(".",$dataI["codRef"]); $cod = ($dataI["codRef"] != "") ? $cod[0] : $dataI["idImovel"]; $pathURL = 'https://images.sysone.com.br/'.$dataI["idEmpresa"].'/fotos/imoveis/'.$cod; $imageLink = $pathURL."/hd/".$dataI["fotoPrincipal"]; list($width, $height, $type, $attr) = @getimagesize($imageLink); $fullLink = 'https://'.__siteurl__.'/'.$langLink.$alternate.'/'.$seoPermalink; ?><?=$imovelTitle?> - Kazullo ' : ''; ?> '; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } }elseif (($m2 == "venda") || ($m2 == "locacao")){ $menuType=$m2; $menuCity=$m4; $menuUF=$m3; $menuActive=$m5; }elseif ($m1 != ""){ echo 'Kazullo | '.$lang["slogan"].''; echo ''; }else{ echo 'Kazullo | '.$lang["slogan"].''; echo ''; echo ''; } $menuCity=($menuCity == "") ? "ponta-grossa" : $menuCity; $menuUF=($menuUF == "") ? "parana" : $menuUF; ?> " media="screen">