{# Template For UG Students In SHC Collagees  #}
<style>
    @media print {
        #printBtnDiv { display : none !important; }
    }
	.primary-table {
		border-collapse: collapse !important;
		page-break-inside: auto;
		width: 100% !important;
	}

	.primary-table th {
		text-align: center;
		background: none !important;
		height: 4mm !important;
		border: 1px solid #000 !important;
		padding: 1mm !important;
	}
	.primary-table td {
		padding: 3px;
		line-height: 20px !important;
		height: 4mm !important;
		border: 1px solid #000;
		text-align: center;
		vertical-align: middle !important;
	}
	#succesRateReportHeader {
		width: 100% !important;
		height: 4mm !important;
	}

	#succesRateReportHeader td {
		padding: 2mm;
		line-height: 15px !important;
		height: 4mm !important;
		border: 1px solid #000;
		vertical-align: middle !important;
	}
	#subjectHeader {
		width: 100% !important;
	}
	#subjectHeader td {
		padding: 2mm;
		line-height: 15px !important;
		height: 4mm !important;
		vertical-align: middle !important;
		text-align: center !important;
	}
	.no-border {
		border-left: 1px solid #fff !important;
		border-right: 1px solid #fff !important;
		border-top: 1px solid #fff !important;
        border-bottom: 1px solid #fff !important;
	}
	.college-header {
		height: 35mm;
		width: auto;
		margin: 0 10%;
	}
    .text-left{
        text-align:left!important;
    }
    .text-center{
        text-align:center!important;
    }
    .text-right{
        text-align:right!important;
    }
    .p-t-20{
        padding-top:10px!important;
    }
	.p-t{
        padding-top:35mm!important;
    }
	
    .p-b-10{
        padding-bottom:10px!important;
    }
    .p-20{
        padding:20px!important;
    }
    .outer-border {
        border: 1px solid black;
        border-collapse: collapse;
    }
    .center {
        margin-left: auto;
        margin-right: auto;
    }
    .abbr-table td{
        padding: 2mm 10mm 2mm 10mm;
		line-height: 14px !important;
		margin-top:5mm;
    }
	.removeTdBorder{
		border-left:1px solid #fff !important;
		border-right:1px solid #fff !important;
		border-bottom:1px solid #fff !important;
		border-top:1px solid #fff !important;
	}
	.tabular-table {
		border-collapse: collapse !important;
		page-break-inside: auto;
		page-break-after:always;
		width: 100% !important;
	}

	.tabular-table th {
		text-align: center;
		background: none !important;
		height: 3mm !important;
		/* border: 1px solid #000 !important; */
		padding: 1mm !important;
	}
	.tabular-table-border{
		border: 1px solid #000 !important;
	}
	.tabular-table td {
		padding: 2px;
		line-height: 20px !important;
		height: 4mm !important;
		border: 1px solid #000;
		text-align: center;
		vertical-align: middle !important;
		/* page-break-after:always; */
	}
	.tabular-table tr{
		/* page-break-after:always; */
		height: 6mm !important;
	}
	.small-font{
		font-weight: normal !important;
		font-size: 15px !important;
	}
	.failed{
		background-color:#c0c0c0 !important;
	}
    .b-b-0{
        border-bottom:none !important;
    }
    .b-t-0{
        border-top:none !important;
    }
    .b-r-0{
        border-right:none !important;
    }
    .b-l-0{
        border-left:none !important;
    }
    #details-table tr{
        height:5mm !important;
    }
    tr.head-details-main th{
        line-height:5mm !important;
    }
    tr.head-details-main th label{
        margin:2mm 0 !important;
        width:100% !important;
    }
