<style>
    .table th, .table td {
        padding: 0.75rem !important;
    }
</style>
<script type="text/javascript">
    $(document).ready(function() {
        //total_approval();
        $(document).on('click','.btn_revisi',function(){
            $("#form_input #id_revisi").val($(this).attr("baris-ke"));
            $("#ket_revisi_modal").val("");
            $('#modal_revisi').modal('show');
        });

        $(document).on('click','.btn_submit_revisi',function(){
            row = $("#form_input #id_revisi").val();
            ket_revisi = $("#ket_revisi_modal").val();
            $("#kolom_"+row).text(ket_revisi);
            $("#ket_revisi_"+row).val(ket_revisi);
            $("#kolom_ditolak_"+row).text("");
            $("#ket_ditolak_"+row).val("");
            $('#modal_revisi').modal('hide');
            //document.getElementById('revisi_'+row).style.backgroundColor = 'yellow';
        });

        $(document).on('click','.btn_ditolak',function(){
            $("#form_ditolak #id_ditolak").val($(this).attr("baris-ke"));
            $("#ket_ditolak_modal").val("");
            $('#modal_ditolak').modal('show');
        });

        $(document).on('click','.btn_submit_ditolak',function(){
            row = $("#form_ditolak #id_ditolak").val();
            ket_ditolak = $("#ket_ditolak_modal").val();
            $("#kolom_"+row).text("");
            $("#kolom_ditolak_"+row).text(ket_ditolak);
            $("#ket_ditolak_"+row).val(ket_ditolak);
            $("#ket_revisi_"+row).val("");
            $('#modal_ditolak').modal('hide');
            //document.getElementById('tolak_'+row).style.backgroundColor = 'red';
        });

        $(document).on('click','.btn_approve',function(){
            var row = $(this).attr("baris-ke");
            $("#ket_revisi_"+row).val("");
            $("#ket_ditolak_"+row).val("");
            $("#kolom_"+row).text("");
            $("#kolom_ditolak_"+row).text("");
            // $("#akun_"+row).prop("disabled",false);
            // $("#akun_"+row).val('');
            //document.getElementById('setuju_'+row).style.backgroundColor = 'blue';
        });

           //nominal approval
        $(document).on('click','.btn_nominal',function(){
            var no = $(this).attr("baris-ke");
            var max = $("#max_plafon_"+no).val();
            var nominal = $("#nominal_setuju_"+no).val();
            $("#form_input_nominal #id_setuju").val(no);
            $("#nominal_setuju_modal").val(nominal);
            $("#max_plafon_modal").html("<p id='max_plafon_modal' style='color: red;'>*) Maksimal Nominal Plafon : <b>"+ max +"</b></p>");
            $('#modal_nominal').modal('show');
        });

        $(document).on('click','.btn_submit_nominal',function(){
            row = $("#form_input_nominal #id_setuju").val();
            nominal = $("#nominal_setuju_modal").val();
            asli = numberWithCommas(nominal);
            $("#setuju_"+row).html(asli+"<a class='fa fa-edit btn_nominal' id='nominal' baris-ke='"+ row +"' style='cursor: pointer'></a>");
            $("#nominal_setuju_"+row).val(nominal);
            total_approval();
            $('#modal_nominal').modal('hide');
        });

        function numberWithCommas(x) {
            return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
        }

    });

    function total_number(x) {
            return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
        }

    function total_approval() {
        var jumlah = 0;
        $.each($('.nominal_setuju'), function(){
            var myStr = $(this).val();
            var newStr = myStr.replace(/\./g, '');
            jumlah += parseInt(newStr);
        })
        //console.log(jumlah);
        document.getElementById("total_approval").innerHTML = total_number(jumlah);
    }

    $(document).ready(function(e) {

        $("#form-hod").on('submit', (function(e) {
            e.preventDefault();
            var loading = Ladda.create(document.getElementById("btn_submit"));

            loading.start();

            var checked=[];
            var unchecked=[];

            $("input:radio").each(function(index){

                var name = $(this).attr('name');

                if($("input:radio[name="+name+"]:checked ").length == 1 ){
                    checked.push(name);
                    console.log("CHECKED =>"+name);
                }else{
                    unchecked.push(name);
                    console.log("UNCHECKED =>"+name);
                }
            });

            console.log("TOTAL UNCHECK =>"+unchecked.length);

            if(unchecked.length === 0){
                $.ajax({
                    url: "<?= route('reimburse.save') ?>",
                    type: "POST",
                    data: new FormData(this),
                    contentType: false,
                    cache: false,
                    dataType: 'json',
                    processData: false,
                    success: function(result) {
                        if(result.success == true) {
                            // $('#btn_submit').prop("disabled", true);
                            $('#btn_submit').hide();
                            $('form input[type="radio"]').prop("disabled", true);
                        }

                        $('#modal_message #message').html(result.message);
                        $("#modal_message").modal('show');
                        loading.stop();
                    },
                    error: function() {
                        loading.stop();
                        $('#modal_message #message').html('<font color="#eb3a28"><i class="fa fa-close(alias)">&nbsp;</i><strong>Gagal : Terjadi Kesalahan</strong></font>');
                        $("#modal_message").modal('show');
                    }
                });
            }else{
                loading.stop();
                $('#modal_message #message').html('<font color="#eb3a28"><i class="fa fa-close(alias)">&nbsp;</i><strong>Pilihan approval harus terisi semua</strong></font>');
                $("#modal_message").modal('show');
            }
        }));
    });
