<div class="modal fade" id="target_detail" tabindex="-1" role="dialog" aria-labelledby="target_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="target_detailTitle">
                    Target Kinerja
                </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_target">
                <?php echo form_open_multipart('kabag_marketing/data/kpi_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>Nama Marketing</label>
                    <input class="form-control" name="target_id" id="target_id" readonly hidden
                        placeholder="Alasan Penolakan Pengajuan Pinjaman" required>
                    <input class="form-control" name="nama_marketing" id="nama_marketing" readonly
                        placeholder="Alasan Penolakan Pengajuan Pinjaman" required>
                </div>
                <div class="form-group">
                    <label>Target Kinerja</label>
                    <input class="form-control" type="number" step="any"" name=" tgt_kinerja" id="tgt_kinerja"
                        placeholder="Alasan Penolakan Pengajuan Pinjaman" required>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-outline-primary" data-dismiss="modal">
                    Close
                </button>
                <button type="submit" id="updateDataTarget" name="updateDataTarget"
                    class="btn btn-success">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_target", function() {
    var target_id = $(this).data('target_id');
    var nama_marketing = $(this).data('nama_marketing');
    var tgt_kinerja = $(this).data('tgt_kinerja');
    $(".modal-body#detail_body_target #target_id").val(target_id);
    $(".modal-body#detail_body_target #nama_marketing").val(nama_marketing);
    $(".modal-body#detail_body_target #tgt_kinerja").val(tgt_kinerja);
})
</script>