{# Template For UG Students In MES  STJOSEPH Collagees   
Changes : No show percentage in each subject
            Show semester grade and SGPA #}
<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>
    @font-face {
      font-family: 'Caladea';
      src: url('https://fonts.gstatic.com/s/caladea/v7/kJFTS2t0STgjw6dfmnYdfA.ttf') format('truetype');
    }
    table {
        border-collapse: collapse;
        border-right-style: hidden;
        border-left-style: hidden;
    }
    #markTable{
      font-family: Caladea Times serif !important; /* caladea is an alternative font to cambria, looks the same */
    }
    .custom-h4{
      font-family: Caladea Times serif !important; /* one of the global css imports override the h4 tag to a default font */
    }
    /* Default markdisplay styles */
    .markdisplay {
        border-left-style: solid !important;
        border-right-style: solid !important;
        border-width: 1px !important;
    }
    .markdisplay th, .markdisplay td {
        border: 1px solid black;
    }
    .student-name{
        width:100%; 
        height:50px; 
        font-size:13px; 
        text-align:left;
    }
    .no-border-table tr td{
        border: 1px solid #fff !important;
    }
    .heading { font-weight: bold; }
    .footer-class { font-size: 13px; text-align: center; margin-top:100px !important;}
    .top { transform:rotate(270deg) translateX(10%); }
    .markdisplay tr.inner-tr:not(:last-child) td { border-bottom: 0; border-top: 0; }
    .markdisplay tr.inner-tr:last-child td { border-top: 0; }  
    .single-page {
        position: relative;
        width: 100%;
        height : 320mm; 
        page-break-after: always;
        box-sizing: border-box;
    }
    .print-footer {
        position: absolute;
        bottom: 3cm;
        width: 100%;
    }
    /* Border styles when isBorderEnabled is true */
    .with-borders {
        border: 1px solid #000 !important;
        padding: 0 !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }
    .with-borders #markTable {
        border: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .with-borders .student-name tr:first-child td {
        border-top: 1px solid #000 !important;
        border-bottom: 1px solid #000 !important;
        border-right: 1px solid #fff !important;
        border-left: 1px solid #fff !important;
    }
    .with-borders .student-name tr:last-child td {
        border: none !important;
        border-right: 1px solid #fff !important;
        border-left: 1px solid #fff !important;
    }
    .with-borders .markdisplay {
        border-left: none !important;
        border-right: none !important;
    }
    .with-borders .markdisplay th,
    .with-borders .markdisplay td {
        border: 1px solid #000 !important;
    }
    .with-borders .markdisplay th:first-child,
    .with-borders .markdisplay td:first-child {
        border-left: none !important;
    }
    .with-borders .markdisplay th:last-child,
    .with-borders .markdisplay td:last-child {
        border-right: none !important;
    }
    /* Hide borders when isBorderEnabled is false */
    .without-borders {
        border: none !important;
    }
    .without-borders #markTable {
        border: none !important;
    }
    .without-borders .student-name tr td {
        border: none !important;
    }
    .without-borders .markdisplay {
        border-left: 1px solid black !important;
        border-right: 1px solid black !important;
    }
    .without-borders .markdisplay th,
    .without-borders .markdisplay td {
        border-left: 1px solid black !important;
        border-right: 1px solid black !important;
        border-top: none !important;
        border-bottom: none !important;
    }
    .without-borders .markdisplay tr.heading th {
        border-top: 1px solid black !important;
        border-bottom: 1px solid black !important;
    }
    .without-borders .markdisplay tr:last-child td {
        border-bottom: 1px solid black !important;
    }
    @media print {
        .with-borders {
            border: 1px solid #000 !important;
            padding: 0 !important;
            box-sizing: border-box !important;
            margin: 0 auto !important;
            page-break-inside: avoid;
        }
        .with-borders .student-name tr:first-child td {
            border-top: 1px solid #000 !important;
            border-bottom: 1px solid #000 !important;
        }
        .single-page {
            width: 100%;
            max-width: 100%;
            height: 315mm;
        }
    }
