var/cache/dev/twig/84/84bb0ccf4e71a0637706afe4cb4858b5.php line 55

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* Parent/LoginParent.html.twig */
  16. class __TwigTemplate_37bb9239606940e257554a0bc0386491 extends Template
  17. {
  18.     private Source $source;
  19.     /**
  20.      * @var array<string, Template>
  21.      */
  22.     private array $macros = [];
  23.     public function __construct(Environment $env)
  24.     {
  25.         parent::__construct($env);
  26.         $this->source $this->getSourceContext();
  27.         $this->blocks = [
  28.             'LinksCss' => [$this'block_LinksCss'],
  29.             'Content' => [$this'block_Content'],
  30.             'javascript' => [$this'block_javascript'],
  31.         ];
  32.     }
  33.     protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  34.     {
  35.         // line 1
  36.         return "/Accueil/layoutAccueilParents.html.twig";
  37.     }
  38.     protected function doDisplay(array $context, array $blocks = []): iterable
  39.     {
  40.         $macros $this->macros;
  41.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  42.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""Parent/LoginParent.html.twig"));
  43.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  44.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""Parent/LoginParent.html.twig"));
  45.         $this->parent $this->load("/Accueil/layoutAccueilParents.html.twig"1);
  46.         yield from $this->parent->unwrap()->yield($contextarray_merge($this->blocks$blocks));
  47.         
  48.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  49.         
  50.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  51.     }
  52.     // line 2
  53.     /**
  54.      * @return iterable<null|scalar|\Stringable>
  55.      */
  56.     public function block_LinksCss(array $context, array $blocks = []): iterable
  57.     {
  58.         $macros $this->macros;
  59.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  60.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""LinksCss"));
  61.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  62.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""LinksCss"));
  63.         // line 3
  64.         yield "    ";
  65.         yield from $this->yieldParentBlock("LinksCss"$context$blocks);
  66.         yield "
  67.     <link rel=\"stylesheet\" href=\"";
  68.         // line 5
  69.         yield "/css/Parent/css/login.css";
  70.         yield "\" >
  71.     <link rel=\"stylesheet\" href=\"";
  72.         // line 6
  73.         yield "/css/Parent/css/premiercnx.css";
  74.         yield "\">
  75.     <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css\">
  76.      <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css\">
  77.  <link href=\"";
  78.         // line 10
  79.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("css/bootstrap-social.css"), "html"nulltrue);
  80.         yield "\" type=\"text/css\" rel=\"stylesheet\" >
  81.  <link rel=\"stylesheet\" href=\"";
  82.         // line 11
  83.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("css/splide.min.css"), "html"nulltrue);
  84.         yield "\">
  85. <style>
  86.     .titleProdbienvenu {
  87.     text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  88. }
  89. /* Style pour le bouton de retour en haut */
  90. .scroll-top-btn {
  91.     position: fixed;
  92.     bottom: 20px;
  93.     right: 20px;
  94.     width: 40px;
  95.     height: 40px;
  96.     border-radius: 50%;
  97.     background-color: #41a2aa;
  98.     color: white;
  99.     border: none;
  100.     box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  101.     z-index: 1000;
  102.     display: none;
  103.     cursor: pointer;
  104.     transition: all 0.3s ease;
  105. }
  106. .scroll-top-btn:hover {
  107.     background-color: #f09e7a;
  108.     transform: translateY(-3px);
  109. }
  110. /* Styles pour le loader d'inscription */
  111. .register-loader {
  112.     position: fixed;
  113.     top: 0;
  114.     left: 0;
  115.     width: 100%;
  116.     height: 100%;
  117.     background-color: rgba(255, 255, 255, 0.9);
  118.     z-index: 9999;
  119.     display: none;
  120.     justify-content: center;
  121.     align-items: center;
  122. }
  123. .loader-content {
  124.     text-align: center;
  125.     background-color: white;
  126.     padding: 30px;
  127.     border-radius: 10px;
  128.     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  129.     max-width: 350px;
  130.     width: 90%;
  131. }
  132. .loader-message {
  133.     margin-top: 20px;
  134.     font-size: 18px;
  135.     font-weight: bold;
  136.     color: #41a2aa;
  137. }
  138. .loader-submessage {
  139.     margin-top: 10px;
  140.     font-size: 14px;
  141.     color: #666;
  142. }
  143. .spinner-border {
  144.     width: 3rem;
  145.     height: 3rem;
  146.     color: #f09e7a !important;
  147. }
  148. /* Styles pour le modal de confirmation */
  149. .modal {
  150.     display: flex;
  151.     align-items: center;
  152.     justify-content: center;
  153. }
  154. .modal-dialog {
  155.     margin: 0 auto;
  156.     max-width: 500px;
  157.     width: 90%;
  158. }
  159. .modal-content {
  160.     border-radius: 10px;
  161.     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  162.     margin: 0 auto;
  163. }
  164. .modal-body {
  165.     padding: 30px 20px;
  166. }
  167. .modal-footer {
  168.     justify-content: center;
  169.     padding: 15px;
  170. }
  171. .circleModal {
  172.     background-color: #f09e7a;
  173.     color: white;
  174.     border: none;
  175.     border-radius: 5px;
  176.     padding: 10px 30px;
  177.     font-weight: bold;
  178.     transition: all 0.3s ease;
  179. }
  180. .circleModal:hover {
  181.     background-color: #e8865e;
  182.     transform: translateY(-2px);
  183. }
  184. /* Animation pour le passage au champ suivant */
  185. .field-complete {
  186.     transition: all 0.3s ease;
  187.     border-color: #41a2aa !important;
  188.     box-shadow: 0 0 5px rgba(65, 162, 170, 0.5) !important;
  189.     transform: translateY(-2px);
  190. }
  191. .form-control:focus {
  192.     border-color: #f09e7a !important;
  193.     box-shadow: 0 0 6px rgba(240, 158, 122, 0.5) !important;
  194.     transition: all 0.3s ease;
  195. }
  196. /* Hide one form by default at 1024px and below */
  197. @media screen and (max-width: 1360px) {
  198.     #connexionDiv, #inscriptionDiv {
  199.         width: 80% !important;
  200.         margin: 0 auto !important;
  201.         float: none !important;
  202.         margin-left: 10% !important;
  203.     }
  204.     
  205.     /* Initially hide the connection form */
  206.     #connexionDiv {
  207.         display: none;
  208.     }
  209.     
  210.     /* Make the inscription form take full width */
  211.     #inscriptionDiv {
  212.         display: block;
  213.     }
  214.     
  215.     /* Hide the OR separator at 1024px */
  216.     .ou-container {
  217.         display: none;
  218.     }
  219.     
  220.     /* Make the buttons more prominent for form switching */
  221.     .circleCree {
  222.         display: block !important;
  223.         width: 100% !important;
  224.         margin: 15px auto !important;
  225.         padding: 10px !important;
  226.         background-color: #41a2aa !important;
  227.         color: white !important;
  228.         border-radius: 5px !important;
  229.         border: none !important;
  230.         cursor: pointer !important;
  231.         text-align: center !important;
  232.         font-weight: bold !important;
  233.     }
  234.     
  235.     /* Adjust column widths */
  236.     .col-md-5, .col-sm-5, .col-lg-5 {
  237.         width: 100% !important;
  238.         max-width: 100% !important;
  239.         flex: 0 0 100% !important;
  240.     }
  241.     
  242.     /* Hide the middle column with the separator */
  243.     .col-md-1.col-sm-1.col-lg-1.col-xs-1 {
  244.         display: none !important;
  245.     }
  246. }
  247. /* Maintain desktop layout above 1024px */
  248. @media screen and (min-width: 1360px) {
  249.     #connexionDiv, #inscriptionDiv {
  250.         display: block !important;
  251.     }
  252.     
  253.     .circleCree {
  254.         display: none !important;
  255.     }
  256. }
  257. </style>
  258. ";
  259.         
  260.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  261.         
  262.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  263.         yield from [];
  264.     }
  265.     // line 209
  266.     /**
  267.      * @return iterable<null|scalar|\Stringable>
  268.      */
  269.     public function block_Content(array $context, array $blocks = []): iterable
  270.     {
  271.         $macros $this->macros;
  272.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  273.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""Content"));
  274.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  275.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""Content"));
  276.         // line 210
  277.         yield "
  278.   <!-- Bouton pour remonter en haut de la page -->
  279.   <button id=\"scrollTopBtn\" class=\"scroll-top-btn\" title=\"Retour en haut\">
  280.     <i class=\"fa fa-arrow-up\"></i>
  281.   </button>
  282.   <!-- Loader pour l'inscription -->
  283.   <div id=\"registerLoader\" class=\"register-loader\">
  284.     <div class=\"loader-content\">
  285.       <div class=\"spinner-border text-primary\" role=\"status\">
  286.         <span class=\"sr-only\">Chargement...</span>
  287.       </div>
  288.       <p class=\"loader-message\">Création de votre compte en cours...</p>
  289.       <p class=\"loader-submessage\">Nous préparons votre espace parent 5sur5sejour, merci de patienter.</p>
  290.     </div>
  291.   </div>
  292.   <!-- Modal de confirmation - avec l'attribut aria-hidden=\"true\" pour s'assurer qu'il est caché par défaut -->
  293.   <div class=\"modal fade\" id=\"exampleModal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"exampleModalLabel\" aria-hidden=\"true\" style=\"display: none;\">
  294.         <div class=\"modal-dialog modal-dialog-centered\" role=\"document\">
  295.             <div class=\"modal-content\">
  296.                 <div class=\"modal-header\" style=\"border-bottom: none; padding-bottom: 0;\">
  297.                     <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\" style=\"position: absolute; right: 15px; top: 15px;\">
  298.                         <span aria-hidden=\"true\">&times;</span>
  299.                     </button>
  300.                 </div>
  301.                 <div class=\"modal-body text-center\">
  302.                     <img class=\"imageLogo2 mb-3\" src=\"";
  303.         // line 237
  304.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("Accueil/imagesAccueil/logoHeader.svg"), "html"nulltrue);
  305.         yield "\" alt=\"Logo 5 sur 5 séjour\">
  306.                     <div class=\"row mb-4\">
  307.                         <div class=\"col-12\">
  308.                             <h4 class=\"font-weight-bold text-success\">Merci pour votre inscription à 5sur5sejour.com !</h4>
  309.                             <p class=\"mt-3\">Vous allez recevoir un mail de confirmation afin d'accéder au site</p>
  310.                         </div>
  311.                     </div>
  312.                 </div>
  313.                 <div class=\"modal-footer\" style=\"border-top: none;\">
  314.                     <button class=\"circleModal\" data-dismiss=\"modal\" onclick=\"location.reload();\" style=\"margin: 0 auto; padding: 10px 40px; font-size: 16px;\">OK</button>
  315.                 </div>
  316.             </div>
  317.         </div>
  318.     </div>
  319.     <div class=\"splide no-padding no-margin\" id=\"imageSlider\" style=\"background:white\">
  320.         <div class=\"splide__track\">
  321.             <ul class=\"splide__list\">
  322.                 <!-- Slide 1 -->
  323.               
  324.                 <!-- Slide 2 -->
  325.                 <li class=\"splide__slide\">
  326.                     <div class=\"slider-content\">
  327.                         <div class=\"namePRD\" style=\"display: block;\">
  328.                             <h4 class=\"titleProdbienvenu titleProdbienvenu1\" style=\"color: #41a2aa\">Offrez des souvenirs inoubliables à votre enfant </h4>
  329.                             <h4 class=\"titleProdbienvenu titleProdbienvenu2\" style=\"color:#F09E7A\">avec des cadeaux personnalisés en toute simplicité !</h4>
  330.                           </div>
  331.                         <img src=\"";
  332.         // line 266
  333.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("/images/3.png"), "html"nulltrue);
  334.         yield "\" class=\"imgslider\" alt=\"Image 2\" />
  335.                     </div>
  336.                 </li>
  337.                   <li class=\"splide__slide\">
  338.                     <div class=\"slider-content\">
  339.                         <div class=\"namePRD\" style=\"display: block;\">
  340.                             <h4 class=\"titleProdbienvenu titleProdbienvenu1\" style=\"color:#F09E7A\">Restez connecté au séjour de votre enfant 24h/24  </h4>
  341.                             <h4 class=\"titleProdbienvenu titleProdbienvenu2\" style=\"color:#41a2aa\">grâce à des photos partagées en toute sécurité !</h4>
  342.                           </div>
  343.                       
  344.                         
  345.                         <img src=\"";
  346.         // line 277
  347.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("/images/2.png"), "html"nulltrue);
  348.         yield "\" class=\"imgslider\" alt=\"Image 1\" />
  349.                     </div>
  350.                 </li>
  351.                 <li class=\"splide__slide\">
  352.                     <div class=\"slider-content\">
  353.                         <div class=\"namePRD\" style=\"display: block;\">
  354.                             <h4 class=\"titleProdbienvenu titleProdbienvenu1\" style=\"color: #41a2aa\">Accéder à une boite vocale en illimitée</h4>
  355.                             <h4 class=\"titleProdbienvenu titleProdbienvenu2\" style=\"color:#F09E7A\">Pour écouter les messages laissés par les enfants et les accompagnateurs</h4>
  356.                           </div>
  357.                         <img src=\"";
  358.         // line 286
  359.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("/images/1.png"), "html"nulltrue);
  360.         yield "\" class=\"imgslider\" alt=\"Image 2\" />
  361.                     </div>
  362.                 </li>
  363.             </ul>
  364.         </div>
  365.     </div>
  366.     <div class='row no-margin' style=\"padding-top:4%\">
  367.         <div class=\"col-lg-1 col-md-1 col-sm-1 col-xs-1 no-padding SeparateurLeftAccom\"></div>
  368.         <div class=\"col-md-10 col-sm-10 col-lg-10 col-xs-12 \" >
  369.          
  370.         <!-- Bouton caché qui déclenche le modal de confirmation -->
  371.         <button type=\"button\" id=\"showOkInscription\" class=\"d-none\" data-toggle=\"modal\" data-target=\"#exampleModal\">
  372.         En savoir plus
  373.         </button>
  374.         
  375.           
  376.             <div class=\"row no-margin\" style='margin-right: auto;margin-top:15px' id=\"formSection\">
  377.   
  378.                 
  379.                
  380.                 <div class=\"col-md-5 col-sm-5 col-lg-5  Inscription \" id='inscriptionDiv'>
  381.                    
  382.                     <form class =\"form-section\" id=\"create\" onsubmit=\"cp(); return false;\">
  383.                         <div class=\"soutitle\"> Créer un compte   </div>
  384.                     <div class =\"description2\" > Vous vous connectez pour la 1ère fois et n'avez pas
  385.                         <br> de compte Parent(s) « 5 sur 5 séjour » </div>
  386.                         <button type=\"button\"  align =\"center\" class=\"circleCree\"  onclick=\"AffichDivConnexion();\">Vous avez déjà un compte Parent(s) ? </button>
  387.                         <div class=\"form-group\">
  388.                             <input type=\"text\" class=\"form-control\" id=\"nomparent\"  placeholder=\"NOM * \" >
  389.                             <input type=\"text\" class=\"form-control\" id=\"prenomparent\"  placeholder=\"PRENOM *\">
  390.                             <input type=\"text\" autocomplete=\"off\" class=\"form-control\" id=\"mail\" placeholder=\"ADRESSE MAIL\" required data-toggle=\"tooltip\" data-placement=\"right\" title=\"\">
  391.                             <input type=\"password\" autocomplete=\"off\" name=\"password\" id=\"Passworduser\" value=\"\"  class=\"form-control\"  placeholder=\"MOT DE PASSE  * \">
  392.                             <input type=\"password\" autocomplete=\"off\" name=\"password\" id=\"Passworduser2\"  class=\"form-control\"  placeholder=\"CONFIRMER VOTRE MOT DE PASSE\">
  393.                             
  394.                             <p style=\"display: none; color:red; font-weight: bold; margin-top: 10px;\" id=\"eroor\">Cet email est déjà utilisé. <a href=\"";
  395.         // line 333
  396.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("forgotPassparent");
  397.         yield "\" style=\"color:#f09e7a; text-decoration: underline;\">Mot de passe oublié ?</a></p>
  398.                             <input type=\"text\" class=\"form-control\" id=\"num\"  name=\"numero de téléphone\" placeholder=\"NUMERO DE TELEPHONE PORTABLE * \">
  399.                                
  400.   
  401.                                         <div class=\"row no-margin \">
  402.                 <div class=\"souTITRE\">Souhaitez-vous être averti lorsque l'organisateur dépose des images ou des messages du séjour ?</div>
  403.             </div>
  404.             <br>
  405.             <div class=\"row no-margin\">
  406.                 <div class=\"box-1\" id=\"smsToggle\">
  407.                     <input type='checkbox' name =\"sms\" id =\"smsInput\"  />
  408.                     <span class=\"toogle\"> </span>
  409.                 </div>
  410.                 <span class=\"sms\"> Par SMS </span>
  411.                 <div class=\"box-1\">
  412.                     <input type='checkbox' name =\"mail\" id =\"mailInput\"   />
  413.                     <span class=\"toogle\" > </span>
  414.                 </div>
  415.                 <span class=\"mail\"> Par Mail </span>
  416.             </div>
  417.             
  418.                         </div>
  419.                         <div class=\"notification\" id=\"notification\" style=\"display: none;\">L'adresse e-mail est incorrecte.</div>
  420.                         <div class=\"button-container\">
  421.                         <button  type=\"button\" onclick=\"cp();\" class=\"logButton\" style=\"color:#fff;border: 1px solid #f09e7a;    position: relative;
  422.         background-color: #f09e7a;\" id=\"submitBtn\">     
  423.             S'inscrire
  424.           </button></div>
  425.           
  426.           <div class=\"button-container mobilesocial\">
  427.             <a href=\"";
  428.         // line 367
  429.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("connect_google_start");
  430.         yield "\"  style=\"color:#fff;background-color:#4F86EC;\" class=\"logButtonSocial\" onclick=\"_gaq.push(['_trackEvent', 'btn-social', 'click', 'btn-google']);\">
  431.          <img src=\"";
  432.         // line 368
  433.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("/images/icons-google.png"), "html"nulltrue);
  434.         yield "\"  >Continuer avec Google
  435.        </a>
  436.                        
  437.      </div>
  438.      <div class=\"mobilesocial\" >                  
  439.                     <a href=\"";
  440.         // line 373
  441.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("connect_facebook_start");
  442.         yield "\"  class=\"logButtonSocial\" style=\"color:#fff;background-color:#3b5998;border-color:rgba(0,0,0,0.2)\" >
  443.                      <img src=\"";
  444.         // line 374
  445.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("/images/icons-facebook.png"), "html"nulltrue);
  446.         yield "\"  >         Continuer avec Facebook
  447.        </a>
  448.            </div>        
  449.         </form>
  450.                 </div>
  451.                 <div class=\"col-md-1 col-sm-1 col-lg-1 col-xs-1  \" ><div class=\"ou-container\" style=\"margin-left: 20%;\">
  452.                     <div class=\"ou-line\"></div>
  453.                     <div class=\"ou-text\">OU</div>
  454.                   </div> </div>
  455.                 <div class=\"col-md-5 col-sm-5 col-lg-5 col-xs-5 connexion \" id='connexionDiv' >
  456.                  
  457.                
  458.                     <div class=\"form-section\">
  459.                         <div class=\"soutitle\">  Se connecter </div>
  460.                         <div class =\"description2\" >Vous avez déja un compte Parent(s) « 5 sur 5 séjour »  </div>
  461.                         <button type=\"button\"  align =\"center\" class=\"circleCree\"  onclick=\"AffichDivInscri();\">Créer un compte ? </button>
  462.                         <form method=\"post\" class=\"\">
  463.                             ";
  464.         // line 397
  465.         if ((($tmp = (isset($context["error"]) || array_key_exists("error"$context) ? $context["error"] : (function () { throw new RuntimeError('Variable "error" does not exist.'397$this->source); })())) && $tmp instanceof Markup ? (string) $tmp $tmp)) {
  466.             // line 398
  467.             yield "                                <div class=\"alert alert-danger\">";
  468.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(CoreExtension::getAttribute($this->env$this->source, (isset($context["error"]) || array_key_exists("error"$context) ? $context["error"] : (function () { throw new RuntimeError('Variable "error" does not exist.'398$this->source); })()), "messageKey", [], "any"falsefalsefalse398), CoreExtension::getAttribute($this->env$this->source, (isset($context["error"]) || array_key_exists("error"$context) ? $context["error"] : (function () { throw new RuntimeError('Variable "error" does not exist.'398$this->source); })()), "messageData", [], "any"falsefalsefalse398), "security"), "html"nulltrue);
  469.             yield "</div>
  470.                             ";
  471.         }
  472.         // line 400
  473.         yield "                            <div class=\"form-group\">
  474.                                 <input type=\"text\"  name=\"email\" id=\"inputEmail\"  value=\"";
  475.         // line 402
  476.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["last_username"]) || array_key_exists("last_username"$context) ? $context["last_username"] : (function () { throw new RuntimeError('Variable "last_username" does not exist.'402$this->source); })()), "html"nulltrue);
  477.         yield "\"  class=\"form-control\" placeholder=\"Mon identifiant  * \" >
  478.                             <input type=\"password\" name=\"password\" id=\"inputPassword\" class=\"form-control\" placeholder=\"Mon mot de passe *\">
  479.                             <span toggle=\"#inputPassword\" class=\"fa fa-fw fa-eye field-icon toggle-password\"></span>
  480.             
  481.                                 
  482.                                 <input type=\"hidden\" name=\"_csrf_token\" value=\"";
  483.         // line 408
  484.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderCsrfToken("authenticate"), "html"nulltrue);
  485.         yield "\">
  486.                                 <div class=\"button-container\">
  487.                                     <button   class=\"logButton\" style=\"color:#fff;background-color:#41a2aa;border-color:rgba(0,0,0,0.2)\" >
  488.              Se connecter 
  489.           </button>
  490.         
  491.                             </div>
  492.                               
  493.                             <div class =\"description\" > <a id=\"mdpobli\" href=\"";
  494.         // line 417
  495.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("forgotPassparent");
  496.         yield "\" style=\"color:#f09e7a ; display: block\">Vous avez oublié votre mot de passe ?  </a> </div>
  497.                             <div class=\"button-container\">
  498.                <a href=\"";
  499.         // line 420
  500.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("connect_google_start");
  501.         yield "\"  style=\"color:#fff;background-color:#4F86EC;\" class=\"logButtonSocial\" onclick=\"_gaq.push(['_trackEvent', 'btn-social', 'click', 'btn-google']);\">
  502.             <img src=\"";
  503.         // line 421
  504.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("/images/icons-google.png"), "html"nulltrue);
  505.         yield "\"  >Continuer avec Google
  506.           </a>
  507.                           
  508.         </div>
  509.         <div class=\"button-c\" style=\"display: flex;
  510.         justify-content: center;
  511.         align-items: center;\">                  
  512.                        <a href=\"";
  513.         // line 428
  514.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("connect_facebook_start");
  515.         yield "\"  class=\"logButtonSocial\" style=\"color:#fff;background-color:#3b5998;border-color:rgba(0,0,0,0.2)\" >
  516.                         <img src=\"";
  517.         // line 429
  518.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("/images/icons-facebook.png"), "html"nulltrue);
  519.         yield "\"  >         Continuer avec Facebook
  520.           </a>
  521.               </div>        
  522.         
  523.                             
  524.                                 <br>
  525.                                 <br>
  526.                                 
  527.                             </div>
  528.                         </form>
  529.                     
  530.                     </div>
  531.                 </div>
  532.                    
  533.         </div>
  534.       
  535.     </div>
  536.   <div class=\"col-md-3\" style=\"margin-top: 21%;display:none\">
  537.    <a href=\"";
  538.         // line 449
  539.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("connect_google_start");
  540.         yield "\"  style=\"color:#fff;background-color:#4F86EC;border-color:rgba(0,0,0,0.2)\" class=\"btn btn-block btn-social btn-google\" onclick=\"_gaq.push(['_trackEvent', 'btn-social', 'click', 'btn-google']);\">
  541.             <span class=\"fa fa-google\"></span> S'inscrire avec Google
  542.           </a>
  543.           
  544.                           
  545.                                 <br>
  546.                                    <br>
  547.                        <a href=\"";
  548.         // line 456
  549.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("connect_facebook_start");
  550.         yield "\"  class=\"btn btn-block btn-social btn-facebook\" style=\"color:#fff;background-color:#3b5998;border-color:rgba(0,0,0,0.2)\" >
  551.             <span class=\"fa fa-facebook\"></span>  S'inscrire avec Facebook
  552.           </a></div>
  553.             </div>
  554. ";
  555.         
  556.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  557.         
  558.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  559.         yield from [];
  560.     }
  561.     // line 463
  562.     /**
  563.      * @return iterable<null|scalar|\Stringable>
  564.      */
  565.     public function block_javascript(array $context, array $blocks = []): iterable
  566.     {
  567.         $macros $this->macros;
  568.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  569.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascript"));
  570.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  571.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascript"));
  572.         // line 464
  573.         yield "   
  574.    
  575.     ";
  576.         // line 467
  577.         yield from $this->yieldParentBlock("javascript"$context$blocks);
  578.         yield "
  579.   <script src=\"";
  580.         // line 468
  581.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("js/splide.min.js"), "html"nulltrue);
  582.         yield "\"></script>
  583.   <script src=\"https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.all.min.js\"></script>
  584.     
  585.     <script>
  586.         document.addEventListener('DOMContentLoaded', function () {
  587.     // S'assurer que le modal est caché au chargement de la page
  588.     \$('#exampleModal').modal('hide');
  589.     \$('#exampleModal').removeClass('show');
  590.     \$('#exampleModal').attr('aria-hidden', 'true');
  591.     \$('body').removeClass('modal-open');
  592.     \$('.modal-backdrop').remove();
  593.     
  594.     // Gestion du bouton de retour en haut
  595.     const scrollTopBtn = document.getElementById('scrollTopBtn');
  596.     
  597.     // Afficher/masquer le bouton en fonction du défilement
  598.     window.addEventListener('scroll', function() {
  599.         if (window.pageYOffset > 300) {
  600.             scrollTopBtn.style.display = 'block';
  601.         } else {
  602.             scrollTopBtn.style.display = 'none';
  603.         }
  604.     });
  605.     
  606.     // Action de clic sur le bouton
  607.     scrollTopBtn.addEventListener('click', function() {
  608.         window.scrollTo({
  609.             top: 0,
  610.             behavior: 'smooth'
  611.         });
  612.     });
  613.     
  614.     // Initialisation du carrousel Splide
  615.     var splide = new Splide('#imageSlider', {
  616.         type: 'loop',
  617.         perPage: 1,
  618.         autoplay: true,
  619.         interval: 6000,
  620.         pauseOnHover: false,
  621.         pauseOnFocus: false,
  622.          pagination: false , // Désactive la pagination
  623.          arrows: false  
  624.     });
  625.     splide.mount();
  626.     
  627.     // Auto-scroll vers les formulaires après 3 secondes
  628.     setTimeout(function() {
  629.         scrollToFormSection();
  630.     }, 5000);
  631.     // Configuration du modal de confirmation - s'assurer qu'il est bien caché
  632.     \$('#exampleModal').modal('dispose'); // Supprimer toute initialisation précédente
  633.     
  634.     // Réinitialiser le modal
  635.     \$('#exampleModal').modal({
  636.         backdrop: 'static',
  637.         keyboard: false,
  638.         show: false // S'assurer que le modal ne s'affiche pas automatiquement
  639.     });
  640.     
  641.     // Centrage du modal uniquement lorsqu'il est affiché
  642.     \$('#exampleModal').on('show.bs.modal', function () {
  643.         \$(this).css('display', 'flex');
  644.         \$(this).css('align-items', 'center');
  645.         \$(this).find('.modal-dialog').css({
  646.             'display': 'flex',
  647.             'align-items': 'center',
  648.             'margin': '0 auto',
  649.             'max-height': '90vh'
  650.         });
  651.     });
  652.     // Fonction pour faire défiler vers la section des formulaires
  653.     function scrollToFormSection() {
  654.         const formSection = document.getElementById('formSection');
  655.         if (formSection) {
  656.             const formPosition = formSection.getBoundingClientRect().top + window.scrollY;
  657.             const headerOffset = 50; // Tenir compte de la hauteur de l'en-tête
  658.             const scrollPosition = formPosition - headerOffset;
  659.             
  660.             // Animation de défilement fluide
  661.             window.scrollTo({
  662.                 top: scrollPosition,
  663.                 behavior: 'smooth'
  664.             });
  665.             
  666.             // Les animations de mise en évidence ont été supprimées
  667.         }
  668.     }
  669. });
  670.         // Fonction pour afficher le popover automatiquement avec animation
  671.       
  672.         function cp() {
  673.          
  674.            // Afficher le loader
  675.            \$('#registerLoader').css('display', 'flex');
  676.            
  677.            // Définir un timeout pour masquer le loader après 10 secondes, même si la requête n'est pas terminée
  678.            var loaderTimeout = setTimeout(function() {
  679.                \$('#registerLoader').css('display', 'none');
  680.                Swal.fire({
  681.                    icon: 'info',
  682.                    title: 'Inscription en cours',
  683.                    text: 'Votre inscription est en cours de traitement. Vous recevrez un email de confirmation.',
  684.                    confirmButtonColor: '#41a2aa',
  685.                    position: 'center'
  686.                });
  687.            }, 10000);
  688.           
  689.             var nomparent = \"\";
  690.             var   prenomparent= \"\";
  691.             var mail = \"\";
  692.             var num = \"5555\";
  693.             console.log(num);
  694.             var confirmpassword = \$('#Passworduser2').val();
  695.             var parent_register = \"";
  696.         // line 584
  697.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("parent_register");
  698.         yield "\";
  699.             var Passworduser = \"\";
  700.             \$testDeCreation = false;
  701.             \$testDeCreation2 = false;
  702.             \$testDeCreation3 = false;
  703.             \$testDeCreation4 = false;
  704.             \$testDeCreation5 = false;
  705.             if (\$('#nomparent').val() == \"\") {
  706.                   
  707.                 \$('#nomparent').addClass('is-invalid');
  708.                 \$('#nomparent').removeClass('is-valid');
  709.                 \$('#nomparent').css('border', '1px solid red');
  710.                 \$testDeCreation = false;
  711.             } else {
  712.                 \$('#nomparent').removeClass('is-invalid');
  713.                 \$('#nomparent').addClass('is-valid');
  714.                 
  715.                 \$('#nomparent').css('border', '1px solid green');
  716.                nomparent = \$('#nomparent').val();
  717.                 \$testDeCreation = true;
  718.             }
  719.             if (\$('#prenomparent').val() == \"\") {
  720.               
  721.                 \$('#prenomparent').addClass('is-invalid');
  722.                 \$('#prenomparent').removeClass('is-valid');
  723.                 \$('#prenomparent').css('border', '1px solid red');
  724.                 \$testDeCreation1 = false;
  725.             } else {
  726.                 \$('#prenomparent').removeClass('is-invalid');
  727.                 \$('#prenomparent').addClass('is-valid');
  728.                
  729.                 \$('#prenomparent').css('border', '1px solid green');
  730.                prenomparent = \$('#prenomparent').val();
  731.                 \$testDeCreation1 = true;
  732.             }
  733.             if (\$('#num').val() == \"\") {
  734.                 \$('#num ').addClass('is-invalid');
  735.                 \$('#num').removeClass('is-valid');
  736.                 \$('#num').css('border', '1px solid red');
  737.                 \$testDeCreation2 = false;
  738.             } else {
  739.                 \$('#num').removeClass('is-invalid');
  740.                 \$('#num').addClass('is-valid');
  741.                
  742.                 \$('#num').css('border', '1px solid green');
  743.                num = \$('#num').val();
  744.                 \$testDeCreation2 = true;
  745.             }
  746.             if (\$('#mail').val() == \"\") {
  747.                 \$('#mail').addClass('is-invalid');
  748.                 \$('#mail').removeClass('is-valid');
  749.                 \$('#mail').css('border', '1px solid red');
  750.                 \$testDeCreation3 = false;
  751.             } else {
  752.                 \$('#mail').removeClass('is-invalid');
  753.                 \$('#mail').addClass('is-valid');
  754.                
  755.                 \$('#mail').css('border', '1px solid green');
  756.                 mail = \$('#mail').val();
  757.                 \$testDeCreation3 = true;
  758.             }
  759.             if (\$('#Passworduser').val() == \"\") {
  760.                 \$('#Passworduser').addClass('is-invalid');
  761.                 \$('#Passworduser').removeClass('is-valid');
  762.                 \$('#Passworduser').css('border', '1px solid red');
  763.                 \$testDeCreation4 = false;
  764.             } else {
  765.                 \$('#Passworduser').removeClass('is-invalid');
  766.                 \$('#Passworduser').addClass('is-valid');
  767.                
  768.                 \$('#Passworduser').css('border', '1px solid green');
  769.                 Passworduser = \$('#Passworduser').val();
  770.                 \$testDeCreation4 = true;
  771.             }
  772.             
  773.             var sms = 0; var mailnotif = 0;
  774.             if (\$(\"#smsInput\").is(':checked')) {
  775.                 var sms = 1;
  776.             }
  777.             if (\$(\"#mailInput\").is(':checked')){
  778.                 var mailnotif = 1;
  779.             }
  780.            
  781.             \$_data = {
  782.                 'nomparent': nomparent,
  783.                 'prenomparent': prenomparent,
  784.                 'mailprent': mail,
  785.                 'numtel': num,
  786.                 'passwordparent': Passworduser,
  787.                 'confirmpassword':confirmpassword,
  788.                 'sms': sms,
  789.                 'mailnotif': mailnotif
  790.             }
  791.              console.log(\$_data);
  792.             if (\$testDeCreation &&  \$testDeCreation1 && \$testDeCreation2 && \$testDeCreation3 && \$testDeCreation4 ) {
  793.              
  794.          
  795.                 \$.ajax({
  796.                     type: \"POST\",
  797.                     url: parent_register,
  798.                     data: \$_data,
  799.                     success: function (\$response) {
  800.                         console.log(\$response);
  801.                         // Masquer le loader quelle que soit la réponse
  802.                         \$('#registerLoader').css('display', 'none');
  803.                         // Annuler le timeout puisque la requête est terminée
  804.                         clearTimeout(loaderTimeout);
  805.                         
  806.                         if (\$response == 'eror') {
  807.                         
  808.                             \$('#mail').css('border-color', 'red');
  809.                             \$('#eroor').css('display', 'block');
  810.                             // Afficher une alerte SweetAlert pour l'email déjà utilisé avec boutons d'action
  811.                             Swal.fire({
  812.                                 icon: 'error',
  813.                                 title: 'Email déjà utilisé',
  814.                                 text: 'Cette adresse email est déjà associée à un compte.',
  815.                                 footer: '<a href=\"";
  816.         // line 715
  817.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("forgotPassparent");
  818.         yield "\" style=\"color:#f09e7a;\">Mot de passe oublié ?</a>',
  819.                                 showCancelButton: true,
  820.                                 confirmButtonText: 'Se connecter',
  821.                                 cancelButtonText: 'Modifier',
  822.                                 confirmButtonColor: '#41a2aa',
  823.                                 cancelButtonColor: '#f09e7a',
  824.                                 position: 'center'
  825.                             }).then((result) => {
  826.                                 if (result.isConfirmed) {
  827.                                     // Basculer vers le formulaire de connexion et pré-remplir l'email
  828.                                     AffichDivConnexion();
  829.                                     \$('#inputEmail').val(\$('#mail').val());
  830.                                     \$('#inputPassword').focus();
  831.                                 }
  832.                             });
  833.                         }
  834.                         else if(\$response == 'erorpasswordconfirm')
  835.                         {
  836.                              
  837.                               \$('#Passworduser2').css('border-color', 'red');
  838.                                 Swal.fire({
  839.                                 icon: 'error',
  840.                                 title: 'Oups..!',
  841.                                 text: 'Les mots de passe ne se correspondent pas.',
  842.                                 footer: '',
  843.                                 position: 'center'
  844.                             })
  845.                         }
  846.                     
  847.                          else {
  848.                               
  849.                           
  850.                             \$(\"#showOkInscription\").trigger('click');
  851.                             
  852.                             // Réinitialiser tous les champs du formulaire
  853.                             resetForm();
  854.                             
  855.                             // S'assurer que le modal est bien centré
  856.                             \$('#exampleModal').on('shown.bs.modal', function () {
  857.                                 \$(this).find('.modal-dialog').css({
  858.                                     'margin-top': function () {
  859.                                         return (\$(window).height() - \$(this).height()) / 2;
  860.                                     }
  861.                                 });
  862.                             });
  863.                               var windowWidth = document.documentElement.clientWidth;
  864.                                 if (windowWidth <= 560) {
  865.                                     setTimeout(function(){
  866.                                        
  867.                                    location.reload();
  868.                               },500);
  869.                               
  870.                            }
  871.                               
  872.                             
  873.                         }
  874.                     },
  875.                     error: function() {
  876.                         // Masquer le loader en cas d'erreur
  877.                         \$('#registerLoader').css('display', 'none');
  878.                         // Annuler le timeout puisque la requête est terminée
  879.                         clearTimeout(loaderTimeout);
  880.                         
  881.                         // Afficher un message d'erreur
  882.                         Swal.fire({
  883.                             icon: 'error',
  884.                             title: 'Erreur de connexion',
  885.                             text: 'Un problème est survenu lors de l\\'inscription. Veuillez réessayer.',
  886.                             confirmButtonColor: '#f09e7a',
  887.                             position: 'center'
  888.                         });
  889.                     }
  890.                 })
  891.             } else {
  892.                 // Masquer le loader si la validation échoue
  893.                 \$('#registerLoader').css('display', 'none');
  894.                 // Annuler le timeout puisque la validation a échoué
  895.                 clearTimeout(loaderTimeout);
  896.             }
  897.         }
  898.         function AffichDivConnexion() {
  899.     \$(\"#inscriptionDiv\").css(\"display\", \"none\");
  900.     \$(\"#connexionDiv\").css(\"display\", \"block\");
  901. }
  902. function AffichDivInscri() {
  903.     \$(\"#inscriptionDiv\").css(\"display\", \"block\");
  904.     \$(\"#connexionDiv\").css(\"display\", \"none\");
  905. }
  906. // Function to handle responsive behavior based on window width
  907. function handleResponsiveFormDisplay() {
  908.     var windowWidth = \$(window).width();
  909.     
  910.     if (windowWidth <= 1024) {
  911.         // Apply mobile-like behavior for tablets/smaller screens
  912.         // Show only one form at a time with toggle buttons
  913.         \$(\"#connexionDiv\").css(\"display\", \"none\");
  914.         \$(\"#inscriptionDiv\").css(\"display\", \"block\");
  915.         \$(\".circleCree\").css(\"display\", \"block\");
  916.     } else {
  917.         // For desktop, show both forms side by side
  918.         \$(\"#connexionDiv\").css(\"display\", \"block\");
  919.         \$(\"#inscriptionDiv\").css(\"display\", \"block\");
  920.         \$(\".circleCree\").css(\"display\", \"none\");
  921.     }
  922. }
  923. // Run on page load
  924. \$(document).ready(function() {
  925.     handleResponsiveFormDisplay();
  926.     
  927.     // Also run when window is resized
  928.     \$(window).resize(function() {
  929.         handleResponsiveFormDisplay();
  930.     });
  931.     
  932.     // Configuration pour le passage automatique au champ suivant
  933.     setupAutoNextField();
  934.     
  935.     // Ajouter la validation en temps réel pour tous les champs
  936.     setupRealtimeValidation();
  937. });
  938. // Fonction pour configurer le passage automatique au champ suivant
  939. function setupAutoNextField() {
  940.     // Ordre des champs dans le formulaire d'inscription
  941.     const formFields = [
  942.         'nomparent',
  943.         'prenomparent',
  944.         'mail',
  945.         'Passworduser',
  946.         'Passworduser2',
  947.         'num'
  948.     ];
  949.     
  950.     // Pour chaque champ, ajouter des événements pour la navigation
  951.     formFields.forEach((field, index) => {
  952.         if (index < formFields.length - 1) {
  953.             const \$currentField = \$('#' + field);
  954.             let typingTimer; // Timer pour détecter quand l'utilisateur arrête de taper
  955.             const doneTypingInterval = 1500; // Temps en ms après lequel on considère que l'utilisateur a fini de taper
  956.             
  957.             // Événement lorsque l'utilisateur tape
  958.             \$currentField.on('input', function() {
  959.                 clearTimeout(typingTimer);
  960.                 
  961.                 // Si l'utilisateur appuie sur espace et que le champ est valide
  962.                 if (event && event.data === ' ' && isFieldValid(field, \$(this).val().trim())) {
  963.                     event.preventDefault(); // Empêcher l'espace d'être ajouté
  964.                     \$('#' + formFields[index + 1]).focus();
  965.                     return;
  966.                 }
  967.                 
  968.                 // Démarrer un nouveau timer
  969.                 if (\$(this).val()) {
  970.                     typingTimer = setTimeout(function() {
  971.                         // Vérifier si le champ est valide
  972.                         if (isFieldValid(field, \$currentField.val().trim())) {
  973.                             \$('#' + formFields[index + 1]).focus();
  974.                         }
  975.                     }, doneTypingInterval);
  976.                 }
  977.             });
  978.             
  979.             // Réinitialiser le timer si l'utilisateur continue de taper
  980.             \$currentField.on('keydown', function(e) {
  981.                 clearTimeout(typingTimer);
  982.                 
  983.                 // Si l'utilisateur appuie sur espace et que le champ est valide
  984.                 if (e.key === ' ' && isFieldValid(field, \$(this).val().trim())) {
  985.                     e.preventDefault(); // Empêcher l'espace d'être ajouté
  986.                     \$('#' + formFields[index + 1]).focus();
  987.                     return;
  988.                 }
  989.                 
  990.                 // Si l'utilisateur appuie sur Tab ou Entrée
  991.                 if (e.key === 'Tab' && !e.shiftKey) {
  992.                     // Laisser le comportement par défaut de Tab
  993.                     return true;
  994.                 }
  995.                 
  996.                 if (e.key === 'Enter') {
  997.                     e.preventDefault(); // Empêcher la soumission du formulaire
  998.                     \$('#' + formFields[index + 1]).focus();
  999.                 }
  1000.             });
  1001.             
  1002.             // Événement lorsque le champ perd le focus
  1003.             \$currentField.on('blur', function() {
  1004.                 clearTimeout(typingTimer);
  1005.             });
  1006.         }
  1007.     });
  1008.     
  1009.     // Pour le dernier champ, la touche Enter déclenche l'inscription
  1010.     \$('#' + formFields[formFields.length - 1]).on('keydown', function(e) {
  1011.         if (e.key === 'Enter') {
  1012.             e.preventDefault();
  1013.             cp(); // Fonction d'inscription
  1014.         }
  1015.     });
  1016. }
  1017. // Fonction pour vérifier si un champ est valide selon son type
  1018. function isFieldValid(fieldId, value) {
  1019.     switch(fieldId) {
  1020.         case 'mail':
  1021.             const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\$/;
  1022.             return emailRegex.test(value);
  1023.         case 'Passworduser':
  1024.             // Minimum 6 caractères pour un mot de passe
  1025.             return value.length >= 6;
  1026.         case 'Passworduser2':
  1027.             // Doit correspondre au mot de passe et avoir au moins 6 caractères
  1028.             return value === \$('#Passworduser').val() && value.length >= 6;
  1029.         case 'num':
  1030.             // Numéro de téléphone: doit contenir uniquement des chiffres et avoir au moins 8 caractères
  1031.             const phoneRegex = /^[0-9]{8,}\$/;
  1032.             return phoneRegex.test(value.replace(/\\s+/g, '')); // Enlever les espaces avant de tester
  1033.         case 'nomparent':
  1034.         case 'prenomparent':
  1035.             // Nom et prénom: au moins 2 caractères, pas de chiffres
  1036.             const nameRegex = /^[A-Za-zÀ-ÖØ-öø-ÿ\\s'-]{2,}\$/;
  1037.             return nameRegex.test(value);
  1038.         default:
  1039.             return value.length >= 2;
  1040.     }
  1041. }
  1042.     </script>
  1043.    
  1044.     <script>
  1045.         function hideshow() {
  1046.             document.getElementById(\"btnn\").disabled = true;
  1047.             \$(\"#btnn\").css(\"background-color\", \"#ecf0f1\");
  1048.             \$(\"#mdpobli\").css(\"display\", \"none\");
  1049.             \$(\"#mdpoblier\").css(\"display\", \"block\");
  1050.         }
  1051.     </script>
  1052.        <script>
  1053.     function closeModale(){
  1054.     \$(\"#monModalInscription\").modal('hide');
  1055.      }
  1056.    // \$(\".masktelph\").inputmask({\"mask\": \"9999999999\"});
  1057.    </script>
  1058.    <script>
  1059.     /**
  1060.      * this code is used to toggle the password
  1061.      */ 
  1062.     \$(\".toggle-password\").click(function() {
  1063. \$(this).toggleClass(\"fa-eye fa-eye-slash\");
  1064. var input = \$(\$(this).attr(\"toggle\"));
  1065. if (input.attr(\"type\") == \"password\") {
  1066.   input.attr(\"type\", \"text\");
  1067. } else {
  1068.   input.attr(\"type\", \"password\");
  1069. }
  1070. });
  1071. \$(document).ready(function(){
  1072.             \$('[data-toggle=\"tooltip\"]').tooltip({
  1073.                 trigger: 'manual',
  1074.                 html: true,
  1075.                 template: '<div class=\"tooltip\" role=\"tooltip\"><div class=\"arrow\"></div><div class=\"tooltip-inner\"></div></div>'
  1076.             });
  1077.             function validateEmail(email) {
  1078.                 const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\$/;
  1079.                 return re.test(String(email).toLowerCase());
  1080.             }
  1081.             \$('#mail').on('input', function() {
  1082.                 var emailInput = \$(this);
  1083.                 if (validateEmail(emailInput.val())) {
  1084.                     emailInput.removeClass('is-invalid');
  1085.                     emailInput.addClass('is-valid');
  1086.                     emailInput.tooltip('dispose');
  1087.                     \$('#notification').hide();
  1088.                     \$('#submitBtn').prop('disabled', false);
  1089.                     
  1090.                     // Ne pas passer automatiquement au champ suivant ici,
  1091.                     // car c'est déjà géré par setupAutoNextField()
  1092.                 } else {
  1093.                     emailInput.removeClass('is-valid');
  1094.                     emailInput.addClass('is-invalid');
  1095.                     
  1096.                     // Afficher le tooltip seulement si l'utilisateur a commencé à saisir
  1097.                     if (emailInput.val().length > 3) {
  1098.                         emailInput.attr('data-original-title', 'Votre adresse mail est incorrecte. Exemple: nom@domaine.com').tooltip('show');
  1099.                         if (emailInput.val().length > 0) {
  1100.                             \$('#notification').show();
  1101.                         }
  1102.                     } else {
  1103.                         \$('#notification').hide();
  1104.                     }
  1105.                     \$('#submitBtn').prop('disabled', false);
  1106.                 }
  1107.             });
  1108.         });
  1109. </script>
  1110. // Fonction pour configurer la validation en temps réel
  1111. function setupRealtimeValidation() {
  1112.     const formFields = [
  1113.         'nomparent',
  1114.         'prenomparent',
  1115.         'mail',
  1116.         'Passworduser',
  1117.         'Passworduser2',
  1118.         'num'
  1119.     ];
  1120.     
  1121.     formFields.forEach(field => {
  1122.         \$('#' + field).on('input', function() {
  1123.             const value = \$(this).val();
  1124.             
  1125.             // Ne pas afficher d'erreur tant que l'utilisateur n'a pas commencé à saisir
  1126.             if (value.length === 0) {
  1127.                 \$(this).removeClass('is-valid is-invalid');
  1128.                 \$(this).css('border', '1px solid #ced4da'); // Couleur de bordure par défaut
  1129.                 return;
  1130.             }
  1131.             
  1132.             // Vérifier la validité du champ
  1133.             if (isFieldValid(field, value)) {
  1134.                 \$(this).removeClass('is-invalid').addClass('is-valid');
  1135.                 \$(this).css('border', '1px solid #28a745'); // Vert pour valide
  1136.             } else {
  1137.                 \$(this).removeClass('is-valid').addClass('is-invalid');
  1138.                 \$(this).css('border', '1px solid #dc3545'); // Rouge pour invalide
  1139.             }
  1140.         });
  1141.     });
  1142. }
  1143. // Fonction pour réinitialiser le formulaire
  1144. function resetForm() {
  1145.     \$('#nomparent').css('border','1px solid #41a2aa');
  1146.     \$('#nomparent').removeClass('is-valid'); 
  1147.     \$('#nomparent').removeClass('is-invalid'); 
  1148.     \$('#nomparent').val(''); 
  1149.     \$('#prenomparent').css('border','1px solid #41a2aa');
  1150.     \$('#prenomparent').removeClass('is-valid'); 
  1151.     \$('#prenomparent').removeClass('is-invalid'); 
  1152.     \$('#prenomparent').val(''); 
  1153.     \$('#mail').css('border','1px solid #41a2aa');
  1154.     \$('#mail').removeClass('is-valid'); 
  1155.     \$('#mail').removeClass('is-invalid'); 
  1156.     \$('#mail').val(''); 
  1157.     \$('#eroor').css('display','none');
  1158.     \$('#num').css('border','1px solid #41a2aa');
  1159.     \$('#num').removeClass('is-valid'); 
  1160.     \$('#num').removeClass('is-invalid'); 
  1161.     \$('#num').val(''); 
  1162.     \$('#Passworduser').css('border','1px solid #41a2aa');
  1163.     \$('#Passworduser').removeClass('is-valid'); 
  1164.     \$('#Passworduser').removeClass('is-invalid');
  1165.     \$('#Passworduser').val('');  
  1166.     \$('#Passworduser2').css('border','1px solid #41a2aa');
  1167.     \$('#Passworduser2').removeClass('is-valid'); 
  1168.     \$('#Passworduser2').removeClass('is-invalid'); 
  1169.     \$('#Passworduser2').val(''); 
  1170.     \$(\"#smsInput\").prop(\"checked\",false);
  1171.     \$(\"#mailInput\").prop(\"checked\",false);
  1172. }
  1173. ";
  1174.         
  1175.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  1176.         
  1177.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  1178.         yield from [];
  1179.     }
  1180.     /**
  1181.      * @codeCoverageIgnore
  1182.      */
  1183.     public function getTemplateName(): string
  1184.     {
  1185.         return "Parent/LoginParent.html.twig";
  1186.     }
  1187.     /**
  1188.      * @codeCoverageIgnore
  1189.      */
  1190.     public function isTraitable(): bool
  1191.     {
  1192.         return false;
  1193.     }
  1194.     /**
  1195.      * @codeCoverageIgnore
  1196.      */
  1197.     public function getDebugInfo(): array
  1198.     {
  1199.         return array (  916 => 715,  782 => 584,  663 => 468,  659 => 467,  654 => 464,  641 => 463,  625 => 456,  615 => 449,  592 => 429,  588 => 428,  578 => 421,  574 => 420,  568 => 417,  556 => 408,  547 => 402,  543 => 400,  537 => 398,  535 => 397,  509 => 374,  505 => 373,  497 => 368,  493 => 367,  456 => 333,  406 => 286,  394 => 277,  380 => 266,  348 => 237,  319 => 210,  306 => 209,  99 => 11,  95 => 10,  88 => 6,  84 => 5,  78 => 3,  65 => 2,  42 => 1,);
  1200.     }
  1201.     public function getSourceContext(): Source
  1202.     {
  1203.         return new Source("{% extends '/Accueil/layoutAccueilParents.html.twig' %}
  1204. {% block LinksCss %}
  1205.     {{ parent() }}
  1206.     <link rel=\"stylesheet\" href=\"{{'/css/Parent/css/login.css'}}\" >
  1207.     <link rel=\"stylesheet\" href=\"{{'/css/Parent/css/premiercnx.css'}}\">
  1208.     <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css\">
  1209.      <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css\">
  1210.  <link href=\"{{ asset ('css/bootstrap-social.css')}}\" type=\"text/css\" rel=\"stylesheet\" >
  1211.  <link rel=\"stylesheet\" href=\"{{ asset('css/splide.min.css') }}\">
  1212. <style>
  1213.     .titleProdbienvenu {
  1214.     text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  1215. }
  1216. /* Style pour le bouton de retour en haut */
  1217. .scroll-top-btn {
  1218.     position: fixed;
  1219.     bottom: 20px;
  1220.     right: 20px;
  1221.     width: 40px;
  1222.     height: 40px;
  1223.     border-radius: 50%;
  1224.     background-color: #41a2aa;
  1225.     color: white;
  1226.     border: none;
  1227.     box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  1228.     z-index: 1000;
  1229.     display: none;
  1230.     cursor: pointer;
  1231.     transition: all 0.3s ease;
  1232. }
  1233. .scroll-top-btn:hover {
  1234.     background-color: #f09e7a;
  1235.     transform: translateY(-3px);
  1236. }
  1237. /* Styles pour le loader d'inscription */
  1238. .register-loader {
  1239.     position: fixed;
  1240.     top: 0;
  1241.     left: 0;
  1242.     width: 100%;
  1243.     height: 100%;
  1244.     background-color: rgba(255, 255, 255, 0.9);
  1245.     z-index: 9999;
  1246.     display: none;
  1247.     justify-content: center;
  1248.     align-items: center;
  1249. }
  1250. .loader-content {
  1251.     text-align: center;
  1252.     background-color: white;
  1253.     padding: 30px;
  1254.     border-radius: 10px;
  1255.     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  1256.     max-width: 350px;
  1257.     width: 90%;
  1258. }
  1259. .loader-message {
  1260.     margin-top: 20px;
  1261.     font-size: 18px;
  1262.     font-weight: bold;
  1263.     color: #41a2aa;
  1264. }
  1265. .loader-submessage {
  1266.     margin-top: 10px;
  1267.     font-size: 14px;
  1268.     color: #666;
  1269. }
  1270. .spinner-border {
  1271.     width: 3rem;
  1272.     height: 3rem;
  1273.     color: #f09e7a !important;
  1274. }
  1275. /* Styles pour le modal de confirmation */
  1276. .modal {
  1277.     display: flex;
  1278.     align-items: center;
  1279.     justify-content: center;
  1280. }
  1281. .modal-dialog {
  1282.     margin: 0 auto;
  1283.     max-width: 500px;
  1284.     width: 90%;
  1285. }
  1286. .modal-content {
  1287.     border-radius: 10px;
  1288.     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  1289.     margin: 0 auto;
  1290. }
  1291. .modal-body {
  1292.     padding: 30px 20px;
  1293. }
  1294. .modal-footer {
  1295.     justify-content: center;
  1296.     padding: 15px;
  1297. }
  1298. .circleModal {
  1299.     background-color: #f09e7a;
  1300.     color: white;
  1301.     border: none;
  1302.     border-radius: 5px;
  1303.     padding: 10px 30px;
  1304.     font-weight: bold;
  1305.     transition: all 0.3s ease;
  1306. }
  1307. .circleModal:hover {
  1308.     background-color: #e8865e;
  1309.     transform: translateY(-2px);
  1310. }
  1311. /* Animation pour le passage au champ suivant */
  1312. .field-complete {
  1313.     transition: all 0.3s ease;
  1314.     border-color: #41a2aa !important;
  1315.     box-shadow: 0 0 5px rgba(65, 162, 170, 0.5) !important;
  1316.     transform: translateY(-2px);
  1317. }
  1318. .form-control:focus {
  1319.     border-color: #f09e7a !important;
  1320.     box-shadow: 0 0 6px rgba(240, 158, 122, 0.5) !important;
  1321.     transition: all 0.3s ease;
  1322. }
  1323. /* Hide one form by default at 1024px and below */
  1324. @media screen and (max-width: 1360px) {
  1325.     #connexionDiv, #inscriptionDiv {
  1326.         width: 80% !important;
  1327.         margin: 0 auto !important;
  1328.         float: none !important;
  1329.         margin-left: 10% !important;
  1330.     }
  1331.     
  1332.     /* Initially hide the connection form */
  1333.     #connexionDiv {
  1334.         display: none;
  1335.     }
  1336.     
  1337.     /* Make the inscription form take full width */
  1338.     #inscriptionDiv {
  1339.         display: block;
  1340.     }
  1341.     
  1342.     /* Hide the OR separator at 1024px */
  1343.     .ou-container {
  1344.         display: none;
  1345.     }
  1346.     
  1347.     /* Make the buttons more prominent for form switching */
  1348.     .circleCree {
  1349.         display: block !important;
  1350.         width: 100% !important;
  1351.         margin: 15px auto !important;
  1352.         padding: 10px !important;
  1353.         background-color: #41a2aa !important;
  1354.         color: white !important;
  1355.         border-radius: 5px !important;
  1356.         border: none !important;
  1357.         cursor: pointer !important;
  1358.         text-align: center !important;
  1359.         font-weight: bold !important;
  1360.     }
  1361.     
  1362.     /* Adjust column widths */
  1363.     .col-md-5, .col-sm-5, .col-lg-5 {
  1364.         width: 100% !important;
  1365.         max-width: 100% !important;
  1366.         flex: 0 0 100% !important;
  1367.     }
  1368.     
  1369.     /* Hide the middle column with the separator */
  1370.     .col-md-1.col-sm-1.col-lg-1.col-xs-1 {
  1371.         display: none !important;
  1372.     }
  1373. }
  1374. /* Maintain desktop layout above 1024px */
  1375. @media screen and (min-width: 1360px) {
  1376.     #connexionDiv, #inscriptionDiv {
  1377.         display: block !important;
  1378.     }
  1379.     
  1380.     .circleCree {
  1381.         display: none !important;
  1382.     }
  1383. }
  1384. </style>
  1385. {% endblock %}
  1386. {% block Content %}
  1387.   <!-- Bouton pour remonter en haut de la page -->
  1388.   <button id=\"scrollTopBtn\" class=\"scroll-top-btn\" title=\"Retour en haut\">
  1389.     <i class=\"fa fa-arrow-up\"></i>
  1390.   </button>
  1391.   <!-- Loader pour l'inscription -->
  1392.   <div id=\"registerLoader\" class=\"register-loader\">
  1393.     <div class=\"loader-content\">
  1394.       <div class=\"spinner-border text-primary\" role=\"status\">
  1395.         <span class=\"sr-only\">Chargement...</span>
  1396.       </div>
  1397.       <p class=\"loader-message\">Création de votre compte en cours...</p>
  1398.       <p class=\"loader-submessage\">Nous préparons votre espace parent 5sur5sejour, merci de patienter.</p>
  1399.     </div>
  1400.   </div>
  1401.   <!-- Modal de confirmation - avec l'attribut aria-hidden=\"true\" pour s'assurer qu'il est caché par défaut -->
  1402.   <div class=\"modal fade\" id=\"exampleModal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"exampleModalLabel\" aria-hidden=\"true\" style=\"display: none;\">
  1403.         <div class=\"modal-dialog modal-dialog-centered\" role=\"document\">
  1404.             <div class=\"modal-content\">
  1405.                 <div class=\"modal-header\" style=\"border-bottom: none; padding-bottom: 0;\">
  1406.                     <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\" style=\"position: absolute; right: 15px; top: 15px;\">
  1407.                         <span aria-hidden=\"true\">&times;</span>
  1408.                     </button>
  1409.                 </div>
  1410.                 <div class=\"modal-body text-center\">
  1411.                     <img class=\"imageLogo2 mb-3\" src=\"{{ asset ('Accueil/imagesAccueil/logoHeader.svg')}}\" alt=\"Logo 5 sur 5 séjour\">
  1412.                     <div class=\"row mb-4\">
  1413.                         <div class=\"col-12\">
  1414.                             <h4 class=\"font-weight-bold text-success\">Merci pour votre inscription à 5sur5sejour.com !</h4>
  1415.                             <p class=\"mt-3\">Vous allez recevoir un mail de confirmation afin d'accéder au site</p>
  1416.                         </div>
  1417.                     </div>
  1418.                 </div>
  1419.                 <div class=\"modal-footer\" style=\"border-top: none;\">
  1420.                     <button class=\"circleModal\" data-dismiss=\"modal\" onclick=\"location.reload();\" style=\"margin: 0 auto; padding: 10px 40px; font-size: 16px;\">OK</button>
  1421.                 </div>
  1422.             </div>
  1423.         </div>
  1424.     </div>
  1425.     <div class=\"splide no-padding no-margin\" id=\"imageSlider\" style=\"background:white\">
  1426.         <div class=\"splide__track\">
  1427.             <ul class=\"splide__list\">
  1428.                 <!-- Slide 1 -->
  1429.               
  1430.                 <!-- Slide 2 -->
  1431.                 <li class=\"splide__slide\">
  1432.                     <div class=\"slider-content\">
  1433.                         <div class=\"namePRD\" style=\"display: block;\">
  1434.                             <h4 class=\"titleProdbienvenu titleProdbienvenu1\" style=\"color: #41a2aa\">Offrez des souvenirs inoubliables à votre enfant </h4>
  1435.                             <h4 class=\"titleProdbienvenu titleProdbienvenu2\" style=\"color:#F09E7A\">avec des cadeaux personnalisés en toute simplicité !</h4>
  1436.                           </div>
  1437.                         <img src=\"{{ asset('/images/3.png') }}\" class=\"imgslider\" alt=\"Image 2\" />
  1438.                     </div>
  1439.                 </li>
  1440.                   <li class=\"splide__slide\">
  1441.                     <div class=\"slider-content\">
  1442.                         <div class=\"namePRD\" style=\"display: block;\">
  1443.                             <h4 class=\"titleProdbienvenu titleProdbienvenu1\" style=\"color:#F09E7A\">Restez connecté au séjour de votre enfant 24h/24  </h4>
  1444.                             <h4 class=\"titleProdbienvenu titleProdbienvenu2\" style=\"color:#41a2aa\">grâce à des photos partagées en toute sécurité !</h4>
  1445.                           </div>
  1446.                       
  1447.                         
  1448.                         <img src=\"{{ asset('/images/2.png') }}\" class=\"imgslider\" alt=\"Image 1\" />
  1449.                     </div>
  1450.                 </li>
  1451.                 <li class=\"splide__slide\">
  1452.                     <div class=\"slider-content\">
  1453.                         <div class=\"namePRD\" style=\"display: block;\">
  1454.                             <h4 class=\"titleProdbienvenu titleProdbienvenu1\" style=\"color: #41a2aa\">Accéder à une boite vocale en illimitée</h4>
  1455.                             <h4 class=\"titleProdbienvenu titleProdbienvenu2\" style=\"color:#F09E7A\">Pour écouter les messages laissés par les enfants et les accompagnateurs</h4>
  1456.                           </div>
  1457.                         <img src=\"{{ asset('/images/1.png') }}\" class=\"imgslider\" alt=\"Image 2\" />
  1458.                     </div>
  1459.                 </li>
  1460.             </ul>
  1461.         </div>
  1462.     </div>
  1463.     <div class='row no-margin' style=\"padding-top:4%\">
  1464.         <div class=\"col-lg-1 col-md-1 col-sm-1 col-xs-1 no-padding SeparateurLeftAccom\"></div>
  1465.         <div class=\"col-md-10 col-sm-10 col-lg-10 col-xs-12 \" >
  1466.          
  1467.         <!-- Bouton caché qui déclenche le modal de confirmation -->
  1468.         <button type=\"button\" id=\"showOkInscription\" class=\"d-none\" data-toggle=\"modal\" data-target=\"#exampleModal\">
  1469.         En savoir plus
  1470.         </button>
  1471.         
  1472.           
  1473.             <div class=\"row no-margin\" style='margin-right: auto;margin-top:15px' id=\"formSection\">
  1474.   
  1475.                 
  1476.                
  1477.                 <div class=\"col-md-5 col-sm-5 col-lg-5  Inscription \" id='inscriptionDiv'>
  1478.                    
  1479.                     <form class =\"form-section\" id=\"create\" onsubmit=\"cp(); return false;\">
  1480.                         <div class=\"soutitle\"> Créer un compte   </div>
  1481.                     <div class =\"description2\" > Vous vous connectez pour la 1ère fois et n'avez pas
  1482.                         <br> de compte Parent(s) « 5 sur 5 séjour » </div>
  1483.                         <button type=\"button\"  align =\"center\" class=\"circleCree\"  onclick=\"AffichDivConnexion();\">Vous avez déjà un compte Parent(s) ? </button>
  1484.                         <div class=\"form-group\">
  1485.                             <input type=\"text\" class=\"form-control\" id=\"nomparent\"  placeholder=\"NOM * \" >
  1486.                             <input type=\"text\" class=\"form-control\" id=\"prenomparent\"  placeholder=\"PRENOM *\">
  1487.                             <input type=\"text\" autocomplete=\"off\" class=\"form-control\" id=\"mail\" placeholder=\"ADRESSE MAIL\" required data-toggle=\"tooltip\" data-placement=\"right\" title=\"\">
  1488.                             <input type=\"password\" autocomplete=\"off\" name=\"password\" id=\"Passworduser\" value=\"\"  class=\"form-control\"  placeholder=\"MOT DE PASSE  * \">
  1489.                             <input type=\"password\" autocomplete=\"off\" name=\"password\" id=\"Passworduser2\"  class=\"form-control\"  placeholder=\"CONFIRMER VOTRE MOT DE PASSE\">
  1490.                             
  1491.                             <p style=\"display: none; color:red; font-weight: bold; margin-top: 10px;\" id=\"eroor\">Cet email est déjà utilisé. <a href=\"{{ path(\"forgotPassparent\") }}\" style=\"color:#f09e7a; text-decoration: underline;\">Mot de passe oublié ?</a></p>
  1492.                             <input type=\"text\" class=\"form-control\" id=\"num\"  name=\"numero de téléphone\" placeholder=\"NUMERO DE TELEPHONE PORTABLE * \">
  1493.                                
  1494.   
  1495.                                         <div class=\"row no-margin \">
  1496.                 <div class=\"souTITRE\">Souhaitez-vous être averti lorsque l'organisateur dépose des images ou des messages du séjour ?</div>
  1497.             </div>
  1498.             <br>
  1499.             <div class=\"row no-margin\">
  1500.                 <div class=\"box-1\" id=\"smsToggle\">
  1501.                     <input type='checkbox' name =\"sms\" id =\"smsInput\"  />
  1502.                     <span class=\"toogle\"> </span>
  1503.                 </div>
  1504.                 <span class=\"sms\"> Par SMS </span>
  1505.                 <div class=\"box-1\">
  1506.                     <input type='checkbox' name =\"mail\" id =\"mailInput\"   />
  1507.                     <span class=\"toogle\" > </span>
  1508.                 </div>
  1509.                 <span class=\"mail\"> Par Mail </span>
  1510.             </div>
  1511.             
  1512.                         </div>
  1513.                         <div class=\"notification\" id=\"notification\" style=\"display: none;\">L'adresse e-mail est incorrecte.</div>
  1514.                         <div class=\"button-container\">
  1515.                         <button  type=\"button\" onclick=\"cp();\" class=\"logButton\" style=\"color:#fff;border: 1px solid #f09e7a;    position: relative;
  1516.         background-color: #f09e7a;\" id=\"submitBtn\">     
  1517.             S'inscrire
  1518.           </button></div>
  1519.           
  1520.           <div class=\"button-container mobilesocial\">
  1521.             <a href=\"{{ path('connect_google_start') }}\"  style=\"color:#fff;background-color:#4F86EC;\" class=\"logButtonSocial\" onclick=\"_gaq.push(['_trackEvent', 'btn-social', 'click', 'btn-google']);\">
  1522.          <img src=\"{{ asset('/images/icons-google.png') }}\"  >Continuer avec Google
  1523.        </a>
  1524.                        
  1525.      </div>
  1526.      <div class=\"mobilesocial\" >                  
  1527.                     <a href=\"{{ path('connect_facebook_start') }}\"  class=\"logButtonSocial\" style=\"color:#fff;background-color:#3b5998;border-color:rgba(0,0,0,0.2)\" >
  1528.                      <img src=\"{{ asset('/images/icons-facebook.png') }}\"  >         Continuer avec Facebook
  1529.        </a>
  1530.            </div>        
  1531.         </form>
  1532.                 </div>
  1533.                 <div class=\"col-md-1 col-sm-1 col-lg-1 col-xs-1  \" ><div class=\"ou-container\" style=\"margin-left: 20%;\">
  1534.                     <div class=\"ou-line\"></div>
  1535.                     <div class=\"ou-text\">OU</div>
  1536.                   </div> </div>
  1537.                 <div class=\"col-md-5 col-sm-5 col-lg-5 col-xs-5 connexion \" id='connexionDiv' >
  1538.                  
  1539.                
  1540.                     <div class=\"form-section\">
  1541.                         <div class=\"soutitle\">  Se connecter </div>
  1542.                         <div class =\"description2\" >Vous avez déja un compte Parent(s) « 5 sur 5 séjour »  </div>
  1543.                         <button type=\"button\"  align =\"center\" class=\"circleCree\"  onclick=\"AffichDivInscri();\">Créer un compte ? </button>
  1544.                         <form method=\"post\" class=\"\">
  1545.                             {% if error %}
  1546.                                 <div class=\"alert alert-danger\">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
  1547.                             {% endif %}
  1548.                             <div class=\"form-group\">
  1549.                                 <input type=\"text\"  name=\"email\" id=\"inputEmail\"  value=\"{{ last_username }}\"  class=\"form-control\" placeholder=\"Mon identifiant  * \" >
  1550.                             <input type=\"password\" name=\"password\" id=\"inputPassword\" class=\"form-control\" placeholder=\"Mon mot de passe *\">
  1551.                             <span toggle=\"#inputPassword\" class=\"fa fa-fw fa-eye field-icon toggle-password\"></span>
  1552.             
  1553.                                 
  1554.                                 <input type=\"hidden\" name=\"_csrf_token\" value=\"{{ csrf_token('authenticate') }}\">
  1555.                                 <div class=\"button-container\">
  1556.                                     <button   class=\"logButton\" style=\"color:#fff;background-color:#41a2aa;border-color:rgba(0,0,0,0.2)\" >
  1557.              Se connecter 
  1558.           </button>
  1559.         
  1560.                             </div>
  1561.                               
  1562.                             <div class =\"description\" > <a id=\"mdpobli\" href=\"{{ path(\"forgotPassparent\") }}\" style=\"color:#f09e7a ; display: block\">Vous avez oublié votre mot de passe ?  </a> </div>
  1563.                             <div class=\"button-container\">
  1564.                <a href=\"{{ path('connect_google_start') }}\"  style=\"color:#fff;background-color:#4F86EC;\" class=\"logButtonSocial\" onclick=\"_gaq.push(['_trackEvent', 'btn-social', 'click', 'btn-google']);\">
  1565.             <img src=\"{{ asset('/images/icons-google.png') }}\"  >Continuer avec Google
  1566.           </a>
  1567.                           
  1568.         </div>
  1569.         <div class=\"button-c\" style=\"display: flex;
  1570.         justify-content: center;
  1571.         align-items: center;\">                  
  1572.                        <a href=\"{{ path('connect_facebook_start') }}\"  class=\"logButtonSocial\" style=\"color:#fff;background-color:#3b5998;border-color:rgba(0,0,0,0.2)\" >
  1573.                         <img src=\"{{ asset('/images/icons-facebook.png') }}\"  >         Continuer avec Facebook
  1574.           </a>
  1575.               </div>        
  1576.         
  1577.                             
  1578.                                 <br>
  1579.                                 <br>
  1580.                                 
  1581.                             </div>
  1582.                         </form>
  1583.                     
  1584.                     </div>
  1585.                 </div>
  1586.                    
  1587.         </div>
  1588.       
  1589.     </div>
  1590.   <div class=\"col-md-3\" style=\"margin-top: 21%;display:none\">
  1591.    <a href=\"{{ path('connect_google_start') }}\"  style=\"color:#fff;background-color:#4F86EC;border-color:rgba(0,0,0,0.2)\" class=\"btn btn-block btn-social btn-google\" onclick=\"_gaq.push(['_trackEvent', 'btn-social', 'click', 'btn-google']);\">
  1592.             <span class=\"fa fa-google\"></span> S'inscrire avec Google
  1593.           </a>
  1594.           
  1595.                           
  1596.                                 <br>
  1597.                                    <br>
  1598.                        <a href=\"{{ path('connect_facebook_start') }}\"  class=\"btn btn-block btn-social btn-facebook\" style=\"color:#fff;background-color:#3b5998;border-color:rgba(0,0,0,0.2)\" >
  1599.             <span class=\"fa fa-facebook\"></span>  S'inscrire avec Facebook
  1600.           </a></div>
  1601.             </div>
  1602. {% endblock %}
  1603. {% block javascript %}
  1604.    
  1605.    
  1606.     {{ parent() }}
  1607.   <script src=\"{{ asset('js/splide.min.js') }}\"></script>
  1608.   <script src=\"https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.all.min.js\"></script>
  1609.     
  1610.     <script>
  1611.         document.addEventListener('DOMContentLoaded', function () {
  1612.     // S'assurer que le modal est caché au chargement de la page
  1613.     \$('#exampleModal').modal('hide');
  1614.     \$('#exampleModal').removeClass('show');
  1615.     \$('#exampleModal').attr('aria-hidden', 'true');
  1616.     \$('body').removeClass('modal-open');
  1617.     \$('.modal-backdrop').remove();
  1618.     
  1619.     // Gestion du bouton de retour en haut
  1620.     const scrollTopBtn = document.getElementById('scrollTopBtn');
  1621.     
  1622.     // Afficher/masquer le bouton en fonction du défilement
  1623.     window.addEventListener('scroll', function() {
  1624.         if (window.pageYOffset > 300) {
  1625.             scrollTopBtn.style.display = 'block';
  1626.         } else {
  1627.             scrollTopBtn.style.display = 'none';
  1628.         }
  1629.     });
  1630.     
  1631.     // Action de clic sur le bouton
  1632.     scrollTopBtn.addEventListener('click', function() {
  1633.         window.scrollTo({
  1634.             top: 0,
  1635.             behavior: 'smooth'
  1636.         });
  1637.     });
  1638.     
  1639.     // Initialisation du carrousel Splide
  1640.     var splide = new Splide('#imageSlider', {
  1641.         type: 'loop',
  1642.         perPage: 1,
  1643.         autoplay: true,
  1644.         interval: 6000,
  1645.         pauseOnHover: false,
  1646.         pauseOnFocus: false,
  1647.          pagination: false , // Désactive la pagination
  1648.          arrows: false  
  1649.     });
  1650.     splide.mount();
  1651.     
  1652.     // Auto-scroll vers les formulaires après 3 secondes
  1653.     setTimeout(function() {
  1654.         scrollToFormSection();
  1655.     }, 5000);
  1656.     // Configuration du modal de confirmation - s'assurer qu'il est bien caché
  1657.     \$('#exampleModal').modal('dispose'); // Supprimer toute initialisation précédente
  1658.     
  1659.     // Réinitialiser le modal
  1660.     \$('#exampleModal').modal({
  1661.         backdrop: 'static',
  1662.         keyboard: false,
  1663.         show: false // S'assurer que le modal ne s'affiche pas automatiquement
  1664.     });
  1665.     
  1666.     // Centrage du modal uniquement lorsqu'il est affiché
  1667.     \$('#exampleModal').on('show.bs.modal', function () {
  1668.         \$(this).css('display', 'flex');
  1669.         \$(this).css('align-items', 'center');
  1670.         \$(this).find('.modal-dialog').css({
  1671.             'display': 'flex',
  1672.             'align-items': 'center',
  1673.             'margin': '0 auto',
  1674.             'max-height': '90vh'
  1675.         });
  1676.     });
  1677.     // Fonction pour faire défiler vers la section des formulaires
  1678.     function scrollToFormSection() {
  1679.         const formSection = document.getElementById('formSection');
  1680.         if (formSection) {
  1681.             const formPosition = formSection.getBoundingClientRect().top + window.scrollY;
  1682.             const headerOffset = 50; // Tenir compte de la hauteur de l'en-tête
  1683.             const scrollPosition = formPosition - headerOffset;
  1684.             
  1685.             // Animation de défilement fluide
  1686.             window.scrollTo({
  1687.                 top: scrollPosition,
  1688.                 behavior: 'smooth'
  1689.             });
  1690.             
  1691.             // Les animations de mise en évidence ont été supprimées
  1692.         }
  1693.     }
  1694. });
  1695.         // Fonction pour afficher le popover automatiquement avec animation
  1696.       
  1697.         function cp() {
  1698.          
  1699.            // Afficher le loader
  1700.            \$('#registerLoader').css('display', 'flex');
  1701.            
  1702.            // Définir un timeout pour masquer le loader après 10 secondes, même si la requête n'est pas terminée
  1703.            var loaderTimeout = setTimeout(function() {
  1704.                \$('#registerLoader').css('display', 'none');
  1705.                Swal.fire({
  1706.                    icon: 'info',
  1707.                    title: 'Inscription en cours',
  1708.                    text: 'Votre inscription est en cours de traitement. Vous recevrez un email de confirmation.',
  1709.                    confirmButtonColor: '#41a2aa',
  1710.                    position: 'center'
  1711.                });
  1712.            }, 10000);
  1713.           
  1714.             var nomparent = \"\";
  1715.             var   prenomparent= \"\";
  1716.             var mail = \"\";
  1717.             var num = \"5555\";
  1718.             console.log(num);
  1719.             var confirmpassword = \$('#Passworduser2').val();
  1720.             var parent_register = \"{{ path('parent_register') }}\";
  1721.             var Passworduser = \"\";
  1722.             \$testDeCreation = false;
  1723.             \$testDeCreation2 = false;
  1724.             \$testDeCreation3 = false;
  1725.             \$testDeCreation4 = false;
  1726.             \$testDeCreation5 = false;
  1727.             if (\$('#nomparent').val() == \"\") {
  1728.                   
  1729.                 \$('#nomparent').addClass('is-invalid');
  1730.                 \$('#nomparent').removeClass('is-valid');
  1731.                 \$('#nomparent').css('border', '1px solid red');
  1732.                 \$testDeCreation = false;
  1733.             } else {
  1734.                 \$('#nomparent').removeClass('is-invalid');
  1735.                 \$('#nomparent').addClass('is-valid');
  1736.                 
  1737.                 \$('#nomparent').css('border', '1px solid green');
  1738.                nomparent = \$('#nomparent').val();
  1739.                 \$testDeCreation = true;
  1740.             }
  1741.             if (\$('#prenomparent').val() == \"\") {
  1742.               
  1743.                 \$('#prenomparent').addClass('is-invalid');
  1744.                 \$('#prenomparent').removeClass('is-valid');
  1745.                 \$('#prenomparent').css('border', '1px solid red');
  1746.                 \$testDeCreation1 = false;
  1747.             } else {
  1748.                 \$('#prenomparent').removeClass('is-invalid');
  1749.                 \$('#prenomparent').addClass('is-valid');
  1750.                
  1751.                 \$('#prenomparent').css('border', '1px solid green');
  1752.                prenomparent = \$('#prenomparent').val();
  1753.                 \$testDeCreation1 = true;
  1754.             }
  1755.             if (\$('#num').val() == \"\") {
  1756.                 \$('#num ').addClass('is-invalid');
  1757.                 \$('#num').removeClass('is-valid');
  1758.                 \$('#num').css('border', '1px solid red');
  1759.                 \$testDeCreation2 = false;
  1760.             } else {
  1761.                 \$('#num').removeClass('is-invalid');
  1762.                 \$('#num').addClass('is-valid');
  1763.                
  1764.                 \$('#num').css('border', '1px solid green');
  1765.                num = \$('#num').val();
  1766.                 \$testDeCreation2 = true;
  1767.             }
  1768.             if (\$('#mail').val() == \"\") {
  1769.                 \$('#mail').addClass('is-invalid');
  1770.                 \$('#mail').removeClass('is-valid');
  1771.                 \$('#mail').css('border', '1px solid red');
  1772.                 \$testDeCreation3 = false;
  1773.             } else {
  1774.                 \$('#mail').removeClass('is-invalid');
  1775.                 \$('#mail').addClass('is-valid');
  1776.                
  1777.                 \$('#mail').css('border', '1px solid green');
  1778.                 mail = \$('#mail').val();
  1779.                 \$testDeCreation3 = true;
  1780.             }
  1781.             if (\$('#Passworduser').val() == \"\") {
  1782.                 \$('#Passworduser').addClass('is-invalid');
  1783.                 \$('#Passworduser').removeClass('is-valid');
  1784.                 \$('#Passworduser').css('border', '1px solid red');
  1785.                 \$testDeCreation4 = false;
  1786.             } else {
  1787.                 \$('#Passworduser').removeClass('is-invalid');
  1788.                 \$('#Passworduser').addClass('is-valid');
  1789.                
  1790.                 \$('#Passworduser').css('border', '1px solid green');
  1791.                 Passworduser = \$('#Passworduser').val();
  1792.                 \$testDeCreation4 = true;
  1793.             }
  1794.             
  1795.             var sms = 0; var mailnotif = 0;
  1796.             if (\$(\"#smsInput\").is(':checked')) {
  1797.                 var sms = 1;
  1798.             }
  1799.             if (\$(\"#mailInput\").is(':checked')){
  1800.                 var mailnotif = 1;
  1801.             }
  1802.            
  1803.             \$_data = {
  1804.                 'nomparent': nomparent,
  1805.                 'prenomparent': prenomparent,
  1806.                 'mailprent': mail,
  1807.                 'numtel': num,
  1808.                 'passwordparent': Passworduser,
  1809.                 'confirmpassword':confirmpassword,
  1810.                 'sms': sms,
  1811.                 'mailnotif': mailnotif
  1812.             }
  1813.              console.log(\$_data);
  1814.             if (\$testDeCreation &&  \$testDeCreation1 && \$testDeCreation2 && \$testDeCreation3 && \$testDeCreation4 ) {
  1815.              
  1816.          
  1817.                 \$.ajax({
  1818.                     type: \"POST\",
  1819.                     url: parent_register,
  1820.                     data: \$_data,
  1821.                     success: function (\$response) {
  1822.                         console.log(\$response);
  1823.                         // Masquer le loader quelle que soit la réponse
  1824.                         \$('#registerLoader').css('display', 'none');
  1825.                         // Annuler le timeout puisque la requête est terminée
  1826.                         clearTimeout(loaderTimeout);
  1827.                         
  1828.                         if (\$response == 'eror') {
  1829.                         
  1830.                             \$('#mail').css('border-color', 'red');
  1831.                             \$('#eroor').css('display', 'block');
  1832.                             // Afficher une alerte SweetAlert pour l'email déjà utilisé avec boutons d'action
  1833.                             Swal.fire({
  1834.                                 icon: 'error',
  1835.                                 title: 'Email déjà utilisé',
  1836.                                 text: 'Cette adresse email est déjà associée à un compte.',
  1837.                                 footer: '<a href=\"{{ path(\"forgotPassparent\") }}\" style=\"color:#f09e7a;\">Mot de passe oublié ?</a>',
  1838.                                 showCancelButton: true,
  1839.                                 confirmButtonText: 'Se connecter',
  1840.                                 cancelButtonText: 'Modifier',
  1841.                                 confirmButtonColor: '#41a2aa',
  1842.                                 cancelButtonColor: '#f09e7a',
  1843.                                 position: 'center'
  1844.                             }).then((result) => {
  1845.                                 if (result.isConfirmed) {
  1846.                                     // Basculer vers le formulaire de connexion et pré-remplir l'email
  1847.                                     AffichDivConnexion();
  1848.                                     \$('#inputEmail').val(\$('#mail').val());
  1849.                                     \$('#inputPassword').focus();
  1850.                                 }
  1851.                             });
  1852.                         }
  1853.                         else if(\$response == 'erorpasswordconfirm')
  1854.                         {
  1855.                              
  1856.                               \$('#Passworduser2').css('border-color', 'red');
  1857.                                 Swal.fire({
  1858.                                 icon: 'error',
  1859.                                 title: 'Oups..!',
  1860.                                 text: 'Les mots de passe ne se correspondent pas.',
  1861.                                 footer: '',
  1862.                                 position: 'center'
  1863.                             })
  1864.                         }
  1865.                     
  1866.                          else {
  1867.                               
  1868.                           
  1869.                             \$(\"#showOkInscription\").trigger('click');
  1870.                             
  1871.                             // Réinitialiser tous les champs du formulaire
  1872.                             resetForm();
  1873.                             
  1874.                             // S'assurer que le modal est bien centré
  1875.                             \$('#exampleModal').on('shown.bs.modal', function () {
  1876.                                 \$(this).find('.modal-dialog').css({
  1877.                                     'margin-top': function () {
  1878.                                         return (\$(window).height() - \$(this).height()) / 2;
  1879.                                     }
  1880.                                 });
  1881.                             });
  1882.                               var windowWidth = document.documentElement.clientWidth;
  1883.                                 if (windowWidth <= 560) {
  1884.                                     setTimeout(function(){
  1885.                                        
  1886.                                    location.reload();
  1887.                               },500);
  1888.                               
  1889.                            }
  1890.                               
  1891.                             
  1892.                         }
  1893.                     },
  1894.                     error: function() {
  1895.                         // Masquer le loader en cas d'erreur
  1896.                         \$('#registerLoader').css('display', 'none');
  1897.                         // Annuler le timeout puisque la requête est terminée
  1898.                         clearTimeout(loaderTimeout);
  1899.                         
  1900.                         // Afficher un message d'erreur
  1901.                         Swal.fire({
  1902.                             icon: 'error',
  1903.                             title: 'Erreur de connexion',
  1904.                             text: 'Un problème est survenu lors de l\\'inscription. Veuillez réessayer.',
  1905.                             confirmButtonColor: '#f09e7a',
  1906.                             position: 'center'
  1907.                         });
  1908.                     }
  1909.                 })
  1910.             } else {
  1911.                 // Masquer le loader si la validation échoue
  1912.                 \$('#registerLoader').css('display', 'none');
  1913.                 // Annuler le timeout puisque la validation a échoué
  1914.                 clearTimeout(loaderTimeout);
  1915.             }
  1916.         }
  1917.         function AffichDivConnexion() {
  1918.     \$(\"#inscriptionDiv\").css(\"display\", \"none\");
  1919.     \$(\"#connexionDiv\").css(\"display\", \"block\");
  1920. }
  1921. function AffichDivInscri() {
  1922.     \$(\"#inscriptionDiv\").css(\"display\", \"block\");
  1923.     \$(\"#connexionDiv\").css(\"display\", \"none\");
  1924. }
  1925. // Function to handle responsive behavior based on window width
  1926. function handleResponsiveFormDisplay() {
  1927.     var windowWidth = \$(window).width();
  1928.     
  1929.     if (windowWidth <= 1024) {
  1930.         // Apply mobile-like behavior for tablets/smaller screens
  1931.         // Show only one form at a time with toggle buttons
  1932.         \$(\"#connexionDiv\").css(\"display\", \"none\");
  1933.         \$(\"#inscriptionDiv\").css(\"display\", \"block\");
  1934.         \$(\".circleCree\").css(\"display\", \"block\");
  1935.     } else {
  1936.         // For desktop, show both forms side by side
  1937.         \$(\"#connexionDiv\").css(\"display\", \"block\");
  1938.         \$(\"#inscriptionDiv\").css(\"display\", \"block\");
  1939.         \$(\".circleCree\").css(\"display\", \"none\");
  1940.     }
  1941. }
  1942. // Run on page load
  1943. \$(document).ready(function() {
  1944.     handleResponsiveFormDisplay();
  1945.     
  1946.     // Also run when window is resized
  1947.     \$(window).resize(function() {
  1948.         handleResponsiveFormDisplay();
  1949.     });
  1950.     
  1951.     // Configuration pour le passage automatique au champ suivant
  1952.     setupAutoNextField();
  1953.     
  1954.     // Ajouter la validation en temps réel pour tous les champs
  1955.     setupRealtimeValidation();
  1956. });
  1957. // Fonction pour configurer le passage automatique au champ suivant
  1958. function setupAutoNextField() {
  1959.     // Ordre des champs dans le formulaire d'inscription
  1960.     const formFields = [
  1961.         'nomparent',
  1962.         'prenomparent',
  1963.         'mail',
  1964.         'Passworduser',
  1965.         'Passworduser2',
  1966.         'num'
  1967.     ];
  1968.     
  1969.     // Pour chaque champ, ajouter des événements pour la navigation
  1970.     formFields.forEach((field, index) => {
  1971.         if (index < formFields.length - 1) {
  1972.             const \$currentField = \$('#' + field);
  1973.             let typingTimer; // Timer pour détecter quand l'utilisateur arrête de taper
  1974.             const doneTypingInterval = 1500; // Temps en ms après lequel on considère que l'utilisateur a fini de taper
  1975.             
  1976.             // Événement lorsque l'utilisateur tape
  1977.             \$currentField.on('input', function() {
  1978.                 clearTimeout(typingTimer);
  1979.                 
  1980.                 // Si l'utilisateur appuie sur espace et que le champ est valide
  1981.                 if (event && event.data === ' ' && isFieldValid(field, \$(this).val().trim())) {
  1982.                     event.preventDefault(); // Empêcher l'espace d'être ajouté
  1983.                     \$('#' + formFields[index + 1]).focus();
  1984.                     return;
  1985.                 }
  1986.                 
  1987.                 // Démarrer un nouveau timer
  1988.                 if (\$(this).val()) {
  1989.                     typingTimer = setTimeout(function() {
  1990.                         // Vérifier si le champ est valide
  1991.                         if (isFieldValid(field, \$currentField.val().trim())) {
  1992.                             \$('#' + formFields[index + 1]).focus();
  1993.                         }
  1994.                     }, doneTypingInterval);
  1995.                 }
  1996.             });
  1997.             
  1998.             // Réinitialiser le timer si l'utilisateur continue de taper
  1999.             \$currentField.on('keydown', function(e) {
  2000.                 clearTimeout(typingTimer);
  2001.                 
  2002.                 // Si l'utilisateur appuie sur espace et que le champ est valide
  2003.                 if (e.key === ' ' && isFieldValid(field, \$(this).val().trim())) {
  2004.                     e.preventDefault(); // Empêcher l'espace d'être ajouté
  2005.                     \$('#' + formFields[index + 1]).focus();
  2006.                     return;
  2007.                 }
  2008.                 
  2009.                 // Si l'utilisateur appuie sur Tab ou Entrée
  2010.                 if (e.key === 'Tab' && !e.shiftKey) {
  2011.                     // Laisser le comportement par défaut de Tab
  2012.                     return true;
  2013.                 }
  2014.                 
  2015.                 if (e.key === 'Enter') {
  2016.                     e.preventDefault(); // Empêcher la soumission du formulaire
  2017.                     \$('#' + formFields[index + 1]).focus();
  2018.                 }
  2019.             });
  2020.             
  2021.             // Événement lorsque le champ perd le focus
  2022.             \$currentField.on('blur', function() {
  2023.                 clearTimeout(typingTimer);
  2024.             });
  2025.         }
  2026.     });
  2027.     
  2028.     // Pour le dernier champ, la touche Enter déclenche l'inscription
  2029.     \$('#' + formFields[formFields.length - 1]).on('keydown', function(e) {
  2030.         if (e.key === 'Enter') {
  2031.             e.preventDefault();
  2032.             cp(); // Fonction d'inscription
  2033.         }
  2034.     });
  2035. }
  2036. // Fonction pour vérifier si un champ est valide selon son type
  2037. function isFieldValid(fieldId, value) {
  2038.     switch(fieldId) {
  2039.         case 'mail':
  2040.             const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\$/;
  2041.             return emailRegex.test(value);
  2042.         case 'Passworduser':
  2043.             // Minimum 6 caractères pour un mot de passe
  2044.             return value.length >= 6;
  2045.         case 'Passworduser2':
  2046.             // Doit correspondre au mot de passe et avoir au moins 6 caractères
  2047.             return value === \$('#Passworduser').val() && value.length >= 6;
  2048.         case 'num':
  2049.             // Numéro de téléphone: doit contenir uniquement des chiffres et avoir au moins 8 caractères
  2050.             const phoneRegex = /^[0-9]{8,}\$/;
  2051.             return phoneRegex.test(value.replace(/\\s+/g, '')); // Enlever les espaces avant de tester
  2052.         case 'nomparent':
  2053.         case 'prenomparent':
  2054.             // Nom et prénom: au moins 2 caractères, pas de chiffres
  2055.             const nameRegex = /^[A-Za-zÀ-ÖØ-öø-ÿ\\s'-]{2,}\$/;
  2056.             return nameRegex.test(value);
  2057.         default:
  2058.             return value.length >= 2;
  2059.     }
  2060. }
  2061.     </script>
  2062.    
  2063.     <script>
  2064.         function hideshow() {
  2065.             document.getElementById(\"btnn\").disabled = true;
  2066.             \$(\"#btnn\").css(\"background-color\", \"#ecf0f1\");
  2067.             \$(\"#mdpobli\").css(\"display\", \"none\");
  2068.             \$(\"#mdpoblier\").css(\"display\", \"block\");
  2069.         }
  2070.     </script>
  2071.        <script>
  2072.     function closeModale(){
  2073.     \$(\"#monModalInscription\").modal('hide');
  2074.      }
  2075.    // \$(\".masktelph\").inputmask({\"mask\": \"9999999999\"});
  2076.    </script>
  2077.    <script>
  2078.     /**
  2079.      * this code is used to toggle the password
  2080.      */ 
  2081.     \$(\".toggle-password\").click(function() {
  2082. \$(this).toggleClass(\"fa-eye fa-eye-slash\");
  2083. var input = \$(\$(this).attr(\"toggle\"));
  2084. if (input.attr(\"type\") == \"password\") {
  2085.   input.attr(\"type\", \"text\");
  2086. } else {
  2087.   input.attr(\"type\", \"password\");
  2088. }
  2089. });
  2090. \$(document).ready(function(){
  2091.             \$('[data-toggle=\"tooltip\"]').tooltip({
  2092.                 trigger: 'manual',
  2093.                 html: true,
  2094.                 template: '<div class=\"tooltip\" role=\"tooltip\"><div class=\"arrow\"></div><div class=\"tooltip-inner\"></div></div>'
  2095.             });
  2096.             function validateEmail(email) {
  2097.                 const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\$/;
  2098.                 return re.test(String(email).toLowerCase());
  2099.             }
  2100.             \$('#mail').on('input', function() {
  2101.                 var emailInput = \$(this);
  2102.                 if (validateEmail(emailInput.val())) {
  2103.                     emailInput.removeClass('is-invalid');
  2104.                     emailInput.addClass('is-valid');
  2105.                     emailInput.tooltip('dispose');
  2106.                     \$('#notification').hide();
  2107.                     \$('#submitBtn').prop('disabled', false);
  2108.                     
  2109.                     // Ne pas passer automatiquement au champ suivant ici,
  2110.                     // car c'est déjà géré par setupAutoNextField()
  2111.                 } else {
  2112.                     emailInput.removeClass('is-valid');
  2113.                     emailInput.addClass('is-invalid');
  2114.                     
  2115.                     // Afficher le tooltip seulement si l'utilisateur a commencé à saisir
  2116.                     if (emailInput.val().length > 3) {
  2117.                         emailInput.attr('data-original-title', 'Votre adresse mail est incorrecte. Exemple: nom@domaine.com').tooltip('show');
  2118.                         if (emailInput.val().length > 0) {
  2119.                             \$('#notification').show();
  2120.                         }
  2121.                     } else {
  2122.                         \$('#notification').hide();
  2123.                     }
  2124.                     \$('#submitBtn').prop('disabled', false);
  2125.                 }
  2126.             });
  2127.         });
  2128. </script>
  2129. // Fonction pour configurer la validation en temps réel
  2130. function setupRealtimeValidation() {
  2131.     const formFields = [
  2132.         'nomparent',
  2133.         'prenomparent',
  2134.         'mail',
  2135.         'Passworduser',
  2136.         'Passworduser2',
  2137.         'num'
  2138.     ];
  2139.     
  2140.     formFields.forEach(field => {
  2141.         \$('#' + field).on('input', function() {
  2142.             const value = \$(this).val();
  2143.             
  2144.             // Ne pas afficher d'erreur tant que l'utilisateur n'a pas commencé à saisir
  2145.             if (value.length === 0) {
  2146.                 \$(this).removeClass('is-valid is-invalid');
  2147.                 \$(this).css('border', '1px solid #ced4da'); // Couleur de bordure par défaut
  2148.                 return;
  2149.             }
  2150.             
  2151.             // Vérifier la validité du champ
  2152.             if (isFieldValid(field, value)) {
  2153.                 \$(this).removeClass('is-invalid').addClass('is-valid');
  2154.                 \$(this).css('border', '1px solid #28a745'); // Vert pour valide
  2155.             } else {
  2156.                 \$(this).removeClass('is-valid').addClass('is-invalid');
  2157.                 \$(this).css('border', '1px solid #dc3545'); // Rouge pour invalide
  2158.             }
  2159.         });
  2160.     });
  2161. }
  2162. // Fonction pour réinitialiser le formulaire
  2163. function resetForm() {
  2164.     \$('#nomparent').css('border','1px solid #41a2aa');
  2165.     \$('#nomparent').removeClass('is-valid'); 
  2166.     \$('#nomparent').removeClass('is-invalid'); 
  2167.     \$('#nomparent').val(''); 
  2168.     \$('#prenomparent').css('border','1px solid #41a2aa');
  2169.     \$('#prenomparent').removeClass('is-valid'); 
  2170.     \$('#prenomparent').removeClass('is-invalid'); 
  2171.     \$('#prenomparent').val(''); 
  2172.     \$('#mail').css('border','1px solid #41a2aa');
  2173.     \$('#mail').removeClass('is-valid'); 
  2174.     \$('#mail').removeClass('is-invalid'); 
  2175.     \$('#mail').val(''); 
  2176.     \$('#eroor').css('display','none');
  2177.     \$('#num').css('border','1px solid #41a2aa');
  2178.     \$('#num').removeClass('is-valid'); 
  2179.     \$('#num').removeClass('is-invalid'); 
  2180.     \$('#num').val(''); 
  2181.     \$('#Passworduser').css('border','1px solid #41a2aa');
  2182.     \$('#Passworduser').removeClass('is-valid'); 
  2183.     \$('#Passworduser').removeClass('is-invalid');
  2184.     \$('#Passworduser').val('');  
  2185.     \$('#Passworduser2').css('border','1px solid #41a2aa');
  2186.     \$('#Passworduser2').removeClass('is-valid'); 
  2187.     \$('#Passworduser2').removeClass('is-invalid'); 
  2188.     \$('#Passworduser2').val(''); 
  2189.     \$(\"#smsInput\").prop(\"checked\",false);
  2190.     \$(\"#mailInput\").prop(\"checked\",false);
  2191. }
  2192. {% endblock %}
  2193. ""Parent/LoginParent.html.twig""/var/www/5sur5sejour/templates/Parent/LoginParent.html.twig");
  2194.     }
  2195. }