<div class="row">
    <div class="col-lg-2 col-xs-12" style="border: solid 1px lightgray;">
        <img src="{{asset('fotos/'~a.cveCtl~'.jpg')}}" class="img-responsive">
    </div>
    <div class="col-lg-5 col-xs-12" style="border: solid 1px lightgray;">
        <label><i class="fa fa-graduation-cap fw"></i>{{a.nomAlu}} {{a.apePat}} {{a.apeMat}}</label>
        <br>
        <label><i class="fa fa-barcode fw"></i> {{a.cveCtl}}</label>
        <br>
        {% set color = 'green' %}
        {% if a.estatus.cveEst == 'AA' %}
            {% set color = 'green' %}
        {% elseif a.estatus.cveEst == 'AB' %}
            {% set color = 'red' %}
        {% elseif a.estatus.cveEst == 'ABT' %}
            {% set color = 'orange' %}
        {% elseif a.estatus.cveEst == 'APB' %}
            {% set color = 'purple' %}
        {% endif %}
        <label style="background-color: {{color}};color: white;"><i class="fa fa-line-chart fw"></i> {{a.estatus.desEst}}</label>
        <br>
        <label><i class="fa fa-phone fw"></i> {{a.telefono}}</label>
        <br>
        <label><i class="fa fa-phone fw"></i> {{a.telefonoCelular}}</label>
    </div>
    <div class="col-lg-5 col-xs-12" style="border: solid 1px lightgray;">
        <label><i class="fa fa-building-o fw"></i> PLANTEL: {{a.cvePla.nomPla}}</label>
        <br>
        {% set nivel = "" %}
        {% if a.tipoAlumno == 1 %}
            {% set nivel = "BACHILLERATO ESCOLARIZADO" %}
        {% elseif a.tipoAlumno == 2 %}
            {% set nivel = "BACHILLERATO EXAMEN ÚNICO" %}
        {% elseif a.tipoAlumno == 3 %}
            {% set nivel = "LICENCIATURA EN: "~a.cveLic.nomLic %}
        {% elseif a.tipoAlumno == 4 %}
            {% set nivel = "MAESTRÍA EN: "~a.cveLic.nomLic %}
        {% elseif a.tipoAlumno == 5 %}
            {% set nivel = "DOCTORADO EN: "~a.cveLic.nomLic %}
        {% endif %}
        <label><i class="fa fa-chevron-up fw"></i><i>{{nivel}}</i></label>
        <br>
        <label><i class="fa fa-dollar fw"></i> Inscripción: ${{a.costoInscripcion}}</label>
        <br>
        <label><i class="fa fa-dollar fw"></i> Reinscripción: ${{a.costoReinscripciones}}</label>
        <br>
        <label><i class="fa fa-dollar fw"></i> Colegiatura: ${{a.costoMensualidad}}</label>
    </div>
