{% set configAffichage = getConfigAffichage() %}
{% set resultView = {1:'pension-room',2:'pension-combin-room',3:'combin-room-pension',4:'room-pension','pension-room':'pension-room','pension-combin-room':'pension-combin-room','combin-room-pension':'combin-room-pension','room-pension':'room-pension'}[app.request.get('modele',is_mobile() ? configAffichage.HOTEL.BLOC_CHAMBRE_TARIFS_MOBILE : configAffichage.HOTEL.BLOC_CHAMBRE_TARIFS)] %}
{% set onlyHotelPrice = true %}
{% extends 'FrontCommun/base.html.twig' %}
{% block title %}
{% if HotelDetail.referencement.title is defined and HotelDetail.referencement.title != null %}{{ HotelDetail.referencement.title|raw }}{% else %}{{ HotelDetail.Name }}{% endif %}
{% endblock %}
{% block breadcrumb_title %}{{ HotelDetail.Name }}{% endblock %}
{% block stylesheets %}
{{ parent() }}
<link rel="stylesheet" type="text/css" href="{{ asset('assets-commun/css/loading.css') }}"/>
{% if file_exists('assets/css/style-tarifs-chbre.css') %}
<link href="{{ asset('assets/css/style-tarifs-chbre.css') }}" rel="stylesheet" type="text/css"/>
{% else %}
<link href="{{ asset('assets-commun/css/style-tarifs-chbre.css') }}" rel="stylesheet" type="text/css"/>
{% endif %}
{% if file_exists('assets/css/Equipements.css') %}
<link href="{{ asset('assets/css/Equipements.css') }}" rel="stylesheet" type="text/css"/>
{% else %}
<link href="{{ asset('assets-commun/css/Equipements.css') }}" rel="stylesheet" type="text/css"/>
{% endif %}
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin=""/>
<link href="{{ asset('assets-commun/css/choices.min.css') }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('assets-commun/css/slick.css') }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('assets-commun/css/slick-theme.css') }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('assets-commun/css/prettyPhoto.css') }}" rel="stylesheet" type="text/css"/>
{% if configAffichage is defined and configAffichage.HOTEL.DETAILS_BLOC_ALBUMS ==3 %}
<link rel="stylesheet" href='https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.css'>
<link rel="stylesheet" href='https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/carousel/carousel.css'>
<link rel="stylesheet" href='https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/carousel/carousel.thumbs.css'>
{% endif %}
<style>
.example {
display: flex;
flex-direction: column;
}
{% if not is_mobile() %}
.example > .b {
order: 3;
}
.example > .c {
order: 3;
}
.example > .a {
order: 1;
}
.example > .d {
order: 2;
}
.example > .e {
order: 4;
}
{% endif %}
{% if is_mobile() %}
.example > .b {
order: 3;
}
.example > .c {
order: 3;
}
.example > .a {
order: 1;
}
.example > .d {
order: 2;
}
.example > .e {
order: 0;
}
{% endif %}
.card-image-overlay {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: 1rem;
border-radius: calc(.25rem - 1px)
}
.localisation #map, .localisation #maph {
width: 100%;
min-height: 350px
}
</style>
<script type="application/ld+json">
{
"telephone" : "{{ getAgence().tel1 }}",
"@context" : "http://schema.org",
"@id": "{{ app.request.uri }}",
"brand": {
"@type": "Brand",
"name": "{{ agence.nom }}"
},
{% if HotelDetail.ShortDescription is defined %}
"description" : "{{ HotelDetail.ShortDescription }}",
{% endif %}
"hasMap" : "https://www.google.com/maps/dir/?api=1&origin=&destination={{ agence.latitude }}
,{{ agence.longitude }}",
"address" : {
"addressRegion" : "{{ HotelDetail.City.Name }}",
"addressCountry" : "{{ HotelDetail.City.Country is defined ? HotelDetail.City.Country : '' }}",
"@type" : "PostalAddress",
"addressLocality" : "{{ agence.adresse }}"
},
{#"priceRange" : "Prix disponible dès {{ HotelDetail.min_price.price }} {{ app.session.get('devise',{'symbole':'DT'})['symbole'] }}",#}
"@type" : "Hotel",
"name" : "{{ HotelDetail.Name }}",
{% if HotelDetail.Image is defined %}
"image" : "{{ HotelDetail.Image }}",
{% endif %}
"url" : "{{ app.request.uri }}"
}
</script>
{% endblock %}
{% block meta_keywords %}
{% if HotelDetail.referencement.metaKeywords is defined and HotelDetail.referencement.metaKeywords != null %}
<meta name="keywords" content="{{ HotelDetail.referencement.metaKeywords|raw }}">
{% endif %}
{% endblock %}
{% block meta_description %}
{% if HotelDetail.referencement.metaDescription is defined and HotelDetail.referencement.metaDescription != null %}
<meta name="description" content="{{ HotelDetail.referencement.metaDescription|raw }}">
{% endif %}
{% endblock %}
{% block injection_head %}
{% if HotelDetail.referencement.injectionHeader is defined and HotelDetail.referencement.injectionHeader != null %}
{{ HotelDetail.referencement.injectionHeader|raw }}
{% endif %}
{% block metas %}
<meta property="og:locale" content="fr_FR"/>
<meta property="og:type" content="article"/>
<meta property="og:title" content="{{ HotelDetail.Name }}"/>
{% if HotelDetail.ShortDescription is defined %}
<meta property="og:description" content="{{ HotelDetail.ShortDescription }}"/>
{% endif %}
<meta property="og:url" content="{{ app.request.uri }}"/>
<meta property="og:site_name" content="{{ agence.nom }}"/>
{% if HotelDetail.Image is defined %}
<meta property="og:image" content="{{ HotelDetail.Image }}"/>
{% endif %}
{% endblock %}
{% endblock %}
{% block body %}
{% block injection_body %}
{% if HotelDetail.referencement.injectionBody is defined and HotelDetail.referencement.injectionBody != null %}
{{ HotelDetail.referencement.injectionBody|raw }}
{% endif %}
{% endblock %}
{# {% include checkCustomTemplate("SejourHotel/details-hotel-content.html.twig") %}#}
{% if app.request.get('product') =="appartement" %}
{% include checkCustomTemplate("SejourAppartement/details-hotel-content.html.twig") %}
{% else %}
{% include checkCustomTemplate("SejourHotel/details-hotel-content.html.twig") %}
{% endif %}
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script type="text/javascript" src="{{ asset('assets-commun/js/loadingoverlay.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets-commun/js/calendar.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets-commun/js/Equipements.js') }}"></script>
<script src="{{ asset('assets-commun/js/vuejs-component/vue-paginate.js') }}"></script>
<script src="{{ asset('assets-commun/js/vuejs-component/axios.min.js') }}"></script>
{% if configAffichage is defined and configAffichage.HOTEL.DETAILS_BLOC_ALBUMS ==3 %}
<script src='https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.umd.js'></script>
<script src='https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/carousel/carousel.umd.js'></script>
<script src='https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/carousel/carousel.thumbs.umd.js'></script>
<script>
const container = document.getElementById("myCarousel");
const options = {
Dots: false,
Thumbs: {
type: 'classic',
},
};
new Carousel(container, options, {Thumbs});
Fancybox.bind("[data-fancybox]", {
// Your custom options
});
</script>
{% endif %}
{% include checkCustomTemplate('vuejs-advanced-search.html.twig') with { produit:'SHE', onlySearchCity:'0', destination:{type:'h', id:id, name:''} } %}
{% include 'FrontCommun/SejourHotel/availability/vuejs-list-hotels.html.twig' %}
<script>
var name_hotel = "{{ HotelDetail.Name }}"
/**/
if ($("#vjs-etiquette").length == 1)
var vjsEtiquette = new Vue({
el: "#vjs-etiquette",
data: {
etiquettes: [],
etiquettesEmplacement: [],
etiquettesSaison: []
}
})
/**/
if ($("#vjs-min-price1").length == 1)
var vjsMinPrice = new Vue({
el: "#vjs-min-price1",
data: {
min_arrangement: [],
Recap: ''
},
computed: {
minPrix: function () {
return parseFloat(this.min_arrangement.min_prices).formatMoney(3, ',', ' ')
},
minPrixSingle: function () {
return (parseFloat(this.min_arrangement.min_prices) / 2).formatMoney(3, ',', ' ')
},
minBasePrixSingle: function () {
return (parseFloat(this.min_arrangement.price) / 2).formatMoney(3, ',', ' ')
}
}
})
if ($("#vjs-min-price2").length == 1)
var vjsMinPrice2 = new Vue({
el: "#vjs-min-price2",
data: {
min_arrangement: [],
Recap: ''
},
computed: {
minPrix: function () {
return parseFloat(this.min_arrangement.min_prices).formatMoney(3, ',', ' ')
}
}
})
vjsAdvancedSearchSHE.callAvailabilitySHE()
$(".more").hide();
$(".button-read-less").hide();
$('.button-read-more').click(function () {
$(this).closest('.less').removeClass('active');
$(this).closest(".less").prev().stop(true).slideDown("1000");
$(".summary").hide();
$(".more").show();
$(".button-read-more").hide();
$(".button-read-less").show();
return false;
});
$('.button-read-less').click(function () {
$(this).closest('.less').addClass('active');
$(this).closest(".less").prev().stop(true).slideUp("1000");
$(".summary").show();
$(".button-read-less").hide();
$(".button-read-more").show();
return false;
});
$(document).ready(function () {
// calendar panel
var cal = new Calendar();
var unavailable_days = [];
var price_arr = new Object();
var retrocession = [];
var current_date = new Date();
var current_year_month = (1900 + current_date.getYear()) + "-" + (current_date.getMonth() + 1);
$("#select-month").find("[value='" + current_year_month + "']").prop("selected", "selected");
cal.generateHTML(current_date.getMonth(), (1900 + current_date.getYear()), unavailable_days, price_arr);
$(".calendar").html(cal.getHTML());
$('.loadingcalendar').prop("hidden", false);
$("#select-month").change(function () {
var unavailable_days = [];
var price_arr = new Object();
var surdemande = [];
var selected_year_month = $("#select-month option:selected").val();
var year = parseInt(selected_year_month.split("-")[0], 10);
var month = parseInt(selected_year_month.split("-")[1], 10);
$('.loadingcalendar').prop("hidden", false);
$.ajax({
url: $("#select-month").find(':selected').data('href') + "?date=" + $("#select-month").val(),
type: "GET",
beforeSend: function () {
$('.calendar').LoadingOverlay("show", {
image: "",
fontawesome: "fa fa-spinner fa-spin"
});
},
success: function (response) {
var data = JSON.parse(JSON.stringify(response));
$.each(data.tarifjour, function (index, element) {
price_arr[parseInt(element.jour.split("-")[2], 10)] = "À partir de " + element.tarifMin + " <sup>{{ app.session.get('devise')['symbole'] }}</sup> <br>En " + element.codeArr;
surdemande[parseInt(element.jour.split("-")[2], 10)] = element.surDemande;
if (element.stopSales)
unavailable_days.push(parseInt(element.jour.split("-")[2], 10))
})
/*$.each(data.stopsales, function (index, element) {
unavailable_days.push(parseInt(element.jour.split("-")[2], 10))
})*/
cal.generateHTML(month - 1, year, unavailable_days, price_arr, surdemande);
$(".calendar").html(cal.getHTML());
$('.loadingcalendar').prop("hidden", true);
},
error: function () {
$('.loadingcalendar').prop("hidden", true);
},
complete: function () {
$('.calendar').LoadingOverlay("hide", true);
}
});
});
$("#select-month").change();
});
</script>
<script>
function setRecap() {
$('#recap-checkin').html(vjsAdvancedSearchSHE.checkin_fr)
$('#recap-nuitees').html(vjsAdvancedSearchSHE.nuitees + ' nuitées')
$('#recap-occupations').html(vjsAdvancedSearchSHE.recap_occupations)
}
$("#search").click(function () {
$("#result").show();
$("#filtre").hide();
setRecap()
});
$(document).on('click', '#edit-search', function () {
$("#result").hide();
$("#filtre").show();
});
setRecap();
if ($("#vjs-recap-result").length == 1)
var vjsRecapResult = new Vue({
el: "#vjs-recap-result",
data: {
checkinDate: window.checkin,
nbrNuitees: window.nuitees,
occupations: vjsAdvancedSearchSHE.recap_occupations,
destination: '',
coupon: {
code: '',
reduction: 0,
amount: 0,
montant: (0).formatMoney(3, ',', ' ')
},
result: {
Total: 0, // Initialiser Total pour garantir la réactivité
TotalPurchase: 0, // Initialiser d'autres propriétés si nécessaire
hotel: null
}
},
computed: {
checkin: function () {
// Method 2: Simple string manipulation (if input is always YYYY-MM-DD)
const inputDate = this.checkinDate;
const [year, month, day] = inputDate.split('-');
return `${day}/${month}/${year}`;
},
checkout: function () {
// Method 1: Using Date object
const date = (new Date(this.checkinDate)).addDays(this.nbrNuitees);
return `${date.getDate().toString().padStart(2, '0')}/${(date.getMonth() + 1).toString().padStart(2, '0')}/${date.getFullYear()}`;
},
nuitees: function () {
return this.nbrNuitees;
},
total: function () {
return (parseFloat(this.result.Total) - parseFloat(this.coupon.amount)).formatMoney(3, ',', ' ');
}
},
methods: {
tarifDispo: function () {
$(`#tarifDispo${this.result.hotel}`).click()
},
verifCoupon() {
this.coupon.reduction = ''
this.coupon.amount = 0
this.coupon.montant = (0).formatMoney(3, ',', ' ')
if (this.coupon.code == "")
return;
$("i#load-coupon").removeClass("hidden")
$.get(Routing.generate('verif_couponreduction', {
produit: 'SHT',
achat: this.result.TotalPurchase,
vente: this.result.Total,
nuitees: vjsAdvancedSearchSHE.nuitees,
checkin: vjsAdvancedSearchSHE.checkin_en,
hotel: this.result.hotel,
code: encodeURIComponent(this.coupon.code)
}), function (data) {
if (data.error !== undefined)
viewAlert(data.error, "danger")
//viewAlert(`Code coupon <b class="text-danger">${vjsRecapResult.coupon.code}</b> invalid`, "danger")
else if (data.reduction !== undefined) {
vjsRecapResult.coupon.montant = parseFloat(data.reduction).formatMoney(3, ',', ' ')
vjsRecapResult.coupon.amount = data.reduction
if (data.type == "sur-total" && data.valeurPour)
vjsRecapResult.coupon.reduction = '(-' + (data.valeurPour ? data.valeur + '%' : (parseFloat(data.valeur).formatMoney(3, ',', ' ') + ' {{ deviseSelected().symbole }}')) + ')'
}
$("i#load-coupon").addClass("hidden")
});
},
},
watch: {
'coupon.code': function (newCode, oldCode) {
if (newCode !== oldCode) {
this.coupon.reduction = ''
this.coupon.amount = 0
this.coupon.montant = (0).formatMoney(3, ',', ' ')
}
},// Surveiller directement les dépendances de total
'result.Total': {
handler(newTotal, oldTotal) {
if (newTotal !== oldTotal && this.coupon.amount > 0) {
this.verifCoupon();
}
},
deep: true // Activer la surveillance profonde si result est un objet complexe
}
},
mounted() {
this.verifCoupon()
window.addEventListener("getResponseAvailHotel", () => {
this.coupon.code = ""
window.code_coupon = ""
this.verifCoupon()
});
window.addEventListener("checkinUpdated", () => {
this.checkinDate = window.checkin; // Mise à jour réactive
});
window.addEventListener("nuiteesUpdated", () => {
this.nbrNuitees = window.nuitees; // Mise à jour réactive
});
}
})
</script>
{# <script defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAZWB8_k7_O-60IwFqsGCPELoclcweZh1Q&callback=initializeMap"></script>#}
{% if HotelDetail.Localization is defined and HotelDetail.Localization.Longitude is not null and HotelDetail.Localization.Latitude %}
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
<script>
var mymap = L.map('maph').setView([{{ HotelDetail.Localization.Longitude }},{{ HotelDetail.Localization.Latitude }}], 10);
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(mymap);
var marker = L.marker([{{ HotelDetail.Localization.Longitude }},{{ HotelDetail.Localization.Latitude }}],
{
title: {% if HotelDetail.Name is defined and HotelDetail.Name is not null %}"{{ HotelDetail.Name }}" {% endif %}
}).addTo(mymap)
</script>
{% endif %}
{% endblock %}