
<link href='https://fonts.googleapis.com/css2?family=Times New Roman:ital,wght@0,400;0,700;1,400;1,700&display=swap' rel='stylesheet'>
<style id="print-style">
    .p-5{
        padding: 5mm;
    }
    .primary-table table,.secondary-table table{
        border-collapse: collapse !important;
        page-break-inside: auto;
    }
    .primary-table th{
        text-align:center;
        background: none !important;
        height: 5mm  !important;
        border:1px solid #000 !important;
        padding: 0 2mm !important;
    }
    .primary-table td{
        padding: 2mm;
        line-height:15px !important;
        height:6mm !important;
        border:1px solid #000;
        text-align:center;
        vertical-align:middle !important;
    }
    @media screen{
        .page-a4{
            width: 21cm !important;
            padding-left:1cm !important;
            margin: auto;
        }
    }
    .page-a4{
        width: 100%; 
        border: none; 
        page-break-before: always;
        position: relative;
        min-height:27.5cm;
    }
    .border-0{
        border:none !important;
    }
    .bold {
        font-weight: 700 !important;
    }
    .text-center{
        text-align:center;
    }
    .text-left{
        text-align:left !important;
    }
    .text-right{
        text-align:right !important;
    }
    .college-head{
        text-align: left !important;
        font-weight: bold !important;
        font-size: 17pt !important;
        line-height: 25px !important;
        font-family: 'Museo Sans 300' !important;
    }
    .college-name{
        text-align: left !important;
        font-size: 13pt !important;
        line-height: 19px !important;
        font-family: 'Trebuchet MS' !important;
    }
    .college-name-container{
        height: 100%;
        padding: 2mm 0mm;
        margin-left: 2mm;
        float: right;
    }
    .secondary-table td{
        padding: 2mm;
        line-height:15px !important;
        height:6mm !important;
        border:none;
        text-align:center;
        vertical-align:middle !important;
    }
    @font-face {
        font-family: 'Trebuchet MS';
        src: url('Trebuchet MS.otf');
    }

    .student-details td{
        font-size:17px!important; 
        line-height:20px !important;
    }
    .student-details th{
        font-size:17px!important; 
    }
    .b-0 {
        border: 0px none;
    }
    .removeTdBorder 
    {
        border-top: 0px none;
        border-bottom: 0px none;
    }
    .subject-details td{
        vertical-align:top !important;
        padding: 2px 2px !important;
        font-size:15px !important;
        line-height: normal;
    }
    * {
        font-family: "Times New Roman", Times, serif;
    }
    .subject-details th{
        text-align:center;
        font-size:14px !important;
    }
    .pageFooter {
        position: absolute;
        bottom: 0;
        width: 100%;
        text-align:center !important;
    }
