<?php
function template26($institutions, $branch, $students_array, $examination, $array, $result, $class_id, $section_id = null) {
?>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Result - <?php echo $institutions['institution_name']; ?></title>
    <style>
      :root {
        --primary-color: #2c6e49;
        --secondary-color: #4c956c;
        --accent-color: #fefee3;
        --text-color: #333;
        --border-color: #d8d8d8;
      }

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

      body {
        font-family: 'Poppins', sans-serif;
        color: var(--text-color);
        background-color: #f9f9f9;
      }

      .container_marksheet {
        width: 21cm;
        min-height: 29.7cm;
        margin: 0 auto;
        padding: 2rem;
        background: white;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
        position: relative;
        overflow: hidden;
      }

      .container_marksheet::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 10px;
        background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
      }

      .header {
        display: flex;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid var(--border-color);
      }

      .logo {
        width: 80px;
        height: 80px;
        margin-right: 1.5rem;
        border: 2px solid var(--border-color);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
      }

      .logo img {
        max-width: 100%;
        max-height: 100%;
      }

      .school-info {
        flex: 1;
      }

      .school-name {
        font-size: 1.8rem;
        font-weight: 700;
        color: var(--primary-color);
        margin-bottom: 0.3rem;
      }

      .school-details {
        font-size: 0.9rem;
        color: #666;
      }

      .report-title {
        text-align: center;
        margin: 1.5rem 0;
      }

      .report-title h1 {
        font-size: 2rem;
        color: var(--primary-color);
        margin-bottom: 0.5rem;
        position: relative;
        display: inline-block;
      }

      .report-title h1::after {
        content: "";
        position: absolute;
        bottom: -5px;
        left: 25%;
        width: 50%;
        height: 3px;
        background: var(--secondary-color);
      }

      .report-title .session {
        font-size: 1rem;
        color: #666;
        font-weight: 500;
      }

      .student-info {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
      }

      .info-box {
        background-color: var(--accent-color);
        padding: 1rem;
        border-radius: 8px;
        border-left: 4px solid var(--primary-color);
      }

      .info-row {
        display: flex;
        margin-bottom: 0.5rem;
      }

      .info-label {
        font-weight: 600;
        min-width: 120px;
        color: var(--primary-color);
      }

      .info-value {
        flex: 1;
      }

      .marks-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 1.5rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
      }

      .marks-table th {
        background-color: var(--primary-color);
        color: white;
        padding: 0.8rem;
        text-align: left;
        font-weight: 500;
      }

      .marks-table td {
        padding: 0.8rem;
        border-bottom: 1px solid var(--border-color);
      }

      .marks-table tr:nth-child(even) {
        background-color: #f5f5f5;
      }

      .marks-table tr:last-child td {
        font-weight: 600;
        background-color: #e8f4ea;
      }

      .additional-info {
        margin-bottom: 2rem;
      }

      .info-box-large {
        background-color: #f8f9fa;
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: 1rem;
      }

      .info-box-large h3 {
        color: var(--primary-color);
        margin-bottom: 0.5rem;
        font-size: 1rem;
      }

      .signatures {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        margin-top: 3rem;
        padding-top: 1rem;
        border-top: 2px dashed var(--border-color);
      }

      .signature-box {
        text-align: center;
      }

      .signature-line {
        height: 1px;
        background-color: var(--border-color);
        margin: 2rem 0 0.5rem;
        position: relative;
      }

      .signature-line::before {
        content: "";
        position: absolute;
        top: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 100px;
        height: 1px;
        background-color: var(--border-color);
      }

      .footer-note {
        text-align: center;
        font-size: 0.8rem;
        color: #999;
        margin-top: 1rem;
        font-style: italic;
      }
    </style>
  </head>

  <body>
    <div class="container_marksheet">
      <div class="header">
        <div class="logo">
          <img src="<?php echo $institutions['logo']; ?>" alt="School Logo" />
        </div>
        <div class="school-info">
          <h1 class="school-name"><?php echo $institutions['institution_name']; ?></h1>
          <div class="school-details">
            <div>Affiliation Code: <?php echo $branch['branch_code']; ?></div>
            <div><?php echo $branch['address']; 
              if($branch['pincode'] != "") {
                echo " - ".$branch['pincode'];  
              }
            ?></div>
            <div>Contact: <?php echo $branch['contact_number'];
              if($branch['email'] != "") {
                echo " | Email: ".strtolower($branch['email']);
              }
            ?></div>
          </div>
        </div>
      </div>

      <div class="report-title">
        <h1>Progress Report</h1>
        <div class="session">Academic Session <?php echo $result; ?></div>
      </div>

      <div class="student-info">
        <div class="info-box">
          <div class="info-row">
            <div class="info-label">Name:</div>
            <div class="info-value"><?php echo $students_array[0]['name']; ?></div>
          </div>
          <div class="info-row">
            <div class="info-label">Class:</div>
            <div class="info-value"><?php echo $class_id; ?></div>
          </div>
          <div class="info-row">
            <div class="info-label">Father's Name:</div>
            <div class="info-value"><?php echo $students_array[0]['fathername']; ?></div>
          </div>
        </div>

        <div class="info-box">
          <div class="info-row">
            <div class="info-label">Admission Number:</div>
            <div class="info-value"><?php echo $students_array[0]['admission_number']; ?></div>
          </div>
          <div class="info-row">
            <div class="info-label">Section:</div>
            <div class="info-value"><?php echo $section_id; ?></div>
          </div>
          <div class="info-row">
            <div class="info-label">Mother's Name:</div>
            <div class="info-value"><?php echo $students_array[0]['mothername']; ?></div>
          </div>
        </div>
      </div>

      <div class="report-title">
        <h2><?php echo ucwords(strtolower($examination)); ?></h2>
      </div>

      <table class="marks-table">
        <thead>
          <tr>
            <th>Subject</th>
            <th>Maximum Marks</th>
            <th>Marks Obtained</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>English</td>
            <td>40</td>
            <td><?php echo $array[5]; ?></td>
          </tr>
          <tr>
            <td>Physical Education</td>
            <td>40</td>
            <td><?php echo $array[6]; ?></td>
          </tr>
          <tr>
            <td><?php echo ucwords($array[1]); ?></td>
            <td>40</td>
            <td><?php echo $array[7]; ?></td>
          </tr>
          <tr>
            <td><?php echo ucwords($array[2]); ?></td>
            <td>40</td>
            <td><?php echo $array[8]; ?></td>
          </tr>
          <tr>
            <td><?php echo ucwords($array[3]); ?></td>
            <td>40</td>
            <td><?php echo $array[9]; ?></td>
          </tr>
          <tr>
            <td><?php echo ucwords($array[4] . ' (Add.)'); ?></td>
            <td>40</td>
            <td><?php echo $array[10]; ?></td>
          </tr>
          <tr>
            <td>Information Technology (Add.)</td>
            <td>40</td>
            <td><?php echo $array[11]; ?></td>
          </tr>
          <tr>
            <td><strong>TOTAL</strong></td>
            <td>200</td>
            <td><strong><?php echo $array[12]; ?></strong></td>
          </tr>
        </tbody>
      </table>

      <div class="additional-info">
        <div class="info-box-large">
          <h3>Remarks:</h3>
          <div><?php echo ucwords(strtolower($array[13])); ?></div>
        </div>
      </div>

      <div class="signatures">
        <div class="signature-box">
          <div>Class Incharge</div>
          <div class="signature-line"></div>
        </div>
        <div class="signature-box">
          <div>Principal / Headmistress</div>
          <div class="signature-line"></div>
        </div>
        <div class="signature-box">
          <div>Parent's Signature</div>
          <div class="signature-line"></div>
        </div>
      </div>

      <div class="footer-note">
        * In case of any discrepancies in marksheet, please contact school administration.
      </div>
    </div>
  </body>
</html>

<?php
}
?>