templates/front/inscriptions/inscription-index.html.twig line 1

Open in your IDE?
  1. {% extends 'front.html.twig' %}
  2. {% block title %}Inscription | CIMEF-INTERNATIONAL{% endblock %}
  3. {% block styleSheets %}
  4. <!-- jQuery (OBLIGATOIRE avant Select2) -->
  5. <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
  6. <script>
  7. /*    $(document).ready(function () {
  8.     let $thematique = $('#new_inscription_form_thematique');
  9.     let $theme = $('#new_inscription_form_theme');
  10.     let $lieu = $('#new_inscription_form_lieu');
  11.     let $periode = $('#new_inscription_form_periode');
  12.     let $prix = $('#new_inscription_form_prix');
  13.     $theme.hide();
  14.     $lieu.hide();
  15.     $periode.hide();
  16.     $prix.hide();
  17.     $thematique.on('change', function () {
  18.         let thematiqueVal = $(this).val();
  19.         if (thematiqueVal !== '') {
  20.             $theme.show();
  21.             $.ajax({
  22.                 url: "{{ path('front.inscriptions', { annee: annee }) }}",
  23.                 type: "POST",
  24.                 data: { thematiqueVal: thematiqueVal },
  25.                 dataType: "json",
  26.                 success: function (response) {
  27.                     if (response.thematique_id) {
  28.                         $periode.show();
  29.                         $('#new_inscription_form_periode').val(response.thematique_id).trigger('change');
  30.                     
  31.                         let $theme = $('#new_inscription_form_theme');
  32.                         $theme.empty();
  33.                         $theme.append('<option value="">Sélectionner un thème</option>');
  34.             
  35.                         data.forEach(function (item) {
  36.                             $theme.append(
  37.                                 `<option value="${item.id}">${item.nom}</option>`
  38.                             );
  39.                         });
  40.                     } else {
  41.                         $periode.hide();
  42.                     }
  43.                 },
  44.                 error: function () {
  45.                     console.error('Erreur AJAX');
  46.                 }
  47.             });
  48.         } else {
  49.             $theme.hide();
  50.             $lieu.hide();
  51.             $periode.hide();
  52.             $prix.hide();
  53.         }
  54.     });
  55. }); */
  56. </script>
  57. <script>
  58. $(document).ready(function () {
  59.     const $thematique = $('#new_inscription_form_thematique');
  60.     const $theme      = $('#new_inscription_form_theme');
  61.     const $lieu       = $('#new_inscription_form_lieu');
  62.     const $periode    = $('#new_inscription_form_periode');
  63.     const $prix       = $('#new_inscription_form_prix');
  64.     const $loader     = $('#loader');
  65.     
  66.     $('#new_inscription_form_prix').prop('readonly', true);
  67.     $('#new_inscription_form_periode').prop('readonly', true);
  68.     $theme.parent().hide();
  69.     $lieu.parent().hide();
  70.     $periode.parent().hide();
  71.     $prix.parent().hide();
  72.     /* =========================
  73.        THÉMATIQUE → THÈMES
  74.     ========================= */
  75.     $thematique.on('change', function () {
  76.         let thematiqueVal = $(this).val();
  77.         
  78.         $theme.parent().hide();
  79.         $lieu.parent().hide();
  80.         $periode.parent().hide();
  81.         $prix.parent().hide();
  82.         if (!thematiqueVal) return;
  83.         
  84.         $loader.show();
  85.         $.ajax({
  86.             url: "{{ path('front.inscriptions', { annee: annee }) }}",
  87.             type: "POST",
  88.             dataType: "json",
  89.             data: {
  90.                 action: 'themes',
  91.                 thematiqueVal: thematiqueVal
  92.             },
  93.             success: function (data) {
  94.                 $theme.empty();
  95.                 $theme.append('<option value="">Sélectionner un thème</option>');
  96.                 data.forEach(item => {
  97.                     $theme.append(
  98.                         `<option value="${item.id}">${item.nom}</option>`
  99.                     );
  100.                 });
  101.                 $theme.parent().show();
  102.             },
  103.             complete: function () {
  104.                 $loader.hide();
  105.             }
  106.         });
  107.     });
  108.     /* =========================
  109.        THÉMATIQUE → THÈME → LIEUX
  110.     ========================= */
  111.     $theme.on('change', function () {
  112.         let themeVal = $(this).val();
  113.         $lieu.parent().hide();
  114.         $periode.parent().hide();
  115.         $prix.parent().hide();
  116.         if (!themeVal) return;
  117.         
  118.         $loader.show();
  119.         $.ajax({
  120.             url: "{{ path('front.inscriptions', { annee: annee }) }}",
  121.             type: "POST",
  122.             dataType: "json",
  123.             data: {
  124.                 action: 'lieux',
  125.                 themeVal: themeVal
  126.             },
  127.             success: function (data) {
  128.                 $lieu.empty();
  129.                 $lieu.append('<option value="">Sélectionner le lieu</option>');
  130.                 data.forEach(item => {
  131.                     $lieu.append(
  132.                         `<option value="${item.id}">${item.lieu}</option>`
  133.                     );
  134.                 });
  135.                 $lieu.parent().show();
  136.             },
  137.             complete: function () {
  138.                 $loader.hide();
  139.             }
  140.         });
  141.     });
  142.     /* =========================
  143.        THÉMATIQUE → THÈME → LIEUX → DATE
  144.     ========================= */
  145.     $lieu.on('change', function () {
  146.     
  147.         let formationId = $(this).val();
  148.     
  149.         $periode.parent().hide();
  150.         $prix.parent().hide();
  151.     
  152.         if (!formationId) return;
  153.         
  154.         $loader.show();
  155.     
  156.         $.ajax({
  157.             url: "{{ path('front.inscriptions', { annee: annee }) }}",
  158.             type: "POST",
  159.             dataType: "json",
  160.             data: {
  161.                 action: 'lieu_details',
  162.                 formationId: formationId
  163.             },
  164.             success: function (data) {
  165.     
  166.                 // Session (date)
  167.                 $('#new_inscription_form_periode')
  168.                     .val(data.session)
  169.                     .parent()
  170.                     .show();
  171.     
  172.                 // Prix
  173.                 $('#new_inscription_form_prix')
  174.                     .val(data.prix + ' ' + data.devise)
  175.                     .parent()
  176.                     .show();
  177.             },
  178.             complete: function () {
  179.                 $loader.hide();
  180.             }
  181.         });
  182.     });
  183. });
  184. </script>
  185. <style id='wp-emoji-styles-inline-css' type='text/css'>
  186. /* 🔄 Spinner */
  187. .loader {
  188.     display: none;
  189.     width: 25px;
  190.     height: 25px;
  191.     border: 3px solid #ddd;
  192.     border-top: 3px solid #007bff;
  193.     border-radius: 50%;
  194.     animation: spin 0.8s linear infinite;
  195.     margin-top: 10px;
  196. }
  197. @keyframes spin {
  198.     100% { transform: rotate(360deg); }
  199. }
  200. label {
  201.     font-family: arial;
  202.     font-weight: bold;
  203. }
  204. .form-control{
  205.     width:100%;
  206.     height:40px;
  207.     padding:10px;
  208.     border-radius:8px;
  209.     font-family: arial;
  210.     margin-bottom: 5px;
  211.     border:1px solid #ccc;
  212. }
  213. .textarea{
  214.     width:100%;
  215.     height:45px;
  216.     padding:10px;
  217.     font-family: arial;
  218.     border:1px solid #ccc;
  219.     height: 100px !important;
  220.     border-radius:1px !important;
  221. }
  222. .row {
  223.     display: flex;            /* flexbox pour aligner les colonnes */
  224.     flex-wrap: wrap;          /* les colonnes passent à la ligne si nécessaire */
  225.     margin-right: -0.75rem;   /* -gutter/2 */
  226.     margin-left: -0.75rem;    /* -gutter/2 */
  227. }
  228. .events_pagination ul.pagination {
  229.     display: flex;
  230.     flex-wrap: wrap;
  231.     justify-content: center;
  232.     list-style: none;
  233.     margin: 0;
  234.     padding: 0;
  235. }
  236. .page-item.active .page-link {
  237.     background-color: #ff6600;
  238.     color: #fff;
  239. }
  240. .page-link {
  241.     margin: 10px;
  242.     color: #051a53;
  243.     background-color: #ededed;
  244.     border-radius: 5px;
  245.     padding: 10px;
  246.     /* margin: 0 3px; */
  247. }
  248. .text-lien{
  249.    color: #ff6600;
  250.    /* font-size: 16px; */
  251. }
  252. /* Small devices ≥576px */
  253. @media (min-width: 576px) {
  254.   .col-3 { flex: 0 0 100%; max-width: 100%; }
  255.   .col-sm-4 { flex: 0 0 100%; max-width: 100%; }
  256.   .col-sm-6 { flex: 0 0 100%; max-width: 100%; }
  257.   .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
  258. }
  259. /* Medium devices ≥768px */
  260. @media (min-width: 768px) {
  261.   .col-md-3 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  262.   .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  263.   .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  264.   .col-md-12 { flex: 0 0 100%; max-width: 100%; }
  265. }
  266. /* Large devices ≥992px */
  267. @media (min-width: 992px) {
  268.   .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  269.   .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  270.   .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
  271.   .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
  272. }
  273. .type1 .date-event {
  274.     transition: all 0.5s ease;
  275.     position: absolute;
  276.     bottom: 20px;
  277.     left: 30px;
  278.     z-index: 1;
  279.     font-size: 12px;
  280.     color: #fff;
  281.     font-weight: 700;
  282.     text-transform: uppercase;
  283.     text-align: center;
  284.     line-height: 1.3;
  285.     letter-spacing: 1px;
  286.     background-color: #ff6600 !important;
  287.     padding: 12px;
  288. }
  289. .icon_event{
  290.     color: #ff6600 !important;
  291. }
  292. .wrap_header_banner .overlay-slider {
  293.     position: absolute;
  294.     top: 0;
  295.     left: 0;
  296.     padding-top: 30px; 
  297.     width: 100%;
  298.     height: 100%;
  299.     background-color: rgba(0, 0, 0, 0.6392156863);
  300. }
  301. </style>
  302. {% endblock %}
  303. {% block body %}
  304. {% include 'section/navbar.html.twig' %}
  305. <div class="wrap_header_banner" style="height: 200px; background: url({{ asset('public/inter/wp-content/uploads/2023/06/header-banner.jpg')}});">
  306.     <div class="overlay-slider">
  307.         <div class="row_site">
  308.             <div class="container_site">
  309.                 <div class="cover_color"></div>
  310.                 <div class="header_banner_el">
  311.                     <div class="header_breadcrumbs">
  312.                         <div id="breadcrumbs">
  313.                         <ul class="breadcrumb">
  314.                             <li><a href="{{ path('front.inter.index') }}" style="color: #fff!important;" title="accueil">Accueil</a></li>
  315.                             <li class="li_separator"><span class="separator"><i class="ovaicon-next" style="color: #fff!important;"></i></span></li>
  316.                             <li style="color: #fff!important;">Formations</li>
  317.                             <li class="li_separator"><span class="separator"><i class="ovaicon-next" style="color: #fff!important;"></i></span></li>
  318.                             <li style="color: #fff!important;">Séminaire Personnalisée</li>
  319.                         </ul>
  320.                         </div>
  321.                     </div>
  322.                     <h1 class="header_title" style="color: #fff!important;">Séminaire Personnalisée </h1>
  323.                 </div>
  324.             </div>
  325.         </div>
  326.     </div>
  327. </div>
  328. {% for message in app.flashes('success') %}
  329. <div class="row toast_success" style="top: 100px !important; float: right !important; position: absolute;">
  330.     <div class="col-md-2 col-sm-2" style="padding: 10px;">
  331.         <i class="fa fa-check fa-2x" aria-hidden="true"></i>
  332.     </div>
  333.     <div class="col-md-10 col-sm-10" style="padding: 10px;">
  334.         <label style="font-family: arial;">{{ message }}</label>
  335.     </div>
  336. </div>    
  337. {% endfor %}
  338. {% for message in app.flashes('warning') %}
  339. <div class="row toast_warning" style="top: 100px !important; float: right !important; position: absolute;">
  340.     <div class="col-md-2 col-sm-2" style="padding: 10px;">
  341.         <i class="fa fa-check fa-2x" aria-hidden="true"></i>
  342.     </div>
  343.     <div class="col-md-10 col-sm-10" style="padding: 10px;">
  344.         <label style="font-family: arial;">{{ message }}</label>
  345.     </div>
  346. </div>   
  347. {% endfor %}
  348. {% for message in app.flashes('danger') %}
  349. <div class="row toast_danger" style="top: 100px !important; float: right !important; position: absolute;">
  350.     <div class="col-md-2 col-sm-2" style="padding: 10px;">
  351.         <i class="fa fa-check fa-2x" aria-hidden="true"></i>
  352.     </div>
  353.     <div class="col-md-10 col-sm-10" style="padding: 10px;">
  354.         <label style="font-family: arial;">{{ message }}</label>
  355.     </div>
  356. </div>   
  357. {% endfor %}
  358. <div class="container-event">
  359.     <div id="main-event" class="content-event">
  360.         
  361.         <div class="card">
  362.             {{ form_start(demandeformationsForm, {attr: {style: 'width: 100%;'} }) }}
  363.                 <div>
  364.                     <h3 class="header_title" style="font-weight: bolder; color: #051a53; font-family: arial;">Données personnelles</h3>
  365.                 </div>
  366.                 <div class="row" style="padding: 20px; margin-top: 5px !important; margin-bottom: 5px !important; border: 2px solid #ededed;">
  367.                     <div class="col-md-12 col-sm-12" style="padding: 5px;">
  368.                         {{ form_row(demandeformationsForm.civilite) }}
  369.                     </div>
  370.                     <div class="col-md-6 col-sm-12" style="padding: 5px;">
  371.                         {{ form_row(demandeformationsForm.nom) }}
  372.                     </div>
  373.                     <div class="col-md-6 col-sm-12" style="padding: 5px;">
  374.                         {{ form_row(demandeformationsForm.prenoms) }}
  375.                     </div>
  376.                     <div class="col-md-6 col-sm-12" style="padding: 5px;">
  377.                         {{ form_row(demandeformationsForm.fonction) }}
  378.                     </div>
  379.                     <div class="col-md-6 col-sm-12" style="padding: 5px;">
  380.                         {{ form_row(demandeformationsForm.mail) }}
  381.                     </div>
  382.                     <div class="col-md-6 col-sm-12" style="padding: 5px;">
  383.                         {{ form_row(demandeformationsForm.telephone) }}
  384.                     </div>
  385.                     <div class="col-md-6 col-sm-12" style="padding: 5px;">
  386.                         {{ form_row(demandeformationsForm.whatsapp) }}
  387.                     </div>  
  388.                 </div>
  389.                 <div>
  390.                     <h3 class="header_title" style="font-weight: bolder; color: #051a53; font-family: arial;">Situation géographique</h3>
  391.                 </div>
  392.                 <div class="row" style="padding: 20px; margin-top: 5px !important; margin-bottom: 5px !important; border: 2px solid #ededed;">
  393.                     <div class="col-md-4 col-sm-12" style="padding: 5px;">
  394.                         {{ form_row(demandeformationsForm.pays) }}
  395.                     </div>
  396.                     <div class="col-md-4 col-sm-12" style="padding: 5px;">
  397.                         {{ form_row(demandeformationsForm.ville) }}
  398.                     </div>
  399.                     <div class="col-md-4 col-sm-12" style="padding: 5px;">
  400.                         {{ form_row(demandeformationsForm.adresse) }}
  401.                     </div>
  402.                 </div>
  403.                 <div>
  404.                     <h3 class="header_title" style="font-weight: bolder; color: #051a53; font-family: arial;">Votre entreprise</h3>
  405.                 </div>
  406.                 <div class="row" style="padding: 20px; margin-top: 5px !important; margin-bottom: 5px !important; border: 2px solid #ededed;">
  407.                     <div class="col-md-6 col-sm-12" style="padding: 5px;">
  408.                         {{ form_row(demandeformationsForm.entreprise) }}
  409.                     </div>
  410.                     <div class="col-md-6 col-sm-12" style="padding: 5px;">
  411.                         {{ form_row(demandeformationsForm.siteweb) }}
  412.                     </div>
  413.                     <div class="col-md-6 col-sm-12" style="padding: 5px;">
  414.                         {{ form_row(demandeformationsForm.boitepostale) }}
  415.                     </div>
  416.                     <div class="col-md-6 col-sm-12" style="padding: 5px;">
  417.                         {{ form_row(demandeformationsForm.nbparticipant) }}
  418.                     </div> 
  419.                 </div>
  420.                 <div>
  421.                     <h3 class="header_title" style="font-weight: bolder; color: #051a53; font-family: arial;">Formation souhaitée</h3>
  422.                 </div>
  423.                 <div class="row" style="padding: 30px; margin-top: 10px !important; margin-bottom: 10px !important; border: 2px solid #ededed;">
  424.                     <div class="col-md-6 col-sm-12" style="padding: 5px;">
  425.                         {{ form_row(demandeformationsForm.thematique) }}
  426.                     </div>
  427.                     <div class="col-md-6 col-sm-12" style="padding: 5px;">
  428.                         {{ form_row(demandeformationsForm.theme) }}
  429.                     </div>
  430.                     
  431.                     <div class="col-md-6 col-sm-12" style="padding: 5px;">
  432.                         {{ form_row(demandeformationsForm.lieu) }}
  433.                     </div>
  434.                     <div class="col-md-3 col-sm-12" style="padding: 5px;">
  435.                         {{ form_row(demandeformationsForm.periode) }}
  436.                     </div>
  437.                     <div class="col-md-3 col-sm-12" style="padding: 5px;">
  438.                         {{ form_row(demandeformationsForm.prix) }}
  439.                     </div>
  440.                     <div class="col-12">
  441.                         <div class="loader" id="loader"></div>
  442.                     </div>
  443.                 </div>
  444.                 <div class="row" style="padding: 30px; margin-top: 10px !important; margin-bottom: 10px !important; border: 2px solid #ededed;">
  445.                     <div class="col-md-12 col-sm-12" style="padding: 5px;">
  446.                         {{ form_row(demandeformationsForm.commentaire) }}
  447.                     </div>
  448.                 </div>  
  449.                 <div style="margin-left: -10px !important;" class="g-recaptcha" data-sitekey="6LfPYkosAAAAANaQq5rVy_x44wv122vknRu-sw3C"></div>
  450.                 <div style="margin-left: -10px; margin-top: 10px;">
  451.                     {{ form_end(demandeformationsForm) }}
  452.                 </div> 
  453.         </div>
  454.         
  455.     </div>
  456. </div>
  457. {% include 'section/footer.html.twig' %}
  458. {% block javascripts %}
  459.     <!-- Select2 JS -->
  460.     <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
  461.     
  462.     <script>
  463.         $(document).ready(function() {
  464.             // Appliquer Select2 sur le champ EntityType
  465.             //$('#new_inscription_form_thematique').select2({
  466.                 //placeholder: "Sélectionner une thématique",
  467.                 //allowClear: true,
  468.                 //width: '100%',
  469.                 //dropdownParent: $('#offcanvasRight') // ⭐ OBLIGATOIRE
  470.             //});
  471.             //$('#new_inscription_form_theme').select2({
  472.                 //placeholder: "Sélectionner un thème",
  473.                 //allowClear: true,
  474.                 //width: '100%',
  475.                 //dropdownParent: $('#offcanvasRight') // ⭐ OBLIGATOIRE
  476.             //});
  477.         });
  478.     </script>
  479. {% endblock %}
  480. {% endblock %}