<div id="content" class="main-content">
    <div class="layout-px-spacing">
        <?= $this->session->flashdata('pesan_berhasil'); ?>
        <?= $this->session->flashdata('pesan_gagal'); ?>
        <div class="row layout-top-spacing">
            <div class="col-xl-3 col-lg-12 col-md-12 col-sm-12 col-12 layout-spacing">
                <div class="card component-card_7" style="width: auto;">
                    <div class="card-body">
                        <h4 class="card-text">Saldo Kelompok <br>
                            Bulan Kemarin
                        </h4>
                        <h2 class="card-text">
                            <?= number_format(($saldo_terakhir), 0, ',', '.') ?>,-
                        </h2>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-lg-12 col-md-12 col-sm-12 col-12 layout-spacing">
                <div class="card component-card_7" style="width: auto;">
                    <div class="card-body">
                        <h4 class="card-text">Saldo Iuran <br> Bulan Sekarang</h4>
                        <h2 class="card-text">
                            <?= number_format(($saldo_iuran['jml_iuran']), 0, ',', '.') ?>,-
                        </h2>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-lg-12 col-md-12 col-sm-12 col-12 layout-spacing">
                <div class="card component-card_7" style="width: auto;">
                    <div class="card-body">
                        <h5 class="card-text">Lelang Tertinggi <br>
                            <?php if ($saldo_lelang['total_lelang'] > 0) : ?>
                            ( <?= $saldo_lelang['regist_undian'] ?> )
                            <?php else : ?>
                            Belum Ada Lelang
                            <?php endif; ?></h5>
                        <h2 class="card-text">
                            <?= number_format(($saldo_lelang['total_lelang']), 0, ',', '.') ?>,-
                        </h2>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 col-lg-12 col-md-12 col-sm-12 col-12 layout-spacing">
                <div class="card component-card_7" style="width: auto;">
                    <div class="card-body">
                        <h4 class="card-text">Anggota Peserta <br>Lelang</h4>
                        <h2 class="card-text">
                            <?= $jml_lelang ?> Anggota
                        </h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <blockquote class="blockquote media-object">
                    <div class="media">
                        <div class="media-body align-self-center">
                            <a style="float: right;" class="btn btn-primary btn-sm" href="javascript:void(0);"
                                data-toggle="modal" data-target="#laporan_detail" style="color: white;">Laporan</a>
                            <p class="d-inline">
                                Kelompok Arisan <?= $data_arisan['ket_arisan'] ?>
                                ke-<?= $data_arisan['nm_kelompok'] ?><br>
                                Lelang Ke <?= $jadwal_arisan['undian_ke'] ?> - <?= $jadwal_arisan['status_undian'] ?> -
                                <span class="badge badge-primary"> Proses Lelang </span>
                            </p>
                        </div>
                    </div>
                    <small class="text-right">Undian : <cite
                            title="Source Title"><?= $this->mycustom->hariIndo(date('l', strtotime($jadwal_arisan['tgl_undian']))) ?>,
                            <?= $this->mycustom->bulanIndo(date('m', strtotime($jadwal_arisan['tgl_undian'])))  ?>
                            <?= date('Y', strtotime($jadwal_arisan['tgl_undian']))  ?></cite></small>
                </blockquote>
            </div>
        </div>
        <div class="row layout-spacing">
            <div class="col-lg-12">
                <div class="statbox widget box box-shadow">
                    <div class="widget-content widget-content-area">
                        <a style="float: right;" class="btn btn-primary btn-sm" href="javascript:void(0);"
                            data-toggle="modal" data-target="#lelang_detail" style="color: white;">Tambah</a>
                        <?= $this->session->flashdata('notifikasi_beli2'); ?>
                        <h4 class="">( <?= $jml_lelang ?> ) Anggota Lelang</h4>
                        <table id="style-lelang" class="table style-lelang  table-hover">
                            <thead>
                                <tr>
                                    <th class="text-center sorting" tabindex="0" aria-controls="style-lelang"
                                        rowspan="1" colspan="1"
                                        aria-label="No Regist: activate to sort column ascending"
                                        style="width: 74.3438px;">No Regist</th>
                                    <th class="text-center sorting" tabindex="0" aria-controls="style-lelang"
                                        rowspan="1" colspan="1"
                                        aria-label="Identitas: activate to sort column ascending"
                                        style="width: 139.188px;">Identitas</th>
                                    <th class="text-center sorting" tabindex="0" aria-controls="style-lelang"
                                        rowspan="1" colspan="1" aria-label="Alamat: activate to sort column ascending"
                                        style="width: 168.812px;">Alamat</th>
                                    <th class="text-center sorting_desc" tabindex="0" aria-controls="style-lelang"
                                        rowspan="1" colspan="1"
                                        aria-label="Bid Lelang: activate to sort column ascending"
                                        style="width: 81.5625px;" aria-sort="descending">Bid Lelang</th>
                                    <th class="text-center sorting" tabindex="0" aria-controls="style-lelang"
                                        rowspan="1" colspan="1" aria-label="Alamat: activate to sort column ascending"
                                        style="width: 168.812px;">Aksi</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach ($anggota_lelang as $Anggota_lelang) : ?>
                                <tr>
                                    <td class="text-center">
                                        <?= $Anggota_lelang->regist_undian ?>
                                    </td>
                                    <td class="text-left">
                                        NIK : <?= $Anggota_lelang->nik ?><br>
                                        Nama : <?= $Anggota_lelang->nm_anggota ?><br>
                                        No Hp : <?= $Anggota_lelang->no_hp ?><br>
                                    </td>
                                    <td class="text-left">
                                        <?= $Anggota_lelang->alamat_lengkap ?><br>
                                        RT. <?= $Anggota_lelang->nm_rt ?> RW. <?= $Anggota_lelang->nm_rw ?><br>
                                        Dk. <?= $Anggota_lelang->nm_desa ?>, Kec.
                                        <?= $Anggota_lelang->nm_kecamatan ?><br>
                                        <?= $Anggota_lelang->kot_kab ?> - <?= $Anggota_lelang->prov ?>
                                    </td>
                                    <td class="text-center sorting_desc">
                                        Rp <?= number_format(($Anggota_lelang->total_lelang), 0, ',', '.') ?>,-
                                    </td>
                                    <td class="text-center">
                                        <a class="btn btn-danger btn-sm"
                                            href="<?= base_url('arisan/aktifitas/lelang/hapus_anggota_lelang/' . $this->encrypt->encode($Anggota_lelang->lelang_id)) ?>"
                                            style="color: white;">Hapus</a>
                                    </td>
                                </tr>
                                <?php endforeach; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $this->load->view('arisan/aktifitas/undian/modal_lelang'); ?>
<?php if ($unit == 1) : ?>
<!-- Laporan Arisan Motor 1 -->
<?php $this->load->view('arisan/aktifitas/undian/lap_lelang01'); ?>
<?php else : ?>
<!-- Laporan Arisan Motor 2 -->
<?php $this->load->view('arisan/aktifitas/undian/lap_lelang02'); ?>
<?php endif; ?>