<?php $__env->startSection('content'); ?>
<!-- start page title -->
<div class="container-xxl flex-grow-1 container-p-y">
    <div class="col-lg-12 mb-4 order-0">
    </div>
<?php if(session('success')): ?>
<div class="alert alert-success">
    <?php echo e(session('success')); ?>

</div>
<?php endif; ?>
<?php if(session('error')): ?>
<div class="alert alert-danger">
    <?php echo e(session('error')); ?>

</div>
<?php endif; ?>

   
   <div class="card mb-3">
       <div class="mb-3">
    <div class="card-body">
        <div class="clearfix">
    
   <a href="javascript:;" onclick="modal('EditProfit', '<?php echo e(route('detail.produk.get', 1)); ?>')">
    <button type="submit" class="btn-secondary inline-flex items-center justify-center rounded-4 px-3 py-2.7 hvrbutton" style="float: right; border-radius:6px;">
        <span style="display: flex; align-items: center;">
             <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" width="16" height="16">
                <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 00-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 01-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 003 15h-.75M15 10.5a3 3 0 11-6 0 3 3 0 016 0zm3 0h.008v.008H18V10.5zm-12 0h.008v.008H6V10.5z"></path>
            </svg>
            Update Profit
        </span>
    </button>
     </a>
     
 <form method="POST" action="<?php echo e(route('sync.produk.get.post')); ?>">
    <?php echo csrf_field(); ?>
   <div class="m-2">
    
        <button type="submit" class="btn-secondary inline-flex items-center justify-center rounded-4 px-3 py-2.7 hvrbutton" style="float: right; border-radius:6px;">
        <span style="display: flex; align-items: center;">
             <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" width="16" height="16">
            <path stroke-linecap="round" stroke-linejoin="round" d="M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"></path>
        </svg>
            Sync price digiflazz
        </span>
    </button>
    
    </div>
</form>

<!-- <form method="POST" action="<?php echo e(route('synctopupedia.produk.get.post')); ?>">-->
<!--    <?php echo csrf_field(); ?>-->
<!--   <div class="m-2">-->
    
<!--        <button type="submit" class="btn-secondary inline-flex items-center justify-center rounded-4 px-3 py-2.7 hvrbutton" style="float: right; border-radius:6px;">-->
<!--        <span style="display: flex; align-items: center;">-->
<!--             <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" width="16" height="16">-->
<!--            <path stroke-linecap="round" stroke-linejoin="round" d="M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"></path>-->
<!--        </svg>-->
<!--            Sync price topupedia-->
<!--        </span>-->
<!--    </button>-->
    
<!--    </div>-->
<!--</form>-->

 <a href="<?php echo e(route('produk.get')); ?>" class="m-2">
    <button type="submit" class="btn-secondary inline-flex items-center justify-center rounded-4 px-3 py-2.7 hvrbutton" style="float: right; border-radius:6px;">
        <span style="display: flex; align-items: center;">
            Get Product
        </span>
    </button>
     </a>
     
