

<?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-4">
            <!--<?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>
            <a href="<?php echo e(url('/')); ?>" class="btn btn-green"><span class="fa fa-plus"></span> Form Tambah Member</a>
        </div>
        <div class="col-md-6 text-right">
          <?php if($auth == 0): ?>
          <button type="button" class="btn btn-success" data-toggle="modal" data-target="#importModal">
            <span class='fa fa-file-excel'></span> Import Data Member 
          </button>            
          <button type="button" class="btn btn-success" data-toggle="modal" data-target="#exampleModal">
            <span class='fa fa-file-excel'></span> Export Data Member 
          </button> 
          <?php endif; ?>          
        </div>
    </div>
    <?php echo $__env->make('customer._table', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    </div>
<!-- Modal Export -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Export Data Member</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
          <form action="<?php echo e(url('member/export')); ?>">
               <?php echo csrf_field(); ?>
               <div class='row'>
                   <div class='col-md-6'>
                       <label>Dari Tanggal</label>
                       <input type='date' class='form-control' name='dari'>
                   </div>
                   <div class='col-md-6'>
                       <label>Sampai Tanggal</label>
                       <input type='date' class='form-control' name='sampai'>
                   </div>
                   <div class='col-md-6'>
                       <br>
                       <button class='btn btn-success'>Export</button>
                   </div>
                   
               </div>
          </form>
      </div>
    </div>
  </div>
</div>

<!-- Modal Import -->
<div class="modal fade" id="importModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="importModalLabel">Import Data Member</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
          <form action="<?php echo e(url('member/import')); ?>" enctype="multipart/form-data" method="POST">
                <?php echo csrf_field(); ?>
                <div class="row">
                  <div class="col">
                    <input type="file" name="import_file"/>
                  </div>
                  <div class="col-auto">
                    <button type="submit" class='btn btn-success'>Import</button></div>
                  </div>
                </div>
          </form>
      </div>
    </div>
  </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('member.index')); ?>",
                columns: [{
                        data: 'DT_RowIndex',
                        name: 'DT_RowIndex'
                    },
                    {
                        data: 'nama',
                        name: 'nama'
                    },
                    {
                        data: 'email',
                        name: 'email'
                    },
                    {
                        data: 'phone',
                        name: 'phone'
                    },
                    {
                        data: 'tgl_lahir',
                        name: 'tgl_lahir'
                    },
                    {
                        data: 'poin',
                        name: 'poin'
                    },
                    {
                        data: 'cabang',
                        name: 'cabang'
                    },
                    {
                        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/coffeetoffeeco/public_html/member/resources/views/customer/index.blade.php ENDPATH**/ ?>