{# Template For Assumption College PG 2023 onwards - Consolidated Mark Cum Grade Card #}
<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>
    .t13-fcmc .slant {
        white-space: normal;
        margin: 70% -65px;
        width: 180px;
        padding: 5px;
        -webkit-transform: rotate(270deg);
        -moz-transform: rotate(270deg);
        -ms-transform: rotate(270deg);
        -o-transform: rotate(270deg);
        transform: rotate(270deg) translateX(-10%);
        display: inline-block;
    }

    .t13-fcmc .table-head {
        font-size: 13px;
        padding: 2px;
    }

    .t13-fcmc .inner {
        width: 60px !important;
    }

    .t13-fcmc .mark-details tr,
    .t13-fcmc .student-details tr {
        height: 8mm !important;
    }

    .t13-fcmc .mark-details td,
    .t13-fcmc .mark-details caption {
        font-size: 13px;
        line-height: 14px;
        padding: 2px 2px !important;
    }

    .t13-fcmc .removeTdBorder {
        border-top: 0px none;
        border-bottom: 0px none;
        padding: 0 1px;
    }

    .t13-fcmc .removeTdBorder2 {
        border-top: 0px none;
        border-bottom: 0px none;
        padding: 0 1px;
    }

    .t13-fcmc .removeTdBorder3 {
        border-top: 0px none;
        border-bottom: 0px none;
        padding: 0 1px;
    }

    .t13-fcmc td,
    .t13-fcmc th {
        font-size: 18px;
        border: 1px solid #000;
        text-align: center;
        vertical-align: middle;
    }

    .t13-fcmc .subjectDetailList td {
        font-size: 22px !important;
        text-align: center;
        vertical-align: top;
        page-break-after: avoid;
        page-break-inside: avoid;
        page-break-before: avoid;
        line-height: 30px !important;
    }

    .t13-fcmc .b-0 {
        border: 0px none;
    }

    .t13-fcmc .student-details {
        height: 11mm !important;
    }

    @page {
        margin: 0;
    }

    .t13-fcmc .student-details td {
        font-size: 24px !important;
        line-height: 37px;
    }
    
    {% if not data.isPrint %}
        .t13-fcmc .student-details th {
            font-size: 26px !important;
            line-height: 35px;
            vertical-align: top !important;
        }
    {% else %}
        .t13-fcmc .student-details th {
            font-size: 26px !important;
            line-height: 65px;
            vertical-align: top !important;
        }
    {% endif %}

    .t13-fcmc .final-result th {
        font-weight: normal !important;
        font-size: 14px !important;
    }

    .t13-fcmc .final-result-data td {
        vertical-align: top !important;
        font-size: 15px !important;
    }

    .t13-fcmc .subject-details td {
        padding: 1mm 2px !important;
        font-size: 22px;
    }

    .t13-fcmc .subject-details th {
        font-size: 22px;
    }

    .t13-fcmc .subject-details {
        width: 99% !important;
    }

    .t13-fcmc * {
        font-family: 'Times New Roman', serif;
    }

    .t13-fcmc table {
        width: 100% !important;
    }

    .t13-fcmc tbody::after {
        content: '';
        display: block;
        page-break-after: always;
        page-break-inside: avoid;
        page-break-before: avoid;
    }

    @media print {
        .t13-fcmc tr.page-break {
            page-break-before: always !important;
        }
    }

    .t13-fcmc tr.page-break {
        page-break-before: always !important;
    }

    .t13-fcmc .subjectHead th {
        font-weight: bold !important;
        font-size: 22px;
        text-align: center;
    }

    .t13-fcmc .footer td {
        font-size: 22px;
    }

    .t13-fcmc tr {
        page-break-inside: avoid !important;
    }

    .t13-fcmc .grade-tables td {
        padding: 1mm 2px !important;
        font-size: 19px;
    }

    .t13-fcmc .grade-tables {
        width: 99% !important;
    }

    .t13-fcmc .semester-result th {
        font-weight: bold !important;
        text-align: center;
    }

    .t13-fcmc .w-90 {
        width: 98% !important;
    }

    .t13-fcmc hr {
        border: 1px solid #333;
        margin: 20px 0;
    }
</style>

{% if not data.isPrint %}
<style>
    .t13-fcmc td, .t13-fcmc th { font-size: 13px !important; }
    .t13-fcmc .subjectDetailList td { font-size: 14px !important; }
    .t13-fcmc .student-details td { font-size: 15px !important; }
    .t13-fcmc .student-details th { font-size: 16px !important; }
    .t13-fcmc .subject-details td { font-size: 14px !important; }
    .t13-fcmc .subject-details th { font-size: 14px !important; }
    .t13-fcmc .subjectHead th { font-size: 14px !important; }
    .t13-fcmc .footer td { font-size: 15px !important; }
    .t13-fcmc .grade-tables td { font-size: 13px !important; }
    .t13-fcmc p { font-size: 14px !important; }
    .t13-fcmc div { font-size: 14px !important; }
</style>
{% endif %}

<div class='t13-fcmc'>
    {% for student in data.studentData %}

        {% if data.isPrint %}
            <div style='page-break-before:always; float: left; padding:1% 5%'>
            </div>
            <div class='pages' style='page-break-after:always'>&nbsp;</div>
        {% endif %}

        <div>
            
            <table
                style='width: 100% !important; font-size:12pt !important; '
                cellpadding='0'
                cellspacing='0'
                border='0'
                class='b-0'
            >
                <tr class='student-details'>
                    <th colspan='2' style='text-align:center; text-transform: uppercase; font-weight:bold; padding:5mm 5mm;color:#000 !important;font-size: 26pt!important;' class='b-0'>  
                        <div style='height:30mm !important; text-align:center;'>
                            <img style = 'width: 50%; height: 100%; display:inline' src = '{{data.collegeData.collegeHeader}}'>
                        </div>
                    </th>
                </tr>
                <tr class='student-details'>
                    <td colspan='2' class='b-0' style='text-align:right;'><div style='margin-bottom:-10px; font-size:20px !important'>{{data.dateOfIssue}}</div></td>
                </tr>
                <tr class='student-details'>
                    <th colspan='2' style='text-align:center; text-transform: uppercase; font-weight:bold; padding:5mm 5mm;color:#000 !important;font-size: 26pt!important;' class='b-0'><div style='font-size: 26pt!important; margin-top:-40px !important'><b>Consolidated Mark Cum Grade Card</b></div></th>
                </tr>
                {% if student.studentImage %}
                    <tr class='student-details'>
                        <td style='text-align:center;' class='b-0' width='20%' colspan="2">
                            <img
                                src='{{ student.studentImage }}'
                                alt='Student Image'
                                style='float:center; width:3.6cm; height:4.4cm; margin-bottom:20px'
                            >
                        </td>
                    </tr>
                {% endif %}

                <tr class='student-details'>
                    <th style='text-align:left;' class='b-0' width='42%'>Name of Candidate</th>
                    <th style='text-align:left; text-transform: uppercase;' class='b-0' width='50%'>
                        : {{ student.name }}
                    </th>
                </tr>
                <tr class='student-details'>
                    <th style='text-align:left;' class='b-0 p-t-5' width='42%'>
                        Permanent Register Number (PRN)
                    </th>
                    <th style='text-align:left;' class='b-0 p-t-5' width='55%'>
                        : {{ student.regNo }}
                    </th>
                </tr>
                <tr class='student-details'>
                    <th style='text-align:left;' class='b-0 p-t-5'>Degree</th>
                    <th style='text-align:left;' class='b-0 p-t-5'>: {{ student.degreeDescription }}</th>
                </tr>
                <tr class='student-details'>
                    <th style='text-align:left;' class='b-0 p-t-5'>Programme</th>
                    <th style='text-align:left;' class='b-0 p-t-5'>: {{ student.streamDesc|default(student.programName) }}</th>
                </tr>
                <tr class='student-details'>
                    <th style='text-align:left;' class='b-0 p-t-5'>Faculty</th>
                    <th style='text-align:left;' class='b-0 p-t-5'>: {{ student.subsidiaryCourseName }}</th>
                </tr>
                <tr class='student-details'>
                    <th style='text-align:left;' class='b-0 p-t-5'>Date of Birth</th>
                    <th style='text-align:left;' class='b-0 p-t-5'>
                        : {{ student.dob ? student.dob : '' }}
                    </th>
                </tr>
                <tr class='student-details'>
                    <th style='text-align:left;' class='b-0 p-t-5'>Date of Eligibility for the Degree</th>
                    <th style='text-align:left;' class='b-0 p-t-5'>: {{ student.resultPublishDate }}</th>
                </tr>
            </table>

            <br/>

            <div style='page-break-before:always'></div>

            {# Subject marks table - 13 columns #}
            <table
                class='subject-details m-10 w-90'
                border='0'
                cellspacing='0'
                style='margin-bottom:20px; border-collapse: collapse;'
            >
                <tr style='height: 4mm !important;'>
                    <th
                        width='5%'
                        colspan='13'
                        style=' text-align:left; font-size:22px !important'
                        class='b-0'
                    >
                        <div style='height:16mm !important; text-align:left;'>
                            <img style = 'width: auto; height: 100%; display:inline' src = '{{data.collegeData.collegeHeader}}'>
                        </div>
                        Permanent Register Number (PRN): {{ student.regNo }}
                    </th>
                </tr>
                <tr style='height: 4mm !important;' class='subjectHead'>
                    <th rowspan='3' width='10%' style='text-align:center; padding: 10px; line-height:18px;'>
                        Course Code
                    </th>
                    <th rowspan='3' width='45%' style='text-align:center;'>Course Title</th>
                    <th rowspan='3' width='3%'>
                        <div class='slant'>Credits (C)</div>
                    </th>
                    <th width='16%' colspan='6' style='text-align:center; line-height:18px;'>
                        Marks
                    </th>
                    <th rowspan='3' width='3%'>
                        <div class='slant'>Grade Point (GP)</div>
                    </th>
                    <th rowspan='3' width='3%'>
                        <div class='slant'>Grade Awarded (G)</div>
                    </th>
                    <th rowspan='3' width='5%'>
                        <div class='slant'>Credit Point (CP)</div>
                    </th>
                    <th rowspan='3' width='5%' style='text-align:center; line-height:18px;'>&nbsp;&nbsp;Result&nbsp;&nbsp;</th>
                </tr>
                <tr style='height: 4mm !important;' class='subjectHead'>
                    <th width='8%' colspan='2'>ESA</th>
                    <th width='8%' colspan='2'>ISA</th>
                    <th width='8%' colspan='2'>Total</th>
                </tr>
                <tr style='height: 21mm !important;' class='subjectHead'>
                    <th width='4%'>
                        <svg width='5mm' height='35mm'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb; text-anchor: middle;'>Awarded</text>
                        </svg>
                    </th>
                    <th width='4%'>
                        <svg width='5mm' height='35mm'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb; text-anchor: middle;'>Maximum</text>
                        </svg>
                    </th>
                    <th width='4%'>
                        <svg width='5mm' height='35mm'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb; text-anchor: middle;'>Awarded</text>
                        </svg>
                    </th>
                    <th width='4%'>
                        <svg width='5mm' height='35mm'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb; text-anchor: middle;'>Maximum</text>
                        </svg>
                    </th>
                     <th width='4%'>
                        <svg width='5mm' height='35mm'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb; text-anchor: middle;'>Awarded</text>
                        </svg>
                    </th>
                    <th width='4%'>
                        <svg width='5mm' height='35mm'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb; text-anchor: middle;'>Maximum</text>
                        </svg>
                    </th>
                </tr>

                {% for term in student.academicTerms %}
                    <tbody>
                        <tr style='height: 8mm; line-height: 15px; page-break-before:always !important' class='page-break'>
                            <td colspan='13' style='font-weight:bold; text-align:left; padding-left:1% !important; '>
                                SEMESTER {{ term.romanNumber }}
                            </td>
                        </tr>

                        {% set prevCategoryId = null %}
                        {% for termSubjects in term.termSubjectTypes %}
                            {% if termSubjects.name %}
                                <tr style='height: 7mm; line-height: 15px;'>
                                    <td class='removeTdBorder3'>&nbsp;</td>
                                    <td class='removeTdBorder' style='text-align:left; font-weight:bold; font-size:22px'>
                                        {{ termSubjects.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='removeTdBorder2'></td>
                                </tr>
                            {% endif %}
                            {% for subject in termSubjects.subject %}
                                <tr style='height: 6mm;' class='subjectDetailList'>
                                    <td class='p-10 removeTdBorder3' style='padding-left:5px !important; text-align:left;' width='10%'>
                                        {{ subject.code }}
                                    </td>
                                    <td class='p-10 text-left removeTdBorder' style='text-align:left; padding-left:5px !important;' width='50%'>
                                        {{ subject.name }}
                                    </td>
                                    <td class='p-10 text-center removeTdBorder' width='3%'>
                                        {{ subject.markDetails.credit }}
                                    </td>
                                    {% if subject.markDetails.isExternal %}
                                        <td class='p-10 text-center removeTdBorder'>{{ subject.markDetails.attendanceStatus == 'ABSENT' ? 'AB' : subject.markDetails.attendanceStatus == 'MALPRACTICE' ? 'MAL' : subject.externalMark }}</td>
                                        <td class='p-10 text-center removeTdBorder'>{{ subject.externalMaxMark }}</td>
                                    {% else %}
                                        <td class='p-10 text-center removeTdBorder'>-</td>
                                        <td class='p-10 text-center removeTdBorder'>-</td>
                                    {% endif %}
                                    {% if subject.markDetails.isInternal %}
                                        <td class='p-10 text-center removeTdBorder'>{{ subject.internalMark }}</td>
                                        <td class='p-10 text-center removeTdBorder'>{{ subject.internalMaxMark }}</td>
                                    {% else %}
                                        <td class='p-10 text-center removeTdBorder'>-</td>
                                        <td class='p-10 text-center removeTdBorder'>-</td>
                                    {% endif %}
                                    <td class='p-10 text-center removeTdBorder'>{{ subject.markObtained }}</td>
                                    <td class='p-10 text-center removeTdBorder'>{{ subject.totalMarks }}</td>
                                   
                                    <td class='text-center removeTdBorder'>
                                        {{ subject.failedStatus == 'PASSED' ? subject.markDetails.gradePoint|number_format(2, '.') : '-' }}
                                    </td>
                                    <td class='text-center removeTdBorder'>
                                        {{ subject.grade }}
                                    </td>
                                    <td class='text-center removeTdBorder'>
                                        {{ subject.failedStatus == 'PASSED' ? subject.creditPoint|number_format(2, '.') : '-' }}
                                    </td>
                                    <td class='text-center removeTdBorder2'>
                                        {% if subject.failedStatus == 'PASSED' %}Pass
                                        {% else %}Fail{% endif %}
                                    </td>
                                </tr>
                            {% endfor %}
                        {% endfor %}
                    </tbody>
                {% endfor %}

                <tr>
                    <td class='removeTdBorder3' style='border-bottom:1px solid #000;'></td>
                    <td class='removeTdBorder3' style='border-bottom:1px solid #000; text-align:center'> ***End of Statement*** <br><br><br></td>
                    <td class='removeTdBorder3' style='border-bottom:1px solid #000;'></td>
                    <td class='removeTdBorder3' style='border-bottom:1px solid #000;'></td>
                    <td class='removeTdBorder3' style='border-bottom:1px solid #000;'></td>
                    <td class='removeTdBorder3' style='border-bottom:1px solid #000;'></td>
                    <td class='removeTdBorder3' style='border-bottom:1px solid #000;'></td>
                    <td class='removeTdBorder3' style='border-bottom:1px solid #000;'></td>
                    <td class='removeTdBorder3' style='border-bottom:1px solid #000;'></td>
                    <td class='removeTdBorder3' style='border-bottom:1px solid #000;'></td>
                    <td class='removeTdBorder3' style='border-bottom:1px solid #000;'></td>
                    <td class='removeTdBorder3' style='border-bottom:1px solid #000;'></td>
                    <td class='removeTdBorder2' style='border-bottom:1px solid #000;'></td>
                </tr>
            </table>

            {# Semester Results #}
            <div style='page-break-before:always'>
                <table
                    class='subject-details m-10'
                    border='0'
                    cellspacing='0'
                    style='line-height:30px; margin-bottom:10px; border-collapse: collapse; page-break-inside:auto'
                >
                    <tr style='height: 4mm !important;'>
                        <th colspan='9' style=' text-align:left;' class='b-0'>
                            <div style='height:16mm !important; text-align:left;'>
                                <img style = 'width: auto; height: 100%; display:inline' src = '{{data.collegeData.collegeHeader}}'>
                            </div>
                            SEMESTER RESULTS
                        </th>
                    </tr>
                    <tr style='height:8mm !important;' class='semester-result'>
                        <th width='15%'>Semester</th>
                        <th width='10%'>Marks Awarded</th>
                        <th width='10%'>Maximum Marks</th>
                        <th width='10%'>Credits</th>
                        <th width='10%'>SGPA</th>
                        <th width='10%'>Grade</th>
                        <th width='15%'>Month & Year of Passing</th>
                        <th width='10%'>Result</th>
                    </tr>
                    {% for term in student.academicTerms %}
                        <tr style='height: 4mm !important;'>
                            <td class='removeTdBorder1' style='text-align:center'>
                                Semester {{ term.romanNumber }}
                            </td>
                            <td class='removeTdBorder1'>
                                {{ term.failedStatus == 'PASSED' ? term.totalMarkObtained : '-' }}
                            </td>
                            <td class='removeTdBorder1'>{{ term.markDetails.totalMarks }}</td>
                            <td class='removeTdBorder1'>{{ term.markDetails.credit }}</td>
                            <td class='removeTdBorder1'>
                                {{ term.failedStatus == 'PASSED' ? term.sgpa|number_format(2, '.') : '-' }}
                            </td>
                            <td class='removeTdBorder1'>
                                {{ term.failedStatus == 'PASSED' ? term.grade : '-' }}
                            </td>
                            <td class='removeTdBorder1'>
                                {{ term.failedStatus == 'PASSED' ? term.examMonthYear : '-' }}
                            </td>
                            <td class='removeTdBorder1'>
                                {{ term.failedStatus == 'PASSED' ? 'Pass' : 'Fail' }}
                            </td>
                        </tr>
                    {% endfor %}
                    <tr style='height: 4mm !important;'>
                        <td style='text-align:center'>Total</td>
                        <td>{{ student.failedStatus == 'PASSED' ? student.markDetails.markObtained : '-' }}</td>
                        <td>{{ student.markDetails.totalMaxMark }}</td>
                        <td>{{ student.markDetails.credit}}</td>
                        <td colspan='4'></td>
                    </tr>
                </table>

                <br>

                {# Final Result #}
                <table
                    class='subject-details m-10 w-90'
                    border='0'
                    cellspacing='0'
                    style='margin-bottom:5px; border-collapse: collapse;'
                >
                    <tr style='height: 4mm !important;'>
                        <th colspan='10' style='text-align:left;' class='b-0'>
                            FINAL RESULT
                        </th>
                    </tr>
                    <tr style='height: 4mm !important;'>
                        <td width='100%' style='text-align:left;padding-left:10px!important;'>
                            CUMULATIVE GRADE POINT AVERAGE (CGPA) = {{ student.failedStatus == 'PASSED' ? student.cgpa : '-' }}
                            <span style='padding-left:50px !important;'></span>
                            <span style='padding-left:50px !important;'>GRADE = {{ student.grade }}</span>
                            {% if student.hasGraceMark %}
                                <span style='padding-right:50px!important; float:right'> *Grace Mark Awarded</span>
                            {% endif %}
                        </td>
                    </tr>
                </table>

                <table
                    style='width: 100%; font-size:15px; margin:auto; border-collapse: collapse; page-break-after:always; margin-top: 40px;'
                    cellpadding='0'
                    cellspacing='0'
                    border='0'
                    class='b-0'
                >
                    <tr style='height: 8mm !important;' class=''>
                        <td style='text-align:left; font-weight:bold; padding-top: 40px; font-size:22px;' class='b-0' colspan = '2'>
                            Entered by:
                        </td>
                    </tr>
                    <tr style='height: 8mm !important;' class=''>
                        <td style='text-align:left; font-weight:bold; padding-top: 40px; font-size:22px;' class='b-0' colspan = '2'>
                            Verified by:
                        </td>
                    </tr>
                    <tr style='height: 8mm !important;' class=''>
                        <td style='text-align:left; font-weight:bold; padding-top: 60px; font-size:22px;' class='b-0' width='50%'>
                            Controller of Examinations
                        </td>
                        <td style='text-align:left; font-weight:bold; padding-top: 60px; font-size:22px;' class='b-0' width='50%'>
                            Principal
                        </td>
                    </tr>
                </table>
            </div>
        </div>

    {% endfor %}
</div>
