templates/FrontCommun/SejourHotel/details-hotel.html.twig line 1

Open in your IDE?
  1. {% set configAffichage = getConfigAffichage() %}
  2.     {% 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)] %}
  3. {% set onlyHotelPrice = true %}
  4. {% extends 'FrontCommun/base.html.twig' %}
  5. {% block title %}
  6.     {% if HotelDetail.referencement.title is defined and HotelDetail.referencement.title != null %}{{ HotelDetail.referencement.title|raw }}{% else %}{{ HotelDetail.Name }}{% endif %}
  7. {% endblock %}
  8. {% block breadcrumb_title %}{{ HotelDetail.Name }}{% endblock %}
  9. {% block stylesheets %}
  10.     {{ parent() }}
  11.     <link rel="stylesheet" type="text/css" href="{{ asset('assets-commun/css/loading.css') }}"/>
  12.     {% if file_exists('assets/css/style-tarifs-chbre.css') %}
  13.         <link href="{{ asset('assets/css/style-tarifs-chbre.css') }}" rel="stylesheet" type="text/css"/>
  14.     {% else %}
  15.         <link href="{{ asset('assets-commun/css/style-tarifs-chbre.css') }}" rel="stylesheet" type="text/css"/>
  16.     {% endif %}
  17.     {% if file_exists('assets/css/Equipements.css') %}
  18.         <link href="{{ asset('assets/css/Equipements.css') }}" rel="stylesheet" type="text/css"/>
  19.     {% else %}
  20.         <link href="{{ asset('assets-commun/css/Equipements.css') }}" rel="stylesheet" type="text/css"/>
  21.     {% endif %}
  22.     <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
  23.           integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin=""/>
  24.     <link href="{{ asset('assets-commun/css/choices.min.css') }}" rel="stylesheet" type="text/css"/>
  25.     <link href="{{ asset('assets-commun/css/slick.css') }}" rel="stylesheet" type="text/css"/>
  26.     <link href="{{ asset('assets-commun/css/slick-theme.css') }}" rel="stylesheet" type="text/css"/>
  27.     <link href="{{ asset('assets-commun/css/prettyPhoto.css') }}" rel="stylesheet" type="text/css"/>
  28.     {% if configAffichage is defined and configAffichage.HOTEL.DETAILS_BLOC_ALBUMS ==3 %}
  29.         <link rel="stylesheet" href='https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.css'>
  30.         <link rel="stylesheet" href='https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/carousel/carousel.css'>
  31.         <link rel="stylesheet" href='https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/carousel/carousel.thumbs.css'>
  32.     {% endif %}
  33.     <style>
  34.         .example {
  35.             display: flex;
  36.             flex-direction: column;
  37.         }
  38.         {% if  not is_mobile() %}
  39.         .example > .b {
  40.             order: 3;
  41.         }
  42.         .example > .c {
  43.             order: 3;
  44.         }
  45.         .example > .a {
  46.             order: 1;
  47.         }
  48.         .example > .d {
  49.             order: 2;
  50.         }
  51.         .example > .e {
  52.             order: 4;
  53.         }
  54.         {% endif %}
  55.         {% if  is_mobile() %}
  56.         .example > .b {
  57.             order: 3;
  58.         }
  59.         .example > .c {
  60.             order: 3;
  61.         }
  62.         .example > .a {
  63.             order: 1;
  64.         }
  65.         .example > .d {
  66.             order: 2;
  67.         }
  68.         .example > .e {
  69.             order: 0;
  70.         }
  71.         {% endif %}
  72.         .card-image-overlay {
  73.             position: absolute;
  74.             top: 0;
  75.             right: 0;
  76.             bottom: 0;
  77.             left: 0;
  78.             padding: 1rem;
  79.             border-radius: calc(.25rem - 1px)
  80.         }
  81.         .localisation #map, .localisation #maph {
  82.             width: 100%;
  83.             min-height: 350px
  84.         }
  85.     </style>
  86.     <script type="application/ld+json">
  87.         {
  88.             "telephone" : "{{ getAgence().tel1 }}",
  89.             "@context" : "http://schema.org",
  90.             "@id": "{{ app.request.uri }}",
  91.             "brand": {
  92.                 "@type": "Brand",
  93.                 "name": "{{ agence.nom }}"
  94.             },
  95.             {% if HotelDetail.ShortDescription is defined %}
  96.             "description" : "{{ HotelDetail.ShortDescription }}",
  97.             {% endif %}
  98.             "hasMap" : "https://www.google.com/maps/dir/?api=1&origin=&destination={{ agence.latitude }}
  99.         ,{{ agence.longitude }}",
  100.             "address" : {
  101.                 "addressRegion" : "{{ HotelDetail.City.Name }}",
  102.                 "addressCountry" : "{{ HotelDetail.City.Country is defined ? HotelDetail.City.Country : '' }}",
  103.                 "@type" : "PostalAddress",
  104.                 "addressLocality" : "{{ agence.adresse }}"
  105.             },
  106.             {#"priceRange" : "Prix disponible dès {{ HotelDetail.min_price.price }} {{ app.session.get('devise',{'symbole':'DT'})['symbole'] }}",#}
  107.             "@type" : "Hotel",
  108.             "name" : "{{ HotelDetail.Name }}",
  109.             {% if HotelDetail.Image is defined %}
  110.             "image" : "{{ HotelDetail.Image }}",
  111.             {% endif %}
  112.             "url" : "{{ app.request.uri }}"
  113.         }
  114.     </script>
  115. {% endblock %}
  116. {% block meta_keywords %}
  117.     {% if HotelDetail.referencement.metaKeywords is defined and HotelDetail.referencement.metaKeywords != null %}
  118.         <meta name="keywords" content="{{ HotelDetail.referencement.metaKeywords|raw }}">
  119.     {% endif %}
  120. {% endblock %}
  121. {% block meta_description %}
  122.     {% if HotelDetail.referencement.metaDescription is defined and HotelDetail.referencement.metaDescription != null %}
  123.         <meta name="description" content="{{ HotelDetail.referencement.metaDescription|raw }}">
  124.     {% endif %}
  125. {% endblock %}
  126. {% block injection_head %}
  127.     {% if HotelDetail.referencement.injectionHeader is defined and HotelDetail.referencement.injectionHeader != null %}
  128.         {{ HotelDetail.referencement.injectionHeader|raw }}
  129.     {% endif %}
  130.     {% block metas %}
  131.         <meta property="og:locale" content="fr_FR"/>
  132.         <meta property="og:type" content="article"/>
  133.         <meta property="og:title" content="{{ HotelDetail.Name }}"/>
  134.         {% if HotelDetail.ShortDescription is defined %}
  135.             <meta property="og:description" content="{{ HotelDetail.ShortDescription }}"/>
  136.         {% endif %}
  137.         <meta property="og:url" content="{{ app.request.uri }}"/>
  138.         <meta property="og:site_name" content="{{ agence.nom }}"/>
  139.         {% if HotelDetail.Image is defined %}
  140.             <meta property="og:image" content="{{ HotelDetail.Image }}"/>
  141.         {% endif %}
  142.     {% endblock %}
  143. {% endblock %}
  144. {% block body %}
  145.     {% block injection_body %}
  146.         {% if HotelDetail.referencement.injectionBody is defined and HotelDetail.referencement.injectionBody != null %}
  147.             {{ HotelDetail.referencement.injectionBody|raw }}
  148.         {% endif %}
  149.     {% endblock %}
  150. {#    {% include checkCustomTemplate("SejourHotel/details-hotel-content.html.twig") %}#}
  151.         {% if app.request.get('product') =="appartement" %}
  152.             {% include checkCustomTemplate("SejourAppartement/details-hotel-content.html.twig") %}
  153.         {% else %}
  154.             {% include checkCustomTemplate("SejourHotel/details-hotel-content.html.twig") %}
  155.         {% endif %}
  156. {% endblock %}
  157. {% block javascripts %}
  158.     {{ parent() }}
  159.     <script type="text/javascript" src="{{ asset('assets-commun/js/loadingoverlay.min.js') }}"></script>
  160.     <script type="text/javascript" src="{{ asset('assets-commun/js/calendar.js') }}"></script>
  161.     <script type="text/javascript" src="{{ asset('assets-commun/js/Equipements.js') }}"></script>
  162.     <script src="{{ asset('assets-commun/js/vuejs-component/vue-paginate.js') }}"></script>
  163.     <script src="{{ asset('assets-commun/js/vuejs-component/axios.min.js') }}"></script>
  164.     {% if configAffichage is defined and configAffichage.HOTEL.DETAILS_BLOC_ALBUMS ==3 %}
  165.         <script src='https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.umd.js'></script>
  166.         <script src='https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/carousel/carousel.umd.js'></script>
  167.         <script src='https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/carousel/carousel.thumbs.umd.js'></script>
  168.         <script>
  169.             const container = document.getElementById("myCarousel");
  170.             const options = {
  171.                 Dots: false,
  172.                 Thumbs: {
  173.                     type: 'classic',
  174.                 },
  175.             };
  176.             new Carousel(container, options, {Thumbs});
  177.             Fancybox.bind("[data-fancybox]", {
  178.                 // Your custom options
  179.             });
  180.         </script>
  181.     {% endif %}
  182.     {% include checkCustomTemplate('vuejs-advanced-search.html.twig') with { produit:'SHE', onlySearchCity:'0', destination:{type:'h', id:id, name:''} } %}
  183.     {% include 'FrontCommun/SejourHotel/availability/vuejs-list-hotels.html.twig' %}
  184.     <script>
  185.         var name_hotel = "{{ HotelDetail.Name }}"
  186.         /**/
  187.         if ($("#vjs-etiquette").length == 1)
  188.             var vjsEtiquette = new Vue({
  189.                 el: "#vjs-etiquette",
  190.                 data: {
  191.                     etiquettes: [],
  192.                     etiquettesEmplacement: [],
  193.                     etiquettesSaison: []
  194.                 }
  195.             })
  196.         /**/
  197.         if ($("#vjs-min-price1").length == 1)
  198.             var vjsMinPrice = new Vue({
  199.                 el: "#vjs-min-price1",
  200.                 data: {
  201.                     min_arrangement: [],
  202.                     Recap: ''
  203.                 },
  204.                 computed: {
  205.                     minPrix: function () {
  206.                         return parseFloat(this.min_arrangement.min_prices).formatMoney(3, ',', ' ')
  207.                     },
  208.                     minPrixSingle: function () {
  209.                         return (parseFloat(this.min_arrangement.min_prices) / 2).formatMoney(3, ',', ' ')
  210.                     },
  211.                     minBasePrixSingle: function () {
  212.                         return (parseFloat(this.min_arrangement.price) / 2).formatMoney(3, ',', ' ')
  213.                     }
  214.                 }
  215.             })
  216.         if ($("#vjs-min-price2").length == 1)
  217.             var vjsMinPrice2 = new Vue({
  218.                 el: "#vjs-min-price2",
  219.                 data: {
  220.                     min_arrangement: [],
  221.                     Recap: ''
  222.                 },
  223.                 computed: {
  224.                     minPrix: function () {
  225.                         return parseFloat(this.min_arrangement.min_prices).formatMoney(3, ',', ' ')
  226.                     }
  227.                 }
  228.             })
  229.         vjsAdvancedSearchSHE.callAvailabilitySHE()
  230.         $(".more").hide();
  231.         $(".button-read-less").hide();
  232.         $('.button-read-more').click(function () {
  233.             $(this).closest('.less').removeClass('active');
  234.             $(this).closest(".less").prev().stop(true).slideDown("1000");
  235.             $(".summary").hide();
  236.             $(".more").show();
  237.             $(".button-read-more").hide();
  238.             $(".button-read-less").show();
  239.             return false;
  240.         });
  241.         $('.button-read-less').click(function () {
  242.             $(this).closest('.less').addClass('active');
  243.             $(this).closest(".less").prev().stop(true).slideUp("1000");
  244.             $(".summary").show();
  245.             $(".button-read-less").hide();
  246.             $(".button-read-more").show();
  247.             return false;
  248.         });
  249.         $(document).ready(function () {
  250.             // calendar panel
  251.             var cal = new Calendar();
  252.             var unavailable_days = [];
  253.             var price_arr = new Object();
  254.             var retrocession = [];
  255.             var current_date = new Date();
  256.             var current_year_month = (1900 + current_date.getYear()) + "-" + (current_date.getMonth() + 1);
  257.             $("#select-month").find("[value='" + current_year_month + "']").prop("selected", "selected");
  258.             cal.generateHTML(current_date.getMonth(), (1900 + current_date.getYear()), unavailable_days, price_arr);
  259.             $(".calendar").html(cal.getHTML());
  260.             $('.loadingcalendar').prop("hidden", false);
  261.             $("#select-month").change(function () {
  262.                 var unavailable_days = [];
  263.                 var price_arr = new Object();
  264.                 var surdemande = [];
  265.                 var selected_year_month = $("#select-month option:selected").val();
  266.                 var year = parseInt(selected_year_month.split("-")[0], 10);
  267.                 var month = parseInt(selected_year_month.split("-")[1], 10);
  268.                 $('.loadingcalendar').prop("hidden", false);
  269.                 $.ajax({
  270.                     url: $("#select-month").find(':selected').data('href') + "?date=" + $("#select-month").val(),
  271.                     type: "GET",
  272.                     beforeSend: function () {
  273.                         $('.calendar').LoadingOverlay("show", {
  274.                             image: "",
  275.                             fontawesome: "fa fa-spinner fa-spin"
  276.                         });
  277.                     },
  278.                     success: function (response) {
  279.                         var data = JSON.parse(JSON.stringify(response));
  280.                         $.each(data.tarifjour, function (index, element) {
  281.                             price_arr[parseInt(element.jour.split("-")[2], 10)] = "À partir de " + element.tarifMin + " <sup>{{ app.session.get('devise')['symbole'] }}</sup> <br>En " + element.codeArr;
  282.                             surdemande[parseInt(element.jour.split("-")[2], 10)] = element.surDemande;
  283.                             if (element.stopSales)
  284.                                 unavailable_days.push(parseInt(element.jour.split("-")[2], 10))
  285.                         })
  286.                         /*$.each(data.stopsales, function (index, element) {
  287.                             unavailable_days.push(parseInt(element.jour.split("-")[2], 10))
  288.                         })*/
  289.                         cal.generateHTML(month - 1, year, unavailable_days, price_arr, surdemande);
  290.                         $(".calendar").html(cal.getHTML());
  291.                         $('.loadingcalendar').prop("hidden", true);
  292.                     },
  293.                     error: function () {
  294.                         $('.loadingcalendar').prop("hidden", true);
  295.                     },
  296.                     complete: function () {
  297.                         $('.calendar').LoadingOverlay("hide", true);
  298.                     }
  299.                 });
  300.             });
  301.             $("#select-month").change();
  302.         });
  303.     </script>
  304.     <script>
  305.         function setRecap() {
  306.             $('#recap-checkin').html(vjsAdvancedSearchSHE.checkin_fr)
  307.             $('#recap-nuitees').html(vjsAdvancedSearchSHE.nuitees + ' nuitées')
  308.             $('#recap-occupations').html(vjsAdvancedSearchSHE.recap_occupations)
  309.         }
  310.         $("#search").click(function () {
  311.             $("#result").show();
  312.             $("#filtre").hide();
  313.             setRecap()
  314.         });
  315.         $(document).on('click', '#edit-search', function () {
  316.             $("#result").hide();
  317.             $("#filtre").show();
  318.         });
  319.         setRecap();
  320.         if ($("#vjs-recap-result").length == 1)
  321.             var vjsRecapResult = new Vue({
  322.                 el: "#vjs-recap-result",
  323.                 data: {
  324.                     checkinDate: window.checkin,
  325.                     nbrNuitees: window.nuitees,
  326.                     occupations: vjsAdvancedSearchSHE.recap_occupations,
  327.                     destination: '',
  328.                     coupon: {
  329.                         code: '',
  330.                         reduction: 0,
  331.                         amount: 0,
  332.                         montant: (0).formatMoney(3, ',', ' ')
  333.                     },
  334.                     result: {
  335.                         Total: 0, // Initialiser Total pour garantir la réactivité
  336.                         TotalPurchase: 0, // Initialiser d'autres propriétés si nécessaire
  337.                         hotel: null
  338.                     }
  339.                 },
  340.                 computed: {
  341.                     checkin: function () {
  342.                         // Method 2: Simple string manipulation (if input is always YYYY-MM-DD)
  343.                         const inputDate = this.checkinDate;
  344.                         const [year, month, day] = inputDate.split('-');
  345.                         return `${day}/${month}/${year}`;
  346.                     },
  347.                     checkout: function () {
  348.                         // Method 1: Using Date object
  349.                         const date = (new Date(this.checkinDate)).addDays(this.nbrNuitees);
  350.                         return `${date.getDate().toString().padStart(2, '0')}/${(date.getMonth() + 1).toString().padStart(2, '0')}/${date.getFullYear()}`;
  351.                     },
  352.                     nuitees: function () {
  353.                         return this.nbrNuitees;
  354.                     },
  355.                     total: function () {
  356.                         return (parseFloat(this.result.Total) - parseFloat(this.coupon.amount)).formatMoney(3, ',', ' ');
  357.                     }
  358.                 },
  359.                 methods: {
  360.                     tarifDispo: function () {
  361.                         $(`#tarifDispo${this.result.hotel}`).click()
  362.                     },
  363.                     verifCoupon() {
  364.                         this.coupon.reduction = ''
  365.                         this.coupon.amount = 0
  366.                         this.coupon.montant = (0).formatMoney(3, ',', ' ')
  367.                         if (this.coupon.code == "")
  368.                             return;
  369.                         $("i#load-coupon").removeClass("hidden")
  370.                         $.get(Routing.generate('verif_couponreduction', {
  371.                             produit: 'SHT',
  372.                             achat: this.result.TotalPurchase,
  373.                             vente: this.result.Total,
  374.                             nuitees: vjsAdvancedSearchSHE.nuitees,
  375.                             checkin: vjsAdvancedSearchSHE.checkin_en,
  376.                             hotel: this.result.hotel,
  377.                             code: encodeURIComponent(this.coupon.code)
  378.                         }), function (data) {
  379.                             if (data.error !== undefined)
  380.                                 viewAlert(data.error, "danger")
  381.                             //viewAlert(`Code coupon <b class="text-danger">${vjsRecapResult.coupon.code}</b> invalid`, "danger")
  382.                             else if (data.reduction !== undefined) {
  383.                                 vjsRecapResult.coupon.montant = parseFloat(data.reduction).formatMoney(3, ',', ' ')
  384.                                 vjsRecapResult.coupon.amount = data.reduction
  385.                                 if (data.type == "sur-total" && data.valeurPour)
  386.                                     vjsRecapResult.coupon.reduction = '(-' + (data.valeurPour ? data.valeur + '%' : (parseFloat(data.valeur).formatMoney(3, ',', ' ') + ' {{ deviseSelected().symbole }}')) + ')'
  387.                             }
  388.                             $("i#load-coupon").addClass("hidden")
  389.                         });
  390.                     },
  391.                 },
  392.                 watch: {
  393.                     'coupon.code': function (newCode, oldCode) {
  394.                         if (newCode !== oldCode) {
  395.                             this.coupon.reduction = ''
  396.                             this.coupon.amount = 0
  397.                             this.coupon.montant = (0).formatMoney(3, ',', ' ')
  398.                         }
  399.                     },// Surveiller directement les dépendances de total
  400.                     'result.Total': {
  401.                         handler(newTotal, oldTotal) {
  402.                             if (newTotal !== oldTotal && this.coupon.amount > 0) {
  403.                                 this.verifCoupon();
  404.                             }
  405.                         },
  406.                         deep: true // Activer la surveillance profonde si result est un objet complexe
  407.                     }
  408.                 },
  409.                 mounted() {
  410.                     this.verifCoupon()
  411.                     window.addEventListener("getResponseAvailHotel", () => {
  412.                         this.coupon.code = ""
  413.                         window.code_coupon = ""
  414.                         this.verifCoupon()
  415.                     });
  416.                     window.addEventListener("checkinUpdated", () => {
  417.                         this.checkinDate = window.checkin; // Mise à jour réactive
  418.                     });
  419.                     window.addEventListener("nuiteesUpdated", () => {
  420.                         this.nbrNuitees = window.nuitees; // Mise à jour réactive
  421.                     });
  422.                 }
  423.             })
  424.     </script>
  425.     {#  <script defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAZWB8_k7_O-60IwFqsGCPELoclcweZh1Q&callback=initializeMap"></script>#}
  426.     {% if HotelDetail.Localization is defined and HotelDetail.Localization.Longitude is not null and HotelDetail.Localization.Latitude %}
  427.         <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
  428.                 integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
  429.         <script>
  430.             var mymap = L.map('maph').setView([{{ HotelDetail.Localization.Longitude }},{{ HotelDetail.Localization.Latitude }}], 10);
  431.             L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(mymap);
  432.             var marker = L.marker([{{ HotelDetail.Localization.Longitude }},{{ HotelDetail.Localization.Latitude }}],
  433.                 {
  434.                     title: {% if HotelDetail.Name is defined and HotelDetail.Name is not null %}"{{ HotelDetail.Name }}" {% endif %}
  435.                 }).addTo(mymap)
  436.         </script>
  437.     {% endif %}
  438. {% endblock %}