<?php
include '../includes/db.php';
$student_id = intval($_GET['student_id']);
$student = $conn->query("SELECT * FROM studentss WHERE id=$student_id")->fetch_assoc();
?>

<div class="modal fade" id="paymentModal" tabindex="-1">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <form action="submit_payment.php" method="POST">
        <div class="modal-header">
          <h5 class="modal-title">Add Payment for <?= $student['full_name'] ?></h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
        </div>
        <div class="modal-body">
          <input type="hidden" name="student_id" value="<?= $student_id ?>">
          <div class="row">
              <div class="col-md-6 mb-3">
                  <label>Course Fee (LKR)</label>
                  <input type="number" name="course_fee" class="form-control" required>
              </div>
              <div class="col-md-6 mb-3">
                  <label>Registration Fee</label>
                  <input type="number" name="reg_fee" class="form-control" required>
              </div>
              <div class="col-md-6 mb-3">
                  <label>Certificate Fee (USD)</label>
                  <input type="number" name="cert_fee" class="form-control" required>
              </div>
              <div class="col-md-6 mb-3">
                  <label>Due Date</label>
                  <input type="date" name="due_date" class="form-control" required>
              </div>
          </div>
        </div>
        <div class="modal-footer">
          <button class="btn btn-success" type="submit">Submit Payment</button>
          <button class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
        </div>
      </form>
    </div>
  </div>
</div>