</style>
<div class="page" style="width:100%;" id="sem-wise-result-sheet" data-cols-width="10,10,30">
    <table class="tabular-table" id="tabulationRegisterReportExcel" style="width:100%!important;">
        <thead>
            {% set columnCount = (data.examRegistrationData.subjects|length * 4) + ( data.examRegistrationData.isFinalSemester ? data.allSemesterDetails|length + 3 : 0) + 6 %}
            {% set headCol = (columnCount / 3)|round(0, 'floor') %}
            {% set headLastCol = columnCount - 2 * headCol %}
            <tr style="padding-top:300px!important">
                <th data-f-bold='true' colspan="{{columnCount}}" class="">
                    <img src="{{data.collegeData.collegeHeader}}" class="college-header">
                </th>
            </tr>
            <tr data-height="30">
                <th colspan="{{headCol}}"></th>
                <th data-f-bold='true' colspan="{{headLastCol}}">
                    <b style="font-size: 18px;">TABULATION REGISTER</br>
                </th>
                <th colspan="{{headCol}}"></th>
            </tr>
            <tr class="head-details-main" data-height="60">
                <th data-f-bold='true' class="text-left v-align-top" colspan="{{headCol}}" style="vertical-align:top !important;">
                    <label>YEAR OF ADMISSION :  {{data.examRegistrationData.batchStartYear}}</label>
                    <br>
                    <label>SEMESTER : {{data.examRegistrationData.semInRomanLetter}}</label>
                </th>
                <th data-f-bold='true' class="text-left" colspan="{{headLastCol}}">
                    <label style="text-align: center; white-space: nowrap;">{{data.examRegistrationData.name | raw}}</label> <br>
                    <label style="text-align: center;">PROGRAMME : {{data.examRegistrationData.programName | raw}}</label> <br>
                    <label style="text-align: center;">Month &amp; Year of Examination : {{ data.examRegistrationData.examMonthName }} {{ data.examRegistrationData.examYear}}</label> <br>
                    {% if  data.examRegistrationData.isFinalSemester %}
                        <label>Board Meeting Held On : {{data.examRegistrationData.boardMeatingDate }}</label><br>
                    {% endif %}
                </th>
                {% if data.examRegistrationData.batchStartYear >= 2019 %}
                    <th data-f-bold='true' class="text-left" style="padding-top: 10px;" colspan="{{headCol}}">
                        <label style="display:none !important;"> Credit Point Calculation</label><br>
                        <label style="display:none !important;"> Extwt = (Ewgp) * 4</label><br>
                        <label style="display:none !important;"> Wgpa = (Extwt + Iwgpa) / 5</label><br>
                        <label style="display:none !important;"> Crpt = Wgpa * Credit</label><br>
                        <label style="display:none !important;"> Minimum Wgpa - 2.00 (P)</label><br>
                        <label style="display:none !important;"> Minimum SGPA - 2.00 (P)</label>
                        <table id="details-table" style="width:65mm !important;">
                            <tr data-exclude="true">
                                <th class="tabular-table-border">Credit Point Calculation</th>
                            </tr>
                            <tr data-exclude="true">
                                <th class="tabular-table-border">Extwt = (Ewgp) * 4</th>
                            </tr>
                            <tr data-exclude="true">
                                <th class="tabular-table-border">Wgpa = (Extwt + Iwgpa) / 5</th>
                            </tr>
                            <tr data-exclude="true">
                                <th class="tabular-table-border">Crpt = Wgpa * Credit</th>
                            </tr>
                            <tr data-exclude="true">
                                <th class="tabular-table-border">Minimum Wgpa - 2.00 (P)</th>
                            </tr>
                            <tr data-exclude="true">
                                <th class="tabular-table-border">Minimum SGPA - 2.00 (P)</th>
                            </tr>
                        </table>
                    </th>
                {% else %}
                    <th data-f-bold='true' class="text-left"  colspan="{{headCol}}">
                        <label style="display:none !important;"> Credit Point Calculation</label><br>
                        <label style="display:none !important;"> Extwt = (Ewgp) * 3</label><br>
                        <label style="display:none !important;"> Wgpa = (Extwt + Iwgpa) / 4</label><br>
                        <label style="display:none !important;"> Crpt = Wgpa * Credit</label><br>
                        <label style="display:none !important;"> Minimum Wgpa - 1.5 (C)</label><br>
                        <label style="display:none !important;"> Minimum SGPA - 1.5 (C)</label>
                        <table id="details-table" style="width:65mm !important;">
                            <tr data-exclude="true">
                                <th class="tabular-table-border">Credit Point Calculation</th>
                            </tr>
                            <tr data-exclude="true">
                                <th class="tabular-table-border">Extwt = (Ewgp) * 3</th>
                            </tr>
                            <tr data-exclude="true">
                                <th class="tabular-table-border">Wgpa = (Extwt + Iwgpa) / 4</th>
                            </tr>
                            <tr data-exclude="true">
                                <th class="tabular-table-border">Crpt = Wgpa * Credit</th>
                            </tr>
                            <tr data-exclude="true">
                                <th class="tabular-table-border">Minimum Wgpa - 1.5 (C)</th>
                            </tr>
                            <tr data-exclude="true">
                                <th class="tabular-table-border">Minimum SGPA - 1.5 (C)</th>
                            </tr>
                        </table>
                    </th>
                {% endif %}
            </tr>
            <tr>
                {% if data.isPrint == 0 %}
                    <th data-f-bold='true' data-exclude="true" class="tabular-table-border" style="width:2%" rowspan="3">Select</th>
                {% endif %}
                <th data-f-bold='true' class="tabular-table-border" style="width:2%" rowspan="3">Sl No</th>
                <th data-f-bold='true' class="tabular-table-border" style="width:10%" rowspan="3">
                    Register No /
                    Student Name
                </th>
                {% for subject in data.examRegistrationData.subjects %}
                    <th data-f-bold='true' class="tabular-table-border text-center" colspan="4" style="width:20%">{{subject.code|raw}}
                        <br><span class="small-font">{{subject.name|raw}}</span>
                    </th> 
                {% endfor %}
                <th rowspan="2" colspan='{{ data.examRegistrationData.isFinalSemester ? 10 : 4 }}' class="tabular-table-border"></th>
            </tr>
            <tr>
                {% for subject in data.examRegistrationData.subjects %}
                    <th data-f-bold='true' class="tabular-table-border text-center" colspan="4" style="width:20%">
                        Credit : {{subject.credit}}
                    </th> 
                {% endfor %}
            </tr>
            <tr>
                {% for subject in data.examRegistrationData.subjects %}
                    <th data-f-bold='true' class="tabular-table-border text-center b-r-0" style="width:1%; vertical-align:middle !important;">
                        EXT <br>
                        WGPA
                    </th> 
                    <th data-f-bold='true' class="tabular-table-border text-center b-r-0 b-l-0" style="width:1%; vertical-align:middle !important;">
                        EGrade <br>
                        Grade
                    </th> 
                    <th data-f-bold='true' class="tabular-table-border text-center b-r-0 b-l-0" style="width:1%; vertical-align:middle !important;">
                        IWGPA <br>
                        CrPt
                    </th> 
                    <th data-f-bold='true' class="tabular-table-border text-center b-l-0" style="width:1%; vertical-align:middle !important;">
                        IGrade <br>
                        Status
                    </th> 
                {% endfor %}
                 <th data-f-bold='true' class="tabular-table-border" style="width:2%">
                    <svg width='5mm' height='30mm' style='margin:1mm; font-size:12px !important'>
                        <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>Total Credit Points</text>
                    </svg>
                </th>
                <th data-f-bold='true' class="tabular-table-border" style="width:2%">
                    <svg width='5mm' height='30mm' style='margin:1mm; font-size:12px !important'>
                        <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>
                            SGPA {% if data.examRegistrationData.isFinalSemester  %}{{data.examRegistrationData.academicTermName|last}} Sem {% endif %}
                        </text>
                    </svg>
                    
                </th>
                <th data-f-bold='true' class="tabular-table-border" style="width:1%">
                    <svg width='5mm' height='30mm' style='margin:1mm; font-size:12px !important'>
                        <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>
                            S Grade {% if data.examRegistrationData.isFinalSemester  %}{{data.examRegistrationData.academicTermName|last}}th Sem {% endif %}
                        </text>
                    </svg>
                </th>
                {% if data.examRegistrationData.isFinalSemester %}
                    {% for semester in data.allSemesterDetails %}
                        <th data-f-bold='true' class="tabular-table-border" style="width:1%">
                            <svg width='5mm' height='30mm' style='margin:1mm; font-size:12px !important'>
                                <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>
                                    SGPA {{semester.name |last}} Sem
                                </text>
                            </svg>
                        </th>
                    {% endfor %} 
                   <th data-f-bold='true' class="tabular-table-border" style="width:1%">
                        <svg width='5mm' height='30mm' style='margin:1mm; font-size:12px !important'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>CGPA</text>
                        </svg>
                    </th>
                    <th data-f-bold='true' class="tabular-table-border" style="width:1%">
                        <svg width='5mm' height='30mm' style='margin:1mm; font-size:12px !important'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>Grade</text>
                        </svg>
                    </th>
                    <th data-f-bold='true' class="tabular-table-border" style="width:1%">
                        <svg width='5mm' height='30mm' style='margin:1mm; font-size:12px !important'>
                            <text transform='rotate(180)' y='-50%' x='-50%' style='writing-mode: tb;text-anchor: middle;'>Folio No.</text>
                        </svg>
                    </th>
                {% endif %}
                <th data-f-bold='true' class="tabular-table-border" style="width:16%">Remarks </th>
            </tr>
        </thead>
        <tbody>
            {% for student in data.studentData %}
                <tr data-height="30">
                    {% set academicTerm = student.academicTerms |first %}
                    {% if data.isPrint == false %}
                        <td data-exclude="true" class="text-center tabular-table-border"><input type="checkbox" class="studentName" value='{{student.id}}'/></td>
                    {% endif %}
                    <td class="text-center">{{loop.index}}</td>
                    <td class="text-left">{{student.registerNo}} <br> {{student.name}}</td>
                    {% for subject in data.examRegistrationData.subjects %}
                        {% set isEntered = false %}
                        {% for studentSubject in academicTerm.subjects %}
                            {% if studentSubject.id == subject.id %}
                                <td class=' b-r-0 {{ studentSubject.failedStatus == "PASSED" ? '' : 'failed'}} '>
                                    {{studentSubject.isExternal ? studentSubject.externalMark : "-"}} <br>
                                    {{studentSubject.wgpa}}
                                </td>
                                <td class=' b-r-0 b-l-0 {{ studentSubject.failedStatus == "PASSED" ? '' : 'failed'}} '>
                                    {{studentSubject.isExternal ? studentSubject.externalGrade : "-"}} <br>
                                    {{studentSubject.grade}}
                                </td>
                                <td class=' b-r-0 b-l-0 {{ studentSubject.failedStatus == "PASSED" ? '' : 'failed'}} '>
                                    {{ studentSubject.isInternal ? studentSubject.internalAttendanceStatus == 'ABSENT' ? 'AB' : studentSubject.internalMark : "-"}} <br>
                                    {{studentSubject.creditGradePoint}}
                                </td>
                                <td class=' b-l-0 {{ studentSubject.failedStatus == "PASSED" ? '' : 'failed'}} '>
                                    {{studentSubject.isInternal? studentSubject.internalGrade : "-"}} <br>
                                    {{ studentSubject.failedStatus == 'FAILED' ? 'F' : 'P' }}
                                </td>
                                {% set isEntered = true %}
                            {% endif %}
                        {% endfor %}
                        {% if isEntered == false %}
                            <td class=' b-r-0'>
                            </td>
                            <td class=' b-r-0 b-l-0'>
                            </td>
                            <td class=' b-r-0 b-l-0'>
                            </td>
                            <td class=' b-l-0'>
                            </td>
                        {% endif %}
                    {% endfor %}
                    <td class=''>
                        {{ academicTerm.semesterCreditGradePoint ? academicTerm.semesterCreditGradePoint  : '-' }} <br>
                    </td>
                    <td class=''>
                        {{ academicTerm.failedStatus == 'PASSED' ? academicTerm.semesterSgpa : '-' }} <br>
                        {{ data.examRegistrationData.isFinalSemester ? (academicTerm.examMonth ~ '/' ~ academicTerm.examYear) : '' }}
                    </td>
                    <td class=''>
                        {{ academicTerm.semesterGrade ? academicTerm.semesterGrade : '-' }} <br>
                    </td>
                   
                    {% if data.examRegistrationData.isFinalSemester %}
                        {% for semester in data.allSemesterDetails %}
                            {% set isEntered = false %}
                            {% for studentSemester in student.otherAcademicTerms %}
                                {% if semester.id == studentSemester.id %}
                                    {% set isEntered = true %}
                                    <td class=''>
                                        {{ studentSemester.semesterSgpa ? studentSemester.semesterSgpa : '-' }} <br>
                                        {{ studentSemester.failedStatus == "PASSED" ? (studentSemester.examMonth ~ '/' ~ studentSemester.examYear) : '' }}
                                    </td>
                                {% endif %}
                            {% endfor %}
                            {% if isEntered == false %}
                                <td class="tabular-table-border text-center"> - </td><!--overallmark_tag-->
                            {% endif %}
                        {% endfor %} 
                        <td class=''>{{ student.cgpa ? student.cgpa : '-' }} <br></td>
                        <td class=''> {{ student.grade ? student.grade : '-' }} <br></td>
                        <td class=''> {{ student.folioNumber }} <br></td>
                    {% endif %}  
                    <td>&nbsp;</td>
                </tr>
            {% endfor %} 
        </tbody>
        <tfoot>
            <tr data-exclude="true">
                <td colspan="100" class="no-border p-t">
                    <span style="float:left !important; width:25% !important; text-align:left !important;">Prepared by</span>
                    <span style="float:left !important; width:25% !important; text-align:center !important;">Verified by</span>
                    <span style="float:left !important; width:25% !important; text-align:center !important;">Controller of Examinations</span>
                    <span style="float:right!important; width:25% !important; text-align:right !important;">Principal</span>
                </td>
            </tr>
	    </tfoot>
    </table>
</div>