</style>
{% for student in data.studentData %}
    <div class="single-page {{ data.displayContentOptions.isBorderEnabled ? 'with-borders' : 'without-borders' }}">
        {% set trcolSpan =  7 %}
        <table id='markTable' style=" margin:0 auto; text-align:center;width: 100%; font-size:13px;" cellpadding="0" cellspacing="0" border="0">
            <tr class="no-border-tr">
                <td style="height:auto; vertical-align:top; text-align:left;" >
                    {% if data.displayContentOptions.collegeHeaderAndLogoFlag == '1' %}
                        {% if data.displayContentOptions.isShowStudentImageInMarkCards %}
                            <table style="width: 100%;">
                                <tr>
                                    <td style="text-align:center;">
                                        <img style='height:40mm !important; width:auto;' src="{{data.collegeAndOtherData.collegeHeader}}" class="college-header">
                                    </td>
                                    <td style="text-align:right; vertical-align:top;">
                                        <img width='100' height='110' src='{{student.myImage}}'>
                                    </td>
                                </tr>
                            </table>
                        {% else %}
                        <div style="text-align:center;">
                            <img style='height:40mm !important; width:auto;' src="{{data.collegeAndOtherData.collegeHeader}}" class="college-header">
                        </div>
                        {% endif %}
                    {% endif %}
                     {% if data.displayContentOptions.changeResultSheetDateAsTrDateAndAddFooterInBottom %}
                        <div style="width:67%;margin:5px auto; padding-top:40px;text-align:center;">
                            <h4 class="custom-h4" style = 'text-decoration:underline;'><b>{{data.displayContentOptions.regularMarkCardTitle}}</b></h4>
                        </div>
                    {% else %}
                        <div style="width:67%;margin:5px auto;text-align:center;">
                            <h4 class="custom-h4" style = 'text-decoration:underline;'><b>{{data.displayContentOptions.regularMarkCardTitle}}</b></h4>
                        </div>
                    {% endif %}
                    <div style='width:78%;margin:5px auto;text-align:center;margin-left: 11%;'>
                       <span style="font-size:18px;">
                        {% if data.displayContentOptions.isShowExamRegistrationNameAsHeader %}
                                <b>{{data.examRegistrationData.name |upper}} </b>
                            {% else %}
                            {% if data.displayContentOptions.examinationNameFlag == '1' %}
                            <b>{{data.examRegistrationData.name}}</b>
                            {% else %}
                                  <b>{{data.examRegistrationData.semInFullName |upper}} SEMESTER {{student.degreeName }} REGULAR EXAMINATIONS - {{data.examRegistrationData.examMonthName |upper}} {{data.examRegistrationData.examYear}} </b>
                            {% endif %}
                         {% endif %}   
                        </span>
                    </div>
                    {# <hr /> #}
                </td>
            </tr>
            <tr class="no-border-tr ">
                <td style="text-align:center; border-bottom:1px solid #fff !important; padding-top:1cm;">
                    <table cellpadding="1" cellspacing="0" border="0" class="student-name no-border-table" style="width:100%;">
                        <tr>
                            <td style="text-align:left;">
                                <span style="margin-left:10px; font-weight:bold; font-size: 16px;">Programme : {{data.examRegistrationData.programName}}</span>
                            </td>
                            <td style="text-align:right;">
                                {% if data.displayContentOptions.enableDateFlag == '1' %}
                                    <span style="margin:23px; font-weight:normal;">
                                        {% if data.displayContentOptions.changeResultSheetDateAsTrDateAndAddFooterInBottom %}
                                            <span style="font-weight:bold;">Result Published Date : {{ data.displayContentOptions.resultPublishTrDate }}</span>
                                        {% else %}
                                            <span style="font-weight:bold;">Date : {{ data.displayContentOptions.markListDate }}</span>
                                        {% endif %}
                                    </span>
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;">
                                <span style="margin-left:10px; font-size:16px; font-weight:bold;">Name :&nbsp;{{student.name | upper}}</span>
                            </td>
                            <td style="text-align:right;">
                                <span style="margin:23px; font-size:16px; font-weight:bold;">Register No : {{student.registerNo}}</span>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                {% if student.isResultBlocked %}
                    <td style="border:1px solid #fff !important;color:red; padding-top:1cm;" class="full-width pull-left text-center bold" >
                        {{student.blockingMsg |raw}}
                    </td>
                {% else %}
                    <td style="border:1px solid #fff !important; padding-top:.5cm;">
                        <table class="markdisplay" cellpadding="0" cellspacing="0" border="0" align="left" style="font-size:15px;">
                            <tr style="height:60px;" class='heading'>
                                <th width='20%' style="text-align:center;padding: 15px 10px;word-break:break-word;white-space:normal;">Course Code</th>
                                <th width='55%' style="text-align:center;padding: 15px 10px;">Title of Course</th>
                                <th width='7%' style="text-align:center;padding: 15px 5px;">Grade Obtained</th>
                                <th width='5%' style="text-align:center;padding: 15px 5px;">Grade Point (G)</th>
                                <th width='5%' style="text-align:center;padding: 15px 5px;">Credit (C)</th>
                                <th width='4%' style="text-align:center;padding: 15px 5px;">Credit Point (C*G)</th>
                                <th width='4%' style="text-align:center;padding: 15px 5px;">Status</th>
                            </tr>
                            {% set slno = 0 %}
                            {% for subject in student.subjects %}
                                {% set grade = subject.grade %}
                                {% if data.displayContentOptions.showGradAsAbsent and subject.attendanceStatus == "ABSENT" %}
                                    {% set grade = "AB" %}
                                {% endif %}
                                {% if subject.highlightExcludeSubjects %}
                                <tr style="height:45px;" class='inner-tr'>
                                    <td class="bold align-middle" style="text-align:left; vertical-align: middle; word-break:break-word; white-space:normal; max-width: 110px; padding-right: 15px; padding-top: 8px; padding-bottom: 8px;"> &nbsp; {{subject.code |raw}}*</td>
                                    <td class="align-middle" style="text-align:left; vertical-align: middle; padding-left:15px; word-wrap: break-word; padding-top: 8px; padding-bottom: 8px;">{{subject.name |raw}}</td>
                                    <td class="bold align-middle text-center " style="padding-top: 8px; padding-bottom: 8px;">{{ grade }}</td>
                                    <td class="bold align-middle text-center " style="padding-top: 8px; padding-bottom: 8px;">{{subject.gradePoint}}</td>
                                    <td class="bold align-middle text-center " style="padding-top: 8px; padding-bottom: 8px;">{{subject.credit}}</td>
                                    <td class="bold align-middle text-center " style="padding-top: 8px; padding-bottom: 8px;">{{subject.creditGradePoint}}</td>
                                    <td class="bold align-middle text-center " style="padding-top: 8px; padding-bottom: 8px;">{{subject.failedStatus == 'FAILED' ? 'F': 'P'}} </td>
                                </tr>
                                {% else %}
                                <tr style="height:45px;" class='inner-tr'>
                                    <td class="align-middle" style="text-align:left; vertical-align: middle; word-break:break-word; white-space:normal; max-width: 110px; padding-right: 15px; padding-top: 8px; padding-bottom: 8px;">&nbsp;{{subject.code |raw}}</td>
                                    {% if data.displayContentOptions.changeResultSheetDateAsTrDateAndAddFooterInBottom %}
                                        <td class="align-middle" style="text-align:left; vertical-align: middle; padding-left:15px; word-wrap: break-word; padding-top: 8px; padding-bottom: 8px;">&nbsp;{{subject.name |raw | upper}}</td>
                                    {% else %}
                                       <td class="align-middle" style="text-align:left; vertical-align: middle; padding-left:15px; word-wrap: break-word; padding-top: 8px; padding-bottom: 8px;">&nbsp;{{subject.name |raw}}</td>
                                    {% endif %}
                                    <td class="align-middle text-center " style="padding-top: 8px; padding-bottom: 8px;">{{subject.excludeSubjectFromTotal == "1" ? "-" : grade }}</td>
                                    <td class="align-middle text-center " style="padding-top: 8px; padding-bottom: 8px;">{{subject.excludeSubjectFromTotal == "1" ? "-" :subject.gradePoint}}</td>
                                    <td class="align-middle text-center " style="padding-top: 8px; padding-bottom: 8px;">{{subject.excludeSubjectFromTotal == "1" ? "-" :subject.credit}}</td>
                                    <td class="align-middle text-center " style="padding-top: 8px; padding-bottom: 8px;">{{subject.excludeSubjectFromTotal == "1" ? "-" :subject.creditGradePoint}}</td>
                                    <td class="align-middle text-center " style="padding-top: 8px; padding-bottom: 8px;">{{subject.failedStatus == 'FAILED' ? 'F': 'P'}} </td>
                                </tr>
                                {% endif %}
                            {% endfor %}
                        </table>
                    </td>
                {% endif %}
            </tr>
            <tr class="no-border-tr">
                <td>
                    {% if student.failedStatus == 'PASSED' or data.isGradeCardSelected == '' %}
                        <table cellpadding="0" cellspacing="0" border="0" style="width:100%;margin:8px auto 0; text-align:center; font-size:15px;" class="no-border-table">
                            <tr style="height:30px;" >
                                <td  style="width:40%;text-align:left;"><b style = 'padding-left: 8%;'>CREDIT POINT OF {{data.examRegistrationData.semInFullName |upper}}  SEMESTER : {{student.failedStatus == 'FAILED' ? '-': student.creditGradePoint}}</b></td>
                                <td  style="width:30%;text-align:center;padding:0 0 0 80px;"><b>SGPA : {{student.failedStatus == 'FAILED' ? '-': student.semesterSgpa}}</b></td>
                                <td  style="width:30%;text-align:right;"><b style = 'margin-right: 8%;'> GRADE : {{student.failedStatus == 'FAILED' ? '-': student.semesterGrade}}</b></td>
                            </tr>
                            <tr style="height:17px;">
                                        {% if data.displayContentOptions.footerFlag == '1' %}

                                <td style = 'text-align:left;'><div style = 'margin-left: 8%; margin-top: 20px;'>
                                    {% if data.examRegistrationData.passCriteria.overallPassCriteria
                                      and data.examRegistrationData.passCriteria.externalPassCriteria
                                    %}
                                        For a pass in each course, {{data.examRegistrationData.passCriteria.overallPassCriteria}}% aggregate (internal and external put together) with a minimum of {{data.examRegistrationData.passCriteria.externalPassCriteria}}% in external or P grade is necessary
                                    {% endif %}
                                    </div></td>
                                    {% endif %}
                                <td style = 'text-align:center;padding:0 0 0 80px; white-space: nowrap;'>
                                    {% if not data.displayContentOptions.hidePercentageAndChangeWordings %}
                                        <span><b>Percentage of Marks : {{student.failedStatus == 'FAILED' ? '-' : student.semesterPercentage}}</b></span>
                                    {% endif %}
                                </td>
                            </tr>
                        </table>
                    {% endif %}
                    {% if data.displayContentOptions.changeResultSheetDateAsTrDateAndAddFooterInBottom %}
                        <div style="margin-top: 30px; padding-left: 3%; text-align:left" >Issued Date : {{ data.displayContentOptions.markListDate }}</div>
                    {% endif %}
                </td>
            </tr>
            {% if student.haveExcludeSubjectFromTotal and student.batchOptionName == 'BVOC' %}
            <tr class='no-border-tr'>
               <td colspan="3">
                <table cellpadding="0" cellspacing="0" border="0" style="width:100%;margin:0 auto; text-align:center; font-size:15px;" class="no-border-table">
                    <tr style="height:17px;"><td style = 'text-align:left;padding-left:3%;'><div>* Credits of Audit Course are not added for SGPA/CGPA. Audit courses are mandatory for pass and completion of programme.</div></td></tr>
                </table>
                </td>
            </tr>
            {% endif %}
            {% if not data.isStudentSideExamResult %}
                <tr class="no-border-tr">
                    <td >
                            <table class='footer-class no-border-table' border="0" style='width:100%;margin-top: 5%; font-size: 16px;'>
                                        <tr style='display: flex; justify-content: space-between; align-items: flex-end;'>
                                    <td style='width:33%; text-align: center;'>
                                        {% if data.displayContentOptions.principalSignFlag == '1' %}
                                            {% if data.displayContentOptions.changeResultSheetDateAsTrDateAndAddFooterInBottom %}
                                                <img src='{{data.collegeAndOtherData.principalSign}}' style='width:160px;height:60px;padding-left:10px;'/> 
                                            {% else %}
                                                <img src='{{data.collegeAndOtherData.principalSign}}' style='width:100px;height:40px;padding-left:10px;'/> 
                                            {% endif %}
                                            <br/>
                                        {% endif %}
                                        {% if data.displayContentOptions.principalNameFlag == '1' %}
                                            <b style='padding-left: 16px;padding-right: 1px; white-space: nowrap;'>{{data.collegeAndOtherData.principalName}}</b>
                                        {% endif %}
                                        {% if data.displayContentOptions.principalLabelFlag == '1' %}
                                            </br><span style='padding-left: 16px;padding-right: 1px; white-space: nowrap;'><b>Principal</b></span>
                                        {% endif %}
                                        {% if data.displayContentOptions.principalSealFlag == '1' %}
                                            <br> <img src='{{data.collegeAndOtherData.principalSeal}}' style='width:150px;height:70px;padding-left:10px;'/> 
                                        {% endif %}
                                    </td>
                                    <td style='width:33%; text-align: center;' >
                                        {% if data.displayContentOptions.collegeSealFlag == '1' %}
                                            <img src='{{data.collegeAndOtherData.collegeSeal}}' style='width:110px;height:auto;padding-left:10px;'/> 
                                        {% elseif data.displayContentOptions.collegeSealLabelFlag == '1' %}
                                            <br/>
                                            <br/>
                                            <br/>
                                            <b>Seal</b>
                                        {% endif %}
                                    </td>
                                    <td style='width:33%; text-align: center;' >
                                        {% if data.displayContentOptions.examControllerSignFlag == '1' %}
                                            {% if data.displayContentOptions.changeResultSheetDateAsTrDateAndAddFooterInBottom %}
                                                <img src='{{data.collegeAndOtherData.coeSign}}' style='width:160px;height:60px;padding-left:10px;'/>
                                            {% else %}
                                                <img src='{{data.collegeAndOtherData.coeSign}}' style='width:100px;height:40px;padding-left:10px;'/>
                                            {% endif %}
                                            <br/>
                                        {% endif %}
                                        {% if data.displayContentOptions.examControllerNameFlag == '1' %}
                                            <b style='padding-left:6px;padding-right: 0px; white-space: nowrap;'>{{data.collegeAndOtherData.examControllerName}}</b>
                                        {% endif %}
                                        {% if data.displayContentOptions.examControllerLabelFlag == '1' %}
                                            </br><span style='padding-left: 16px;padding-right: 1px; white-space: nowrap;'><b>Controller of Examinations</b></span>
                                        {% endif %}
                                        {% if data.displayContentOptions.coeSealFlag == '1' %}
                                              <br><img src='{{data.collegeAndOtherData.coeSeal}}' style='width:150px;height:70px;padding-left:10px;'/> 
                                        {% endif %}
                                    </td>
                                </tr>
                            </table>
                    </td>
                </tr>
            {% endif %}
            {% if data.displayContentOptions.disclaimerFlag == '1' or data.isStudentSideExamResult %}
            <tfoot>
                <tr class="no-border-tr">
                    <td style="text-align:left;padding-left:5px;padding-right:5px; padding-top: 50px">
                        <b>Disclaimer :</b>
                        The office of the Controller of Examinations is not responsible for any inadvertent error that may have crept in the information being published in the site. The details published are for immediate information of the candidate and cannot be treated as original documents. The final mark sheets issued by the College should only be treated as authentic and final.
                    </td>
                </tr>
            </tfoot>
            {% endif %}
        </table>
    </div>
{% endfor %}
