{% load static %}
{% load custom_tag %}
{% load other_tag %}
<!DOCTYPE>
<html>
    <head>
        <title>STATS_{{UFR.code}}_{{get_niveau}}_{{get_annee}}</title>
        <style type="text/css">
         
            .usp-info img{
                width:100%;

            }
            .table{
                border:1px solid #000000;
                text-align:left;
                font-size:11px;
            }
            .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:80px;
                padding:3px;
            }
            .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:150px;
                padding:3px 2px 1px 2px;
            }
            .bg-orange{
                background-color:#fdc000;
            }
            @page{
                size: A4 landscape;
                margin: 15px;
            }

        </style>
    </head>
    <body>
      <div class="pdf-content">
          <div class="usp-info">
               <center> <img src="static/ac-img/usp-info.png"></center>
          </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;">
                    SEMESTRE 1 & 2
              </span><br/>
              <span style="font-weight:bold;">STATISTIQUES SEMESTRE 1 & 2</span><br/>
          </div><br/><br/>

          <div style="text-align:center;text-decoration:underline;font-size:14px;font-weight:bold;">Statistiques par Genre</div>
          <div>
              <table>
                  <tr>
                      <td width="50"></td>
                      <td valign="top">
                          <table class="table-2">
                              <thead>
                                <tr>
                                    <th></th>
                                    <th style="width:75px;font-size:14px;padding-top:2px;"><center>Filles</center></th>
                                    <th style="width:75px;font-size:14px;padding-top:2px;"><center>Garçons</center></th>
                                    <th style="width:75px;font-size:14px;padding-top:2px;" class="bg-orange">Générale</th>
                                </tr>
                              </thead>
                              <tbody>
                                <tr>
                                    <td class="stat-ue-2">Effectifs</td>
                                    <th class="ue-content">{{fille}}</th>
                                    <th class="ue-content">{{garcon}}</th>
                                    <th class="ue-content bg-orange">{{etudiants|length}}</th>
                                </tr>
                                <tr>
                                    <td class="stat-ue-2">Moyennes</td>
                                    <th class="ue-content">{{MFe|stringformat:".2f"}}</th>
                                    <th class="ue-content">{{MGn|stringformat:".2f"}}</th>
                                    <th class="ue-content bg-orange">{{MoyGen|stringformat:".2f"}}</th>
                                </tr>
                                <tr>
                                    <td class="stat-ue-2">Ecart-types</td>
                                    <th class="ue-content">{{Ecart_Type_Fille|stringformat:".2f"}}</th>
                                    <th class="ue-content">{{Ecart_Type_Gar|stringformat:".2f"}}</th>
                                    <th class="ue-content bg-orange">{{EcartGen|stringformat:".2f"}}</th>
                                </tr>
                              </tbody>
                          </table>
                      </td>
                      <td width="100"></td>
                      <td valign="top">
                          <table class="table-2">
                              <thead>
                                <tr>
                                    <th></th>
                                    <th style="width:75px;font-size:14px;padding-top:2px;"><center>Filles</center></th>
                                    <th style="width:75px;font-size:14px;padding-top:2px;"><center>Garçons</center></th>
                                    <th style="width:75px;font-size:14px;padding-top:2px;" class="bg-orange">Total</th>
                                </tr>
                              </thead>
                              <tbody>
                                <tr>
                                    <td class="stat-ue-2">Admis</td>
                                    <th class="ue-content">{{F_admis}}<br/> ({{taux_Fil_admis|stringformat:".2f"}}%)</th>
                                    <th class="ue-content">{{G_admis}}<br/> ({{taux_Gar_admis|stringformat:".2f"}}%)</th>
                                    <th class="ue-content bg-orange">{{admis}}<br/> ({{taux_admis|stringformat:".2f"}}%)</th>
                                </tr>
                                <tr>
                                    <td class="stat-ue-2">Autorisés</td>
                                    <th class="ue-content">{{F_autorise}}<br/> ({{taux_Fil_autrorise|stringformat:".2f"}}%)</th>
                                    <th class="ue-content">{{G_autorise}}<br/> ({{taux_Gar_autrorise|stringformat:".2f"}}%)</th>
                                    <th class="ue-content bg-orange">{{autorises}}<br/> ({{taux_autorise|stringformat:".2f"}}%)</th>
                                </tr>
                                <tr>
                                    <td class="stat-ue-2">Refusés</td>
                                    <th class="ue-content">{{F_refuse}}<br/> ({{taux_Fil_refuse|stringformat:".2f"}}%)</th>
                                    <th class="ue-content">{{G_refuse}}<br/> ({{taux_Gar_refuse|stringformat:".2f"}}%)</th>
                                    <th class="ue-content bg-orange">{{refuses}}<br/> ({{taux_refuse|stringformat:".2f"}}%)</th>
                                </tr>
                              </tbody>
                          </table>
                      </td>
                      <td width="50"></td>
                  </tr>
              </table>
          </div><br/>

          <div style="text-align:center;text-decoration:underline;font-size:14px;font-weight:bold;">Statistiques par UE</div>
          <table class="table">
              <thead>
                <tr>
                    <th></th>
                    {% for ue in ues_semestre %}
                    <th class="ue-content"><center>{{ue.code}}</center></th>
                    {% endfor %}
                    <th style="width:75px;" class="bg-orange">Générale</th>
                </tr>
              </thead>
              <tbody >
                <tr>
                    <td class="stat-ue">Moyennes</td>
                    {% for moy in stat_moy_list %}
                    <th class="ue-content"><center>{{moy|stringformat:".2f"}}</center></th>
                    {% endfor %}
                    <td style="text-align:center;" class="bg-orange">{{MoyGen|stringformat:".2f"}}</td>
                </tr>
                <tr>
                    <td class="stat-ue">Ecart-Types</td>
                    {% for ec in stat_ecart_ue_list %}
                    <th class="ue-content"><center>{{ec|stringformat:".2f"}}</center></th>
                    {% endfor %}
                    <td style="text-align:center;" class="bg-orange">{{EcartGen|stringformat:".2f"}}</td>
                </tr>
                <tr>
                    <td class="stat-ue">% de Validation</td>
                    {% for tx in taux_valid_ue_list %}
                    <th class="ue-content"><center>{{tx|stringformat:".2f"}}%</center></th>
                    {% endfor %}
                    <td width="50" style="text-align:center;" class="bg-orange"></td>
                </tr>
              </tbody>
          </table><br/><br/>

          <br/><br/>

      </div>
    </body>
</html>