{# Template For PG Students In IIC Collage
 #}
<style>
     td, th { padding: 5px; }
    body{
        font-family: \"Times New Roman\", Times, serif; 
    }
    .no-border {
        border-style: none !important;
        border-top:2px solid #fff !important;
        border-bottom:2px solid #fff !important;
        border-left:2px solid #fff !important;
        border-right:2px solid #fff !important;
    } 
    .border {
        border-style: solid; 
        border-width: 2px;
        border-top:2px solid #000 !important;
        border-bottom:2px solid #000 !important;
        border-left:2px solid #000 !important;
        border-right:2px solid #000 !important;
    }
    .border-l-0 {
        border-left:none !important;
    }
    .border-r-0 {
        border-right:none !important;
    }
    .pages {
        width: 100%;
        padding: 1cm;
        background: no-repeat;
        -webkit-background-size: contain;
        -moz-background-size: contain;
        -o-background-size: contain;
        background-size: contain;
        page-break-after: always;
    }
    .subject-details tr{
        padding-top:10mm;
        padding-bottom:10mm;
    }
   
    .subject-details tr th{
        border-left: 1px solid #000;
        border-right: 1px solid #000;
        border-top: 1px solid #000;
        text-align:center;
        background: none !important;
        height: 5mm  !important;
        padding: 0 1mm !important;
        line-height:20px !important;
        font-size:12px;
    }
    .subject-details tr td{
        border-left: 1px solid #000;
        border-right: 1px solid #000;
        border-bottom: 1px solid #000;
        border-top: 1px solid #000;
        padding: 2mm;
        line-height:15px !important;
        height:6mm !important;
        text-align:center;
        vertical-align:middle !important;
        font-size:13px;
       
    }
    .student-details tr td{
        padding:2mm; 
    }
    .secondary-table tr td{
        padding: 2mm;
        line-height:15px !important;
        height:6mm !important;
        border:none;
        text-align:center;
        vertical-align:middle !important;
    }
    
    
</style>
{% for student in data.studentData %}
    <div class="pages" style=" no-border">
        <div class="">
            {% if data.collegeAndOtherData.isHeaderEnabled %}
                <div style="margin:0 0 0 0;width:100%; !important;" class="text-center">
                    <img src="{{data.collegeAndOtherData.collegeHeader}}" class="" style="width:100%; height:auto;">
                </div>
            {% endif %}
            <table style = 'width:100% !important; margin:0mm 0 0 0; page-break-inside:avoid;' cellpadding='0' cellspacing='0' border='0' class='b-0'>   
                    <tr>
                        <td  class="no-border text-left" width="65%" style=" font-size: 13pt;">
                            Name : <b>{{student.name}}</b>
                        </td>
                        <td class="no-border text-left" width="35%" style="vertical-align: bottom !important;  font-size: 13pt;">
                                Date : {{ data.examRegistrationData.resultPublishingStartDate }}
                        </td>
                    </tr>
                    <tr>
                        <td  class="no-border text-left" width="65%" style=" font-size: 13pt;">
                            Year of Admission : <b>{{data.examRegistrationData.batchStartYear}}</b>
                        </td>
                        <td class="no-border text-left" width="35%" style=" font-size: 13pt;">
                            Reg. Number: <b>{{student.registerNo}}</b>
                        </td>
                    </tr> 
            </table>
            <table style = 'width: 100%; margin-top: 10mm !important;' cellpadding='0' cellspacing='0' border='0'  class='student-details' >
                    <tr>
                        <td  class="no-border text-center" width="100%" style="text-align:center;">
                            <div style="line-height:36px;   font-size: 11pt; font-weight:bold;text-align:center;">
                                <span class="bold">{{data.examRegistrationData.programName|upper}}<br></span>
                                <i style="  font-size: 11pt; font-weight:bold;">{{data.examRegistrationData.name}}</i>
                            </div>
                        </td>
                    </tr> 
            </table>
            
            <table class='subject-details' cellspacing='0' style='width:100% !important; page-break-inside:avoid;border-collapse: collapse;'>
                <thead>
                    <tr style='height: 7mm !important;'>
                        <th rowspan="2" width="20%">COURSE CODE</th>
                        <th rowspan="2" width="50%">COURSE NAME</th>
                        <th colspan="2" width="20%">TOTAL</th>
                        <th rowspan="2" width="10%">GRADE</th>
                    </tr>
                    <tr>
                        <th width="10%">Marks Obtained</th>
                        <th width="10%">Max. Marks</th>
                    </tr>
                </thead>
                <tbody>
                    {% set slno = 0 %}
                    {% for subject in student.subjects %}
                        <tr style='height: 7mm;line-height: 30px; font-size: 12pt !important; '>
                            <td class="align-middle " style="">{{subject.code}}</td>
                            <td class="align-left " style="text-align: left;">{{subject.name}}</td>
                            <td class="align-middle text-center ">{{subject.markObtained}}</td>
                            <td class="align-middle text-center ">{{subject.totalMaxMark}}</td>
                            <td class="align-middle text-center ">{{subject.failedStatus == 'FAILED' ? 'F' : subject.grade}}</td>
                        </tr>
                    {% endfor %}
                    <tr>
                        <td colspan="2" rowspan="3">
                            <table style="width:100% !important; page-break-inside:avoid;" class="secondary-table">
                                <tr>
                                    <th style="border:none !important">Grade Details </th>
                                    <th style="border:none !important">Percentage Mark </th>
                                </tr>
                                {% for grade in data.examRegistrationData.semesterGradeDetails %}
                                <tr>
                                    <td>{{ grade.letterGrade }}</td>
                                    <td>{{ grade.name }}</td>
                                </tr>
                                {% endfor %}
                            </table>
                        </td>
                        <td colspan="2" style="height:19mm !important;">Total Marks</td>
                        <td>{{ student.semesterMarkObtained}}</td>
                    </tr>
                    <tr style='height: 7mm;line-height: 30px;'>
                        <td colspan="2" style="height:19mm !important;">Maximum Marks</td>
                        <td>{{ student.semesterTotalMarks}}</td>
                    </tr>
                     <tr class = ""style='height: 7mm;line-height: 30px;'>
                        <td colspan="2" style="height:19mm !important;">Overall Grade</td>
                        <td>{{student.failedStatus == 'FAILED' ? 'F' : student.semesterGrade}}</td>
                    </tr>
                </tbody>
            </table>
            <table style="width:100% !important; page-break-inside:avoid; margin: 40mm 0 0 0;" class="">
                <tr>
                    <td class="text-left bold" style="font-size:15px;"><div><b>Anju Mohan J </b></div><div style='padding-top:10px!important;'><b>Controller of Examination</b></div></td>
                    <td class="text-right bold" style="font-size:15px;"><div><b>Prof. (Dr.) B Sunil Kumar</b></div><div style='padding-top:10px!important;padding-right:30.5mm!important;'><b>Director</b></div></td>
                </tr>
            </table>
        </div>
    </div>
{% endfor %}
