<?php

function grade_calculations($obtained, $total)
{
    if (!is_numeric($obtained)) {
        $obtained = 0;
    }

    if (!is_numeric($total) || $total <= 0) {
        return '';
    }

    $obtained = (float)$obtained;
    $total = (float)$total;

    $p = ($obtained / $total) * 100;

    if ($p >= 91) return 'A1';
    if ($p >= 81) return 'A2';
    if ($p >= 71) return 'B1';
    if ($p >= 61) return 'B2';
    if ($p >= 51) return 'C1';
    if ($p >= 41) return 'C2';
    if ($p >= 33) return 'D';
    if ($p >= 21) return 'E1';
    return 'E2';
}

function show_val($val)
{
    return ($val === 0 || $val === '0') ? '-' : ($val ?? '');
}

function template30($institutions, $branch, $students_array, $examination, $array, $result, $class_id, $section_id)
{
?>
    <!DOCTYPE html>
    <html lang="en">

    <head>
        <meta charset="UTF-8">
        <title>Holistic Progress Report</title>

        <style>
            /* =====================================================
               GLOBAL COMMON CSS (All Pages)
            ===================================================== */
            @page {
                size: A4 landscape;
                margin: 0;
            }

            * {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
            }

            body {
                font-family: Arial, Helvetica, sans-serif;
                background: #fff;
                padding: 20px;
            }

            .wrapper {
                display: flex;
                width: 100%;
                gap: 20px;
            }

            .page,
            .left-section,
            .right-section {
                flex: 1;
                width: 50%;
                border: 3px solid #c4161c;
                padding: 18px;
                box-sizing: border-box;
                background: #fff;
                display: flex;
                flex-direction: column;
            }

            table {
                width: 100%;
                border-collapse: collapse;
                font-size: 11pt;
            }

            th,
            td {
                border: 1px solid #000;
                padding: 6px;
                /*text-align: center;*/
                vertical-align: middle;
            }

            th {
                font-weight: bold;
            }

            .left {
                text-align: left;
                padding-left: 8px;
            }

            .center {
                text-align: center;
            }

            .diamond::before {
                content: "◆ ";
            }

            .page-break {
                page-break-after: always;
            }

            /* PAGE 1 LEFT — INCREASED */
            .p1-title {
                text-align: center;
                font-size: 30px;
                font-weight: bold;
                color: #c4161c;
                margin-bottom: 22px;
            }

            .paragraph {
                font-size: 16px;
                line-height: 1.6;
                color: #000;
                text-align: justify;
                margin-bottom: 26px;
            }

            .sub-title {
                text-align: center;
                font-size: 22px;
                color: #c4161c;
                font-weight: bold;
                margin-bottom: 12px;
            }

            .grading-note {
                text-align: center;
                margin-bottom: 16px;
                font-size: 11pt;
            }

            .grading-table {
                width: 65%;
                margin: 0 auto 16px auto;
                font-size: 16px;
            }

            .grading-table th {
                background: #c4161c;
                color: #fff;
                padding: 7px;
            }

            .grading-table td {
                padding: 6px;
                background: #f6e7b0;
                font-weight: bold;
            }

            .grading-table td.range {
                background: #fff;
                color: #0066cc;
                font-weight: normal;
            }

            .min-note {
                text-align: center;
                margin-bottom: 16px;
                font-size: 11pt;
            }

            .blue-note {
                color: #00a2e8;
                margin-bottom: 12px;
                font-size: 11pt;
            }

            .rules {
                border: 2px solid #9bbad1;
                font-size: 13pt;
                border-radius: 10px;
                padding: 12px;
                line-height: 1.6;
                color: #1b3c73;
                margin-bottom: 20px;
            }

            .footer-note {
                margin-top: auto;
                padding: 12px 14px;
                font-size: 14px;
                text-align: center;
                background: #f1f1f1;
                border: 1px solid #cfcfcf;
                line-height: 1.4;
            }

            /* PAGE 1 RIGHT — INCREASED */
            .school-header {
                text-align: center;
                margin-top: 3px;
            }

            .school-logo {
                text-align: center;
                margin-bottom: 3px;
            }

            .school-logo img {
                width: 210px;
                height: 120px;
                object-fit: contain;
            }

            .school-name {
                font-family: 'Cinzel', serif;
                font-size: 46px;
                font-weight: 700;
                color: #2c2f83;
                letter-spacing: 1.5px;
                margin-top: 2px;
            }

            /* Address line */
            .school-address {
                font-size: 20px;
                line-height: 1.3;
                text-align: center;
            }

            /* Second line: contact + email + city + pincode */
            .school-meta-main {
                font-size: 20px;
                white-space: nowrap;
                /* stay on ONE line */
                text-align: center;
            }

            /* Third line: affiliation only */
            .school-meta-aff {
                font-size: 20px;
                text-align: center;
            }

            .photo-box {
                width: 185px;
                height: 220px;
                border: 3px solid #c4161c;
                border-radius: 18px;
                margin: 16px auto 10px auto;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .student-photo {
                width: 92%;
                height: 92%;
                object-fit: cover;
                border-radius: 12px;
            }

            .report-title {
                text-align: center;
                font-size: 24pt;
                font-weight: 900;
                margin: 10px 0 4px 0;
                letter-spacing: 0.5px;
            }

            .year {
                text-align: center;
                font-size: 32px;
                color: #c4161c;
                font-weight: 900;
                margin-bottom: 22px;
            }

            .info-table {
                width: 85%;
                margin: 0 auto;
                border-collapse: collapse;
            }

            .info-table td {
                border: none;
                background: transparent;
                padding: 13px 2px;
                text-align: left;
                /*font-size: 16px;*/
                font-size: 12pt;
                vertical-align: middle;
            }

            .info-table td:first-child {
                width: 30%;
                font-weight: 600;
            }

            .line {
                display: inline-block;
                width: 340px;
                /*height: 18px;*/
                font-family: 'Futura';
                letter-spacing: 1px;
                border-bottom: 3px dotted rgba(0, 0, 0, 0.5);
                vertical-align: middle;
            }

            /* PAGE 2 LEFT */
            .header {
                background: #fff;
                padding: 0;
            }

            .p2-title {
                background: #c41e3a;
                color: #fff;
                padding: 10px 15px;
                text-align: center;
                font-size: 22px;
                font-weight: bold;
                letter-spacing: 2px;
                margin-bottom: 8px;
            }

            .content {
                padding: 0;
                flex: 1;
                display: flex;
                flex-direction: column;
            }

            .description {
                font-size: 11pt;
                line-height: 1.6;
                margin-bottom: 10px;
            }

            .diagram {
                width: 100%;
                flex: 1;
                min-height: 0;
                margin: 6px 0 10px 0;
                text-align: center;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .mi-diagram {
                width: 100%;
                max-width: 100%;
                height: 100%;
                max-height: 100%;
                display: block;
                margin: 0 auto;
                object-fit: contain;
            }

            .subject-title {
                background: #c41e3a;
                color: #fff;
                padding: 10px 12px;
                text-align: center;
                font-size: 18px;
                font-weight: bold;
                letter-spacing: 1px;
                margin: 10px 0 8px 0;
            }

            .levels-title {
                color: #c41e3a;
                font-size: 17px;
                font-weight: bold;
                margin: 0 0 8px 0;
            }

            .levels-table td {
                border: 1px solid #333;
                padding: 10px 12px;
                font-size: 14px;
            }

            .levels-table td:first-child {
                font-weight: bold;
                width: 75px;
            }

            /* PAGE 2 RIGHT */
            .p2-right-title {
                font-weight: bold;
                font-size: 15px;
                margin-bottom: 8px;
            }

            .bar-title {
                background: #9fa8d4;
                border: 1px solid #000;
                font-weight: bold;
                font-size: 15px;
                text-align: center;
                padding: 9px 0;
                margin: 0;
            }

            .marks-table {
                width: 100%;
                border-collapse: collapse;
                table-layout: fixed;
                margin-top: 0;
                font-family: 'Futura';
                font-size: 11pt;
            }

            .marks-table th,
            .marks-table td {
                border: 1px solid #000;
                text-align: center;
                vertical-align: middle;
            }

            .marks-table thead tr:first-child th {
                background: #9fa8d4;
                /*font-size: 14px;*/
                font-weight: bold;
                padding: 2px 0;

            }

            .marks-table thead tr:nth-child(2) th {
                background: #c8d3e8;
                /*font-size: 13px;*/
                padding: 2px;
                font-family: 'Arial';
                font-weight: bold;
                /*line-height: 1.3;*/
            }

            .marks-table tbody td {
                /*font-size: 13px;*/
                padding: 2px;
            }

            /* LEFT ALIGN FIRST COLUMN (ALL ROWS, INCLUDING PERCENTAGE) */
            .marks-table th:first-child,
            .marks-table td:first-child {
                text-align: left !important;
                padding-left: 2px !important;
            }

            .support-table,
            .assessment-table {
                width: 100%;
                border-collapse: collapse;
                table-layout: fixed;
                margin-top: 0;
            }

            .support-table td,
            .assessment-table td {
                border: 1px solid #000;
                font-size: 14px;
                padding: 9px 10px;
                vertical-align: middle;
            }

            .support-table td:first-child,
            .assessment-table td:first-child {
                background: #e9e9e9;
                font-weight: bold;
                text-align: left;
                width: 45%;
            }

            .support-legend {
                background: #c4161c;
                color: #fff;
                font-weight: bold;
                text-align: center;
                font-size: 13px;
                padding: 8px 10px;
                margin: 8px 0 8px;
                border: 1px solid #c4161c;
            }

            .remarks-box {
                border: 1px solid #000;
                padding: 8px;
                min-height: 45px;
                max-height: 65px;
                margin-top: 8px;
                font-size: 14px;
            }


            .promotion-section {
                margin: 12px 0px 12px;
                font-size: 15px;
                font-weight: bold;
            }

            .signature-section {
                display: flex;
                justify-content: space-between;
                margin-top: auto;
                padding-top: 10px;
                font-size: 15px;
                font-weight: bold;
            }

            .signature-item {
                flex: 1;
                text-align: center;
            }

            /* PAGE 3 + 4 */
            .page-title {
                font-weight: bold;
                font-size: 11pt;
                margin-bottom: 8px;
            }

            .term-head {
                background: #b4b4d6;
                font-weight: bold;
            }

            .sub-head {
                font-weight: bold;
                font-size: 11pt;
                margin: 15px 0 6px;
            }

            .health th,
            .attendance th {
                background: #b4b4d6;
            }

            .blank-box {
                height: 70px;
            }

            .portfolio-title {
                font-weight: bold !important;
                font-size: 18px;
                margin-bottom: 6px !important;
            }

            .remarks-line {
                height: 30px;
            }

            .remarks-heading {
                margin-top: 6px !important;
                margin-bottom: 4px !important;
                display: block !important;
                font-weight: bold;
                font-size: 11pt;
            }


            .skill-table,
            .rounded {
                width: 100%;
                border-collapse: separate !important;
                border-spacing: 0 !important;
                table-layout: fixed;
                margin: 10px 0 10px;
                border: 1px solid #000;
                border-radius: 12px;
                overflow: hidden;
                background: #fff;
            }

            .skill-table th,
            .rounded th {
                background: #ffffff !important;
                color: #000 !important;
                font-weight: bold;
                font-size: 13px;
                text-transform: uppercase;
                padding: 6px !important;
                border-bottom: 1px solid #000 !important;
            }

            .skill-table td,
            .rounded td {
                font-size: 11pt;
                font-family: 'Futura';
                padding: 6px 8px !important;
                vertical-align: middle !important;
                border-top: 1px solid #000 !important;
            }

            .skill-table th,
            .skill-table td,
            .rounded th,
            .rounded td {
                border-right: 1px solid #000;
            }

            .skill-table th:last-child,
            .skill-table td:last-child,
            .rounded th:last-child,
            .rounded td:last-child {
                border-right: none;
            }

            .skill-table th:nth-child(1),
            .skill-table td:nth-child(1),
            .rounded th:nth-child(1),
            .rounded td:nth-child(1) {
                width: 72%;
                text-align: left !important;
                padding-left: 12px !important;
            }

            .skill-table th:nth-child(2),
            .skill-table td:nth-child(2),
            .skill-table th:nth-child(3),
            .skill-table td:nth-child(3),
            .rounded th:nth-child(2),
            .rounded td:nth-child(2),
            .rounded th:nth-child(3),
            .rounded td:nth-child(3) {
                width: 14%;
                text-align: center !important;
                white-space: nowrap;
            }

            .skill-table tr,
            .rounded tr {
                /*height: 28px;*/
            }

            .skill-table td.left.diamond,
            .rounded td.left.diamond {
                padding-left: 12px !important;
            }

            .p4-photo-box {
                width: 120px;
                height: 150px;
                border: 1px solid #000;
                display: flex;
                align-items: center;
                justify-content: center;
            }


            /* =====================================================
               PRINT — NO EMPTY PAGES, FULL A4 LANDSCAPE
            ===================================================== */
            @media print {

                @page {
                    size: 297mm 210mm landscape;
                    margin: 0;
                }

                html,
                body {
                    margin: 0 !important;
                    padding: 0 !important;
                    width: 297mm !important;
                    -webkit-print-color-adjust: exact !important;
                    print-color-adjust: exact !important;
                    color-adjust: exact !important;
                    font-family: 'Arial' !important;
                    font-size: 11pt !important;
                }


                .wrapper {
                    display: flex !important;
                    flex-direction: row !important;
                    /*width: 297mm !important;*/
                    /*height: 210mm !important;*/
                    /*min-height: 210mm !important;*/
                    /*max-height: 210mm !important;*/
                    /*padding: 4mm !important;*/
                    /*gap: 4mm !important;*/
                    width: 100% !important;
                    height: 100% !important;
                    padding: 6mm !important;
                    /* equal margin from all sides */
                    gap: 6mm !important;

                    margin: 0 !important;
                    box-sizing: border-box !important;
                    overflow: hidden !important;
                    page-break-inside: avoid !important;
                    break-inside: avoid !important;
                }

                .page-break {
                    display: block !important;
                    height: 0 !important;
                    margin: 0 !important;
                    padding: 0 !important;
                    page-break-after: always !important;
                    break-after: page !important;
                    page-break-before: avoid !important;
                    break-before: avoid !important;
                }

                .page,
                .left-section,
                .right-section {
                    flex: 1 !important;
                    width: calc(50% - 3mm) !important;
                    /*height: 202mm !important;*/
                    /*height: 100% !important;*/
                    height: 198mm !important;
                    /* key line */
                    /*min-height: 202mm !important;*/
                    /*max-height: 202mm !important;*/
                    padding: 8px 10px !important;
                    border: 2px solid #c4161c !important;
                    box-sizing: border-box !important;
                    overflow: hidden !important;
                    display: flex !important;
                    flex-direction: column !important;
                    page-break-inside: avoid !important;
                    break-inside: avoid !important;
                }


                th,
                td {
                    padding: 2px 4px !important;
                    line-height: 1.2 !important;
                    font-size: 11px !important;
                }

                /* PAGE 1 LEFT — PRINT */
                .p1-title {
                    font-size: 20px !important;
                    margin-bottom: 10px !important;
                    color: #c4161c !important;
                }

                .paragraph {
                    font-size: 15px !important;
                    line-height: 1.5 !important;
                    margin-bottom: 12px !important;
                    color: #000 !important;
                }

                .sub-title {
                    font-size: 15px !important;
                    margin-bottom: 8px !important;
                    color: #c4161c !important;
                }

                .grading-note {
                    margin-bottom: 8px !important;
                    font-size: 11pt !important;
                }

                .grading-table {
                    width: 72% !important;
                    margin: 0 auto 10px auto !important;
                }

                .grading-table th {
                    background: #c4161c !important;
                    color: #fff !important;
                    padding: 5px 6px !important;
                    font-size: 15px !important;
                }

                .grading-table td {
                    padding: 5px 6px !important;
                    font-size: 15px !important;
                    background: #f6e7b0 !important;
                    font-weight: bold !important;
                }

                .grading-table td.range {
                    background: #fff !important;
                    color: #0066cc !important;
                    font-weight: normal !important;
                }

                .min-note {
                    font-size: 11pt !important;
                    margin-bottom: 8px !important;
                }

                .blue-note {
                    font-size: 11pt !important;
                    margin-bottom: 7px !important;
                    color: #00a2e8 !important;
                    padding-left: 55px;
                    /* space for "Note :" */
                    text-indent: -55px;
                    /* pull first line back */
                }

                .blue-note .label {
                    font-size: 11pt !important;
                    margin-bottom: 7px !important;
                    color: #00a2e8 !important;
                    font-weight: bold;
                }

                .rules {
                    font-size: 11pt !important;
                    padding: 8px 10px !important;
                    line-height: 1.45 !important;
                    margin-bottom: 10px !important;
                    border: 2px solid #9bbad1 !important;
                    color: #1b3c73 !important;
                }

                .footer-note {
                    padding: 6px 8px !important;
                    margin-top: auto !important;
                    background: #f1f1f1 !important;
                    border: 1px solid #cfcfcf !important;
                }

                /* PAGE 1 RIGHT — PRINT */
                .school-logo img {
                    width: 120px !important;
                    height: 65px !important;
                }

                .school-name {
                    font-size: 24pt !important;
                    color: #2c2f83 !important;
                    margin-bottom: 10px;
                }

                /* SCHOOL ADDRESS & META — INCREASED */
                .school-address {
                    font-size: 11pt !important;
                    margin-top: 2px !important;
                }

                .school-meta-main {
                    font-size: 11pt !important;
                }

                .school-meta-aff {
                    font-size: 11pt !important;
                    margin-top: 10px;
                }

                .school-meta {
                    font-size: 11pt !important;
                }

                .photo-box {
                    width: 37mm !important;
                    height: 42mm !important;
                    margin: 15px auto 6px auto !important;
                    border-radius: 10px !important;
                    border: 2px solid #c4161c !important;
                }

                .report-title {
                    font-size: 20pt !important;
                    margin: 5px 0 3px !important;
                }

                .year {
                    font-size: 18px !important;
                    margin-bottom: 10px !important;
                    color: #c4161c !important;
                }

                .info-table {
                    width: 98% !important;
                }

                .info-table td {
                    padding: 8px 2px !important;
                    font-size: 11pt !important;
                    /*font-size: 20px !important;*/
                }

                .info-table td:first-child {
                    width: 32% !important;
                }

                .line {
                    display: inline-block;
                    width: 260px !important;
                    /* ⬅ longer line */
                    /*height: 20px !important;*/
                    /* ⬅ taller */
                    border-bottom: 1.5px dotted #888 !important;
                    vertical-align: middle;
                    margin-left: 6px;
                    font-size: 11pt !important;

                    /*font-size: 20px !important;*/
                    /* text sits nicely on line 
                }

                /* PAGE 2 LEFT — PRINT */
                    .p2-title {
                        font-size: 14px !important;
                        padding: 6px 8px !important;
                        letter-spacing: 1px !important;
                        background: #c41e3a !important;
                        color: #fff !important;
                        margin-bottom: 5px !important;
                    }

                    .content {
                        padding: 0 !important;
                        flex: 1 !important;
                        display: flex !important;
                        flex-direction: column !important;
                        min-height: 0 !important;
                    }

                    .description {
                        font-size: 11pt !important;
                        line-height: 1.5 !important;
                        margin-bottom: 6px !important;
                    }

                    .diagram {
                        flex: 1 !important;
                        min-height: 0 !important;
                        width: 100% !important;
                        margin: 4px 0 6px 0 !important;
                        display: flex !important;
                        align-items: center !important;
                        justify-content: center !important;
                    }

                    .mi-diagram {
                        width: 100% !important;
                        height: 100% !important;
                        max-width: 100% !important;
                        display: block !important;
                        margin: 0 auto !important;
                        object-fit: contain !important;
                    }

                    .subject-title {
                        font-size: 12px !important;
                        padding: 6px 8px !important;
                        margin: 5px 0 4px 0 !important;
                        background: #c41e3a !important;
                        color: #fff !important;
                        flex-shrink: 0 !important;
                    }

                    .levels-title {
                        font-size: 12px !important;
                        margin: 0 0 4px 0 !important;
                        color: #c41e3a !important;
                        flex-shrink: 0 !important;
                    }

                    .levels-table td {
                        padding: 5px 8px !important;
                        font-size: 12px !important;
                        border: 1px solid #333 !important;
                    }

                    .levels-table td:first-child {
                        width: 60px !important;
                        font-weight: bold !important;
                    }

                    /* PAGE 2 RIGHT — unchanged except marks table */
                    .p2-right-title {
                        font-size: 12px !important;
                        margin-bottom: 3px !important;
                    }

                    .bar-title {
                        font-size: 11pt !important;
                        padding: 3px 0 !important;
                        margin: 0 !important;
                        background: #9fa8d4 !important;
                    }

                    /* ── ONLY MARKS TABLE: slightly bigger than before ── */
                    /* before: height 17px / font 12.5px / padding 2px  */
                    /* now:    height 20px / font 13px   / padding 3px  */



                    /* support & assessment — unchanged from last version */
                    .support-table td,
                    .assessment-table td {
                        padding: 4px 5px !important;
                        font-size: 12px !important;
                        line-height: 1.2 !important;
                    }

                    .support-table td:first-child,
                    .assessment-table td:first-child {
                        width: 45% !important;
                        background: #e9e9e9 !important;
                    }

                    .support-legend {
                        padding: 4px 5px !important;
                        font-size: 10px !important;
                        margin: 3px 0 5px !important;
                        background: #c4161c !important;
                        color: #fffff !important;
                    }

                    /* remarks — unchanged */
                    .remarks-box {
                        min-height: 20px !important;
                        max-height: 42px !important;
                        padding: 4px 6px !important;
                        margin-top: 5px !important;
                        font-size: 11pt !important;
                        border: 1px solid #000 !important;
                        flex-shrink: 0 !important;
                    }

                    .promotion-section {
                        margin: 5px 0px 5px !important;
                        font-size: 11pt !important;
                        font-family: 'arial' !important;
                        flex-shrink: 0 !important;
                    }

                    .signature-section {
                        margin-top: auto !important;
                        padding-top: 6px !important;
                        font-size: 11pt !important;
                        font-family: 'arial' !important;
                        flex-shrink: 0 !important;
                    }

                    /* PAGE 3 + 4 */
                    .page-title {
                        margin-bottom: 6px !important;
                    }

                    .section-title {
                        font-size: 11pt !important;
                        margin: 7px 0 5px !important;
                        font-weight: bold !important;
                    }

                    .sub-head {
                        margin: 7px 0 5px !important;
                    }

                    .blank-box {
                        height: 44px !important;
                    }

                    .remarks-line {
                        font-size: 11pt !important;
                        height: 22px !important;
                    }

                    .remarks-heading {
                        font-size: 11pt !important;
                        font-weight: bold !important;
                        margin-top: 6px !important;
                        margin-bottom: 4px !important;
                        display: block !important;
                    }


                    .p4-photo-box {
                        width: 78px !important;
                        height: 95px !important;
                    }

                    .portfolio-title {
                        font-weight: bold !important;
                        font-size: 11pt !important;
                        margin-bottom: 6px !important;
                    }

                    .term-head {
                        background: #b4b4d6 !important;
                    }

                    .health th,
                    .attendance th {
                        background: #b4b4d6 !important;
                    }

                    .skill-table,
                    .rounded {
                        margin: 6px 0 9px !important;
                        border-radius: 8px !important;
                    }

                    .skill-table th,
                    .rounded th {
                        font-size: 12px !important;
                        padding: 3px 4px !important;
                        line-height: 1.3 !important;
                        background: #ffffff !important;
                        color: #000 !important;
                    }

                    .skill-table td,
                    .rounded td {
                        font-size: 12px !important;
                        padding: 2px 5px !important;
                        line-height: 1.3 !important;
                    }

                    /*.skill-table tr,*/
                    /*.rounded tr {*/
                    /*    height: 24px !important;*/
                    /*}*/

                    .skill-table td.left.diamond,
                    .rounded td.left.diamond {
                        padding-left: 14px !important;
                    }

                    .skill-table th:nth-child(1),
                    .skill-table td:nth-child(1),
                    .rounded th:nth-child(1),
                    .rounded td:nth-child(1) {
                        width: 72% !important;
                    }

                    /* NO BREAKS INSIDE ELEMENTS */
                    .page,
                    .left-section,
                    .right-section,
                    table,
                    thead,
                    tbody,
                    tr,
                    td,
                    th,
                    .diagram,
                    .remarks-box,
                    .signature-section,
                    .skill-table,
                    .rounded,
                    .marks-table,
                    .support-table,
                    .assessment-table {
                        page-break-inside: avoid !important;
                        break-inside: avoid !important;
                    }


                }
        </style>


    </head>

    <body>

        <div class="wrapper">


            <!-- LEFT PAGE -->
            <div class="page">
                <div class="p1-title">PERIOD ASSESSMENT</div>

                <div class="paragraph">
                    The report card is designed to assess the various areas of ability of the student.
                    Apart from his/her academic achievements, behavioural, mental and physical skills
                    are minutely examined for the overall holistic development of the students.
                </div>

                <div class="sub-title">Grading Scale</div>

                <div class="grading-note">
                    The nine point grading scale for measuring Scholastic achievements
                </div>

                <table class="grading-table">
                    <tr>
                        <th>GRADE</th>
                        <th>MARKS RANGE</th>
                    </tr>
                    <tr>
                        <td>A1</td>
                        <td class="range">91 - 100</td>
                    </tr>
                    <tr>
                        <td>A2</td>
                        <td class="range">81 - 90</td>
                    </tr>
                    <tr>
                        <td>B1</td>
                        <td class="range">71 - 80</td>
                    </tr>
                    <tr>
                        <td>B2</td>
                        <td class="range">61 - 70</td>
                    </tr>
                    <tr>
                        <td>C1</td>
                        <td class="range">51 - 60</td>
                    </tr>
                    <tr>
                        <td>C2</td>
                        <td class="range">41 - 50</td>
                    </tr>
                    <tr>
                        <td>D</td>
                        <td class="range">33 - 40</td>
                    </tr>
                    <tr>
                        <td>E1</td>
                        <td class="range">21 - 32</td>
                    </tr>
                    <tr>
                        <td>E2</td>
                        <td class="range">00 - 20</td>
                    </tr>
                </table>

                <div class="min-note">
                    Minimum qualifying grade in all subjects under Scholastic Domain is D<br>
                    and minimum qualifying marks are 33
                </div>

                <div class="blue-note">
                    <span class="label">Note : </span>All assessment with regard to the academic status of the students
                    shall be done in marks.
                </div>

                <div class="rules">
                    1. If a student is absent for an assessment whether Examination/Unit Test/Evaluation/Project,
                    he or she cannot appear for it at a later date.<br>
                    2. Promotion depends on the student's performance throughout the year.<br>
                    3. The decision of the Principal with regard to promotion is final.
                </div>

                <div class="footer-note">
                    <b>Note:</b> This Progress Report is the property of the school. Any tear,
                    mutilation or unauthorized alteration of this Report could lead to serious consequences.
                </div>
            </div>

            <!-- RIGHT PAGE -->
            <div class="page">

                <div class="school-header">

                    <div class="school-logo">
                        <?php if (!empty($institutions['logo'])): ?>
                            <img src="<?= htmlspecialchars($institutions['logo']) ?>" alt="School Logo">
                        <?php endif; ?>
                    </div>

                    <div class="school-name">
                        <?= strtoupper(htmlspecialchars($institutions['institution_name'] ?? '')) ?>
                    </div>

                    <!-- LINE 1 : ADDRESS -->
                    <div class="school-address">
                        <?= !empty($branch['address'])
                            ? ucfirst(htmlspecialchars($branch['address']))
                            : '' ?>
                    </div>

                    <!-- LINE 2 : CONTACT + EMAIL + CITY + PINCODE -->
                    <div class="school-meta school-meta-main">

                        <?php if (!empty($branch['city'])): ?>
                            <?= htmlspecialchars($branch['city']) ?>
                        <?php endif; ?>

                        <?php if (!empty($branch['pincode'])): ?>
                            - <?= htmlspecialchars($branch['pincode']) ?>
                        <?php endif; ?>

                        <?php if (!empty($branch['contact_number'])): ?>
                            &nbsp; | ☎ <?= htmlspecialchars($branch['contact_number']) ?>
                        <?php endif; ?>

                        <?php if (!empty($branch['email'])): ?>
                            &nbsp; | ✉ <?= htmlspecialchars($branch['email']) ?>
                        <?php endif; ?>

                    </div>

                    <!-- LINE 3 : AFFILIATION ONLY -->
                    <div class="school-meta school-meta-aff">
                        Affiliation No:
                        <?php if (!empty($branch['affiliation_code'])): ?>
                            <?= htmlspecialchars($branch['affiliation_code']) ?>
                        <?php endif; ?>
                    </div>
                </div>


                <div class="photo-box">
                    <?php if (!empty($students_array[0]['student_image']['filepath'])): ?>
                        <img src="<?= htmlspecialchars($students_array[0]['student_image']['filepath']) ?>" class="student-photo" alt="Student Photo">
                    <?php else: ?>
                        <span>No Photo</span>
                    <?php endif; ?>
                </div>

                <div class="report-title">HOLISTIC PROGRESS REPORT</div>
                <div class="year">2025-2026</div>

                <table class="info-table">
                    <tr>
                        <td width="35%">Name</td>
                        <td>: <span class="line"><?= $students_array[0]['name'] ?? '' ?></span></td>
                    </tr>
                    <tr>
                        <td>Class & Sec.</td>
                        <td>: <span class="line"><?= ($class_id ?? '') . ' ' . ($section_id ?? '') ?></span></td>
                    </tr>
                    <tr>
                        <td>PEN No.</td>
                        <td>: <span class="line"><?= $students_array[0]['penn'] ?? '' ?></span></td>
                    </tr>
                    <tr>
                        <td>Admission No.</td>
                        <td>: <span class="line"><?= $students_array[0]['admission_number'] ?? '' ?></span></td>
                    </tr>
                    <tr>
                        <td>Date of Birth</td>
                        <td>: <span class="line">
                                <?= !empty($students_array[0]['dob'])
                                    ? date('d-m-Y', strtotime($students_array[0]['dob']))
                                    : '' ?>
                            </span></td>
                    </tr>
                    <tr>
                        <td>Father’s Name</td>
                        <td>: <span class="line"><?= $students_array[0]['fathername'] ?? '' ?></span></td>
                    </tr>
                    <tr>
                        <td>Mother’s Name</td>
                        <td>: <span class="line"><?= $students_array[0]['mothername'] ?? '' ?></span></td>
                    </tr>
                </table>

            </div>
        </div>

        <div class="page-break"></div>

        <div class="wrapper">

            <!-- LEFT SECTION -->
            <div class="left-section">
                <div class="header"></div>
                <div class="p2-title">HOLISTIC LEARNING</div>

                <div class="content">
                    <div class="description">
                        An approach that seeks to fully activate all aspects of the learner's personality (intellect, emotions, imaginations, body) for more effective and comprehensive learning. It includes the following:
                    </div>

                    <div class="diagram">
                        <img
                            src="https://rejoicebilldesk.in/rjllearning_development/resources/assets/Multiple_Intelligence_Model.svg"
                            alt="Multiple Intelligence Model"
                            class="mi-diagram">
                    </div>


                    <div class="subject-title">SUBJECT WISE PERFORMANCE</div>

                    <div class="levels-title">Levels of performance</div>

                    <table class="levels-table">
                        <tr>
                            <td>Level 1</td>
                            <td>Needs a lot of support of teacher and peers.</td>
                        </tr>
                        <tr>
                            <td>Level 2</td>
                            <td>Able to do with support of teacher/peers.</td>
                        </tr>
                        <tr>
                            <td>Level 3</td>
                            <td>Able to perform expected skills</td>
                        </tr>
                    </table>
                </div>
            </div>

            <div class="right-section">
                <div class="header"></div>

                <div class="content">

                    <div class="p2-right-title">ACADEMIC PERFORMANCE: SCHOLASTIC AREAS</div>

                    <table class="marks-table">
                        <thead>
                            <tr>
                                <th colspan="8">TERM -II (100 MARKS)</th>
                                <th>Final</th>
                                <th></th>
                            </tr>
                            <tr>
                                <!--<th></th>-->
                                <th>PT-3<br>40</th>
                                <th>Ass.<br>5</th>
                                <th>N.B.<br>5</th>
                                <th>Marks<br>Out of<br>50</th>
                                <th>PT-4<br>80/2=40</th>
                                <th>Ass.<br>5</th>
                                <th>N.B.<br>5</th>
                                <th>Marks<br>Out of<br>50</th>
                                <th>Marks<br>Out of<br>200</th>
                                <th>Grade</th>
                            </tr>
                        </thead>

                        <tbody>
                            <tr>
                                <!--<td>English</td>-->
                                <td><?= show_val($array[1]  ?? null) ?></td>
                                <td><?= show_val($array[2]  ?? null) ?></td>
                                <td><?= show_val($array[3]  ?? null) ?></td>
                                <td><?= show_val($array[4]  ?? null) ?></td>
                                <td><?= show_val($array[5]  ?? null) ?></td>
                                <td><?= show_val($array[6]  ?? null) ?></td>
                                <td><?= show_val($array[7]  ?? null) ?></td>
                                <td><?= show_val($array[8]  ?? null) ?></td>
                                <td><?= show_val($array[9]  ?? null) ?></td>
                                <td><?= show_val($array[10] ?? null) ?></td>
                            </tr>

                            <tr>
                                <!--<td>Hindi</td>-->
                                <td><?= show_val($array[11] ?? null) ?></td>
                                <td><?= show_val($array[12] ?? null) ?></td>
                                <td><?= show_val($array[13] ?? null) ?></td>
                                <td><?= show_val($array[14] ?? null) ?></td>
                                <td><?= show_val($array[15] ?? null) ?></td>
                                <td><?= show_val($array[16] ?? null) ?></td>
                                <td><?= show_val($array[17] ?? null) ?></td>
                                <td><?= show_val($array[18] ?? null) ?></td>
                                <td><?= show_val($array[19] ?? null) ?></td>
                                <td><?= show_val($array[20] ?? null) ?></td>
                            </tr>

                            <tr>
                                <!--<td>Punjabi</td>-->
                                <td><?= show_val($array[21] ?? null) ?></td>
                                <td><?= show_val($array[22] ?? null) ?></td>
                                <td><?= show_val($array[23] ?? null) ?></td>
                                <td><?= show_val($array[24] ?? null) ?></td>
                                <td><?= show_val($array[25] ?? null) ?></td>
                                <td><?= show_val($array[26] ?? null) ?></td>
                                <td><?= show_val($array[27] ?? null) ?></td>
                                <td><?= show_val($array[28] ?? null) ?></td>
                                <td><?= show_val($array[29] ?? null) ?></td>
                                <td><?= show_val($array[30] ?? null) ?></td>
                            </tr>

                            <tr>
                                <!--<td>Maths</td>-->
                                <td><?= show_val($array[31] ?? null) ?></td>
                                <td><?= show_val($array[32] ?? null) ?></td>
                                <td><?= show_val($array[33] ?? null) ?></td>
                                <td><?= show_val($array[34] ?? null) ?></td>
                                <td><?= show_val($array[35] ?? null) ?></td>
                                <td><?= show_val($array[36] ?? null) ?></td>
                                <td><?= show_val($array[37] ?? null) ?></td>
                                <td><?= show_val($array[38] ?? null) ?></td>
                                <td><?= show_val($array[39] ?? null) ?></td>
                                <td><?= show_val($array[40] ?? null) ?></td>
                            </tr>

                            <tr>
                                <!--<td>EVS</td>-->
                                <td><?= show_val($array[41] ?? null) ?></td>
                                <td><?= show_val($array[42] ?? null) ?></td>
                                <td><?= show_val($array[43] ?? null) ?></td>
                                <td><?= show_val($array[44] ?? null) ?></td>
                                <td><?= show_val($array[45] ?? null) ?></td>
                                <td><?= show_val($array[46] ?? null) ?></td>
                                <td><?= show_val($array[47] ?? null) ?></td>
                                <td><?= show_val($array[48] ?? null) ?></td>
                                <td><?= show_val($array[49] ?? null) ?></td>
                                <td><?= show_val($array[50] ?? null) ?></td>
                            </tr>
                            <tr>
                                <!--<td>G. Total</td>-->
                                <td> </td>
                                <td> </td>
                                <td> </td>
                                <td>
                                    <?php
                                    $gt1 = ($array[4] ?? 0) + ($array[14] ?? 0) + ($array[24] ?? 0) + ($array[34] ?? 0) + ($array[44] ?? 0);
                                    echo $gt1 == 0 ? '-' : $gt1;
                                    ?>
                                </td>
                                <td> </td>
                                <td> </td>
                                <td> </td>
                                <td>
                                    <?php
                                    $gt2 = ($array[8] ?? 0) + ($array[18] ?? 0) + ($array[28] ?? 0) + ($array[38] ?? 0) + ($array[48] ?? 0);
                                    echo $gt2 == 0 ? '-' : $gt2;
                                    ?>
                                </td>
                                <td>
                                    <?php
                                    $gtf = ($array[9] ?? 0) + ($array[19] ?? 0) + ($array[29] ?? 0) + ($array[39] ?? 0) + ($array[49] ?? 0);
                                    echo $gtf == 0 ? '-' : $gtf;
                                    ?>
                                </td>
                                <td><?= $gtf == 0 ? '-' : grade_calculations($gtf, 1000) ?></td>
                            </tr>

                            <tr>
                                <!--<td>Drawing</td>-->
                                <!--<td colspan="3"></td>-->
                                <!--<td><?= ($array[54] ?? 0) == 0 ? '-' : grade_calculations($array[54], 50) ?></td>-->
                                <td colspan="7"></td>
                                <td><?= ($array[58] ?? 0) == 0 ? '-' : grade_calculations($array[58], 50) ?></td>
                                <td><?= ($array[59] ?? 0) == 0 ? '-' : grade_calculations($array[59], 200) ?></td>
                                <td><?= ($array[60] ?? 0) == 0 ? '-' : $array[60] ?></td>
                            </tr>

                            <tr>
                                <!--<td>Computer</td>-->
                                <!--<td colspan="3"></td>-->
                                <!--<td><?= ($array[64] ?? 0) == 0 ? '-' : grade_calculations($array[64], 50) ?></td>-->
                                <td colspan="7"></td>
                                <td><?= ($array[68] ?? 0) == 0 ? '-' : grade_calculations($array[68], 50) ?></td>
                                <td><?= ($array[69] ?? 0) == 0 ? '-' : grade_calculations($array[69], 200) ?></td>
                                <td><?= ($array[70] ?? 0) == 0 ? '-' : $array[70] ?></td>
                            </tr>

                            <tr>
                                <!--<td>GK</td>-->
                                <!--<td colspan="3"></td>-->
                                <!--<td><?= ($array[74] ?? 0) == 0 ? '-' : grade_calculations($array[74], 50) ?></td>-->
                                <td colspan="7"></td>
                                <td><?= ($array[78] ?? 0) == 0 ? '-' : grade_calculations($array[78], 50) ?></td>
                                <td><?= ($array[79] ?? 0) == 0 ? '-' : grade_calculations($array[79], 200) ?></td>
                                <td><?= ($array[80] ?? 0) == 0 ? '-' : $array[80] ?></td>
                            </tr>

                            <tr>
                                <td class="left" colspan="3">Percentage</td>

                                <td>
                                    <?php
                                    $p1 = (($array[4] ?? 0) + ($array[14] ?? 0) + ($array[24] ?? 0) + ($array[34] ?? 0) + ($array[44] ?? 0));
                                    echo $p1 == 0 ? '-' : round($p1 / 250 * 100, 0) . '%';
                                    ?>
                                </td>

                                <td colspan="3"></td>

                                <td>
                                    <?php
                                    $p2 = (($array[8] ?? 0) + ($array[18] ?? 0) + ($array[28] ?? 0) + ($array[38] ?? 0) + ($array[48] ?? 0));
                                    echo $p2 == 0 ? '-' : round($p2 / 250 * 100, 0) . '%';
                                    ?>
                                </td>

                                <td>
                                    <?php
                                    $pf = (($array[9] ?? 0) + ($array[19] ?? 0) + ($array[29] ?? 0) + ($array[39] ?? 0) + ($array[49] ?? 0));
                                    echo $pf == 0 ? '-' : round($pf / 1000 * 100, 0) . '%';
                                    ?>
                                </td>
                                <td></td>
                            </tr>
                        </tbody>
                    </table>

                    <div class="bar-title">PARENTAL SUPPORT</div>
                    <table class="support-table">
                        <tr>
                            <td>Uniform</td>
                            <td><?= $array[101] ?? '' ?></td>
                            <td><?= $array[102] ?? '' ?></td>
                        </tr>
                        <tr>
                            <td>Circular Follow Up</td>
                            <td><?= $array[103] ?? '' ?></td>
                            <td><?= $array[104] ?? '' ?></td>
                        </tr>
                        <tr>
                            <td>Home Work/Act. Submission</td>
                            <td><?= $array[105] ?? '' ?></td>
                            <td><?= $array[106] ?? '' ?></td>
                        </tr>
                        <tr>
                            <td>PTM/Attendance</td>
                            <td><?= $array[107] ?? '' ?></td>
                            <td><?= $array[108] ?? '' ?></td>
                        </tr>
                    </table>

                    <div class="support-legend">
                        A - Very Supportive | B - Show Support in Some Areas | C - Need to be involved
                    </div>

                    <div class="bar-title">TEACHERS ASSESSMENT</div>
                    <table class="assessment-table">
                        <tr>
                            <td>Personal Hygiene</td>
                            <td><?= $array[109] ?? '' ?></td>
                            <td><?= $array[110] ?? '' ?></td>
                        </tr>
                        <tr>
                            <td>Punctuality</td>
                            <td><?= $array[111] ?? '' ?></td>
                            <td><?= $array[112] ?? '' ?></td>
                        </tr>
                        <tr>
                            <td>Value System</td>
                            <td><?= $array[113] ?? '' ?></td>
                            <td><?= $array[114] ?? '' ?></td>
                        </tr>
                        <tr>
                            <td>Self-confidence</td>
                            <td><?= $array[115] ?? '' ?></td>
                            <td><?= $array[116] ?? '' ?></td>
                        </tr>
                    </table>

                    <div class="remarks-box">
                        <div class="remarks-heading">Class Teacher's Remarks:</div>
                        <div class="remarks-line"><?= $array[117] ?? '' ?></div>
                    </div>

                    <div class="promotion-section">
                        Promoted to Class: <?= $array[118] ?? '' ?>
                    </div>

                    <div class="signature-section">
                        <div class="signature-item">Class Teacher Signature</div>
                        <div class="signature-item">Headmistress Signature</div>
                        <div class="signature-item">Parents Signature</div>
                    </div>

                </div>
            </div>

        </div>

        <div class="page-break"></div>

        <div class="wrapper">

            <!-- LEFT PAGE -->
            <div class="page">

                <div class="page-title">ACADEMIC PERFORMANCE: SCHOLASTIC AREAS</div>

                <table class="marks-table">
                    <thead>
                        <tr class="term-head">
                            <th></th>
                            <th colspan="8">TERM - I (100 MARKS)</th>
                        </tr>
                        <tr>
                            <th>Subject</th>
                            <th>PT-1<br>40</th>
                            <th>Ass.<br>5</th>
                            <th>N.B.<br>5</th>
                            <th>Marks<br>Out of<br>50</th>
                            <th>PT-2<br>80/2=40</th>
                            <th>Ass.<br>5</th>
                            <th>N.B.<br>5</th>
                            <th>Marks<br>Out of<br>50</th>
                        </tr>
                    </thead>

                    <tr>
                        <td class="left">English</td>
                        <td><?= show_val($array[119] ?? null) ?></td>
                        <td><?= show_val($array[120] ?? null) ?></td>
                        <td><?= show_val($array[121] ?? null) ?></td>
                        <td><?= show_val($array[122] ?? null) ?></td>
                        <td><?= show_val($array[123] ?? null) ?></td>
                        <td><?= show_val($array[124] ?? null) ?></td>
                        <td><?= show_val($array[125] ?? null) ?></td>
                        <td><?= show_val($array[126] ?? null) ?></td>
                    </tr>

                    <tr>
                        <td class="left">Hindi</td>
                        <td><?= show_val($array[127] ?? null) ?></td>
                        <td><?= show_val($array[128] ?? null) ?></td>
                        <td><?= show_val($array[129] ?? null) ?></td>
                        <td><?= show_val($array[130] ?? null) ?></td>
                        <td><?= show_val($array[131] ?? null) ?></td>
                        <td><?= show_val($array[132] ?? null) ?></td>
                        <td><?= show_val($array[133] ?? null) ?></td>
                        <td><?= show_val($array[134] ?? null) ?></td>
                    </tr>

                    <tr>
                        <td class="left">Punjabi</td>
                        <td><?= show_val($array[135] ?? null) ?></td>
                        <td><?= show_val($array[136] ?? null) ?></td>
                        <td><?= show_val($array[137] ?? null) ?></td>
                        <td><?= show_val($array[138] ?? null) ?></td>
                        <td><?= show_val($array[139] ?? null) ?></td>
                        <td><?= show_val($array[140] ?? null) ?></td>
                        <td><?= show_val($array[141] ?? null) ?></td>
                        <td><?= show_val($array[142] ?? null) ?></td>
                    </tr>

                    <tr>
                        <td class="left">Maths</td>
                        <td><?= show_val($array[143] ?? null) ?></td>
                        <td><?= show_val($array[144] ?? null) ?></td>
                        <td><?= show_val($array[145] ?? null) ?></td>
                        <td><?= show_val($array[146] ?? null) ?></td>
                        <td><?= show_val($array[147] ?? null) ?></td>
                        <td><?= show_val($array[148] ?? null) ?></td>
                        <td><?= show_val($array[149] ?? null) ?></td>
                        <td><?= show_val($array[150] ?? null) ?></td>
                    </tr>

                    <tr>
                        <td class="left">EVS</td>
                        <td><?= show_val($array[151] ?? null) ?></td>
                        <td><?= show_val($array[152] ?? null) ?></td>
                        <td><?= show_val($array[153] ?? null) ?></td>
                        <td><?= show_val($array[154] ?? null) ?></td>
                        <td><?= show_val($array[155] ?? null) ?></td>
                        <td><?= show_val($array[156] ?? null) ?></td>
                        <td><?= show_val($array[157] ?? null) ?></td>
                        <td><?= show_val($array[158] ?? null) ?></td>
                    </tr>

                    <tr>
                        <td class="left">G. Total</td>
                        <td colspan="3"></td>
                        <td><?= show_val($array[162] ?? null) ?></td>
                        <td colspan="3"></td>
                        <td><?= show_val($array[166] ?? null) ?></td>
                    </tr>
                    <tr>
                        <td class="left" colspan="8">Drawing</td>
                        <!--<td><?= ($array[170] ?? 0) == 0 ? '-' : grade_calculations($array[170], 50) ?></td>-->
                        <!--<td ></td>-->
                        <td colspan="1"><?= ($array[174] ?? 0) == 0 ? '-' : grade_calculations($array[174], 50) ?></td>
                    </tr>

                    <tr>
                        <td class="left" colspan="8">Computer</td>
                        <!--<td><?= ($array[178] ?? 0) == 0 ? '-' : grade_calculations($array[178], 50) ?></td>-->
                        <!--<td colspan="3"></td>-->
                        <td colspan="1"><?= ($array[182] ?? 0) == 0 ? '-' : grade_calculations($array[182], 50) ?></td>
                    </tr>

                    <tr>
                        <td class="left" colspan="8">G.K. / Apt</td>
                        <!--<td><?= ($array[186] ?? 0) == 0 ? '-' : grade_calculations($array[186], 50) ?></td>-->
                        <!--<td colspan="3"></td>-->
                        <td colspan="1"><?= ($array[190] ?? 0) == 0 ? '-' : grade_calculations($array[190], 50) ?></td>
                    </tr>
                    <tr>
                        <td class="left" colspan="4">Percentage</td>
                        <td>
                            <?php
                            $p1 = (($array[122] ?? 0) + ($array[130] ?? 0) + ($array[138] ?? 0) +
                                ($array[146] ?? 0) + ($array[154] ?? 0));
                            echo $p1 == 0 ? '-' : round($p1 / 250 * 100, 0) . '%';
                            ?>
                        </td>
                        <td colspan="3"></td>
                        <td>
                            <?php
                            $p2 = (($array[126] ?? 0) + ($array[134] ?? 0) + ($array[142] ?? 0) +
                                ($array[150] ?? 0) + ($array[158] ?? 0));
                            echo $p2 == 0 ? '-' : round($p2 / 250 * 100, 0) . '%';
                            ?>
                        </td>
                    </tr>
                </table>

                <div style="height:18px;"></div>

                <div class="sub-head">CO-SCHOLASTICS AREAS</div>

                <table class="health">
                    <tr>
                        <th colspan="4" class="left">HEALTH STATUS</th>
                    </tr>
                    <tr>
                        <td class="left">Height</td>
                        <td class="center"><?= $array[192] ?? '' ?></td>
                        <td class="left">Weight</td>
                        <td class="center"><?= $array[193] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left">Blood Group</td>
                        <td colspan="3" class="center"><?= $array[194] ?? '' ?></td>
                    </tr>
                </table>

                <div style="height:18px;"></div>

                <table class="attendance">
                    <tr>
                        <th class="left">ATTENDENCE</th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                        <th>TOTAL</th>
                    </tr>
                    <tr>
                        <td class="left">No of Working Days</td>
                        <td class="center"><?= $array[195] ?? '' ?></td>
                        <td class="center"><?= $array[196] ?? '' ?></td>
                        <td class="center"><?= $array[197] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left">Days Attended</td>
                        <td class="center"><?= $array[198] ?? '' ?></td>
                        <td class="center"><?= $array[199] ?? '' ?></td>
                        <td class="center"><?= $array[200] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left">Attendance %</td>
                        <td class="center"><?= $array[201] ?? '' ?></td>
                        <td class="center"><?= $array[202] ?? '' ?></td>
                        <td class="center"><?= $array[203] ?? '' ?></td>
                    </tr>
                </table>

                <div style="height:18px;"></div>

                <table>
                    <tr>
                        <th class="left">Competition</th>
                    </tr>
                    <tr>
                        <td class="blank-box"><?= $array[204] ?? '';
                                                if ($array[205] != '' and $array[205] != null) '<br>' . $array[205];  ?></td>
                    </tr>
                    <!--<tr><td class="blank-box"><?= $array[205] ?? '' ?></td></tr>-->
                </table>

                <div class="remarks-box">
                    <div class="remarks-heading">Class Teacher's Remarks:</div>
                    <div class="remarks-line"><?= $array[206] ?? '' ?></div>
                </div>

            </div>

            <!-- RIGHT PAGE -->
            <div class="page">

                <div class="portfolio-title">
                    BASED ON PORTFOLIO, SUBJECT ENRICHMENT<br>
                    Activities and Class Activities
                </div>

                <div class="section-title">1. Linguistic Intelligence</div>

                <table class="skill-table">
                    <tr>
                        <th class="left">ENGLISH</th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                    </tr>
                    <tr>
                        <td class="left diamond">Able to read and understand the text easily.</td>
                        <td><?= $array[207] ?? '' ?></td>
                        <td><?= $array[208] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Remember written and spoken Information.</td>
                        <td><?= $array[209] ?? '' ?></td>
                        <td><?= $array[210] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Able to write grammatically correct sentences.</td>
                        <td><?= $array[211] ?? '' ?></td>
                        <td><?= $array[212] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Is able to explain text well.</td>
                        <td><?= $array[213] ?? '' ?></td>
                        <td><?= $array[214] ?? '' ?></td>
                    </tr>
                </table>

                <table class="skill-table">
                    <tr>
                        <th class="left">HINDI</th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                    </tr>
                    <tr>
                        <td class="left diamond">Able to read and understand the text easily.</td>
                        <td><?= $array[215] ?? '' ?></td>
                        <td><?= $array[216] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Remember written and spoken Information.</td>
                        <td><?= $array[217] ?? '' ?></td>
                        <td><?= $array[218] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Able to write grammatically correct sentences.</td>
                        <td><?= $array[219] ?? '' ?></td>
                        <td><?= $array[220] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Is able to explain text well.</td>
                        <td><?= $array[221] ?? '' ?></td>
                        <td><?= $array[222] ?? '' ?></td>
                    </tr>
                </table>

                <table class="skill-table">
                    <tr>
                        <th class="left">PUNJABI</th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                    </tr>
                    <tr>
                        <td class="left diamond">Able to read and understand the text easily.</td>
                        <td><?= $array[223] ?? '' ?></td>
                        <td><?= $array[224] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Remember written and spoken Information.</td>
                        <td><?= $array[225] ?? '' ?></td>
                        <td><?= $array[226] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Able to write grammatically correct sentences.</td>
                        <td><?= $array[227] ?? '' ?></td>
                        <td><?= $array[228] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Is able to explain text well.</td>
                        <td><?= $array[229] ?? '' ?></td>
                        <td><?= $array[230] ?? '' ?></td>
                    </tr>
                </table>

                <div class="section-title">2. Logical Mathematical Intelligence</div>

                <table class="skill-table">
                    <tr>
                        <th class="left">MATHEMATICS</th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                    </tr>
                    <tr>
                        <td class="left diamond">Enjoy working with numbers, has number sense.</td>
                        <td><?= $array[231] ?? '' ?></td>
                        <td><?= $array[232] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Able to do accurate calculation.</td>
                        <td><?= $array[233] ?? '' ?></td>
                        <td><?= $array[234] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Ability to think conceptually.</td>
                        <td><?= $array[235] ?? '' ?></td>
                        <td><?= $array[236] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Discern logical or numeric Patterns.</td>
                        <td><?= $array[237] ?? '' ?></td>
                        <td><?= $array[238] ?? '' ?></td>
                    </tr>
                </table>

            </div>
        </div>

        <div class="page-break"></div>

        <div class="wrapper">

            <!-- LEFT PAGE -->
            <div class="page">

                <table class="rounded">
                    <tr>
                        <th class="left">ENVIRONMENTAL STUDIES / SCIENCE</th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                    </tr>
                    <tr>
                        <td class="left diamond">Show awareness to the topic.</td>
                        <td><?= $array[239] ?? '' ?></td>
                        <td><?= $array[240] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Able to interpret diagrams.</td>
                        <td><?= $array[241] ?? '' ?></td>
                        <td><?= $array[242] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Enjoy in knowing facts and exploring new ideas.</td>
                        <td><?= $array[243] ?? '' ?></td>
                        <td><?= $array[244] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Comprehensive understanding of diversity.</td>
                        <td><?= $array[245] ?? '' ?></td>
                        <td><?= $array[246] ?? '' ?></td>
                    </tr>
                </table>

                <table class="rounded">
                    <tr>
                        <th class="left">COMPUTER EDUCATION</th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                    </tr>
                    <tr>
                        <td class="left diamond">Have excellent problem solving skill.</td>
                        <td><?= $array[247] ?? '' ?></td>
                        <td><?= $array[248] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Understanding of Concept.</td>
                        <td><?= $array[249] ?? '' ?></td>
                        <td><?= $array[250] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Able to do creative work and designs documents well.</td>
                        <td><?= $array[251] ?? '' ?></td>
                        <td><?= $array[252] ?? '' ?></td>
                    </tr>
                </table>

                <div class="section-title">3. Visual - Spatial Intelligence</div>

                <table class="rounded">
                    <tr>
                        <th class="left">DRAWING / ART & CRAFT</th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                    </tr>
                    <tr>
                        <td class="left diamond">Enjoy Drawing, painting and visual Art.</td>
                        <td><?= $array[253] ?? '' ?></td>
                        <td><?= $array[254] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Participation in Art and Craft work.</td>
                        <td><?= $array[255] ?? '' ?></td>
                        <td><?= $array[256] ?? '' ?></td>
                    </tr>
                </table>

                <div class="section-title">4. Bodily Kinesthetics Intelligence</div>

                <table class="rounded">
                    <tr>
                        <th class="left">HEALTH AND FITNESS</th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                    </tr>
                    <tr>
                        <td class="left diamond">Actively participates in sports.</td>
                        <td><?= $array[257] ?? '' ?></td>
                        <td><?= $array[258] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Ability to co-ordinates physical movements.</td>
                        <td><?= $array[259] ?? '' ?></td>
                        <td><?= $array[260] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Have a good sense of timing.</td>
                        <td><?= $array[261] ?? '' ?></td>
                        <td><?= $array[262] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Understands and follow instruction</td>
                        <td><?= $array[263] ?? '' ?></td>
                        <td><?= $array[264] ?? '' ?></td>
                    </tr>
                </table>

                <div class="section-title">5. Musical Rhythmic Intelligence</div>

                <table class="rounded">
                    <tr>
                        <th class="left">MUSIC / DANCE</th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                    </tr>
                    <tr>
                        <td class="left diamond">Enjoy singing and playing musical instruments.</td>
                        <td><?= $array[265] ?? '' ?></td>
                        <td><?= $array[266] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Remember songs and melodies.</td>
                        <td><?= $array[267] ?? '' ?></td>
                        <td><?= $array[268] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Follow dance steps well.</td>
                        <td><?= $array[269] ?? '' ?></td>
                        <td><?= $array[270] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Is compatible with other dancers</td>
                        <td><?= $array[271] ?? '' ?></td>
                        <td><?= $array[272] ?? '' ?></td>
                    </tr>
                </table>

            </div>

            <div class="page">

                <div class="section-title">6. Naturalistic Intelligence</div>
                <table class="rounded">
                    <tr>
                        <th class="left"></th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                    </tr>
                    <tr>
                        <td class="left diamond">Categorize information easily.</td>
                        <td><?= $array[273] ?? '' ?></td>
                        <td><?= $array[274] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Enjoy camping, exploring the outdoor trips.</td>
                        <td><?= $array[275] ?? '' ?></td>
                        <td><?= $array[276] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Have ability to adapt a changing environment.</td>
                        <td><?= $array[277] ?? '' ?></td>
                        <td><?= $array[278] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Likes to keep the environment clean</td>
                        <td><?= $array[279] ?? '' ?></td>
                        <td><?= $array[280] ?? '' ?></td>
                    </tr>
                </table>

                <div class="section-title">7. Interpersonal Intelligence</div>
                <table class="rounded">
                    <tr>
                        <th class="left"></th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                    </tr>
                    <tr>
                        <td class="left diamond">Follow self discipline.</td>
                        <td><?= $array[281] ?? '' ?></td>
                        <td><?= $array[282] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">See situation from different perspective.</td>
                        <td><?= $array[283] ?? '' ?></td>
                        <td><?= $array[284] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Can deal with distractions.</td>
                        <td><?= $array[285] ?? '' ?></td>
                        <td><?= $array[286] ?? '' ?></td>
                    </tr>
                </table>

                <div class="section-title">8. Intrapersonal Intelligence</div>
                <table class="rounded">
                    <tr>
                        <th class="left"></th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                    </tr>
                    <tr>
                        <td class="left diamond">Communicate well verbally.</td>
                        <td><?= $array[287] ?? '' ?></td>
                        <td><?= $array[288] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Create positive relationship with others</td>
                        <td><?= $array[289] ?? '' ?></td>
                        <td><?= $array[290] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Accomplishes small task well</td>
                        <td><?= $array[291] ?? '' ?></td>
                        <td><?= $array[292] ?? '' ?></td>
                    </tr>
                </table>

                <div class="section-title">9. Existential Intelligence</div>
                <table class="rounded">
                    <tr>
                        <th class="left">Value Education/Yoga and Meditation</th>
                        <th>TERM I</th>
                        <th>TERM II</th>
                    </tr>
                    <tr>
                        <td class="left diamond">Observes values taught in the class.</td>
                        <td><?= $array[293] ?? '' ?></td>
                        <td><?= $array[294] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Meditates regularly and enjoys Yoga practice.</td>
                        <td><?= $array[295] ?? '' ?></td>
                        <td><?= $array[296] ?? '' ?></td>
                    </tr>
                    <tr>
                        <td class="left diamond">Can think critically and objectively</td>
                        <td><?= $array[297] ?? '' ?></td>
                        <td><?= $array[298] ?? '' ?></td>
                    </tr>
                </table>

            </div>
        </div>

    </body>

    </html>
<?php
}
?>