date_default_timezone_set('America/Argentina/Buenos_Aires'); function fecha_gira($fecha) { if (strpos($fecha, '-')) { $array_fecha = explode('-',$fecha); return $array_fecha[2].'-'.$array_fecha[1].'-'.$array_fecha[0]; } else return ''; } $year_en_curso=(int) date("Y"); $mes_en_curso=(int) date("m"); if ($mes_en_curso<3 || $mes_en_curso>=9) { if ($mes_en_curso>=9 && $mes_en_curso<=12) { $auxanio=$year_en_curso; } else if ($mes_en_curso>=1 && $mes_en_curso<=3) { $auxanio=$year_en_curso-1; } $auxanio2 = (int) $auxanio+1; $array_fechaingreso = array("Ingreso","01-12-".$auxanio, "08-12-".$auxanio, "16-12-".$auxanio, "24-12-".$auxanio, "01-01-".$auxanio2, "09-01-".$auxanio2, "16-01-".$auxanio2, "24-01-".$auxanio2, "01-02-".$auxanio2,"08-02-".$auxanio2, "15-02-".$auxanio2, "22-02-".$auxanio2, "01-03-".$auxanio2, "08-03-".$auxanio2, "16-03-".$auxanio2, "24-03-".$auxanio2); $array_fechasalida = array("Salida","08-12-".$auxanio, "15-12-".$auxanio, "23-12-".$auxanio, "31-12-".$auxanio, "08-01-".$auxanio2, "16-01-".$auxanio2, "23-01-".$auxanio2, "31-01-".$auxanio2, "08-02-".$auxanio2, "15-02-".$auxanio2, "22-02-".$auxanio2, "01-03-".$auxanio2, "08-03-".$auxanio2, "15-03-".$auxanio2, "24-03-".$auxanio2, "31-03-".$auxanio2); for($i=1; $i<$tamano; $i++) { if (strtotime($array_fechaingreso[$i]) <= strtotime(date("Y-m-d"))) { array_splice($array_fechaingreso, $i, 1); array_splice($array_fechasalida, $i, 1); $i=$i-1; $tamano=$tamano-1; } } } $array_ambientes = array("Ambientes: Todos","1 ambiente", "2 ambientes", "2 amb c/dep.", "3 ambientes", "3 amb c/ dep.", "4 ambientes", "+4 ambientes"); $array_orientacion = array("Todos","Externo", "Contrafrente", "Lateral", "Interno"); // leo variables if (isset($_GET['fingreso'])) $fingreso = $_GET['fingreso']; else $fingreso ="Ingreso"; if (isset($_GET['fsalida'])) $fsalida = $_GET['fsalida']; else $fsalida ="Salida"; if (isset($_GET['ambientes'])) $ambientes = $_GET['ambientes']; else $ambientes =0; if (isset($_GET['orientacion'])) $orientacion = $_GET['orientacion']; else $orientacion =0; if (isset($_GET['unaplaza'])) $unaplaza = $_GET['unaplaza']; else $unaplaza =0; if (isset($_GET['dosplaza'])) $dosplaza = $_GET['dosplaza']; else $dosplaza =0; if (isset($_GET['mar']) && (int) ($_GET['mar'])==1) $mar = ' checked'; else $mar =''; if (isset($_GET['wifi']) && (int) ($_GET['wifi'])==1) $wifi = ' checked'; else $wifi =''; if (isset($_GET['freezer']) && (int) ($_GET['freezer'])==1) $freezer = ' checked'; else $freezer =''; if (isset($_GET['banios']) && (int) ($_GET['banios'])==1) $banios = ' checked'; else $banios =''; if (isset($_GET['cochera']) && (int) ($_GET['cochera'])==1) $cochera = ' checked'; else $cochera =''; if (isset($_GET['cocina']) && (int) ($_GET['cocina'])==1) $cocina = ' checked'; else $cocina =''; if (isset($_GET['balcon']) && (int) ($_GET['balcon'])==1) $balcon = ' checked'; else $balcon =''; if (isset($_GET['mascota']) && (int) ($_GET['mascota'])==1) $mascota = ' checked'; else $mascota =''; if (isset($_GET['led']) && (int) ($_GET['led'])==1) $led = ' checked'; else $led =''; if (isset($_GET['micro']) && (int) ($_GET['micro'])==1) $micro = ' checked'; else $micro =''; ?>