{% load static %}
{% load custom_tag %}
{% load custom_tag_obj %}
<!DOCTYPE>
<html>
    <head>
        <title>RELEVE_DE_NOTE-{{etudiant.nce}}</title>
        <style type="text/css">
            .minist{
                text-align:center;
                vertical-align:top;
                line-height:15px;
            }
            .b{
                font-weight:bold;
            }
            .tit{
                color:#fff;
                background-color:green;
                font-size:14px;
                padding:10px 0px 5px 5px;
                text-align:center;
                font-weight:bold;
            }
            .tit2{
                color:#1f96d7;
                font-size:20px;
                padding:5px 0px -5px 5px;
                text-align:center;
                font-weight:bold;
                width:400px;
                border:1px solid #1f96d7;
            }
            .thd{
                border:1px solid #1f96d7;
                padding:4px 0px 1px 15px;
                background-color:#1f96d7;
                color:#fff;
                font-weight:bold;
                height:30px;
            }
            .table{
                margin-top:10px;
                font-size:12px;
                border-collapse:collapse;
                border:1px solid #1f96d7;
            }
            .fst-td{
                padding-top:5px;
            }
            .table td{
                padding:1px 1px 1px 5px;

            }
            .bd-left-none{
                border-left:none;
            }
            .bd-right-none{
                border-right:none;
            }
            .bd-top-none{
                border-top:none;
            }
            .bd-bottom-none{
                border-bottom:none;
            }
            .upper{
                text-transform:uppercase;
            }
            .inf-label{
                font-size:14px;
                padding-bottom:-2px;
            }
            .inf-content{
                font-size:14px;
            }
            .cntn{
                font-weight:bold;
            }
            .inf-content td{
                width:700px;
                border-bottom:1px dotted #fff;
                padding-bottom:-3px;
            }
            .inf-ctn{
                margin:10px 0px;
            }
            .sep{
                width:20;
            }


            @page{
                size: a4 portrait;
                margin: 20px 32px 10px 32px;
                .pdf-content{
                    background-image: url('static/ac-img/usp_bg4.jpg');
                    background-position: bottom;
                }


                @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: 80pt;
                }
            }

        </style>
    </head>
    <body>
        <!-- Content for Static Frame 'header_frame' -->
        <div id="header_content">

        </div>
        <!-- Content for Static Frame 'footer_frame' -->
        <div id="footer_content">
           <span style="text-align:center;">
               <hr/>
             <center>  Située à San Pedro, route du village de Goréké, en face en nouveau CHR de San Pedro - 01 BP 1800 San Pedro 01 - Côte d’Ivoire
                <br/>Tél : 27 34 70 12 50 - Cell :  07 99 13 77 54  / 05 06 88 56 46 / Site web : www.usp.edu.ci - E-mail : informations@usp.edu.ci
            </center>
           </span>
        </div>
      <div class="pdf-content">
             <!-- <img src="static/assets/img/usp-pdf-header.png"> -->
              <div>

                  <table>
                      <tr>
                          <td class="minist">
                              <p>MINISTERE DE L'ENSEIGNEMENT SUPERIEUR ET DE LA RECHERCHE SCIENTIFIQUE
                              <br/>----------------------------
                                  <br/><span class="b">UNIVERISTE DE SAN PEDRO</span>
                              <br/><img src="static/inscription/assets/img/logousp.png" width="120" height="50">
                              <br/>----------------------------<br/>
                                  <span class="b">
                                      {% if ags %}
                                      SCOLARITE CENTRALE
                                      {% else %}
                                      UFR : {{etudiant.ufr.libelle|upper}}
                                      {% endif %}
                                  </span>
                              <br/>----------------------------
                              </p>
                          </td>
                          <td></td>
                          <td class="minist">
                              <p>REPUBLIQUE DE COTE D'IVOIRE
                             <br/><img src="static/inscription/assets/img/ci2.png" width="120" height="70">
                              <br/>Union - Discipline - Travail
                                  <br/>----------------------------
                              </p>
                              <p style="font-size:16px;font-weight:bold;text-align:center;">
                                 <!-- UFR {{etudiant.ufr.code|upper}} -->
                              </p>
                          </td>
                      </tr>
                  </table>
                 <!-- <p class="b">CLASSES PREPARATOIRES AUX GRANDES ECOLES</p> -->

                 <!-- <div><span style="font-weight:bold;text-decoration:underline;">AVIS TRES IMPORTANT</span>: L'authenticité du présent document peut être vérifiée auprès de la scolarité.</div> -->
                  <table><tr><td></td><td class="tit2">RELEVE DE NOTES - ANNUEL </td><td></td></tr></table><br/>
                  <div style="text-align:center;margin:5px;font-size:12px;font-weight:bold;"> ANNEE UNIVERSITAIRE {{annee}}</div>

                  <div class="inf-ctn">
                      <table>
                        <tr>
                            <td class="sep"></td>
                            <td width="100" class="inf-label"><span>N<sup>o</sup> Carte d'étudiant :</span></td>
                            <td>
                                <table class="inf-content">
                                      <tr>
                                          <td>
                                              <span class="cntn">{% if etudiant.nce %}{{etudiant.nce}}{% endif %}</span>
                                          </td>
                                      </tr>
                                </table>
                            </td>
                        </tr>
                      </table>
                  </div>

                  <div class="inf-ctn">
                      <table>
                        <tr>
                            <td class="sep"></td>
                            <td width="35" class="inf-label"><span>Nom :</span></td>
                            <td width="80">
                                <table class="inf-content">
                                      <tr><td><span class="cntn">{% if etudiant %}{{etudiant.nom|upper }}{% endif %}</span></td></tr>
                                </table>
                            </td>
                            <td class="sep"></td>
                            <td width="65" class="inf-label"><span>Prénom(s) :</span></td>
                            <td width="220">
                                <table class="inf-content">
                                      <tr><td><span class="cntn">{% if etudiant %}{{etudiant.prenoms|title }}{% endif %}</span></td></tr>
                                </table>
                            </td>
                        </tr>
                      </table>
                  </div>


                  <div class="inf-ctn">
                      <table>
                        <tr>
                            <td class="sep"></td>
                            <td width="35" class="inf-label"><span>Sexe :</span></td>
                            <td>
                                <table class="inf-content">
                                      <tr>
                                          <td>
                                              <span class="cntn">{% if etudiant.sexe %}{{etudiant.sexe|get_sexe_libelle:'MaFe'}}{% endif %}</span>
                                          </td>
                                      </tr>
                                </table>
                            </td>
                        </tr>
                      </table>
                  </div>

                  <div class="inf-ctn">
                      <table>
                        <tr>
                            <td class="sep"></td>
                            <td width="135" class="inf-label"><span>Date et Lieu de Naissance :</span></td>
                            <td>
                                <table class="inf-content">
                                      <tr>
                                          <td>
                                              <span class="cntn">{% if etudiant.datenaiss %}{{etudiant.datenaiss|date:'d/m/Y'}}{% endif %}</span>
                                              &nbsp; à &nbsp;
                                              <span class="cntn">{% if etudiant.lieunaiss %}{{etudiant.lieunaiss|title}}{% endif %}</span>
                                          </td>
                                      </tr>
                                </table>
                            </td>
                        </tr>
                      </table>
                  </div>

                  <div class="inf-ctn">
                      <table>
                        <tr>
                            <td class="sep"></td>
                            <td width="43" class="inf-label"><span>Niveau :</span></td>
                            <td width="80">
                                <table class="inf-content">
                                      <tr>
                                          <td>
                                              <span class="cntn">{% if nivEtud %}{{nivEtud}}{% endif %}</span>
                                          </td>
                                      </tr>
                                </table>
                            </td>
                        </tr>
                      </table>
                  </div>

                  <div class="inf-ctn">
                      <table>
                        <tr>
                            <td class="sep"></td>
                            <td width="55" class="inf-label"><span>Parcours :</span></td>
                            <td>
                                <table class="inf-content">
                                      <tr><td><span class="cntn"> {{etudiant.ufr|get_parcours:nivEtud}}</span></td></tr>
                                </table>
                            </td>
                        </tr>
                      </table>
                  </div>

                  <div class="inf-ctn">
                      <table>
                        <tr>
                            <td class="sep"></td>
                            <td width="35" class="inf-label"><span>UFR :</span></td>
                            <td>
                                <table class="inf-content">
                                      <tr><td><span class="cntn"> {{etudiant.ufr.libelle|upper}}</span></td></tr>
                                </table>
                            </td>
                        </tr>
                      </table>
                  </div>

                  <table border="1">
                      <tr style="padding:2px;font-size:14px;">
                          <th>CODE</th>
                          <th>UNITES D'ENSEIGNEMENTS</th>
                          <th>MOY.</th>
                          <th>CR.</th>
                          <th>RESUL.</th>
                          <th>ANNEE</th>
                          <th>MENTION</th>
                      </tr>
                      {% for semestre in semestres %}
                      {% for  ue in ufrAn|get_ue_by_ufr_and_semestre_set:semestre.id %}
                      <tr style="font-size:12px;padding:3px 3px -1px 3px;">
                          <td width="50">{{ue.code}}</td>
                          <td style="text-transform:uppercase;">{{ue.libelle|capfirst}}</td>
                          <td width="35" style="text-align:center;">{{ etudAn|get_etudiant_moyenne_ue3:ue |stringformat:".2f" }}</td>
                          <td width="35" style="text-align:center;">{{ ue|get_credit_ue }}</td>
                          <td width="53" style="text-align:left;">
                              {% if etudAn|get_etudiant_moyenne_ue3:ue >= ue|get_note_delib_ue:annee and ue|get_note_delib_ue:annee > 0 %}
                              <span>Validé(e)</span>
                              {% else %}
                              <span>Ajourné(e)</span>
                              {% endif %}
                          </td>
                          <td width="53" style="text-align:center;">
                              {% if etudiant|get_annee_validation_ue:ue %}
                              {{ etudiant|get_annee_validation_ue:ue }}
                              {% endif %}
                          </td>
                          <td width="65">
                              {{ etudAn|get_etudiant_moyenne_ue3:ue|get_mention }}
                          </td>
                      </tr>
                      {% endfor %}
                      <tr>
                          <td colspan="7" style="font-size:12px;font-weight:bold;padding:4px 3px 2px 3px;">
                              <span>TOTAL CREDIT {{semestre|upper}}:  {{etudAn|get_credit_valide_semestre_ufr:semestre}} SUR {{ufrAn|get_credit_semestre_ufr:semestre.id}} | DECISION : {{ etudAn|get_decision_annuelle_etudiant:semestre}}</span>
                          </td>
                      </tr>
                      {% endfor %}
                  </table>
                  <br/>
                  <table>
                      <tr style="font-size:14px;">
                          <td width="150"></td>
                          <td>
                              TOTAL CREDIT:
                              <strong>{{ etudAn|get_credit_valide_annuel}}</strong> SUR
                              <strong>{{etudAn|get_credit_annuel_2}}</strong> SOIT
                              <strong>{{etudAn|taux_credit_valide_annuel|stringformat:".2f"}}%</strong> DES CREDITS OBTENUS
                          </td>
                      </tr>
                      <tr style="font-size:14px;">
                          <td width="150"></td>
                          <td>MOYENNE OBTENUE: <strong>{{ etudAn|get_moyenne_annuelle_etudiant|stringformat:".2f"}} / 20</strong></td>
                      </tr>
                      <tr style="font-size:14px;">
                          <td width="150"></td>
                          <td>DECISION: <strong>{{ etudiant|decision_annuelle_etudiant_by_annee:annee}}</strong></td>
                      </tr>
                  </table>

                  <table border="0">
                      <tr style="font-size:14px;">
                          <td width="100"></td>
                          <td width="100">

                          </td>
                          <td width="100"></td>
                          <td style="font-size:16px;line-height:15px;">
                              <p style="text-align:center;font-size:14px;">&nbsp; San Pedro, le {{'/'|get_today}}</p>
                              <p style="text-align:center;">
                                  &nbsp;&nbsp;&nbsp;&nbsp;<u>Le Président</u>
                              </p><br/>
                              <p style="text-align:center;">Prof. Méké M&Eacute;IT&Eacute;</p>
                          </td>
                      </tr>
                  </table>

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