</script>
<div class="content-header">
    <div class="row align-items-center">
        <div class="content-header-left col-md-6 col-12 mb-md-0 mb-1">
            <h3 class="content-header-title"><?= $judul ?></h3>
            <div class="row breadcrumbs-top">
                <div class="breadcrumb-wrapper col-12">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">Reimbursement</a>
                        </li>
                        <li class="breadcrumb-item active"><?= $judul ?>
                        </li>
                    </ol>
                </div>
            </div>
        </div>
        <div class="content-header-right col-md-6 col-12">
            <!-- <div class="float-md-right">
                <a href="<?= site_url(); ?>/informasi/gaji/import-main">
                <button type="button" class="btn_tambah btn btn-biru">
                    <i class="fa fa-upload"></i> Import Data
                </button>
                </a>
            </div> -->
        </div>
    </div>
</div>

<div class="card card-rounded">
    <div class="card-content">
        <div class="card-body">
            <div class="row">
                <div class="col-md-6">
                    <div class="row">
                        <div class="col-md-4" style="color: black; font-weight: bold;">Nama Karyawan</div>
                        <div class="col-md-8" style="color: black; font-weight: bold;">: <?= ((isset($data_pengajuan->nama_karyawan))?$data_pengajuan->nik." - ".$data_pengajuan->nama_karyawan:"") ?></div>
                    </div>
                    <div class="row">
                        <div class="col-md-4" style="color: black; font-weight: bold;">Jabatan</div>
                        <div class="col-md-8" style="color: black; font-weight: bold;">: <?= ((isset($data_pengajuan->nama_jabatan))?$data_pengajuan->kode_jabatan." - ".$data_pengajuan->nama_jabatan:"") ?></div>
                    </div>
                    <div class="row">
                        <div class="col-md-4" style="color: black; font-weight: bold;">Cabang</div>
                        <div class="col-md-8" style="color: black; font-weight: bold;">: <?= ((isset($data_pengajuan->nama_cabang))?$data_pengajuan->kode_cabang." - ".$data_pengajuan->nama_cabang:"") ?></div>
                    </div>
                    <div class="row">
                        <div class="col-md-4" style="color: black; font-weight: bold;">Departemen</div>
                        <div class="col-md-8" style="color: black; font-weight: bold;">: <?= ((isset($data_pengajuan->departemen_karyawan))?$data_pengajuan->kode_departemen." - ".$data_pengajuan->departemen_karyawan:"") ?></div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="row">
                        <div class="col-md-4" style="color: black; font-weight: bold;">Nomor Pengajaun</div>
                        <div class="col-md-8" style="color: black; font-weight: bold;">: <?= ((isset($data_pengajuan->no_pengajuan))?$data_pengajuan->no_pengajuan:"") ?></div>
                    </div>
                    <div class="row">
                        <div class="col-md-4" style="color: black; font-weight: bold;">Tanggal Pengajuan</div>
                        <div class="col-md-8" style="color: black; font-weight: bold;">: <?= ((isset($data_pengajuan->tgl_pengajuan))?date_format(date_create($data_pengajuan->tgl_pengajuan),"d-m-Y"):"") ?></div>
                    </div>
                </div>
            </div><br>

            <div class="row">
                <div class="col-md-12" style="overflow-x: auto;">
                    <form id="form-hod">
                    <input type="hidden" id="id_pengajuan_reimburse" name="id_pengajuan_reimburse" value="<?= ((isset($data_pengajuan->id))?$data_pengajuan->id:"") ?>">
                    <table class="table table-bordered table-hover" style="width: 100%;">
                        <thead style="background-color: #1c77d4; color:#fff; font-weight:600;">
                            <tr class="bg-tr">
                                <th class="text-center" style="width: 5px;">NO</th>
                                <th class="text-center">PLAFON</th>
                                <th class="text-center">MAX PLAFON</th>
                                <th class="text-center">NOMINAL<br>PENGAJUAN</th>
                                <th class="text-center">KETERANGAN</th>
                                <th class="text-center">TANGGAL BUKTI</th>
                                <?php
                                    if ($this->level_user == '6') {
                                ?>
                                        <th style="text-align: center;">NOMINAL<br>APPROVAL</th>
                                <?php
                                    }
                                ?>
                                <th class="text-center">BUKTI NOTA</th>
                                <th class="text-center">AKUN REIMBURSEMENT</th>
                                <th class="text-center">KETERANGAN<br>REVISI</th>
                                <th class="text-center">KETERANGAN<br>DITOLAK</th>
                                <th class="text-center">DITOLAK</th>
                                <th class="text-center">REVISI</th>
                                <th class="text-center">APPROVE</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                                $total_pengajuan = 0;
                                $total_approval = 0;
                                $no=0;
                                foreach($list_pengajuan as $rows){
                                    $no++;
                                    $level = $this->level_user;
                                    if ($level == '7') {
                                        $flag = $rows->apv_spv;
                                        $ket_revisi = $rows->ket_rev_spv;
                                        $ket_tolak  = $rows->ket_tolak_spv;
                                    }elseif ($level == '2') {
                                        $flag = $rows->apv_kedep;
                                        $ket_revisi = $rows->ket_rev_kedep;
                                        $ket_tolak  = $rows->ket_tolak_kedep;
                                    }elseif ($level == '5') {
                                        $flag = $rows->apv_kacap;
                                        $ket_revisi = $rows->ket_rev_kacap;
                                        $ket_tolak  = $rows->ket_tolak_kacap;
                                    }elseif ($level == '6') {
                                        $flag = $rows->apv_finance;
                                        $ket_revisi = $rows->ket_rev_finance;
                                        $ket_tolak  = $rows->ket_tolak_finance;
                                    }elseif ($level == '4') {
                                        $flag = $rows->apv_direksi;
                                        $ket_revisi = $rows->ket_rev_direksi;
                                        $ket_tolak  = $rows->ket_tolak_direksi;
                                    }
                                    $total_pengajuan    = $total_pengajuan + $rows->nominal;
                                    $total_approval     = $total_approval + $rows->nominal_disetujui;
                            ?>
                                        <tr id="rows_colom">
                                            <input type="hidden" id="id_reimburse_<?= $no ?>" name="id_reimburse_<?= $no ?>" value="<?= $rows->id ?>">
                                            <?php
                                                if ($flag == '3') {
                                            ?>
                                                    <input type="hidden" id="ket_ditolak_<?= $no ?>" name="ket_ditolak_<?= $no ?>" value="<?= $ket_tolak ?>">
                                            <?php
                                                }else{
                                            ?>
                                                    <input type="hidden" id="ket_ditolak_<?= $no ?>" name="ket_ditolak_<?= $no ?>" value="">
                                            <?php
                                                }
                                            ?>

                                            <?php
                                                if ($flag == '4') {
                                            ?>
                                            <input type="hidden" id="ket_revisi_<?= $no ?>" name="ket_revisi_<?= $no ?>" value="<?= $ket_revisi ?>">
                                            <?php
                                                }else{
                                            ?>
                                            <input type="hidden" id="ket_revisi_<?= $no ?>" name="ket_revisi_<?= $no ?>" value="">
                                            <?php
                                                }
                                            ?>
                                            <?php
                                                if ($rows->nominal_disetujui != 0) {
                                                    $nominal_asli = $rows->nominal_disetujui;
                                                }else{
                                                    $nominal_asli = $rows->nominal;
                                                }
                                            ?>
                                            <input type="hidden" class="nominal_setuju" id="nominal_setuju_<?= $no ?>" name="nominal_setuju_<?= $no ?>" value="<?= number_format($nominal_asli,0,',','.') ?>">
                                            <input type="hidden" id="max_plafon_<?= $no ?>" value="<?= number_format($rows->max_nominal_plafon,0,',','.') ?>">
                                            <td class="text-center"><?= $no ?></td>
                                            <td><?= $rows->jenis_plafon ?></td>
                                            <td class="text-right"><?= number_format($rows->max_nominal_plafon,0,",",".") ?></td>
                                            <td class="text-right"><?= number_format($rows->nominal,0,",",".") ?></td>
                                            <td><?= $rows->keterangan ?></td>
                                            <td class="text-center"><?= date_format(date_create($rows->tgl_bukti),"d-m-Y") ?></td>
                                            <!-- <td class="text-center"><a href="<?= $rows->file ?>" target="_blank">Lihat Nota</a></td> -->
                                            <?php
                                                if ($this->level_user == '6') {
                                            ?>
                                                    <td class="text-right" id="setuju_<?= $no ?>"> 
                                                        <?php
                                                            if ($rows->nominal_disetujui != 0) {
                                                                $nominal = $rows->nominal_disetujui;
                                                            }else{
                                                                $nominal = $rows->nominal;
                                                            }
                                                            echo number_format($nominal,0,",",".");
                                                            if($flag == "1"){
                                                                echo ' <a href="#" class="fa fa-edit btn_nominal" id="nominal" baris-ke="'.$no.'"></a>';
                                                            }
                                                        ?>
                                                    </td>
                                            <?php
                                                }
                                            ?>
                                            <td class="text-center">
                                                <a href="#" id="<?= md5($rows->id) ?>">
                                                    <?php
                                                        $file = $this->config->item('base_image').'image?_t=image&_d='.$field->file;
                                                    ?>
                                                    <input type="hidden" name="gambar" id="<?= $rows->id ?>" value="<?= $field->file ?>" image="<?= $file ?>">
                                                    Lihat Gambar
                                                </a>
                                            </td>
                                            <td id="akun_<?= $no ?>">
                                                <?php
                                                    if ($flag == '3' || $flag == '5'){ ?>
                                                        <!-- <select class="form-control" name="id_akun_<?=$no ?>" disabled>
                                                            <?php foreach ($list_akun as $akun) { ?>
                                                                <option value="<?= $rows->kode_akun ?>" <?= ((isset($rows) AND $rows->kode_akun == $akun->kode_akun."-".$akun->nama_akun)?'selected':'') ?>><?= $rows->kode_akun ?></option>
                                                                <?php } ?>
                                                        </select> -->
                                                        <?= $rows->kode_akun ?>

                                                <?php }else{ ?>
                                                        <select class="form-control" name="id_akun_<?=$no ?>" >
                                                            <option value="">Pilih</option>
                                                            <?php foreach ($list_akun as $akun) { ?>
                                                                <option value="<?= $akun->kode_akun."-".$akun->nama_akun ?>"<?php if ($rows->kode_akun==$akun->kode_akun."-".$akun->nama_akun) {
                                                                    echo "selected";} ?>>
                                                                    <?= $akun->kode_akun."-".$akun->nama_akun ?>
                                                                </option>
                                                                <?php } ?>
                                                        </select>

                                                <?php }
                                                ?>
                                            </td>
                                            <script type="text/javascript">
                                                $("#<?= md5($rows->id) ?>").on("click", function() {
                                                    $('#imagepreview').attr('src', $('#<?= $rows->id ?>').attr("image"));
                                                    $('#imagemodal').modal('show'); // imagemodal is the id attribute assigned to the bootstrap modal, then i use the show function
                                                });
                                            </script>
                                            <td id="kolom_<?= $no ?>"><?= $ket_revisi ?></td>
                                            <td id="kolom_ditolak_<?= $no ?>"><?= $ket_tolak ?></td>
                                            <td class="text-center" style="width:100px" id="tolak_<?= $no ?>">
                                                <div class="form-check">
                                                    <?php
                                                        if ($flag == '3' || $flag == '5'){
                                                    ?>
                                                            <input type="radio" id="exampleRadios1_<?= $no ?>" name="status_reimburse_<?= $no ?>" class="status_reimburse form-check-input btn_ditolak" baris-ke="<?= $no ?>" value="3" <?php echo ($flag=='3')?'checked':'' ?> disabled="true">
                                                            <label class="form-check-label" for="exampleRadios1_<?= $no ?>" >&nbsp;</label>
                                                    <?php
                                                        }else{
                                                    ?>
                                                            <input type="radio" id="exampleRadios1_<?= $no ?>" name="status_reimburse_<?= $no ?>" class="status_reimburse form-check-input btn_ditolak" baris-ke="<?= $no ?>" value="3" <?php echo ($flag=='3')?'checked':'' ?>>
                                                            <label class="form-check-label" for="exampleRadios1_<?= $no ?>" >&nbsp;</label>
                                                    <?php
                                                        }
                                                    ?>
                                                </div>
                                            </td>
                                            <td class="text-center" style="width:100px" id="revisi_<?= $no ?>">
                                                <div class="form-check">
                                                    <?php
                                                        if($flag == '3' || $flag == '5'){
                                                    ?>
                                                            <input type="radio" id="exampleRadios2_<?= $no ?>" name="status_reimburse_<?= $no ?>" class="status_reimburse form-check-input btn_revisi" baris-ke="<?= $no ?>" value="4" <?php echo ($flag=='4')?'checked':'' ?> disabled="true">
                                                            <label class="form-check-label" for="exampleRadios2_<?= $no ?>" >&nbsp;</label>
                                                    <?php
                                                        }else{
                                                    ?>
                                                            <input type="radio" id="exampleRadios2_<?= $no ?>" name="status_reimburse_<?= $no ?>" class="status_reimburse form-check-input btn_revisi" baris-ke="<?= $no ?>" value="4" <?php echo ($flag=='4')?'checked':'' ?>>
                                                            <label class="form-check-label" for="exampleRadios2_<?= $no ?>" >&nbsp;</label>
                                                    <?php
                                                        }
                                                    ?>
                                                </div>
                                            </td>
                                            <td class="text-center" style="width:100px" id="setuju_<?= $no ?>">
                                                <div class="form-check">
                                                    <?php
                                                        if($flag == '3' || $flag == '5'){
                                                    ?>
                                                            <input type="radio" id="exampleRadios3_<?= $no ?>" name="status_reimburse_<?= $no ?>" class="status_reimburse form-check-input btn_approve" value="5" baris-ke="<?= $no ?>" <?php echo ($flag=='5')?'checked':'' ?> disabled="true">
                                                            <label class="form-check-label" for="exampleRadios3_<?= $no ?>">&nbsp;</label>
                                                    <?php
                                                        }else{
                                                    ?>
                                                            <input type="radio" id="exampleRadios3_<?= $no ?>" name="status_reimburse_<?= $no ?>" class="status_reimburse form-check-input btn_approve" value="5" baris-ke="<?= $no ?>" <?php echo ($flag=='5')?'checked':'' ?>>
                                                            <label class="form-check-label" for="exampleRadios3_<?= $no ?>">&nbsp;</label>
                                                    <?php
                                                        }
                                                    ?>
                                                </div>
                                            </td>
                                        </tr>
                            <?php
                                }
                            ?>
                        </tbody>
                        <tfoot>
                            <tr class="noBorder" style="background-color: #e9ecef; color: black;">
                                <th colspan="3" class="text-right">TOTAL</th>
                                <th class="text-right"><?= number_format($total_pengajuan,0,",",".") ?></th>
                                <th>&nbsp;</th>
                                <?php
                                    if($this->level_user == '6') {
                                ?>
                                <th class="text-center">TOTAL APPROVAL</th>
                                <th class="text-right" id="total_approval"><?= number_format($total_pengajuan,0,",",".") ?></th>
                                <?php
                                    }
                                ?>
                                <th colspan="9" class="text-right">
                                    <input type="hidden" name="jumlah_data" id="jumlah_data" value="<?= $no ?>">
                                    <a href="<?= site_url('reimburse')  ?>" class="btn btn-secondary"><i class="fa fa-arrow-left"></i> KEMBALI</a>
                                    <?php

                                        if($level == '7') {
                                            $status_pengajuan = $data_pengajuan->apv_spv;
                                        }elseif ($level == '2') {
                                            $status_pengajuan = $data_pengajuan->apv_kedep;
                                        }elseif ($level == '5') {
                                            $status_pengajuan = $data_pengajuan->apv_kacap;
                                        }elseif ($level == '6') {
                                            $status_pengajuan = $data_pengajuan->apv_finance;
                                        }elseif ($level == '4') {
                                            $status_pengajuan = $data_pengajuan->apv_direksi;
                                        }

                                        if ($status_pengajuan == '1' || $status_pengajuan == '4'){
                                    ?>
                                            <button type="submit" id="btn_submit" class="btn btn-success ladda-button" data-style="expand-left"><i class="fa fa-check-circle-o"></i> SUBMIT</button>
                                    <?php
                                        }
                                    ?>
                                </th>
                            </tr>
                            <style type="text/css">
                                tr.noBorder td {
                                    border: 0;
                                }
                            </style>
                        </tfoot>
                    </table>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- START TAMPIL MODAL -->
