templates/inscription/inscription-centre.html.twig line 1

Open in your IDE?
  1. {% extends "layout.html.twig" %}
  2. {% block content %}
  3. <!-- Modal test SANG -->
  4. <div id="apk-modal-test-plasma" uk-modal>
  5.     <div class="uk-modal-dialog uk-modal-body">
  6.         <button class="uk-modal-close-default" type="button" uk-close></button>
  7.         {{ pimcore_inc("/" ~ app.request.locale ~ "/Snippets/form-eligibilite-inscription", {'id' : centre.site.id}) }}
  8.     </div>
  9. </div>
  10. <!-- Modal si jamais donné SANG et/ou PLASMA -->
  11. <div id="apk-modal-never-give" class="uk-modal-container" uk-modal>
  12.     <div class="uk-modal-dialog uk-modal-body">
  13.         <button class="uk-modal-close-outside" type="button" uk-close></button>
  14.         <div class="uk-modal-body">
  15.             <div class="uk-flex uk-flex-middle">
  16.                 <div class="uk-width-1-1">
  17.                     <h3>{{"Attention !"|trans}}</h3>
  18.                     <p>
  19.                         {{"En tant que nouveau donneur, une procédure de première inscription vous sera demandée lors de votre premier rendez-vous."|trans}}<br>
  20.                         {{"Nous vous demandons de vous présenter 15 min à l'avance."|trans}}<br>
  21.                         {{"Merci."|trans}}
  22.                     </p>
  23.                 </div>
  24.             </div>
  25.         </div>
  26.         <div class="uk-modal-footer uk-text-right">
  27.             <button class="uk-button uk-modal-close" type="button">{{"Fermer"|trans}}</button>
  28.         </div>
  29.     </div>
  30. </div>
  31. <div class="page-collect-centre-inscription-form apk-page-inscription">
  32.     <div class="uk-container apk-container-1400 uk-margin-large-top">
  33.         <div class="section-sites-prelevement-item">
  34.             <h2 class="h-big-lowcase-grey">{{ "Prendre un rendez-vous dans un centre de prélèvement"|trans }}</h2>
  35.             <div class="uk-grid" uk-grid>
  36.                 <div class="uk-width-2-3@s">
  37.                     <div class="uk-text-uppercase uk-width-1-1 uk-margin-bottom" style="border-bottom: 1px solid grey;">{{ 'Votre Centre'|trans }}</div>
  38.                     <div class="uk-grid uk-grid-small uk-child-width-1-2@s" uk-grid>
  39.                         <div>
  40.                             <div class="adresse">
  41.                                 <ul class="fa-ul">
  42.                                     <li>
  43.                                         <img uk-svg width="14" height="14" src="/static/img/pictos/position.svg" />
  44.                                         <strong>{{ centre.site.name }}</strong><br>
  45.                                         {{ centre.site.address }}<br>
  46.                                         {{ centre.site.zip }} {{ centre.site.city }}
  47.                                     </li>
  48.                                 </ul>
  49.                             </div>
  50.                             <div>
  51.                                 <ul class="fa-ul telephone">
  52.                                     <li>
  53.                                         <img uk-svg width="14" height="14" src="/static/img/pictos/phone.svg" />
  54.                                         <a href="tel:{{ centre.site.phone}}"
  55.                                         target="_blank">{{ centre.site.phone}}</a>
  56.                                     </li>
  57.                                 </ul>
  58.                             </div>
  59.                             <div class="horaires">
  60.                                 <ul class="fa-ul">
  61.                                     <li>
  62.                                         <img uk-svg width="14" height="14" src="/static/img/pictos/horaires.svg" />
  63.                                         {# <strong>{{ 'Horaires'|trans }} {{ 'du'|trans }} {{ date['weekStartDate'] }} {{'au'|trans}} {{ date['weekEndDate'] }}</strong><br/> #}
  64.                                         {% for jour,horaire in centre.days %}
  65.                                             {% if horaire %}
  66.                                                 {{ jour|trans }} : {{ horaire }}
  67.                                                 <br/>
  68.                                             {% else %}
  69.                                                 {{ jour|trans }} : {{ "Fermé"|trans }}
  70.                                                 <br/>
  71.                                             {% endif %}
  72.                                         {% endfor %}
  73.                                     </li>
  74.                                 </ul>
  75.                             </div>
  76.                         </div>
  77.                         <!-- <div>
  78.                             {% if not centre.site.info is empty %}
  79.                                 <div>
  80.                                     <ul class="fa-ul">
  81.                                         <li>
  82.                                             <i class="fa-li fa"><svg width="17" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M255.989 0C114.623 0 0 114.623 0 255.989 0 397.355 114.623 512 255.989 512 397.355 512 512 397.355 512 255.989 512 114.623 397.355 0 255.989 0Zm53.292 396.749c-13.177 5.201-23.666 9.145-31.533 11.876a83.188 83.188 0 0 1-27.35 4.096c-15.951 0-28.369-3.901-37.211-11.681-8.842-7.781-13.242-17.641-13.242-29.626 0-4.659.326-9.427.976-14.282a178.126 178.126 0 0 1 3.185-16.449l16.493-58.254c1.452-5.591 2.709-10.901 3.706-15.842.997-4.985 1.473-9.558 1.473-13.719 0-7.411-1.538-12.613-4.594-15.538-3.099-2.926-8.929-4.356-17.619-4.356-4.248 0-8.626.628-13.112 1.95-4.443 1.365-8.3 2.601-11.464 3.814l4.356-17.944c10.792-4.4 21.13-8.17 30.991-11.291a91.567 91.567 0 0 1 27.956-4.725c15.843 0 28.066 3.858 36.669 11.486 8.561 7.651 12.874 17.598 12.874 29.821 0 2.536-.304 7-.889 13.372a89.462 89.462 0 0 1-3.294 17.576l-16.406 58.08a164.502 164.502 0 0 0-3.619 15.951 84.402 84.402 0 0 0-1.582 13.567c0 7.715 1.712 12.981 5.18 15.777 3.424 2.796 9.427 4.204 17.922 4.204 4.01 0 8.496-.715 13.567-2.102 5.028-1.387 8.669-2.622 10.966-3.684l-4.399 17.923Zm-2.905-235.748a39.172 39.172 0 0 1-27.631 10.663c-10.75 0-20.025-3.555-27.74-10.663a34.044 34.044 0 0 1-11.552-25.855c0-10.077 3.901-18.746 11.552-25.919a39.28 39.28 0 0 1 27.74-10.771c10.771 0 20.003 3.576 27.631 10.771 7.651 7.173 11.487 15.842 11.487 25.919 0 10.121-3.836 18.747-11.487 25.855Z" style="fill:#F9B123;fill-rule:nonzero" transform="scale(.03125)"/></svg></i>
  83.                                             {{ centre.site.info|raw }}
  84.                                         </li>
  85.                                     </ul>
  86.                                 </div>
  87.                             {% endif %}
  88.                             {% if not centre.site.parking is empty %}
  89.                                 <div>
  90.                                     <ul class="fa-ul">
  91.                                         <li>
  92.                                             <i class="fa-li fa"><svg width="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M287 167h-62v60h62c16.538 0 30-13.462 30-30s-13.462-30-30-30Z" style="fill:#F9B123;fill-rule:nonzero" transform="scale(.03125)"/><path d="M437 0H75C33.647 0 0 33.647 0 75v362c0 41.353 33.647 75 75 75h362c41.353 0 75-33.647 75-75V75c0-41.353-33.647-75-75-75ZM287 287h-62v105c0 8.284-6.716 15-15 15h-30c-8.284 0-15-6.716-15-15V122c0-8.284 6.716-15 15-15h107c49.629 0 90 40.371 90 90s-40.371 90-90 90Z" style="fill:#F9B123;fill-rule:nonzero" transform="scale(.03125)"/></svg></i>
  93.                                             {{"Parking"|trans}}
  94.                                             <br>
  95.                                             {{ centre.site.parking|raw }}
  96.                                         </li>
  97.                                     </ul>
  98.                                 </div>
  99.                             {% endif %}
  100.                             {% if not centre.site.transports_commun is empty %}
  101.                                 <div>
  102.                                     <ul class="fa-ul">
  103.                                         <li>
  104.                                             <i class="fa-li fa"><svg width="16" height="16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path d="M4.266 0c-1.455 0-3.2.793-3.2 2.93v9.87s0 1.067 1.067 1.067v1.066S2.133 16 3.2 16c1.066 0 1.066-1.067 1.066-1.067v-1.066h7.467v1.066S11.733 16 12.8 16c1.066 0 1.066-1.067 1.066-1.067v-1.066s1.067 0 1.067-1.067V2.93C14.933.747 13.615 0 12.16 0H4.266Zm.267 1.6h6.933a.267.267 0 0 1 0 .533H4.533a.267.267 0 1 1 0-.533ZM3.2 3.2h9.6c1.066 0 1.066 1.031 1.066 1.031v3.236s0 1.066-1.066 1.066H3.2c-1.067 0-1.067-1.066-1.067-1.066v-3.2S2.133 3.2 3.2 3.2Zm0 7.467a1.066 1.066 0 1 1 0 2.132 1.066 1.066 0 0 1 0-2.132Zm9.6 0a1.067 1.067 0 1 1 0 2.133 1.067 1.067 0 0 1 0-2.133Z" fill="#F9B123"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg></i>
  105.                                             {{"Transports en commun"|trans}}
  106.                                             <br>
  107.                                             {{ centre.site.transports_commun|raw }}
  108.                                         </li>
  109.                                     </ul>
  110.                                 </div>
  111.                             {% endif %}
  112.                             {% if not centre.site.accessibilite_pmr is empty %}
  113.                                 <div>
  114.                                     <ul class="fa-ul">
  115.                                         <li>
  116.                                             <i class="fa-li fa"><svg width="17" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M234.486 100.91c27.837 0 50.452-22.59 50.452-50.455C284.938 22.582 262.323 0 234.486 0c-27.869 0-50.466 22.582-50.466 50.455 0 27.865 22.597 50.455 50.466 50.455Zm77.967 285.907c-13.407 46.553-56.323 80.741-107.136 80.741-61.532 0-111.573-50.042-111.573-111.556 0-45.535 27.471-84.727 66.674-102.045v-47.294C96.217 226 49.309 285.597 49.309 356.002 49.309 442.015 119.293 512 205.316 512c62.69 0 116.724-37.258 141.5-90.717l-17.614-34.609c-4.945.041-10.673.093-16.749.143Z" style="fill:#F9B123;fill-rule:nonzero" transform="scale(.03125)"/><path d="M459.45 446.708 391.867 313.84a29.625 29.625 0 0 0-26.395-16.2h-86.558v-19.738h74.495c7.439 0 13.692-3.888 17.731-9.489 2.624-3.649 4.491-7.888 4.491-12.734 0-12.269-9.937-22.22-22.222-22.22h-74.495v-66.946c0-18.413-13.652-44.443-44.427-44.443-24.544 0-44.441 19.901-44.441 44.443v145.044c0 25.038 20.297 45.335 45.335 45.335h111.927l59.345 116.68c5.215 10.277 15.622 16.207 26.422 16.207a29.362 29.362 0 0 0 13.408-3.23c14.605-7.408 20.406-25.256 12.967-39.841Z" style="fill:#F9B123;fill-rule:nonzero" transform="scale(.03125)"/></svg></i>
  117.                                             {{"Accessibilité aux PMR"|trans}}
  118.                                             <br>
  119.                                             {{ centre.site.accessibilite_pmr|raw }}
  120.                                         </li>
  121.                                     </ul>
  122.                                 </div>
  123.                             {% endif %}
  124.                         </div> -->
  125.                     </div>
  126.                     <div class="uk-margin-top uk-text-center apk-container-cta-modal">
  127.                         <img src="/static/img/icons/questionnaire-plasma.png" style="width:80px" alt="">
  128.                         <p>
  129.                             {{"Prenez 2 minutes pour vérifier que vous êtes bien dans les conditions pour donner votre sang"|trans}}
  130.                         </p>
  131.                         <button class="uk-button" uk-toggle="target: #apk-modal-test-plasma">{{"Faire le test"|trans}}</button>
  132.                     </div>
  133.                 </div>
  134.                 <div class="uk-width-1-3@s">
  135.                     {% if centre.site.picture %}
  136.                         {% if not centre.site.maps_url is empty %} <a href="{{ centre.site.maps_url }}" target="_blank"> {% endif %}
  137.                         <figure class="uk-margin-top">
  138.                             <img src="{{ centre.site.picture }}" alt="{{ centre.site.name }}" />
  139.                             {% if centre.site.copyright %}
  140.                                 <figcaption>{{ centre.site.copyright }}</figcaption>
  141.                             {% endif %}
  142.                         </figure>
  143.                         {% if not centre.site.maps_url is empty %} </a> {% endif %}
  144.                     {% else %}
  145.                         <img src="/static/img/logos/logo-crb.svg" alt="Croix-Rouge de Belgique"/>
  146.                     {% endif %}
  147.                 </div>
  148.                 <div class="uk-width-1-1 uk-margin-small-bottom">
  149.                     {% if centre.site.informations %}
  150.                         <div class="note">
  151.                             <ul class="fa-ul">
  152.                                 <li><img uk-svg width="14" height="14" src="/static/img/pictos/info-circle.svg" />
  153.                                     {{ centre.site.informations|raw }}
  154.                                 </li>
  155.                             </ul>
  156.                         </div>
  157.                     {% endif %}
  158.                 </div>
  159.             </div>
  160.             <div class="uk-margin-medium-top">
  161.                 <form class="uk-form" role="form" name="form-validation" id="form-validation" method="POST">
  162.                     <div class="uk-text-uppercase uk-width-1-1" style="border-bottom: 1px solid grey;">{{ "A quelle date souhaitez-vous vous inscrire ?"|trans }}</div>
  163.                     <div class="warning-message uk-margin-top">{{"ATTENTION : le délai minimum entre 2 dons est de 15 jours. Si vous venez de donner, assurez-vous que le délai est bien respecté lors de votre prise de rendez-vous."|trans}}</div>
  164.                     <div uk-slider>
  165.                         <div class="uk-position-relative">
  166.                             <div class="uk-slider-container uk-padding">
  167.                                 <ul class="uk-slider-items uk-grid-small" uk-grid>
  168.                                     {% for i in 0..5 %}
  169.                                         <li class=" uk-width-1-4@m">
  170.                                             <div class="apk-calendar">
  171.                                                 {{ calendriers[i]|raw }}
  172.                                             </div>
  173.                                         </li>
  174.                                     {% endfor %}
  175.                                 </ul>
  176.                             </div>
  177.                             <div class="uk-visible@s">
  178.                                 <a class="uk-position-center-left-out uk-position-small" href="#" uk-slidenav-previous uk-slider-item="previous"></a>
  179.                                 <a class="uk-position-center-right-out uk-position-small" href="#" uk-slidenav-next uk-slider-item="next"></a>
  180.                             </div>
  181.                         </div>
  182.                         <ul class="uk-slider-nav uk-dotnav uk-margin-bottom uk-margin-left"></ul>
  183.                     </div>
  184.                     <div class="uk-grid-small" uk-grid>
  185.                         <div class="uk-width-1-1">
  186.                             <div class="uk-text-uppercase" style="border-bottom: 1px solid grey;">
  187.                                 <label class="control-label">
  188.                                     {{ "A quelle heure souhaitez-vous prendre rendez-vous le"|trans }} <span id="dateSelect" name="dateSelect" class="date-selected">...</span> ?
  189.                                 </label>
  190.                             </div>
  191.                             <div class="uk-width-1-1@m" id="resultats">
  192.                                 <div class="resultats-placeholder">
  193.                                     <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-svg="info"><path fill="currentColor" d="M12.13,11.59 C11.97,12.84 10.35,14.12 9.1,14.16 C6.17,14.2 9.89,9.46 8.74,8.37 C9.3,8.16 10.62,7.83 10.62,8.81 C10.62,9.63 10.12,10.55 9.88,11.32 C8.66,15.16 12.13,11.15 12.14,11.18 C12.16,11.21 12.16,11.35 12.13,11.59 C12.08,11.95 12.16,11.35 12.13,11.59 L12.13,11.59 Z M11.56,5.67 C11.56,6.67 9.36,7.15 9.36,6.03 C9.36,5 11.56,4.54 11.56,5.67 L11.56,5.67 Z"></path><circle fill="none" stroke="currentColor" stroke-width="1.1" cx="10" cy="10" r="9"></circle></svg>
  194.                                     {{ "Veuillez sélectionner d'abord une date dans le calendrier au-dessus"|trans }}
  195.                                 </div>
  196.                             </div>
  197.                         </div>
  198.                     </div>
  199.                     <div class="uk-grid">
  200.                         <div class="uk-width-1-1">
  201.                             <div class="uk-text-uppercase" style="border-bottom: 1px solid grey;">
  202.                                 {{ "Avant de terminer votre inscription,"|trans }}<br/>
  203.                                 {{ "Nous avons besoin de ces quelques informations"|trans }}
  204.                             </div>
  205.                         </div>
  206.                     </div>
  207.                     <div class="uk-grid">
  208.                         {% if errorMessage or errorMessage != "" %}
  209.                             <div class="uk-width-1-1">
  210.                                 <div class="uk-margin-bottom uk-alert uk-alert-warning" id="error-msg" uk-alert>{% if errorMessage %}{{ errorMessage|trans }}{% endif %}</div>
  211.                             </div>
  212.                         {% endif %}
  213.                         <input type="hidden" name="akimedia-centre" value="{{ centre.site.id }}">
  214.                         <div class="uk-grid-medium" uk-grid>
  215.                             <div class="uk-width-1-2@s ">
  216.                                 <label class="control-label required" for="collecte_centre_form_lastname">{{ 'Nom'|trans }}</label><br/>
  217.                                 <input type="text" id="collecte_centre_form_lastname" name="lastname" required="required" class="uk-input">
  218.                             </div>
  219.                             <div class="uk-width-1-2@s">
  220.                                 <label class="control-label required" for="collecte_centre_form_firstname">{{ 'Prénom'|trans }}</label><br/>
  221.                                 <input type="text" id="collecte_centre_form_firstname" name="firstname" required="required" class="uk-input">
  222.                             </div>
  223.                             <div class="uk-width-1-2@s">
  224.                                 <label class="control-label required" for="collecte_centre_form_email">{{ 'Adresse mail'|trans }}</label><br/>
  225.                                 <input type="email" id="collecte_centre_form_email" name="email" required="required" class="uk-input">
  226.                             </div>
  227.                             <div class="uk-width-1-2@s">
  228.                                 <label class="control-label required" for="collecte_centre_form_email2">{{ 'Confirmez votre adresse mail'|trans }}</label><br/>
  229.                                 <input type="email" id="collecte_centre_form_email2" name="email2" required="required" class="uk-input">
  230.                             </div>
  231.                             <div class="uk-width-1-2@s">
  232.                                 <label class="control-label required" for="collecte_centre_form_phone">{{ 'Téléphone'|trans }}</label>
  233.                                 <input type="text" id="collecte_centre_form_phone" name="phone" required="required" class="uk-input">
  234.                             </div>
  235.                             <div class="uk-width-1-2@s">
  236.                                 <label class="control-label required" for="dtenaissance">{{ 'Date de naissance jj/mm/aaaa'|trans }}</label>
  237.                                 <input class="uk-input" type="date" name="dtenaissance"  id ="dtenaissance"
  238.                                     data-min="{{yearAllowed.min|date('Y-m-d')}}" data-max="{{yearAllowed.max|date('Y-m-d')}}"
  239.                                     value="" autocomplete="false" maxlength="10" required>
  240.                             </div>
  241.                             <div class="uk-width-1-1 apk-choix uk-margin-top uk-grid-margin uk-first-column">
  242.                                 <div class="uk-grid uk-grid-small uk-child-width-1-2@s" uk-grid>
  243.                                     <div>
  244.                                         <div class="apk-sang">
  245.                                             <div class="uk-margin-top uk-position-relative">
  246.                                                 <div>
  247.                                                     <label class="required">{{ 'Déjà donné du sang'|trans }}</label>
  248.                                                     <div id="inscription_form_plasma">
  249.                                                         <input type="radio" id="collecte_centre_form_alreadyBlood_0" name="alreadyBlood" required="required" value="OUI">
  250.                                                         <label for="collecte_centre_form_alreadyBlood_0" class="required apk-label-is-linked-to-field">{{ "Oui"|trans }}</label>
  251.                                                         <input type="radio" id="collecte_centre_form_alreadyBlood_1" name="alreadyBlood" required="required" value="NON">
  252.                                                         <label for="collecte_centre_form_alreadyBlood_1" class="required apk-label-is-linked-to-field">{{ "Non"|trans }}</label>
  253.                                                     </div>
  254.                                                 </div>
  255.                                             </div>
  256.                                         </div>
  257.                                     </div>
  258.                                     <div>
  259.                                         <div class="apk-plasma">
  260.                                             <div class="uk-margin-top uk-position-relative">
  261.                                                 <div>
  262.                                                     <label class="required">{{ 'Déjà donné du plasma'|trans }}</label>
  263.                                                     <div id="inscription_form_plasma">
  264.                                                         <input type="radio" id="collecte_centre_form_alreadyPlasma_0" name="alreadyPlasma" required="required" value="OUI">
  265.                                                         <label for="collecte_centre_form_alreadyPlasma_0" class="required apk-label-is-linked-to-field">{{ "Oui"|trans }}</label>
  266.                                                         <input type="radio" id="collecte_centre_form_alreadyPlasma_1" name="alreadyPlasma" required="required" value="NON">
  267.                                                         <label for="collecte_centre_form_alreadyPlasma_1" class="required apk-label-is-linked-to-field">{{ "Non"|trans }}</label>
  268.                                                     </div>
  269.                                                 </div>
  270.                                             </div>
  271.                                         </div>
  272.                                     </div>
  273.                                 </div>
  274.                             </div>
  275.                             <div class="uk-width-1-1">
  276.                                 <label class="gdpr-label">
  277.                                     <input type="checkbox" id="collecte_centre_form_gdpr" name="gdpr" required="required" class="uk-checkbox uk-margin-small-right" value="1">{{ 'En cochant cette case, vous acceptez la manière dont vos données sont traitées.'|trans }} *</label>
  278.                             </div>
  279.                             <div class="uk-width-1-1">
  280.                                 <div class="uk-display-inline-block">
  281.                                     <button type="submit" id="collecte_centre_form_submit" class="uk-button">{{"Envoyer"|trans}}</button>
  282.                                 </div>
  283.                             </div>
  284.                         </div>
  285.                     </div>
  286.                     <input id="collecte_centre_form_centre" name="centre" type="hidden" value="{{ centre.site.id }}">
  287.                     <input id="collecte_centre_form_date" name="date" type="hidden" value="">
  288.                     <input id="collecte_centre_form_horaire" name="horaire" type="hidden" value="">
  289.                     <input id="collecte_centre_form_heure" name="heure" type="hidden" value="">
  290.                 </form>
  291.             </div>
  292.         </div>
  293.     </div>
  294. </div>
  295.     
  296. {% endblock %}
  297. {% block inlinescripts %}
  298. <link href="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.css" rel="stylesheet">
  299. <script src="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.js"></script>
  300. <script src="https://npmcdn.com/flatpickr@4.6.13/dist/l10n/{{app.request.locale}}.js"></script>
  301.     {% if not editmode %}
  302. <script>
  303.     var borne = [];
  304.     {% set now = "now"|date("Y-m-d") %}
  305.     {% for date in dates %}
  306.         {% set d = date|date("Y-m-d") %}
  307.         {% if d >= now %}
  308.             borne.push('{{ d }}');
  309.         {% endif %}
  310.     {% endfor %}
  311.     
  312.     $( document ).ready(function() {
  313.         //gestion de la birthDate
  314.         newMaxDate = false;
  315.         const BirthMaxOri = new Date($('#dtenaissance').attr('data-max'));
  316.         const BirthMinOri = new Date($('#dtenaissance').attr('data-min'));
  317.         let inputBirthDate = $("#dtenaissance").flatpickr({
  318.             locale : "{{app.request.locale}}",
  319.             dateFormat : "d/m/Y",
  320.             minDate : BirthMinOri,
  321.             maxDate : BirthMaxOri,
  322.             allowInput: true,
  323.         });
  324.         function setDateMax () {
  325.             let BirthMax = BirthMaxOri;
  326.             let BirthMin = BirthMinOri;
  327.             let newMaxDate = null;
  328.             let radioSelected = null;
  329.             let found = false;
  330.             $('.schedule-item').each(function(el){
  331.                 if($(this).is('.is-selected')) {
  332.                     found = true;
  333.                     radioSelected = $(this).find('input:checked');
  334.                 }
  335.             });
  336.             if(found) {
  337.                 newMaxDate = radioSelected.attr('data-id');
  338.                 BirthMax18 = new Date(newMaxDate);
  339.                 newBirthMax = new Date(BirthMax18.setFullYear(BirthMax18.getFullYear() - parseFloat({{yearAllowed.year}})));
  340.                 inputBirthDate.set('maxDate', newBirthMax);
  341.             } else {
  342.                 inputBirthDate.set('maxDate', BirthMaxOri);
  343.             }
  344.             inputBirthDate.clear();
  345.         }
  346.         setDateMax();
  347.         
  348.         $("form").on("submit", function() {
  349.             if($("#collecte_centre_form_email").val() != $("#collecte_centre_form_email2").val()){
  350.                 $("#error-msg").text("{{ 'Les adresses e-mails sont différentes, veuillez corriger'|trans }}");
  351.                 $("#error-msg").addClass("uk-padding-small uk-margin-bottom");
  352.                 console.log('in');
  353.                 return false;
  354.             }
  355.             
  356.             if($("#collecte_centre_form_horaire").val() == 'zzzzz'){
  357.             $("#error-msg").text("{{ 'Veuillez choisir une date et une heure.'|trans }}");
  358.             return false;
  359.         }
  360.         
  361.         // Ajout du test de validiter de l'horaire pour eviter les doublon
  362.         var horaire = $("#collecte_centre_form_horaire").val()+'|'+$("#collecte_centre_form_heure").val();
  363.         var codeCentre = $("#collecte_centre_form_centre").val();
  364.         });        
  365.         $("form").on("submit", function() {
  366.         });
  367.         $('.day').each(function () {
  368.             console.log ($(this).attr('data-date'));
  369.             if(borne.includes($(this).attr('data-date'))){
  370.                 $(this).addClass('date_actif');
  371.             }
  372.             else {
  373.                 $(this).addClass('not-active');
  374.             }
  375.         });
  376.         $('.day.date_actif').on("click", function () {
  377.             $('.day.is-selected').removeClass('is-selected');
  378.             $(this).addClass('is-selected');
  379.             var date = $(this).attr('data-date');
  380.             var centreid = $(this).attr('data-centre-id');
  381.             $("#dateSelect").html($(this).attr('data-date-format'));
  382.             $("#collecte_centre_form_date").val(date);
  383.             var lang = '{{ app.request.locale }}';
  384.             
  385.             $.ajax({
  386.                 dataType: "json",
  387.                 type: "GET",
  388.                 url: "{{ path('getHoraireCentreAkimedia') }}",
  389.                 data: {'date': date ,'centreid':centreid, 'lang':lang},
  390.                 success: function (data) {
  391.                     
  392.                     $('#resultats').html(data["msg"]);
  393.                     $("input[name='inscription']").on("click", function(){ 
  394.                         $("#collecte_centre_form_heure").val($(this).val());
  395.                         $("#collecte_centre_form_horaire").val($(this).attr("data-id"));
  396.                     });                    
  397.                     console.log(data);
  398.                     inputBirthDate.clear();
  399.                     
  400.                     $('.schedule-item').on("click", function () {
  401.                         var $radioSelected = $(this).find('.uk-radio');
  402.                         if($radioSelected.attr("data-id")){
  403.                                 
  404.                         $('.schedule-item').removeClass('is-selected');
  405.                         $(this).addClass('is-selected');
  406.                         $radioSelected.prop('checked', true);
  407.                         setDateMax();
  408.                         $("#collecte_centre_form_heure").val($radioSelected.val());
  409.                         $("#collecte_centre_form_horaire").val($radioSelected.attr("data-id"));
  410.                         }
  411.                         else{
  412.                                 $('.schedule-item').removeClass('is-selected');
  413.                         }
  414.                     });
  415.                 },
  416.                 error: function (xhr, textStatus, errorThrown) {
  417.                     UIkit.notification('{{ "Oops! Une erreur s'est produite. Veuillez réessayer."|trans }}', {status: 'danger'});
  418.                     console.log(xhr, textStatus, errorThrown);
  419.                 }
  420.             });
  421.         })
  422.     });
  423. </script>
  424.     {% endif %}
  425. {% endblock inlinescripts %}