<div class="col-xl-8 col-lg-12 col-md-12 col-sm-12 col-12 layout-spacing">
    <div class="widget widget-table-two">
        <div class="widget-heading">
            <h5 class="">Jadwal Undian Arisan</h5>
        </div>
        <div class="widget-content widget-content-area">
            <?= $this->session->flashdata('pesan_berhasil'); ?>
            <?= $this->session->flashdata('pesan_gagal'); ?>
            <table id="style-3" class="table style-3  table-hover">
                <thead>
                    <tr>
                        <th class="text-center">Undian</th>
                        <th class="text-center">Tanggal</th>
                        <th class="text-center">Status</th>
                        <th class="text-center">Aksi</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($jadwal_undian as $Jadwal_undian) : ?>
                        <tr>
                            <td>
                                <center>
                                    <?= $Jadwal_undian->undian_ke ?>
                                </center>
                            </td>
                            <td>
                                <?= date('d', strtotime($Jadwal_undian->tgl_undian)) ?>
                                <?= $this->mycustom->bulanIndo(date('m', strtotime($Jadwal_undian->tgl_undian))) ?>
                                <?= date('Y', strtotime($Jadwal_undian->tgl_undian)) ?>
                            </td>
                            <td>
                                <center>
                                    <?php
                                    if ($Jadwal_undian->status_undian == 'BELUM') : ?>
                                        <span class="shadow-none badge badge-warning"><?= $Jadwal_undian->status_undian ?></span>
                                    <?php else : ?>
                                        <span class="shadow-none badge badge-success"><?= $Jadwal_undian->status_undian ?></span>
                                    <?php endif; ?>
                                </center>
                            </td>
                            <td class="text-center">
                                <?php
                                if ($Jadwal_undian->status_undian != 'SELESAI') : ?>
                                    <div class="btn-group mr-2">
                                        <button class="btn btn-primary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                            Pilih Aksi <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down">
                                                <polyline points="6 9 12 15 18 9"></polyline>
                                            </svg>
                                        </button>
                                        <div class="dropdown-menu">
                                            <?php if ($Jadwal_undian->status_undian == 'BELUM') : ?>
                                                <a href="javascript:void(0);" class="dropdown-item" id="detail_jadwal" data-target="#jadwal_detail" class="bs-tooltip" data-toggle="modal" data-kode_regist="<?= $data_arisan['id'] ?>" data-tgl_undian="<?= $Jadwal_undian->tgl_undian ?>" data-undian_ke="<?= $Jadwal_undian->undian_ke ?>" data-status_undian="<?= $Jadwal_undian->status_undian ?>">Jadwal</a>
                                            <?php endif; ?>
                                            <a class="dropdown-item" href="<?= base_url('arisan/operasional/jadwal_motor/histori/' . $this->encrypt->encode($Jadwal_undian->id)) ?>">Tagihan</a>
                                        </div>
                                    </div>
                                <?php else : ?>
                                    <?php foreach ($data_laporan as $Data_laporan) :
                                        if ($Data_laporan->jadwal_id == $Jadwal_undian->id) :
                                    ?>
                                            <a class="btn btn-primary btn-sm" href="<?= base_url('arisan/laporan/laporan_motor/lap_detail/' . $this->encrypt->encode($Data_laporan->id)) ?>" style="color: white;">Laporan</a>
                                    <?php
                                        endif;
                                    endforeach; ?>
                                <?php endif; ?>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>
        </div>
    </div>
</div>