

<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('components.notification', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

    <div class="row justify-content-start">
        <div class="col-md-4">
            <div class="input-group">
                <input type="number" class="form-control" id="phone" name="keyword" value="<?php echo e(Request::get('keyword')); ?>"
                    placeholder="No Telepon">
                    <button class="btn btn-sm btn-primary px-3" onclick="getByPhone()"><i
                        class="fa fa-filter"></i>FILTER</button>
            </div>
        </div>
    </div>
    <br>
    <?php echo $__env->make('customer._poin-table', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('custom-script'); ?>
    <script>
        function getByPhone() {
        var phone = $('#phone').val();
        $.ajax({
            type: "GET",
            url: "<?php echo e(url('get-by-phone')); ?>?phone=" + phone,
            dataType: "json",
            success: function(response) {
                var title = "Data Kosong"
                var text = "No Hp Tidak ditemukan"
                var type = "warning"
                if (response.length == 1) {
                    title = 'Hello ' + response[0].nama+"!";
                    text = 'Poin anda sebanyak ' + response[0].poin;
                    type = 'success'
                }
                swal({
                    title: title,
                    text: text,
                    type: type,
                    showCancelButton: false,
                    confirmButtonColor: "#92BA92",
                    confirmButtonText: 'Kembali',
                    closeOnConfirm: false,
                });
            }            
        });
    }
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.template', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\Code\Kuliah\Magang\coffeetoffee\resources\views/customer/cek-poin.blade.php ENDPATH**/ ?>