var/cache/dev/twig/40/408bba2eb54ad93a08416debeafd5dc1418cd0bf483c83de6002547b65aaec7b.php line 48

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* frontend/frontindex/atelierParticipant.html.twig */
  14. class __TwigTemplate_bc934c675a12dd1552588495341e2e42855e2839d2bfd595778f6e49711d4f7f extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source = $this->getSourceContext();
  22.         $this->blocks = [
  23.             'body' => [$this, 'block_body'],
  24.         ];
  25.     }
  26.     protected function doGetParent(array $context)
  27.     {
  28.         // line 1
  29.         return "frontend/frontindex/add.html.twig";
  30.     }
  31.     protected function doDisplay(array $context, array $blocks = [])
  32.     {
  33.         $macros = $this->macros;
  34.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  35.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "frontend/frontindex/atelierParticipant.html.twig"));
  36.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  37.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "frontend/frontindex/atelierParticipant.html.twig"));
  38.         $this->parent = $this->loadTemplate("frontend/frontindex/add.html.twig", "frontend/frontindex/atelierParticipant.html.twig", 1);
  39.         $this->parent->display($context, array_merge($this->blocks, $blocks));
  40.         
  41.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  42.         
  43.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  44.     }
  45.     // line 3
  46.     public function block_body($context, array $blocks = [])
  47.     {
  48.         $macros = $this->macros;
  49.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  50.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
  51.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  52.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
  53.         // line 4
  54.         echo "\t<section class=\"doctors-area doctor-page\">
  55. \t\t<div class=\"container\">
  56.             ";
  57.         // line 6
  58.         if ((0 <= twig_compare(twig_get_attribute($this->env, $this->source, (isset($context["congres"]) || array_key_exists("congres", $context) ? $context["congres"] : (function () { throw new RuntimeError('Variable "congres" does not exist.', 6, $this->source); })()), "dateFin", [], "any", false, false, false, 6), (isset($context["currentDate"]) || array_key_exists("currentDate", $context) ? $context["currentDate"] : (function () { throw new RuntimeError('Variable "currentDate" does not exist.', 6, $this->source); })())))) {
  59.             // line 7
  60.             echo "                <div class=\"row\">
  61.                     <div class=\"col-md-12 text-center\">
  62.                         <a href=\"";
  63.             // line 9
  64.             echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("details_congres", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["congres"]) || array_key_exists("congres", $context) ? $context["congres"] : (function () { throw new RuntimeError('Variable "congres" does not exist.', 9, $this->source); })()), "id", [], "any", false, false, false, 9)]), "html", null, true);
  65.             echo "\" class=\"text-dark\"><h1>";
  66.             echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%Participation-atelier-du-congrès%"), "html", null, true);
  67.             echo " : ";
  68.             if ((0 === twig_compare(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 9, $this->source); })()), "request", [], "any", false, false, false, 9), "locale", [], "any", false, false, false, 9), "fr"))) {
  69.                 echo " ";
  70.                 echo twig_get_attribute($this->env, $this->source, (isset($context["congres"]) || array_key_exists("congres", $context) ? $context["congres"] : (function () { throw new RuntimeError('Variable "congres" does not exist.', 9, $this->source); })()), "label", [], "any", false, false, false, 9);
  71.                 echo " ";
  72.             } elseif ((0 === twig_compare(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 9, $this->source); })()), "request", [], "any", false, false, false, 9), "locale", [], "any", false, false, false, 9), "en"))) {
  73.                 echo twig_get_attribute($this->env, $this->source, (isset($context["congres"]) || array_key_exists("congres", $context) ? $context["congres"] : (function () { throw new RuntimeError('Variable "congres" does not exist.', 9, $this->source); })()), "labelEn", [], "any", false, false, false, 9);
  74.                 echo " ";
  75.             }
  76.             echo "</h1></a>
  77.                     </div>
  78.                 </div>
  79.                 <div class=\"row\">
  80.                     ";
  81.             // line 13
  82.             $context['_parent'] = $context;
  83.             $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 13, $this->source); })()), "flashes", [0 => "success"], "method", false, false, false, 13));
  84.             foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
  85.                 // line 14
  86.                 echo "                        <div class=\"alert alert-success col-12 text-center\">
  87.                             ";
  88.                 // line 15
  89.                 echo twig_escape_filter($this->env, $context["message"], "html", null, true);
  90.                 echo "
  91.                         </div>
  92.                     ";
  93.             }
  94.             $_parent = $context['_parent'];
  95.             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
  96.             $context = array_intersect_key($context, $_parent) + $_parent;
  97.             // line 18
  98.             echo "                    ";
  99.             $context['_parent'] = $context;
  100.             $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 18, $this->source); })()), "flashes", [0 => "danger"], "method", false, false, false, 18));
  101.             foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
  102.                 // line 19
  103.                 echo "                        <div class=\"alert alert-danger col-12 text-center\">
  104.                             ";
  105.                 // line 20
  106.                 echo twig_escape_filter($this->env, $context["message"], "html", null, true);
  107.                 echo "
  108.                         </div>
  109.                     ";
  110.             }
  111.             $_parent = $context['_parent'];
  112.             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
  113.             $context = array_intersect_key($context, $_parent) + $_parent;
  114.             // line 23
  115.             echo "                </div>
  116.                 <form action=\"";
  117.             // line 24
  118.             echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_participation_atelier", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["congres"]) || array_key_exists("congres", $context) ? $context["congres"] : (function () { throw new RuntimeError('Variable "congres" does not exist.', 24, $this->source); })()), "id", [], "any", false, false, false, 24)]), "html", null, true);
  119.             echo "\" method=\"post\" enctype=\"multipart/form-data\" id=\"inscriptionForm\">
  120.                     <div class=\"row mb-5 mt-5\">
  121.                         <div class=\"form-group col-md-6\">
  122.                             <label for=\"nom\"><strong>";
  123.             // line 27
  124.             echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%nomAtelier%")), "html", null, true);
  125.             echo "</strong></label>
  126.                             <input class=\"form-control\" type=\"text\" placeholder=\"";
  127.             // line 28
  128.             echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%nomAtelier%"), "html", null, true);
  129.             echo "\" required name=\"nom\">
  130.                         </div>
  131.                         <div class=\"form-group col-md-6\">
  132.                             <label for=\"prenom\"><strong>";
  133.             // line 31
  134.             echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%prenomAtelier%")), "html", null, true);
  135.             echo "</strong></label>
  136.                             <input class=\"form-control\" type=\"text\" placeholder=\"";
  137.             // line 32
  138.             echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%prenomAtelier%"), "html", null, true);
  139.             echo "\" required name=\"prenom\">
  140.                         </div>
  141.                         <div class=\"form-group col-md-6\">
  142.                             <label for=\"email\"><strong>";
  143.             // line 35
  144.             echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%E-mail%")), "html", null, true);
  145.             echo "</strong></label>
  146.                             <input type=\"email\" class=\"form-control\" id=\"email\" placeholder=\"name@example.com\" name=\"email\">
  147.                         </div>
  148.                         <div class=\"form-group col-md-6\">
  149.                             <label for=\"tel\"><strong>";
  150.             // line 39
  151.             echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%Phone%")), "html", null, true);
  152.             echo "</strong></label>
  153.                             <input type=\"text\" class=\"form-control\" id=\"tel\" placeholder=\"+21612345678\" name=\"tel\">
  154.                         </div>
  155.                         <div class=\"form-group col-md-6\">
  156.                             <label for=\"atelier\"><strong>";
  157.             // line 43
  158.             echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%Choisissez-un-ou-plusieurs-ateliers%")), "html", null, true);
  159.             echo "</strong></label>
  160.                             ";
  161.             // line 44
  162.             $context['_parent'] = $context;
  163.             $context['_seq'] = twig_ensure_traversable((isset($context["ateliers"]) || array_key_exists("ateliers", $context) ? $context["ateliers"] : (function () { throw new RuntimeError('Variable "ateliers" does not exist.', 44, $this->source); })()));
  164.             foreach ($context['_seq'] as $context["key"] => $context["atelier"]) {
  165.                 // line 45
  166.                 echo "                                <div class=\"form-check pt-2\">
  167.                                     <input class=\"form-check-input atelier\" type=\"checkbox\" value=\"";
  168.                 // line 46
  169.                 echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "id", [], "any", false, false, false, 46), "html", null, true);
  170.                 echo "\" id=\"atelier";
  171.                 echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "id", [], "any", false, false, false, 46), "html", null, true);
  172.                 echo "\" name=\"atelier";
  173.                 echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "id", [], "any", false, false, false, 46), "html", null, true);
  174.                 echo "\" ";
  175.                 if ((0 === twig_compare(twig_get_attribute($this->env, $this->source, $context["atelier"], "nbPlaceAtteint", [], "any", false, false, false, 46), twig_get_attribute($this->env, $this->source, $context["atelier"], "place", [], "any", false, false, false, 46)))) {
  176.                     echo "disabled";
  177.                 }
  178.                 echo ">
  179.                                     <label class=\"form-check-label\" for=\"atelier";
  180.                 // line 47
  181.                 echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "id", [], "any", false, false, false, 47), "html", null, true);
  182.                 echo "\">
  183.                                         ";
  184.                 // line 48
  185.                 echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "titre", [], "any", false, false, false, 48), "html", null, true);
  186.                 echo " <br>
  187.                                         <i class=\"fa fa-calendar\"></i> ";
  188.                 // line 49
  189.                 echo twig_escape_filter($this->env, twig_date_format_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "date", [], "any", false, false, false, 49), "Y-m-d"), "html", null, true);
  190.                 echo " : <i class=\"fa fa-clock\"></i> ";
  191.                 echo twig_escape_filter($this->env, twig_date_format_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "heureDeb", [], "any", false, false, false, 49), "H:i"), "html", null, true);
  192.                 echo " - ";
  193.                 echo twig_escape_filter($this->env, twig_date_format_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "heureFin", [], "any", false, false, false, 49), "H:i"), "html", null, true);
  194.                 echo " <br><i class=\"fa fa-users\"></i> <strong> ";
  195.                 echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%Animateur%"), "html", null, true);
  196.                 echo " : ";
  197.                 echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "animateur", [], "any", false, false, false, 49), "html", null, true);
  198.                 echo "</strong> 
  199.                                         ";
  200.                 // line 50
  201.                 if ((0 === twig_compare(twig_get_attribute($this->env, $this->source, $context["atelier"], "nbPlaceAtteint", [], "any", false, false, false, 50), twig_get_attribute($this->env, $this->source, $context["atelier"], "place", [], "any", false, false, false, 50)))) {
  202.                     echo "<strong class=\"text-danger\"> ";
  203.                     echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%messageLimitePlaceAtelier%")), "html", null, true);
  204.                     echo " </strong>";
  205.                 }
  206.                 // line 51
  207.                 echo "                                    </label>
  208.                                 </div>
  209.                             ";
  210.             }
  211.             $_parent = $context['_parent'];
  212.             unset($context['_seq'], $context['_iterated'], $context['key'], $context['atelier'], $context['_parent'], $context['loop']);
  213.             $context = array_intersect_key($context, $_parent) + $_parent;
  214.             // line 54
  215.             echo "                        </div>
  216.                         <div class=\"form-group col-md-6\">
  217.                             <label for=\"type\"> <strong>";
  218.             // line 56
  219.             echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%Inscrivez-vous-en-tant-que%")), "html", null, true);
  220.             echo " : </strong></label>
  221.                             <div class=\"form-check\">
  222.                                 <input class=\"form-check-input\" type=\"radio\" name=\"type\" id=\"membre\" value=\"membre\" checked>
  223.                                 <label class=\"form-check-label\" for=\"type\">
  224.                                     ";
  225.             // line 60
  226.             echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%membre%"), "html", null, true);
  227.             echo " ATU 
  228.                                 </label>
  229.                             </div>
  230.                             <div class=\"form-check\">
  231.                                 <input class=\"form-check-input\" type=\"radio\" name=\"type\" id=\"nonMembre\" value=\"nonMembre\">
  232.                                 <label class=\"form-check-label\" for=\"type\">
  233.                                     ";
  234.             // line 66
  235.             echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%nonmembre%"), "html", null, true);
  236.             echo " ATU
  237.                                 </label>
  238.                             </div>
  239.                             <div class=\"form-check\">
  240.                                 <input class=\"form-check-input\" type=\"radio\" name=\"type\" id=\"resident\" value=\"resident\">
  241.                                 <label class=\"form-check-label\" for=\"type\">
  242.                                     ";
  243.             // line 72
  244.             echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%Résident%"), "html", null, true);
  245.             echo "
  246.                                 </label>
  247.                             </div>
  248.                         </div>
  249.                         <div class=\"form-group col-md-8 offset-md-2 text-center\">
  250.                             ";
  251.             // line 79
  252.             echo "                            <button type=\"submit\" value=\"Valider\" class=\"btn btn-outline-success btn-lg mt-3\">";
  253.             echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%Valider%"), "html", null, true);
  254.             echo "</button>
  255.                         </div>
  256.                     </div>
  257.                 </form>
  258.             ";
  259.         } else {
  260.             // line 84
  261.             echo "                <h1 class=\"text-center\">";
  262.             echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%congres-termine%"), "html", null, true);
  263.             echo "</h1>
  264.             ";
  265.         }
  266.         // line 86
  267.         echo "        </div>
  268.     </section>
  269.     <script>
  270.        document.addEventListener('DOMContentLoaded', function() {
  271.         const ateliers = document.querySelectorAll('.atelier');
  272.         const participationRadios = document.querySelectorAll('input[name=\"type\"]');
  273.         const totalDisplay = document.getElementById('total');
  274.         const form = document.getElementById('inscriptionForm');
  275.         const participationPrices = {
  276.             membre: 40,
  277.             nonMembre: 120,
  278.             resident: 40
  279.         };
  280.         function calculateTotal() {
  281.             let totalAteliers = 0;
  282.             let participationType = '';
  283.             ateliers.forEach(atelier => {
  284.                 if (atelier.checked) {
  285.                     totalAteliers++;
  286.                 }
  287.             });
  288.             participationRadios.forEach(radio => {
  289.                 if (radio.checked) {
  290.                     participationType = radio.value;
  291.                 }
  292.             });
  293.             const participationFee = participationPrices[participationType];
  294.             const total = totalAteliers * participationFee;
  295.             totalDisplay.textContent = total + ' DT';
  296.         }
  297.         // Validation avant soumission
  298.         form.addEventListener('submit', function(event) {
  299.             let selectedAtelier = false;
  300.             
  301.             ateliers.forEach(atelier => {
  302.                 if (atelier.checked) {
  303.                     selectedAtelier = true;
  304.                 }
  305.             });
  306.             if (!selectedAtelier) {
  307.                 event.preventDefault(); // Empêcher l'envoi du formulaire
  308.                 alert(\"Veuillez sélectionner au moins un atelier.\");
  309.             }
  310.         });
  311.         ateliers.forEach(atelier => {
  312.             atelier.addEventListener('change', calculateTotal);
  313.         });
  314.         participationRadios.forEach(radio => {
  315.             radio.addEventListener('change', calculateTotal);
  316.         });
  317.     });
  318.     
  319.     </script>
  320. ";
  321.         
  322.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  323.         
  324.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  325.     }
  326.     public function getTemplateName()
  327.     {
  328.         return "frontend/frontindex/atelierParticipant.html.twig";
  329.     }
  330.     public function isTraitable()
  331.     {
  332.         return false;
  333.     }
  334.     public function getDebugInfo()
  335.     {
  336.         return array (  281 => 86,  275 => 84,  266 => 79,  258 => 72,  249 => 66,  240 => 60,  233 => 56,  229 => 54,  221 => 51,  215 => 50,  203 => 49,  199 => 48,  195 => 47,  183 => 46,  180 => 45,  176 => 44,  172 => 43,  165 => 39,  158 => 35,  152 => 32,  148 => 31,  142 => 28,  138 => 27,  132 => 24,  129 => 23,  120 => 20,  117 => 19,  112 => 18,  103 => 15,  100 => 14,  96 => 13,  78 => 9,  74 => 7,  72 => 6,  68 => 4,  58 => 3,  35 => 1,);
  337.     }
  338.     public function getSourceContext()
  339.     {
  340.         return new Source("{% extends 'frontend/frontindex/add.html.twig' %}
  341. {% block body %}
  342. \t<section class=\"doctors-area doctor-page\">
  343. \t\t<div class=\"container\">
  344.             {% if congres.dateFin >= currentDate %}
  345.                 <div class=\"row\">
  346.                     <div class=\"col-md-12 text-center\">
  347.                         <a href=\"{{path('details_congres',{id:congres.id })}}\" class=\"text-dark\"><h1>{{'%Participation-atelier-du-congrès%'|trans}} : {% if app.request.locale =='fr' %} {{congres.label|raw}} {% elseif app.request.locale =='en' %}{{congres.labelEn|raw}} {% endif %}</h1></a>
  348.                     </div>
  349.                 </div>
  350.                 <div class=\"row\">
  351.                     {% for message in app.flashes('success') %}
  352.                         <div class=\"alert alert-success col-12 text-center\">
  353.                             {{ message }}
  354.                         </div>
  355.                     {% endfor %}
  356.                     {% for message in app.flashes('danger') %}
  357.                         <div class=\"alert alert-danger col-12 text-center\">
  358.                             {{ message }}
  359.                         </div>
  360.                     {% endfor %}
  361.                 </div>
  362.                 <form action=\"{{path('app_participation_atelier',{'id': congres.id})}}\" method=\"post\" enctype=\"multipart/form-data\" id=\"inscriptionForm\">
  363.                     <div class=\"row mb-5 mt-5\">
  364.                         <div class=\"form-group col-md-6\">
  365.                             <label for=\"nom\"><strong>{{'%nomAtelier%'|trans|capitalize}}</strong></label>
  366.                             <input class=\"form-control\" type=\"text\" placeholder=\"{{'%nomAtelier%'|trans}}\" required name=\"nom\">
  367.                         </div>
  368.                         <div class=\"form-group col-md-6\">
  369.                             <label for=\"prenom\"><strong>{{'%prenomAtelier%'|trans|capitalize}}</strong></label>
  370.                             <input class=\"form-control\" type=\"text\" placeholder=\"{{'%prenomAtelier%'|trans}}\" required name=\"prenom\">
  371.                         </div>
  372.                         <div class=\"form-group col-md-6\">
  373.                             <label for=\"email\"><strong>{{'%E-mail%'|trans|capitalize}}</strong></label>
  374.                             <input type=\"email\" class=\"form-control\" id=\"email\" placeholder=\"name@example.com\" name=\"email\">
  375.                         </div>
  376.                         <div class=\"form-group col-md-6\">
  377.                             <label for=\"tel\"><strong>{{'%Phone%'|trans|capitalize}}</strong></label>
  378.                             <input type=\"text\" class=\"form-control\" id=\"tel\" placeholder=\"+21612345678\" name=\"tel\">
  379.                         </div>
  380.                         <div class=\"form-group col-md-6\">
  381.                             <label for=\"atelier\"><strong>{{'%Choisissez-un-ou-plusieurs-ateliers%'|trans|capitalize}}</strong></label>
  382.                             {% for key, atelier in ateliers %}
  383.                                 <div class=\"form-check pt-2\">
  384.                                     <input class=\"form-check-input atelier\" type=\"checkbox\" value=\"{{atelier.id}}\" id=\"atelier{{atelier.id}}\" name=\"atelier{{atelier.id}}\" {% if atelier.nbPlaceAtteint == atelier.place %}disabled{% endif %}>
  385.                                     <label class=\"form-check-label\" for=\"atelier{{atelier.id}}\">
  386.                                         {{atelier.titre}} <br>
  387.                                         <i class=\"fa fa-calendar\"></i> {{atelier.date|date('Y-m-d')}} : <i class=\"fa fa-clock\"></i> {{atelier.heureDeb|date('H:i')}} - {{atelier.heureFin|date('H:i')}} <br><i class=\"fa fa-users\"></i> <strong> {{'%Animateur%'|trans}} : {{atelier.animateur}}</strong> 
  388.                                         {% if atelier.nbPlaceAtteint == atelier.place %}<strong class=\"text-danger\"> {{'%messageLimitePlaceAtelier%'|trans|capitalize}} </strong>{% endif %}
  389.                                     </label>
  390.                                 </div>
  391.                             {% endfor %}
  392.                         </div>
  393.                         <div class=\"form-group col-md-6\">
  394.                             <label for=\"type\"> <strong>{{'%Inscrivez-vous-en-tant-que%'|trans|capitalize}} : </strong></label>
  395.                             <div class=\"form-check\">
  396.                                 <input class=\"form-check-input\" type=\"radio\" name=\"type\" id=\"membre\" value=\"membre\" checked>
  397.                                 <label class=\"form-check-label\" for=\"type\">
  398.                                     {{'%membre%'|trans}} ATU 
  399.                                 </label>
  400.                             </div>
  401.                             <div class=\"form-check\">
  402.                                 <input class=\"form-check-input\" type=\"radio\" name=\"type\" id=\"nonMembre\" value=\"nonMembre\">
  403.                                 <label class=\"form-check-label\" for=\"type\">
  404.                                     {{'%nonmembre%'|trans}} ATU
  405.                                 </label>
  406.                             </div>
  407.                             <div class=\"form-check\">
  408.                                 <input class=\"form-check-input\" type=\"radio\" name=\"type\" id=\"resident\" value=\"resident\">
  409.                                 <label class=\"form-check-label\" for=\"type\">
  410.                                     {{'%Résident%'|trans}}
  411.                                 </label>
  412.                             </div>
  413.                         </div>
  414.                         <div class=\"form-group col-md-8 offset-md-2 text-center\">
  415.                             {# <h4 class=\"text-danger\"> <i class=\"fa fa-triangle-exclamation\"></i>  {{'%Total-à-payer%'|trans|capitalize}} : <span id=\"total\">0 DT</span></h4>
  416.                             <h4 class=\"text-danger\">{{'%to-be-paid-on-site-when-registering-for-the-congress%'|trans|capitalize}}</h4> #}
  417.                             <button type=\"submit\" value=\"Valider\" class=\"btn btn-outline-success btn-lg mt-3\">{{'%Valider%'|trans}}</button>
  418.                         </div>
  419.                     </div>
  420.                 </form>
  421.             {% else %}
  422.                 <h1 class=\"text-center\">{{'%congres-termine%'|trans}}</h1>
  423.             {% endif %}
  424.         </div>
  425.     </section>
  426.     <script>
  427.        document.addEventListener('DOMContentLoaded', function() {
  428.         const ateliers = document.querySelectorAll('.atelier');
  429.         const participationRadios = document.querySelectorAll('input[name=\"type\"]');
  430.         const totalDisplay = document.getElementById('total');
  431.         const form = document.getElementById('inscriptionForm');
  432.         const participationPrices = {
  433.             membre: 40,
  434.             nonMembre: 120,
  435.             resident: 40
  436.         };
  437.         function calculateTotal() {
  438.             let totalAteliers = 0;
  439.             let participationType = '';
  440.             ateliers.forEach(atelier => {
  441.                 if (atelier.checked) {
  442.                     totalAteliers++;
  443.                 }
  444.             });
  445.             participationRadios.forEach(radio => {
  446.                 if (radio.checked) {
  447.                     participationType = radio.value;
  448.                 }
  449.             });
  450.             const participationFee = participationPrices[participationType];
  451.             const total = totalAteliers * participationFee;
  452.             totalDisplay.textContent = total + ' DT';
  453.         }
  454.         // Validation avant soumission
  455.         form.addEventListener('submit', function(event) {
  456.             let selectedAtelier = false;
  457.             
  458.             ateliers.forEach(atelier => {
  459.                 if (atelier.checked) {
  460.                     selectedAtelier = true;
  461.                 }
  462.             });
  463.             if (!selectedAtelier) {
  464.                 event.preventDefault(); // Empêcher l'envoi du formulaire
  465.                 alert(\"Veuillez sélectionner au moins un atelier.\");
  466.             }
  467.         });
  468.         ateliers.forEach(atelier => {
  469.             atelier.addEventListener('change', calculateTotal);
  470.         });
  471.         participationRadios.forEach(radio => {
  472.             radio.addEventListener('change', calculateTotal);
  473.         });
  474.     });
  475.     
  476.     </script>
  477. {% endblock %}", "frontend/frontindex/atelierParticipant.html.twig", "/home/urotunisuz/www/templates/frontend/frontindex/atelierParticipant.html.twig");
  478.     }
  479. }