<main id="main" class="main">
    <div class="pagetitle">
        <h1>Selamat Datang <?= $this->session->strNama; ?></h1>
        <nav>
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                <li class="breadcrumb-item active">Final Check</li>
            </ol>
        </nav>
    </div>

    <section class="section dashboard">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-body">
                    <br>
                    <button onclick="tampildata()" type="button" id="btnview" class="btn btn-primary" type="button"><i class="bi bi-arrow-clockwise"></i>&nbsp;Reload</button>

                    <button type="button" style="display:none;float:left;margin: 2px;" id="btnloading" class="btn btn-primary" type="button" disabled="">
                        <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
                        Loading...
                    </button>
                </div>
            </div>
        </div>
        <div class="row">
            <div id="tb_fc"></div>
        </div>
    </section>
</main>


<div class="modal fade" id="f_lot" tabindex="-1" style="display: none;" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Detail LOT</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <input type="hidden" id="doc_id">
                <input type="hidden" id="blc">
                <div class="row mb-1">
                    <label class="col-sm-2 col-form-label">No.ITO</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control form-control-sm" id="docno">
                    </div>
                    <label class="col-sm-2 col-form-label">Qty : </label>
                    <div class="col-sm-3">
                        <input type="number" class="form-control form-control-sm" id="qty" placeholder="0">
                    </div>
                    <label class="col-sm-2 col-form-label">Status : </label>
                    <div class="col-sm-5">
                        <select class="form-control form-control-sm" id="sts_kirim">
                            <option value="1">Kirim</option>
                            <option value="2">Void</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
                <button type="button" class="btn btn-primary" onclick="kirim_fg()">Simpan</button>
            </div>
        </div>
    </div>
</div>



<script>
    function tampildata() {
        document.getElementById("btnloading").style.display = "block";
        document.getElementById("btnview").style.display = "none";
        $.get("<?= base_url('produksi/tb_final_check'); ?>", function(data, status) {
            $("#tb_fc").html(data);
            document.getElementById("btnloading").style.display = "none";
            document.getElementById("btnview").style.display = "block";
        });
    }

    function pesan(txt, tipe) {
        const Toast = Swal.mixin({
            toast: true,
            position: "top-end",
            showConfirmButton: false,
            timer: 2000,
            timerProgressBar: true,
            didOpen: (toast) => {
                toast.onmouseenter = Swal.stopTimer;
                toast.onmouseleave = Swal.resumeTimer;
            }
        });
        Toast.fire({
            icon: tipe,
            title: txt
        });
    }
</script>

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
    $(document).ready(function() {
        tampildata();
    });
</script>