<?php $__env->startSection('content'); ?>

    <div class="container-fluid">
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                <div class="row">
                    <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                        <h3 class="set_menu_name"></h3>
                    </div>
                    <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 text-right">
                        <button type="button" data-href="<?php echo e(route('member-package.create')); ?>" data-width="1000px" class="getHtmlForm button_primary fa fa-plus"> <span class="set_menu_name"></span></button>
                        <button type="button" data-name="Import Package" data-href="<?php echo e(route('member-package-import-exel')); ?>" data-width="800px" class="getHtmlForm button_success fa fa-upload"> <span>Import</span></button>
                        <button type="button" class="button_info save_to_excel fa fa-file-excel-o"> <span>Save to excel</span></button>

                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="margin-top: 40px">
                        <form class="serialize_form">
                            <div class="col-md-4 col-lg-4">
                                <div class="col-sm-3 col-md-3" >
                                    <?php echo e(__('administrator.member_type')); ?>

                                </div>
                                <div class="form-group col-sm-9 col-md-9">
                                    <?php echo Form::select('member_type', \App\Model\setup\MemberTypeModel::pluck('name','id') , null , ['placeholder'=>__('administrator.please_select'),'class' => 'form-control']); ?>

                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="container-fluid" style="background: white; padding:10px">
                    <div class="table-responsive">
                        <table id="dataTable" class="table table-hover">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th>ID</th>
                                <th><?php echo e(__('administrator.barcode')); ?></th>
                                <th><?php echo e(__('administrator.product')); ?></th>
                                <th><?php echo e(__('administrator.member_type')); ?></th>
                                <th><?php echo e(__('administrator.price')); ?> (៛)</th>
                                <th><?php echo e(__('administrator.price')); ?> ($)</th>
                                <th><?php echo e(__('administrator.created_at')); ?></th>
                                <th width="10%"><?php echo e(__('administrator.action')); ?></th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>

            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
    <script type="text/javascript">
        let tb = $('#dataTable');
        $(document).ready(function () {
            getTable();
            $('.serialize_form').on('change','select',function () {
                getTable()
            })
        });
        function getTable() {
            tb.DataTable().destroy();
            tb.DataTable({
                serverSide: true,
                ordering: false,
                lengthMenu: tbLeng,
                dom: 'lBfrtip',
                buttons: [
                    {
                        extend: 'excelHtml5',
                        className: 'btn-save-excel',
                        title:'member-package',
                        text: 'Save as Excel',
                        footer: true,
                        header: true,

                    },
                ],
                ajax: {
                    url: "<?php echo e(route('member-package.index')); ?>?"+$('.serialize_form').serialize(),
                },
                columns:
                    [
                        {data: 'DT_RowIndex','searchable':false},
                        {data: 'product_id','name':'p.id'},
                        {data: 'barcode','name':'p.barcode'},
                        {data: 'product_name','name':'p.product_name'},
                        {data: 'member_type_name','name':'mt.name'},
                        {data: 'price_riel'},
                        {data: 'price_usd'},
                        {data: 'created_at'},
                        {data: 'action','searchable':false},
                    ]
            });
        }
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make(branchMenu(), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/nsowos/public_html/shr-brand/resources/views/administrator/setup/member-package/index.blade.php ENDPATH**/ ?>