{# Template For PG Students In PWC Collage  #}
<style>
     td, th { padding: 5px; }
     body{
        font-family: \"Times New Roman\", Times, serif; 
    }
    .border-0{
        border:1px solid #fff !important;
    }
    .border-trl-0{
        border-top:1px solid #fff !important;
        border-left:1px solid #fff !important;
        border-right:1px solid #fff !important;
    }
    .border-rl-0{
        border-left:1px solid #fff !important;
        border-right:1px solid #fff !important;
    }
    .border-b-0{
        border-bottom:1px solid #fff !important;
        border-top:1px solid #000 !important;
    }
    .border-t-0{
        border-top:1px solid #fff !important;
        border-bottom:1px solid #000 !important;
    }
    .noborder-r-0{
       border-right-style: none;
    }
    .border-bt-0{
        border-bottom:1px solid #fff !important;
        border-top:1px solid #fff !important;
    }
    .markTab{
        width:100%;
        margin:20px auto;
        font-size: 16px;
        padding:0;
        text-align:center;
        border-collapse: collapse;
    }
    .markTab td{
        margin: 0;
        font-size: 16px;
        padding:3px;
        color: #000;
        text-align: center;
        border-collapse: collapse;
    }
    .markTab thead th[rowspan="4"] {
        height: 130px;
        vertical-align: middle;
        text-align: center;
    }
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }
    tr { page-break-inside: avoid; }
    .celldiv{
        width:100%;
        height: auto;
        float: none;
        margin: 0px auto;
        text-align: center;
        /*border: 1px solid #000;*/
        border-collapse: collapse;
        display: block;
    }
    .cellspan_left{
        float: left;
    }
    .cellspan_right{
        float: left;
    }
    .cellspan_left, .cellspan_right{
        width:50%;
        height: auto;				
        /*border:1px solid #000;*/
        padding: 5px 0;				
        border-collapse: collapse;
        display: block;
    }
    
