<?php $currency_symbol = $this->customlib->getSchoolCurrencyFormat(); ?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Term Performance Report</title>

    <style>
        body {
            font-family: "Times New Roman", serif;
            background: #ffffff;
            margin: 0;
            padding: 0;
        }

        .page-wrapper {
            width: 850px;
            margin: auto;
            padding: 25px 40px;
        }

        /* HEADER SECTION */
        .top-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .top-header img {
            height: 70px;
        }

        .school-box {
            text-align: right;
            padding: 15px 20px;
            background: #1b4f72;
            color: white;
            border-radius: 4px;
            font-size: 14px;
            font-weight: bold;
        }

        /* TITLE BAR */
        .title-bar {
            background: #b22222; /* deep red similar to example */
            color: white;
            padding: 12px;
            text-align: center;
            font-size: 24px;
            margin-top: 20px;
            border-radius: 4px;
            font-weight: bold;
        }

        /* STUDENT INFO BOX */
        .section-title {
            font-size: 18px;
            font-weight: bold;
            margin-top: 25px;
            border-bottom: 2px solid #ccc;
            padding-bottom: 3px;
            color: #1b4f72;
        }

        .info-grid {
            display: flex;
            justify-content: space-between;
            margin-top: 10px;
            font-size: 15px;
        }

        .info-grid div {
            width: 48%;
            line-height: 1.7;
        }

        /* TABLE STYLING LIKE IMAGE */
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
            font-size: 15px;
        }

        table thead th {
            background: #34495e;
            color: white;
            padding: 8px;
            border: 1px solid #ccc;
        }

        table tbody td, table tfoot td {
            border: 1px solid #ccc;
            padding: 7px;
        }

        table tbody tr:nth-child(even) {
            background: #f8f8f8;
        }

        table tfoot tr {
            background: #34495e;
            color: white;
            font-weight: bold;
        }

        /* COMMENT BOXES */
        .comment-box {
            margin-top: 15px;
            background: #f2f2f2;
            padding: 15px;
            border-left: 4px solid #1b4f72;
            border-radius: 3px;
            line-height: 1.6;
        }

        /* SIGNATURE LINES */
        .signature-row {
            display: flex;
            justify-content: space-between;
            margin-top: 50px;
        }

        .sig-box {
            width: 30%;
            text-align: center;
        }

        .sig-line {
            width: 100%;
            border-top: 1px solid #000;
            margin-bottom: 5px;
            height: 20px;
        }

        .footer-note {
            text-align: center;
            font-size: 12px;
            color: #555;
            margin-top: 30px;
        }
    </style>

</head>
<body>