</style>
{% for student in data.studentData %}
    <div class="page" style="border:none;">
        {% for index,semMark in student.academicTerms %}
            {% if semMark.termId == student.finalSem %}
                <div class="page-a4">
                    <div style='width: 100%; height:15mm; float:left; margin: 0;'>
                        {% if student.courseCompleteWithinYear != 1 and student.failedStatus != 'FAILED' %}
                            <div style='font-size:17px;margin-top:20px;float:left; width:50%; font-weight:bold'><span style='border: 1px solid #000;'>CONSOLIDATED MARK CUM GRADE CARD </span><br>
                                <span>Period of Study: {{student.yearOfStudy}} </span>
                            </div>
                            <span style='font-size:17px;margin-top:20px;width:34%; float:right;  font-weight:bold'>Date of Consolidation: <span style='margin-left:68px'>{{ data.additionalInfo.currentDate }} </style><br>
                            Date of Passing the Programme: {{student.programPassingDate}} </span>
                            </div><div style='padding-bottom:20px;width: 100%; height:3mm; float:left;'>
                        {% endif %}
                    </div>
                    <div style='text-align:center; font-size:32px !important; font-weight:bold; width: 100%; float:left;margin-bottom: 10px;margin-top:150px'>
                            GRADE CARD
                    </div>
                    <table style="width:100% !important; margin:0mm 0 0 0; page-break-inside:avoid;" class=" student-details b-0">
                        <tr class='student-details'>
                            <td style='text-align:left;' class='b-0'>
                                Name of the Candidate 
                            </td>
                            <th style='text-align:left;' class='b-0'>
                                : {{student.name}}
                            </th>
                            <td style='text-align:left;' class='b-0' rowspan='6' width='20%'>
                                <div style='width:110px; text-align: center; float:right; font-size:17px; margin:-10mm 0 0 0;'>{{data.additionalInfo.currentDate}}</div>
                                <img src='{{student.myImage}}' alt='Student Image' style='float:right; margin:0 4mm 0 0;width:3.3cm; height:3.8cm'>
                            </td>
                        </tr>
                        <tr class='student-details'>
                            <td style='text-align:left;' class='b-0' width='30%'>
                            Register Number
                            </td>
                            <th style='text-align:left;' class='b-0' width='55%'>
                                : {{student.regNo}}
                            </th>
                        </tr>
                        <tr class='student-details'>
                            <td style='text-align:left;' class='b-0'>
                                Programme
                            </td>
                            <th style='text-align:left;' class='b-0'>
                                : {{student.programName}}
                            </th>
                        </tr>
                        <tr class='student-details'>
                            <td style='text-align:left;' class='b-0'>
                            Name of Examination
                            </td>
                            <th style='text-align:left;' class='b-0'>
                                : {{student.examRegName}}
                            </th>
                        </tr>
                    </table>
                    <table class='subject-details' border='1' cellspacing='0' style='margin-bottom:5px; margin-top:15px; border-collapse: collapse !important;width:100%'>
                        <tr style='height: 4mm !important;'>
                            <th rowspan='3' width='12%' style='text-align:center;padding: 10px;line-height:18px;' class='syllabusCode1'>Course Code</th>
                            <th rowspan='3' width='50%' style='text-align:center;'>Course Title</th>
                            <th rowspan='3' width='3%'>
                                <svg width='5mm' height='25mm'>
                                    <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>Credits</text>
                                </svg>
                            </th>
                            <th width='18%' colspan='4' style='text-align:center;line-height:18px;'>Grade Point Averages</th>
                            <th rowspan='3' width='3%'>
                                <svg width='10mm' height='30mm'>
                                    <text transform='rotate(180)' y='-50%' x='-25%' style='writing-mode: tb;text-anchor: middle;'>
                                    GPA for the</text>
                                    <text transform='rotate(180)' y='-50%' x='-75%' style='writing-mode: tb;text-anchor: middle;'>
                                    Course</text>
                                </svg>
                            </th>
                            <th rowspan='3' width='3%'>
                                <svg width='10mm' height='30mm'>
                                    <text transform='rotate(180)' y='-50%' x='-25%' style='writing-mode: tb;text-anchor: middle;'>
                                    Institution</text>
                                    <text transform='rotate(180)' y='-50%' x='-75%' style='writing-mode: tb;text-anchor: middle;'>
                                    Average</text>
                                </svg>
                            </th>
                            <th rowspan='3' width='3%'>
                                <svg width='10mm' height='30mm'>
                                    <text transform='rotate(180)' y='-50%' x='-25%' style='writing-mode: tb;text-anchor: middle;'>
                                    Grade</text>
                                    <text transform='rotate(180)' y='-50%' x='-75%' style='writing-mode: tb;text-anchor: middle;'>
                                    Awarded</text>
                                </svg>
                            </th>
                            <th rowspan='3' width='5%' style='text-align:center;line-height:18px;'>Result</th>
                        </tr>
                        <tr style='height: 4mm !important;'>
                            <th width='6%' colspan='2' class="text-center">
                                Theory
                            </th>
                            <th width='6%' colspan='2' class="text-center">
                                Practical
                            </th>
                        </tr>
                        <tr style='height: 6mm !important;'>
                            <th width='3%'>
                                <svg width='5mm' height='15mm'>
                                    <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>
                                        ISA
                                    </text>
                                </svg>
                            </th>
                            <th width='3%'>
                                <svg width='5mm' height='15mm'>
                                    <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>ESA</text>
                                </svg>
                            </th>
                            <th width='3%'>
                                <svg width='5mm' height='15mm'>
                                    <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>
                                        ISA
                                    </text>
                                </svg>
                            </th>
                            <th width='3%'>
                                <svg width='5mm' height='15mm'>
                                    <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>ESA</text>
                                </svg>
                            </th>
                        </tr>

                        {% for subjectCategoryWiseMarkDataObj in semMark.subjectCategoryWiseMarkData %}
                            {% if subjectCategoryWiseMarkDataObj.isSubjectCategory %}
                                {% if subjectCategoryWiseMarkDataObj.canShowCategoryHead or data.additionalInfo.courseType == 'UG' %}
                                    <tr style='height: 6mm;line-height: 15px;'>
                                        <td class = 'removeTdBorder'>&nbsp;</td>
                                        <td class = 'removeTdBorder' style='text-align:left; font-weight:bold'>{{subjectCategoryWiseMarkDataObj.name}}</td>
                                        <td class = 'removeTdBorder'></td>
                                        <td class = 'removeTdBorder'></td>
                                        <td class = 'removeTdBorder'></td> 
                                        <td class = 'removeTdBorder'></td>
                                        <td class = 'removeTdBorder'></td>
                                        <td class = 'removeTdBorder'></td>
                                        <td class = 'removeTdBorder'></td>
                                        <td class = 'removeTdBorder'></td>
                                        <td class = 'removeTdBorder'></td>
                                        <td class = 'removeTdBorder'></td>
                                        {# <td class = 'removeTdBorder'></td> #}
                                        <td class = 'removeTdBorder'></td>	
                                    </tr>
                                {% endif%}
                            {% endif%}
                            {% for subjectId in subjectCategoryWiseMarkDataObj.subjectIds %}
                                {% for subject in semMark.subjects %}
                                    {% if subject.paperSubjetId ==  subjectId %}
                                        <tr class = "subject-details">
                                            <td class = 'removeTdBorder'> {{subject.code|raw}}</td>
                                            <td class = 'removeTdBorder' class="text-left"> {{subject.name|raw}}</td>
                                            <td class = 'removeTdBorder text-center'> {{subject.hideGrade ? '--' : subject.markDetails.credit}}</td>
                                            {% if subject.isTheory %}
                                                <td class = 'removeTdBorder text-center'> 
                                                    {% if subject.markDetails.attendanceStatus == 'PRESENT' %}
                                                    {{subject.markDetails.isExternal ? subject.markDetails.percentageObtainedExternal : '-'}}
                                                    {% else %}
                                                        {% if subject.markDetails.attendanceStatus == 'ABSENT' %}
                                                        AB
                                                        {% elseif subject.markDetails.attendanceStatus == 'MAL' %}
                                                        MAL
                                                        {% else %}
                                                        -
                                                        {% endif %}
                                                    {% endif %}
                                                </td>
                                                <td class = 'removeTdBorder text-center'> {{subject.markDetails.isInternal ? subject.markDetails.percentageObtainedInternal : '-'}}</td>
                                                <td class = 'removeTdBorder text-center'> - </td>
                                                <td class = 'removeTdBorder text-center'> - </td>
                                            {% else %}
                                                <td class = 'removeTdBorder text-center'> - </td>
                                                <td class = 'removeTdBorder text-center'> - </td>
                                                <td class = 'removeTdBorder text-center'> 
                                                    {% if subject.markDetails.attendanceStatus == 'PRESENT' %}
                                                    {{subject.markDetails.isExternal ? subject.markDetails.percentageObtainedExternal : '-'}}
                                                    {% else %}
                                                        {% if subject.markDetails.attendanceStatus == 'ABSENT' %}
                                                        AB
                                                        {% elseif subject.markDetails.attendanceStatus == 'MAL' %}
                                                        MAL
                                                        {% else %}
                                                        -
                                                        {% endif %}
                                                    {% endif %}
                                                </td>
                                                <td class = 'removeTdBorder text-center'> {{subject.markDetails.isInternal ? subject.markDetails.percentageObtainedInternal : '-'}}</td>
                                            {% endif %}

                                            {% if subject.failedStatus == 'FAILED'%}
                                                <td class="removeTdBorder text-center ">-</td>
                                                <td class="removeTdBorder text-center "></td>
                                                <td class="removeTdBorder text-center ">-</td>
                                            {% else %}
                                                <td class="removeTdBorder text-center ">{{subject.markDetails.gradePoint}}</td>
                                                <td class="removeTdBorder text-center "></td>
                                                <td class="removeTdBorder text-center ">{{subject.markDetails.grade}}</td>
                                            {% endif %}
                                            <td class="removeTdBorder text-center ">{{subject.failedStatus == 'FAILED' ? 'Failed': 'Passed'}}</td>
                                        </tr>
                                    {% endif%}
                                {% endfor %}
                            {% endfor %}
                        {% endfor %}
                        <tr style='height: 7mm;line-height: 15px;'>
                            <td class = 'removeTdBorder'>&nbsp;</td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td> 
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                        </tr>
                        {% for index,semDetails in  student.academicTerms %}
                            <tr style='height: 7mm;line-height: 15px;'>
                                <td class = 'removeTdBorder'>&nbsp;</td>
                                <td class = 'removeTdBorder'>	SEMESTER {{semDetails.semInRoman}} SGPA ({{semDetails.lastExamYearMonth}})</td>
                                <td class = 'removeTdBorder text-center'>{{semDetails.markDetails.credit}}</td>
                                <td class = 'removeTdBorder'></td>
                                <td class = 'removeTdBorder'></td> 
                                <td class = 'removeTdBorder'></td>
                                <td class = 'removeTdBorder'></td>
                                <td class = 'removeTdBorder text-center'>
                                    {% if semDetails.failedStatus == 'PASSED' %}
                                        {{semDetails.markDetails.sgpa|number_format(student.roundOff, '.')}}
                                    {% else %}
                                        -
                                    {% endif %}
                                </td>
                                <td class = 'removeTdBorder text-center'></td>
                                <td class = 'removeTdBorder text-center'> {{semDetails.grade}} </td>
                                <td class = 'removeTdBorder text-center'> {{semDetails.failedStatus == 'FAILED' ? 'Failed': 'Passed'}} </td>
                            </tr>
                        {% endfor %}

                        <tr style='height: 7mm;line-height: 15px;'>
                            <td class = 'removeTdBorder'>&nbsp;</td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td> 
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                        </tr>
                        <tr style='height: 7mm;line-height: 15px;'>
                            <td class = 'removeTdBorder'>&nbsp;</td>
                            <td class = 'removeTdBorder' style='text-align:left; text-transform:uppercase;'>
                            	FINAL RESULT (CGPA)
                            </td>
                            <td class = 'removeTdBorder text-center'>{{student.markDetails.credit}}</td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td> 
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder text-center'>{{ student.failedStatus == 'FAILED' ? '-' : student.cgpa}}</td>
                            <td class = 'removeTdBorder text-center'></td>
                            <td class = 'removeTdBorder text-center'> {{student.grade}} </td>
                            <td class = 'removeTdBorder text-center'> {{ student.failedStatus == 'FAILED' ? 'Failed' : 'Passed'}} </td>
                        </tr>
                        <tr style='height: 7mm;line-height: 15px;'>
                            <td class = 'removeTdBorder'>&nbsp;</td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td> 
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                        </tr>
                        <tr style='height: 7mm;line-height: 15px;'>
                            <td class = 'removeTdBorder'>&nbsp;</td>
                            <td class = 'removeTdBorder text-center'> ***End of Statement*** </td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td> 
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                            <td class = 'removeTdBorder'></td>
                        </tr>
                        <tr style='height: 10mm;line-height: 15px;'>
                            <td class = 'removeTdBorder' style='border-bottom:1px solid #000;'>&nbsp;</td>
                            <td class = 'removeTdBorder' style='border-bottom:1px solid #000;'></td>
                            <td class = 'removeTdBorder' style='border-bottom:1px solid #000;'></td>
                            <td class = 'removeTdBorder' style='border-bottom:1px solid #000;'></td>
                            <td class = 'removeTdBorder' style='border-bottom:1px solid #000;'></td> 
                            <td class = 'removeTdBorder' style='border-bottom:1px solid #000;'></td>
                            <td class = 'removeTdBorder' style='border-bottom:1px solid #000;'></td>
                            <td class = 'removeTdBorder' style='border-bottom:1px solid #000;'></td>
                            <td class = 'removeTdBorder' style='border-bottom:1px solid #000;'></td>
                            <td class = 'removeTdBorder' style='border-bottom:1px solid #000;'></td>
                            <td class = 'removeTdBorder' style='border-bottom:1px solid #000;'></td>
                        </tr>
                    </table>
                </div>
            {% endif %}
        {% endfor %}
    </div> 
{% endfor %}