templates/evenement/detailsFront.html.twig line 1

Open in your IDE?
  1. {% extends 'backfront.html.twig' %}
  2. {% block title %}Sessions de formation SIP Academy - Calendrier et inscription{% endblock %}
  3. {% block meta_description %}
  4.     Inscrivez-vous aux prochaines sessions de formation chez SIP Academy. Consultez le calendrier de nos cours en ligne et en présentiel et planifiez votre avenir.
  5. {% endblock %}
  6. {% block body %}
  7.     <style>
  8.         #captcha > div {
  9.             width: 100%; /* Default width for non-mobile devices */
  10.             /* Media query for screens with a maximum width of 768 pixels (adjust as needed) */
  11.             @media (max-width: 768px) {
  12.                 width: 200px; /* Adjust the width for mobile devices */
  13.                 margin: 0 auto; /* Center the reCAPTCHA element */
  14.             }
  15.         }
  16.     </style>
  17.     <script>
  18.         var recaptchaCallback = function (){
  19.             var btnSubmitt = document.getElementById("button-confirm");
  20.             var captcha = document.getElementById("captcha");
  21.             captcha.classList.add("hidden");
  22.             if ( btnSubmitt.disabled ) {
  23.                 btnSubmitt.disabled = false;
  24.             }
  25.             console.log('checked !');
  26.         }
  27.     </script>
  28. <!--Event Area Start-->
  29. <div class="event-details-area section-padding">
  30.     <div class="container">
  31.         {% for flashMessages in app.flashes('success') %}
  32.             <div class="alert  alert-success alert-dismissible fade show">
  33.                 <i class="bi-check-circle-fill"></i>
  34.                 <strong class="mx-2">         {{ flashMessages }}</strong>
  35.                 <!--begin::Close-->
  36.                 <button type="button" class="position-absolute  m-2 m-sm-0 top-0 end-0 btn btn-icon ms-sm-auto" data-bs-dismiss="alert">
  37.                 <span class="svg-icon svg-icon-2x svg-icon-muted">
  38.                     <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
  39. <rect opacity="0.3" x="2" y="2" width="20" height="20" rx="10" fill="currentColor"/>
  40. <rect x="7" y="15.3137" width="12" height="2" rx="1" transform="rotate(-45 7 15.3137)" fill="currentColor"/>
  41. <rect x="8.41422" y="7" width="12" height="2" rx="1" transform="rotate(45 8.41422 7)" fill="currentColor"/>
  42. </svg>
  43.                 </span>
  44.                 </button>
  45.                 <!--end::Close-->
  46.             </div>
  47.         {% endfor %}
  48.         <div class="row">
  49.             <div class="col-lg-9 col--12">
  50.                 <div class="events-details-right-sidebar">
  51.                     <div class="events-details-img1 img-full">
  52.                         <h3>{{ evenement.titre }}</h3>
  53.                         {% if evenement.imgdetail %}
  54.                             <img  alt="" src="{{asset('uploads/evenement/'~ evenement.imgdetail  )}}">
  55.                         {% elseif evenement.formation %}
  56.                             <img  alt="" src="{{asset('uploads/formation/'~ evenement.formation.affiche  )}}">
  57.                             {% else %}
  58.                         {% endif %}
  59.                     </div>
  60.                     <div class="events-details-all">
  61.                         <div class="events-details-time">
  62.                             <div class="time-icon">
  63.                                 <i class="zmdi zmdi-time"></i>
  64.                             </div>
  65.                             <div class="time-text">
  66.                                 <span>Date Début</span>
  67.                                 <p class="time-mrg">{{ evenement.starttime |date('d-m-Y H:i') }}</p>
  68.                             </div>
  69.                         </div>
  70.                         <div class="events-details-time mrg-xs">
  71.                             <div class="time-icon">
  72.                                 <i class="zmdi zmdi-time"></i>
  73.                             </div>
  74.                             <div class="time-text">
  75.                                 <span>Date Fin</span>
  76.                                 <p class="time-mrg">{{  evenement.endtime |date('d-m-Y H:i') }}</p>
  77. {#                                <p>Monday,July 09,2016</p>#}
  78.                             </div>
  79.                         </div>
  80.                         <div class="events-details-time mrg-xs">
  81.                             <div class="time-icon">
  82.                                 <i class="zmdi zmdi-pin"></i>
  83.                             </div>
  84.                             <div class="time-text">
  85.                                 <span>Adresse</span>
  86.                                 <p class="time-mrg">{{ evenement.adresse }}</p>
  87.                             </div>
  88.                         </div>
  89.                         <div class="events-details-time  mrg-xs">
  90.                             <div class="time-icon">
  91.                                 <i class="zmdi zmdi-money"></i>
  92.                             </div>
  93.                             <div class="time-text">
  94.                                 {% if evenement.prixpromo == null %}
  95.                                     <span>Prix</span>
  96.                                     {% if evenement.formation %}
  97.                                     <p > {{ evenement.formation.prix }}DT</p>
  98. {% endif %}
  99.                                 {% else %}
  100.                                     <span>Prix Promo</span>
  101.                                     <p style="color: green"> {{ evenement.prixpromo }}DT</p>
  102.                                 {% endif %}
  103.                             </div>
  104.                         </div>
  105.                     </div>
  106.                     {% if evenement.lienprog %}
  107.                         <div class="programme-section ">
  108.                             <div class="programme-header d-flex flex-wrap align-items-center justify-content-between gap-3">
  109.                                 <div class="programme-title">
  110.                                     <div class="d-flex align-items-center gap-3">
  111.                                         <div class="programme-icon">
  112.                                             <i class="zmdi zmdi-file-text"></i>
  113.                                         </div>
  114.                                         <div>
  115.                                             <h3 class="mb-0 fw-bold" style="color: #1F3971;">Programme Détaillé</h3>
  116.                                             <p class="text-muted small mb-0">Téléchargez le programme complet de la formation</p>
  117.                                         </div>
  118.                                     </div>
  119.                                 </div>
  120.                                 <div class="programme-download">
  121.                                     <a href="{{ asset('uploads/evenement/' ~ evenement.lienprog) }}"
  122.                                        download
  123.                                        class="btn-download-programme"
  124.                                        title="Télécharger le programme">
  125.                                         <i class="zmdi zmdi-download"></i>
  126.                                         <span>Télécharger le programme</span>
  127.                                         <i class="zmdi zmdi-file-pdf"></i>
  128.                                     </a>
  129.                                 </div>
  130.                             </div>
  131.                         </div>
  132.                         <style>
  133.                             .programme-section {
  134.                                 background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
  135.                                 border-radius: 20px;
  136.                                 padding: 25px 30px;
  137.                                 margin: 30px 0;
  138.                                 border: 1px solid rgba(31,57,113,0.1);
  139.                                 transition: all 0.3s ease;
  140.                             }
  141.                             .programme-section:hover {
  142.                                 box-shadow: 0 10px 30px rgba(31,57,113,0.1);
  143.                                 transform: translateY(-2px);
  144.                             }
  145.                             .programme-icon {
  146.                                 width: 50px;
  147.                                 height: 50px;
  148.                                 background: linear-gradient(135deg, #1F3971, #2d52b0);
  149.                                 border-radius: 15px;
  150.                                 display: flex;
  151.                                 align-items: center;
  152.                                 justify-content: center;
  153.                                 color: white;
  154.                                 font-size: 24px;
  155.                             }
  156.                             .btn-download-programme {
  157.                                 display: inline-flex;
  158.                                 align-items: center;
  159.                                 gap: 12px;
  160.                                 background: linear-gradient(135deg, #FFAE27, #e09500);
  161.                                 color: #1F3971;
  162.                                 padding: 12px 28px;
  163.                                 border-radius: 50px;
  164.                                 text-decoration: none;
  165.                                 font-weight: 600;
  166.                                 font-size: 14px;
  167.                                 transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  168.                                 border: none;
  169.                                 cursor: pointer;
  170.                                 box-shadow: 0 4px 15px rgba(255,174,39,0.2);
  171.                             }
  172.                             .btn-download-programme:hover {
  173.                                 background: linear-gradient(135deg, #e09500, #FFAE27);
  174.                                 transform: translateY(-3px);
  175.                                 box-shadow: 0 8px 25px rgba(255,174,39,0.35);
  176.                                 color: #1F3971;
  177.                             }
  178.                             .btn-download-programme i {
  179.                                 font-size: 20px;
  180.                             }
  181.                             .btn-download-programme i:first-child {
  182.                                 font-size: 18px;
  183.                             }
  184.                             .btn-download-programme i:last-child {
  185.                                 font-size: 22px;
  186.                             }
  187.                             .programme-info {
  188.                                 padding-top: 15px;
  189.                                 border-top: 1px solid rgba(31,57,113,0.1);
  190.                             }
  191.                             .info-item {
  192.                                 display: inline-flex;
  193.                                 align-items: center;
  194.                                 gap: 8px;
  195.                                 color: #6c757d;
  196.                                 font-size: 13px;
  197.                             }
  198.                             .info-item i {
  199.                                 color: #FFAE27;
  200.                                 font-size: 16px;
  201.                             }
  202.                             @media (max-width: 768px) {
  203.                                 .programme-section {
  204.                                     padding: 20px;
  205.                                 }
  206.                                 .programme-header {
  207.                                     flex-direction: column;
  208.                                     text-align: center;
  209.                                 }
  210.                                 .programme-title {
  211.                                     width: 100%;
  212.                                 }
  213.                                 .programme-title .d-flex {
  214.                                     justify-content: center;
  215.                                 }
  216.                                 .btn-download-programme {
  217.                                     width: 100%;
  218.                                     justify-content: center;
  219.                                 }
  220.                                 .programme-info {
  221.                                     justify-content: center;
  222.                                 }
  223.                             }
  224.                         </style>
  225.                     {% endif %}
  226.                     <div class="about-lectures">
  227.                         <h3>Description</h3>
  228.                             {{ evenement.description|raw}}
  229.                                   </div>
  230.                     <br>
  231.                     {% if sections  != null %}
  232.                         <div class="course-duration " style="margin-bottom: 20px">
  233.                             <div class="duration-title">
  234.                                 <div class="text"><span>Sections</span> <span class="text-right"> Durée</span></div>
  235.                             </div>
  236.                             <div class="duration-text">
  237.                                 {%  for section  in sections %}
  238.                                     <div class="text"><span >{{ section.titre }}</span> <span class="text-right">{{ section.duree }}</span></div>
  239.                                 {% endfor %}
  240.                             </div>
  241.                         </div>
  242.                     {% endif %}
  243.                     {% if evenement.imgprog %}
  244. {#                        {{ evenement.imgprog  }}#}
  245.                     <div class="events-details-img1 img-full">
  246.                             <img  alt="" src="{{asset('uploads/evenement/'~ evenement.imgprog )}}">
  247.                     </div>
  248.                     {% endif %}
  249.                     <div class=" yellow-bg">
  250.                         <div class="contact-form-wrap">
  251.                             <h2 class="contact-title">Formulaire Inscription</h2>
  252.                             {{ form_start(form) }}
  253.                                 <div class="row">
  254.                                     <div class="col-6">
  255.                                         <div class="contact-form-style mb-20">
  256.                                             {{ form_widget(form.nom,{'attr':{'class':'form-control form-control-solid','rows':'3', 'placeholder':"Nom*",'required':'true'}}) }}
  257.                                         </div>
  258.                                     </div>
  259.                                     <div class="col-6">
  260.                                         <div class="contact-form-style mb-20">
  261.                                             {{ form_widget(form.prenom,{'attr':{'class':'form-control form-control-solid','rows':'3', 'placeholder':"Prénom*",'required':'true'}}) }}
  262.                                         </div>
  263.                                     </div>
  264.                                     <div class="col-12">
  265.                                         <div class="contact-form-style mb-20">
  266.                                             {{ form_widget(form.email,{'attr':{'class':'form-control form-control-solid','rows':'3', 'placeholder':"Email*",'required':'true'}}) }}
  267.                                         </div>
  268.                                     </div>
  269.                                     <div class="col-6">
  270.                                         <div class="contact-form-style mb-20">
  271.                                             {{ form_widget(form.phone,{'attr':{'class':'form-control form-control-solid','rows':'3', 'placeholder':"Téléphone*",'required':'true'}}) }}
  272.                                         </div>
  273.                                     </div>
  274.                                     <div class="col-6">
  275.                                         <div class="contact-form-style mb-20">
  276.                                             {{ form_widget(form.whatsapp,{'attr':{'class':'form-control form-control-solid','rows':'3', 'placeholder':"WhatsApp"}}) }}
  277.                                         </div>
  278.                                     </div>
  279.                                     <div class="col-12">
  280.                                         <div class="contact-form-style mb-20">
  281.                                             {{ form_widget(form.adresse,{'attr':{'class':'form-control form-control-solid','rows':'3', 'placeholder':"Adresse*",'required':'true'}}) }}
  282.                                         </div>
  283.                                     </div>
  284.                                     <div class="col-12">
  285.                                         <div class="form-check form-check-inline">
  286.                                             {% for op in form.mode %}
  287.                                                 <label class="form-check-label">
  288.                                                     {{ form_errors(op) }}
  289.                                                     {{ form_widget(op ,{'attr':{'class':'form-check-input','rows':'2' }}) }}
  290.                                                     <h4 style="color: white">{{ op.vars.label }}</h4>
  291.                                                     &nbsp;&nbsp;&nbsp;&nbsp; </label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  292.                                             {% endfor %}
  293.                                         </div>
  294.                                     </div>
  295.                                     <div class="mb-3 d-flex align-items-center flex-wrap gap-3">
  296.                                         {{ form_label(form.disponibilte, 'Disponibilité', {
  297.                                             'label_attr': {'class': 'form-label mb-0 me-3 text-gray fs-6'}
  298.                                         }) }}
  299.                                         {% for op in form.disponibilte %}
  300.                                             <div class="form-check form-check-inline mb-0">
  301.                                                 {{ form_widget(op, {'attr': {'class': 'form-check-input'}}) }}
  302.                                                 {{ form_label(op, null, {'label_attr': {'class': 'form-check-label ms-1 mb-0 text-light fs-6'}}) }}
  303.                                                 {{ form_errors(op) }}
  304.                                             </div>
  305.                                         {% endfor %}
  306.                                     </div>
  307.                                     <div class="col-12">
  308.                                         <div class="contact-form-style mb-20">
  309.                                             <input name="idvoucher" class="form-control form-control-solid" placeholder="Voucher si vous avez">
  310.                                         </div>
  311.                                     </div>
  312.                                     <div class="col-md-12">
  313.                                         <div class="contact-form-style">
  314.                                             {{ form_widget(form.message,{'attr':{'class':'form-control form-control-solid','rows':'3', 'placeholder':"Message*",'required':'true'}}) }}</div>
  315.                                     </div>
  316.                                     <div class="col-md-6">
  317.                                             <div style="width: 100px;" id="captcha" class="g-recaptcha"
  318.                                                  data-sitekey="6LeIOc0lAAAAAHX9N25sC0hFU8IjprSY1GH7cVOp"
  319.                                                   data-callback="recaptchaCallback">
  320.                                             </div>
  321.                                             </div>
  322.                                             <button class="button-default"
  323.                                                     disabled
  324.                                                     id="button-confirm" type="submit"><span>Valider </span></button>
  325.                                 </div>
  326.                             {{ form_end(form) }}
  327.                             <p class="form-messege"></p>
  328.                         </div>
  329.                     </div>
  330. {#                    <div class="event-content">#}
  331. {#                        <h3 class="content2">Event Content</h3>#}
  332. {#                        <ul>#}
  333. {#                            <li>Over 40 lectures and 60 hours of content</li>#}
  334. {#                            <li>Live Project End to End Software Testing Training Included</li>#}
  335. {#                            <li>Information packed practical training starting from basics to advanced testing techniques.</li>#}
  336. {#                            <li>Course content designed by considering current software testing technology and the job market.</li>#}
  337. {#                            <li>Best suitable for beginners to advanced level users and who learn faster when demonstrated.</li>#}
  338. {#                            <li>Practical assignments at the end of every session.</li>#}
  339. {#                        </ul>#}
  340. {#                    </div>#}
  341. {#                    <div class="event-participants">#}
  342. {#                        <h3 class="content2">Event Participants</h3>#}
  343. {#                        <div class="row">#}
  344. {#                            <div class="col-lg-3 col-md-3 col-12">#}
  345. {#                                <div class="participants-details text-center img-full mb-30">#}
  346. {#                                    <a href="#">#}
  347. {#                                        <img src="img/teacher/l-1.jpg" alt="">#}
  348. {#                                    </a>#}
  349. {#                                    <h3>T Rayed</h3>#}
  350. {#                                    <p>Chif Principal</p>#}
  351. {#                                </div>#}
  352. {#                            </div>#}
  353. {#                            <div class="col-lg-3 col-md-3 col-12">#}
  354. {#                                <div class="participants-details text-center img-full mb-30">#}
  355. {#                                    <a href="#">#}
  356. {#                                        <img src="img/teacher/l-2.jpg" alt="">#}
  357. {#                                    </a>#}
  358. {#                                    <h3>S Tasnim</h3>#}
  359. {#                                    <p>Head Teacher</p>#}
  360. {#                                </div>#}
  361. {#                            </div>#}
  362. {#                            <div class="col-lg-3 col-md-3 col-12">#}
  363. {#                                <div class="participants-details text-center img-full mb-30">#}
  364. {#                                    <a href="#">#}
  365. {#                                        <img src="img/teacher/l-3.jpg" alt="">#}
  366. {#                                    </a>#}
  367. {#                                    <h3>FH Shuvo</h3>#}
  368. {#                                    <p>Chif Principal</p>#}
  369. {#                                </div>#}
  370. {#                            </div>#}
  371. {#                            <div class="col-lg-3 col-md-3 col-12">#}
  372. {#                                <div class="participants-details text-center img-full mb-30">#}
  373. {#                                    <a href="#">#}
  374. {#                                        <img src="img/teacher/l-4.jpg" alt="">#}
  375. {#                                    </a>#}
  376. {#                                    <h3>Lalen</h3>#}
  377. {#                                    <p>Head Teacher</p>#}
  378. {#                                </div>#}
  379. {#                            </div>#}
  380. {#                        </div>#}
  381. {#                    </div>#}
  382.                 </div>
  383.             </div>
  384.             <div class="col-lg-3">
  385.                 <div class="sidebar-widget">
  386.                     <div class="single-sidebar-widget">
  387.                         <h4 class="title">Prochaines Sessions</h4>
  388.                         <div class="recent-content">
  389.                             {% for eve in evenements|sort|reverse %}
  390. {#                            {% if evenement.id != eve.id %}#}
  391.                                 <div class="recent-content-item">
  392.                                     <a href="{{ path('app_details_session',{'slug':eve.slug}) }}">
  393.                                         {% if eve.imgdetail %}
  394.                                             <img  alt="" style="width: 70px;height: 65px"  src="{{asset('uploads/evenement/'~ eve.imgdetail  )}}">
  395.                                         {% elseif eve.formation %}
  396.                                             <img  alt="" style="width: 70px;height: 65px"  src="{{asset('uploads/formation/'~ eve.formation.affiche  )}}">
  397.                                             {% else %}
  398.                                         {% endif %}
  399.                                     </a>
  400.                                     <div class="recent-text">
  401.                                         <h4><a href="{{ path('app_details_session',{'slug':eve.slug}) }}">{{ eve.titre }}</a></h4>
  402.                                         <div class="single-item-comment-view">
  403.                                             <span><i class="zmdi zmdi-time"></i>{{ eve.starttime |date('d M H:i') }}</span>
  404.                                             <span><i class="zmdi zmdi-time"></i>{{ eve.endtime |date('d M H:i') }}</span>
  405.                                         </div>
  406.                                     </div>
  407.                                 </div>
  408. {#                            {% endif %}#}
  409.                             {% endfor %}
  410.                         </div>
  411.                     </div>
  412.                     <div class="single-sidebar-widget">
  413.                         <h4 class="title">Anciennes Sessions</h4>
  414.                         <div class="recent-content">
  415.                             {% for eve in ancienevents|sort|reverse %}
  416.                                 {% if evenement.id != eve.id %}
  417.                                     <div class="recent-content-item">
  418.                                         <a href="{{ path('app_details_session',{'slug':eve.slug}) }}">
  419.                                             {% if eve.imgdetail %}
  420.                                                 <img  alt="" style="width: 70px;height: 65px"  src="{{asset('uploads/evenement/'~ eve.imgdetail  )}}">
  421.                                             {% elseif eve.formation %}
  422.                                                 <img  alt="" style="width: 70px;height: 65px"  src="{{asset('uploads/formation/'~ eve.formation.affiche  )}}">
  423.                                             {% else %}
  424.                                             {% endif %}
  425.                                         </a>
  426.                                         <div class="recent-text">
  427.                                             <h4><a href="{{ path('app_details_session',{'slug':eve.slug}) }}">{{ eve.titre }}</a></h4>
  428.                                             <div class="single-item-comment-view">
  429.                                                 <span><i class="zmdi zmdi-time"></i>{{ eve.starttime |date('d M H:i') }}</span>
  430.                                                 <span><i class="zmdi zmdi-time"></i>{{ eve.endtime |date('d M H:i') }}</span>
  431.                                             </div>
  432.                                         </div>
  433.                                     </div>
  434.                                 {% endif %}
  435.                             {% endfor %}
  436.                         </div>
  437.                     </div>
  438.                     <div class="single-sidebar-widget">
  439.                         <h4 class="title">Dernières Actualités</h4>
  440.                         <div class="recent-content">
  441.                             {% for actualite in actualites %}
  442.                             <div class="recent-content-item">
  443.                                 <a href="{{ path('app_details_actualite',{'slug':actualite.slug}) }}"><img src="{{asset('uploads/actualite/'~ actualite.image  )}}" style="width: 70px;height: 65px" alt=""></a>
  444.                                 <div class="recent-text">
  445.                                     <h4><a href="{{ path('app_details_actualite',{'slug':actualite.slug}) }}">{{ actualite.titre }}</a></h4>
  446.                                     <a class="single-item-comment-view" style="height: 20px;margin-bottom: 0px;color: darkblue;font-size: 13px"
  447.                                        href="{{ path('app_details_actualite',{'slug':actualite.slug}) }}"
  448.                                     >Lire la suite</a>
  449.                                     <div class="single-item-comment-view">
  450.                                         <span><i class="zmdi zmdi-eye"></i>{{ actualite.nbvue }}</span>
  451.                                         <span><i class="zmdi zmdi-comments"></i>{{ actualite.nbcommentaire }}</span>
  452.                                     </div>
  453.                                 </div>
  454.                             </div>
  455. {% endfor %}
  456.                         </div>
  457.                     </div>
  458.                     <div class="single-sidebar-widget">
  459.                         <div class="widget-banner img-full">
  460.                             <a href="#"><img src="img/banner/event-banner1.jpg" alt=""></a>
  461.                         </div>
  462.                     </div>
  463.                 </div>
  464.             </div>
  465.         </div>
  466.     </div>
  467. </div>
  468. <!--End of Event Area-->
  469.     {# Dans votre formulaire d'inscription, ajoutez ce script #}
  470.     <script>
  471.         document.addEventListener('DOMContentLoaded', function() {
  472.             const emailInput = document.querySelector('input[name="inscrit_session[email]"]');
  473.             const voucherInput = document.querySelector('input[name="idvoucher"]');
  474.             let couponChecked = false;
  475.             if (emailInput && voucherInput) {
  476.                 emailInput.addEventListener('blur', function() {
  477.                     const email = this.value;
  478.                     const slug = '{{ evenement.slug }}';
  479.                     if (email && email.includes('@') && !couponChecked) {
  480.                         // Afficher un loader
  481.                         voucherInput.placeholder = 'Vérification en cours...';
  482.                         voucherInput.disabled = true;
  483.                         fetch('{{ path("app_check_available_coupon") }}', {
  484.                             method: 'POST',
  485.                             headers: {
  486.                                 'Content-Type': 'application/json',
  487.                             },
  488.                             body: JSON.stringify({
  489.                                 email: email,
  490.                                 slug: slug
  491.                             })
  492.                         })
  493.                             .then(response => response.json())
  494.                             .then(data => {
  495.                                 if (data.success && data.coupon_code) {
  496.                                     voucherInput.value = data.coupon_code;
  497.                                     couponChecked = true;
  498.                                     // Afficher une notification
  499.                                     showNotification(
  500.                                         '🎉 Bonne nouvelle !',
  501.                                         `Un coupon de réduction de ${data.reduction}% a été automatiquement appliqué à votre inscription.`,
  502.                                         'success'
  503.                                     );
  504.                                     // Ajouter une classe de succès au champ
  505.                                     voucherInput.classList.add('is-valid');
  506.                                     voucherInput.style.borderColor = '#28a745';
  507.                                 } else {
  508.                                     voucherInput.placeholder = 'Voucher si vous avez';
  509.                                     showNotification(
  510.                                         'ℹ️ Information',
  511.                                         'Aucun coupon disponible pour le moment. Vous pouvez toujours en utiliser un manuellement.',
  512.                                         'info'
  513.                                     );
  514.                                 }
  515.                                 voucherInput.disabled = false;
  516.                             })
  517.                             .catch(error => {
  518.                                 console.error('Erreur:', error);
  519.                                 voucherInput.disabled = false;
  520.                                 voucherInput.placeholder = 'Voucher si vous avez';
  521.                             });
  522.                     }
  523.                 });
  524.             }
  525.             function showNotification(title, message, type) {
  526.                 // Créer la notification
  527.                 const notification = document.createElement('div');
  528.                 notification.className = `alert alert-${type} alert-dismissible fade show position-fixed top-0 end-0 m-3`;
  529.                 notification.style.zIndex = '9999';
  530.                 notification.style.minWidth = '300px';
  531.                 notification.innerHTML = `
  532.             <strong>${title}</strong><br>
  533.             <small>${message}</small>
  534.             <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
  535.         `;
  536.                 document.body.appendChild(notification);
  537.                 // Auto-supprimer après 5 secondes
  538.                 setTimeout(() => {
  539.                     notification.remove();
  540.                 }, 5000);
  541.             }
  542.         });
  543.     </script>
  544.     <style>
  545.         .is-valid {
  546.             border-color: #28a745 !important;
  547.             background-color: #f0fff0 !important;
  548.         }
  549.     </style>
  550. {% endblock %}