{% extends 'inc/base.html.twig' %}
{% block body %}
<div class="container">
<h2>Educador: {{ datos_educa.id_ed }}&nbsp;-&nbsp;{{ datos_educa.ape_ed}}&nbsp;{{ datos_educa.nom_ed }}</h2>
<strong style="font-size: larger">Curso:&nbsp;{{ eval_mes.codigo }}&nbsp;&nbsp;&nbsp;T&eacute;cnica:&nbsp;{{ eval_mes.descripcion }} </strong>

&nbsp;&nbsp;&nbsp;<a href="{{ constant('URLROOT2') }}/educadores/" class="btn btn-danger pull-right"><i class="fa fa-backward"></i> Regresar</a>
&nbsp;&nbsp;&nbsp;<button type="button" class="btn btn-success pull-right" data-toggle="modal" data-target="#ModalMes" data-whatever="@mdo"><i class="fa fa-add">&nbsp;</i>Agregar Mes</button>
&nbsp;&nbsp;&nbsp;
</div>

{% if msj_err is not empty %}
<div class="col-12 text-center">
<div class="alert alert-danger alert-dismissible fade show" role="alert">
  <strong>{{ msj_err }}</strong>
  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
</div>
</div>
{% endif %}

<table class="table table-striped table-hover table-sm">
  <thead style="background-color: #006699;color:#FFFFFF;">
    <tr class="d-flex">
    <th class='col-sm-1 text-center'>Mes</th>
    <th class='col-sm-1 text-center'>A&ntilde;o</th>
    <th class='col-sm-2 text-center'>Hrs. Dictadas Mes</th>
    <th class='col-sm-2 text-center'>Carga</th>
    <th class='col-sm-2 text-center'>Estado</th>
    <th class='col-sm-4 text-center'>Movimientos</th>
    </tr>
  </thead>
  <tbody>

{% for evalua in evaluacion %}
    <tr class="d-flex">
      <th class='col-sm-1 text-center'>{{ evalua.mes }}</th>
      <th class='col-sm-1 text-center'>{{ evalua.ano }}</th>
      <td class='col-sm-2 text-center'>{{ evalua.horas_mes }}</td>
      <th class='col-sm-2 text-center'>{{ evalua.carga_mes }}</th>
      <th class='col-sm-2 text-center'>
            {% if evalua.tag == 'PR' %}
            <span class="badge badge-danger" style="background-color: #570000;color:#FFFFFF;">Procesado</span>
            {% else %}
            <span class="badge badge-success" style="background-color: #006600;color:#FFFFFF;">En Proceso</span>
            {% endif %}
      </th>
        <th class='col-sm-4 text-center'>
        {% if evalua.tag == 'PR' %}
        <a onclick="procesando();" style="background-color: #570000;color:#FFFFFF;" class="btn btn-sm" href="{{ constant('URLROOT2') }}/educadores/notas_pro/{{ evalua.idd }}" data-toggle="tooltip" data-placement="top" title="Evaluaciones">Notas</a>&nbsp;&nbsp;&nbsp;
        <a onclick="procesando();" style="background-color: #570000;color:#FFFFFF;" class="btn btn-sm" href="{{ constant('URLROOT2') }}/educadores/asistencia_pro/{{ evalua.idd }}" data-toggle="tooltip" data-placement="top" title="Evaluaciones">Asistencia</a>&nbsp;&nbsp;&nbsp;
<!--        <a onclick="procesando();" style="background-color: #570000;color:#FFFFFF;" class="btn btn-sm" href="{{ constant('URLROOT2') }}/educadores/actitudinales_pro/{{ evalua.idd }}" data-toggle="tooltip" data-placement="top" title="Evaluaciones">Actitudinales</a>&nbsp;&nbsp;&nbsp;
-->        {% else %}
        <a onclick="procesando();" style="background-color: #006600;color:#FFFFFF;" class="btn btn-sm" href="{{ constant('URLROOT2') }}/educadores/notas/{{ evalua.idd }}" data-toggle="tooltip" data-placement="top" title="Evaluaciones">Notas</a>&nbsp;&nbsp;&nbsp;
        <a onclick="procesando();" style="background-color: #006600;color:#FFFFFF;" class="btn btn-sm" href="{{ constant('URLROOT2') }}/educadores/asistencia/{{ evalua.idd }}" data-toggle="tooltip" data-placement="top" title="Evaluaciones">Asistencia</a>&nbsp;&nbsp;&nbsp;
      <a onclick="procesando();" href="" class="button btn btn-danger btn-sm" data-id="{{ evalua.idd }}" data-token="{{ datos_educa.id_asiste }}" data-ruta="{{ constant('URLROOT2') }}/educadores/eliminames/{{ evalua.idd }}"  data-toggle="tooltip" data-placement="top" title="Eliminar Registro"><i class="fa fa-trash"></i></a>&nbsp;&nbsp;&nbsp;

