templates/croisiere/list.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block stylesheets %}
  3.     <link href="{{ asset('front/plugins/colorbox/colorbox.css') }}" rel="stylesheet" type="text/css">
  4.     <link rel="stylesheet" type="text/css" href="{{ asset('front/style/blog_style.css') }}">
  5.     <link rel="stylesheet" type="text/css" href="{{ asset('front/style/blog_responsive.css') }}">
  6.     <link rel="stylesheet" type="text/css" href="{{ asset('front/style/single_listing_style.css') }}">
  7.     <link rel="stylesheet" type="text/css" href="{{ asset('front/style/single_listing_responsive.css') }}">
  8.     <link rel="stylesheet" type="text/css" href="{{ asset('front/style/about_style.css') }}">
  9.     <link rel="stylesheet" type="text/css" href="{{ asset('front/style/about_responsive.css') }}">
  10.     <link rel="stylesheet" href="{{ asset('slider/css/owl.carousel.min.css') }}">
  11.     <link rel="stylesheet" href="{{ asset('slider/css/owl.theme.default.min.css') }}">
  12.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/4.5.6/css/ionicons.min.css">
  13.     <link rel="stylesheet" href="{{ asset('slider/css/style.css') }}">
  14.     <style>
  15.         .container {
  16.             max-width: 1440px!important;
  17.         }
  18.         .hotel_info_text
  19.         {
  20.             width: 1400px;
  21.         }
  22.         .carousel {
  23.             position: relative;
  24.         }
  25.         .carousel-item img {
  26.             object-fit: cover;
  27.         }
  28.         #carousel-thumbs {
  29.             background: rgba(255,255,255,.3);
  30.             bottom: 0;
  31.             left: 0;
  32.             padding: 0 50px;
  33.             right: 0;
  34.         }
  35.         #carousel-thumbs img {
  36.             border: 5px solid transparent;
  37.             cursor: pointer;
  38.         }
  39.         #carousel-thumbs img:hover {
  40.             border-color: rgba(255,255,255,.3);
  41.         }
  42.         #carousel-thumbs .selected img {
  43.             border-color: #fff;
  44.         }
  45.         .carousel-control-prev,
  46.         .carousel-control-next {
  47.             width: 50px;
  48.         }
  49.         @media all and (max-width: 767px) {
  50.             .carousel-container #carousel-thumbs img {
  51.                 border-width: 3px;
  52.             }
  53.         }
  54.         @media all and (min-width: 576px) {
  55.             .carousel-container #carousel-thumbs {
  56.                 position: absolute;
  57.             }
  58.         }
  59.         @media all and (max-width: 576px) {
  60.             .carousel-container #carousel-thumbs {
  61.                 background: #ccccce;
  62.             }
  63.         }
  64.         .offers_item{
  65.             position: relative;
  66.             width: 205%;
  67.             overflow: hidden;
  68.             box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  69.             transition: all 300ms;
  70.             margin-bottom: 30px;
  71.             border-radius: 20px;
  72.             color: rgba(0, 0, 0, 0.87);
  73.             background: #fff;
  74.         }
  75.         
  76.         .latest_posts_container {
  77.             margin: 35px;
  78.         }
  79.         .hotel_location {
  80.             font-size: 24px;
  81.             color: #929191;
  82.             margin-top: 9px;
  83.             font-weight: 700;
  84.         }
  85.         .main_nav_item a {
  86.             font-family: 'Open Sans', sans-serif;
  87.             font-size: 15px;
  88.             font-weight: 700;
  89.             color: #0093a9!important;
  90.             text-transform: uppercase;
  91.             padding-bottom: 10px;
  92.             padding-top: 10px;
  93.         }
  94.         /*price style*/
  95.         .pricing-content{}
  96.         .single-pricing{
  97.             background:transparent;
  98.             margin-top: 25px;
  99.             width: 255%;
  100.             padding:40px 20px;
  101.             border-radius:5px;
  102.             position:relative;
  103.             z-index:2;
  104.             /*border:1px solid #d8d5d5;*/
  105.             /*box-shadow: 0 10px 40px -10px rgba(0,64,128,.09);*/
  106.             transition:0.3s;
  107.         }
  108.         @media only screen and (max-width:480px) {
  109.             .single-pricing {margin-bottom:30px;}
  110.         }
  111.         /*.single-pricing:hover{*/
  112.         /*    box-shadow:0px 60px 60px rgba(0,0,0,0.1);*/
  113.         /*    z-index:100;*/
  114.         /*    transform: translate(0, -10px);*/
  115.         /*}*/
  116.         .price-label {
  117.             color: #fff;
  118.             background: #ff9100;
  119.             font-size: 16px;
  120.             width: 100px;
  121.             margin-bottom: 15px;
  122.             display: block;
  123.             -webkit-clip-path: polygon(100% 0%, 90% 50%, 100% 100%, 0% 100%, 0 50%, 0% 0%);
  124.             clip-path: polygon(100% 0%, 90% 50%, 100% 100%, 0% 100%, 0 50%, 0% 0%);
  125.             margin-left: -20px;
  126.             position: absolute;
  127.         }
  128.         .price-head h2 {
  129.             font-weight: 600;
  130.             margin-bottom: 0px;
  131.             text-transform: capitalize;
  132.             font-size: 35px;
  133.         }
  134.         .price-head span {
  135.             display: inline-block;
  136.             background:#ff9100;
  137.             width: 6px;
  138.             height: 6px;
  139.             border-radius: 30px;
  140.             margin-bottom: 20px;
  141.             margin-top: 15px;
  142.         }
  143.         .price {
  144.             font-weight: 500;
  145.             font-size: 50px;
  146.             margin-bottom: 0px;
  147.         }
  148.         .single-pricing{}
  149.         .single-pricing h5 {
  150.             font-size: 14px;
  151.             margin-bottom: 0px;
  152.             text-transform: uppercase;
  153.         }
  154.         .single-pricing ul{
  155.             list-style: none;
  156.             margin-bottom: 20px;
  157.             margin-top: 30px;
  158.         }
  159.         .single-pricing ul li{line-height: 35px;}
  160.         .single-pricing button {
  161.             background:#ff9100;
  162.             border: 2px solid #ff9100;
  163.             border-radius: 0.25rem;
  164.             color: white;
  165.             display: inline-block;
  166.             font-size: 16px;
  167.             width: -webkit-fill-available;
  168.             overflow: hidden;
  169.             padding:10px 45px;
  170.             text-transform: capitalize;
  171.             transition: all 0.3s ease 0s;
  172.         }
  173.         .single-pricing button:hover, .single-pricing a:focus{
  174.             background:#ff9100;
  175.             color: #ffffff;
  176.             border: 2px solid #ff9100;
  177.         }
  178.         .single-pricing-white{background: #5b0909
  179.         }
  180.         .single-pricing-white ul li{color:#fff;}
  181.         .single-pricing-white h2{color:#fff;}
  182.         .single-pricing-white h1{color:#fff;}
  183.         .single-pricing-white h5{color:#fff;}
  184.         /*breadcrumb style*/
  185.         .hm-gradient {
  186.             background-image: linear-gradient(to top, #f3e7e9 0%, #e3eeff 99%, #e3eeff 100%);
  187.         }
  188.         .darken-grey-text {
  189.             color: #2E2E2E;
  190.         }
  191.         .bc-icons .breadcrumb-item + .breadcrumb-item::before {
  192.             content: none; }
  193.         .bc-icons .breadcrumb-item.active {
  194.             color: #eeeeee; }
  195.         .bc-icons-2 .breadcrumb-item + .breadcrumb-item::before {
  196.             content: none; }
  197.         .bc-icons-2 .breadcrumb-item.active {
  198.             color: #455a64; }
  199.         .light-font .breadcrumb-item + .breadcrumb-item::before {
  200.             color: #fff; }
  201.         .light-font .breadcrumb-item.active {
  202.             color: #cfd8dc; }
  203.         .dark-font .breadcrumb-item + .breadcrumb-item::before {
  204.             color: #000; }
  205.         .dark-font .breadcrumb-item.active {
  206.             color: #455a64; }
  207.         .breadcrumb{
  208.             background-color: transparent;
  209.         }
  210.         .work-wrap .img
  211.         {
  212.             height: auto;
  213.             width: auto;
  214.         }
  215.         @media (min-width: 992px) {
  216.             .owl-carousel .owl-dots {
  217.                 position: absolute;
  218.                 top: 0;
  219.                 right: 50px!important;
  220.                 margin-top: 0;
  221.                 margin-right: -40px; }
  222.             .owl-carousel .owl-dots .owl-dot {
  223.                 display: block; }
  224.         }
  225.         .table-bordered {
  226.     border: 1px solid #232022;
  227.     background: #f3f6f9;
  228.     border-radius: 18px;
  229. }
  230.         @media screen and (max-width: 768px) 
  231.         {
  232.             .hotel_info_text {
  233.                 width: 106% !important;
  234.                 margin-left:-10px!important;
  235.             }
  236.             table{
  237.                 max-width: 340px !important;
  238.                 margin-left: 11px !important;
  239.             }
  240.             .tablenavire
  241.             {
  242.                 max-width: 350px !important;
  243.                 margin-left: 2px !important;
  244.                 margin-top: 12px !important;
  245.             }
  246.             .testimage
  247.             {
  248.                 height: 350px!important;
  249.                 margin-left: -21px!important;
  250.                 margin-top: 10px!important;
  251.                 max-width: 350px !important;
  252.             }
  253.             .card-block
  254.             {
  255.                 width: 358px!important;
  256.                 height: 50px!important;
  257.                 margin-left: -35px!important;
  258.             }
  259.             .form-control
  260.             {
  261.                 margin-left:2px!important;
  262.             }
  263.             .offers_price1
  264.             {
  265.                 margin-top: -70px!important;
  266.                 margin-left: 68px!important;
  267.             }
  268.             .img3
  269.             {
  270.                 height: 260px !important;
  271.                 margin-top: 22px !important;
  272.                 width: 350px !important;
  273.                 margin-left: -26px !important;
  274.             }
  275.             .img1
  276.             {
  277.                 width: 350px !important;
  278.                 margin-left: 4px !important;
  279.             }
  280.             .ftco-section {
  281.                 padding: 1em 0!important;
  282.                 margin-top: -100px;
  283.             }
  284.             .owl-carousel
  285.             {
  286.                 margin-left: -25px!important;
  287.             }
  288.         }
  289.     
  290.         .owl-carousel .owl-dots
  291.         {
  292.             text-align: justify;
  293.             margin-top: 15px;
  294.         }
  295.         .ftco-section
  296.         {
  297.             padding: 5em 0;
  298.             margin-top: -35px;
  299.         }
  300.         .owl-carousel .owl-nav {
  301.             position: absolute;
  302.             bottom: 0;
  303.             left: 0;
  304.             right: 0;
  305.             display: none;
  306.         }
  307.         .badge
  308.         {
  309.             border: 1px solid white;
  310.             background: white;
  311.             color: #ff9600;
  312.             width: 100%;
  313.             height: 50px;
  314.         }
  315.         .badges{
  316.             font-size: 95%;
  317.             height: 26px;
  318.             line-height: normal;
  319.             font-weight: 600;
  320.             background-color: #b29b63;
  321.         }
  322.         /* Ajoutez ces styles dans votre fichier CSS ou entre les balises <style> dans l'en-tête HTML */
  323.         /* Pour rendre les images réactives */
  324.         .featured-carousel img {
  325.             max-width: 100%;
  326.             height: auto;
  327.         }
  328.         .offers_price span{
  329.             color: #ff9600;
  330.         }
  331.         button {
  332.             margin: 20px;
  333.         }
  334.         .custom-btn {
  335.             width: 130px;
  336.             height: 40px;
  337.             color: #fff;
  338.             border-radius: 5px;
  339.             padding: 10px 25px;
  340.             font-family: 'Lato', sans-serif;
  341.             font-weight: 500;
  342.             background: transparent;
  343.             cursor: pointer;
  344.             transition: all 0.3s ease;
  345.             position: relative;
  346.             display: inline-block;
  347.             box-shadow:inset 2px 2px 2px 0px rgba(255,255,255,.5),
  348.             7px 7px 20px 0px rgba(0,0,0,.1),
  349.             4px 4px 5px 0px rgba(0,0,0,.1);
  350.             outline: none;
  351.         }
  352.         /* 3 */
  353.         .reserveButton
  354.         {
  355.             background: #ff9600;
  356.             width: 200px;
  357.             height: 39px;
  358.             line-height: 40px;
  359.             margin-left: 30px;
  360.             padding: 0;
  361.             border: none;
  362.             border-radius: 5px;
  363.         }
  364.         .btn-3 {
  365.             background: #ff9600;
  366.             width: 200px;
  367.             height: 50px;
  368.             line-height: 52px;
  369.             margin-left: 30px;
  370.             padding: 0;
  371.             border: none;
  372.             border-radius: 5px;
  373.         }
  374.         .btn-3 span {
  375.             position: relative;
  376.             display: block;
  377.             width: 100%;
  378.             height: 100%;
  379.         }
  380.         .btn-3:before,
  381.         .btn-3:after {
  382.             position: absolute;
  383.             content: "";
  384.             right: 0;
  385.             top: 0;
  386.             background: #ff9600;
  387.             border-radius: 5px;
  388.             transition: all 0.3s ease;
  389.         }
  390.         .btn-3:before {
  391.             height: 0%;
  392.             width: 2px;
  393.         }
  394.         .btn-3:after {
  395.             width: 0%;
  396.             height: 2px;
  397.         }
  398.         /*.btn-3:hover{*/
  399.         /*    background: transparent;*/
  400.         /*    box-shadow: none;*/
  401.         /*}*/
  402.         /*.btn-3:hover:before {*/
  403.         /*    height: 100%;*/
  404.         /*}*/
  405.         /*.btn-3:hover:after {*/
  406.         /*    width: 100%;*/
  407.         /*}*/
  408.         /*.btn-3 span:hover{*/
  409.         /*    color: #ff9600;*/
  410.         /*    border-radius: 5px;*/
  411.         /*}*/
  412.         .btn-3 span:before,
  413.         .btn-3 span:after {
  414.             position: absolute;
  415.             content: "";
  416.             left: 0;
  417.             bottom: 0;
  418.             background: #ff9600;
  419.             border-radius: 5px;
  420.             transition: all 0.3s ease;
  421.         }
  422.         .btn-3 span:before {
  423.             width: 2px;
  424.             height: 0%;
  425.         }
  426.         .btn-3 span:after {
  427.             width: 0%;
  428.             height: 2px;
  429.         }
  430.         /*.btn-3 span:hover:before {*/
  431.         /*    height: 100%;*/
  432.         /*}*/
  433.         /*.btn-3 span:hover:after {*/
  434.         /*    width: 100%;*/
  435.         /*}*/
  436.         /*a:hover{*/
  437.         /*    color: #ff9600!important;*/
  438.         /*    font-size: 16px;*/
  439.         /*    font-weight: 500;*/
  440.         /*}*/
  441.         .text-xs 
  442.         {
  443.             font-size: 10px;
  444.             line-height: 1rem;
  445.         }
  446.     </style>
  447. {% endblock %}
  448. {% block body %}
  449.     <!-- Home -->
  450.     <div class="home" style="height: 100px"></div>
  451.     <!-- Blog -->
  452.     <div class="blog">
  453.         <div class="container">
  454.             <div class="row">
  455.                 <!-- Grid column -->
  456.                 <div class="col-md-12">
  457.                     <div class="card p-3" style="border: none;">
  458.                         <div class="card-block" style="width: 500px;height: 50px;margin-left: -35px">
  459.                             <div class="bc-icons-2">
  460.                                 <ol class="breadcrumb blue-grey lighten-4">
  461.                                     <li class="breadcrumb-item"><a class="black-text" href="#" style="font-weight: 600;font-size: 16px;color:#d7000e"><i class="fa fa-home" aria-hidden="true"></i></a><i class="fa fa-angle-double-right mx-2" aria-hidden="true"></i></li>
  462.                                     <li class="breadcrumb-item"><a class="black-text" href="#" style="font-weight: 600;font-size: 16px;color:#d7000e">Croisière</a><i class="fa fa-angle-double-right mx-2" aria-hidden="true"></i></li>
  463.                                     <li class="breadcrumb-item active" style="font-weight: 600;font-size: 16px">{{ sousCroisiere.name }}</li>
  464.                                 </ol>
  465.                             </div>
  466.                         </div>
  467.                     </div>
  468.                 </div>
  469.                 <!-- Grid column -->
  470.             </div>
  471.             <div class="row">
  472.                 <div class="col-lg-8">
  473.                     <div class="blog_post_container">
  474.                         <div class="blog_post">
  475.                             <div class="hotel_info_text">
  476.                                 <div class="container mt-5">
  477.                                     <section class="ftco-section">
  478.                                         
  479.                                             <div class="container">
  480.                                                 <div class="row">
  481.                                                     <div class="col-md-4">
  482.                                                         <div class="featured-carousel owl-carousel">
  483.                                                             {% if sousCroisiere.imagessouscroisieres is not empty %}
  484.                                                                 {% for photo in sousCroisiere.imagessouscroisieres %}
  485.                                                                     <div class="item">
  486.                                                                         <div class="work-wrap">
  487.                                                                             <div class="img order-md-last">
  488.                                                                                 <img src="{{ asset('./rusticav/public/uploads/souscroisieres/' ~ photo.name) }}" alt="" width="90%" height="90%" style="margin: 15px"/>
  489.                                                                             </div>
  490.                                                                         </div>
  491.                                                                     </div>
  492.                                                                 {% endfor %}
  493.                                                             {% endif %}
  494.                                                         </div>
  495.                                                     </div>
  496.                                                     <div class="col-md-6">
  497.                                                         <h5 style="margin-top: 17px;color: #0093a9;font-weight: 600;font-size: 28px"><i class="fa fa-map-marker"></i> {{ sousCroisiere.name }}</h5>
  498.                                                         <h6 style="margin-top: 15px;color: black;font-weight: 300;"><i class="fa fa-anchor" aria-hidden="true"></i>{{ sousCroisiere.destination }}</h6>
  499.                                                         <h6 style="margin-top: 15px;color: black;font-weight: 300;">
  500.                                                             <i class="fa fa-ship" aria-hidden="true"></i>
  501.                                                             {{ sousCroisiere.navire.titre }}
  502.                                                         </h6>
  503.                                                         <h6 style="margin-top: 15px;color: black;font-weight: 600;">
  504.                                                         <i class="fa fa-clock-o" aria-hidden="true" style="color: black"></i>
  505.                                                         {{sousCroisiere.duree}} jours / {{sousCroisiere.duree-1}} Nuits
  506.                                                         </h6>
  507.                                                         <p style="margin-top: 15px;margin-left:1px;color: red;font-weight: 600" >Avantages durant la croisière</p>
  508.                                                         <h6 style="margin-top: -20px;color: black;font-weight: 300;">
  509.                                                             <ul>
  510.                                                                 {% for a in sousCroisiere.avantages %}
  511.                                                                     <li>
  512.                                                                     <span class="badges badge-danger">
  513.                                                                         {% for img in a.imagesavantages %}
  514.                                                                             <img src="{{ asset('./rusticav/public/uploads/avantages/' ~ img.name) }}" alt="" style="width:25px;height:19px;margin-top:-4px;"/>
  515.                                                                         {% endfor %}
  516.                                                                         <span>{{ a.name }}</span>
  517.                                                                     </span></li><br>
  518.                                                                 {% endfor %}
  519.                                                             </ul>
  520.                                                         </h6>
  521.                                                     </div>
  522.                                                     {# <div class="col-md-2">
  523.                                                         <div class="offers_price" style="margin-top: 60px">
  524.                                                             {% set totalprix = 0 %}
  525.                                                             {% if sousCroisiere.souscroisiererooms is defined and sousCroisiere.souscroisiererooms|length > 0 %}
  526.                                                                 {% set firstSouscroisierecabine = sousCroisiere.souscroisiererooms[0] %}
  527.                                                                 {% if firstSouscroisierecabine.souscroisierepricerooms is defined and firstSouscroisierecabine.souscroisierepricerooms|length > 0 %}
  528.                                                                     {% set firstSouscroisierepricecabine = firstSouscroisierecabine.souscroisierepricerooms[0] %}
  529.                                                                     {% if firstSouscroisierepricecabine.price is defined %}
  530.                                                                         {% set totalprix = totalprix + firstSouscroisierepricecabine.price %}
  531.                                                                     {% endif %}
  532.                                                                 {% endif %}
  533.                                                             {% endif %}
  534.                                                             <div class="offers_price1">
  535.                                                             <span class="text-center" style="margin-left: 30px;font-size: 15px;color: black;font-weight: 300" >A partir de:</span><br><br>
  536.                                                             <span class="badge badge-danger" style="font-size: 41px;font-weight: 600;margin-left: -22px;color: red">
  537.                                                                 {{ totalprix }} TND
  538.                                                             </span>
  539.                                                             </div>
  540.                                                         </div>
  541.                                                     </div> #}
  542.                                                     <div class="col-md-2">
  543.                                                         <div class="offers_price" style="margin-top: 60px">
  544.                                                             {% set minPrix = null %}
  545.                                                             
  546.                                                             {% if sousCroisiere.souscroisiererooms is defined and sousCroisiere.souscroisiererooms|length > 0 %}
  547.                                                                 {% for cabine in sousCroisiere.souscroisiererooms %}
  548.                                                                     {% if cabine.souscroisierepricerooms is defined and cabine.souscroisierepricerooms|length > 0 %}
  549.                                                                         {% for priceCabine in cabine.souscroisierepricerooms %}
  550.                                                                             {% if priceCabine.price is defined %}
  551.                                                                                 {% if minPrix is null or priceCabine.price < minPrix %}
  552.                                                                                     {% set minPrix = priceCabine.price %}
  553.                                                                                 {% endif %}
  554.                                                                             {% endif %}
  555.                                                                         {% endfor %}
  556.                                                                     {% endif %}
  557.                                                                 {% endfor %}
  558.                                                             {% endif %}
  559.                                                             
  560.                                                             <div class="offers_price1">
  561.                                                                 <span class="text-center" style="margin-left: 30px;font-size: 15px;color: black;font-weight: 300">A partir de:</span><br><br>
  562.                                                                 <span class="badge badge-danger" style="font-size: 41px;font-weight: 600;margin-left: -22px;color: #5586c2">
  563.                                                                     {{ minPrix is not null ? minPrix : 'N/A' }} TND
  564.                                                                 </span>
  565.                                                             </div>
  566.                                                         </div>
  567.                                                     </div>
  568.                                                 </div>
  569.                                             </div>
  570.                                     </section>
  571.                                 </div>
  572.                             </div>
  573.                             <div class="hotel_info_text">
  574.                                 <p style="margin-left: 10px">
  575.                                     {{ sousCroisiere.itineraire|raw }}
  576.                                 </p>
  577.                             </div>
  578.                             <div class="hotel_info_text">
  579.                                 <br>
  580.                                 <div class="row">
  581.                                     <div class="col-md-5">
  582.                                         {% for img in sousCroisiere.navire.imagesnavires %}
  583.                                             {% if loop.first %}
  584.                                                 <img class="img1" src="{{ asset('./rusticav/public/uploads/navires/'~img.name) }}" alt="" width="90%" height="90%" style="margin-left: 30px" />
  585.                                             {% endif %}
  586.                                         {% endfor %}
  587.                                     </div>
  588.                                     <div class="col-md-7">
  589.                                         <h4 style="font-weight: 700">Fiche technique</h4>
  590.                                         {{ sousCroisiere.navire.technique|raw}}
  591.                                     </div>
  592.                                 </div>
  593.                             </div>
  594.                             
  595.                             
  596. <div class="hotel_info_text">
  597.     <div class="container">
  598.         <div class="row">
  599.             <div class="col-md-5">
  600.                 <div class="packs-container">
  601.                     <br><br>
  602.                     <!-- Boucle pour itérer sur toutes les plages de dates disponibles -->
  603.                     <select id="dateRangesDropdown" class="form-control" style="margin-left:400px;">
  604.                         <option value="all">Toutes les dates</option>
  605.                         {% for pack, packData in dataByPack %}
  606.                             {% for dateRange in packData.dateRanges %}
  607.                                 <option 
  608.                                     value="{{ dateRange.dated }} - {{ dateRange.datef }}"
  609.                                     data-roomdata="{{ dateRange.roomData | json_encode }}"
  610.                                     data-monthyear="{{ dateRange.dated | date("F Y") }}"
  611.                                 >
  612.                                     {{ dateRange.dated | date("F Y") }}
  613.                                 </option>
  614.                             {% endfor %}
  615.                         {% endfor %}
  616.                     </select>
  617.                 </div>
  618.             </div>
  619.         </div><br><br>
  620.         <div class="row">
  621.             <div class="col-md-12">
  622.                 <div id="selectedData" class="selected-data">
  623.                     <section id="pricing" class="pricing-content section-padding">
  624.                         <div class="container">
  625.                             <div class="row text-center" id="chambreInfo"></div>
  626.                         </div>
  627.                     </section>
  628.                 </div>
  629.             </div>
  630.         </div>
  631.     </div>
  632. </div>
  633. <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  634. <script>
  635.     $(document).ready(function () {
  636.         $('#dateRangesDropdown').change(function () {
  637.             displaySelectedData();
  638.         });
  639.         // Affichez les informations sélectionnées du premier date de la première pack lors du chargement
  640.         displaySelectedData();
  641.     });
  642.     var souscroisiereId = {{ sousCroisiere.id }}; // Assurez-vous que cette variable est correctement définie
  643.     // Fonction pour afficher les informations sélectionnées
  644.     function displaySelectedData() {
  645.         var selectedOption = $('#dateRangesDropdown option:selected');
  646.         var value = selectedOption.val();
  647.         var monthYear = selectedOption.data('monthyear');
  648.         var groupedOptions = $('#dateRangesDropdown option').filter(function() {
  649.             return $(this).data('monthyear') === monthYear;
  650.         });
  651.         var chambreInfoDiv = $('#chambreInfo');
  652.         chambreInfoDiv.empty(); // Clear existing data
  653.         if (value === "all") {
  654.             // Stocker la date sélectionnée pour une utilisation ultérieure
  655.             selectedAllDate = $('#dateRangesDropdown').val();
  656.             // Afficher toutes les données disponibles
  657.             $('#dateRangesDropdown option').each(function() {
  658.                 if ($(this).val() !== "all") {
  659.                     var roomData = $(this).data('roomdata');
  660.                     var table = $('<table class="table table-bordered"></table>');
  661.                     var tbody = $('<tbody></tbody>');
  662.                     var dates = $(this).val().split(' - ');
  663.                     var formattedDates = 'Du ' + formatDate(dates[0]) + ' au ' + formatDate(dates[1]);
  664.                     var dateRange = $('<tr style="background: #2980b9;color: white;"><td colspan="4" style="font-weight:700;font-size:16px;">' + formattedDates + '</td></tr>');
  665.                     tbody.append(dateRange);
  666.                     var row = $('<tr></tr>');
  667.                     $.each(roomData, function(cabineName, room) {
  668.                         var cell = '<td>' + cabineName + ' <br/><span style="font-size:15px;font-weight:700"> ' + room.price + 'TND</span> <span class="text-xs">/pers.</span></td>';
  669.                         row.append(cell);
  670.                     });
  671.                     tbody.append(row);
  672.                     table.append(tbody);
  673.                     // Ajouter le tableau au div chambreInfo
  674.                     chambreInfoDiv.append(table);
  675.                     // Ajouter le bouton "Obtenir un devis gratuit"
  676.                     addReservationButton(table, $(this).val(), roomData);
  677.                 }
  678.             });
  679.         } else {
  680.             groupedOptions.each(function() {
  681.                 var roomData = $(this).data('roomdata');
  682.                 var table = $('<table class="table table-bordered"></table>');
  683.                 var tbody = $('<tbody></tbody>');
  684.                 
  685.                 var dates = $(this).val().split(' - ');
  686.                 var formattedDates = 'Du ' + formatDate(dates[0]) + ' au ' + formatDate(dates[1]);
  687.                 var dateRange = $('<tr><td colspan="' + Object.keys(roomData).length + '">' + formattedDates + '</td></tr>');
  688.                 tbody.append(dateRange);
  689.                 var row = $('<tr></tr>');
  690.                 $.each(roomData, function(cabineName, room) {
  691.                     var cell = '<td>' + cabineName + ' <br/> ' + room.price + 'TND <span class="text-xs">/pers.</span></td>';
  692.                     row.append(cell);
  693.                 });
  694.                 tbody.append(row);
  695.                 table.append(tbody);
  696.                 chambreInfoDiv.append(table);
  697.                 // Ajouter le bouton "Obtenir un devis gratuit"
  698.                 addReservationButton(table, $(this).val(), roomData);
  699.             });
  700.         }
  701.     }
  702.     // Fonction pour formater la date
  703.     function formatDate(dateString) {
  704.         var date = new Date(dateString);
  705.         var day = date.getDate();
  706.         var month = date.toLocaleString('default', { month: 'long' });
  707.         var year = date.getFullYear();
  708.         return day + ' ' + month + ' ' + year;
  709.     }
  710.     // Fonction pour ajouter un bouton "Obtenir un devis gratuit" à un tableau de données de chambre existant
  711.     function addReservationButton(table, selectedDate, roomData) {
  712.         // Créer une nouvelle ligne pour le bouton "Obtenir un devis gratuit"
  713.         var buttonRow = $('<tr></tr>');
  714.         var buttonCell = $('<td colspan="' + Object.keys(roomData).length + '"></td>');
  715.         var button = $('<button class="reserveButton"><span style="color: white;font-size: 16px;font-weight: 500">Obtenir un devis gratuit</span></button>');
  716.         // Ajouter l'attribut data-selecteddate au bouton "Obtenir un devis gratuit"
  717.         button.attr('data-selecteddate', selectedDate);
  718.         // Ajouter l'attribut data-roomdata au bouton "Obtenir un devis gratuit" pour stocker les types de chambre
  719.         button.attr('data-roomdata', JSON.stringify(roomData));
  720.         buttonCell.append(button);
  721.         buttonRow.append(buttonCell);
  722.         table.append(buttonRow);
  723.     }
  724.     // Ajouter un écouteur d'événements pour le clic sur le bouton "Obtenir un devis gratuit"
  725.     $(document).on('click', '.reserveButton', function () {
  726.         // Récupérer la date sélectionnée à partir de l'attribut data-selecteddate
  727.         var selectedDate = $(this).data('selecteddate');
  728.         // Rediriger vers la nouvelle page avec la date sélectionnée
  729.         redirectToNewPage(selectedDate);
  730.     });
  731.     // Fonction pour rediriger vers la nouvelle page avec la date sélectionnée et les types de chambre
  732.     function redirectToNewPage(selectedDate) {
  733.         // Récupérer les types de chambre à partir de l'attribut de données du bouton "Obtenir un devis gratuit"
  734.         var roomData = $('.reserveButton[data-selecteddate="' + selectedDate + '"]').data('roomdata');
  735.         // Créer un formulaire dynamique
  736.         var form = $('<form method="post" action="/page_suivante/' + souscroisiereId + '"></form>');
  737.         // Ajouter un champ pour la date sélectionnée
  738.         var selectedDateInput = $('<input type="hidden" name="selectedDate" value="' + selectedDate + '">');
  739.         form.append(selectedDateInput);
  740.         // Ajouter un champ pour les types de chambre
  741.         var roomDataInput = $('<input type="hidden" name="roomData" value=\'' + JSON.stringify(roomData) + '\'>');
  742.         form.append(roomDataInput);
  743.         // Ajouter le formulaire à la page et le soumettre
  744.         $('body').append(form);
  745.         form.submit();
  746.     }
  747. </script>
  748.                             
  749.                             
  750.                         </div>
  751.                     </div>
  752.                 </div>
  753.             </div>
  754.         </div>
  755.     </div>
  756.     <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  757.     <script src="{{ asset('slider/js/popper.js') }}"></script>
  758.     <script src="{{ asset('slider/js/bootstrap.min.js') }}"></script>
  759.     <script src="{{ asset('slider/js/owl.carousel.min.js') }}"></script>
  760.     <script src="{{ asset('slider/js/main.js') }}"></script>
  761. {% endblock %}