<div class="modal fade" id="tambahWA" tabindex="-1" role="dialog" aria-labelledby="tambahWATitle" 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="tambahWATitle">
                    Cari Nota
                </h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <?php echo form_open_multipart('owner/database/nota/utama/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>Mencari Nota Menurut?</label>
                    <select class="form-control" id="format_nota" name="format_nota" onchange="showDiv(this)" required>
                        <option value="1">Nomor Nota</option>
                        <option value="2">Tanggal Transaksi</option>
                        <option value="3">Bulan Transaksi</option>
                    </select>
                </div>
                <div class="form-group" id="select_nomor_nota">
                    <label>Nomor Nota</label>
                    <input type="number" class="form-control" id="nomor_nota" name="nomor_nota"
                        placeholder="Masukkan Nomor Nota">
                </div>
                <div class="form-group" id="select_tgl_transaksi" style="display:none">
                    <label>Tanggal Transaksi</label>
                    <input type="date" class="form-control" id="tgl_transaksi" name="tgl_transaksi"
                        placeholder="Masukkan Tanggal Transaksi">
                </div>
                <div class="form-group" id="select_bulan_transaksi" style="display:none">
                    <div class="form-row mb-4">
                        <div class="col">
                            <label for="">Bulan</label>
                            <select class="form-control" id="bulan_transaksi" name="bulan_transaksi">
                                <option value="PILIH">Bulan Transaksi</option>
                                <option value="01">Januari</option>
                                <option value="02">Febuari</option>
                                <option value="03">Maret</option>
                                <option value="04">April</option>
                                <option value="05">Mei</option>
                                <option value="06">Juni</option>
                                <option value="07">Juli</option>
                                <option value="08">Agustus</option>
                                <option value="09">September</option>
                                <option value="10">Oktober</option>
                                <option value="11">November</option>
                                <option value="12">Desember</option>
                            </select>
                        </div>
                        <div class="col">
                            <label for="">Tahun</label>
                            <select class="form-control" id="tahun_transaksi" name="tahun_transaksi">
                                <?php foreach ($tampil_tahun as $Tampil_tahun) : ?>
                                    <option value="<?= $Tampil_tahun->tahun_nota_tersedia ?>">
                                        <?= $Tampil_tahun->tahun_nota_tersedia ?></option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-outline-primary" data-dismiss="modal">
                    Close
                </button>
                <button type="submit" id="cari_nota" name="cari_nota" class="btn btn-primary">Cari</button>
            </div>
            <?php echo form_close(); ?>
        </div>
    </div>
</div>
<script>
    function showDiv(select) {
        if (select.value == 1) {
            $("#select_nomor_nota").show();
            $("#select_tgl_transaksi").hide();
            $("#select_bulan_transaksi").hide();
        }
        if (select.value == 2) {
            $("#select_nomor_nota").hide();
            $("#select_tgl_transaksi").show();
            $("#select_bulan_transaksi").hide();
        }
        if (select.value == 3) {
            $("#select_nomor_nota").hide();
            $("#select_tgl_transaksi").hide();
            $("#select_bulan_transaksi").show();
        }
    }
</script>