<!--        <a onclick="procesando();" style="background-color: #006600;color:#FFFFFF;" class="btn btn-sm" href="{{ constant('URLROOT2') }}/educadores/actitudinales/{{ evalua.idd }}" data-toggle="tooltip" data-placement="top" title="Evaluaciones">Actitudinales</a>&nbsp;&nbsp;&nbsp;
-->        {% endif %}
        </th>
<!--      <td class='col-sm-2 text-center'>
      <a onclick="procesando();" class="btn btn-info btn-sm" href="{{ constant('URLROOT2') }}/educadores/evaluaciones/{{ educado.id }}" data-toggle="tooltip" data-placement="top" title="Evaluaciones">Reportes</a>&nbsp;&nbsp;&nbsp;
      </td>-->
    </tr>

{% endfor %}

</tbody>
</table>

<div class="modal fade bd-modal-lg" id="ModalMes" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">

<form action="{{ constant('URLROOT2') }}/educadores/agregarmes" method="post">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Agregar Mes</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
    <div class="modal-body">
    <div class="form-row">

        <div class="form-group col-md-4">
            <label for="message-text">Carga:</label>
<select class="form-control" name="textca" id="textca" size="1" >
<option value="Mensual">Mensual</option>
<option value="Final">Final</option>
</select>
</div>
        <div class="form-group col-md-4">
            <label for="message-text">Mes:</label>
<select class="form-control" name="textms" id="textms" size="1" >
<option value="01">Enero</option>
<option value="02">Febrero</option>
<option value="03">Marzo</option>
<option value="04">Abril</option>
<option value="05">Mayo</option>
<option value="06">Junio</option>
<option value="07">Julio</option>
<option value="08">Agosto</option>
<option value="09">Septiembre</option>
<option value="10">Octubre</option>
<option value="11">Noviembre</option>
<option value="12">Diciembre</option>
</select>
</div>
{% set anio = data.dia_hoy | date('Y')  %}
        <div class="form-group col-md-4">
            <label for="message-text">A&ntilde;o:</label>
<select class="form-control" name="anho" id="anho" size="1" >
{% for i in 0..1 %}
{% set anio1 = anio-i  %}
<option value="{{ anio1 }}">{{ anio1 }}</option>
{% endfor %}
</select>
</div>
        <div class="form-group col-md-4">
            <label for="message-text">Horas que se dictar&aacute;n en el mes:</label>
            <input class="form-control" type="number" min='1' id="horas" name="horas" value=""  required/>
        </div>

        <div class="form-group col-md-8">
        <label for="recipient-name">Contenido:</label>
<textarea class="form-control" name="textcon" id="textcon" rows="2" cols="30" placeholder="Escriba el contenido de la materia que dictara en el mes, ademas las fechas y las evaluaciones."></textarea>
        </div>
        <div class="form-group col-md-12">
        <label for="recipient-name">Observaciones:</label>
<textarea class="form-control" name="textob" id="textob" rows="2" cols="30" placeholder="Observaciones."></textarea>
        </div>
    </div>
    <div class="form-row">
        <input id="id_mes" type="hidden" name="id_mes" value="{{ datos_educa.id_asiste }}">
   </div>
   </div>


      <div class="modal-footer">
        <button onclick="procesando();" type="submit" class="btn btn-success">Guardar Registro</button>
        <button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
      </div>

    </div>
  </form>
  </div>
</div>

{% endblock %}
