{# Template For MBA Students In SB Collage
 #}
<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'>
<link href="https://fonts.googleapis.com/css2?family=Stardos+Stencil&display=swap" rel="stylesheet">

<style>
     td, th { padding: 5px; color: #000!important;}
  
   
    .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;
    }
    .pages {
        width: 95%;
        padding: 17mm 13mm 5mm 13mm;
        margin: 1cm auto;
        background: no-repeat;
        -webkit-background-size: contain;
        -moz-background-size: contain;
        -o-background-size: contain;
        background-size: contain;
        page-break-before: always;
        height: 297mm;
        font-family: Times New Roman, Times, serif!important;
    }
    .subHeading{
        font-size:16px!important; 
        border-left: 1px solid #000 !important;
        border-right: 1px solid #000 !important;
        border-bottom: 1px solid #000 !important;
        border-top: 1px solid #000 !important;
        padding:2mm;
    }
    .subject-details td{
        vertical-align:top !important;
        padding: 2px 2px !important;
        line-height: normal !important;
    }
    .subject-details tr th{
        border-left: 1px solid #000;
        border-right: 1px solid #000;
        border-bottom: 1px solid #000;
        border-top: 1px solid #000;
        padding:2px;
        font-size: 17px!important;
        text-align: center;
    }
    .subject-details tr td{
        border-left: 1px solid #000;
        border-right: 1px solid #000;
        border-bottom: none;
        border-top: none;
        padding:2mm;
        font-size:17px!important;
    }
    .subject-details tr:last-child {
        border-bottom: 1px solid #000;
    }
    .student-details td, .student-details th{
        font-size:14pt !important;
        padding:1px!important;
        vertical-align:top !important;
    }
    .student-details tr{
        height:5mm !important;
    }
    .student-details td{
        font-size:19px!important; 
        line-height:20px !important;
    }
    .student-details th{
        font-size:19px!important; 
    }
    .bold{
        font-weight: bold;
    }
    .stardos-stencil-bold {
        font-family: "Stardos Stencil", system-ui!important;
        font-weight: 700 !important;;
        font-style: normal !important;;
    }
</style>
{% for student in data.studentData %}
    <div class="pages" style=" no-border">
        {% set trcolSpan =  14 %}
        <table style = 'width: 100%;font-size:18px;margin-top:10px' cellpadding='0' cellspacing='0' border='0' class='b-0 student-details'>
            <thead>
                <tr class="no-border">
                    <td colspan="3" class="  no-border" style="text-align:center;" data-f-bold='true' data-a-h='center'  >
                        <div style = 'width: auto; height:160px;'></div>
                    </td>
                </tr>
                <tr>
                    <td width='100%' colspan="3" class="no-border stardos-stencil-bold" style='text-align:center; text-transform: uppercase; font-weight:bold; padding:5mm 5mm;color:#002072 !important;font-size: 26pt!important;' data-f-bold='true' data-a-h='center' >
                        {% if data.examRegistrationData.semInSemNumber != 4 %}
                            <b>Mark Cum Grade Card</b>
                        {% endif %}
                    </td>
                </tr>
                 <tr>
                    <td width='100%' colspan="3" class="  no-border" style='height: 10mm; text-align:center; text-transform: uppercase; font-weight:bold; padding:1mm 5mm;' data-f-bold='true' data-a-h='center' >
                    </td>
                </tr>
                <tr class="student-details">
                    <td class=''class="" style='text-align:left; '>
                        Name of Candidate 
                    </td>
                    <th style='text-align:left;' class='b-0'>
                        : {{student.name}}
                    </th>
                    <td  class="no-border" style='text-align:right; 'rowspan='6' width='15%' >
                        {% if data.displayContentOptions.enableDateFlag == '1' %}
                            <div style='width:150px; text-align: center; float:right; font-size:20px; margin:-5mm 0 0 0;padding-left:5mm;'> {{ data.displayContentOptions.markListDate }}</div>
                        {% endif %}
                        <img src='{{student.myImage}}' alt='Student Image' style='height:33mm !important; width: 30mm; margin-top: 5px;float: right;'>
                    </td>
                </tr>
                <tr class="student-details">
                    <td class=''class="" style='text-align:left;  width:31%;'>
                        Permanent Register Number (PRN)
                    </td>
                    <th style='text-align:left;' class='b-0'>
                        : {{student.registerNo}}
                    </th>
                </tr>
                <tr class="student-details">
                    <td class=''class="" style='text-align:left; '>
                        Degree
                    </td>
                    <th style='text-align:left;' class='b-0'>
                        : {{data.examRegistrationData.degreeName}}
                    </th>
                </tr>
                <tr class="student-details">
                    <td class=''class="" style='text-align:left; '>
                        Programme
                    </td>
                    <th style='text-align:left;' class='b-0'>
                        : {{data.examRegistrationData.streamDesc|default(data.examRegistrationData.programName)}}
                    </th>
                </tr>
                <tr class="student-details">
                    <td class=''class="" style='text-align:left; '>
                        Faculty
                    </td>
                    <th style='text-align:left;' class='b-0'>
                        : {{data.examRegistrationData.subsidiaryCourseName}}
                    </th>
                </tr>
                <tr class="student-details">
                    <td class=''class="" style='text-align:left; '>
                        Name of Examination
                    </td>
                    <th style='text-align:left; padding: 1px !important;' class='b-0'>
                        <table cellpadding='0' cellspacing='0' border='0' style='width:100%;'>
                            <tr>
                                <td style='vertical-align:top; width:9px;  padding:0 !important;' class="bold">:</td>
                                <td style='vertical-align:top; padding:0 !important;' class="bold">{{data.examRegistrationData.name}}</td>
                            </tr>
                        </table>
                    </th>
                </tr>
            </thead>
        </table>
        <table  class='subject-details'  cellpadding='0' cellspacing='0' border='0' align='left' style='margin-bottom:5px; margin-top:5px; border-collapse: collapse;line-height: 14px; min-height:17cm'>
            <thead>
                <tr style='height: 4mm !important;'>
                    <th rowspan='3' width='9%' style='text-align:center;padding: 10px;line-height:18px;' class='syllabusCode1'>Course Code</th>
                    <th rowspan='3' width='54%' 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 (C)</text>
                        </svg>
                    </th>
                    <th width='12%' colspan='6' style='text-align:center;line-height:18px;'>Marks</th>
                    <th rowspan='3' width='3%'>
                        <svg width='5mm' height='42mm'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>
                            Grade Awarded (G)</text>
                        </svg>
                    </th>
                    <th rowspan='3' width='3%'>
                        <svg width='5mm' height='38mm'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>
                            Grade Point (GP)</text>
                        </svg>
                    </th>
                
                    <th rowspan='3' width='3%'>
                        <svg width='5mm' height='38mm'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>
                            Credit Point (CP)</text>
                        </svg>
                    </th>
                    <th rowspan='3' width='3%'>
                        <svg width='5mm' height='50mm'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>
                            Institution Average (IA)</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='4%' colspan='2' style='text-align:center;'>
                        ESA
                    </th>
                    <th width='4%' colspan='2' style='text-align:center;'>
                        ISA
                    </th>
                    <th width='4%' colspan='2' style='text-align:center;'>
                        Total
                    </th>
                </tr>
                <tr style='height: 21mm !important;'>
                    <th width='2%'>
                        <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='2%'>
                        <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='2%'>
                        <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='2%'>
                        <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='2%'>
                        <svg width='8mm' height='35mm'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>Awarded </text>
                        </svg>
                    </th>
                    <th width='2%'>
                        <svg width='5mm' height='25mm'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>Maximum</text>
                        </svg>
                    </th>
                </tr>
            </thead>
            <tbody>
                {% set slno = 0 %}
                {% for academicSubjectType in student.academicSubjectTypes %}
                    {% if academicSubjectType.isElective %}
                        <tr style='height:5mm;line-height: 15px;'>
                            <td class="align-middle" ></td>
                            <td class="align-middle" style="text-align:left; font-weight:bold; border-left:none !important; border-right:none !important;">
                                {{ academicSubjectType.name }}
                            </td>
                            <td class="align-middle"></td>
                            <td class="align-middle"></td>
                            <td class="align-middle"></td>
                            <td class="align-middle"></td>
                            <td class="align-middle"></td>
                            <td class="align-middle"></td>
                            <td class="align-middle"></td>
                            <td class="align-middle"></td>
                            <td class="align-middle"></td>
                            <td class="align-middle"></td>
                            <td class="align-middle"></td>
                            <td class="align-middle"></td>
                        </tr>
                    {% endif %}
                    {% for subject in academicSubjectType.subjects %}
                                <tr style='height:5mm;line-height: 15px;'>
                                    <td class="align-middle " style=" vertical-align:top !important; text-align:left;">{{subject.code}}</td>
                                    <td class="align-middle " style=" vertical-align:top !important; text-align:left;">{{subject.name}}</td>
                                    <td class="align-middle text-center ">{{subject.credit}}</td>
                                    {% if subject.isExternal %}
                                        {% if subject.attendanceStatus == 'ABSENT'%}
                                            <td class="align-middle text-center ">AB</td>
                                            <td class="align-middle text-center ">{{subject.externalMaxMark}}</td>
                                        {% elseif subject.attendanceStatus == 'MALPRACTICE'%}
                                            <td class="align-middle text-center ">MAL</td>
                                            <td class="align-middle text-center ">{{subject.externalMaxMark}}</td>
                                        {% elseif subject.failedStatus == 'FAILED' and data.examRegistrationData.isFinalTerm %}
                                            <td class="align-middle text-center ">-</td>
                                            <td class="align-middle text-center ">{{subject.externalMaxMark}}</td>
                                        {% else %}
                                            <td class="align-middle text-center ">{{subject.externalMark}}</td>
                                            <td class="align-middle text-center ">{{subject.externalMaxMark}}</td>
                                        {% endif %}
                                    {% else %}
                                        <td class="align-middle text-center ">-</td>
                                        <td class="align-middle text-center ">-</td>
                                    {% endif %}
                                    {% if subject.isInternal %}
                                        {% if subject.isInternalFailed == 'ABSENT'%}
                                            <td class="align-middle text-center">AB</td>
                                            <td class="align-middle text-center ">{{subject.internalMaxMark}}</td>
                                        {% else %}
                                            <td class="align-middle text-center ">{{subject.internalMark}}</td>
                                            <td class="align-middle text-center ">{{subject.internalMaxMark}}</td>
                                        {% endif %}
                                    {% else %}
                                        <td class="align-middle text-center ">-</td>
                                        <td class="align-middle text-center ">-</td>
                                    {% endif %}
                                
                                    {% if subject.failedStatus == 'ABSENT'%}
                                        <td class="align-middle text-center ">AB</td>
                                        <td class="align-middle text-center ">{{subject.totalMaxMark}}</td>
                                    {% else %}
                                        <td class="align-middle text-center ">{{subject.markObtained}}</td>
                                        <td class="align-middle text-center ">{{subject.totalMaxMark}}</td>
                                    {% endif %}
                                   {% if subject.failedStatus == 'FAILED'%}
                                        <td class="align-middle text-center ">{{subject.grade}}</td>
                                        <td class="align-middle text-center ">-</td>
                                        <td class="align-middle text-center ">-</td>
                                    {% else %}
                                        <td class="align-middle text-center ">{{subject.grade}}</td>
                                        <td class="align-middle text-center ">{{subject.gradePoint}}</td>
                                        <td class="align-middle text-center ">{{subject.creditGradePoint}}</td>
                                    {% endif %}
                                    
                                    <td class="align-middle text-center ">{{subject.institutionAvg}}</td>
                                    <td class="align-middle text-center ">{{subject.failedStatus == 'FAILED' ? 'Fail': 'Pass'}}</td>
                                </tr>
                    {% endfor %}
                {% endfor %}
                
                <tr style='height: 7mm;line-height: 15px;font-weight:bold'>
                    <td class = ' text-center '>&nbsp;</td>
                    <td class = '' style='text-align:left; font-weight:bold; padding:0 2mm; padding-top:15px; text-transform:uppercase;'>Total </td>
                    <td class = 'text-center '>{{student.semesterCredit}}</td>
                    <td class = 'text-center '></td>
                    <td class = 'text-center '></td>
                    <td class = 'text-center '></td> 
                    <td class = 'text-center '></td>
                    {% if student.failedStatus == 'FAILED' %}
                        <td class = 'text-center '>-</td>
                    {% else %}
                        <td class = 'text-center '>{{student.semesterMarkObtained}}</td>
                    {% endif %}
                    <td class = 'text-center '>{{student.semesterTotalMarks}}</td>
                    <td class = 'text-center '></td>
                    <td class = 'text-center '></td>
                    {% if student.failedStatus == 'FAILED' %}
                        <td class = 'text-center ' style=' padding-top:15px;' >-</td>
                        <td class = 'text-center '></td>
                        <td class = 'text-center '>Fail</td>
                    {% else %}
                        <td class = 'text-center ' style=' padding-top:15px;' >{{ student.creditGradePoint}}</td>
                        <td class = 'text-center '></td>
                        <td class = 'text-center '>Pass</td>
                    {% endif %}
                    
                </tr>
                <tr style='height: 7mm;line-height: 15px;'>
                    <td class = ' text-center '>&nbsp;</td>
                    <td class = ' ' style='text-align:left; font-weight:bold; padding:0 2mm; padding-top:15px; text-transform:uppercase;'> 
                        SGPA: {{student.failedStatus == 'FAILED' ? ' - ' : student.semesterSgpa}} &nbsp; &nbsp; SG: {{ student.semesterGrade}}
                    </td>
                    <td class = 'text-center '></td>
                    <td class = 'text-center '></td>
                    <td class = 'text-center '></td>
                    <td class = 'text-center '></td> 
                    <td class = 'text-center '></td>
                    <td class = 'text-center '></td>
                    <td class = 'text-center '></td>
                    <td class = 'text-center '></td>
                    <td class = 'text-center '></td>
                    <td class = 'text-center '></td>
                    <td class = 'text-center '></td>
                    <td class = 'text-center '></td>
                </tr>
                <tr style='height: 7mm;line-height: 15px;'>
                    <td class = 'text-center'>&nbsp;</td>
                    <td class = 'text-center' style='padding-top:5px !important;padding-bottom:5px !important'>***End of Statement***</td>
                    <td class = 'text-center'></td>
                    <td class = 'text-center'></td>
                    <td class = 'text-center'></td> 
                    <td class = 'text-center'></td>
                    <td class = 'text-center'></td>
                    <td class = 'text-center'></td>
                    <td class = 'text-center'></td>
                    <td class = 'text-center'></td>
                    <td class = 'text-center'></td>
                    <td class = 'text-center'></td>
                    <td class = 'text-center'></td>
                    <td class = 'text-center '></td>
                </tr>
                
             </tbody>
        </table>
        {% if data.examRegistrationData.isFinalTerm %}
            <table class='subject-details m-10 w-90' border='1' cellspacing='0' style='margin-bottom:20px; border-collapse: collapse; width:100%'>
                <tr> 
                    <td colspan="9"> <div class="text-center bold fs-16" style='font-size:18px;'><b>Programme Results</b></div> </td>
                </tr>
                <tr style='height: 4mm !important;'>
                    <th class='text-center' width='8%'>
                    Semester  
                    </th>
                    <th class='text-center' width='10%'>
                        Marks
                        Awarded 
                    </th>
                    <th class='text-center' width='10%'>
                        Maximum
                        Marks  
                    </th>
                    <th class='text-center' width='8%'>
                        Credits 
                    </th>
                    <th class='text-center' width='10%'>
                        Credit Points 
                    </th>
                    <th class='text-center' width='10%'>
                    {{data.additionalInfo.SGPAorSCPA}} 
                    </th>
                    <th class='text-center' width='9%'>
                        Grade 
                    </th>
                    <th class='text-center' width='20%'>
                        Month & Year of Passing 
                    </th>
                    <th class='text-center' width='15%'>
                        Result 
                    </th>
                </tr>
                {% for semResult in student.programmeResults %}
                    <tr>
                        <td class = 'removeTdBorder text-center'> {{semResult.semInRoman}} </td>
                        {% if semResult.failedStatus == 'FAILED' and semResult.isFinalTerm %}
                            <td class = 'removeTdBorder text-center'>-</td>
                        {% else %}
                            <td class = 'removeTdBorder text-center'> {{semResult.totalMarks}} </td>
                        {% endif%}
                        <td class = 'removeTdBorder text-center'> {{semResult.examTotalMarks}} </td>
                        <td class = 'removeTdBorder text-center'> {{semResult.credit}} </td>
                        {% if semResult.failedStatus == 'FAILED' and semResult.isFinalTerm %}
                            <td class = 'removeTdBorder text-center'>-</td>
                        {% else %}
                            <td class = 'removeTdBorder text-center'> {{semResult.creditGradePoint}} </td>
                        {% endif%}
                        <td class = 'removeTdBorder text-center'> {{semResult.sgpa}} </td>
                        <td class = 'removeTdBorder text-center'> {{semResult.grade}} </td>
                        {% if semResult.failedStatus == 'FAILED'  %}
                            <td class = 'removeTdBorder text-center'>-</td>
                        {% else %}
                            <td class = 'removeTdBorder text-center'> {{semResult.lastExamYearMonth}} </td>
                        {% endif%}
                        {% if semResult.failedStatus == 'FAILED' %}
                            <td class = 'removeTdBorder text-center'>Fail</td>
                        {% else %}
                            <td class = 'removeTdBorder text-center'>Pass</td>
                        {% endif%}
                    </tr>
                {% endfor %}
                <tr style='height: 4mm !important; border-top:1px solid #000 !important;'>
                    <td class="text-center bold" width='10%'>
                        TOTAL
                    </td>
                    {% if student.failedStatus == 'FAILED' and data.examRegistrationData.isFinalTerm %}
                        <td class="text-center bold" width='10%'>-</td>
                    {% else %}
                            <td class="text-center bold" width='10%'>
                            {{student.totalMarkObtained}}
                        </td>
                    {% endif%}
                    <td class="text-center bold" width='10%'>
                        {{student.totalMark}}
                    </td>
                    <td class="text-center bold" width='10%'>
                        {{student.credit}}
                    </td>
                    {% if student.failedStatus == 'FAILED' and data.examRegistrationData.isFinalTerm %}
                        <td class="text-center bold" width='10%'>-</td>
                    {% else %}
                            <td class="text-center bold" width='10%'>
                            {{student.courseCreditGradePoint}}
                        </td>
                    {% endif%}
                    <td width='5%' colspan='4' class='bold'>
                        FINAL RESULT:  {{data.additionalInfo.CGPAorCCPA}} =  {{student.cgpa}}; GRADE= {{student.grade}}
                    </td>
                </tr>
            </table>
        {% endif %}
        </div>
    </div>
{% endfor %}
