<div class="modal fade" id="konten_detail" tabindex="-1" role="dialog" aria-labelledby="konten_detailTitle"
    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="konten_detailTitle">
                    Detail 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" id="detail_body_nota">
                <?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>Tanggal Pembayaran</label>
                    <input type="date" class="form-control" id="tgl_pembayaran" name="tgl_pembayaran"
                        placeholder="Masukkan Endpoint URL" required>
                    <input type="number" class="form-control" hidden id="nota_id" name="nota_id"
                        placeholder="Masukkan Nama Desa" required>
                </div>
                <div class="form-group">
                    <label>Qty Pembayaran</label>
                    <input type="number" class="form-control" id="qty_pembayaran" name="qty_pembayaran"
                        placeholder="Masukkan Qty Pembayaran" required>
                </div>
                <div class="form-group">
                    <label>Total Bayar</label>
                    <input type="number" class="form-control" id="ttl_bayar" name="ttl_bayar"
                        placeholder="Masukkan Total Pembayaran" required>
                </div>
                <div class="form-group">
                    <label>Status KAS</label>
                    <select class="form-control" id="status_kas" name="status_kas" required>
                        <option value="MASUK">MASUK</option>
                        <option value="KELUAR">KELUAR</option>
                        <option value="OMSET">OMSET</option>
                        <option value="OPERASIONAL">OPERASIONAL</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>Status Nota</label>
                    <select class="form-control" id="status_nota" name="status_nota" required>
                        <option value="PROSES">PROSES</option>
                        <option value="TERIMA">TERIMA</option>
                        <option value="TOLAK">TOLAK</option>
                        <option value="PROSES_TUNGGAKAN">PROSES TUNGGAKAN</option>
                        <option value="TERIMA_TUNGGAKAN">TERIMA TUNGGAKAN</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>Metode Bayar</label>
                    <select class="form-control" id="metode_bayar" name="metode_bayar" required>
                        <option value="TRANSFER">TRANSFER</option>
                        <option value="TUNAI">TUNAI</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>Petugas Pembayaran</label>
                    <select class="form-control" id="petugas" name="petugas" required>
                        <?php foreach ($data_petugas as $Data_petugas) : ?>
                        <option value="<?= $Data_petugas->id ?>"><?= $Data_petugas->nm_panggilan ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
                <div class="form-group">
                    <label>Kasir Pembayaran</label>
                    <select class="form-control" id="kasir" name="kasir" required>
                        <?php foreach ($data_petugas as $Data_petugas) : ?>
                        <option value="<?= $Data_petugas->id ?>"><?= $Data_petugas->nm_panggilan ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-outline-primary" data-dismiss="modal">
                    Close
                </button>
                <button type="submit" id="deleteDatabaseTerbaru" name="deleteDatabaseTerbaru"
                    class="btn btn-danger">Hapus</button>
                <button type="submit" id="updateDatabaseTerbaru" name="updateDatabaseTerbaru"
                    class="btn btn-warning">Update</button>
            </div>
            <?php echo form_close(); ?>
        </div>
    </div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).on("click", "#detail_konten", function() {
    var tgl_pembayaran = $(this).data('tgl_pembayaran');
    var nota_id = $(this).data('nota_id');
    var qty_pembayaran = $(this).data('qty_pembayaran');
    var ttl_bayar = $(this).data('ttl_bayar');
    var status_kas = $(this).data('status_kas');
    var status_nota = $(this).data('status_nota');
    var metode_bayar = $(this).data('metode_bayar');
    var petugas = $(this).data('petugas');
    var kasir = $(this).data('kasir');
    $(".modal-body#detail_body_nota #tgl_pembayaran").val(tgl_pembayaran);
    $(".modal-body#detail_body_nota #nota_id").val(nota_id);
    $(".modal-body#detail_body_nota #qty_pembayaran").val(qty_pembayaran);
    $(".modal-body#detail_body_nota #ttl_bayar").val(ttl_bayar);
    $(".modal-body#detail_body_nota #status_kas").val(status_kas);
    $(".modal-body#detail_body_nota #status_nota").val(status_nota);
    $(".modal-body#detail_body_nota #metode_bayar").val(metode_bayar);
    $(".modal-body#detail_body_nota #petugas").val(petugas);
    $(".modal-body#detail_body_nota #kasir").val(kasir);
})
</script>