</style>
    <div class="page" style="width:100%;">
    
    {% set subjectColSpan =   subjectLen * 5 %}
    {% set trcolSpan =  subjectColSpan + 5  %}
    {% set colspan =  7  %}
    {% set subjectLen =  data.examRegistrationData.subjects|length   %}
    {% set colspan = colspan + subjectLen * 4  %}
    {% set widthtr =  80 / subjectLen %}
    {% set extraColspan =  colspan - 4 %}
    <table class="markTab" border="0" cellpadding="0" cellspacing="0">
        <tr align = 'center'>
            <td colspan = "{{colspan}}" style = "text-align:center">
                <div style = "width:80%; text-align:center !important; display:inline-block; vertical-align:top;margin-left: 26%;">
                    <b style = 'width:80%; text-align:center !important; display:inline-block; vertical-align:top;margin-left: 26%;font-size: 25px;'>{{data.collegeData.collegeName}}</b><br />
                    <b style = 'width:80%; text-align:center !important; display:inline-block; vertical-align:top;margin-left: 26%;font-size:18px;'>{{data.collegeData.collegeAddress}}</b><br />
				</div>
            </td>
            <td colspan = "{{colspan}}">
                <div style = "width:80%; text-align:center !important; display:inline-block; vertical-align:top;line-height: 8px;height: 164px;border:1px solid #000;margin-top: 0px;margin-bottom: -72%;padding-top: 3%;">
                    <b>Credit Point Calculation<br/ ><hr style = "margin-top: 10px;margin-bottom: 0px;">
                    <br />ExtWt = (Ewgp)*4<br /><hr style = "margin-top: 8px;margin-bottom: 0px;">
                    <br />Wgpa = (ExtWt+Iwgpa)/5<br /><hr style = "margin-top: 8px;margin-bottom: 0px;">
                    <br />Crpt = Wgpa* Credit<br /><hr style = "margin-top: 8px;margin-bottom: 0px;">
                    <br />Minimum Wgpa - 2.00 (P)<br /><hr style = "margin-top: 8px;margin-bottom: 0px;">
                    <br />Minimum SGPA - 2.00 (P)</b>
                </div>
			</td>
        </tr>
        <tr align = 'center'>
            <td colspan = "{{colspan}}" style = "text-align:center ">
                <div style = "font-size: 15px;;margin-left: 54%; text-align:center !important; display:inline-block;">
                    <b style = "font-size: 18px;\">{{data.examRegistrationData.streamName}} Semester {{data.examRegistrationData.semInSemNumber}} ({{data.examRegistrationData.examMonth}} / {{data.examRegistrationData.examYear}}) CSS </b>
				</div>
            </td>
        </tr>
        <tr align = 'center'>
            <td colspan = "{{colspan}}" style = "text-align:center ">
                <div style = "font-size: 15px;;margin-left: 54%; text-align:center !important; display:inline-block;">
                    <b style = "font-size: 18px;\">{{data.examRegistrationData.batchStartYear}} Admission</b>
				</div>
            </td>
        </tr>
    </table>
    <table class="markTab" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td style = "width: 30%;">
                <b>Board Meeting Held on : </b>
                <b>{{data.examRegistrationData.boardMeatingDate}}</b>
            </td>
        </tr>
        <tr>
            <td >
                <b>Result Published on : </b>
                <b>{{data.examRegistrationData.resultPublishDate}}</b>
            </td>
        </tr>
         <tr>
            <td >
                <b>Moderation : </b>
                <b>{{data.examRegistrationData.moderation}}</b>
            </td>
        </tr>
    </table>
    <table class="markTab" border="1" cellpadding="0" cellspacing="0" style = "">
        <thead>
            <tr>
                <th rowspan="4" class='text-center bold ' data-a-h='center' data-a-v='middle'>Sl.No</th>
                <th rowspan="4"class='text-center bold' data-a-h='center' data-a-v='middle'>Reg. No & Name</th>
                {% for subject in data.examRegistrationData.subjects %}
                    <th colspan="2" width='{{widthtr}}'  class='text-center' data-a-h='center' data-a-v='middle'>{{subject.code}}</th>
                {% endfor %}
                <th rowspan="4" class='text-center bold' data-a-h='center' data-a-v='middle'>
                    <svg width="40" height="120"><text x="20" y="115" transform="rotate(-90, 20, 115)" font-size="16" font-family="Times New Roman, Times, serif" text-anchor="start" font-weight="bold">SGPA {{data.examRegistrationData.semInSemNumber}}</text></svg>
                </th>
                {% for semester in data.examRegistrationData.semesters %}
                    <th rowspan="4" class='text-center bold' data-a-h='center' data-a-v='middle'>
                        <svg width="40" height="120"><text x="20" y="115" transform="rotate(-90, 20, 115)" font-size="16" font-family="Times New Roman, Times, serif" text-anchor="start" font-weight="bold">SGPA {{semester.semInSemNumber}}</text></svg>
                    </th>
                {% endfor %}
                <th rowspan="4" class='text-center bold' data-a-h='center' data-a-v='middle'>
                    <svg width="40" height="120"><text x="20" y="115" transform="rotate(-90, 20, 115)" font-size="16" font-family="Times New Roman, Times, serif" text-anchor="start" font-weight="bold">CGPA</text></svg>
                </th>
                <th rowspan="4" class='text-center bold' data-a-h='center' data-a-v='middle'>
                    <svg width="40" height="120"><text x="20" y="115" transform="rotate(-90, 20, 115)" font-size="16" font-family="Times New Roman, Times, serif" text-anchor="start" font-weight="bold">Grade</text></svg>
                </th>
                <th rowspan="4" class='text-center bold' data-a-h='center' data-a-v='middle'>
                    <svg width="40" height="120"><text x="20" y="115" transform="rotate(-90, 20, 115)" font-size="16" font-family="Times New Roman, Times, serif" text-anchor="start" font-weight="bold">Folio No.</text></svg>
                </th>
                <th rowspan="4" class='text-center bold' data-a-h='center' data-a-v='middle'>
                    <svg width="40" height="120"><text x="20" y="115" transform="rotate(-90, 20, 115)" font-size="16" font-family="Times New Roman, Times, serif" text-anchor="start" font-weight="bold">PC Folio No.</text></svg>
                </th>
                <th rowspan="4" class='text-center bold' data-a-h='center' data-a-v='middle'>
                    <svg width="40" height="120"><text x="20" y="115" transform="rotate(-90, 20, 115)" font-size="16" font-family="Times New Roman, Times, serif" text-anchor="start" font-weight="bold">DC Folio No.</text></svg>
                </th>
                <th rowspan="4" class='text-center bold' data-a-h='center' data-a-v='middle'>
                    <svg width="40" height="120"><text x="20" y="115" transform="rotate(-90, 20, 115)" font-size="16" font-family="Times New Roman, Times, serif" text-anchor="start" font-weight="bold">Remarks</text></svg>
                </th>
            </tr>
             <tr>
                {% for subject in data.examRegistrationData.subjects %}
                    <th colspan="2" class='text-center ' data-a-h='center' data-a-v='middle'>{{subject.name}}</th>
                {% endfor %} 
            </tr>
            <tr>
                {% for subject in data.examRegistrationData.subjects %}
                    <th colspan="2" class='text-center ' data-a-h='center' data-a-v='middle'>Credits : {{subject.credit}}</th>
                {% endfor %} 
            </tr>
            <tr>
                {% for subject in data.examRegistrationData.subjects %}
                    <th colspan = '2' style='margin:0px auto; text-align:center; padding:0px;border-collapse:collapse;'>
                        <div class='celldiv'>	
                            <span class='cellspan_left'>Ewgp</span>
                            <span class='cellspan_right'>Iwgpa</span>
                        </div>
                        <div class='celldiv'>
                            <span class='cellspan_left'>Wgpa</span>
                            <span class='cellspan_right'>CrPt</span>
                        </div>
                    </th>
                {% endfor %} 
            </tr>
        </thead>
        <tbody>
             {% set slno = 0 %}
            {% for student in data.studentData %}
            {% for academicTerm in student.academicTerms %}
                {% set slno = slno + 1 %}
                <tr>
                    <td class="align-middle text-center ">{{slno}}</td>
                    <td style="text-align:left;padding: 4px; ">{{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 colspan = '2'>
                                    <div class='celldiv'>
                                
                                        {% if studentSubject.isExternal == "1" %}
                                            {% if studentSubject.attendanceStatus == "PRESENT" %}
                                                <span class='cellspan_left' style="text-align:center;">{{  studentSubject.externalGradePoint }}</span>
                                            {% elseif studentSubject.attendanceStatus == "MAL" %}
                                                <span class='cellspan_left' style="color:red;">MAL </span> 
                                            {% else %}
                                                <span class='cellspan_left' style="color:red;"> A </span> 
                                            {% endif %}
                                        {% else %}
                                            <span class='cellspan_left'> - </span> 
                                        {% endif %}
                                        <span class='cellspan_left'>{{ studentSubject.isInternal == '1' ?  studentSubject.internalGradePoint : '-'}}</span>
                                    </div>
                                    <div class='celldiv'>
                                        <span class='cellspan_right'>{{ studentSubject.gradePoint }}</span>
                                        <span class='cellspan_right'>{{ studentSubject.creditGradePoint }}</span>
                                    </div>
                                </td>
                                {% set isEntered = true %}
                            {% endif %}
                        {% endfor %}
                        {% if isEntered == false %}
                            <td colspan = '2'>
                                <div class='celldiv'>
                                    <span class='cellspan_left'>*</span>
                                    <span class='cellspan_right'>*</span>
                                </div>
                                <div class='celldiv'>
                                    <span class='cellspan_left'>*</span>
                                    <span class='cellspan_right'>*</span>
                                </div>
                            </td>
                        {% endif %}
                    {% endfor %}
                    {% if academicTerm.failedStatus == 'PASSED' %}
                        <td class="align-middle text-center">{{academicTerm.semesterSgpa}}</td>
                    {% else %}
                        <td> - </td>
                    {% endif %}
                    {% for semester in data.examRegistrationData.semesters %}
                        {% set isEntered = false %}
                        {% for otherAcademicTerm in student.otherAcademicTerms %}
                            {% if otherAcademicTerm.id == semester.id %}
                                <td class="text-center noborder-r-0">
                                    {% if otherAcademicTerm.failedStatus == "PASSED" %}
                                        {{ otherAcademicTerm.semesterSgpa }} <br> {{ otherAcademicTerm.latestExamMonth }}/{{ otherAcademicTerm.latestExamYear }}
                                    {% else %}
                                        <span > --<br> {{ otherAcademicTerm.latestExamMonth }}/{{ otherAcademicTerm.latestExamYear }}</span> 
                                    {% endif %}
                                </td>
                                {% set isEntered = true %}
                            {% endif %}
                        {% endfor %}
                        {% if isEntered == false %}
                            <td class="text-center"> - </td>
                        {% endif %}
                    {% endfor %}
                    {% if student.failedStatus == 'PASSED' %}
                        <td class="align-middle text-center">{{student.cgpa}}</td>
                        <td class="align-middle text-center">{{student.grade}}</td>
                    {% else %}
                        <td> - </td>
                        <td> - </td>
                    {% endif %}
                        <td> {{ student.folioNumber }} </td> {#  For Folio Number #}
                        <td>  </td>{#  For Folio Number #}
                        <td>  </td>{#  For Folio Number #}
                        <td>  </td>{#  For Remarks #}

                </tr>
            {% endfor %} 
            {% endfor %}
        </tbody>
    </table>
    <div style="margin: 100px 0 0 0; width: 100%; font-size: 16px">
        <div style = "width:16%;margin:0 auto; text-align:center;float:left;"><b>Clerk</b></div>
        <div style = "width:16%;margin:0 auto; text-align:center;float:left;"><b>Chairman</b></div>
        <div style = "width:16%;margin:0 auto; text-align:center;float:left;"><b>Seal</b></div>
        <div style = "width:16%;margin:0 auto; text-align:center;float:left;"><b>ACE</b></div>
        <div style = "width:16%;margin:0 auto; text-align:center;float:left;" class="small">
            <b>CE</b>
        </div>
        <div style = "width:16%;margin:0 auto; text-align:center;float:left;" class="small">
            <b>Principal</b>
        </div>
    </div>
</div>
