src/Flexy/FrontBundle/Themes/CoWorking/templates/reservation/reservation-meeting-step.html.twig line 1

  1. {% extends '@Flexy/FrontBundle/Themes/CoWorking/templates/layout.html.twig' %}
  2. {% block stylesheets %}
  3. {{ parent() }}
  4.  <link rel="stylesheet" href="{{ asset('themes/coworking/css/reservation.css') }}" />
  5.  
  6. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.css" />
  7.  <style>
  8.   
  9.   .form-check {
  10.  
  11.     min-height: 1.9rem !important;
  12.     }
  13.   .modal-backdrop.fade.show {Théâtre
  14.         display: none;
  15. }
  16.  
  17.  
  18. /* css checkbox*/
  19. /* hide checkbox */
  20. input[type="checkbox"] {
  21.   display: none;
  22. }
  23. /* if checkbox is checked, then do these things */
  24. /*input[type="checkbox"]:checked + label {
  25.   color: white;
  26.   background:#FFD86E;
  27.   border-radius: 5px;
  28.   padding: 0px 10px 0px 10px;
  29. }
  30. /* styles when hovering over options */
  31. label:hover {
  32.   cursor: pointer;
  33.   
  34.   /* transitions and animations */
  35.   -webkit-transition: color .5s ease;
  36.   -moz-transition: color .5s ease;
  37.   -ms-transition: color .5s ease;
  38.   -o-transition: color .5s ease;
  39.   transition: color .5s ease;
  40. }
  41. .boutton-step{
  42.   padding:10px; 
  43.   text-decoration:none; 
  44.   width:230px; 
  45.    font-size: 12px;
  46.     font-family: 'PT Sans', sans-serif;
  47.     letter-spacing:2px;
  48. }
  49.   
  50. input.button {
  51.   
  52.     width:130px;
  53.     height:50px;
  54.     margin: 20px 0 30px 0;
  55.     padding: 0px 20px 0px 20px;
  56.     background: #e6e6e6;
  57.     border-radius:5px;
  58.     border: 1px solid #ccc;
  59.     font-family: OpenSans, sans-serif;
  60.     font-size:16pt;
  61.     color:#444;
  62. }
  63. .Addons label{
  64.     font-size:12px !important;
  65.     font-family: 'roboto';
  66.     font-weight: 500;
  67.     border: 1px solid #80808024;
  68.     margin: 2px;
  69.     padding: 0px 5px 0px 5px;
  70.     border-radius: 5px;
  71. }
  72. .multistep-container .active-button li:not(:first-child) .round-btn:before {
  73.     position: absolute;
  74.     content: '';
  75.     width: 141px;
  76.     height: 3px;
  77.     background-color: #E9F2FA;
  78.     left: -120px;
  79. }
  80. .multistep-container .active-button li {
  81.     display: inline-block;
  82.     width: 140px;
  83. }
  84. .form-check {
  85.     line-height: 22px;
  86. }   
  87. .col-md-12.col-lg-12.col-sm-12.d-flex.justify-content-end.align-items-end.mb-3{
  88.         flex: 0 0 86%;
  89. }
  90.  @media (max-width:767px) {
  91.                 html, body {
  92.                   overflow-x: hidden  !important;
  93.                 }
  94.                 body {
  95.                   position: relative !important;
  96.                 }
  97.                 .col-sm-8.reservation-steeps {
  98.                     padding:0%;
  99.                 }
  100.                 .multistep-container .mutistep-form-area .form-box{
  101.                     position: relative;
  102.                     top: 33px;
  103.                     left: 0px;
  104.                 }
  105.                 .multistep-container .active-button li{
  106.                     display: inline-block;
  107.                     width: 100px;
  108.                 }
  109.                 .panel-sticky{
  110.                     font-size:12px;
  111.                 }
  112.               h6.display-6.header-steeps {
  113.                 margin-left: 3%;
  114.             }
  115.             h6.datetime{
  116.                  margin-left: 3%;
  117.             }
  118.             a#seeDetails {
  119.                 margin-bottom: -11%;
  120.             }
  121.             a#seePrice {
  122.                 float: right;
  123.                 margin-right: 52%;
  124.             }
  125.  }
  126.     
  127.      li.etape1:before {
  128.     background: #7ED670 !important; /* Change the background color */
  129.     color: white !important;
  130. }
  131.   .titre-page{
  132. margin-top:10px;
  133. font-size: 20px;
  134. line-height:45.29px;
  135. color: #000000;
  136. .radio-buttons {
  137.   display: flex;
  138. }
  139. .radio-buttons input[type="radio"] {
  140.   display: none;
  141. }
  142. .radio-buttons label {
  143.   display: block;
  144.   margin-right: 40px;
  145.   cursor: pointer;
  146. }
  147. .radio-buttons label img {
  148.   border-radius: 10px;
  149.   width: 100px;  
  150.   height: 110px;  
  151.   box-shadow: rgba(17, 17, 26, 0.05) 0px 1px 0px, rgba(17, 17, 26, 0.1) 0px 0px 8px;
  152. }
  153. .radio-buttons input[type="radio"]:checked + label img {
  154.   border: 2px solid #FFCB00 ; /* Style pour indiquer la sélection, vous pouvez personnaliser */
  155. }
  156.  
  157. </style>
  158.   
  159.   
  160. {% endblock  %}
  161. {% block body %}
  162.  
  163.  
  164.  
  165.  
  166.   <img src="{{asset('themes/coworking/front/images/sallereunion.jpg')}}" style="width: 100%;height: 520px;" class="img-fluid" />
  167.   <div class="container">
  168.     <div class="row justify-content-between">
  169.       <div class="col-sm-8 reservation-steeps">
  170.        
  171.        <div class="row">
  172.           <div class="col-sm-8">
  173.             <h6 class="titre-page">Réservation {{name}}
  174.                 
  175.             </h6>
  176.           </div>
  177.           <div class="col-sm-4" style="margin-top:10px;">
  178.             <a href="/themes/coworking/front/images/prixSalles.pdf" class="btn-res text-center text-light text-uppercase bg-dark" style="float: right;padding: 8px;border-radius: 6px;font-size:13px;" target="_blank"> NOS TARIFS</a>
  179.           </div>
  180.         </div>
  181.        
  182.        
  183.         <div class="container">
  184.          
  185.               
  186.                    
  187.   <div class="container d-flex justify-content-center align-items-center">
  188.          
  189.          
  190.           <ul id="progressbar">
  191.          <li class="etape1"> <span> Type</span>  </li>
  192.         <li class="active" > Formule </li>
  193.         <li> Dates</li>
  194.         <li> Confirmation</li>
  195.            
  196.           
  197.                 </ul>
  198.         </div>
  199.             
  200.             <div class="col-xl-12" style="top: 20px;">
  201.               
  202.               <div class="multistep-container">
  203.                 <div class="mutistep-form-area">
  204.                     
  205.                  
  206.                   <div class="form-box">
  207.                 
  208.                     
  209.                  
  210.                        
  211.                             <div class="container" >
  212.                   
  213.               
  214.                
  215.                  <div id="form-attribue" style="line-height: 20px;" class="mt-4"> 
  216.                <h5>Veuillez choisir une formule </h5>
  217.                    
  218.                 
  219.                   {% for attr in  attributValues %}
  220.                    {% if attr.code == "check" %}     
  221.                     
  222.                      <div class="form-check">
  223.                       <input class="form-check-input option" data-time="{{attr.attribut.name}}"  data-days="{{ attr.attribut.description}}" data-id="{{attr.product.id}}" data-name="{{attr.product.name}}"  data-price="{{attr.price}}" class="option"   type="radio" name="radioGroup" id="radio{{ attr.attribut.id}}" value="{{attr.attribut.name}}"  />
  224.                       <label class="form-check-label"  data-time="{{attr.attribut.name}}"  data-days=" {{ attr.attribut.description}}" data-id="{{attr.product.id}}" data-name="{{attr.product.name}}"   data-price="{{attr.price}}"    for="radio{{ attr.attribut.id}}">  {% if(attr.attribut.name == "1 Jour") %} Journée entière  {% else %} {{attr.attribut.name}}  {% endif %}  </label><br>
  225.                       {% if(attr.attribut.name == "Demi-Journée") %} 
  226.                     
  227.                    
  228.                      <small>Choisir une plage horaire :</small>
  229.                       <select class="form-select" id="plage-horaire" style="width: 37%;" name="plage-horaire" disabled>
  230.                           <option value=""> Plage horaire</option>
  231.                         <option value="matin">Matin (8h00-13h00)</option>
  232.                         <option value="apres-midi">Après-midi (13h00-18H00)</option>
  233.                       </select>
  234.              
  235.                       {% endif %} 
  236.                       
  237.                     </div>
  238.                      
  239.                      {% endif %}
  240.                    {% endfor %}
  241.                     {% for attr in  attributValues %}
  242.                   {% if attr.code == "simple" %}
  243.                   
  244.                 <div class="form-check"  >
  245.                 <input class="form-check-input option"  data-days="10"  data-id="{{attr.product.id}}" data-name="{{attr.product.name}}"  data-price="{{attr.price}}" type="radio" name="radioGroup" class="option" id="radio1" value="{{attr.attribut.name}}" />
  246.                 <label class="form-check-label"    data-days="10"  data-id="{{attr.product.id}}" data-name="{{attr.product.name}}"  data-price="{{attr.price}}" for="radio1"> {{attr.attribut.name}} </label><br>
  247.                 <small>
  248.                   
  249.                   {{attr.attribut.description}}
  250.                   </small>
  251.                 </div>
  252.                 
  253.                   {% endif %}
  254.                   {% endfor %}
  255.                      {#  {% if attributValues|length > 0 %}
  256.                 
  257.                 <!-- <div class="form-check">
  258.                         <input class="form-check-input" type="radio" name="radioGroup" id="radio2" />
  259.                         <label class="form-check-label" for="radio2">Location “Pass jours”</label><br>
  260.                         <small>Cette formule est déclinée comme suit :</small>
  261.                         <select style="padding: 4px;" class="col-6  option " id="serviceFormule" >
  262.                              <option value="" data-price=""  >Sélectionner un choix</option>
  263.                     
  264.                          {% for attr in attributValues %}
  265.                          {% if attr.code == "multiple" %}
  266.                         <option  value="{{attr.attribut.name}}" data-days="{{attr.attribut.description}}"  data-id="{{attr.product.id}}" data-name="{{attr.product.name}}"  data-price="{{attr.price}}"  >{{attr.attribut.name}}</option>
  267.                         {% endif %}
  268.                         {% endfor %}
  269.                         </select>
  270.                  </div>-->
  271.                {% endif %}  #} 
  272.              {% for attr in  attributValues %}
  273.                    {% if attr.code == "personalized" %}     
  274.                     
  275.                      <div class="form-check">
  276.                       <input class="form-check-input"  data-days="30" data-id="{{attr.product.id}}" data-name="{{attr.product.name}}"  data-price="{{attr.price}}"   type="radio" name="radioGroup" id="radio{{ attr.attribut.id}}"  />
  277.                       <label class="form-check-label" data-days="30" data-id="{{attr.product.id}}" data-name="{{attr.product.name}}"   data-price="{{attr.price}}"    for="radio{{ attr.attribut.id}}">  {{ attr.attribut.name}}   </label><br>
  278.                       
  279.                        <small> {{ attr.attribut.description}}</small>
  280.                     </div>
  281.                      
  282.                      {% endif %}
  283.                    {% endfor %}
  284.                    
  285.                  {% set room = name|replace({'Meeting room ': ''}) %}
  286.                  {% set targetRooms = ['Omega', 'Beta', 'Epsilon', 'Alpha', 'Delta'] %}
  287.                  {% set isDisabled = room in targetRooms %}
  288.                  
  289.                     <h5 style="font-weight:bold; margin-top: 20px;{% if isDisabled %}opacity: 0.5; pointer-events: none;{% endif %}" >Veuillez choisir une disposition de la salle  </h5>
  290.                    <!-- <select class="form-select" aria-label="Default select example" name="disposition"  id="disposition" style="width: 50%;">
  291.                      <option value="">Sélectionnez un choix</option>
  292.                       <option value="u">U</option>
  293.                       <option value="Théâtre">Théâtre</option>
  294.                       <option value="Ecole">Ecole</option>
  295.                       
  296.                     </select>-->
  297.                      <div class="radio-buttons">
  298.                     <input type="radio" id="u" name="disposition" value="u" required  {% if isDisabled %} disabled{% endif %} >
  299.                     <label for="u">
  300.                         <img src="{{asset('themes/coworking/front/images/U.png')}}"  style="width: 110px;height: 100px;{% if isDisabled %}opacity: 0.5; pointer-events: none;{% endif %}" class="img-fluid"  title="Disposition U"/>
  301.                     <br>
  302.                       {% if dispotionU != 0 %}
  303.                     <div class="text-center mt-1"><small>{{dispotionU}} Personnes max</small> </div>
  304.                          {% endif  %}
  305.                     </label>
  306.                     <input type="radio" id="theatre" name="disposition" value="Théâtre"  {% if isDisabled %}disabled{% endif %} >
  307.                     <label for="theatre">
  308.                      <img src="{{asset('themes/coworking/front/images/theatre.png')}}" style="width: 110px;height: 100px;{% if isDisabled %}opacity: 0.5; pointer-events: none;{% endif %}" class="img-fluid"  title="Disposition Théâtre" />
  309.                     <br>
  310.                         {% if dispotionTheatre != 0 %}
  311.                     <div class="text-center mt-1"><small>{{dispotionTheatre}} Personnes max</small></div>
  312.                          {% endif  %}
  313.                     </label>
  314.                     <input type="radio" id="ecole" name="disposition" value="Ecole"  {% if isDisabled %}disabled{% endif %} >
  315.                     <label for="ecole">
  316.                       <img src="{{asset('themes/coworking/front/images/ecole.png')}}" style="width: 110px;height: 100px;{% if isDisabled %}opacity: 0.5; pointer-events: none;{% endif %}" class="img-fluid" title="Disposition École" />
  317.                      <br>
  318.                       {% if dispotionEcole != 0 %}
  319.                     <div class="text-center mt-1"><small>{{dispotionEcole}} Personnes max </small></div>
  320.                          {% endif  %}
  321.                     </label>
  322.                   </div>
  323.                    <div class="row">
  324.                   <div class="col-md-4">
  325.                       <label for="nbr" style="font-size: 12px;{% if isDisabled %}opacity: 0.5; pointer-events: none;{% endif %}">Le nombre approximatif de personnes présentes :</label>
  326.                   </div>
  327.                   <div class="col-md-4">
  328.                       <input type="number"  id="nbr_personne" name="nbr_personne"  class="form-control" style="width:40%;{% if isDisabled %}disabled{% endif %}" min="1"/>
  329.                   </div>
  330.               </div>
  331.                     <h5 style="font-weight:bold; margin-top: 22px;">Services supplémentaires</h5>
  332.                     <h6 style="font-weight:bold; margin-top: 22px;">Voulez-vous ajouter des services supplémentaires?</h6>
  333.                    <!-- <small style="color:grey">Disponible en location au mois ou à la journée</small>-->
  334.                     <div class="row">
  335.                          <div class="col-sm-12 Addons">
  336.                             {% for service in  services %}
  337.                                     <input id="{{ service.name}}"    data-id="{{service.id}}" data-name="{{service.name}}"  data-price="{{service.price}}" type="checkbox" class="CK" name="services" value="{{ service.id}} "><label for="service"> {{ service.name}}  </label> 
  338.                             {% endfor %}<br>
  339.                             
  340.                               {% set isSimple = false %}
  341.                                 {% for attr in attributValues %}
  342.                                     {% if attr.code == "simple" %}
  343.                                         {% set isSimple = true %}
  344.                                     {% endif %}
  345.                                 {% endfor %}
  346.                                 
  347.                             {% for servicesCommun in  servicesCommuns %}
  348.                                {% if not isSimple %}
  349.                                {% if servicesCommun.id not in [94, 92, 69]  %}
  350.                             <input id="{{ servicesCommun.name }}" data-id="{{ servicesCommun.id }}" data-name="{{ servicesCommun.name }}" data-price="{{ servicesCommun.price }}" type="checkbox" class="CK" name="serviceCommun" value="{{ servicesCommun.id }} ">
  351.                             <label for="service"> {{ servicesCommun.name }} </label>
  352.                              {% endif %}
  353.                             {% else %}
  354.                         <input id="{{ servicesCommun.name }}" data-id="{{ servicesCommun.id }}" data-name="{{ servicesCommun.name }}" data-price="{{ servicesCommun.price }}" type="checkbox" class="CK" name="serviceCommun" value="{{ servicesCommun.id }} ">
  355.                         <label for="service"> {{ servicesCommun.name }} </label>
  356.                            {% endif %}
  357.                               {% endfor %}
  358.                               {#{% for servicesCommun in  servicesCommuns %}
  359.                                     <input id="{{ servicesCommun.name}}"  data-id="{{servicesCommun.id}}" data-name="{{servicesCommun.name}}"  data-price="{{servicesCommun.price}}"   type="checkbox" class="CK" name="serviceCommun" value="{{ servicesCommun.id}} "><label for="service"> {{ servicesCommun.name}}   </label>
  360.                                       
  361.                               {% endfor %}#}     
  362.  
  363.                              </div>
  364.                      
  365.                     
  366.                     </div>
  367.  
  368.                      <!--<h6 style="font-weight:bold; margin-top: 10px;">Avez vous des demandes spécifiques ?</h6>
  369.                       <textarea class="form-control" name="demande" id="textAreaExample1" rows="1" placeholder="Saisissez votre texte Ici" style="font-size: 12px;"></textarea>
  370.                    -->
  371.                   </div>
  372.               
  373.                                
  374.                     
  375.               
  376.                  </div>
  377.                     <div class="button-row">
  378.                          
  379.             <a href="{{path("reservationsallereuninon")}}"  style="border:1px solid #FFCB00 !important; color:black !important;background: #ffff !important;"  class="btn-res text-center text-light text-uppercase bg-dark ReserveNext__ boutton-step" >Étape précédente</a>
  380.             &nbsp;&nbsp;
  381.              <a href="{{path("reservationMeetingNext",{id:product, 'paramFormule': 'days'})}}" style="background: #FFCB00 !important;"  id="reservationLink" class="btn-res text-center text-light text-uppercase bg-dark ReserveNext__ boutton-step">Étape suivante</a>
  382.             
  383.                       </div> 
  384.                             
  385.                             
  386.                            
  387.                      
  388.            
  389.                     
  390.                    
  391.                   </div>
  392.                    
  393.                 
  394.                 </div>
  395.               </div>
  396.             </div>
  397.           
  398.         </div>
  399.          
  400.       
  401.       </div>
  402.          <div class="col-sm-4 reservation-steeps-panier" style="overflow-y: auto;">
  403.       
  404.         {{render(path("ajax_cart"))}}
  405.     </div>
  406.     </div>
  407.   </div>
  408.   
  409.   
  410. {% endblock %}
  411. {% block javascripts %}
  412.   <!-- MAIN CONTENT -->
  413.  
  414. <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
  415. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
  416.  
  417.  
  418. <script>
  419.   //recuperer la valeur des jours dans le formulaire .
  420.     document.getElementById('reservationLink').addEventListener('click', function() {
  421.       
  422.          var errors = ""; // Variable pour stocker les messages d'erreur
  423.         var days=0;
  424.         var check=false;
  425.         var time ="";
  426.         var isChecked = false;
  427.          var selectValue = $('#plage-horaire').val();
  428.         //var disposition = $('#disposition').val();
  429.            // Obtention de la valeur de l'option de disposition sélectionnée
  430.          var disposition = $('input[name="disposition"]:checked').val(); 
  431.          var nbrApproximatif  = $('input[name="nbr_personne"]').val(); 
  432.         
  433.      
  434.       
  435.           
  436.          var radioButtons = document.getElementsByName('radioGroup');
  437.          
  438.           for (var i = 0; i < radioButtons.length; i++) {
  439.             if (radioButtons[i].checked) {
  440.              days = parseInt(radioButtons[i].getAttribute('data-days'));
  441.              time = radioButtons[i].getAttribute('data-time');
  442.             break;
  443.             }
  444.         } 
  445.         
  446.         if(time == "Horaire" ){
  447.           check = true;
  448.         }
  449.         
  450.         
  451.         
  452.        
  453.         
  454.    // Vérification pour la plage horaire
  455.      if (time == "DEMI JOURNÉE" && selectValue == "") {
  456.         errors += "Veuillez sélectionner une plage horaire.\n";
  457.     }
  458.    
  459.          
  460.           
  461.     if (days === 0 && !isChecked) {
  462.       
  463.          errors += "Vous n'avez rien sélectionné, Veuillez sélectionner une option.\n";
  464.   
  465.     }
  466.     
  467.       // Récupération du texte du titre de la page
  468.     var excludedNames = ["Omega", "Beta", "Epsilon", "Alpha", "Delta"];
  469.     var pageTitle = document.querySelector('.titre-page').textContent.trim();
  470.     var titleEndsWithExcludedName = excludedNames.some(name => pageTitle.endsWith(name));
  471.     
  472.     
  473.      // Vérification pour la disposition
  474.     if (!disposition && !titleEndsWithExcludedName )  {
  475.         
  476.         errors += "Veuillez sélectionner une disposition.\n";
  477.     }
  478.      
  479.     // Affichage des erreurs (s'il y en a)
  480.     if (errors !== "") {
  481.         event.preventDefault(); // Empêche le lien de se déclencher
  482.         alert(errors);
  483.     }
  484.   
  485.    
  486.     
  487.         var link = document.getElementById('reservationLink');
  488.         link.href = "{{ path('reservationMeetingNext', {id: product, 'paramFormule': 'days', 'Horai12': 'VALUE', 'dIS34': 'VALUE2', 'time': 'VALUE3','proxim':'VALUE4'}) }}".replace('days', days).replace('VALUE', selectValue).replace('VALUE2', disposition).replace('VALUE3', check).replace('VALUE4',nbrApproximatif);
  489.     });
  490.   
  491.     $(document).ready(function(){
  492.     var select= $('#plage-horaire');
  493.       $('input[name="radioGroup"]').change(function(){
  494.         if ($(this).attr('id') === 'radio24') {
  495.           select.prop('disabled', false);
  496.         } else {
  497.           select.prop('selectedIndex', 0).prop('disabled', true);
  498.         }
  499.       });
  500.  $('input[type=radio][name=radioGroup]').click(function() {
  501.    // $('input[type=checkbox]').prop('checked', false);
  502. });
  503.      
  504.  $('#serviceFormule').change(function(){ 
  505.    var radio = document.getElementById('radio2');
  506.         radio.checked = true;
  507.         
  508.   //$('input[type=checkbox]').prop('checked', false); 
  509.           
  510.   });
  511.    
  512.   var radioButtons = document.getElementsByName('radioGroup');
  513.  var selectElement = document.getElementById('serviceFormule');
  514. radioButtons.forEach(function(radio) {
  515.     radio.addEventListener('click', function() {
  516.         if (radio.id === 'radio2') {
  517.             selectElement.disabled = false;
  518.            
  519.           var idProduct = $('option:nth-child(2)').attr("data-id");
  520.           var price = $('option:nth-child(2)').attr("data-price");
  521.            var name = $('option:nth-child(2)').attr("data-name");
  522.           var actionType = "add";
  523.     
  524.     $.ajax({
  525.       url:"{{path('ajax_cart')}}",
  526.       data:{
  527.         idProduct:idProduct,
  528.         price:price,
  529.         name:name,
  530.         actionType:actionType
  531.       },
  532.       success:function(result){
  533.         console.log(result);
  534.           $(".reservation-steeps-panier").html(result);
  535.       }
  536.     });
  537.            // alert(idProduct);
  538.              selectElement.val($('option:nth-child(2)').prop('selected', true));
  539.         } else {
  540.             selectElement.selectedIndex = 0; // Sélection du premier élément
  541.             selectElement.disabled = true;
  542.         }
  543.     });
  544. });
  545.      $('body').on("click",".option",function() {
  546.      
  547.      var selectedServiceIds = [];
  548.            var formule ="";
  549.             if ($(this).is(':checked')) { // Vérifie si la case est cochée
  550.         var formule = $(this).val(); // Récupère la valeur de la case cochée
  551.          
  552.     }
  553.             
  554.              $('.CK:checked').each(function() {
  555.         // Ajouter l'ID du service sélectionné à la liste
  556.         selectedServiceIds.push($(this).data('id'));
  557.   
  558.            var currentCheckbox = $(this);
  559.           $.ajax({
  560.                 url: '/reservation/ajax-service-price',
  561.                 type: 'GET', // ou 'GET' en fonction de votre besoin
  562.                 data: { 
  563.                   serviceId : $(this).data('id'),
  564.                   formule : formule
  565.                  },
  566.                 success: function(response) {
  567.                     currentCheckbox.attr('data-price', response);
  568.                     var idProduct = currentCheckbox.attr("data-id");
  569.                     var price = currentCheckbox.attr("data-price");
  570.                     var name = currentCheckbox.attr("data-name");
  571.                      if(price != 0){
  572.                     var actionType = "add";
  573.                      currentCheckbox.next('label').css({'color': 'white', 'background': 'rgb(255, 216, 110)'});
  574.                     }else{
  575.                       var actionType = "remove";
  576.                       currentCheckbox.next('label').css({'color': 'white', 'background': '#C7C8CC'});
  577.                     }
  578.              $.ajax({
  579.                 url:"{{path('ajax_cart')}}",
  580.                 data:{
  581.                   idProduct:idProduct,
  582.                   price:price,
  583.                   name:name,
  584.                   actionType:actionType
  585.                 },
  586.                 success:function(result){
  587.                   console.log(result);
  588.                     $(".reservation-steeps-panier").html(result);
  589.                 }
  590.               });                     
  591.         },
  592.                 error: function(xhr, status, error) {
  593.                     // Gérez les erreurs ici
  594.                     console.error(error);
  595.                 }
  596.             });   });
  597.    
  598.           
  599.     var idProduct = $(this).attr("data-id");
  600.     var price = $(this).attr("data-price");
  601.     var name = $(this).attr("data-name");
  602.     var actionType = "add";
  603.     
  604.     $.ajax({
  605.       url:"{{path('ajax_cart')}}",
  606.       data:{
  607.         idProduct:idProduct,
  608.         price:price,
  609.         name:name,
  610.         actionType:actionType
  611.       },
  612.       success:function(result){
  613.         console.log(result);
  614.           $(".reservation-steeps-panier").html(result);
  615.       }
  616.     });
  617.     });
  618.     $('body').on("change","select.option",function() {
  619.                 
  620.                 var selectedServiceIds = [];
  621.      
  622.                  formule =$("#serviceFormule").val();
  623.                 
  624.           
  625.  
  626.     // Parcourir toutes les cases cochées avec la classe CK
  627.     $('.CK:checked').each(function() {
  628.         // Ajouter l'ID du service sélectionné à la liste
  629.         selectedServiceIds.push($(this).data('id'));
  630.   
  631.            var currentCheckbox = $(this);
  632.       
  633.           $.ajax({
  634.                 url: '/reservation/ajax-service-price',
  635.                 type: 'GET', // ou 'GET' en fonction de votre besoin
  636.                 data: { 
  637.                   serviceId : $(this).data('id'),
  638.                   formule : formule
  639.                  },
  640.                 success: function(response) {
  641.                     currentCheckbox.attr('data-price', response);
  642.                     var idProduct = currentCheckbox.attr("data-id");
  643.                     var price = currentCheckbox.attr("data-price");
  644.                     var name = currentCheckbox.attr("data-name");
  645.                     var actionType = "add";
  646.              $.ajax({
  647.                 url:"{{path('ajax_cart')}}",
  648.                 data:{
  649.                   idProduct:idProduct,
  650.                   price:price,
  651.                   name:name,
  652.                   actionType:actionType
  653.                 },
  654.                 success:function(result){
  655.                   console.log(result);
  656.                     $(".reservation-steeps-panier").html(result);
  657.                 }
  658.               });
  659.                             
  660.                        
  661.         },
  662.                 error: function(xhr, status, error) {
  663.                     // Gérez les erreurs ici
  664.                     console.error(error);
  665.                 }
  666.             });
  667.          
  668.   
  669.           
  670.     
  671.         
  672.     });
  673.     
  674.     
  675.           
  676.     var idProduct = $(this).find("option:selected").attr("data-id");
  677.     var price = $(this).find("option:selected").attr("data-price");
  678.     var name = $(this).find("option:selected").attr("data-name");
  679.     var actionType = "add";
  680.    
  681.     $.ajax({
  682.       url:"{{path('ajax_cart')}}",
  683.       data:{
  684.         idProduct:idProduct,
  685.         price:price,
  686.         name:name,
  687.         actionType:actionType
  688.       },
  689.       success:function(result){
  690.         console.log(result);
  691.           $(".reservation-steeps-panier").html(result);
  692.       }
  693.     });
  694.     });
  695.  $('body').on("click",".delete-cart-item",function() {
  696.           
  697.     var idProduct = $(this).attr("data-id");
  698.     var price = $(this).attr("data-price");
  699.     var name = $(this).attr("data-name");
  700.     var actionType = "remove";
  701.     $.ajax({
  702.       url:"{{path('ajax_cart')}}",
  703.       data:{
  704.         idProduct:idProduct,
  705.         price:price,
  706.         name:name,
  707.         actionType:actionType
  708.       },
  709.       success:function(result){
  710.         console.log(result);
  711.           $(".reservation-steeps-panier").html(result);
  712.       }
  713.     });
  714.     });
  715.         // Ajouter la délégation d'événements pour le clic sur le label 'service'
  716.  $('label[for="service"]').click(function(){ 
  717.  
  718.     var checkBox = $(this).prev();
  719.     var value = checkBox.val();
  720.     if (checkBox.is(":checked")) {
  721.         checkBox.prop('checked', false);
  722.         console.log("Case à cocher décochée : " + value);
  723.           checkBox.next('label').css({ 'color': '#626262' ,'background': 'none'});
  724.     var idProduct = checkBox.attr("data-id");
  725.     var price = checkBox.attr("data-price");
  726.     var name = checkBox.attr("data-name");
  727.     var actionType = "remove";
  728.       $.ajax({
  729.       url:"{{path('ajax_cart')}}",
  730.       data:{
  731.         idProduct:idProduct,
  732.         price:price,
  733.         name:name,
  734.         actionType:actionType
  735.       },
  736.       success:function(result){
  737.         console.log(result);
  738.           $(".reservation-steeps-panier").html(result);
  739.       }
  740.     });
  741.     } else {
  742.         checkBox.prop('checked', true);
  743.        // console.log("Case à cocher cochée : " + value);
  744.        var formule = "";
  745.          
  746.                    if ($('#radio1').is(':checked')) {
  747.                   formule = $("#radio1").val();
  748.                  }
  749.                 else if ($('#radio21').is(':checked')) {
  750.                   formule = $("#radio21").val();
  751.                  }
  752.                   else if ($('#radio24').is(':checked')) {
  753.                   formule = $("#radio24").val();
  754.                  }
  755.                  else if ($('#radio25').is(':checked')) {
  756.                   formule = $("#radio25").val();
  757.                  }else{
  758.                        formule = "";
  759.                  }
  760.             
  761.               var serviceId = $(this).prev().data('id');
  762.               var dataElement = $(this).prev();
  763.              $.ajax({
  764.                 url: "{{path('ajaxServicePrice')}}",
  765.                 type: 'GET', // ou 'GET' en fonction de votre besoin
  766.                 data: { 
  767.                   serviceId : value,
  768.                   formule : formule
  769.                  },
  770.                 success: function(response) {
  771.                       dataElement.attr("data-price", response);
  772.                       var idProduct = dataElement.attr("data-id");
  773.                     var price = dataElement.attr("data-price");
  774.                     var name = dataElement.attr("data-name");
  775.                     var actionType = "add";
  776.             
  777.             
  778.             if(price != 0 ){
  779.                 $.ajax({
  780.                 url:"{{path('ajax_cart')}}",
  781.                 data:{
  782.                   idProduct:idProduct,
  783.                   price:price,
  784.                   name:name,
  785.                   actionType:actionType
  786.                 },
  787.                 success:function(result){
  788.                   console.log(result);
  789.                     $(".reservation-steeps-panier").html(result);
  790.                 }
  791.               });
  792.                checkBox.next('label').css({ 'color': 'white' ,'background': '#FFD86E'});
  793.                  
  794.                    }else {
  795.                 // Si le prix est égal à zéro, changer le fond du checkbox en gris
  796.                 checkBox.next('label').css({'color': 'white', 'background': '#C7C8CC'});
  797.             }    
  798.                  
  799.                        
  800.                 },
  801.                 error: function(xhr, status, error) {
  802.                     // Gérez les erreurs ici
  803.                     console.error(error);
  804.                 }
  805.             });
  806.             
  807.     }
  808. });
  809.  
  810.  
  811.  var radioButtons = document.getElementsByName('radioGroup');
  812. for (var i = 0; i < radioButtons.length; i++) {
  813.     if (radioButtons[i].checked) {
  814.         var selectedValue = radioButtons[i].value;
  815.         break;
  816.     }
  817. }
  818. console.log(selectedValue); // Vous pouvez utiliser la valeur comme vous le souhaitez ici
  819.     });
  820.    
  821.  
  822.  
  823. </script>
  824.  
  825. {% endblock %}