{% load static %}
{% load custom_tag %}
<!DOCTYPE>
<html>
    <head>
        <title>PV_{{get_semestre}}_{{UFR}}_{{get_niveau}}_{{get_annee}}</title>
        <style type="text/css">
            .usp-info img{
                width:1124px;
            }
            .table{
                border:1px solid #000000;
                text-align:left;
                font-size:11px;
                border-collapse: collapse;
            }
            .table-2{
                border:1px solid #000000;
                width:80%;
                text-align:left;
                font-size:12px;
            }
            .table tr{
                padding:1px;
            }
            .table td {
              border: 1px solid;
            }
            .table th{
                text-align:left;
                padding:1px;
            }
            .nce{
                width:148px;
            }
            .nom{
                width:160px;
            }
            .ue-content{
                min-width:45px;
            }
            .title{
                font-size:20px;
                text-align: center;
                border:1px solid #000000;
                padding:15px;
            }
            .stat-ue{
                font-size:16px;
                font-weight:bold;
                width:113px;
                padding:3px 2px 1px 2px;
            }
            .stat-ue-2{
                font-size:16px;
                font-weight:bold;
                width:200px;
                padding:3px 2px 1px 2px;
            }
            .bg-orange{
                background-color:#fdc000;
            }
            @page{
                size: a4 landscape;
                margin: 10px;
            }

        </style>
    </head>
    <body>
      <div class="pdf-content">
          <div class="usp-info">
                <img src="static/ac-img/usp-info.png">
          </div>
          <br/><br/>
          <div class="title">
              <span style="font-weight:bold;">UFR: {{UFR}}</span><br/>
              <span style="text-transform: uppercase;">ANNEE UNIVERSITAIRE: {{get_annee}}</span><br/>
              <span style="text-transform: uppercase;">NIVEAU: {{get_niveau}}</span><br/>
              <span style="text-transform: uppercase;">
                  {% if get_semestre.libelle == 'Semestre 1' %}
                    SEMESTRE N<sup>o</sup>1 (S1)
                    {% else %}
                    SEMESTRE N<sup>o</sup>2 (S2)
                  {% endif %}
              </span><br/>
              <span style="font-weight:bold;">PROCES-VERBAL DE DELIBERATIONS</span><br/>
          </div><br/><br/>

          <br/>
          <center>
          <table class="table">
              <thead>
              <tr>
                  <th colspan="{{header_cols}}" style="font-size:20px;padding-top:4px;">
                      <center>
                          {% if get_semestre.libelle == 'Semestre 1' %}
                            SEMESTRE 1
                            {% else %}
                            SEMESTRE 2
                          {% endif %}
                      </center>
                  </th>
              </tr>
              <tr>
                    <th style="width:35px;float:left;"></th>
                    <th style="width:150px;">ID ETUDIANT</th>
                    {% for ue in ues_semestre %}
                    <th class="ue-content"><center>{{ue.ue.code}}<br/>{{ue.ue|get_credit_ue}}</center></th>
                    {% endfor %}
                    <th style="width:40px;background-color:#fdc000;">
                        <center>Moy.<br/>
                            {% if get_semestre.libelle == 'Semestre 1' %}
                            S1
                            {% else %}
                            S2
                            {% endif %}
                        </center></th>
                    <th style="width:60px;"><center>TT Cred.<br/> {{total_credit}}</center></th>
                    <th style="width:85px;">Décision</th>
                </tr>
              </thead>
              <tbody>
              {% for item in datas_etudiant %}
                    {% if item.3 == 'REFUSE(E)' %}

                    <tr>
                        <td style="text-align:center;">{{ forloop.counter }}</td>
                        <td>
                            {{ item.0 }}<br/>
                            Né(e) le {{ item.0.datenaiss |date:'d/m/Y' }} à {{ item.0.lieunaiss }}<br/>
                            SEXE: {{ item.0.sexe }}<br/>
                            NCE: {{ item.0.nce }}
                        </td>
                        {% for ue in ues_semestre %}
                            <td>
                                <!--
                                <table class="table">
                                    <tr>
                                        <td>1</td>
                                        <td>2</td>
                                    </tr><tr>
                                        <td>1</td>
                                        <td>2</td>
                                    </tr><tr>
                                        <td>1</td>
                                        <td>2</td>
                                    </tr>
                                </table>
                                -->
                                <center>{{item.0|get_etudiant_moyenne_ue:ue.ue.id|stringformat:".2f"}}</center>
                            </td>
                        {% endfor %}

                        <td style="width:40px;background-color:#fdc000;"><center>{{ item.1|stringformat:".2f" }}</center></td>
                        <td style="width:50px;"><center>{{ item.2 }}</center></td>
                        <td style="width:85px;{% if item.3 == 'ADMIS(E)' or item.3 == 'AUTORISE(E)' %}background-color:green;{% endif %}">
                            <center>{{ item.3 }}</center>
                        </td>
                    </tr>
                    {% endif %}
              {% endfor %}
              </tbody>
          </table>
            </center>
      </div>
    </body>
</html>