<div id="modal_revisi" class="modal fade in">
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <div class="card-header">
                <h3 class="modal-title">KETERANGAN REVISI</h3>
            </div>
            <div id="form_input" class="card-body">
                <input type="hidden" id="id_revisi">
                <div class="form-group">
                    <textarea id="ket_revisi_modal" class="form-control" rows="3"></textarea>
                </div>
            </div>
            <div class="card-footer">
                <div class="row">
                    <div class="col-md-12 text-right">
                        <button class="btn btn-secondary cancel" data-dismiss="modal"><i class="fa fa-arrow-left"></i> CANCEL</button>
                        <button class="btn_submit_revisi btn btn-success ladda-button" data-style="expand-left"><i class="fa fa-check-circle-o"></i> SUBMIT</button>
                    </div>
                </div><!-- ./row -->
            </div>
        </div>
    </div>
</div>
<!-- END TAMPIL MODAL -->

<!-- START TAMPIL MODAL -->
<div id="modal_ditolak" class="modal fade in">
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <div class="card-header">
                <h3 class="modal-title">KETERANGAN DITOLAK</h3>
            </div>
            <div id="form_ditolak" class="card-body">
                <input type="hidden" id="id_ditolak">
                <div class="form-group">
                    <textarea id="ket_ditolak_modal" class="form-control" rows="3"></textarea>
                </div>
            </div>
            <div class="card-footer">
                <div class="row">
                    <div class="col-md-12 text-right">
                        <button class="btn btn-secondary cancel" data-dismiss="modal"><i class="fa fa-arrow-left"></i> CANCEL</button>
                        <button class="btn_submit_ditolak btn btn-success ladda-button" data-style="expand-left"><i class="fa fa-check-circle-o"></i> SUBMIT</button>
                    </div>
                </div><!-- ./row -->
            </div>
        </div>
    </div>
