<?php

function template14($institutions, $branch, $students_array, $examination, $array, $result, $class_id, $section_id)
{
?>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Template 14</title>
	<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
	<!--<link href="<?php echo 'https://rejoicebilldesk.in/rjllearning_development/resources/marksheet_template/template14/style_template14.css?key=' . time(); ?>" type="text/css" rel="stylesheet">-->
    <link href="<?php echo 'https://rejoicebilldesk.in/rjllearning_development/resources/marksheet_template/template14/custom_stylesheets/4/14.css?key=' . time(); ?>" type="text/css" rel="stylesheet">

</head>
<body>
  <div class="report-container">

    <!-- Header -->
    <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="affiliation-details">
          <span><?php echo $branch['branch_code']; ?></span>
          <span><?php echo $branch['address']; ?><?php if ($branch['pincode'] != "") { echo " - " . $branch['pincode']; } ?></span> 
          <span><?php echo $branch['contact_number']; ?><?php if ($branch['email'] != "") { echo ", " . strtolower($branch['email']); } ?></span>
        </div>
      </div>
    </div>

    <!-- Report Title -->
    <div class="text-center">
      <h2 class="progress-report-title">Progress Report</h2>
      <p class="session-info">Academic Session <?php echo $result; ?></p>
    </div>

    <!-- Student Info -->
    <div class="student-info">
      <div class="student-info-item">
        <span class="label">Name : </span>
        <span class="value"><?php echo $students_array[0]['name']; ?></span>
      </div>
      <div class="student-info-item">
        <span class="label">Admission Number :</span>
        <span class="value"><?php echo $students_array[0]['admission_number']; ?></span>
      </div>
      <div class="student-info-item">
        <span class="label">Class :</span>
        <span class="value"><?php echo $class_id; ?></span>
      </div>
      <div class="student-info-item">
        <span class="label">Section :</span>
        <span class="value"><?php echo $section_id; ?></span>
      </div>
      <div class="student-info-item">
        <span class="label">Father's Name :</span>
        <span class="value"><?php echo $students_array[0]['fathername']; ?></span>
      </div>
      <div class="student-info-item">
        <span class="label">Mother's Name :</span>
        <span class="value"><?php echo $students_array[0]['mothername']; ?></span>
      </div>
    </div>

    <!-- Marks Table -->
    <table class="marks-table">
      <thead>
        <tr>
          <th>SUBJECT</th>
          <th><?php echo ucwords(strtolower($examination)); ?><br>MAXIMUM MARKS</th>
          <th>MARKS OBTAINED</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>English</td>
          <td>20</td>
          <td><?php echo $array[1]; ?></td>
        </tr>
        <tr>
          <td>Mathematics</td>
          <td>20</td>
          <td><?php echo ($array[2] == "0" || $array[2] == "00") ? "-" : $array[2]; ?></td>
        </tr>
        <tr>
          <td>E.V.S.</td>
          <td>20</td>
          <td><?php echo ($array[3] == "0" || $array[3] == "00") ? "-" : $array[3]; ?></td>
        </tr>
        <tr>
          <td>Punjabi</td>
          <td>20</td>
          <td><?php echo ($array[4] == "0" || $array[4] == "00") ? "-" : $array[4]; ?></td>
        </tr>
        <tr>
          <td>Hindi</td>
          <td>20</td>
          <td><?php echo ($array[5] == "0" || $array[5] == "00") ? "-" : $array[5]; ?></td>
        </tr>
        <tr class="total-row">
          <td>TOTAL</td>
          <td>100</td>
          <td><?php echo $array[6]; ?></td>
        </tr>
      </tbody>
    </table>

    <!-- Remarks -->
    <p><strong>Remarks :</strong> <?php echo ucwords(strtolower($array[7])); ?></p>

    <!-- Signatures -->
    <div class="signatures">
      <div class="signature-item">
        <span class="signature-label">Class Incharge</span>
      </div>
      <div class="signature-item">
        <span class="signature-label">Principal / Headmistress</span>
      </div>
    </div>

    <!-- Date -->
    <p class="date">Date: <?php echo date('d-m-Y'); ?></p>

    <!-- Disclaimer -->
    <p class="disclaimer">* Incase of any discrepancies in marksheet, please contact school administration.</p>
  </div>
</body>
</html>
<?php
}
?>
