{% extends 'CmBundle:Z:baseDos.html.twig' %}

{% block stylesheet %}
    <!-- Bootstrap Core CSS -->
    <link href="{{asset('vendor/bootstrap/css/bootstrap.min.css')}}" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="{{asset('vendor/metisMenu/metisMenu.min.css')}}" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="{{asset('dist/css/sb-admin-2.css')}}" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="{{asset('vendor/font-awesome/css/font-awesome.min.css')}}" rel="stylesheet" type="text/css">
{% endblock %}

{% block javascripts %}
    <!-- jQuery -->
    <script src="{{asset('vendor/jquery/jquery.min.js')}}"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="{{asset('vendor/bootstrap/js/bootstrap.min.js')}}"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="{{asset('vendor/metisMenu/metisMenu.min.js')}}"></script>

    <!-- Custom Theme JavaScript -->
    <script src="{{asset('dist/js/sb-admin-2.js')}}"></script>

    <script src="{{asset('js/misJs/alumno.js')}}"></script>
    
    <script src="{{asset('js/misJs/alumnoCaja.js')}}"></script>
{% endblock %}

{% block content %}
    <div class="row">
        <h3 class="text-center">ALUMNOS</h3>
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <h3 class="text-center">{% set t =  alumnos | length%}
            TOTAL ALUMNOS : {{t}}
            {% set b = 0 %}
            {% for a in alumnos %}
                {% if a.modoPago == 1 %}
                    {% set b = b+1 %}
                {% endif %}
            {% endfor %}
            TOTAL ALUMNOS CAJA : {{b}}
            PORCENTAJE: {{( (b*100) / t ) | number_format(2,".",",") }}%</h3>
        </div>
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <table class="table table-condensed table-hover table-striped" style="font-size: smaller;">
                <thead>
                    <tr>
                        <th>No.</th>
                        <th>CVE. CONTROL</th>
                        <th>APELLIDO PATERNO</th>
                        <th>APELLIDO MATERNO</th>
                        <th>NOMBRE DEL ALUMNO</th>
                        <th>MODO DE PAGO</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    {% if alumnos is defined %}
                        {% for a in alumnos %}

                            <tr>

                                <td>{{loop.index}}</td>
                                <td>{{a.cveCtl}}</td>
                                <td>{{a.apePat}}</td>
                                <td>{{a.apeMat}}</td>
                                <td>{{a.nomAlu}}</td>
                                {% if a.modoPago == 1 %}
                                    <td style="background-color: lightgreen;">
                                    {% else %}
                                    <td>
                                    {% endif %}
                                    <select id="modPag{{a.ideAlu}}" class="form-control pago">
                                        {% if a.modoPago == 0 %}
                                            <option value="0" selected="true">BANCO</option>
                                            <option value="1">CAJA</option>
                                        {% else %}
                                            <option value="0">BANCO</option>
                                            <option value="1" selected="true">CAJA</option>
                                        {% endif %}
                                    </select>
                                </td>
                                <td>
                                    <form class="form-horizontal" action="{{path('caja_alumnos',{ideAlu : a.ideAlu })}}" method="POST">
                                        <input type="hidden" id="mod{{a.ideAlu}}" name="mod{{a.ideAlu}}" value="{{a.modoPago}}">
                                        <input type="submit" value="ACTUALIZAR" class="btn btn-info btn-sm">
                                    </form>
                                </td>
                            </tr>


                        {% endfor %}
                    {% endif %}

                </tbody>
            </table>
        </div>
    </div>

{% endblock %}