</div>
<!-- END TAMPIL MODAL -->

<!-- START TAMPIL MODAL -->
<div id="modal_nominal" class="modal fade in">
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <div class="card-header">
                <h3 class="modal-title">NOMINAL DISTUJUI</h3>
            </div>
            <div id="form_input_nominal" class="card-body">
                <input type="hidden" id="id_setuju">
                <div class="form-group">
                    <input type="text" id="nominal_setuju_modal" class="form-control testInput">
                    <p id="max_plafon_modal"></p>
                    <script type="text/javascript">
                        $(".testInput").autoNumeric('init', {
                            aSep: '.',
                            aDec: ',',
                            aForm: true,
                            vMax: '999999999',
                            vMin: '0'
                        });
                    </script>
                </div>
            </div>
            <div class="card-footer">
                <div class="row">
                    <div class="col-md-12 text-right">
                        <button class="btn btn-secondary cancel" data-dismiss="modal">BATAL</button>
                        <button class="btn_submit_nominal btn btn-primary ladda-button" data-style="expand-left">SUBMIT</button>
                    </div>
                </div><!-- ./row -->
            </div>
        </div>
    </div>
</div>
<!-- END TAMPIL MODAL -->

<!-- START TAMPIL MODAL MESSAGE-->
<div id="modal_message" class="modal fade in">
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <div id="message" class="card-body"></div>
            <div class="card-footer">
                <div class="row">
                    <div class="col-md-12 text-right">
                    <button class="btn btn-secondary ladda-button" data-style="expand-left" data-dismiss="modal">TUTUP</button>
                    </div>
                </div><!-- ./row -->
            </div>
        </div>
    </div>
</div>
<!-- END TAMPIL MODAL MESSAGE-->

<!-- Creates the bootstrap modal where the image will appear -->
<div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
        <div class="modal-header">
            <h4 class="modal-title" id="myModalLabel">BUKTI NOTA</h4>
            <button type="button" class="close btn btn-secondary" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">TUTUP</span></button>
        </div>
        <div class="modal-body text-center">
            <img src="" id="imagepreview" style="width: 100%;" >
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn btn-secondary" data-dismiss="modal">TUTUP</button>
        </div>
        </div>
    </div>
</div>



