{# Template For SHC Collage  #}
<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-50{
        padding-top:50px!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;
		font-size:12px;
	}
	.tabular-table-border{
		border: 1px solid #000 !important;
	}
	.tabular-table td {
		padding: 2px;
		line-height: 16px !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-r-t {
            border-right-width: thick !important;
    }
    
</style>
<div class="page" style="width:100%;" id="sem-wise-result-sheet" data-cols-width="10,10,30,40">
    {% set columnCount = (data.examRegistrationData.subjects|length * 4) + 6 %}

    <table class="tabular-table" id="tabulationRegisterReportExcel" style="width:100%!important;">
    <thead>
        <tr>
            <td data-f-bold='true' data-a-h='center' class="removeTdBorder" style="border-bottom: 1px solid #000 !important;" colspan="{{columnCount}}">
                <table id="subjectHeader">
                    <thead>
                        <tr style="padding-top:300px!important">
                            <td  class="removeTdBorder" data-f-bold='true' data-a-h='center'>
                                <b style="font-size: 20px;">{{data.collegeData.collegeName }} ({{ data.collegeData.autonomous }})</b>
                            </td>
                        </tr>
                        <tr>
                            <td  class="removeTdBorder" data-f-bold='true' data-a-h='center'>
                                <b style="font-size: 18px;">Result of  {{data.examRegistrationData.name}}</b>
                            </td>
                        </tr>
                        <tr>
                            <td  class="removeTdBorder" data-f-bold='true' data-a-h='center'>
                                <b style="font-size: 18px;">Class : {{ data.examRegistrationData.groupName }}</br>
                            </td>
                        </tr>
                    </thead>
                </table>
            </td>   
        </tr>
        <tr>
            {% if data.isPrint == 0 %}
                <th data-f-bold='true' data-exclude="true" class="tabular-table-border" style="width:2%" rowspan="2">Select</th>
            {% endif %}
            <th data-f-bold='true' class="tabular-table-border" style="width:2%" rowspan="2">Sl No</th>
			<th data-f-bold='true' class="tabular-table-border" style="width:10%" rowspan="2">Register No.</th>
			<th data-f-bold='true' class="tabular-table-border" style="width:20%; padding-left:15px !important; padding-right:15px !important" rowspan="2">Name&nbsp;Of&nbsp;The&nbsp;Student</th>
            {% set haslang = 0 %}
            {% for subject in data.examRegistrationData.subjects %}
                {% if subject.isGroup == 1 %}
                    {% set haslang = 1 %}
                        <th data-f-bold='true' class="tabular-table-border" style="width:5%" rowspan="2">{{subject.name | raw}}</th>
                {% endif %}
            {% endfor %}
            {% for subject in data.examRegistrationData.subjects %}
                <th data-f-bold='true' class="tabular-table-border text-center" colspan="3" style="width:20%">{{subject.code | raw}} <br> {{subject.name|raw}}
            {% endfor %}
            <th data-f-bold='true' class="tabular-table-border text-center" style="width:2%" rowspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <br> Max: {{studentMarkDetails[0].semMark.examTotalMarks }}</th>
        </tr>
        <tr>
            {% for subject in data.examRegistrationData.subjects %}
                <th data-f-bold='true' class="tabular-table-border text-center" style="font-size:10px; width:2%"><span style="padding-left: 10px;padding-right: 10px;">INT</span> <br>Max {{subject.internalMaxMark}}</th>
			    <th data-f-bold='true' class="tabular-table-border text-center" style="font-size:10px; width:2%"><span style="padding-left: 10px;padding-right: 10px;">EXT</span>  <br>Max {{subject.externalMaxMark}}</th>
			    <th data-f-bold='true' class="tabular-table-border text-center" style="font-size:10px; width:2%"><span style="padding-left: 10px;padding-right: 10px;">TOT</span>  <br>Max {{subject.totalMaxMark}}</th>
            {% endfor %}
        </tr>
    </thead>
	<tbody class="text-center">
        {% for student in data.studentData %}
            <tr>
                {% 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-center">{{student.registerNo}}</td>
				<td class="text-left">{{student.name}}</td>
                {% set langcount = 0 %}
                {% set displayHeadCount = 0 %}
                {% set displayHeadTag3Display = displayHeadCount %}
                {% for groupSubject in data.examRegistrationData.subjects %}
                    {% if groupSubject.isGroup == 1 %}
                        {% for studentSubject in academicTerm.subjects %}
                            {% if studentSubject.id == groupSubject.id %}
                                {% set haslang = 1 %}
                                <th data-f-bold='true' class="tabular-table-border" style="width:5%" rowspan="2">{{studentSubject.name | raw}}</th>
                            {% endif %}
                        {% endfor %}
                    {% endif %}
                {% endfor %}
                {% if haslang and  langcount == 0  %}
                    <td></td>
                {% endif %}
                {% for subject in data.examRegistrationData.subjects %}
                    {% set isEntered = false %}
                    {% for studentSubject in academicTerm.subjects %}
                        {% if studentSubject.id == subject.id %}
                            {% set displayHeadCount = displayHeadCount + 1 %}
                            {% if studentSubject.attendanceStatus == "ABSENT" %}
                                <td class="failed">{{studentSubject.internalAttendanceStatus == 'ABSENT' ? 'AB' : studentSubject.internalMark}}</td>
								<td class="failed">AB</td>
								<td class="failed b-r-t">-</td>
                            {% elseif studentSubject.failedStatus == 'FAILED' %}
                                <td class="failed">{{studentSubject.internalAttendanceStatus == 'ABSENT' ? 'AB' : studentSubject.internalMark}}</td>
                                <td class="failed">-</td>
                                <td class="failed b-r-t">-</td>
                            {% else %}
                                {% if studentSubject.isInternal== 1 %}
                                    <td>{{studentSubject.internalAttendanceStatus == 'ABSENT' ? 'AB' : studentSubject.internalMark}}</td>
                                {% else %}
                                    <td class="failed">-</td>
                                {% endif %}
                                {% if studentSubject.isExternal== 1 %}
                                    <td>{{studentSubject.externalMark}}</td>
                                {% else %}
                                    <td class="failed">-</td>
                                {% endif %}
                                <td class="b-r-t">{{studentSubject.totalMark}}</td>
                            {% endif %}
                            {% set isEntered = true %}
                        {% endif %}
                    {% endfor %}
                    {% if isEntered == false %}
                        <td></td>
                        <td></td>
                        <td class="b-r-t"></td>
                    {% endif %}
                {% endfor %}
                <td >{{academicTerm.failedStatus == 'PASSED' ? academicTerm.semesterSgpa : '-'}}</td>
            </tr>
        {% endfor %} 
    </tbody>
    </table>
</div>
