<html>
    <head>
        <!-- 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">

    </head>
    <body style="background-color: white;">
        <div id="mensualidad" class="panel panel-default col-lg-6 col-md-6 col-sm-6 col-xs-12">
            <div class="col-lg-12">
                <h3>PLANTEL {{chart[7].nomPla}}</h3>
                <h3>CIERRE DEL MES DE {{nomMes}}</h3>
            </div>
            <div class="col-xs-12">
                <div class="col-xs-6">
                    TOTAL DE ALUMNOS
                </div>
                <div class="col-xs-6">
                    {{chart[1]}}
                </div>
            </div>
            <div class="col-xs-12" style="background-color: #7DFE8B;">
                <div class="col-xs-6">
                    PAGADOS AL CORTE
                </div>
                <div class="col-xs-6">
                    {{chart[2][0]}}
                </div>
            </div>
            <div class="col-xs-12" style="background-color: #FFAF6E;">
                <div class="col-xs-6">
                    FALTANTES POR PAGAR
                </div>
                <div class="col-xs-6">
                    {{chart[3][0]}}
                </div>
            </div>
            <div class="col-xs-12" style="background-color: #DDDF00;">
                <div class="col-xs-6">
                    NO PAGAN
                </div>
                <div class="col-xs-6">
                    {{chart[4]}}
                </div>
            </div>
            <div class="col-xs-12">
                <div class="col-xs-6">
                    TOTAL DE INGRESOS TOTAL
                </div>
                <div class="col-xs-6">
                    $ {{ (chart[5][0]['SumaTotal'] + chart[6][0]['SumaTotal']) | number_format(2,".",",")}}
                </div>
            </div>
            <div class="col-xs-12" style="border: solid 2px #006000;vertical-align: middle;">
                <div class="col-xs-6">
                    TOTAL DE INGRESOS AL CORTE
                </div>
                <div class="col-xs-6" style="vertical-align: middle;">
                    $ {{chart[5][0]['SumaTotal'] | number_format(2,".",",")}}
                </div>
            </div>
            <div class="row">
                <div class="col-xs-12">
                    <div class="col-xs-6">
                        RESTAN
                    </div>
                    <div class="col-xs-6">
                        $ {{chart[6][0]['SumaTotal'] | number_format(2,".",",")}}
                    </div>
                </div>
            </div>

        </div>
        <div id="cierreMensualidad" class="panel panel-default col-lg-6 col-md-6 col-sm-6 col-xs-12">
        </div>
        <div class="col-lg-12 table-responsive">
            <table class="table table-bordered table-condensed table-hover table-striped" style="font-size: smaller;">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>CVE CTL</th>
                        <th>NOMBRE</th>
                        <th>ESTATUS</th>
                        <th>NIVEL</th>
                        <th>ESPECIALIDAD</th>
                        <th>GRADO</th>
                        <th>INSCRIPCIÓN</th>
                        <th>COLEGIATURA</th>
                        <th>REINSCRIPCIÓN</th>
                        <th>PAGA</th>
                    </tr>
                </thead>
                <tbody>
                    {% set tipoUsuario = app.session.get('rol') %}
                    {% set alumnosNoActivos = 0 %}
                    {% for c in chart[8] %}
                        <tr>
                            <td>{{loop.index}}</td>
                            <td>
                                {{c.cveCtl}}
                                {% if tipoUsuario == 3 %}
                                    <a href="{{path('vista_pago',{cveCtl:c.cveCtl})}}" class="btn btn-xs btn-success" target="_blank" data-toggle="tooltip" title="Ir a Caja..." data-placement="right">$</a>
                                {% endif %}
                            </td>
                            <td>{{c.apePat}} {{c.apeMat}} <i style="font-weight: bolder;">{{c.nomAlu}}</i></td>
                                {% if c.estatus.cveEst != 'AA' %}
                                    {% set alumnosNoActivos = alumnosNoActivos + 1 %}
                                <td style="background-color: red;color: white;">
                                    {{c.estatus.desEst}}
                                </td>
                            {% else %}
                                <td>
                                    {{c.estatus.desEst}}
                                </td>
                            {% endif %}
                            <td>
                                {% if c.tipoAlumno == 1 %}
                                    BACHILLERATO ESCOLARIZADO
                                {% elseif c.tipoAlumno == 2 %}
                                    EXAMEN ÚNICO
                                {% elseif c.tipoAlumno == 3 %}
                                    LICENCIATURA
                                {% elseif c.tipoAlumno == 4 %}
                                    MAESTRÍA
                                {% elseif c.tipoAlumno == 5 %}
                                    DOCTORADO
                                {% elseif c.tipoAlumno == 6 %}
                                    NO DEBE DE EXISTIR
                                {% else %}
                                    INDETERMINADO / NO ASIGNADO
                                {% endif %}
                            </td>
                            {% if c.cveLic is null %}
                                <td style="background-color: red;color: white;">
                                    ES NULLO
                                </td>
                            {% else %}
                                <td>
                                    {{c.cveLic.nomLic}}
                                </td>
                            {% endif %}

                            <td>{{c.numero}}</td>
                            <td>${{c.costoInscripcion | number_format(2,".",",") }}</td>
                            {% if c.costoMensualidad ==0 %}
                                <td style="background-color: red;">${{c.costoMensualidad | number_format(2,".",",") }}</td>
                            {% else %}
                                <td>${{c.costoMensualidad | number_format(2,".",",") }}</td>
                            {% endif %}
                            <td>${{c.costoReinscripciones | number_format(2,".",",") }}</td>
                            {% if c.paga == 0 %}
                                <td style="background-color: red;">NO</td>
                            {% elseif c.paga == -1 %}
                                <td style="background-color: yellow;">NO SE SABE</td>
                            {% else %}
                                <td>SI</td>
                            {% endif %}
                        </tr>
                    {% else %}
                        <tr>
                            <td colspan="7">NO HAY REGISTROS</td>
                        </tr>
                    {% endfor %}
                    <tr>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td>{{alumnosNoActivos}}</td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                </tbody>
            </table>
        </div>


        <!-- 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/highcharts.js')}}"></script>
        <script src="{{asset('js/highcharts-3d.js')}}"></script>
        <script src="{{asset('js/modules/exporting.js')}}"></script>
        <script type="text/javascript">
            {{ chart(chart[0]) }}
            {#{{ chart(chart2) }}#}
        </script>
    </body>
</html>
