<!-- Begin Page Content -->
<div class="container-fluid">

  <!-- Page Heading -->
  <h1 class="h3 mb-2 text-gray-800">Daftar Peserta</h1>

  <!-- DataTales Example -->
  <div class="card shadow mb-4">
    <div class="card-header py-3">

    </div>
    <div class="card-body">
      <a href="<?= base_url('admin/peserta/print') ?>" class="btn btn-primary mb-4">Cetak</a>

      <div class="table-responsive">
        <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
          <thead>
            <tr>
              <th>No</th>
              <th>Username</th>
              <th>Nama</th>
              <th>Jenis</th>
              <th>No Antri</th>
              <th>Harga</th>
              <th>Created At</th>
              <th>Edit</th>
            </tr>
          </thead>
          <tbody>
            <?php
            $no = 1;
            foreach ($peserta as $data) {
            ?>
            <tr>
              <td><?php echo $no; ?></td>
              <td><?php echo $data->username; ?></td>
              <td><?php echo $data->nama; ?></td>
              <td><?php echo $data->jenis; ?></td>
              <td><?php echo $data->no_antri; ?></td>
              <td><?php echo number_format($data->harga); ?></td>
              
              <td><?php echo date('d-m-Y H:i:s',strtotime($data->created_at)); ?></td>
              <td>
                <a href="<?php echo base_url(); ?>admin/peserta/cetak/<?php echo $data->id; ?>" class="btn btn-warning btn-icon-split btn-sm">
                    <span class="icon text-white-50">
                      <i class="fas fa-edit"></i>
                    </span>
                    <span class="text">Cetak Invoice</span>
                </a>
              </td>
            </tr>
            <?php
            $no++;
            }
             ?>
          </tbody>
        </table>
      </div>
    </div>
  </div>

</div>
<!-- /.container-fluid -->
