Para más información, contacte en reservations@villasholidayscostablanca.com
$uri = parse_url($_SERVER['REQUEST_URI']);
parse_str($uri['query'], $params);
$page = ($params['page']) ? $params['page'] : 1;
$limit = 12;
$start = ($page - 1) * $limit;
$total = count($data);
$totalPages = ceil($total / $limit);
$startPages = $page - 2;
$endPages = $page + 2;
if ($startPages <= 0) {
$startPages = 1;
$endPages = $page + 4;
}
if ($endPages > $totalPages) {
$endPages = $totalPages;
if ($startPages > 1) {
$startPages = $endPages - 4;
}
}
if ($endPages < $totalPages && $totalPages > 5 && $endPages < 5) {
$endPages = 5;
}
if ($page == $totalPages && ($page - 4 > 0 )) {
$startPages = $page - 4;
}
$previousPage = ($page > 1) ? "" : "";
$nextPage = ($page < $totalPages) ? "" : "";
$data = array_slice($data, $start, $limit);
?>
$cont = 0;
foreach ($data as $ofertaEspecial):
$cont++;
$discountAmount = $ofertaEspecial['discount']['amount'];
$discountType = $ofertaEspecial['discount']['type'];
$lastMinute = $ofertaEspecial['discount']['lastMinute'];?>
-
if (!is_null($ofertaEspecial['title'])) { ?>
- echo $ofertaEspecial['title']; ?>
} else { ?>
- echo $ofertaEspecial['name']; ?>
- echo $ofertaEspecial['locality']; ?>
} ?>
echo $ofertaEspecial['basePriceText']['precio'] . $ofertaEspecial['basePriceText']['desde'] . $ofertaEspecial['basePrice'] . " " . $ofertaEspecial['basePriceText']['noche'] ; ?>
- echo $ofertaEspecial['capacity']; ?>
if($ofertaEspecial['bedrooms'] || $ofertaEspecial['bedrooms'] !== 0) { ?>
- echo $ofertaEspecial['bedrooms']; ?>
} ?>
if (!$lastMinute) { ?>
- echo " " . $ofertaEspecial['discount']['i18n']['i18nValidOffer'] . " " . $ofertaEspecial['discount']['startDate'] . " | " . $ofertaEspecial['discount']['endDate']; ?>
} ?>
if ($discountType && ($discountAmount != null)) { ?>
echo ($lastMinute) ? $ofertaEspecial['discount']['i18n']['i18nLastMinute'] : $ofertaEspecial['discount']['i18n']['i18nAplicarDescuento']; ?>
if ($discountType == 'DAYS') { ?>
echo $discountAmount . ' ' . $ofertaEspecial['discount']['typeText']; ?>
} ?>
if ($discountType == 'PERCENTAGE') { ?>
=$ofertaEspecial['discount']['i18n']['i18nTextoHasta']?> echo $discountAmount . ' %'?>
} ?>
if ($discountType == 'MONEY') { ?>
=$ofertaEspecial['discount']['i18n']['i18nTextoHasta']?> echo $discountAmount; ?>
} ?>
} ?>
endforeach; ?>
=$data[0]['discount']['i18n']['i18nInfoPagination1']?> =$start + 1?> - =$start + count($data)?> =$data[0]['discount']['i18n']['i18nInfoPagination2']?> =$total?> =$data[0]['discount']['i18n']['i18nInfoPagination3']?>
=$previousPage?>
for ($i = $startPages; $i <= $endPages; $i ++) {
if ($page == $i) { ?>
=$i?>
continue; } ?>
=$i?>
} ?>
=$nextPage?>
Para más información, contacte en reservations@villasholidayscostablanca.com