{% extends 'scolarite/ags_base.html' %}
{% load static %}
{% load custom_tag %}
{% block head %}{% endblock head %}
{% block page_title %}<!--({{ue.code}}) : {{ue.libelle}}--> {% endblock page_title %}
{% block content %}
<div class="card">
    <div class="card-header text-white" style="background: #21618C"><h3 class="card-title">EXPORTER UN PV</h3>
    </div>
    <div class="card-body">
        <form method="post" action="#">
            {% csrf_token %}
        <div class="row">
            <div class="col-md-2">
                <select name="annee" class="form-control">
                    {% for annee in annees %}
                    <option value="{{annee.id}}">{{annee}}</option>
                    {% endfor %}
                </select>
            </div>
            <div class="col-md-2">
                <select name="niveau" class="form-control">
                    {% for niveau in niveaux %}
                    <option value="{{niveau.id}}">{{niveau}}</option>
                    {% endfor %}
                </select>
            </div>
            <div class="col-md-2">
                <select name="ufr" class="form-control">
                    {% for ufr in ufrs %}
                    <option value="{{ufr.id}}">{{ufr.code}}</option>
                    {% endfor %}
                </select>
            </div>
            <div class="col-md-2">
                <button type="submit" class='btn btn-primary'><i class="fa fa-search"></i>&nbsp; Filtrer</button>
            </div>
        </div>
        </form>
        <br/>
        {% if an and niveau and ufr %}
        <p>
           <i class="fa fa-file-pdf"></i> <a target="_blank" href="{% url 'EspaceEnseignant:pv_annuel_export' an niveau ufr %}" style="text-transform:uppercase;">PV ANNUEL (.CSV EXPORT) </a>
        </p>
        {% endif %}
    </div>
</div>
<div class="card mb-3">
    <div class="card-header">
        <i class="fas fa-table"></i>
        LISTE PROCES VERBAUX
    </div>
    <div class="card-body">
        <div class="table-responsive">

            <table class="table table-bordered table-striped" id="dataTable" width="100%" cellspacing="0">
                <thead>
                <tr>
                    <th>Années</th>
                   <!-- <th>Libellé UFR</th> -->
                    <th>Niveau</th>
                    <th>Code UFR</th>
                    <th></th>
                </tr>
                </thead>
                <tfoot>
                <tr>
                    <th>Années</th>
                   <!-- <th>Libellé UFR</th> -->
                    <th>Niveau</th>
                    <th>Code UFR</th>
                    <th></th>
                </tr>
                </tfoot>
                <tbody>
                {% for pv in pvs %}
                <tr>
                    <td width="100">{{pv.annee}}</td>
                    <td width="120">{{pv.niveau}}</td>
                    <!--<td>{{pv.ufr.libelle}}</td> -->
                    <td>{{pv.ufr.code}}</td>
                    <td width="80">
                        <a class="btn btn-primary btn-sm" href="{% url 'Scolarite:pdf_display' pv.id %}" target="_blank"><i class="fa fa-eye"></i>&nbsp; view</a>
                    </td>
                </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
{% endblock content %}

{% block custom_js %}
<script src="{% static 'js/custom-js/save_note.js'%} "></script>
 <script src="{% static 'js/custom-js/note.js' %}"></script>
<script>
    var elements = rootElement.getElementsByClassName('delib')
</script>
{% endblock custom_js %}