<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* frontend/frontindex/atelierParticipant.html.twig */
class __TwigTemplate_bc934c675a12dd1552588495341e2e42855e2839d2bfd595778f6e49711d4f7f extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'body' => [$this, 'block_body'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "frontend/frontindex/add.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "frontend/frontindex/atelierParticipant.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "frontend/frontindex/atelierParticipant.html.twig"));
$this->parent = $this->loadTemplate("frontend/frontindex/add.html.twig", "frontend/frontindex/atelierParticipant.html.twig", 1);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
// line 3
public function block_body($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
// line 4
echo "\t<section class=\"doctors-area doctor-page\">
\t\t<div class=\"container\">
";
// line 6
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); })())))) {
// line 7
echo " <div class=\"row\">
<div class=\"col-md-12 text-center\">
<a href=\"";
// line 9
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);
echo "\" class=\"text-dark\"><h1>";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%Participation-atelier-du-congrès%"), "html", null, true);
echo " : ";
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"))) {
echo " ";
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);
echo " ";
} 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"))) {
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);
echo " ";
}
echo "</h1></a>
</div>
</div>
<div class=\"row\">
";
// line 13
$context['_parent'] = $context;
$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));
foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
// line 14
echo " <div class=\"alert alert-success col-12 text-center\">
";
// line 15
echo twig_escape_filter($this->env, $context["message"], "html", null, true);
echo "
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 18
echo " ";
$context['_parent'] = $context;
$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));
foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
// line 19
echo " <div class=\"alert alert-danger col-12 text-center\">
";
// line 20
echo twig_escape_filter($this->env, $context["message"], "html", null, true);
echo "
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 23
echo " </div>
<form action=\"";
// line 24
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);
echo "\" method=\"post\" enctype=\"multipart/form-data\" id=\"inscriptionForm\">
<div class=\"row mb-5 mt-5\">
<div class=\"form-group col-md-6\">
<label for=\"nom\"><strong>";
// line 27
echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%nomAtelier%")), "html", null, true);
echo "</strong></label>
<input class=\"form-control\" type=\"text\" placeholder=\"";
// line 28
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%nomAtelier%"), "html", null, true);
echo "\" required name=\"nom\">
</div>
<div class=\"form-group col-md-6\">
<label for=\"prenom\"><strong>";
// line 31
echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%prenomAtelier%")), "html", null, true);
echo "</strong></label>
<input class=\"form-control\" type=\"text\" placeholder=\"";
// line 32
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%prenomAtelier%"), "html", null, true);
echo "\" required name=\"prenom\">
</div>
<div class=\"form-group col-md-6\">
<label for=\"email\"><strong>";
// line 35
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);
echo "</strong></label>
<input type=\"email\" class=\"form-control\" id=\"email\" placeholder=\"name@example.com\" name=\"email\">
</div>
<div class=\"form-group col-md-6\">
<label for=\"tel\"><strong>";
// line 39
echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%Phone%")), "html", null, true);
echo "</strong></label>
<input type=\"text\" class=\"form-control\" id=\"tel\" placeholder=\"+21612345678\" name=\"tel\">
</div>
<div class=\"form-group col-md-6\">
<label for=\"atelier\"><strong>";
// line 43
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);
echo "</strong></label>
";
// line 44
$context['_parent'] = $context;
$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); })()));
foreach ($context['_seq'] as $context["key"] => $context["atelier"]) {
// line 45
echo " <div class=\"form-check pt-2\">
<input class=\"form-check-input atelier\" type=\"checkbox\" value=\"";
// line 46
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "id", [], "any", false, false, false, 46), "html", null, true);
echo "\" id=\"atelier";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "id", [], "any", false, false, false, 46), "html", null, true);
echo "\" name=\"atelier";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "id", [], "any", false, false, false, 46), "html", null, true);
echo "\" ";
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)))) {
echo "disabled";
}
echo ">
<label class=\"form-check-label\" for=\"atelier";
// line 47
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "id", [], "any", false, false, false, 47), "html", null, true);
echo "\">
";
// line 48
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "titre", [], "any", false, false, false, 48), "html", null, true);
echo " <br>
<i class=\"fa fa-calendar\"></i> ";
// line 49
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);
echo " : <i class=\"fa fa-clock\"></i> ";
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);
echo " - ";
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);
echo " <br><i class=\"fa fa-users\"></i> <strong> ";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%Animateur%"), "html", null, true);
echo " : ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["atelier"], "animateur", [], "any", false, false, false, 49), "html", null, true);
echo "</strong>
";
// line 50
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)))) {
echo "<strong class=\"text-danger\"> ";
echo twig_escape_filter($this->env, twig_capitalize_string_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%messageLimitePlaceAtelier%")), "html", null, true);
echo " </strong>";
}
// line 51
echo " </label>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['key'], $context['atelier'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 54
echo " </div>
<div class=\"form-group col-md-6\">
<label for=\"type\"> <strong>";
// line 56
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);
echo " : </strong></label>
<div class=\"form-check\">
<input class=\"form-check-input\" type=\"radio\" name=\"type\" id=\"membre\" value=\"membre\" checked>
<label class=\"form-check-label\" for=\"type\">
";
// line 60
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%membre%"), "html", null, true);
echo " ATU
</label>
</div>
<div class=\"form-check\">
<input class=\"form-check-input\" type=\"radio\" name=\"type\" id=\"nonMembre\" value=\"nonMembre\">
<label class=\"form-check-label\" for=\"type\">
";
// line 66
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%nonmembre%"), "html", null, true);
echo " ATU
</label>
</div>
<div class=\"form-check\">
<input class=\"form-check-input\" type=\"radio\" name=\"type\" id=\"resident\" value=\"resident\">
<label class=\"form-check-label\" for=\"type\">
";
// line 72
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%Résident%"), "html", null, true);
echo "
</label>
</div>
</div>
<div class=\"form-group col-md-8 offset-md-2 text-center\">
";
// line 79
echo " <button type=\"submit\" value=\"Valider\" class=\"btn btn-outline-success btn-lg mt-3\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%Valider%"), "html", null, true);
echo "</button>
</div>
</div>
</form>
";
} else {
// line 84
echo " <h1 class=\"text-center\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("%congres-termine%"), "html", null, true);
echo "</h1>
";
}
// line 86
echo " </div>
</section>
<script>
document.addEventListener('DOMContentLoaded', function() {
const ateliers = document.querySelectorAll('.atelier');
const participationRadios = document.querySelectorAll('input[name=\"type\"]');
const totalDisplay = document.getElementById('total');
const form = document.getElementById('inscriptionForm');
const participationPrices = {
membre: 40,
nonMembre: 120,
resident: 40
};
function calculateTotal() {
let totalAteliers = 0;
let participationType = '';
ateliers.forEach(atelier => {
if (atelier.checked) {
totalAteliers++;
}
});
participationRadios.forEach(radio => {
if (radio.checked) {
participationType = radio.value;
}
});
const participationFee = participationPrices[participationType];
const total = totalAteliers * participationFee;
totalDisplay.textContent = total + ' DT';
}
// Validation avant soumission
form.addEventListener('submit', function(event) {
let selectedAtelier = false;
ateliers.forEach(atelier => {
if (atelier.checked) {
selectedAtelier = true;
}
});
if (!selectedAtelier) {
event.preventDefault(); // Empêcher l'envoi du formulaire
alert(\"Veuillez sélectionner au moins un atelier.\");
}
});
ateliers.forEach(atelier => {
atelier.addEventListener('change', calculateTotal);
});
participationRadios.forEach(radio => {
radio.addEventListener('change', calculateTotal);
});
});
</script>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
public function getTemplateName()
{
return "frontend/frontindex/atelierParticipant.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
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,);
}
public function getSourceContext()
{
return new Source("{% extends 'frontend/frontindex/add.html.twig' %}
{% block body %}
\t<section class=\"doctors-area doctor-page\">
\t\t<div class=\"container\">
{% if congres.dateFin >= currentDate %}
<div class=\"row\">
<div class=\"col-md-12 text-center\">
<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>
</div>
</div>
<div class=\"row\">
{% for message in app.flashes('success') %}
<div class=\"alert alert-success col-12 text-center\">
{{ message }}
</div>
{% endfor %}
{% for message in app.flashes('danger') %}
<div class=\"alert alert-danger col-12 text-center\">
{{ message }}
</div>
{% endfor %}
</div>
<form action=\"{{path('app_participation_atelier',{'id': congres.id})}}\" method=\"post\" enctype=\"multipart/form-data\" id=\"inscriptionForm\">
<div class=\"row mb-5 mt-5\">
<div class=\"form-group col-md-6\">
<label for=\"nom\"><strong>{{'%nomAtelier%'|trans|capitalize}}</strong></label>
<input class=\"form-control\" type=\"text\" placeholder=\"{{'%nomAtelier%'|trans}}\" required name=\"nom\">
</div>
<div class=\"form-group col-md-6\">
<label for=\"prenom\"><strong>{{'%prenomAtelier%'|trans|capitalize}}</strong></label>
<input class=\"form-control\" type=\"text\" placeholder=\"{{'%prenomAtelier%'|trans}}\" required name=\"prenom\">
</div>
<div class=\"form-group col-md-6\">
<label for=\"email\"><strong>{{'%E-mail%'|trans|capitalize}}</strong></label>
<input type=\"email\" class=\"form-control\" id=\"email\" placeholder=\"name@example.com\" name=\"email\">
</div>
<div class=\"form-group col-md-6\">
<label for=\"tel\"><strong>{{'%Phone%'|trans|capitalize}}</strong></label>
<input type=\"text\" class=\"form-control\" id=\"tel\" placeholder=\"+21612345678\" name=\"tel\">
</div>
<div class=\"form-group col-md-6\">
<label for=\"atelier\"><strong>{{'%Choisissez-un-ou-plusieurs-ateliers%'|trans|capitalize}}</strong></label>
{% for key, atelier in ateliers %}
<div class=\"form-check pt-2\">
<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 %}>
<label class=\"form-check-label\" for=\"atelier{{atelier.id}}\">
{{atelier.titre}} <br>
<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>
{% if atelier.nbPlaceAtteint == atelier.place %}<strong class=\"text-danger\"> {{'%messageLimitePlaceAtelier%'|trans|capitalize}} </strong>{% endif %}
</label>
</div>
{% endfor %}
</div>
<div class=\"form-group col-md-6\">
<label for=\"type\"> <strong>{{'%Inscrivez-vous-en-tant-que%'|trans|capitalize}} : </strong></label>
<div class=\"form-check\">
<input class=\"form-check-input\" type=\"radio\" name=\"type\" id=\"membre\" value=\"membre\" checked>
<label class=\"form-check-label\" for=\"type\">
{{'%membre%'|trans}} ATU
</label>
</div>
<div class=\"form-check\">
<input class=\"form-check-input\" type=\"radio\" name=\"type\" id=\"nonMembre\" value=\"nonMembre\">
<label class=\"form-check-label\" for=\"type\">
{{'%nonmembre%'|trans}} ATU
</label>
</div>
<div class=\"form-check\">
<input class=\"form-check-input\" type=\"radio\" name=\"type\" id=\"resident\" value=\"resident\">
<label class=\"form-check-label\" for=\"type\">
{{'%Résident%'|trans}}
</label>
</div>
</div>
<div class=\"form-group col-md-8 offset-md-2 text-center\">
{# <h4 class=\"text-danger\"> <i class=\"fa fa-triangle-exclamation\"></i> {{'%Total-à-payer%'|trans|capitalize}} : <span id=\"total\">0 DT</span></h4>
<h4 class=\"text-danger\">{{'%to-be-paid-on-site-when-registering-for-the-congress%'|trans|capitalize}}</h4> #}
<button type=\"submit\" value=\"Valider\" class=\"btn btn-outline-success btn-lg mt-3\">{{'%Valider%'|trans}}</button>
</div>
</div>
</form>
{% else %}
<h1 class=\"text-center\">{{'%congres-termine%'|trans}}</h1>
{% endif %}
</div>
</section>
<script>
document.addEventListener('DOMContentLoaded', function() {
const ateliers = document.querySelectorAll('.atelier');
const participationRadios = document.querySelectorAll('input[name=\"type\"]');
const totalDisplay = document.getElementById('total');
const form = document.getElementById('inscriptionForm');
const participationPrices = {
membre: 40,
nonMembre: 120,
resident: 40
};
function calculateTotal() {
let totalAteliers = 0;
let participationType = '';
ateliers.forEach(atelier => {
if (atelier.checked) {
totalAteliers++;
}
});
participationRadios.forEach(radio => {
if (radio.checked) {
participationType = radio.value;
}
});
const participationFee = participationPrices[participationType];
const total = totalAteliers * participationFee;
totalDisplay.textContent = total + ' DT';
}
// Validation avant soumission
form.addEventListener('submit', function(event) {
let selectedAtelier = false;
ateliers.forEach(atelier => {
if (atelier.checked) {
selectedAtelier = true;
}
});
if (!selectedAtelier) {
event.preventDefault(); // Empêcher l'envoi du formulaire
alert(\"Veuillez sélectionner au moins un atelier.\");
}
});
ateliers.forEach(atelier => {
atelier.addEventListener('change', calculateTotal);
});
participationRadios.forEach(radio => {
radio.addEventListener('change', calculateTotal);
});
});
</script>
{% endblock %}", "frontend/frontindex/atelierParticipant.html.twig", "/home/urotunisuz/www/templates/frontend/frontindex/atelierParticipant.html.twig");
}
}