<?php include 'templates/header.php'; ?>

<section id="jadwal" class="section pt-5">
  <div class="container" data-aos="fade-up">
    <div class="section-title text-center mb-5">
        <br><br><br><br><br>
      <h2 class="fw-bold fs-5">Jadwal Pendaftaran</h2>
      <p>Berikut adalah tahapan dan jadwal penting dalam proses PPDB</p>
    </div>

    <div class="timeline-wrapper clearfix">
      <div class="timeline-line"></div>

      <?php
      include 'config/koneksi.php';
      $items = mysqli_query($conn, "SELECT * FROM timeline_pendaftaran ORDER BY urutan ASC");
      $colors = ['primary', 'danger', 'success', 'warning', 'info', 'secondary'];
      $i = 0;
      while ($row = mysqli_fetch_assoc($items)):
        $color = $colors[$i % count($colors)];
        $side = ($i % 2 == 0) ? 'left' : 'right';
      ?>
        <div class="timeline-step <?= $side ?>" data-aos="fade-up">
          <div class="icon bg-<?= $color ?>">
            <?= $row['urutan'] ?>
          </div>
          <div class="card bg-white">
            <h6 class="fw-bold mb-1"><?= htmlspecialchars($row['nama_kegiatan']) ?></h6>
            <small class="text-muted"><?= htmlspecialchars($row['tanggal']) ?></small>
          </div>
        </div>
      <?php $i++; endwhile; ?>
    </div>
  </div>
</section>

<?php include 'templates/footer.php'; ?>