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/d8e15813cf15eca4407f0f11e5bf9dfe.php
<?php $__env->startSection('modal-supplier'); ?>
    <div class="modal fade" id="modal_supplier">
        <div class="modal-dialog modal-xl">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title">Supplier</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <table id="tbl-supplier" class="table table-sm table-bordered">
                        <thead>
                            <tr>
                                <th class="text-center" hidden>ID</th>
                                <th class="text-center">Data</th>
                            </tr>
                        </thead>
                        <tbody></tbody>
                    </table>
                </div>
                <div class="modal-footer d-flex justify-content-start justify-content-md-end d-print-none">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-script-modal-supplier'); ?>
    <script>
        new DataTable('#tbl-supplier', {
            columns: [
                {
                    data: 'id',
                    name: 'id',
                    targets: 0,
                    className: 'dt-body-left',
                    visible: false,
                },
                {
                    data: 'data',
                    name: 'data',
                    targets: 1,
                    className: 'dt-body-left'
                }
            ]
        });

        function openSupplier() {
            var table = new DataTable('#tbl-supplier');
            table.clear().draw();
            $('#modal_supplier').modal('toggle');

            var id = document.getElementById('tenant_id').value;
            id = id ? id : 0;

            $.ajax({
                dataType: 'json',
                type: "GET",
                url: '<?php echo e(env('APP_URL')); ?>' + "/api/global/select/tenant-open-supplier/" + id,

                success: function(res) {
                    if (res.length > 0) {
                        const arr = res.map(col => {
                            return {
                                id: col.id,
                                data: showDetailSupplier(col.id, col.image, col.name, col.phone, col.email, col.address, col.description, col.is_active, col.tenant, col.created_at),
                            }
                        })
                        
                        table.rows.add(arr).draw();
                    }
                },
                error: function(xhr, status, error) {
                    alert(error);
                    return;
                }
            });
        }

        function showDetailSupplier(id, image, name, phone, email, address, description, is_active, tenant, created_at) {
            var html ="";
            html +='<div class="container my-2">';
                html +='<div class="row">';
                    html +='<div class="col-3 mb-2">';
                        if (image) {
                            var url = '<?php echo e(config('app.url')); ?>' + '/storage/' + '<?php echo e(config('app.dir_file_supplier')); ?>' + '/' + image;

                            if (fileExists(url)) {
                                html +='<img src=' + url + ' class="rounded">';
                            } else {
                                html +='<img src=<?php echo e(asset(config("app.img_not_found"))); ?> class="rounded">';
                            }
                        } else {
                            html +='<img src=<?php echo e(asset(config("app.img_not_found"))); ?> class="rounded">';
                        }
                    html +='</div>';

                    html +='<div class="col-9 mb-2">';
                        html +='<div class="row">';
                            html +='<div class="col-3 border-bottom">';
                                html +='<span class="text-capitalize">name</span>';
                            html +='</div>';
                            html +='<div class="col-9 border-bottom">';
                                html +='<span class="text-capitalize">: ' + name + '</span>';
                            html +='</div>';
                        html +='</div>';

                        html +='<div class="row">';
                            html +='<div class="col-3 border-bottom">';
                                html +='<span class="text-capitalize">phone</span>';
                            html +='</div>';
                            html +='<div class="col-9 border-bottom">';
                                html +='<span class="text-capitalize">: ' + phone + '</span>';
                            html +='</div>';
                        html +='</div>';

                        html +='<div class="row">';
                            html +='<div class="col-3 border-bottom">';
                                html +='<span class="text-capitalize">email</span>';
                            html +='</div>';
                            html +='<div class="col-9 border-bottom">';
                                html +='<span class="text-capitalize">: ' + email + '</span>'
                            html +='</div>';
                        html +='</div>';

                        html +='<div class="row">';
                            html +='<div class="col-3 border-bottom">';
                                html +='<span class="text-capitalize">address</span>';
                            html +='</div>';
                            html +='<div class="col-9 border-bottom">';
                                html +='<span class="text-capitalize">: ' + address + '</span>';
                            html +='</div>';
                        html +='</div>';

                        html +='<div class="row">';
                            html +='<div class="col-3 border-bottom">';
                                html +='<span class="text-capitalize">descript.</span>';
                            html +='</div>';
                            html +='<div class="col-9 border-bottom">';
                                html +='<span class="text-capitalize">: ' + description + '</span>';
                            html +='</div>';
                        html +='</div>';

                        html +='<div class="row">';
                            html +='<div class="col-3 border-bottom">';
                                html +='<span class="text-capitalize">status</span>';
                            html +='</div>';
                            html +='<div class="col-9 border-bottom">';
                                html +='<span class="text-capitalize ' + is_active == 1 ? "text-primary" : "text-danger" + '">: ' + is_active == 1 ? "active" : "non active" + '</span>';
                            html +='</div>';
                        html +='</div>';
                    html +='</div>';
                html +='</div>';

                html +='<div class="row rounded" style="background-color: #F5F5F5;">';
                    html +='<div class="col-md-6 mb-2">';
                        html +='<div class="d-flex justify-content-md-start justify-content-center p-1">';
                            html +='<small class="text-muted text-capitalize mt-2">tenant: ' + tenant ? tenant.name : `` + ', last updated: ' + created_at + '</small>';
                        html +='</div>';
                    html +='</div>';
                    html +='<div class="col-md-6 mb-2">';
                        html +='<div class="d-flex justify-content-md-end justify-content-center p-1">';
                            html +='<button type="button" class="text-capitalize btn btn-dark btn-sm mt-2" onclick="selectDataSupplier(`' + id + '`, `' + image + '`, `' + name + '`, `' + phone + '`, `' + email + '`, `' + address + '`, `' + description + '`, `' + is_active + '`, `' + tenant + '`, `' + created_at + '`)"><i class="fa fa-arrow-right mr-2"></i>select</button>';
                        html +='</div>';
                    html +='</div>';
                html +='</div>';
            html +='</div>';

            return html;
        }
    </script>
<?php $__env->stopSection(); ?><?php /**PATH /home/elvh3918/public_html/pmm/resources/views/content/master/parts/modal/supplier.blade.php ENDPATH**/ ?>

Yohohohohohooho | Sanrei Aya