{{ include('classroom/partials/header.html.twig') }}

{% if (rooms|length > 1) %} Repartition des eleves de l'etablissement selon les tranches d'ages et leur sexe {% else %} {% if(rooms[0].level.cycle.section.name=="Francophone") %} Repartition des eleves de {{rooms[0].name}} selon les tranches d'ages et leur sexe {% else %} Distribution of students according to their gender {% endif %} {% endif %}

{% if ((rooms|length > 1) or (rooms[0].level.cycle.section.name=="Francophone")) %} ANNEE SCOLAIRE   : {{ year }} {% else %} {{ year }}   SCHOOL YEAR : {% endif %}
{% set effectifPerAge = [] %} {% set effectifMascPerAge = [] %} {% set effectifFemPerAge = [] %} {% for age in minAge .. maxAge %} {% set effectifPerAge = effectifPerAge|merge({ (age ~ "ans") : 0 }) %} {% set effectifMascPerAge = effectifMascPerAge|merge({ (age ~ "ans") : 0 }) %} {% set effectifFemPerAge = effectifFemPerAge|merge({ (age ~ "ans") : 0 }) %} {% endfor %} {% for age in minAge .. maxAge %} {% endfor %} {% for index,roomData in age_group_gender_datas %} {% set roomTotal = 0 %} {% for age in minAge .. maxAge %} {% set total = 0 %} {% endfor %} {% for triplet in roomData %} {% set effectifPerAge = effectifPerAge|merge({ (triplet["age"] ~ "ans") : (attribute(effectifPerAge,(triplet["age"] ~ "ans")) + triplet["poids"]) }) %} {% if( triplet["sexe"]=="1" ) %} {% set effectifFemPerAge = effectifFemPerAge|merge({ (triplet["age"] ~ "ans") : (attribute(effectifFemPerAge,(triplet["age"] ~ "ans")) + triplet["poids"]) }) %} {% else %} {% set effectifMascPerAge = effectifMascPerAge|merge({ (triplet["age"] ~ "ans") : (attribute(effectifMascPerAge,(triplet["age"] ~ "ans")) + triplet["poids"]) }) %} {% endif %} {% endfor %} {% endfor %} {% for age in minAge .. maxAge %} {% endfor %}
CLASSES
{{age ~ "ans"}} EFFECTIF
M F T
{{roomNames[index]}} {% for triplet in roomData %} {% if( age == triplet["age"] and triplet["sexe"]=="0" ) %} {{triplet["poids"]}} {% set total = total + triplet["poids"] %} {% endif %} {% endfor %} {% for triplet in roomData %} {% if( age == triplet["age"] and triplet["sexe"]=="1" ) %} {{triplet["poids"]}} {% set total = total + triplet["poids"] %} {% endif %} {% endfor %} {{total}} {% set roomTotal = roomTotal + total %} {{roomTotal}}
TOTAL {{attribute(effectifMascPerAge,(age ~ "ans"))}} {{attribute(effectifFemPerAge,(age ~ "ans"))}} {{attribute(effectifPerAge,(age ~ "ans"))}}