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

{% block stylesheet %}
    <link rel="stylesheet" href="{{asset('tablefilter/tablefilter.css')}}">
{% endblock %}


{% block javascripts %}
    <script src="{{asset('tablefilter/tablefilter.js') }}" type="text/javascript"></script>

    <script src="{{asset('js/misJs/ce/baseGExportar.js') }}" type="text/javascript"></script>

    <script data-config>
        var filtersConfig = {
            base_path: 'tablefilter/',
            filters_row_index: 1,
            highlight_keywords: true,
            col_0: 'NONE',
            col_2: 'select',
            col_3: 'select',
            col_4: 'select',
            col_5: 'select',
            col_6: '',
            col_7: 'select',
            col_8: 'select',
            col_9: 'select',
            col_10: 'select',
            col_11: 'select',
            col_12: 'select',
            clear_filter_text: '< Todos >',
            auto_filter: true,
            auto_filter_delay: 200, //milliseconds
            ignore_diacritics: true,
            load_filters_on_demand: true,
            responsive: true,
            loader: true,
            loader: {
                text: 'Cargando...'
            },
            status_bar: {
                target_id: 'toolBar'
            },
            rows_counter: {
                text: 'NUMERO DE REGISTROS: '
            },
            btn_reset: true,
            msg_filter: 'Filtrando...',
            alternate_rows: true,
            mark_active_columns: {
                highlight_column: true
            },
            /* SkyBlue theme */
            themes: [{name: 'skyblue'}],
            /*paging: {
             page_text: 'Página',
             of_text: ' de ',
             toolbar_position: 'left',
             results_per_page: ['Filas: ', [5, 10, 15, 20]],
             btn_next_page_text: 'Siguiente >',
             btn_prev_page_text: '< Anterior',
             btn_last_page_text: 'Última página >>',
             btn_first_page_text: '<< Primera página'
             },*/

        };
        var tf = new TableFilter('tb-estadisticas', filtersConfig, 1);
        tf.init();

        $(document).ready(function () {
            $('[data-toggle="tooltip"]').tooltip();
        });

    </script>
{% endblock %}


{% block content %}
    <div class="row">
        <div class="col-lg-4">
            <label class="title col-md-1">ESTADÍSTICAS</label>
        </div>
        <div class="col-lg-4">
            <select class="form-control form-control-sm" id="opcExport" name="opcExport">
                <option value="default" selected="true">Selecciona</option>
                <option value="1">Documentos</option>
                <option value="2">Calificaciones</option>
            </select>
        </div>
        <div class="col-lg-4">
            <a class="btn btn-sm btn-danger" id="btnExportar" onclick="generarExportar('{{ path('exportar_se') }}');">
                <i class="fa fa-download fw"></i> Exportar
            </a>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12" id="toolBar">
        </div>
        <div class="col-lg-12">
            <div class="table-responsive">
                <table class="table table-bordered table-striped table-condensed table-utm table-sobre" style="font-size: xx-small;" id="tb-estadisticas">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>ALUMNO</th>
                            <th>NIVEL</th>
                            <th>ESPECIALIDAD</th>
                            <th>GRADO</th>
                            <th>PLANTEL</th>
                            <th>EDAD</th>
                            <th>GÉNERO</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for a in alumnos %}
                            <tr>
                                <td>{{ loop.index }}</td>
                                <td>{{ a[0].apePat }} {{ a[0].apeMat }} {{ a[0].nomAlu }}</td>
                                {% if a[0].cveLic != null %}
                                    <td>{{ a[0].cveLic.cveNivAca.nombre }}</td>
                                    <td>{{ a[0].cveLic.nomLic }}</td>
                                {% else %}
                                    <td style="color: red;">NO TIENE |°0°|</td>
                                    <td style="color: red;">----</td>
                                {% endif %}
                                <td class="text-center">{{ a[0].numero }}°</td>
                                {% if a[0].cvePla != null %}
                                    <td>{{ a[0].cvePla.nomPla }}</td>
                                {% else %}
                                    <td style="color: red;">----</td>
                                {% endif %}
                                <td>{{ a[0].edad }}</td>
                                <td>
                                    {% if a[0].sexo == 1 %}
                                        MUJER
                                    {% elseif a[0].sexo == 0 %}
                                        HOMBRE
                                    {% else %}
                                        ERROR
                                    {% endif %}
                                </td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
{% endblock %}