<?php $__env->startSection('title', 'Entry Transaksi'); ?>

<?php $__env->startSection('content'); ?>
<?php use Facades\App\Cart\CartCollection; ?>
<?php if(CartCollection::isEmpty()): ?>
    <h3 class="page-header"><?php echo e(trans('nav_menu.draft_list')); ?></h3>
    <form action="<?php echo e(route('cart.add')); ?>" method="POST">
        <?php echo e(csrf_field()); ?>

        <p class="text-muted">Anda belum memiliki Draft Transaksi, silakan buat Transaksi Baru:</p>
        <input type="submit" class="btn btn-default navbar-btn" name="create-cash-draft" id="cash-draft-create-button" value="<?php echo e(trans('transaction.create_cash')); ?>">
        <input type="submit" class="btn btn-default navbar-btn" name="create-credit-draft" id="credit-draft-create-button" value="<?php echo e(trans('transaction.create_credit')); ?>">
    </form>
<?php endif; ?>
<?php echo $__env->renderWhen(! CartCollection::isEmpty(), 'cart.partials.transaction-draft-tabs', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>
<?php if($draft): ?>
    <?php if(Request::get('action') == 'confirm'): ?>
        <?php echo $__env->make('cart.partials.draft-confirm', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php else: ?>
        <?php echo $__env->make('cart.partials.product-search-box', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        <div class="row">
            <div class="col-md-9"><?php echo $__env->make('cart.partials.draft-item-list', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?></div>
            <div class="col-md-3"><?php echo $__env->make('cart.partials.form-draft-detail', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?></div>
        </div>
    <?php endif; ?>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php if($draft): ?>
<?php $__env->startSection('script'); ?>
<script>
(function() {
    var delay = (function(){
        var timer = 0;
        return function(callback, ms){
            clearTimeout (timer);
            timer = setTimeout(callback, ms);
        };
    })();

    $('#query').keyup(function() {
        delay(function() {
            var query = $('#query').val();
            if (query.length >= 3) {
                $.post(
                    "<?php echo e(route('api.products.search')); ?>",
                    {
                        query: query,
                        draftKey: '<?php echo e($draft->draftKey); ?>',
                        draftType: '<?php echo e($draft->type); ?>',
                        formToken: '<?php echo e(csrf_token()); ?>',
                    },
                    function(data) {
                    $('#product-search-result-box').html(data);
                });
            }
        }, 200 );
    });
})();
</script>
<?php $__env->stopSection(); ?>
<?php endif; ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Users\Deni\Downloads\Compressed\Apotek candilkuya\grosir-obat-master\resources\views/cart/index.blade.php ENDPATH**/ ?>