119 || $yy1 > 118) { if ($xx1 > $yy1) { $chicopor1 = $yy1*118; $division1 = $chicopor1/$xx1; $yy1= $division1; $xx1= 119; } else { $chicopor1 = $xx1*119; $division1 = $chicopor1/$yy1; $xx1= $division1; $yy1= 118; } } else { $yy1= $yy1; $xx1= $xx1; } return $xx1; } function yesg($xx1,$yy1) { if ($xx1 > 119 || $yy1 > 118) { if ($xx1 > $yy1) { $chicopor1 = $yy1*118; $division1 = $chicopor1/$xx1; $yy1= $division1; $xx1= 119; } else { $chicopor1 = $xx1*119; $division1 = $chicopor1/$yy1; $xx1= $division1; $yy1= 118; } } else { $yy1= $yy1; $xx1= $xx1; } return $yy1; } function conectar() { $base_de_datos = "villas"; $db_usuario = "villas"; $db_password = "680107"; //$base_de_datos = "villas"; //$db_usuario = "root"; //$db_password = ""; if (!($link = mysql_connect("localhost", $db_usuario, $db_password))) { echo "Error conectando a la base de datos."; exit(); } if (!mysql_select_db($base_de_datos, $link)) { echo "Error seleccionando la base de datos."; exit(); } return $link; } $db = conectar(); $registros = 15; $pagina = $_GET['pagina']; if (!$pagina) { $inicio = 0; $pagina = 1; } else { $inicio = ($pagina - 1) * $registros; } $squeryo = "SELECT ubicacionv FROM villa where id <> '>zzD' group by ubicacionv order by ubicacionv"; $resultadoso = mysql_query($squeryo); $squeryitinerario = "SELECT * FROM villa where id <> '>zd' "; //echo $squeryitinerario; if ($_GET['destino'] <> "0") {$squeryitinerario = $squeryitinerario." and ubicacion = '".$_GET['destino']."'";} if ($_GET['tipoc'] <> "") {$squeryitinerario = $squeryitinerario." and categoria = '".$_GET['tipoc']."'";} if ($_GET['tipo'] <> "") {$squeryitinerario = $squeryitinerario." and tipo = '".$_GET['tipo']."'";} if ($_GET['vista'] <> "0") {$squeryitinerario = $squeryitinerario." and vista = '".$_GET['vista']."'";} if ($_GET['recamaras'] <> "0") {$squeryitinerario = $squeryitinerario." and recamaras >= '1' and recamaras <= '" .$_GET['recamaras']."'";} if ($_GET['banos'] <> "0") {$squeryitinerario = $squeryitinerario." and ocupacion >= '1' and ocupacion <= '" .$_GET['banos']."'";} if (empty($_GET["tv"])) { $vtv= ""; $vtvc= ""; } else { if ($_GET['tv']=="1") { $vtv= "1"; $vtvc= " checked"; $squeryitinerario = $squeryitinerario." and top_villa='1'"; } } if (empty($_GET["ve"])) { $vve= ""; $vvec= ""; } else { if ($_GET['ve']=="1") { $vve= "1"; $vvec= " checked"; $squeryitinerario = $squeryitinerario." and paraeventos='1'"; } } if (empty($_GET["zona"])) { $vzona= ""; } else { $vzona= $_GET['zona']; $squeryitinerario = $squeryitinerario." and ubicacionv='". $vzona ."'"; } $vany = ""; if (empty($_GET["va"])) { $vva= ""; $vvac= ""; } else { if ($_GET['va']=="1") { $vva= "1"; $vvac= " checked"; $vtv= ""; $vtvc= ""; $vve= ""; $vvec= ""; //$vany = "selected"; $vzona= ""; $squeryitinerario = "SELECT * FROM villa where id <> '>zzD' "; if (empty($_GET["tv"])) {} else { if ($_GET['tv']=="1") { $vtv= "1"; $vtvc= " checked"; $squeryitinerario = $squeryitinerario." and top_villa='1'"; } } if (empty($_GET["ve"])) {} else { if ($_GET['ve']=="1") { $vve= "1"; $vvec= " checked"; $squeryitinerario = $squeryitinerario." and paraeventos='1'"; } } if (empty($_GET["zona"])) { $vzona= ""; } else { $vzona= $_GET['zona']; $squeryitinerario = $squeryitinerario." and ubicacionv='". $vzona ."'"; } } } $orden = " order by recamaras asc"; $qwhere= "" ; //echo $squeryitinerario.$qwhere.$orden; //exit; $resultadositinerario = mysql_query($squeryitinerario.$qwhere.$orden." LIMIT $inicio, $registros"); $resultadositinerario2 = mysql_query($squeryitinerario.$qwhere.$orden); $total_registros = mysql_num_rows($resultadositinerario2); //$total_registros = "3"; $resultados = mysql_query($squeryitinerario.$qwhere.$orden); $total_paginas = ceil($total_registros / $registros); ?>