</div>
</div>
</div>
    <div class="card-body">
        <form id="addServiceForm" action="<?php echo e(route('layanan.post')); ?>" method="POST" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>

            <div class="mb-3 row">
                <label class="col-lg-2 col-form-label" for="example-fileinput">Layanan</label>
                <div class="col-lg-10">
                    <input type="text" class="form-control <?php $__errorArgs = ['nama'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('nama')); ?>" name="nama">
                    <?php $__errorArgs = ['nama'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <div class="invalid-feedback">
                        <?php echo e($message); ?>

                    </div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
            </div>

            <div class="mb-3 row">
                <label class="col-lg-2 col-form-label">Kategori</label>
                <div class="col-lg-10">
                    <select class="form-select" name="kategori">
                        <option>--Pilih Game--</option>
                        <?php $__currentLoopData = $kategoris; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kategori): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($kategori->id); ?>"><?php echo e($kategori->nama); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
            </div>

            <div class="mb-3 row">
                <label class="col-lg-2 col-form-label">Provider</label>
                <div class="col-lg-10">
                    <select class="form-select" name="provider">
                        <option>--Pilih Provider--</option>
                        <!--<option value="topupedia">Topupedia</option>-->
                        <option value="digiflazz">Digiflazz</option>
                        <!--<option value="bangjeff">Bangjeff</option>-->
                        <option value="joki">Joki</option>
                        <option value="vilogml">ML Vilog</option>
                        <option value="giftskin">Gift Skin</option>
                    </select>
                </div>
            </div>

           <div class="mb-3 row">
    <label for="harga" class="col-lg-1 col-form-label">Harga</label>
    <div class="col-lg-5">
        <input type="number" class="form-control <?php $__errorArgs = ['harga'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('harga')); ?>" name="harga" id="harga">
        <?php $__errorArgs = ['harga'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
        <div class="invalid-feedback">
            <?php echo e($message); ?>

        </div>
        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
    </div>
    <label for="harga_member" class="col-lg-1 col-form-label">Harga Member</label>
    <div class="col-lg-5">
        <input type="number" class="form-control <?php $__errorArgs = ['harga_member'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('harga_member')); ?>" name="harga_member" id="harga_member">
        <?php $__errorArgs = ['harga_member'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
        <div class="invalid-feedback">
            <?php echo e($message); ?>

        </div>
        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
    </div>
</div>

<div class="mb-3 row">
    <label for="harga_platinum" class="col-lg-1 col-form-label">Harga Platinum</label>
    <div class="col-lg-5">
        <input type="number" class="form-control <?php $__errorArgs = ['harga_platinum'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('harga_platinum')); ?>" name="harga_platinum" id="harga_platinum">
        <?php $__errorArgs = ['harga_platinum'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
        <div class="invalid-feedback">
            <?php echo e($message); ?>

        </div>
        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
    </div>
    <label for="harga_gold" class="col-lg-1 col-form-label">Harga Gold</label>
    <div class="col-lg-5">
        <input type="number" class="form-control <?php $__errorArgs = ['harga_gold'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('harga_gold')); ?>" name="harga_gold" id="harga_gold">
        <?php $__errorArgs = ['harga_gold'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
        <div class="invalid-feedback">
            <?php echo e($message); ?>

        </div>
        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
    </div>
</div>



            <div class="mb-3 row">
                <label for="" class="col-lg-1 col-form-label">Profit</label>
                <div class="col-lg-5">
                    <input type="number" class="form-control <?php $__errorArgs = ['profit'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('profit')); ?>" name="profit">
                    <?php $__errorArgs = ['profit'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <div class="invalid-feedback">
                        <?php echo e($message); ?>

                    </div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
                <label for="" class="col-lg-1 col-form-label">Profit Member</label>
                <div class="col-lg-5">
                    <input type="number" class="form-control <?php $__errorArgs = ['profit_member'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('profit_member')); ?>" name="profit_member">
                    <?php $__errorArgs = ['profit_member'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <div class="invalid-feedback">
                        <?php echo e($message); ?>

                    </div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
                <label for="" class="col-lg-1 col-form-label">Profit Platinum</label>
                <div class="col-lg-5">
                    <input type="number" class="form-control <?php $__errorArgs = ['profit_platinum'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('profit_platinum')); ?>" name="profit_platinum">
                    <?php $__errorArgs = ['profit_platinum'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <div class="invalid-feedback">
                        <?php echo e($message); ?>

                    </div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
                <label for="" class="col-lg-1 col-form-label">Profit Gold</label>
                <div class="col-lg-5">
                    <input type="number" class="form-control <?php $__errorArgs = ['profit_gold'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('profit_gold')); ?>" name="profit_gold">
                    <?php $__errorArgs = ['profit_gold'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <div class="invalid-feedback">
                        <?php echo e($message); ?>

                    </div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
                <label for="" class="col-lg-1 col-form-label">Provider ID</label>
                <div class="col-lg-5">
                    <input type="text" class="form-control <?php $__errorArgs = ['provider_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('provider_id')); ?>" name="provider_id">
                    <?php $__errorArgs = ['provider_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <div class="invalid-feedback">
                        <?php echo e($message); ?>

                    </div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
            </div>

            <div class="mb-3 row">
                <label class="col-lg-2 col-form-label">Flash Sale?</label>
                <div class="col-lg-10">
                    <select class="form-select" name="flash_sale">
                        <option value="0">No</option>
                        <option value="1">Yes</option>
                    </select>
                </div>
            </div>

            <div class="mb-3 row">
                <label class="col-lg-2 col-form-label" for="example-fileinput">Judul Flash Sale</label>
                <div class="col-lg-10">
                    <input type="text" class="form-control <?php $__errorArgs = ['judul_flash_sale'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('judul_flash_sale')); ?>" name="judul_flash_sale">
                    <?php $__errorArgs = ['judul_flash_sale'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <div class="invalid-feedback">
                        <?php echo e($message); ?>

                    </div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
            </div>
<div class="mb-3 row">
    <label class="col-lg-2 col-form-label" for="example-fileinput">Harga Flash Sale</label>
    <div class="col-lg-10">
        <input type="number" class="form-control <?php $__errorArgs = ['harga_flash_sale'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="0" name="harga_flash_sale" id="harga_flash_sale">
        <?php $__errorArgs = ['harga_flash_sale'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
        <div class="invalid-feedback">
            <?php echo e($message); ?>

        </div>
        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
    </div>
</div>

<div class="mb-3 row">
    <label class="col-lg-2 col-form-label" for="example-fileinput">Stock Flash Sale</label>
    <div class="col-lg-10">
        <input type="number" class="form-control <?php $__errorArgs = ['stock_flash_sale'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="0" name="stock_flash_sale" id="stock_flash_sale">
        <?php $__errorArgs = ['stock_flash_sale'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
        <div class="invalid-feedback">
            <?php echo e($message); ?>

        </div>
        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
    </div>
</div>

<script>
    document.querySelectorAll('input[type="number"]').forEach(function(input) {
        input.addEventListener('input', function() {
            if (this.value < 0) {
                this.value = 0;
            }
        });
    });
</script>
            <div class="mb-3 row">
                <label class="col-lg-2 col-form-label" for="example-fileinput">Expired Flash Sale</label>
                <div class="col-lg-10">
                    <input type="datetime-local" class="form-control <?php $__errorArgs = ['expired_flash_sale'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('expired_flash_sale')); ?>" name="expired_flash_sale">
                    <?php $__errorArgs = ['expired_flash_sale'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <div class="invalid-feedback">
                        <?php echo e($message); ?>

                    </div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
            </div>

            <button type="button" class="btn btn-primary" onclick="confirmAddService()">Submit</button>
        </form>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="card">
            <div class="card-body">
                <h4 class="header-title mt-0 mb-1">Semua Layanan</h4>
                <div id="loadingSpinnerLayanan" class="text-center">
                    <div class="spinner-border text-primary" role="status">
                        <span class="visually-hidden">Loading...</span>
                    </div>
                </div>
                <div class="table-responsive d-none" id="layananTableContainer">
                    <table class="table table-dark table-bordered table-striped m-0" id="layanan-table">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>Kategori</th>
                                <th>Layanan</th>
                                <th>Provider</th>
                                <th>PID</th>
                                <th>Harga</th>
                                <th>Harga Member</th>
                                <th>Harga Platinum</th>
                                <th>Harga Gold</th>
                                <th>Profit</th>
                                <th>Profit Member</th>
                                <th>Profit Platinum</th>
                                <th>Profit Gold</th>
                                <th>Harga Flash Sale</th>
                                <th>Flash Sale?</th>
                                <th>Judul Flash Sale</th>
                                <th>Expired Flash Sale</th>
                                <th>Status</th>
                                <th>Aksi</th>
                                <th>Tanggal</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = $datas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php
                            $label_pesanan = '';
                            if($data->status == "available"){
                                $label_pesanan = 'info';
                            }else if($data->status == "unavailable"){
                                $label_pesanan = 'warning';
                            }
                            ?>
                            <tr>
                                <th scope="row"><?php echo e($data->id); ?></th>
                                <td><?php echo e($data->nama_kategori); ?></td>
                                <td><?php echo e($data->layanan); ?></td>
                                <td><?php echo e($data->provider); ?></td>
                                <td><?php echo e($data->provider_id); ?></td>
                                <td>Rp. <?php echo e(number_format($data->harga, 0, '.', ',')); ?></td>
                                <td>Rp. <?php echo e(number_format($data->harga_member, 0, '.', ',')); ?></td>
                                <td>Rp. <?php echo e(number_format($data->harga_platinum, 0, '.', ',')); ?></td>
                                <td>Rp. <?php echo e(number_format($data->harga_gold, 0, '.', ',')); ?></td>
                                <td><?php echo e(number_format($data->profit, 0, '.', ',')); ?>% (Rp. <?php echo e($data->harga * ($data->profit / 100)); ?>)</td>
                                <td><?php echo e(number_format($data->profit_member, 0, '.', ',')); ?>% (Rp. <?php echo e($data->harga_member * ($data->profit_member / 100)); ?>)</td>
                                <td><?php echo e(number_format($data->profit_platinum, 0, '.', ',')); ?>% (Rp. <?php echo e($data->harga_platinum * ($data->profit_platinum / 100)); ?>)</td>
                                <td><?php echo e(number_format($data->profit_gold, 0, '.', ',')); ?>% (Rp. <?php echo e($data->harga_gold * ($data->profit_gold / 100)); ?>)</td>
                                <td>Rp. <?php echo e(number_format($data->harga_flash_sale, 0, '.', ',')); ?></td>
                                <td><?php echo e($data->is_flash_sale == 0 ? 'No' : 'Yes'); ?></td>
                                <td><?php echo e($data->judul_flash_sale); ?></td>
                                <td><?php echo e($data->expired_flash_sale); ?></td>
                                <td>
                                    <div class="btn-group-vertical">
                                        <button id="btnGroupDrop1" type="button" class="btn btn-<?php echo e($label_pesanan); ?> dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> <?php echo e($data->status); ?> <i class="mdi mdi-chevron-down"></i> </button>
                                        <ul class="dropdown-menu" aria-labelledby="btnGroupDrop1">
                                            <li><a class="dropdown-item" href="javascript:;" onclick="changeStatus('<?php echo e($data->id); ?>', 'available')">available</a></li>
                                            <li><a class="dropdown-item" href="javascript:;" onclick="changeStatus('<?php echo e($data->id); ?>', 'unavailable')">unavailable</a></li>
                                        </ul>
                                    </div>
                                </td>
                                <td>
                                    <a href="javascript:;" onclick="modal('<?php echo e($data->layanan); ?>', '<?php echo e(route('layanan.detail', [$data->id])); ?>')" class="btn btn-info mb-1">Edit</a>
                                    <a href="javascript:;" onclick="confirmDelete('<?php echo e($data->id); ?>')" class="btn btn-danger">Hapus</a>
                                </td>
                                <td><?php echo e($data->created_at); ?></td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
$(document).ready(function() {
    setTimeout(function() {
        $('#loadingSpinnerLayanan').addClass('d-none');
        $('#layananTableContainer').removeClass('d-none');
        $('#layanan-table').DataTable();
    }, 500); // Adjust the delay as needed
});
</script>

<!-- Modal untuk Edit -->
<div class="modal fade" id="modal-detail" tabindex="-1" aria-labelledby="modal-detail-title" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="modal-detail-title">Detail Layanan</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body" id="modal-detail-body">
                <!-- Konten akan dimuat di sini melalui AJAX -->
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    function confirmAddService() {
        Swal.fire({
            title: 'Tambah Layanan',
            text: "Apakah Anda yakin ingin menambah layanan ini?",
            icon: 'question',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Ya, tambahkan!',
            cancelButtonText: 'Batal'
        }).then((result) => {
            if (result.isConfirmed) {
                document.getElementById('addServiceForm').submit();
            }
        });
    }

    function confirmDelete(id) {
        Swal.fire({
            title: 'Hapus Layanan',
            text: "Apakah Anda yakin ingin menghapus layanan ini?",
            icon: 'warning',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Ya, hapus!',
            cancelButtonText: 'Batal'
        }).then((result) => {
            if (result.isConfirmed) {
                window.location.href = '/layanan/hapus/' + id;
            }
        });
    }

    function changeStatus(id, status) {
        Swal.fire({
            title: 'Ubah Status Layanan',
            text: "Apakah Anda yakin ingin mengubah status layanan ini menjadi " + status + "?",
            icon: 'question',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Ya, ubah!',
            cancelButtonText: 'Batal'
        }).then((result) => {
            if (result.isConfirmed) {
                window.location.href = '/layanan-status/' + id + '/' + status;
            }
        });
    }

    $(document).ready(function() {
        $('.table').DataTable();
    });

    function modal(name, link) {
        var myModal = new bootstrap.Modal($('#modal-detail'))
        $.ajax({
            type: "GET",
            url: link,
            beforeSend: function() {
                $('#modal-detail-title').html(name);
                $('#modal-detail-body').html('Loading...');
            },
            success: function(result) {
                $('#modal-detail-title').html(name);
                $('#modal-detail-body').html(result);
            },
            error: function() {
                $('#modal-detail-title').html(name);
                $('#modal-detail-body').html('There is an error...');
            }
        });
        myModal.show();
    }
</script>

<!-- Include SweetAlert library -->
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('main-admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u870822285/domains/ramstopup.id/public_html/project/resources/views/components/admin/layanan.blade.php ENDPATH**/ ?>