{# Template For MIC College PG  - 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: 11pt;
        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: 12pt;
        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 .removeTdBorder4 {
        border-left: 0px none;
        border-right: 0px none;
    }

    .t13-fcmc .removeTdBorder5 {
        border-left: 0px none;
        border-right: 0px none;
        border-top: 0px none;
    }

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

    .t13-fcmc .subjectDetailList td {
        font-size: 12pt !important;
        text-align: center;
        vertical-align: middle;
        page-break-after: avoid;
        page-break-inside: avoid;
        page-break-before: avoid;
        line-height: 20px !important;
    }

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

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

    @page {
        margin: 0;
    }

    .t13-fcmc .student-details td {
        font-size: 11.5pt !important;
        line-height: 18px;
    }

        .t13-fcmc .student-details th {
            font-size: 12pt !important;
            line-height: 65px;
            vertical-align: top !important;
        }
    .t13-fcmc .final-result th {
        font-weight: normal !important;
        font-size: 12pt !important;
    }

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

    .t13-fcmc .subject-details td {
        padding: 0mm 2px !important;
        font-size: 12pt;
    }

    .t13-fcmc .subject-details th {
        font-size: 12pt;
    }

    .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: 12pt;
        text-align: center;
    }

    .t13-fcmc .footer td {
        font-size: 12pt;
    }

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

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

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

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

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

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

    .t13-fcmc .page-footer {

    }
</style>