</div>
<div class="row">
    <div class="col-lg-6" style="border: solid 1px lightgray;padding-left: 0px;">
        <div class="col-lg-12">PAGOS REGISTRADOS EN SISTEMA</div>
        <div class="col-lg-12 table-responsive" style="padding-left: 0px;">
            {% if a.tipoAlumno == 2 %}
            {% else %}
                <table class="table table-bordered table-condensed table-hover table-striped" style="font-size: smaller;">
                    <thead>
                        <tr style="font-size: xx-small;">
                            <th style="text-align: center;">NP</th>
                                {% if a is defined and a != null%}
                                    {% if a.modalidad == "SEMESTRAL" %}
                                    <th>SEMESTRE</th>
                                    {% else %}
                                    <th>CUATRIMESTRE</th>
                                    {% endif %}
                                {% else %}
                                <th>---</th>
                                {% endif %}
                            <th style="text-align: center;">CONCEPTO</th>
                            <th style="text-align: center;">MES</th>
                            <th style="text-align: center;">MONTO</th>
                            <th style="text-align: center;">RECARGOS</th>
                            <th style="text-align: center;">TOTAL</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% if pagos is defined%}
                            {% set hoy = "now" | date('Y-m-d') %}
                            {%for p in pagos %}
                                {% if date('last day of this month') <= date(p.fecIni) %}
                                    <tr style="text-align: center;font-size: xx-small;background-color: yellowgreen;">
                                    {% else %}
                                        <tr style="text-align: center;font-size: xx-small;background-color: pink;">
                                    {% endif %}
                                    <td>{{loop.index}}</td>
                                    <td>{{p.semestre}}</td>
                                    <td>
                                        {% if p.numero == 0 %}
                                            <strong>{{p.descripcion}}</strong>
                                        {% else %}
                                            {{p.descripcion}}
                                        {% endif %}
                                    </td>
                                    {% if p.numero == 0 %}
                                        {% if a.modalidad == "SEMESTRAL" %}
                                            <td><strong>SEMESTRE: #{{p.semestre}}</strong></td>
                                        {% else %}
                                            <td><strong>CUATRIMESTRE: #{{p.semestre}}</strong></td>
                                        {% endif %}
                                    {% else %}
                                        <td>{{p.nomMes}} {{p.fecIni | date('Y')}}</td>
                                    {% endif %}
                                    {% if p.staPag == 2 %}
                                        <td>-----</td>
                                        <td>-----</td>
                                    {% elseif p.staPag == 1 %}
                                        {% if p.numero == 0 %}
                                            <td>{{p.cveAlu.costoReinscripciones}}</td>
                                            <td>$ 100.00</td>
                                        {% else %}
                                            <td>{{p.cveAlu.costoMensualidad}}</td>
                                            <td>$ 200.00</td>
                                        {% endif %}
                                    {% endif %}
                                    <td>
                                        {% if p.staPag == 2 %}
                                            {% if p.tipPag == 99 %}
                                                <p style="background-color: lightblue;margin-bottom: 0px;">EXCEL</p>
                                            {% elseif p.tipPag == 69 %}
                                                <p style="background-color: blueviolet;color: white;margin-bottom: 0px;">CONVENIO</p>
                                            {% else %}
                                                {% if p.numero == 0 %}
                                                    <a id="btnImpMensualidad" class="btn btn-xs btn-success btn-block" href="{{path('imprimir_mensualidad',{ref:p.referencia,ban : 1,ideAlu : p.cveAlu.ideAlu,numRec : p.numRecibo,cveIng : p.cveIng})}}" target="_blank"><i class="fa fa-print fw fa-sm"></i></a>
                                                    {% elseif p.numero == -1 %}
                                                    <a id="btnImpMensualidad" class="btn btn-xs btn-success btn-block" href="{{path('imprimir_mensualidad',{ref:p.referencia,ban : 2,ideAlu : p.cveAlu.ideAlu,numRec : p.numRecibo,cveIng : p.cveIng})}}" target="_blank"><i class="fa fa-print fw fa-sm"></i></a>
                                                    {% else %}
                                                    <a id="btnImpMensualidad" class="btn btn-xs btn-success btn-block" href="{{path('imprimir_mensualidad',{ref:p.referencia,ban : 0,ideAlu : p.cveAlu.ideAlu,numRec : p.numRecibo,cveIng : p.cveIng})}}" target="_blank"><i class="fa fa-print fw fa-sm"></i></a>
                                                    {% endif %}
                                                {% endif %}

                                        {% elseif p.staPag == 1 %}
                                            <span style="color: red;">NO PAGADO</span>
                                        {% endif %}
                                    </td>
                                </tr>
                            {% endfor %}
                        {% endif %}
                    </tbody>
                </table>
            {% endif %}




        </div>
    </div>
    <div class="col-lg-6" style="border: solid 1px lightgray;">
        <div class="col-lg-12">CONVENIOS</div>
        <div class="col-lg-12 table-responsive">
            <table class="table table-bordered table-condensed table-hover">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>FECHA</th>
                        <th>CONVENIO</th>
                        <th>MONTO</th>
                        <th>ESTATUS</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    {% for c in convenios %}
                        <tr>
                            <td>{{loop.index}}</td>
                            <td>{{c.fecCon | date('d-m-Y')}} {{c.horCon |date('H:i:s p') }}</td>
                            <td>{{c.numConvenio}}</td>
                            <td>${{c.monto | number_format(2,".",",") }}</td>
                            {% if c.estatus == 0  %}
                                <td>ACTIVO</td>
                            {% else %}
                                <td>FINALIZADO</td>
                            {% endif %}
                            <td>
                                <a href="" target="">VER PAGOS</a>
                            </td>
                        </tr>
                    {% else %}
                        <tr>
                            <td colspan="6">NO TIENE CONVENIOS</td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>