

<?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-between mb-3">
        <div class="col-md-6">
            <!--<?php echo $__env->make('components.button-add', ['btnText' => $btnText, 'btnLink' => $btnLink], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>-->
            <a href="<?php echo e($btnLink); ?>" class="btn btn-primary px-3"><i class="fa fa-plus-circle"></i> <?php echo e($btnText); ?></a>
        </div>
        <div class="col-md-4">
            
        </div>
    </div>
    <div class="table-responsive">
        <table class="table table-hover myTable" id="mytable">
            <thead>
                <tr class="table-primary">
                    <th class="text-center">#</th>
                    <th>Kode Voucher</th>
                    <th>Member</th>
                    <th>Nominal</th>
                    <th>Cabang</th>
                    <th>Aksi</th>
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('custom-script'); ?>
    <script type="text/javascript">
            var no = 1
    
        $(function() {
            var table = $('.myTable').DataTable({
                processing: true,
                serverSide: true,
                ajax: "<?php echo e(route('voucher.index')); ?>",
                columns: [{
                        data: 'DT_RowIndex',
                        name: 'DT_RowIndex'
                    },
                    {
                        data: 'voucher_code',
                        name: 'voucher_code'
                    },
                    {
                        data: 'nama',
                        name: 'nama'
                    },
                    {
                        data: 'price_item',
                        render:function(data,type,row){
                            return new Intl.NumberFormat("id-ID", { style: "currency", currency: "IDR" }).format(data);
                        }
                    },
                    {
                        data: 'branch_name',
                        name: 'branch_name'
                    },
                    {
                        data: 'action',
                        name: 'action',
                        orderable: false,
                        searchable: false
                    },
                ]
            });
        });
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.template', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/coffeeto/public_html/member/resources/views/voucher/index.blade.php ENDPATH**/ ?>