<div class="col-lg-12 p-4">
    <a class="btn btn-primary btn-sm" href="#" target="">
        EXPORTAR
    </a>
    <a class="btn btn-primary btn-sm" href="{{ path('formatos_oficios_cierre_matriculacion') }}"
       target="_blank">
        <b>OFICIO DE MATRICULACIÓN</b>
    </a>
</div>
<div class="col-lg-12 table-responsive text-center" id="contenedor-resultados">

    <table class="table table-bordered table-condensed small">
        <thead>
        <tr>
            <th style="background-color: rgb(237,125,49);vertical-align: middle;" class="text-center">CUA.</th>
            {% if cuadroZ | length > 0 %}
                {% for x in cuadroZ[0] %}
                    <th style="background-color: rgb(0,32,96);color: white;font-size: xx-small;vertical-align: middle;"
                        class="text-center">
                        {# <p class="verticalText">{{x}}</p> #}
                        {{ x[0] }}
                        {#
                        {{x[1]}}
                        #}
                    </th>
                {% endfor %}
            {% endif %}
            <th style="background-color: rgb(146,208,80);vertical-align: middle;" class="text-center">TOTAL</th>
        </tr>
        </thead>
        <tbody>
        {% set sumFilas = 0 %}
        {% for key, x in cuadroZ %}
            {% if key > 0 %}
                {% set sumaFila = 0 %}

                <tr>
                    <td style="background-color: rgb(0,32,96);color: white;" class="text-center">
                        {{ loop.index-1 }}°
                    </td>
                    {% for y in x %}
                        <td style="background-color: white;font-weight: bolder;text-align: center;color: #006600;">
                            {% if y[0] != 0 %}
                                {#
                                T={{y[0]}}||
                                id={{y[1]}}||
                                C={{y[2]}}°||
                                IdePla={{y[3]}}
                                #}

                                <input type="button" class="btn btn-primary btn-xs" value="{{ y[0] }}"
                                       data-toggle="modal" data-target="#myModal"
                                       onclick="listarAlumnos({{ y[1] }},{{ y[2] }} ,{{ y[3] }} );">
                            {% endif %}
                        </td>
                        {% set sumaFila = (sumaFila + y[0]) %}
                    {% endfor %}
                    <td style="background-color: rgb(237,125,49);text-align: center;font-weight: bolder;">
                        {{ sumaFila }}
                        {% set sumFilas = sumFilas + sumaFila %}
                    </td>
                </tr>
            {% endif %}
        {% endfor %}
        <tr>
            <td style="background-color: rgb(0,32,96);color: white;vertical-align: middle;" class="text-center">
                <b>TOTAL</b>
            </td>
            {% for sc in columnas %}
                <td style="background-color: rgb(237,125,49);" class="text-center">
                    <b>{{ sc }}</b>
                </td>
            {% endfor %}
            <td style="background-color: rgb(0,32,96);"></td>
        </tr>
        <tr>
            <td style="background-color: rgb(146,208,80);color: white;vertical-align: middle;" class="text-center">
                TOTAL
            </td>
            {% if cuadroZ | length > 0 %}
                {% set colum = cuadroZ[0] | length %}
                <td colspan="{{ colum+1 }}" class="text-center" style="background-color: rgb(146,208,80);color: white;">
                    <h4 style="margin: 0;"><b>{{ sumFilas }}</b></h4>
                </td>
            {% endif %}
        </tr>
        </tbody>
    </table>
</div><!-- FIN col-12 -->