
{# <!--
    use to render template
        |-> template for JCET 
--> #}
<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 id="print-style">
    .primary-table th,td{
        padding: 0px 1px;
        line-height:15px !important;
        height:6mm !important;
        text-align:center;
        vertical-align:middle !important;
        font-size: 15pt !important; 
        border-top: 0px!important;
        border-bottom: 0px!important;
        font-weight:normal;
		font-weight: bold;
    }
    .page-a4{
        width: 100%; 
        border: none; 
        margin: 0 auto 0 auto;
        page-break-after: always;
		font-family: 'Times New Roman', serif;
    }
	.page-a4:last-child {
		page-break-after: auto; /* Remove page break after the last element */
	}
    .bold {
        font-weight: 700 !important;
    }
	.txt-normal {
        font-weight: normal !important;
    }
    .text-center{
        text-align:center;
    }
    .text-left{
        text-align:left !important;
    }
    .text-right{
        text-align:right !important;
    }
    .text-danger{
        color:red;
    }


    .subject-details td, th {
        font-size: 13pt !important;
        border: 1px solid #000!important;
        text-align: center;
        vertical-align: middle;
		padding:5mm 5mm;
    }
	.stud-details td{
		font-size: 13pt !important;
        text-align: center;
        vertical-align: middle;
		padding:2mm 2mm;
	}
	.stud-values{
		font-weight:normal!important;
	}

    .b-0 {
        border: 0px none;
    }
	.footer{
		font-size: 15pt !important;
		text-align:right;
		width:100%;
		padding:30mm 10mm 0mm 0mm;

	}

</style>

{% for student in  data.studentData %}
<div class="page-a4" id="markcard">
	<table style = 'margin:0px auto; text-align:center;width: 100%;font-size:16px;' cellpadding='0' cellspacing='0' border='0'>
		<tr>
            <td class='text-right' style='padding-top:30mm'>
               No: CoE/Ex/{{student.endYear}}/{{data.marksCardType == 'MINOR' ? 'Min/':data.marksCardType == 'HONOURS' ? 'Hon/':'EC/'}}{{student.sequenceNo}}
            </td>
		</tr>
		<tr>
            <td style=''>
                <div style = 'width:100%;line-height:25px;'>
					<div style = 'width:auto; height:78px;'>
                    {# <img style = 'width:auto; height:115px;' src ="{{additionalInfo.collegeLogo}}"> #}
                </div> 
            </td>
		</tr>
		<tr>
            <td>
                <div style = 'width:100%;line-height:25px;'>
                    <img style = 'width:auto; height: 115px;' src ="{{data.collegeData.collegeHeaderProvisional}}">
                </div> 
            </td>
		</tr>
	</table>
    <table style="width:100% !important; margin:10mm 0 3mm 0; page-break-inside:avoid;" class="primary-table">
        <tr>
            <td>
			{% if data.marksCardType == 'MINOR' %}
				Minor Grade Card
			{% elseif data.marksCardType == 'HONOURS' %}
				B.Tech (Honours) Grade Card
			{% else %}
				Grade Card for Extra Credits Earned
			{% endif %}
			</td>
        </tr>
    </table>
    <div style="min-height:427px">
        <table style="width:100% !important; margin:2mm 0 0 0mm;">
			<tr class='stud-details'>
				<td class="text-left" style='width:50mm!important;'><b>Name of the Candidate</b></td>
				<td class="text-left stud-values" colspan='1'>: &nbsp;{{student.name}}</td> 
				<td class="text-right" style='width:50mm!important;'><b>University Register No </b></td>
				<td class="text-right stud-values" style='width:35mm!important;'>:&nbsp;&nbsp;{{student.ktuCode}}</td>
			</tr>
			<tr class='stud-details'>
				<td class="text-left"><b>Branch</b></td>
				<td class="text-left stud-values" colspan='3'>: &nbsp;{{student.departmentDesc |raw |upper}}</td>
			</tr>
			<tr class='stud-details'>
				<td class="text-left"><b>College Register No</b></td>
				<td class="text-left stud-values" colspan='3'>: &nbsp;{{student.regNo}}</td>
			</tr>
			<tr class='stud-details'>
				<td class="text-left"><b>Programme</b></td>
				<td class="text-left stud-values" colspan='3'>: &nbsp;B.Tech</td>
			</tr>
			{% if data.marksCardType == 'MINOR' %}
			<tr class='stud-details'>
				<td class="text-left"><b>{{data.marksCardType == 'MINOR' ? 'Minor':'Honours'}}</b></td>
				<td class="text-left stud-values" colspan='3'>: &nbsp;{{student.minorHonours.minor.subjects ? student.minorHonoursBasketName |raw |upper : ''}}</td>
			</tr>
			{% endif %}

        </table>
		{% set haveSubjects = false %}
		{# mark Table #}
		<table border="0" cellspacing="0" style="width:100%!important; margin-bottom:5px; margin-top:15px; border-collapse: collapse; min-height:3cm" class="subject-details">
			<tr style="height: 7mm !important;">
				<th width="47%" style="text-align:center; padding: 5px; line-height:21px;">Course Name</th>
				<th width="18%" style="text-align:center;">Code</th>
				<th width="5%" style="text-align:center;">Credits</th>
				<th width="5%" style="text-align:center;">Grade</th>
				<th width="20%" style="text-align:center; line-height:21px;" colspan='2'>Month & Year of Pass</th>
			</tr>

			{######################## SUBJECT ROWS ##########################}
			{% if data.marksCardType == 'MINOR' or data.marksCardType == 'EXTRA_CREDIT' and student.sequenceNo %}
				{% for subject in student.minorHonours.minor.subjects %}
				{% if subject.subjectFailedStatus == "PASSED" %}
				{% set haveSubjects = true %}
				<tr style="height: 7mm; line-height: 15px;">
					<td class="txt-normal text-left" style="text-align:left; vertical-align:top !important;">{{ subject.subjectName }}</td>
					<td class="txt-normal text-center" style="vertical-align:top !important;">{{ subject.code }}<sup style='font-size:12pt'>{{subject.isMoocSubject ? ' $':''}}</sup></td>
					<td class="txt-normal text-center">{{ subject.credit|number_format(2) }}</td>
					<td class="txt-normal text-center">{{ subject.grade }}</td>
					<td class="txt-normal text-center" colspan='2'>{{ subject.monthYearOfPassing }}</td>
				</tr>
				{% endif %}
				{% endfor %}
			{% endif %}
			{% if data.marksCardType == 'HONOURS' or data.marksCardType == 'EXTRA_CREDIT' and student.sequenceNo %}
				{% for subject in student.minorHonours.honours.subjects %}
					{% if subject.subjectFailedStatus == "PASSED" %}
					{% set haveSubjects = true %}
					<tr style="height: 7mm; line-height: 15px;">
						<td class="txt-normal text-left" style="text-align:left; vertical-align:top !important;">{{ subject.subjectName }}</td>
						<td class="txt-normal text-center" style="vertical-align:top !important;">{{ subject.code }}<sup style='font-size:12pt'>{{subject.isMoocSubject ? ' $':''}}</sup></td>
						<td class="txt-normal text-center">{{ subject.credit|number_format(2) }}</td>
						<td class="txt-normal text-center">{{ subject.grade }}</td>
						<td class="txt-normal text-center" colspan='2' style='width:18%'>{{ subject.monthYearOfPassing }}</td>
					</tr>
					{% endif %}
				{% endfor %}
			{% endif %}
			{###################### END SUBJECT ROWS ####################}


			{###################### SET TOTALS ####################}
			{% if haveSubjects %}
				{% if data.marksCardType == 'MINOR' %}
					{% set creditsEarned = student.minorHonours.minor.details.creditEarned %}
					{% set totalCredits = student.minorHonours.minor.details.totalCredit %}
				{% elseif data.marksCardType == 'HONOURS' %}
					{% set creditsEarned = student.minorHonours.honours.details.creditEarned %}
					{% set totalCredits = student.minorHonours.honours.details.totalCredit %}
				{% else %}
					{# {% set creditsEarned = student.minorHonours.totalCreditEarned %}
					{% set totalCredits = student.minorHonours.totalCredit %} #}
				{% endif %}
				{% if data.marksCardType == 'MINOR' or data.marksCardType == 'HONOURS' %}
				<tr>
					<td class='text-right'  colspan='3'>Additional Credits Earned</td>
					<td colspan='2'>{{creditsEarned}}</td>
				</tr>
				{% else %}
				<tr>
					<td class='text-right' colspan='3'>Additional Credits Earned</td>
					<td colspan='2' >{{student.minorHonours.totalCreditEarned}}</td>
				</tr>
				{% endif %}
			{% else %}
			<tr>
				<td colspan='6'>NO DETAILS</td>
			</tr>
			{% endif %}
		</table>
		<div style='width:100%;float:left;padding-left:10px' class='text-left'>$ Massive Open Online Course (MOOC)</div>
		{% if student.minorHonours.honours.details.hasExceededCredit %}
			<div style='width:100%;margin-top:0mm;padding-top:1mm; padding-left:10px' class='font-7'>
				The total additional credits earned by the candidate are limited to 20 for the award of B.Tech (Honours).
			</div>
		{% endif %} 
		<div style='width:100%;margin-top:15mm'>
			<div style='width:30%;float:left;padding-left:5mm' class='footer text-left'>Verified by</div>
			<div style='width:50%;float:right;' class='footer text-right coe'><b>Controller of Examinations</b></div>
		</div>
    </div>
	{# <div style='font-size:17px;text-align:center;margin-top:30mm'> * This is a computer system (Digital File) generated document. Hence there is no need for a physical signature</div> #}
</div>
{% endfor %}