{# <!DOCTYPE html>
<html lang="en"> #}
{% extends 'base.html.twig' %}
{% block title %}Meilleur Agence de voyages en Tunisie - Rustica Voyages{% endblock %}
{% block stylesheets %}
<head>
<meta charset="UTF-8">
<title>Hotel List</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
<link href="{{ asset('front/plugins/font-awesome-4.7.0/css/font-awesome.min.css') }}" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/14.6.4/nouislider.min.css" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="{{ asset('front/style/single_listing_style.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('front/style/single_listing_responsive.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('front/style/blog_style.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('front/style/blog_responsive.css') }}">
<link href="{{ asset('front/searchbar/vendor/mdi-font/css/material-design-iconic-font.min.css') }}" rel="stylesheet" media="all">
<link href="{{ asset('front/searchbar/vendor/font-awesome-4.7/css/font-awesome.min.css') }}" rel="stylesheet" media="all">
<!-- Font special for pages-->
<link href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i" rel="stylesheet">
<!-- Vendor CSS-->
<link href="{{ asset('front/searchbar/vendor/select2/select2.min.css') }}" rel="stylesheet" media="all">
<link href="{{ asset('front/searchbar/vendor/datepicker/daterangepicker.css') }}" rel="stylesheet" media="all">
<!-- Main CSS-->
<link href="{{ asset('front/searchbar/css/main.css') }}" rel="stylesheet" media="all">
<!-- Modal Css -->
<link rel="stylesheet" href="{{ asset('front/modals/fonts/icomoon/stylecommons.css') }}">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="{{ asset('front/modals/css/bootstrapcss.min.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('front/plugins/OwlCarousel2-2.2.1/owl.carousel.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('front/plugins/OwlCarousel2-2.2.1/owl.theme.default.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('front/plugins/OwlCarousel2-2.2.1/animate.css') }}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css">
<!-- Icons font CSS-->
<link href="{{ asset('searchbar/vendor/mdi-font/css/material-design-iconic-font.min.css') }}" rel="stylesheet" media="all">
<!-- Font special for pages-->
<link href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i" rel="stylesheet">
<!-- Vendor CSS-->
<link href="{{ asset('searchbar/vendor/select2/select2.min.css') }}" rel="stylesheet" media="all">
<!-- Main CSS-->
<link href="{{ asset('searchbar/css/main.css') }}" rel="stylesheet" media="all">
<style>
.hotel-container {
display: flex;
gap: 20px; /* Espacement entre les hôtels */
flex-wrap: wrap; /* Permet de revenir à la ligne si l'espace est insuffisant */
}
.modal .modal-content {
background-color: white;
border: none;
border-radius: 7px;
}
.modal .modal-content .modal-body {
background: #FFFFFF;
border: none;
border-radius: 7px;
overflow: hidden;
color: #fff;
padding-left: 35px;
padding-right: 16px;
-webkit-box-shadow: 0 10px 50px -10px rgba(0, 0, 0, 0.9);
box-shadow: none;
}
.hotel {
flex: 1;
min-width: 200px; /* Largeur minimale pour chaque hôtel */
max-width: 300px; /* Largeur maximale pour chaque hôtel */
}
.facilities {
margin-left: 20px;
list-style-type: none;
padding: 0;
}
.facilities li {
margin-bottom: 5px;
}
.room {
margin-bottom: 15px;
border: 1px solid #ddd;
padding: 10px;
}
.remove-room {
color: red;
cursor: pointer;
background-color: #FFFFFF;
border-color: #FFFFFF;
font-size: 18px;
}
.facility {
display: contents;
align-items: center;
}
.facility img {
margin-right: 10px;
width: 20px;
height: 20px;
filter: invert(54%) sepia(74%) saturate(1363%) hue-rotate(199deg) brightness(108%) contrast(107%)
}
.hotel1
{
width: auto;
margin-left: auto;
box-shadow: none;
border: 1px solid #cccccc;
border-radius: 25px;
height: 368px;
background-color: #0A6CA9;
color: #FFFFFF;
}
.hotel2
{
width: 22%;
margin-top: 453px;
margin-left: 15px;
box-shadow: none;
border-radius: 25px;
height: 368px;
}
.badge{
font-size: 80%;
font-weight: 600;
background-color: #b29b63;
}
.container{
max-width: 1440px;
}
.offers_item1{
position: relative;
width: 110%;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
transition: all 300ms;
margin-bottom: 30px;
margin-left: -15px;
color: rgba(0, 0, 0, 0.87);
background: #fff;
}
.offers_item2{
position: relative;
width: 110%;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
transition: all 300ms;
margin-bottom: 100px;
margin-left: -15px;
color: rgba(0, 0, 0, 0.87);
background: #fff;
border-radius: 20px;
}
h4 {
position: relative;
padding: 0;
margin: 0;
font-family: "Raleway", sans-serif;
font-weight: 600;
font-size: 24px;
color: #080808;
-webkit-transition: all 0.4s ease 0s;
-o-transition: all 0.4s ease 0s;
transition: all 0.4s ease 0s;
}
h4 span {
display: block;
font-size: 0.5em;
line-height: 1.3;
}
h4 em {
font-style: normal;
font-weight: 600;
}
.two h4 {
text-transform: capitalize;
margin: 15px;
color: #FFFFFF;
}
.two h4:before {
position: absolute;
left: 0;
bottom: 0;
width: 60px;
height: 2px;
content: "";
background-color: white;
}
.two h4 span {
font-size: 13px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 4px;
line-height: 3em;
padding-left: 0.25em;
color: rgba(0, 0, 0, 0.4);
padding-bottom: 10px;
}
.alt-two h4 {
text-align:center;
}
.alt-two h4:before {
left:50%; margin-left:-30px;
}
.mt-4, .my-4 {
margin-top: -5.5rem !important;
}
/* Style personnalisé pour noUiSlider */
.noUi-target {
background: #f0f0f0;
border: 1px solid #ccc;
border-radius: 5px;
}
.noUi-horizontal {
height: 10px;
}
.noUi-handle {
width: 20px;
height: 20px;
background: #0A6CA9;
border: 2px solid #fff;
border-radius: 50%;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.noUi-connect {
background: #0A6CA9;
height: 10px;
}
.noUi-tooltip {
background: #0A6CA9;
color: #fff;
border-radius: 3px;
padding: 5px;
font-size: 12px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
@media (min-width: 576px) {
.modal-dialog {
max-width: 800px;
margin: 1.75rem auto;
}
}
.card-7 {
background: transparent;
position: relative;
border: none;
margin-top: 25px;
}
.input--large {
width: 300px;
height: 80px;
}
.input--medium {
width: 280px;
height: 80px;
}
.form-group1 {
margin-top: -10px;
}
.bg-color-1 {
background: transparent;
}
.p-t-395 {
padding-top: 95px;
}
.page-wrapper {
min-height: 0vh;
}
.box-area{
display: inline-flex;
flex-wrap: wrap;
justify-content: left;
align-items: left;
margin-top: 70px;
margin-left: 25px;
}
.single-box{
position: relative;
display: flex;
flex-direction: column;
align-items: left;
justify-content: left;
width: 320px;
height: 360px;
border-radius: 4px;
background-color: #fff;
text-align: left;
margin: 6px;
padding: 20px;
transition: .3s;
box-shadow: 1px 0 5px 0 rgba(0,0,0,0.6) ;
}
.img-area{
display: flex;
justify-content: center;
align-items: center;
width: 80px;
height:80px;
border: 6px solid #ddd;
border-radius: 50%;
margin-bottom: 10px;
padding: 20px;
background-size: cover;
background-position: center center;
}
.single-box:nth-child(1) .img-area{
background-image: url(https://images.pexels.com/photos/1222271/pexels-photo-1222271.jpeg?auto=compress&cs=tinysrgb&w=600);
}
.single-box:nth-child(2) .img-area{
background-image: url(https://images.pexels.com/photos/1239291/pexels-photo-1239291.jpeg?auto=compress&cs=tinysrgb&w=600);
}
.single-box:nth-child(3) .img-area{
background-image: url(https://images.pexels.com/photos/35537/child-children-girl-happy.jpg?auto=compress&cs=tinysrgb&w=600);
}
.header-text{
font-size: 24px;
font-weight: 500px;
line-height: 48px;
}
.img-text h3{
margin: 10px 0;
}
.img-text p{
font-size: 15px;
font-weight: 400px;
line-height: 30px;
}
.single-box:hover .line{
background-color: #fff;
}
.childrenAgesContainer{
display: flex;
margin-left: 18px;
}
.btn-primary {
color: #fff;
background-color: #17a2b8;
border-color: #17a2b8;
width: 60%;
margin-top: 10px;
}
.owl-theme .owl-dots {
text-align: center;
-webkit-tap-highlight-color: transparent;
display: none;
}
.owl-theme .owl-nav {
margin-top: 10px;
text-align: center;
-webkit-tap-highlight-color: transparent;
z-index: 10000;
background: red;
display: none;
}
.cta {
padding-top: 190px;
padding-bottom: 183px;
background: linear-gradient(to right, #b29b63, #0093a9);
}
.search_tab.active {
background: linear-gradient(to right, #b29b63, #0093a9);
color: #FFFFFF;
}
.search_tab:hover {
background: linear-gradient(to right, #0093a9, #b29b63);
color: #FFFFFF;
}
.content {
max-height: 3em; /* Limite initiale de hauteur en fonction du nombre de lignes */
overflow: hidden;
}
.expanded {
max-height: none; /* Agrandir la hauteur lorsque le paragraphe est étendu */
}
.read-more {
cursor: pointer;
color: blue;
}
.home_slider_background {
height: 80;
width: 100%;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
margin-top:40px;
}
.offers_price {
display: inline-block;
font-size: 29px;
font-weight: 700;
color: #ff9100;
line-height: 25px;
}
.offers_price a{
display: inline-block;
font-size: 22px;
font-weight: 700;
color: #0093a9;
line-height: 25px;
}
.offer_name{
display: block;
font-size: 22px;
font-weight: 700;
background: #0093a9;
color: #FFFFFF;
width: 310px;
line-height: 35px;
padding-left: 12px;
}
.offers_item {
border-radius: 12px;
overflow: hidden;
position: relative;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
transition: all 300ms;
}
.offers_item:hover {
transform: translateY(-2px);
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}
.offers_image_background {
position: relative;
margin: auto;
overflow: hidden;
}
.offers_image_background img {
max-width: 100%;
transition: all 0.3s;
display: block;
transform: scale(1);
}
.offers_image_background:hover img {
transform: scale(1.1);
}
.offers_content {
margin-top: 22px;
margin-left: 17px;
margin-bottom: 22px;
margin-right: 17px;
}
.offers_link {
margin-top: 24px;
}
.intro_price {
font-size: 20px;
font-weight: 600;
color: #FFFFFF;
margin-top: -4px;
}
.intro{
padding-bottom: 50px;
}
.button a:hover {
background-color: #ff9100;
color: white;
}
.btn-primary :hover {
color: #fff;
background-color: #ff9100;
border-color: #ff9100;
}
.ctaBackground {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 210%;
background-repeat: no-repeat;
background-size: cover;
background-position: center center;
opacity: 0.27;
}
img {
max-width: 100%;
height: 100%;
}
.container {
max-width: 1440px!important;
}
.main_nav_item a {
font-family: 'Open Sans', sans-serif;
font-size: 15px;
font-weight: 700;
color: #0093a9!important;
text-transform: uppercase;
padding-bottom: 10px;
padding-top: 10px;
}
.main_nav_item::after {
display: block;
position: absolute;
left: -1px;
bottom: -11px;
width: calc(100% + 2px);
height: 2px;
background: linear-gradient(to right, #b29b63, #0093a9)!important;
content: '';
opacity: 0;
-webkit-transition: all 200ms ease;
-moz-transition: all 200ms ease;
-ms-transition: all 200ms ease;
-o-transition: all 200ms ease;
transition: all 200ms ease;
}
.section-title h2 {
text-align: center;
font-size: 18px;
font-weight: 600;
text-transform: uppercase;
padding-bottom: 6px;
color: #000;
letter-spacing: 0.3px;
padding: 0;
}
.section-title::after {
content: "";
height: 3px;
background: #fbb900;
width: 80px;
position: absolute;
left: 0;
right: 0;
margin: auto;
}
/****************/
/* BX-SLIDER */
/****************/
/* section.client {
padding:4em 0em;
}*/
section.client .section-title {
margin-bottom: 6em;
}
.bx-controls {
position: relative;
}
.bx-wrapper{
margin: auto;
margin-top: 70px;
}
.bx-wrapper .bx-pager {
text-align: center;
padding-top: 30px;
display: none;
}
.bx-wrapper .bx-pager .bx-pager-item, .bx-wrapper .bx-controls-auto .bx-controls-auto-item {
display: inline-block;
*zoom: 1;
*display: inline;
}
.bx-wrapper .bx-pager.bx-default-pager a {
background: #666;
text-indent: -9999px;
display: block;
width: 10px;
height: 10px;
margin: 0 5px;
outline: 0;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
/**/
/* Default styles */
.filter {
background: #f3f6f9;
margin-top: -24px;
}
.container {
padding: 0 15px;
margin: 0 auto;
}
.card {
border: none;
background: transparent;
width: 100%;
/* max-width: 1070px;*/
margin: 0 auto;
}
.card-body {
margin-top: 25px;
}
.input-group {
width: calc(25% - 20px);
max-width: 300%;
margin-bottom: 10px;
}
.input-group1 {
width: calc(25% - 20px);
max-width: 300%;
margin-bottom: 10px;
}
.input-group2 {
width: calc(25% - 20px);
max-width: 300%;
margin-bottom: 10px;
}
.label {
color: black;
font-weight: 500;
display: block;
}
.btn-submit {
font-size: 16px;
font-weight: 500;
border: 1px solid black;
background: #FFFFFF;
color: black;
margin-bottom: 10px;
max-width:335px;
}
/* Media Queries */
@media screen and (max-width: 768px) {
.input-group {
width: 97%!important;
max-width: none;
}
.btn-submit {
width: 97%!important;
}
.nuite{
width: 23%!important;
max-width: none;
}
.arr{
width: 70%!important;
max-width: none;
}
.form{
margin-left: 11px!important;
}
.home_slider_container{
display:none;
}
.form-group1 {
margin-top: -11px!important;
margin-left: -15px!important;
}
.lnuite{
margin-left: -14px!important;
}
.inuite{
margin-left: 20px!important;
}
.iarr{
margin-left: 7px!important;
}
.larr{
margin-left: -8px!important;
}
#addRoomButton{
font-size: 14px!important;
}
.daterangepicker {
width: 290px!important;
left:60px!important;
top:280px!important;
}
.cta{
display:none;
}
.filter{margin-top:-140px;}
.offers{padding-top:55px;}
.intro{padding-top:55px;}
.section_title{font-size:20px !important;}
.offers_items {
margin-top: 30px;
}
.intro_col
{
min-width: 395px;
margin-left: -45px;
}
.banniere
{
width:100%;
height:50%!important;
}
}
.home_slider_container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10;
background: #ffffff;
}
.home_slider_background{
opacity: unset
}
.input--style-1 {
font-size: 16px;
padding: 9px 0;
color: #666;
font-family: "Roboto", "Arial", "Helvetica Neue", sans-serif;
}
.daterangepicker {
width: 490px;
}
.card1 {
position: relative;
display: inline-block;
width: 330px;
margin-left: 30px;
background: #FFF;
box-shadow: 0px 15px 30px 0px rgba(25, 27, 42, 0.05);
}
.card1__love-btn {
position: absolute;
top: 22px;
right: 22px;
display: grid;
place-items: center;
width: 44px;
height: 44px;
border-radius: 50%;
background: #fff;
border: none;
cursor: pointer;
}
.card1__love-btn svg {
width: 20px;
fill: #FF6A8E;
}
.card1__img {
width: 100%;
height: 245px;
object-fit: cover;
}
.card1__body {
padding: 1px 10px 5px 15px;
}
.card1__title {
font-size: 18px;
font-weight: 600;
}
.card1__text {
padding-top: 8px;
padding-bottom: 24px;
color: #5A5A5A;
font-size: 14px;
font-weight: 400;
line-height: 170%;
}
.card1__footer {
display: flex;
align-items: center;
justify-content: space-between;
margin-top:-20px;
}
.card1__footer .price {
display: contents;
font-size: 20px;
font-weight: 600;
color: black;
}
.test {
display: flex;
gap: 7px;
align-items: center;
padding: 7px 24px;
color: #000;
font-size: 15px;
font-weight: 500;
line-height: 170%;
border: none;
outline: none;
border-radius: 5px;
background: transparent;
margin-left:-25px;
cursor: pointer;
}
</style>
</head>
{% endblock %}
{% block body %}
<div class="home" style="height: 100px;">
</div>
<!-- Blog -->
<div class="cta">
<div class="home_slider_container" style="height: 132%">
{# <div class="owl-carousel owl-theme home_slider">
{% for b in banniere%}
<div class="owl-item home_slider_item">
<div class="home_slider_background">
{% for img in b.imagesbannieres %}
<img class="banniere" src="{{ asset('./rusticav/public/uploads/bannieres/'~img.name) }}" alt="" width="100%" height="74%" />
{% endfor %}
</div>
</div>
{% endfor %}
</div> #}
<div class="owl-carousel owl-theme home_slider">
{% for b in banniere%}
<div class="owl-carousel owl-theme home_slider">
<div class="home_slider_background">
{% for img in b.imagesbannieres %}
<img class="banniere" src="{{ asset('./rusticav/public/uploads/bannieres/'~img.name) }}" alt="" width="100%" height="74%" />
{% endfor %}
</div>
</div>
{% endfor %}
</div>
<!-- Home Slider Nav - Prev -->
<div class="home_slider_nav home_slider_prev">
<svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="28px" height="33px" viewBox="0 0 28 33" enable-background="new 0 0 28 33" xml:space="preserve">
<defs>
<linearGradient id='home_grad_prev'>
<stop offset='0%' stop-color='#fa9e1b'/>
<stop offset='100%' stop-color='#8d4fff'/>
</linearGradient>
</defs>
<path class="nav_path" fill="#F3F6F9" d="M19,0H9C4.029,0,0,4.029,0,9v15c0,4.971,4.029,9,9,9h10c4.97,0,9-4.029,9-9V9C28,4.029,23.97,0,19,0z
M26,23.091C26,27.459,22.545,31,18.285,31H9.714C5.454,31,2,27.459,2,23.091V9.909C2,5.541,5.454,2,9.714,2h8.571
C22.545,2,26,5.541,26,9.909V23.091z"/>
<polygon class="nav_arrow" fill="#F3F6F9" points="15.044,22.222 16.377,20.888 12.374,16.885 16.377,12.882 15.044,11.55 9.708,16.885 11.04,18.219
11.042,18.219 "/>
</svg>
</div>
<!-- Home Slider Nav - Next -->
<div class="home_slider_nav home_slider_next">
<svg version="1.1" id="Layer_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="28px" height="33px" viewBox="0 0 28 33" enable-background="new 0 0 28 33" xml:space="preserve">
<defs>
<linearGradient id='home_grad_next'>
<stop offset='0%' stop-color='#fa9e1b'/>
<stop offset='100%' stop-color='#8d4fff'/>
</linearGradient>
</defs>
<path class="nav_path" fill="#F3F6F9" d="M19,0H9C4.029,0,0,4.029,0,9v15c0,4.971,4.029,9,9,9h10c4.97,0,9-4.029,9-9V9C28,4.029,23.97,0,19,0z
M26,23.091C26,27.459,22.545,31,18.285,31H9.714C5.454,31,2,27.459,2,23.091V9.909C2,5.541,5.454,2,9.714,2h8.571
C22.545,2,26,5.541,26,9.909V23.091z"/>
<polygon class="nav_arrow" fill="#F3F6F9" points="13.044,11.551 11.71,12.885 15.714,16.888 11.71,20.891 13.044,22.224 18.379,16.888 17.048,15.554
17.046,15.554 "/>
</svg>
</div>
</div>
</div>
<!-- Inclure jQuery (nécessaire pour Owl Carousel) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Inclure le fichier JavaScript de Owl Carousel -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<script>
$(document).ready(function(){
// Initialisez le carrousel avec Owl Carousel
$('.home_slider').owlCarousel({
loop: true,
items: 1,
autoplay: true,
autoplayTimeout: 5000, // Durée entre chaque diapositive en millisecondes (5 secondes)
autoplayHoverPause: true, // Mettre en pause le carrousel lorsque survolé
nav: true, // Activer les flèches de navigation
dots: true // Activer les points de navigation
});
// Écoutez l'événement 'changed.owl.carousel' pour détecter le changement de diapositive
$('.home_slider').on('changed.owl.carousel', function(event) {
var currentSlide = event.item.index;
var slideCount = event.item.count;
if (currentSlide === slideCount - 1) {
// Si c'est la dernière diapositive, retournez à la première diapositive
$('.home_slider').trigger('to.owl.carousel', [0, 500]);
}
});
});
</script>
</div>
<br><br><br><br><br><br><br><br>
<div class="filter">
<div class="container">
<div class="card card-7">
<div class="card-body">
<form class="form" id="searchForm" style="margin-left:60px;margin-top:-15px">
<div class="input-group input--medium">
<label class="label" for="city">Destination</label>
<select id="city" name="city" class="input--style-1" style="margin-top: -6px;border: none;width: 80%" required>
<option value="">Choisir une ville</option>
{% for cityId, cityName in cities %}
<option value="{{ cityId }}" {% if city == cityId %}selected{% endif %}>{{ cityName }}</option>
{% endfor %}
</select>
</div>
<div class="input-group input--medium arr">
<label class="larr">Arrivée - Départ</label>
<div class="form-group1">
<input type="text" class="input--style-1 iarr" name="daterange" id="daterange" required/>
</div>
</div>
<div class="input-group input--medium nuite" style="width:90px">
<label class="lnuite">Nuitée</label>
<div class="form-group1">
<input type="text" class="input--style-1 inuite" id="nightsCount" readonly/>
</div>
</div>
<button class="btn-submit" type="button" id="addRoomButton" data-toggle="modal" data-target="#roomModal" style="background: #FFFFFF"><i class="fa fa-bed"></i> une chambre: 2 adultes</button>
<button class="btn-submit" type="submit" style="background: #17a2b8;color: #FFFFFF">Rechercher</button>
</form>
</div>
</div>
</div>
</div>
<!-- The Modal -->
<div class="modal fade" id="roomModal" tabindex="-1" role="dialog" aria-labelledby="roomModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="roomModalLabel">Chambre & Occupation</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div id="roomsContainer">
{% for room in rooms %}
<div class="room mb-3">
<div class="form-row align-items-center">
<div class="col-md-3">
<label for="adultCount"style="color: black">Adulte(s):</label>
<input type="number" class="form-control adultCount" name="adultCount[]" min="1" required value="{{ room.Adult }}">
</div>
<div class="col-md-3">
<label for="childCount"style="color: black">Enfant(s):</label>
<input type="number" class="form-control childCount" name="childCount[]" min="0" value="{{ room.Child is defined ? room.Child|length : 0 }}">
</div>
<div class="col-md-5">
<div class="childrenAgesContainer">
{% if room.Child is defined %}
{% for age in room.Child %}
<div class="col-md-3">
<label for="childAge{{ loop.index }}" style="color: black;width: 104%">Âge {{ loop.index }}</label>
<select id="childAge{{ loop.index }}" style="width: 60px" class="form-control childrenAges" name="childrenAges[]">
<option value="" disabled>Sélectionner l'âge</option>
{% for i in 1..17 %}
<option value="{{ i }}" {% if age == i %}selected{% endif %}>{{ i }}</option>
{% endfor %}
</select>
</div>
{% endfor %}
{% endif %}
</div>
</div>
<div class="col-md-1 text-right">
<button type="button" class="btn btn-danger btn-sm remove-room" data-room-id="{{ loop.index }}">
<i class="fa fa-trash"></i>
</button>
</div>
</div>
</div>
{% else %}
<div class="room mb-3">
<div class="form-row align-items-center">
<div class="col-md-3">
<label for="adultCount" style="color: black">Adulte(s):</label>
<input type="number" class="form-control adultCount" name="adultCount[]" min="1" required value="2">
</div>
<div class="col-md-3">
<label for="childCount" style="color: black">Enfant(s):</label>
<input type="number" class="form-control childCount" name="childCount[]" min="0" value="0">
</div>
<div class="row">
<div class="col-md-5">
<div class="childrenAgesContainer">
<!-- This container will be populated dynamically -->
</div>
</div>
<div class="col-md-1 text-right">
<button type="button" class="btn btn-danger btn-sm remove-room" data-room-id="{{ loop.index }}">
<i class="fa fa-trash"></i>
</button>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
<button type="button" class="btn btn-secondary" id="addMoreRoomButton">Add More Room</button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="saveRoomButton" data-dismiss="modal">Save</button>
</div>
</div>
</div>
</div>
<div id="content">
<div style="display: none">
{{ content|raw }}
</div>
</div>
<br><br><br><br>
<div class="offers">
<div class="container">
<div class="row">
<div class="col text-center">
<h2 class="section_title">Nos Meilleurs Hôtels en Tunisie</h2>
</div>
</div>
<div class="row offers_items">
<div id="test">
<div style="display: none">
{{ test|raw }}
</div>
</div>
</div>
</div>
</div>
<div class="cta">
<div class="cta_background" style="background-image:url(./front/images/Slider_3.png);opacity: unset ; background-size: cover;background-position: center;width: 100%;"></div>
<div class="container">
<div class="row">
<div class="col">
</div>
</div>
</div>
</div>
<!-- Intro -->
<div class="intro">
<div class="container">
<div class="row">
<div class="col text-center">
<h2 class="section_title" style="font-size: 33px;color: #0093a9">Croisière</h2>
</div>
</div>
<div class="intro">
<div class="container mt-4">
<div class="row intro_items" style="margin-top: -100px; margin-left:20px;">
{% for c in croisiere|slice(0, 3) %}
<div class="col-lg-4 intro_col">
<div class="intro_item" style="width: 90%;height: 400px;box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2);">
<div class="intro_item_overlay" style="background: #301c405c"></div>
<div class="intro_item_background">
{% for img in c.imagescroisieres %}
{% if loop.first %}
<img src="{{ asset('./rusticav/public/uploads/croisieres/'~img.name) }}" alt="" width="100%" height="100%" />
{% endif %}
{% endfor %}
</div>
<div class="intro_item_content d-flex flex-column align-items-center justify-content-center" style="margin-top: 60px;">
<div class="button intro_button" style="margin-bottom: -5px;">
<div class="button_bcg" style="background: #0093a9;"></div>
<a href="{{ path('details', {'croisiereId': c.id}) }}" style="font-size: 14px">
Voir plus<span></span><span></span><span></span>
</a>
</div>
<div class="intro_center text-center">
<a href="{{ path('details', {'croisiereId': c.id}) }}" style="color:#000;font-size: 23px"><h1 style="font-size: 34px;text-transform: uppercase">{{c.name}}</h1></a>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
<div class="text-right mt-4" style="margin-right: 79px; margin-bottom:-53px">
<a href="{{path('app_croisiere')}}" style="color: #0093a9;margin-top: 128px;">
Découvrir Nos Croisières <i class="fa fa-angle-double-right"></i>
</a>
</div>
</div>
</div>
</div>
<!-- CTA -->
<div class="cta">
<!-- Image by https://unsplash.com/@thanni -->
<div class="cta_background" style="background-image:url(./front/images/Slider_1.png);opacity: unset; background-size: cover;background-position: center;width: 100%;"></div>
<div class="container">
<div class="row">
<div class="col">
</div>
</div>
</div>
</div>
<!-- Intro -->
<div class="intro">
<div class="container">
<div class="row">
<div class="col text-center">
<h2 class="section_title" style="font-size: 33px;color: #0093a9">Voyages Organisés</h2>
</div>
</div>
<div class="intro">
<div class="container mt-4">
<div class="row intro_items" style="margin-top: -62px; margin-left:20px;">
{% for s in sejour|slice(0, 3) %}
<div class="col-lg-4 intro_col">
<div class="intro_item" style="width: 90%;height: 400px;box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2);">
<div class="intro_item_overlay" style="background: #301c405c"></div>
<div class="intro_item_background">
{% for img in s.imageSejours %}
{% if loop.first %}
<img src="{{ asset('./rusticav/public/uploads/sejours/'~img.name) }}" alt="" width="100%" height="100%" />
{% endif %}
{% endfor %}
</div>
<div class="intro_item_content d-flex flex-column align-items-center justify-content-center" style="margin-top: 60px;">
<div class="intro_date" style="background-color:#ff9100; top: 74px;font-size: 12px;font-weight: 700"> {{s.dated|date("d-m-Y")}} Au {{s.datef|date("d-m-Y")}}</div>
<div class="button intro_button" style="margin-bottom: -5px;">
<div class="button_bcg" style="background: #0093a9;"></div>
<a href="{{ path('detailsejour', {'id': s.id}) }}" style="font-size: 14px">
Voir plus<span></span><span></span><span></span>
</a>
</div>
<div class="intro_center text-center">
<a href="{{ path('detailsejour', {'id': s.id}) }}" style="color:#000;font-size: 23px"><h1 style="font-size: 34px;text-transform: uppercase">{{s.titre}}</h1></a>
<div class="intro_price" style="font-weight: 600;font-size: 20px">À partir de <strong>{{s.prix + s.marge}} TND</strong> </div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
<div class="text-right mt-4" style="margin-right: 79px; margin-bottom:-53px">
<a href="{{path('app_sejour')}}" style="color: #0093a9;margin-top: 128px;">
Découvrir Nos Voyages Organisés <i class="fa fa-angle-double-right"></i>
</a>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/14.6.4/nouislider.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script>
<!-- Jquery JS-->
<!-- Vendor JS-->
<script src="{{ asset('searchbar/vendor/bootstrap-wizard/bootstrap.min.js') }}"></script>
<script src="{{ asset('searchbar/vendor/bootstrap-wizard/jquery.bootstrap.wizard.min.js') }}"></script>
<!-- Main JS-->
<script src="{{ asset('searchbar/js/global.js') }}"></script>
<script>
$(document).ready(function() {
// Initialize date range picker
const checkIn = "{{ checkIn|default('') }}";
const checkOut = "{{ checkOut|default('') }}";
$('#daterange').daterangepicker({
startDate: checkIn,
endDate: checkOut,
opens: 'right',
locale: {
format: 'YYYY-MM-DD',
applyLabel: 'Valider',
cancelLabel: 'Annuler',
customRangeLabel: 'Custom',
daysOfWeek: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
firstDay: 1
}
}, function(start, end) {
// Callback pour le calcul des nuitées
const nights = end.diff(start, 'days');
document.getElementById('nightsCount').value = nights + ' ' + (nights > 1 ? 's' : '');
});
// Calcul initial des nuitées si checkIn et checkOut sont déjà définis
if (checkIn && checkOut) {
const startDate = moment(checkIn);
const endDate = moment(checkOut);
const nights = endDate.diff(startDate, 'days');
document.getElementById('nightsCount').value = nights + ' ' + (nights > 1 ? 's' : '');
}
// Update text of the Add Room button
function updateRoomButtonText() {
const totalRooms = $('.room').length;
const totalAdults = $('.adultCount').toArray().reduce((sum, input) => sum + parseInt($(input).val(), 10), 0);
const totalChildren = $('.childrenAges').toArray().length;
$('#addRoomButton').text(`${totalRooms} chambres, ${totalAdults} adultes, ${totalChildren} enfants`);
}
// Add more rooms
$('#addMoreRoomButton').on('click', function() {
const roomHtml = `
<div class="room mb-3">
<div class="form-row align-items-center">
<div class="col-md-3">
<label style="color: black">Adulte(s):</label>
<input type="number" class="form-control adultCount" name="adultCount[]" min="1" required value="2">
</div>
<div class="col-md-3">
<label style="color: black">Enfant(s):</label>
<input type="number" class="form-control childCount" name="childCount[]" min="0" value="0">
</div>
<div class="col-md-5">
<div class="childrenAgesContainer"></div>
</div>
<div class="col-md-1 text-right">
<button type="button" class="btn btn-danger btn-sm remove-room">
<i class="fa fa-trash"></i>
</button>
</div>
</div>
</div>
`;
$('#roomsContainer').append(roomHtml);
updateRoomButtonText(); // Update the button text after adding a room
});
// Handle change in number of children
$('#roomsContainer').on('change', '.childCount', function() {
const parentRoom = $(this).closest('.room');
const childrenCount = parseInt($(this).val(), 10);
const childrenAgesContainer = parentRoom.find('.childrenAgesContainer');
childrenAgesContainer.empty();
for (let i = 0; i < childrenCount; i++) {
childrenAgesContainer.append(`
<div class="col-md-3">
<label for="childAge${i}" style="color: black;width: 104%">Âge ${i + 1}</label>
<select id="childAge${i}" class="form-control childrenAges" name="childrenAges[]" style="width: 60px;">
<option value="" disabled selected>Sélectionner l'âge</option>
${Array.from({ length: 18 }, (_, age) => `<option value="${age}">${age}</option>`).join('')}
</select>
</div>
`);
}
});
// Save rooms and update button text
$('#saveRoomButton').on('click', function() {
const rooms = [];
$('.room').each(function() {
const adultCount = $(this).find('.adultCount').val();
const childrenCounts = $(this).find('.childCount').val();
const childrenAges = $(this).find('.childrenAgesContainer .childrenAges').map(function() {
return $(this).val();
}).get();
rooms.push({
Adult: adultCount,
Child: childrenAges
});
});
updateRoomButtonText(); // Update the button text when saving rooms
});
// Remove a room
$('#roomsContainer').on('click', '.remove-room', function() {
$(this).closest('.room').remove();
updateRoomButtonText(); // Update the button text after removing a room
});
// Initialize the button text
updateRoomButtonText(); // Ensure button text is correct on initial load
// Handle form submission
$('#searchForm').on('submit', function(event) {
event.preventDefault();
const checkIn = $('#daterange').data('daterangepicker').startDate.format('YYYY-MM-DD');
const checkOut = $('#daterange').data('daterangepicker').endDate.format('YYYY-MM-DD');
const city = $('#city').val();
const rooms = [];
$('.room').each(function() {
const childrenAges = $(this).find('.childrenAges').map(function() {
return $(this).val();
}).get();
rooms.push({
Adult: $(this).find('.adultCount').val(),
Child: childrenAges
});
});
if (checkIn && checkOut && rooms.length > 0) {
// Supposons que l'URL actuelle soit de la forme '/detail-search/{id}'
const citySelect = document.getElementById('city');
const city = citySelect.value;
const url = new URL('{{ path('hotel_results', {'city': 'CITY_ID'}) }}'.replace('CITY_ID', city), window.location.origin);
url.searchParams.append('checkIn', checkIn);
url.searchParams.append('checkOut', checkOut);
rooms.forEach((room, index) => {
url.searchParams.append(`rooms[${index}][Adult]`, room.Adult);
room.Child.forEach((child, childIndex) => {
url.searchParams.append(`rooms[${index}][Child][${childIndex}]`, child);
});
});
window.location.href = url.toString();
}
});
});
// Function to generate star rating HTML
function generateStarRating(stars) {
let starRating = '';
for (let i = 0; i < stars; i++) {
starRating += '★';
}
return starRating;
}
const test = $('#test').text();
// Fonction pour afficher les données de tous les hôtels
function displayAllHotels(test) {
const hotelList = $('#test');
let hotelData = [];
try {
const data = JSON.parse(test);
hotelData = data.HotelSearch;
} catch (e) {
console.error('Error parsing JSON:', e);
return;
}
// Effacer le contenu précédent
hotelList.empty();
// Afficher le formulaire de recherche
hotelList.append(``);
hotelData.forEach(hotel => {
const hotelDiv = $('<div class="card1"><div class="hotel">');
hotelDiv.data('hotel-id', hotel.Id); // Stocke l'ID de l'hôtel
const prices = hotel.Price.Boarding;
hotelDiv.html(`
<a href="/detail-search/${hotel.Hotel.City.Id}/${hotel.Hotel.Id}">
${hotel.Hotel.Image ? `<img class="card1__img" src="${hotel.Hotel.Image}" alt="Image of ${hotel.Hotel.Name}" ` : ''}
</a>
<div class="card1__body">
<a href="/detail-search/${hotel.Hotel.City.Id}/${hotel.Hotel.Id}">
<h2 class="card1__title">
${hotel.Hotel.Name}<span style="color: gold"> ${generateStarRating(hotel.Hotel.Category.Star)}</span
</h2>
</a>
<p class="card1__text">
<i class="fa fa-map-marker"></i> ${hotel.Hotel.City.Name}
</p>
<div class="card1__footer">
${prices.length > 0 ? `
<h5 class="test" style="font-weight: 500">en ${prices[0].Code}</h5>
${prices[0].Pax.map(pax => `
${pax.Rooms.length > 0 ? `
<p class="price">${(((pax.Rooms[0].Price * 1.1) * 1.1) * 0.5).toFixed(3)} TND</p>
` : ''}
`).join('')}
` : ''}
</div>
`);
// Ajouter le div de l'hôtel à la liste des hôtels
hotelList.append(hotelDiv);
// Ajouter un gestionnaire d'événements pour les boutons de réservation
});
}
// Appeler la fonction pour afficher les données des hôtels
displayAllHotels(test);
</script>
{% endblock %}
{# </body>
</html> #}
{# templates/hotel/index.html.twig #}
{#<!DOCTYPE html>#}
{#<html lang="en">#}
{#<head>#}
{# <meta charset="UTF-8">#}
{# <title>Hotel List</title>#}
{# <style>#}
{# .hotel {#}
{# border: 1px solid #ddd;#}
{# padding: 15px;#}
{# margin: 15px 0;#}
{# }#}
{# .facilities {#}
{# margin-left: 20px;#}
{# }#}
{# </style>#}
{#</head>#}
{#<body>#}
{#<h1>Hotel List</h1>#}
{#<div id="content">#}
{# <div style="display: none">#}
{# {{ content|raw }}#}
{# </div>#}
{#</div>#}
{#<script>#}
{# // Récupère le contenu brut passé par le contrôleur#}
{# const content = document.getElementById('content').textContent;#}
{# // Fonction pour afficher les données de tous les hôtels#}
{# function displayAllHotels(content) {#}
{# const hotelList = document.getElementById('content');#}
{# try {#}
{# const data = JSON.parse(content);#}
{# const hotelData = data.ListHotel;#}
{# hotelData.forEach(hotel => {#}
{# const hotelDiv = document.createElement('div');#}
{# hotelDiv.classList.add('hotel');#}
{# hotelDiv.innerHTML = `#}
{# <h2>${hotel.Name}</h2>#}
{# <p>Category: ${hotel.Category.Title}</p>#}
{# <p>City: ${hotel.City.Name}, ${hotel.City.Country.Name}</p>#}
{# ${hotel.Image ? `<img src="${hotel.Image}" alt="Image of ${hotel.Name}" style="width:200px;">` : ''}#}
{# <a href="/detail-search/${hotel.Id}">Voir les détails</a>#}
{# `;#}
{# hotelList.appendChild(hotelDiv);#}
{# });#}
{# } catch (e) {#}
{# console.error('Error displaying hotels:', e);#}
{# // Si le contenu ne peut pas être analysé comme JSON, affiche-le tel quel#}
{# hotelList.innerHTML = content;#}
{# }#}
{# }#}
{# // Fonction pour afficher les facilités#}
{# function displayFacilities(facilities) {#}
{# if (!facilities) return '';#}
{# // Regrouper les facilités par catégorie#}
{# const categories = {};#}
{# facilities.forEach(facility => {#}
{# const category = facility.Category;#}
{# if (!categories[category]) {#}
{# categories[category] = [];#}
{# }#}
{# categories[category].push(facility.Title);#}
{# });#}
{# // Construire le HTML pour les facilités par catégorie#}
{# let html = '<h3>Facilities</h3>';#}
{# html += '<ul class="facilities">';#}
{# Object.keys(categories).forEach(category => {#}
{# html += `<li><strong>${category}</strong>: ${categories[category].join(', ')}</li>`;#}
{# });#}
{# html += '</ul>';#}
{# return html;#}
{# }#}
{# // Affiche les données de tous les hôtels si le contenu est en JSON#}
{# try {#}
{# displayAllHotels(content);#}
{# } catch (e) {#}
{# console.error('Error displaying hotels:', e);#}
{# }#}
{#</script>#}
{#</body>#}
{#</html>#}
{#<!DOCTYPE html>#}
{#<html lang="en">#}
{#<head>#}
{# <meta charset="UTF-8">#}
{# <title>Hotel List</title>#}
{# <style>#}
{# .hotel {#}
{# border: 1px solid #ddd;#}
{# padding: 15px;#}
{# margin: 15px 0;#}
{# box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);#}
{# }#}
{# .facilities {#}
{# margin-left: 20px;#}
{# list-style-type: none;#}
{# padding: 0;#}
{# }#}
{# .facilities li {#}
{# margin-bottom: 5px;#}
{# }#}
{# </style>#}
{#</head>#}
{#<body>#}
{#<h1>Hotel List</h1>#}
{#<div id="content">#}
{# <div style="display: none">#}
{# {{ content|raw }}#}
{# </div>#}
{#</div>#}
{#<script>#}
{# document.addEventListener("DOMContentLoaded", () => {#}
{# const content = document.getElementById('content').textContent;#}
{# // Afficher le contenu brut pour le débogage#}
{# console.log("Contenu reçu:", content);#}
{# try {#}
{# const data = JSON.parse(content);#}
{# if (data && data.ListHotel) {#}
{# displayAllHotels(data.ListHotel);#}
{# } else {#}
{# document.getElementById('content').innerHTML = 'Aucun hôtel trouvé pour l\'ID de ville spécifié.';#}
{# }#}
{# } catch (e) {#}
{# console.error('Error parsing JSON:', e);#}
{# document.getElementById('content').innerHTML = 'Erreur de chargement des données des hôtels.';#}
{# }#}
{# });#}
{# function displayAllHotels(hotelData) {#}
{# const hotelList = document.getElementById('content');#}
{# // Grouper les hôtels par ville#}
{# const hotelsByCity = hotelData.reduce((acc, hotel) => {#}
{# const cityName = hotel.City.Name;#}
{# if (!acc[cityName]) {#}
{# acc[cityName] = [];#}
{# }#}
{# if (hotel.Image) { // Inclure uniquement les hôtels avec une image#}
{# acc[cityName].push(hotel);#}
{# }#}
{# return acc;#}
{# }, {});#}
{# // Parcourir les groupes d'hôtels par ville#}
{# Object.entries(hotelsByCity).forEach(([cityName, hotels]) => {#}
{# if (hotels.length === 0) return; // Si aucun hôtel pour la ville, passer à la ville suivante#}
{# // Ajouter un titre de ville#}
{# const cityHeader = document.createElement('h3');#}
{# cityHeader.textContent = cityName;#}
{# hotelList.appendChild(cityHeader);#}
{# // Limiter à 2 hôtels pour chaque ville#}
{# const limitedHotels = hotels.slice(0, 2);#}
{# // Ajouter les hôtels pour cette ville#}
{# limitedHotels.forEach(hotel => {#}
{# const hotelDiv = document.createElement('div');#}
{# // Fonction pour générer les étoiles en fonction du nombre d'étoiles#}
{# function generateStarRating(starCount) {#}
{# let starsHtml = '';#}
{# for (let i = 0; i < starCount; i++) {#}
{# starsHtml += '<img src="{{ asset('front/images/etoil.png') }}" alt="Star">';#}
{# }#}
{# return starsHtml;#}
{# }#}
{# hotelDiv.classList.add('hotel');#}
{# hotelDiv.innerHTML = `#}
{# <img src="${hotel.Image}" alt="Image of ${hotel.Name}" style="width:200px;">#}
{# <h2>${hotel.Name} ${generateStarRating(hotel.Category.Star)}</h2>#}
{# <p>City: ${hotel.City.Name}, ${hotel.City.Country.Name}</p>#}
{# <a href="/detail-search/${hotel.Id}">Voir les détails</a>#}
{# `;#}
{# hotelList.appendChild(hotelDiv);#}
{# });#}
{# });#}
{# }#}
{#</script>#}
{#</body>#}
{#</html>#}
{#<!DOCTYPE html>#}
{#<html lang="en">#}
{#<head>#}
{# <meta charset="UTF-8">#}
{# <title>Hotel List</title>#}
{# <style>#}
{# .hotel {#}
{# border: 1px solid #ddd;#}
{# padding: 15px;#}
{# margin: 15px 0;#}
{# }#}
{# .album img {#}
{# width: 200px;#}
{# margin: 5px;#}
{# }#}
{# </style>#}
{#</head>#}
{#<body>#}
{#<h1>Hotel List</h1>#}
{#<div id="content">#}
{# <div style="display: none">#}
{# {{ content|raw }}#}
{# </div>#}
{#</div>#}
{#<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>#}
{#<script src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>#}
{#<script src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>#}
{#<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>#}
{#<script src="https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/14.6.4/nouislider.min.js"></script>#}
{#<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script>#}
{#<script>#}
{# // Récupère le contenu brut passé par le contrôleur#}
{# const content = document.getElementById('content').textContent;#}
{# // Définir des prix manuellement pour chaque hôtel#}
{# const hotelPrices = {#}
{# '6': '100', // Prix pour l'hôtel avec l'ID 1#}
{# '7': '150', // Prix pour l'hôtel avec l'ID 2#}
{# // Ajoutez des prix pour tous les hôtels nécessaires#}
{# };#}
{# // Fonction pour afficher les données de tous les hôtels#}
{# function displayAllHotels(content) {#}
{# const hotelList = document.getElementById('content');#}
{# try {#}
{# const data = JSON.parse(content);#}
{# const hotelData = data.ListHotel;#}
{# hotelData.forEach(hotel => {#}
{# const hotelDiv = document.createElement('div');#}
{# hotelDiv.classList.add('hotel');#}
{# // Obtenez le prix correspondant à cet hôtel#}
{# const price = hotelPrices[hotel.Id] || 'N/A'; // 'N/A' si le prix n'est pas défini#}
{# hotelDiv.innerHTML = `#}
{# <h2>${hotel.Name}</h2>#}
{# <p>Category: ${hotel.Category.Title}</p>#}
{# <p>City: ${hotel.City.Name}, ${hotel.City.Country.Name}</p>#}
{# ${hotel.Adress ? `<p>Address: ${hotel.Adress}</p>` : ''}#}
{# ${hotel.Localization ? `<p>Location: Latitude ${hotel.Localization.Latitude}, Longitude ${hotel.Localization.Longitude}</p>` : ''}#}
{# ${hotel.Image ? `<img src="${hotel.Image}" alt="Image of ${hotel.Name}" style="width:200px;">` : ''}#}
{# ${hotel.Facilities ? `#}
{# <h3>Facilities</h3>#}
{# <ul>#}
{# ${hotel.Facilities.map(facility => `<li>${facility.Title} (${facility.Category})</li>`).join('')}#}
{# </ul>` : ''}#}
{# ${hotel.Theme ? `#}
{# <h3>Themes</h3>#}
{# <ul>#}
{# ${hotel.Theme.map(theme => `<li>${theme}</li>`).join('')}#}
{# </ul>` : ''}#}
{# ${hotel.Note ? `<p>Note: ${hotel.Note}</p>` : ''}#}
{# ${hotel.Album ? `#}
{# <h3>Album</h3>#}
{# <div class="album">#}
{# ${hotel.Album.map(photo => `<img src="${photo.Url}" alt="Photo of ${hotel.Name}">`).join('')}#}
{# </div>` : ''}#}
{# <p>Price: ${price} €</p>#}
{# <a href="/hotel-detail/${hotel.Id}">Voir les détails</a>#}
{# `;#}
{# hotelList.append(hotelDiv);#}
{# });#}
{# } catch (e) {#}
{# console.error('Error displaying hotels:', e);#}
{# // Si le contenu ne peut pas être analysé comme JSON, affiche-le tel quel#}
{# hotelList.innerHTML = content;#}
{# }#}
{# }#}
{# // Affiche les données de tous les hôtels si le contenu est en JSON#}
{# try {#}
{# displayAllHotels(content);#}
{# } catch (e) {#}
{# console.error('Error displaying hotels:', e);#}
{# }#}
{#</script>#}
{#</body>#}
{#</html>#}