<div class="page-wrapper">

    <!-- HEADER WITH LOGO AND BLUE SCHOOL BOX -->
    <div class="top-header">
        <div>
            <?php if ($settinglist[0]['image'] != "") { ?>
                <img src="<?php echo base_url(); ?>/uploads/school_content/logo/<?php echo $settinglist[0]['image']; ?>">
            <?php } ?>
        </div>

        <div class="school-box">
            <div style="font-size:16px;"><?php echo $settinglist[0]['name']; ?></div>
            <div><?php echo $settinglist[0]['address']; ?></div>
            <div>Phone: <?php echo $settinglist[0]['phone']; ?></div>
        </div>
    </div>

    <!-- MAIN TITLE BAR -->
    <div class="title-bar">TERM PERFORMANCE REPORT</div>

    <!-- STUDENT INFORMATION -->
    <div class="section-title">Student Information</div>

    <div class="info-grid">
        <div>
            <strong>Name:</strong> Emma Johnson<br>
            <strong>Admission Number:</strong> STU2024001<br>
            <strong>Class/Grade:</strong> Level 2 - Section A
        </div>

        <div>
            <strong>Academic Year:</strong> 2024-2025<br>
            <strong>Term:</strong> Second Term<br>
            <strong>Report Date:</strong> <?php echo date('F d, Y'); ?>
        </div>
    </div>

    <!-- PERFORMANCE TABLE -->
    <div class="section-title">Academic Performance</div>

    <table>
        <thead>
            <tr>
                <th>Subject</th>
                <th>Actual Mark</th>
                <th>Possible Mark</th>
                <th>Percentage</th>
                <th>Grade</th>
                <th>Teacher's Comment</th>
            </tr>
        </thead>

        <tbody>
            <tr>
                <td>Mathematics</td>
                <td align="center">85</td>
                <td align="center">100</td>
                <td align="center">85%</td>
                <td align="center"><b>A</b></td>
                <td>Excellent mathematical reasoning.</td>
            </tr>

            <tr>
                <td>English Language</td>
                <td align="center">78</td>
                <td align="center">100</td>
                <td align="center">78%</td>
                <td align="center"><b>B+</b></td>
                <td>Good writing skills and creativity.</td>
            </tr>

            <tr>
                <td>Science</td>
                <td align="center">92</td>
                <td align="center">100</td>
                <td align="center">92%</td>
                <td align="center"><b>A</b></td>
                <td>Exceptional performance.</td>
            </tr>

            <tr>
                <td>Social Studies</td>
                <td align="center">80</td>
                <td align="center">100</td>
                <td align="center">80%</td>
                <td align="center"><b>A-</b></td>
                <td>Good understanding of concepts.</td>
            </tr>

            <tr>
                <td>Art & Creativity</td>
                <td align="center">88</td>
                <td align="center">100</td>
                <td align="center">88%</td>
                <td align="center"><b>A</b></td>
                <td>Very creative and imaginative.</td>
            </tr>
        </tbody>

        <tfoot>
            <tr>
                <td>OVERALL PERFORMANCE</td>
                <td align="center"><b>423</b></td>
                <td align="center"><b>500</b></td>
                <td align="center"><b>84.6%</b></td>
                <td align="center"><b>A-</b></td>
                <td><b>Excellent Academic Standing</b></td>
            </tr>
        </tfoot>
    </table>

    <!-- TEACHER COMMENTS -->
    <div class="section-title">Teacher Comments</div>

    <div class="comment-box">
        <strong>Class Teacher:</strong><br>
        Emma has shown remarkable progress this term. Excellent analytical skills and participation.
    </div>

    <div class="comment-box">
        <strong>Head Teacher:</strong><br>
        Outstanding performance across all subjects. Highly recommended for advanced programs.
    </div>

    <div class="comment-box">
        <strong>Recommendations:</strong><br>
        • Continue advanced reading program<br>
        • Participate in math olympiad<br>
        • Lead science project team<br>
        • Develop writing portfolio
    </div>

    <!-- ATTENDANCE & BEHAVIOR -->
    <div class="section-title">Attendance & Conduct</div>

    <table>
        <tr><td><strong>Days Present:</strong></td><td>85 days</td></tr>
        <tr><td><strong>Days Absent:</strong></td><td>2 days</td></tr>
        <tr><td><strong>Attendance Rate:</strong></td><td>97.7%</td></tr>
        <tr><td><strong>Punctuality:</strong></td><td>Excellent</td></tr>
    </table>

    <br>

    <table>
        <tr><td><strong>Participation:</strong></td><td>Excellent</td></tr>
        <tr><td><strong>Homework:</strong></td><td>Always</td></tr>
        <tr><td><strong>Behavior:</strong></td><td>Exemplary</td></tr>
        <tr><td><strong>Cooperation:</strong></td><td>Outstanding</td></tr>
    </table>

    <!-- SIGNATURES -->
    <div class="signature-row">
        <div class="sig-box">
            <div class="sig-line"></div>
            Class Teacher
        </div>

        <div class="sig-box">
            <div class="sig-line"></div>
            Head Teacher
        </div>

        <div class="sig-box">
            <div class="sig-line"></div>
            Parent/Guardian
        </div>
    </div>

    <!-- FOOTER -->
    <div class="footer-note">
        This is a computer-generated report. No signature is required.<br>
        Generated on: <?php echo date('F d, Y \a\t h:i A'); ?>
    </div>

</div>

</body>
</html>
