<div class="modal fade" id="tambahTransaksi" tabindex="-1" role="dialog" aria-labelledby="tambahTransaksiTitle" aria-hidden="true">
    <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="tambahTransaksiTitle">
                    Tambah Transaksi Kas Arisan
                </h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body" id="detail_body">
                <?php echo form_open_multipart('keuangan/kas/produk_arisan/crud'); ?>
                <input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>" style="display: none">
                <div class="form-group">
                    <label>Keterangan Transaksi</label>
                    <textarea class="form-control" name="ket_transaksi" id="ket_transaksi" placeholder="Keterangan Transaksi Kas Produk Arisan" required></textarea>
                </div>
                <div class="form-group">
                    <label>Total Transaksi</label>
                    <input type="number" class="form-control" id="total_transaksi" name="total_transaksi" placeholder="Besaran Biaya Transaksi" required>
                </div>
                <div class="form-group">
                    <label>Jenis Transaksi</label>
                    <select class="form-control" id="jenis_transaksi" name="jenis_transaksi" required>
                        <option value="PILIH">Pilih Jenis Transaksi</option>
                        <option value="MASUK">Transaksi Masuk</option>
                        <option value="KELUAR">Transaksi Keluar</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>Pilih Produk Arisan</label>
                    <select class="form-control" id="produk_arisan" onchange="showDiv(this)" name="produk_arisan" required>
                        <option value="0">Pilih Produk Arisan</option>
                        <?php foreach ($produk_arisan as $Produk_arisan) : ?>
                            <option value="<?= $Produk_arisan->id ?>"><?= $Produk_arisan->nm_produk ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
                <div class="form-group" id="select_arisan_heboh" style="display:none">
                    <label>Pilih Produk Arisan Heboh</label>
                    <select class="form-control" id="arisan_heboh" name="arisan_heboh">
                        <?php foreach ($arisan_heboh as $Arisan_heboh) : ?>
                            <option value="<?= $Arisan_heboh->id ?>">Arisan Heboh Kelompok <?= $Arisan_heboh->nm_kelompok ?>
                            </option>
                        <?php endforeach; ?>
                    </select>
                </div>
                <div class="form-group" id="select_arisan_motor" style="display:none">
                    <label>Pilih Produk Arisan Motor</label>
                    <select class="form-control" id="arisan_motor" name="arisan_motor">
                        <?php foreach ($arisan_motor as $Arisan_motor) : ?>
                            <option value="<?= $Arisan_motor->id ?>">Arisan Motor <?= $Arisan_motor->ket_arisan ?> Ke-
                                <?= $Arisan_motor->nm_kelompok ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
                <div class="form-group">
                    <label>Bukti Transaksi</label>
                    <input type="file" class="form-control" id="bukti_transaksi" name="bukti_transaksi" required>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-outline-primary" data-dismiss="modal">
                    Close
                </button>
                <button type="submit" id="simpanTransaksiBaru" name="simpanTransaksiBaru" class="btn btn-primary">Simpan</button>
            </div>
            <?php echo form_close(); ?>
        </div>
    </div>
</div>
<script>
    function showDiv(select) {
        if (select.value == 0) {
            $("#select_arisan_heboh").hide();
            $("#select_arisan_motor").hide();
        }
        if (select.value == 21) {
            $("#select_arisan_motor").hide();
            $("#select_arisan_heboh").show();
        }
        if (select.value == 22) {
            $("#select_arisan_heboh").hide();
            $("#select_arisan_motor").show();
        }
    }
</script>