{% load static %}
{% load custom_tag %}
<!DOCTYPE>
<html>
    <head>
        <title>REFUSES ECUE {{get_ue.code}} SESSION 1 {{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 portrait;
                margin: 500px 25px 90px 25px;
                @frame header_frame {           /* Static Frame */
                        -pdf-frame-content: header_content;
                        left: 20pt; width: 562pt; top: 20pt;
                    }

                    @frame footer_frame {           /* Another static Frame */
                        -pdf-frame-content: footer_content;
                        left: 50pt; width: 512pt; top: 800pt; height: 20pt;
                    }
            }

        </style>
    </head>
    <body>
        <!-- Content for Static Frame 'header_frame' -->
        <div id="header_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="font-weight:bold;">UE: ({{get_ue.code}}) {{get_ue.libelle}}</span><br/>
              <span style="font-weight:bold;">ECUE: ({{get_ecue.code}}) {{get_ecue}}</span><br/>
              <span style="text-transform: uppercase;">
                  {% if get_semestre.libelle == 'Semestre 1' %}
                    SEMESTRE 1
                    {% else %}
                    SEMESTRE 2
                  {% endif %} - SESSION 2
              </span><br/>
              <span style="font-weight:bold;">PROCES-VERBAL DE DELIBERATIONS</span><br/>
          </div><br/>
            <p style="text-align:center;font-size:20px;text-transform:uppercase;text-decoration:underline;">EVALUATIONS SESSION 2 - ECUE: {{get_ecue.code}}
                <br/>
            </p>

        </div>

        <!-- Content for Static Frame 'footer_frame' -->
        <div id="footer_content">
            <pdf:pagenumber>/<pdf:pagecount>
        </div>
      <div class="pdf-content">

          <center>
          <table class="table">
              <thead>
              <tr>
                    <th style="width:35px;float:left;"></th>
                    <th style="text-align:center;width:100px;text-align:center;">NCE</th>
                    <th style="text-align:center;">NOMS & PRENOMS</th>
                    <th style="width:60px;text-align:center;">SEXES</th>
                    <th style="width:75px;text-align:center;">DATES DE NAISSANCE</th>
                    <th style="width:75px;text-align:center;">NOTE</th>
                    <th style="width:75px;text-align:center;">DECISIONS</th>
                </tr>
              </thead>
              <tbody>
              {% for etudiant in etudiants %}
                    <tr style="padding-top:3px;">
                        <td style="text-align:center;">{{forloop.counter}}</td>
                        <td style="text-align:center;font-weight:bold;">{{etudiant.nce}}</td>
                        <td>{{etudiant}}</td>
                        <td style="text-align:center;padding-left:3px;">
                            {% if etudiant.sexe %}
                                {{etudiant.sexe}}
                            {% else %}
                                ?
                            {% endif %}
                        </td>
                        <td style="text-align:center;">{{etudiant.datenaiss|date:"d/m/Y"}}</td>
                        <td style="text-align:center;">{{etudiant|get_etudiant_session_2_ecue_note:UeAnneeData|stringformat:".2f"}}</td>
                        <td style="text-align:center;">{{etudiant|get_etudiant_session_2_ecue_note:UeAnneeData|stringformat:".2f"|get_decision_session_2_ecue_note:UeAnneeData}}</td>
                    </tr>
              {% endfor %}
              </tbody>
          </table>
            </center>
      </div>
    </body>
</html>