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

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

{% block javascripts %}
    <script src="{{ asset('js/tablefilter/tablefilter.js') }}" type="text/javascript"></script>
    <script data-config>
        var filtersConfig = {
            base_path: 'tablefilter/',
            filters_row_index: 1,
            highlight_keywords: true,
            col_0: 'NONE',
            col_3: 'select',
            col_4: 'select',
            col_5: 'select',
            col_6: 'NONE',
            col_7: 'NONE',
            col_8: 'select',
            col_9: 'NONE',
            col_10: 'NONE',
            clear_filter_text: '< Todos >',
            auto_filter: true,
            auto_filter_delay: 200, //milliseconds
            responsive: true,
            toolbar: {
                target_id: 'externalToolbar'
            },
            rows_counter: {
                text: 'Filas: '
            },
            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: ', [50]],
            //     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('tabla', filtersConfig, 1);
        tf.init();

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

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


    <script src="{{ asset('js/jsxlsx/FileSaver.min.js') }}"></script>
    <script src="{{ asset('js/jsxlsx/xlsx.full.min.js') }}"></script>
    <script src="{{ asset('js/jsxlsx/tableexport.min.js') }}"></script>
    <script src="{{ asset('js/jsxlsx/script.js') }}"></script>

{% endblock %}

{% block content %}
    <div class="container-fluid">
        {% set tipoUsuario = app.session.get('rol') %}
        <div class="row">
            <div class="col-lg-6">
                <h1 class="mt-4">ALUMNOS PREINSCRITOS</h1>
            </div>
            <div class="col-lg-6">
                <button id="btnExportar" class="btn btn-info btn-sm pull-right">Exportar</button>
                <input type="hidden" id="nomArchivo" name="nomArchivo" value="preinscritos">
                <input type="hidden" id="nombre-tabla" value="Preinscritos Ceepam">
            </div>
        </div><!-- FIN row -->
        <ol class="breadcrumb mb-2">
            <li class="breadcrumb-item"><a href="{{ path('cm_homepage') }}">Tablero</a></li>
            <li class="breadcrumb-item active">BPRE</li>
        </ol>

        <div class="row">

            <div class="col-lg-12">
                <div id="externalToolbar">
                </div>
            </div>


            <div class="col-lg-12 table-responsive">
                <table style="font-size: xx-small;" id="tabla">
                    <thead>
                    <tr>
                        <th>No.</th>
                        <th>CVE</th>
                        <th>NOMBRE</th>
                        <th>NIVEL</th>
                        <th>ESPECIALIDAD</th>
                        <th>PLANTEL</th>
                        {% if tipoUsuario == 333 %}
                            <th>ESTATUS</th>
                        {% else %}
                        {% endif %}
                        <th>*</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% if alumnos is defined %}
                        {% for a in alumnos %}
                            <tr>
                                <td>{{ loop.index }}</td>
                                <td>
                                    <a href="{{ path('consulta_alumno_dos', {ideAlu: a.ideAlu} ) }}"
                                       target="_blank">{{ a.cveCtl }}</a>
                                </td>
                                <td>{{ a.apePat }} {{ a.apeMat }} {{ a.nomAlu }}</td>
                                <td>
                                    {% if a.cveLic != null %}
                                        {{ a.cveLic.cveNivAca.nombre }}
                                    {% else %}
                                        <b style="color: red;">SIN DATO</b>
                                    {% endif %}
                                </td>
                                <td>
                                    {% if a.cveLic != null %}
                                        {{ a.cveLic.nomLic }}
                                    {% else %}
                                        <b style="color: red;">SIN DATO</b>
                                    {% endif %}
                                </td>
                                <td>
                                    {{ a.cvePla.nomPla }}
                                </td>
                                {% if tipoUsuario == 333 %}
                                    <td>
                                        <select class="form-control form-control-sm" id="ideEst_{{ a.ideAlu }}"
                                                name="ideEst_{{ a.ideAlu }}" onchange="cambiarEstatus({{ a.ideAlu }});">
                                            {% for e in estatus %}
                                                {% if a.estatus.ideEst == e.ideEst %}
                                                    <option value="{{ e.ideEst }}"
                                                            selected="true">{{ e.desEst }}</option>
                                                {% else %}
                                                    <option value="{{ e.ideEst }}">{{ e.desEst }}</option>
                                                {% endif %}

                                            {% endfor %}
                                        </select>

                                    </td>
                                {% else %}
                                {% endif %}
                                <td id="fila_{{ a.ideAlu }}">
                                </td>
                            </tr>
                        {% endfor %}
                    {% endif %}
                    </tbody>
                </table>


            </div><!-- FIN col-lg-12 -->
        </div><!-- FIN row -->
    </div><!-- FIN container-fluid -->

{% endblock %}
