{% extends "base.html" %}

{% load static %}

{% block content %}

<div class="breadcrumbs">
    <div class="breadcrumbs-inner">
        <div class="row m-0">
            <div class="col-sm-4">
                <div class="page-header float-left">
                    <div class="page-title">
                        <h1>UNIVERSIDAD POLITÉCNICA DE TAPACHULA</h1>
                    </div>
                </div>
            </div>
            <div class="col-sm-8">
                <div class="page-header float-right">
                    
                </div>
            </div>
        </div>
    </div>
</div>

 

        <div class="content">
            <div class="animated fadeIn">
                <div class="row">

                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                                <strong class="card-title">{{ labos.nombre }}</strong>
                                <a href="{% url 'lcscan' labos.id  %}" class="btn btn-primary btn-rounded btn-lg">Entrada</a>
                            </div>
                            <div class="card-body">
                                <table id="example" class="table table-striped table-bordered">
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>ID_Usuario</th>
                                            <th>Asignatura</th>
                                            <th>Area</th>
                                            <th>Material</th>
                                            <th>Uso</th>
                                            <th>Entrada</th>
                                            <th>Salida</th>
                                            <th>Opciones</th>
                                            
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {% for dato in datos %}
                                        <tr>
                                            <td>{{ dato.id }}</td>
                                            
                                            {% for user in users %}
                                                {% if dato.usuario_id == user.id %}
                                                    <td>{{ user.first_name }} {{ user.last_name }}</td>
                                                {% endif %}
                                            {% endfor %}

                                            {% if dato.id_asig_id is not None %}
                                                {% for asig in asigs %}
                                                    {% if dato.id_asig_id == asig.id %}
                                                        <td>{{ asig.nombre }}</td>
                                                    {% endif %}
                                                {% endfor %}
                                            {% else %}
                                            <td></td>
                                            {% endif %}

                                            {% if dato.id_area_id is not None %}
                                                {% for area in areas %}
                                                    {% if dato.id_area_id == area.id %}
                                                        <td>{{ area.nombre }}</td>
                                                    {% endif %}
                                                {% endfor %}
                                            {% else %}
                                            <td></td>
                                            {% endif %}

                                            {% if dato.id_mat_id is not None %}
                                                {% for mate in mates %}
                                                    {% if dato.id_mat_id == mate.id %}
                                                        <td>{{ mate.nombre }}</td>
                                                    {% endif %}
                                                {% endfor %}
                                            {% else %}
                                            <td></td>
                                            {% endif %}
                                            
                                            <td>{{ dato.uso }}</td>
                                            <td>{{ dato.entrada }}</td>
                                            <td>
                                                {% if dato.salida != dato.entrada %}
                                                    {{ dato.salida }}
                                                {% else %}
                                                    <a href="{% url 'lcscanS' labos.id dato.id %}" class="btn btn-primary">Reg. Salida</a>
                                                {% endif %}
                                            </td>
                                            <td>
                                                {% if user.is_superuser %}
                                                <a href="" class="btn btn-primary">Actualizar</a>
                                                {% endif %}
                                            </td>
                                        </tr>
                                        {% endfor %}
                                        
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>


                </div>
            </div><!-- .animated -->
        </div><!-- .content -->
        {% endblock content %}

{% block javascript %}






<!--
<script type="text/javascript">
    $(function() {
      $('#bootstrap-data-table').DataTable({
        responsive: true,
        "language": {
                      url : "{% static 'lib/datatables-1.10.20/spanish.txt' %}"
                  }
                
            });
  
    });
    
  </script>
  -->

{% endblock javascript %}



