<style>
	td, th { 
		font-size:12px; 
		text-align:center;
	}
	.result-div { 
		margin-left:3px;
		margin-right:3px;
	}
	.outer-table {
		table-layout: fixed;
	}
	.outer-table th ,.outer-table-td,.border th,.border td{ 
		border: 1px solid #000 !important;
		border-right:1px solid #000 !important;
		border-left:1px solid #000 !important;
		border-top:1px solid #000 !important;
		border-bottom:1px solid #000 !important;
	}
	.mark-row td{
		font-size:8pt;
		border: 1px solid #000000;
		height: 5mm !important;
		border-bottom : 1px solid #000000 !important;
		border-right : none !important;
		border-top : none !important;
		spacing:2px;
	}
	.mark-row td:first-child{
		border-left:none !important;
	}
	.subject-table{
		table-layout:fixed;
	}
	.text-left{
		text-align:left;
	}
	.sem-tr th {
		height:5mm ;
	}
	.slant-th {
		-webkit-transform: rotate(270deg);
		-moz-transform: rotate(270deg);
		-ms-transform: rotate(270deg);
		-o-transform: rotate(270deg);
		transform: rotate(270deg);
		writing-mode: bt-lr;
		padding: 10px;
		font-size:12px !important;
		height:17mm !important;
		line-height:1;
		margin-right:-30px;
	}
	caption{
		text-decoration:underline;
	}
	.result-table th,result-table td{
		font-size:12px;
		padding:5px;
		vertical-align: middle!important;
	}
	.result-div{
		color : black !important;
	}
	.result-div { color: #000; }
	.student-page{
		position: relative;
		min-height: 36cm;
	}
	.footer-signature{
		position: absolute;
		bottom: 0mm;
		width: 100%;
	}
</style>

{% for student in data.studentData %}
	{% set paddingStyle = "padding:4px 0;" %}
	{% if student.isResultBlocked == true %}
		{# NOT AVAILABALE #}
		<div class="page-a4" style="page-break-after: always; page-break-before: always;    padding-top: 150px; padding-bottom: 150px;">
			<div class='text-danger bold text-center fsize-14 failed'>RESULT IS BLOCKED FOR THE STUDENT {{student.name|raw |upper}} ({{student.regNo|raw}}) </div>
		</div>
	{% else %}
		<div class='student-page' style='page-break-inside: avoid;'>
			<div class='result-div'>
				<div style="width:100%; margin-bottom:-190px;" class='pull-right text-right' >
					<div>
						<img src='{{student.studentImage}}' width='90' height='100' alt='Student Image' style="margin-top:40px;">
					</div>
					<div style="width: 100px;" class='pull-right text-right'>
						<table style = 'margin-top:8px; text-align:center;font-size:12px;width: 100px;' cellpadding='2' cellspacing='0'>
							<tr>
								<td width='50%'><b>Sl.No :</b></td>
								<td width='50%'><b>{{student.serialNo}}</b></td>
							</tr>
						</table>
					</div>
				</div>
				<div style='width:100%; '>
					<div style = 'width:100%; text-align:left; padding:0 !important;'>
                        <img style = 'width: 250px; height: 80px; margin-top: 10px;' src = '{{data.collegeData.collageLogo}}'>
					</div>
					<h4 style='text-align:center;'><b>M.S. RAMAIAH COLLEGE OF ARTS, SCIENCE AND COMMERCE-AUTONOMOUS</b></h4>
					<h4 style='text-align:center;'>(Affiliated to Dr. Manmohan Singh Bengaluru City University)</h4>
					<h4 style='text-align:center;'>M S R Nagar, MSRIT Post, BENGALURU-560054</h4>
					<h5 style='padding-bottom:1mm!important;text-align:center;'><b><u>TRANSCRIPT / CONSOLIDATED STATEMENT OF MARKS</u></b></h5>
				</div>
				<table class='student-info text-center' border='1' cellspacing='0' style='margin-top: 50px; margin-bottom:0px; margin-right:0px;width:100%;'>
				{# <caption><h5 style='padding-top:3mm!important;padding-bottom:1mm!important;text-align:center;'><b>TRANSCRIPT / CONSOLIDATED STATEMENT OF MARKS</b></h5></caption> #}
					<thead>
						<tr class='text-center'>
							<th width='30%'>Name</th>
							<th width='10%'>Reg. No.</th>
							<th width='15%'>Years of Study</th>
							<th width='27%'>Programme</th>
							<th width='18%'>Medium of Instruction</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<th class='text-center'>{{student.name|raw}}</th>
							<th class='text-center'>{{student.regNo|raw |upper}}</th>
							<th class='text-center'>{{student.periodOfStudy}}</th>
							<th class='text-center'>{{student.programNameTobeDisplayed|raw}}</th>
							<th class='text-center'>{{student.mediumOfInstrn}}</th>
						</tr>
					</tbody>
				</table>
				<table class=' m-b-0 outer-table' style='margin-bottom:0px;margin-right:0px;width:100%;height:auto;'  >
					<thead>
						<tr>
							<th class='text-center' style='padding:3px!important;width:8%;'>Course Code</th>
							<th class='text-center' style='padding:3px!important;width:21%;'>Course Name</th>
							<th class='text-center' style='padding:3px!important;width:4%;'><div class='slant-th'>Max </br>Marks</div></th>
							<th class='text-center' style='padding:3px!important;width:4%;'><div class='slant-th'>Marks </br>Obtained</div></th>
							<th class='text-center' style='padding:3px!important;width:3%;'><div class='slant-th'>Grade</div></th>
							<th class='text-center' style='padding:3px!important;width:4%;'><div class='slant-th'>Credits</div></th>
							<th class='text-center' style='padding:3px!important;width:6%;'><div class='slant-th'>Year Of </br> Passing</div></th>
							
							<th class='text-center' style='padding:3px!important;width:8%;'>Course Code</th>
							<th class='text-center' style='padding:3px!important;width:21%;'>Course Name</th>
							<th class='text-center' style='padding:3px!important;width:4%;'><div class='slant-th'>Max </br>Marks</div></th>
							<th class='text-center' style='padding:3px!important;width:4%;'><div class='slant-th'> Marks </br>Obtained</div></th>
							<th class='text-center' style='padding:3px!important;width:3%;'><div class='slant-th'>Grade</div> </th>
							<th class='text-center' style='padding:3px!important;width:4%;'><div class='slant-th'>Credits</div> </th>
							<th class='text-center' style='padding:3px!important;width:8%;'><div class='slant-th'>Year Of</br> Passing</div></th>
						</tr>
					</thead>
					<tbody>
					{% set semNo = 0 %}
					{% for semester in range(0, student.totalSemester) %}
						{% if (student.academicTerms[semester]) %}
							{%  if semNo % 2 == 0 %}
								<tr class='sem-tr'>
									<th colspan='7' style="vertical-align: middle; padding:5px!important;" class='text-center'>SEMESTER {{student.academicTerms[semester].romanNumber}}</th>
									<th colspan='7' style="vertical-align: middle; padding:5px!important;" class='text-center'>SEMESTER {{student.academicTerms[semester + 1].romanNumber}}</th>
								</tr>
								<tr>
							{% endif %}
							<td colspan='7' class='outer-table-td' style='vertical-align:top;'>
								<table class='subject-table' style='margin-bottom:20px;width:100%;'>
								{% for subjectDetail in student.academicTerms[semester].subjects %}
									<tr class='mark-row'>
										<td style='padding:10px!important;height:5mm!important;width:8%;'class='text-left'>{{subjectDetail.code}}</td>
										<td style='padding:10px!important;height:5mm!important;width:21%;word-break:normal;overflow-wrap: break-word;'class='text-left'>{{subjectDetail.name|raw}}</td>
										<td style='padding:10px!important;height:5mm!important;width:4%;'class='text-center'>{{subjectDetail.markDetails.totalMarks}}</td>
										<td style='padding:10px!important;height:5mm!important;width:4%;'class='text-center'>{{subjectDetail.markDetails.markObtained}}</td>
										<td style='padding:10px!important;height:5mm!important;width:3%;'class='text-center'>{{subjectDetail.grade}}</td>
										<td style='padding:10px!important;height:5mm!important;width:4%;'class='text-center'>{{subjectDetail.credit}}</td>
										<td style='padding:10px!important;height:5mm!important;width:8%;'class='text-center'>{{subjectDetail.examMonthYear}}</td>
									</tr>
								{% endfor %}
								</table>
							</td>
							{%  if semNo % 2 == 1 %}
								</tr>
							{% endif %}
						{% endif %}
						{% set semNo = semNo + 1 %}
					{% endfor %}
					</tbody>
				</table>
				<table class='result-table table-bordered text-center border' style='margin:3px 0;width:100%;'>
					<tr>
						<th width='25%'>Result</th>
						<td width='15%'>Max Marks</td>
						<td width='15%'>Marks Obtained</td>
						<td width='10%'>Percentage</td>
						<td width='15%'>Credits Awarded</td>
						<td width='10%'>CGPA</td>
						<td width='20%'>Letter Grade</td>
					</tr>
					<tr>
						<th class='text-center'>{{student.failedStatus == "FAILED" ? '-':student.markDetails.class | upper}}</th>
						<th class='text-center'>{{student.markDetails.totalMarks}}</th>
						<th class='text-center'>{{student.markDetails.markObtained}}</th>
						<th class='text-center'>{{student.failedStatus == "FAILED" ? '-' : student.cgpaPercentage|round(2)}}</th>
						<th class='text-center'>{{student.failedStatus == "FAILED" ? '-':student.credit}}</th>
						<th class='text-center'>{{student.failedStatus == "FAILED" ? '-':student.cgpa}}</th>
						<th class='text-center'>{{student.failedStatus == "FAILED" ? student.failedGrade :student.grade}}</th>
					</tr>
				</table>
			</div>
			{% if (student.gradesAwarded) %}
				<div style='page-break-inside: avoid;'>
					<div class='text-center'>Special Grades Awarded</div>
					<table class=' text-center m-b-0' border='1' style='margin-bottom:0;width:100%'>
						<tr>
							{% for activity in data.activities %}
								<td>{{activity.activity}}</td>
							{% endfor %}
						</tr>
						<tr>
							{% for activity in data.activities %}
								<td>
									{% for grade in student.gradesAwarded %}
										{%  if activity.id  == grade.activityId %}
											{{grade.gradeAwarded}}<br>
										{% endif %}
									{% endfor %}
								</td>
							{% endfor %}
						</tr>
					</table>
				</div>
			{% endif %}
			<div class='footer-signature'>
				<table class='' border='0' style='border:none;width:100%;'>
					<tr>
						<td width='30%' class='text-left' style='padding-left:10mm;border:none'>
							<img src='{{data.collegeData.coeSign}}' width='150' height='50' alt='Signature of Controller of Examinations'>
						</td>
						<td width='30%' style='border:none'></td>
						<td width='30%' style='border:none'>
							<img src='{{data.collegeData.principalSign}}' width='150' height='50' alt='Signature of Principal'>
						</td>
					</tr>
					<tr>
						<th class='text-left' style='padding-left:10mm;border:none'>CONTROLLER OF EXAMINATIONS</th>
						<th style='border:none'></th>
						<th style='border:none'>PRINCIPAL</th>
					</tr>
					<tr>
						<th class='text-left' style='padding-left:10mm;border:none;padding-top:20px;'>Date of Issue : {{data.dateOfIssue}}</th>
					</tr>
				</table>
			</div>
		</div>
	{% endif %}
{% endfor %}
		
