src/Aviatur/TwigBundle/Resources/views/aviatur/Flux/Search/Hotel/hotelSearch_engine.html.twig line 1

Open in your IDE?
  1. {% if inlineEngine is defined %}
  2.   {# if NOT desktop hompage, var from controller #}
  3.   {% set dispoEngine = true %}
  4. {% else %}
  5.   {% set dispoEngine = false %}
  6. {% endif %}
  7. {# END .search-header #}
  8. {# START .search-body #}
  9. <style type="text/css">
  10.   .custom-radio {
  11.     width: 20px;
  12.     height: 20px;
  13.     appearance: none;
  14.     border: 1px solid white;
  15.     border-radius: 50%;
  16.     outline: none;
  17.     background-color: transparent;
  18.     position: relative;
  19.     cursor: pointer;
  20.   }
  21.   .custom-radio:checked::before {
  22.     content: '';
  23.     width: 12px;
  24.     height: 12px;
  25.     border-radius: 50%;
  26.     background-color: white;
  27.     position: absolute;
  28.     top: 50%;
  29.     left: 50%;
  30.     transform: translate(-50%, -50%);
  31.   }
  32.   @media (max-width: 991px) {
  33.     .custom-radio {
  34.       width: 20px;
  35.       height: 20px;
  36.       appearance: none;
  37.       border: 1px solid #042A44;
  38.       border-radius: 50%;
  39.       outline: none;
  40.       background-color: transparent;
  41.       position: relative;
  42.       cursor: pointer;
  43.     }
  44.     .custom-radio:checked::before {
  45.       content: '';
  46.       width: 12px;
  47.       height: 12px;
  48.       border-radius: 50%;
  49.       background-color: #042A44;
  50.       position: absolute;
  51.       top: 50%;
  52.       left: 50%;
  53.       transform: translate(-50%, -50%);
  54.     }
  55.   }
  56. </style>
  57. <form action="#" class="search__engine clearfix search-hotel js-searchForm js-searchFormHotel pb-0 w-full">
  58.   {% if cookieLastSearch is defined and cookieLastSearch != null %}
  59.   <div style="display:none">
  60.     <p id="js-cookieLastSearch-destination">{{ cookieLastSearch.destination }}</p>
  61.     <p id="js-cookieLastSearch-destinationLabel">{{ cookieLastSearch.destinationLabel }}</p>
  62.     <p id="js-cookieLastSearch-date1">{{ cookieLastSearch.date1 }}</p>
  63.     <p id="js-cookieLastSearch-date2">{{ cookieLastSearch.date2 }}</p>
  64.     <p id="js-cookieLastSearch-adults">{{ cookieLastSearch.adults }}</p>
  65.     <p id="js-cookieLastSearch-children">{{ cookieLastSearch.children }}</p>
  66.     {% if cookieLastSearch.childAge is iterable %}
  67.     {% for child in cookieLastSearch.childAge.age1 %}
  68.     <p id="js-cookieLastSearch-childrenAge{{ loop.index }}">{{ child }}</p>
  69.     {% endfor %}
  70.     {% endif %}
  71.   </div>
  72.   {% endif %}
  73.   {# START .search-header #}
  74.   <div
  75.     class="search__header clearfix font-[Roboto] py-14 m:py-12 s:pb-4 s:pt-14 xs:pb-4 xs:pt-14 m-0 pl-[144px] l:pl-[0px] m:pl-[32px] s:pl-[0px] xs:pl-[0px] ">
  76.     <h1
  77.       class="search__title text-[#FFF] text-[1.75rem] m:text-[1.5rem] s:text-[1.5rem] xs:text-[1.5rem] s:text-start xs:text-start s:px-[20px] xs:px-[20px] ">
  78.       {# <i class="icon icon_bundle_hotel search__title__icon hide-lap-and-up"></i> #}
  79.       {% if articulo is defined and articulo.url is not defined and typeArticle is defined %}
  80.       <span class="">
  81.         {% set info = typeArticle %}
  82.         {% set info = info|replace({ '-': ' ' }) %}Hoteles{% if info == 'destino' %} con pago en destino{% endif %}
  83.         {% if info != 'destino' %}
  84.         {# <span class="hide-portable">Baratos</span> #}
  85.         en {{ info|replace({ oceania: 'oceanía', america: 'américa', africa: 'áfrica' })|capitalize }}
  86.         {% endif %}
  87.       </span>
  88.       {% else %}
  89.       {% endif %}
  90.       {% if articulo is defined and articulo.url is defined %}
  91.       <b>
  92.         Reserve su hotel{% set info = articulo.url %}
  93.         {% set info = info|replace({ '-': ' ' }) %}
  94.         {% set contentInfo = json_decode(articulo.description, true) %}
  95.         {% if contentInfo['type'] == 'hoteles' %}
  96.         en {{ info|title|replace({ Baru: 'Barú', Medellin: 'Medellín', Bogota: 'Bogotá', 'San Andres': 'San Andrés',
  97.         Ibague: 'Ibagué', Cucuta: 'Cúcuta', Monteria: 'Montería', Popayan: 'Popayán', Mexico: 'México', Cancun:
  98.         'Cancún', Panama: 'Panamá', Paris: 'París', 'Los Angeles': 'Los Ángeles', Dubai: 'Dubái', Amsterdam:
  99.         'Ámsterdam', Milan: 'Milán', Zurich: 'Zúrich', Moscu: 'Moscú', Dublin: 'Dublín', Kazan: 'Kazán', Monaco:
  100.         'Mónaco', Malaga: 'Málaga', 'Rio de Janeiro': 'Río de Janeiro', 'San Jose de Costa Rica': 'San José de Costa
  101.         Rica', Cordoba: 'Córdoba', Asuncion: 'Asunción', 'Seúl': 'Seúl', America: 'América', Mexico: 'México', 'Ciudad
  102.         de Mexico': 'Ciudad de México', Oceania: 'Oceanía', Africa: 'África', 'Kinshasa RepUblica Del Congo': 'Kinshasa
  103.         República Del Congo', 'Jartum Sudan': 'Jartum Sudán', 'Shanghai China': 'Shanghái China', Japon: 'Japón',
  104.         Turquia: 'Turquía', 'Emiratos Arabes Unidos': 'Emiratos Árabes Unidos', Taiwan: 'Taiwán', Taipei: 'Taipéi' }) }}
  105.         {% endif %}
  106.       </b>
  107.       {% endif %}
  108.       {% if articulo is not defined %}
  109.         <b class="text-[28px] mb-5 block leading-none whitespace-nowrap">Hoteles Baratos</b>
  110.         <b class="text-[22px] block leading-none whitespace-nowrap">Hoteles nacionales e internacionales</b>
  111.       {% endif %}
  112.     </h1>
  113.   </div>
  114.   <div
  115.     class="search__light--box-opaque-palm h-auto  s:p-[16px] xs:p-[16px] m:p-[36px] m:gap-y-[35px] flex flex-col gap-y-[11px]">
  116.     <div
  117.       class="sm-12 xs:py-[8px] s:px-[4px] m:pb-[24px] xs:w-full s:w-full m:w-full flex">
  118.       <label for="onlinepayment" class="search__option no-margin-bottom sp-inset--tiny paymentOnline flex gap-x-[8px] !hidden">
  119.         <input type="radio" name="paymentOnline" class="custom-radio" />
  120.         <span class="text-white xs:text-[#5A5A5A] s:text-[#5A5A5A] m:!text-[#5A5A5A]">Pago en línea</span>
  121.       </label>
  122.       {# {% if (booking is defined and booking == 'true' and 'aviatur_search_hotels' in app.request.get('_route')) or
  123.       'aviatur_hotel_filtered' in app.request.get('_route') or 'aviatur_hotel_view' in app.request.get('_route') %} #}
  124.       {# <label for="onlinepayment"
  125.         class="search__option no-margin-bottom sp-inset--tiny paymentDestination flex gap-x-[8px] ">
  126.         <input type="radio" name="paymentDestination" checked="true" class="custom-radio" />
  127.         <span class="text-white xs:text-[#5A5A5A] s:text-[#5A5A5A] m:!text-[#5A5A5A]">Pago en destino</span>
  128.       </label> #}
  129.       {# {% endif %} #}
  130.       {# Formulario para búsqueda #}
  131.     </div>
  132.     <div class="search__row-main">
  133.       <div id="hotelOptions" class="grid grid-cols-12 w-full justify-center items-center search__row-main-flight m:gap-y-[40px] s:gap-y-[16px] xs:gap-y-[16px] m:gap-x-3">
  134.         <div id="cityId" class="px-[24px] l:px-[24px] m:!px-0 s:!px-0 xs:!px-0 col-span-4 xs:col-span-12 s:col-span-12 m:!col-span-6 sm-12 search__col-hotel-city dispo__col-search s:!border-r-0  xs:!border-r-0 m:!border-r-0 border-r-2 border-r-[#D1D1D1]-2">
  135.           <div class="form-group xs:!border-b-2 xs:!border-b-[#D1D1D1]-2 s:!border-b-2 s:!border-b-[#D1D1D1]-2 m:!border-b-2 m:!border-b-[#D1D1D1]-2">
  136.             <span class="font-[Roboto] xs:text-[12px] xs:text-[#002B46] s:text-[12px] s:text-[#002B46] m:text-[12px] m:text-[#002B46] text-[#FFFFFF]">Ubicación del hotel</span>
  137.             <input type="hidden" name="parameters[destination]" id="destination" />
  138.             <input type="hidden" name="parameters[destinationText]" id="destinationText" />
  139.             <div class="flex items-center justify-between">
  140.               {# <i class="icon icon_search_close icon__input icon__input--click js-empty text-white xs:text-[#5A5A5A] s:text-[#5A5A5A] m:!text-[#5A5A5A]"></i> #}
  141.               <div class="w-full">
  142.                 <input id="destinationValidate" class="text-input-flight !p-0 input--white js-searchErrorInput js-scrollToTop js-selectOnFocus cursor-text xs:!text-[#5A5A5A] s:!text-[#5A5A5A] m:!text-[#5A5A5A]" type="text" name="parameters[destinationValidate]" autocomplete="off" placeholder="Ubicación del Hotel"/>
  143.                 <label id="js-destinationError" class="label--error js-searchError" style="display: none;"></label>
  144.                 <div id="js-autocomplete-hotelModal" class="absolute z-10 bg-[#FFFFFF] l:bg-[#1E1E1E] text-[#2F2F2F] l:text-white py-6 px-4 w-full rounded-lg font-roboto flex flex-col gap-y-2 max-h-[400px] overflow-y-auto shadow-[0px_1px_12.2px_1px_rgba(0,0,0,0.10)]" style="display: none; scrollbar-width: none; -ms-overflow-style: none;" data-active="false"></div>
  145.               </div>
  146.               <span id="js-deleteInputDestination" class="material-symbols-rounded cursor-pointer text-white">close</span>
  147.             </div>
  148.           </div>
  149.         </div>
  150.         {# DATES #}
  151.         <!--Implementación de input para buscar ciudades con Geocoding-->
  152.         {# <div id="cityIdGeocoding"
  153.           class="px-[24px] l:px-[24px] m:!px-0 s:!px-0 xs:!px-0 col-span-4 xs:col-span-12 s:col-span-12 m:!col-span-6 sm-12 search__col-hotel-city dispo__col-search s:!border-r-0  xs:!border-r-0 m:!border-r-0 border-r-2 border-r-[#D1D1D1]-2">
  154.           <div
  155.             class="form-group xs:!border-b-2 xs:!border-b-[#D1D1D1]-2 s:!border-b-2 s:!border-b-[#D1D1D1]-2 m:!border-b-2 m:!border-b-[#D1D1D1]-2">
  156.             <span
  157.               class="font-[Roboto] xs:text-[12px] xs:text-[#002B46] s:text-[12px] s:text-[#002B46] m:text-[12px] m:text-[#002B46] text-[#FFFFFF]">Ciudad</span>
  158.             <input type="hidden" name="parameters[destination]" id="destination" />
  159.             <i
  160.               class="icon icon_search_close icon__input icon__input--click js-empty text-white xs:text-[#5A5A5A] s:text-[#5A5A5A] m:!text-[#5A5A5A]"></i>
  161.             <input id="searchCity" class="text-input-flight" type="text" placeholder="Ubicación del Hotel" />
  162.             <label id="js-destinationError" class="label--error js-searchError" style="display: none;"></label>
  163.           </div>
  164.         </div> #}
  165.         <div id="datesdisplay1Id" class="px-[24px] l:px-[24px] m:!px-0 s:!px-0 xs:!px-0 col-span-4 xs:!col-span-12 s:!col-span-12 m:!col-span-6 xs:!grid xs:!grid-cols-1 s:!grid s:!grid-cols-1 sm-12 no-padding has-feedback border-r-2 border-r-[#D1D1D1]-2 s:!border-r-0  xs:!border-r-0 m:!border-r-0 xs:!border-b-2 xs:!border-b-[#D1D1D1]-2 s:!border-b-2 s:!border-b-[#D1D1D1]-2 m:!border-b-2 m:!border-b-[#D1D1D1]-2">
  166.           <span
  167.             class="font-[Roboto] xs:text-[12px] xs:text-[#002B46] s:text-[12px] s:text-[#002B46] m:text-[12px] m:text-[#002B46] xs:col-span-1 s:col-span-1 text-[#FFFFFF]">Fechas</span>
  168.           <div
  169.             class="xs:grid xs:grid-cols-3 s:grid s:grid-cols-3 items-center text-center flex justify-start items-center h-[40px]">
  170.             <div
  171.               class="col-5 xs:!col-span-1 s:!col-span-1 sm-12 search__col-hotel-date dispo__col-search s:p-0 xs:p-0 !p-0 w-fit">
  172.               <div class="form-group">
  173.                 {# <span
  174.                   class="font-[Roboto] xs:text-[12px] xs:text-[#002B46] s:text-[12px] s:text-[#002B46]">Fechas</span> #}
  175.                 <div class="relative  js-createDatepicker js-datepicker-container-open" data-input="#date1"
  176.                   data-instancenbr="1" role="button" tabindex="0" data-tabopen="1">
  177.                   <input type="hidden" name="parameters[date1]" id="date1" readonly="readonly" style="display:none" />
  178.                   <input type="text" id="js-createDatepicker1" name="parameters[date1validate]" placeholder="Fecha Ida"
  179.                     readonly="readonly"
  180.                     class="!w-[80px] !font-normal cursor-pointer !focus:outline-none !focus:border-none !bg-transparent input--white l:!text-[#FFFFFF] m:!text-[#5A5A5A] !xs:text-[16px] s:text-[16px] js-searchErrorInput js-inputDatepicker text-input no-focus !p-0 "
  181.                     tabindex="-1" />
  182.                 </div>
  183.               </div>
  184.             </div>
  185.             <span
  186.               class="col-2 xs:!col-span-1 s:!col-span-1 font-bold text-white xs:!text-[#5A5A5A] s:!text-[#5A5A5A] m:!text-[#5A5A5A] s:w-full xs:w-full">-</span>
  187.             <div
  188.               class="col-5 xs:!col-span-1 s:!col-span-1 sm-12 search__col-hotel-date dispo__col-search s:p-0 xs:p-0 !p-0 w-fit">
  189.               <div class="form-group">
  190.                 <div class="relative icon__input--inline js-createDatepicker js-datepicker-container-open"
  191.                   data-input="#date-return1" data-instancenbr="1" role="button" tabindex="0" data-tabopen="1">
  192.                   <input type="hidden" name="parameters[date-return1]" id="date-return1" readonly="readonly"
  193.                     style="display:none" />
  194.                   <input type="text" id="js-createDatepicker-return1" name="parameters[date1validate]"
  195.                     placeholder="Fecha Ida" readonly="readonly"
  196.                     class="!w-[80px] !p-0 !font-normal cursor-pointer !focus:outline-none !focus:border-none !bg-transparent input--white l:!text-[#FFFFFF] m:!text-[#5A5A5A] xs:text-[16px] s:text-[16px] js-searchErrorInput js-inputDatepicker text-input no-focus  m:text-end"
  197.                     tabindex="-1" style="padding-top: 0px !important;" />
  198.                 </div>
  199.               </div>
  200.             </div>
  201.           </div>
  202.         </div>
  203.         <div
  204.           class="col-span-3 xs:!col-span-12 s:!col-span-12 m:!col-span-12 xs:col-span-12 grid grid-cols-12 no-padding">
  205.           {% include twig_exists('@AviaturTwig/' ~ agency_folder.twigFlux() ~ '/Search/Hotel/hotelSearch_engine_footer.html.twig') %}
  206.         </div>
  207.         <label id="js-dateError" class="label--error js-searchError" style="display: none;"></label>
  208.         {# END DATES #}
  209.         {# SEARCH BUTTON #}
  210.         <div
  211.           class="col-span-1 sm-12 flex justify-center xs:col-span-12 s:col-span-12 m:col-span-12 s:mt-[30px] xs:mt-[30px]">
  212.           <div class="!flex !content-center">
  213.             <button type="button" class="js-searchButton js-changeType inline-block h-[3.375rem] w-[270px] l:w-[3.375rem] rounded-full border-0 bg-[#00C382] text-white text-[2.2rem] p-[0.7rem] hover:bg-[#00dd93]"
  214.               data-type="online">
  215.               <div class="m:hidden s:hidden xs:hidden">
  216.                 <svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"
  217.                   style="vertical-align: top;">
  218.                   <path
  219.                     d="M13.8001 25.3484C20.2869 25.3484 25.5455 20.1721 25.5455 13.7868C25.5455 7.40158 20.2869 2.22531 13.8001 2.22531C7.31329 2.22531 2.05469 7.40158 2.05469 13.7868C2.05469 20.1721 7.31329 25.3484 13.8001 25.3484Z"
  220.                     fill="#00C382" stroke="white" stroke-width="2.71293" stroke-linecap="round" stroke-linejoin="round">
  221.                   </path>
  222.                   <path d="M28.4803 28.2407L22.0938 21.9541" stroke="white" stroke-width="2.71293"
  223.                     stroke-linecap="round" stroke-linejoin="round"></path>
  224.                 </svg>
  225.               </div>
  226.               <div class="l:hidden h-[28px] flex items-center font-[500] px-[30px] justify-between !text-white">
  227.                 <span class="material-symbols-rounded w-[26.182px] h-[24px]">
  228.                   concierge
  229.                 </span>
  230.                 <span class="text-[16px]">Buscar alojamiento</span>
  231.               </div>
  232.             </button>
  233.           </div>
  234.         </div>
  235.         <div
  236.           class="col-6 sm-12 xs:!col-span-12 s:!col-span-12 m:!col-span-12 m:w-full s:w-full xs:w-full xs:col-span-12 m:flex m:justify-center s:flex s:justify-center xs:flex xs:justify-center">
  237.           {# END SEARCH BUTTON #}
  238.         </div>
  239.       </div>
  240.     </div>
  241.     <div class="hidden sm:flex l:hidden justify-center">
  242.       <span class="material-symbols-rounded text-[#8B8B8B]">keyboard_arrow_down</span>
  243.     </div>
  244.   </div>
  245. </form>
  246. {# END .search-body #}
  247. {# START .search-footer #}
  248. <script>
  249.     const d = document
  250.     {# let $paymentOnline = d.querySelector('[name="paymentOnline"]')
  251.     let $paymentDestination = d.querySelector('[name="paymentDestination"]') #}
  252.     let $typeSearch = d.querySelector('.js-changeType')
  253.     let $searchCity = d.querySelector('#searchCity');
  254.     //Variable del contador de habitaciones que se inicia en 0 ya que al renderizar la pagina hay un evento que agrega una habitacion automaticamente
  255.     let roomsCounter = 0;
  256.     {# (() => {
  257.     if (!d.querySelector('.paymentDestination')) {
  258.         d.querySelector('.paymentOnline').classList.add('hide');
  259.     }
  260.     const savedSearchType = localStorage.getItem('searchType');
  261.     if (savedSearchType) {
  262.         if (savedSearchType === 'online') {
  263.             $paymentOnline.checked = true;
  264.             $paymentDestination.checked = false;
  265.             $typeSearch.dataset.type = 'online';
  266.         } else if (savedSearchType === 'destination') {
  267.             $paymentDestination.checked = true;
  268.             $paymentOnline.checked = false;
  269.             $typeSearch.dataset.type = 'destination';
  270.         }
  271.     } else {
  272.         $paymentDestination.checked = true;
  273.         $paymentOnline.checked = false;
  274.         $typeSearch.dataset.type = 'destination';
  275.     }
  276. })(); #}
  277. {# const saveSearchType = (type) => {
  278.     localStorage.setItem('searchType', type);
  279. } #}
  280.     // "destination" sea la opción seleccionada por defecto
  281.     {# $paymentDestination.checked = true;
  282.     $paymentOnline.checked = false;
  283.     if ($paymentDestination.checked) {
  284.         $typeSearch.dataset.type = 'destination';
  285.     } #}
  286.     const disableAddButtonsInSearch = (counterPassagers, counterRooms)=>{
  287.       let is_buttons_disabled = counterPassagers >= 9 ? true: false;
  288.       let is_submit_disabled = counterPassagers > 9 ? true: false;
  289.       let is_button_rooms_disabled = counterRooms > 2 || counterPassagers >= 9 ? true : false;
  290.             let $btn_add_rooms = document.querySelector(".search__hotel-passengers-block .js-createRoom");
  291.             let $submit_search_button = document.querySelector(".js-searchButton");
  292.       let $search_error_message = document.querySelector("#search_error_message");
  293.             Array.from(document.querySelectorAll(".js-slideContent .search-hotel__col-passenger .js-nextOption")).map(($btn) => {
  294.         toogleButtonDisabled($btn, is_buttons_disabled)
  295.             })
  296.       //Bloqueo boton de añadir habitaciones
  297.       toogleButtonDisabled($btn_add_rooms, is_button_rooms_disabled)
  298.       //Bloqueo boton de busqueda
  299.       toogleButtonDisabled($submit_search_button, is_submit_disabled)
  300.       if(counterPassagers >= 9 && !$search_error_message){
  301.                     document.querySelector(".search__hotel-passengers-block").insertAdjacentHTML("afterBegin",
  302.                     `<div class="bg-[#00C77C] text-sm text-center rounded-md mb-3 w-full flex flex-wrap p-3 text-white font-bold" id="search_error_message">
  303.                         <span> Has alcanzado el límite de 9 pasajeros <span>
  304.                     </div>`
  305.                     )
  306.             }
  307.       else if($search_error_message && counterPassagers != 9){
  308.         document.querySelector("#search_error_message")?.remove()
  309.       }
  310.         }
  311.     const toogleButtonDisabled = ($button, is_disabled)=>{
  312.       if(!$button){
  313.         return;
  314.       }
  315.       if(is_disabled){
  316.         $button.classList.add('opacity-30')
  317.       }else{
  318.         $button.classList.remove('opacity-30')
  319.       }
  320.       $button.disabled = is_disabled
  321.     }
  322.     function countRoomPassanger(operation = null) {
  323.         let counterPassager = 0
  324.         let $inputPassanger = d.querySelectorAll('.search-hotel__col-room .number-input')
  325.         for (let i = 0; i < $inputPassanger.length; i++) {
  326.             counterPassager += parseInt($inputPassanger[i].value)
  327.         }
  328.         d.querySelector('.quantityRoom').textContent = d.querySelectorAll('.search-hotel__col-room .js-rooms').length + (d.querySelectorAll('.search-hotel__col-room .js-rooms').length > 1 ? ' habitaciones' : ' habitación')
  329.         if (operation === 'remove') {
  330.             // console.log('está restando habitaciones')
  331.             let $inputPassanger = jQuery('.search-hotel__row-room:last .number-input')
  332.             let counter = 0
  333.             let rooms_number = d.querySelectorAll('.search-hotel__col-room .js-rooms').length - 1;
  334.             for (let i = 0; i < $inputPassanger.length; i++) {
  335.                 counter += parseInt($inputPassanger[i].value)
  336.             }
  337.             counterPassager -= counter
  338.             // console.log(rooms_number, 'conteo de habitaciones')
  339.             d.querySelector('.quantityRoom').textContent = `${rooms_number} ${rooms_number == 1 ? 'habitación': 'habitaciones'}`;
  340.               // d.querySelectorAll('.search-hotel__col-room .js-rooms').length - 2 + (d.querySelectorAll('.search-hotel__col-room .js-rooms').length > 1 ? ' habitaciones' : ' habitación')
  341.         }
  342.         d.querySelector('.quantityPassanger').textContent = counterPassager + (counterPassager > 1 ? ' personas.' : ' persona.')
  343.         return counterPassager
  344.     }
  345.     d.addEventListener('click', (e) => {
  346.         if(e.target.matches(".js-createRoom")){
  347.           roomsCounter+=1
  348.         }
  349.         if (e.target.matches('.search__btn-increment *') || e.target.matches('.js-createRoom')) {
  350.           let counterPassagers = countRoomPassanger('add');
  351.           disableAddButtonsInSearch(counterPassagers, roomsCounter)
  352.         }
  353.         if (e.target.matches('.js-deleteRoom')) {
  354.           let counterPassagers = countRoomPassanger('remove')
  355.           roomsCounter-=1
  356.           disableAddButtonsInSearch(counterPassagers, roomsCounter)
  357.         }
  358.         if (e.target.matches('.js-palmPrevModal *') || e.target.matches('.js-palmPrevModal')) {
  359.             document.querySelector('.js-travelers').style.display = 'none'
  360.         }
  361.     })
  362.     /**
  363.      * Funcion para obtener coordenadas de una ciudad
  364.      *
  365.      * @param city
  366.      */
  367.     function geocode(city) {
  368.       $.ajax({
  369.         url: 'https://api.opencagedata.com/geocode/v1/json',
  370.         method: 'GET',
  371.         data: {
  372.           'key': 'd4ea2db24f6448dcbb1551c3546851d6',
  373.           'q': city,
  374.           'no_annotations': 1
  375.         },
  376.         dataType: 'json',
  377.         statusCode: {
  378.           200: function(response){
  379.             //console.log(response.results);
  380.             for (let i = 0; i < response.results.length; i++) {
  381.               // console.log('formatted: ' + response.results[i].formatted);
  382.               // console.log('geometry: ' + response.results[i].geometry.lat + ', ' + response.results[i].geometry.lng);
  383.               $('#cityIdGeocoding').append('<div id="result'+i+'"></div>')
  384.               $('#result' + i).append('<h3 style="color: white">' + 'formatted: ' + response.results[i].formatted + '</h3>');
  385.               $('#result' + i).append('<h3 style="color: white">' + 'geometry: ' + response.results[i].geometry.lat + ', ' + response.results[i].geometry.lng + '</h3>');
  386.             }
  387.           }
  388.         }
  389.       });
  390.     }
  391. </script>
  392. {# END .search-footer #}