<div class='t13-fcmc'>
    {% for student in data.studentData %}
        {% if student.failedStatus == 'FAILED'%}
        <div style='page-break-before:always'>
            <table
                style='width: 100% !important; font-size:12pt !important; '
                cellpadding='0'
                cellspacing='0'
                border='0'
                class='b-0'
            >
                <tr class='student-details'>
                    <td colspan='4' style='text-align:center; padding: 20px;' class='b-0'>
                        <div style='font-size: 13pt!important; font-weight: bold; color: #d32f2f;'>
                            MARKS CARD NOT AVAILABLE FOR {{student.registerNo}}
                        </div>
                        <div style='font-size: 12pt!important; padding-top: 10px;'>
                            Student has FAILED and is not eligible for consolidated marks card.
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        {% else %}
            <div style='page-break-before:always;'>

                <table
                    style='width: 99% !important; font-size:12pt !important; '
                    cellpadding='0'
                    cellspacing='0'
                    border='0'
                    class='b-0'
                >
                    <tr class='student-details'>
                        <td colspan='4' style='text-align:center;' class='b-0'>
                            <div style='font-size: 14pt!important; line-height: normal; padding:3px'>
                                <b>MAR IVANIOS COLLEGE (AUTONOMOUS), THIRUVANANTHAPURAM </b>
                            </div>
                            <div style='font-size: 14pt!important; line-height: normal; padding:3px'>
                                (Affiliated to University of Kerala, Thiruvananthapuram - 695 034)
                            </div>
                            <div style='font-size: 14pt!important; line-height: normal; padding:3px'>
                                <b>P.G. Degree Examination - CONSOLIDATED STATEMENT OF MARKS </b>
                            </div>
                            <hr style='margin:3px 0'>
                        </td>
                    </tr>

                    <tr class='student-details'>
                        <td style='text-align:left;' class='b-0' width='14%'>Course & Branch</td>
                        <td style='text-align:left; ' class='b-0' width='56%'>
                            : {{ student.programName }}
                        </td>
                        <td style='text-align:left;' class='b-0' width='17%'>Year of Admission</td>
                        <td style='text-align:left; ' class='b-0' width='13%'>
                            : {{ student.batchStartYear }}
                        </td>
                    </tr>
                    <tr class='student-details'>
                        <td style='text-align:left;' class='b-0' width='14%'>Student Name </td>
                        <td style='text-align:left; ' class='b-0' width='56%'>
                            : {{ student.name }}
                        </td>
                        <td style='text-align:left;' class='b-0' width='17%'>Period of Study </td>
                        <td style='text-align:left; ' class='b-0' width='13%'>
                            : {{ student.batchStartYear }} - {{ student.batchEndYear }}
                        </td>
                    </tr>
                    <tr class='student-details'>
                        <td style='text-align:left;' class='b-0' width='14%'>Register Number </td>
                        <td style='text-align:left; ' class='b-0' width='56%'>
                            : {{ student.registerNo }}
                        </td>
                        <td style='text-align:left;' class='b-0' width='17%'>Month & Year of Passing</td>
                        <td style='text-align:left; ' class='b-0' width='13%'>
                            : {{ student.latestExamMonthYear|date('F Y') }}
                        </td>
                    </tr>
                    <tr class='student-details'>
                        <td style='text-align:left;' class='b-0' width='14%'>College Center Code </td>
                        <td style='text-align:left; ' class='b-0' width='56%'>
                            : 120
                        </td>
                        <td style='text-align:left;' class='b-0' width='17%'>Dated</td>
                        <td style='text-align:left; ' class='b-0' width='13%'>
                            : {{ data.dateOfIssueFormat2 }}
                        </td>
                    </tr>
                </table>


                <table
                    class='subject-details m-10 w-100'
                    border='0'
                    cellspacing='0'
                    style='margin-bottom:20px; border-collapse: collapse;margin-top:3px;'
                >
                    <colgroup>
                        <col width='9%'>
                        <col width='6%'>
                        <col width='28%'>
                        <col width='8%'>
                        <col width='8%'>
                        <col width='8%'>
                        <col width='8%'>
                        <col width='8%'>
                        <col width='8%'>
                        <col width='9%'>
                    </colgroup>
                    <tr style='height: 4mm !important;' class='subjectHead'>
                        <th rowspan='2' width='10%' style='text-align:center; padding: 10px; line-height:18px;'>
                            Subject Code
                        </th>
                        <th rowspan='2' colspan='2' width='45%' style='text-align:center;'>Subject Name</th>
                        <th width='16%' colspan='2' style='text-align:center; line-height:18px;'>CA Marks</th>
                        <th width='16%' colspan='2' style='text-align:center; line-height:18px;'>ESA Marks</th>
                        <th width='16%' colspan='2' style='text-align:center; line-height:18px;'>Total Marks</th>
                        <th width='16%' rowspan='2' style='text-align:center; line-height:18px;'>Month & Year</th>
                    </tr>
                    <tr style='height: 4mm !important;' class='subjectHead'>
                        <th width='8%'>Marks <br> Scored</th>
                        <th width='8%'>Max.<br> Marks</th>
                        <th width='8%'>Marks <br> Scored</th>
                        <th width='8%'>Max.<br> Marks</th>
                        <th width='8%'>Marks <br> Scored</th>
                        <th width='8%'>Max.<br> Marks</th>
                    </tr>
                    <tbody>
                        {% for term in student.academicTerms %}
                            <tr style='height: 7mm; line-height: 15px;'>
                                <td colspan='10' style='font-weight:bold; text-align:center;' class='removeTdBorder4'>
                                    SEMESTER {{ term.semInRomanLetter }}
                                </td>
                            </tr>

                            {% for subject in term.subjects %}
                                <tr style='height: 6mm;' class='subjectDetailList'>
                                    <td class='p-10 ' style='padding-left:5px !important; text-align:center;' width='7%'>
                                        {{ subject.code }}
                                    </td>
                                    <td class='p-10 text-left ' colspan='2' style='text-align:left; padding-left:5px !important;' width='53%'>
                                        {{ subject.name | raw}}
                                    </td>
                                    <td class='p-10 text-center ' width='3%'>
                                        {{ subject.isInternal ? subject.internalMark : '-' }}
                                    </td>
                                    <td class='p-10 text-center ' width='3%'>
                                        {{ subject.isInternal ? subject.internalMaxMark : '-' }}
                                    </td>
                                    {% if subject.isExternal %}
                                        <td class='p-10 text-center '>{{ subject.attendanceStatus == 'ABSENT' ? 'AB' : subject.attendanceStatus == 'MALPRACTICE' ? 'MAL' : subject.externalMark }}</td>
                                        <td class='p-10 text-center '>{{ subject.externalMaxMark }}</td>
                                    {% else %}
                                        <td class='p-10 text-center '>-</td>
                                        <td class='p-10 text-center '>-</td>
                                    {% endif %}
                                    <td class='p-10 text-center '>{{ subject.markObtained }}</td>
                                    <td class='p-10 text-center '>{{ subject.totalMarks }}</td>
                                    <td class='text-center '>
                                        {{ subject.examMonthYear }}
                                    </td>
                                </tr>
                            {% endfor %}
                            <tr style='height: 8mm; line-height: 15px;'>
                                <td colspan='7' style='font-weight:bold; text-align:left;'>
                                <span style='margin-left:100px'> SEMESTER TOTAL </span>
                                </td>
                                <td colspan='1' style='font-weight:bold; text-align:center; '>{{term.failedStatus == 'PASSED' ? term.semesterMarkObtained : '-'}}</td>
                                <td colspan='1' style='font-weight:bold; text-align:center; '>{{term.semesterTotalMarks}}</td>
                                <td colspan='1' style='font-weight:bold; text-align:center; '></td>
                            </tr>
                        {% endfor %}
                        <tr style='height: 8mm; line-height: 15px;'>
                            <td rowspan='2' colspan='2' style='font-weight:bold; text-align:center;'>
                                GRAND TOTAL 
                            </td>
                            <td colspan='5' style='font-weight:bold; text-align:left;border-right:none; '>IN FIGURES:</td>
                            <td colspan='1' style='font-weight:bold; text-align:center;border-left:none;    '>{{student.failedStatus == 'PASSED' ? student.markObtained : '-'}}</td>
                            <td colspan='1' style='font-weight:bold; text-align:center; '>{{student.totalMarks}}</td>
                            <td colspan='1' style='font-weight:bold; text-align:center; '></td>
                        </tr>
                        <tr style='height: 8mm; line-height: 15px;'>
                            <td colspan='8' style='font-weight:bold; text-align:left; text-transform:uppercase '>IN WORDS: {{student.failedStatus == 'PASSED' ? student.markObtainedInWords|join(' ') : '-'}}</td>
                        </tr>
                        <tr style='height: 8mm; line-height: 15px;'>
                            <td colspan='10' style='font-weight:bold; text-align:left; '>  &nbsp; &nbsp; RESULT:
                                {% if student.failedStatus == 'PASSED'%}
                                    PASSED IN {{student.class}}
                                {% else%}
                                    FAILED
                                {% endif %}
                            </td>
                        </tr>
                    </tbody>
                </table>

                {% if student.additionalCourses is defined and student.additionalCourses is not empty %}
                    <table
                        class='subject-details m-10 w-100'
                        border='0'
                        cellspacing='0'
                        style='margin-top:3px; border-collapse: collapse;'
                    >
                        <tr class='subjectHead'>
                            <th class='removeTdBorder5' colspan='{{ student.additionalCourseColumns|length + 1 }}' style='text-align:center; font-weight:bold; padding:6px;'>
                                Details of SWAYAM-NPTEL Online Courses Undertaken 
                            </th>
                        </tr>
                        <tr class='subjectHead'>
                            <th style='text-align:center; padding:4px; width:10%;'>Sl. No</th>
                            {% for colName in student.additionalCourseColumns %}
                                <th style='text-align:center; padding:4px;'>{{ colName }}</th>
                            {% endfor %}
                        </tr>
                        {% for row in student.additionalCourses %}
                            <tr>
                                <td style='text-align:center; padding:4px;'>{{ loop.index }}</td>
                                {% for cell in row %}
                                    <td style='text-align:center; padding:4px;'>{{ cell }}</td>
                                {% endfor %}
                            </tr>
                        {% endfor %}
                    </table>
                {% endif %}
            </div>
        {% endif %}
    {% endfor %}

   
</div>
