<?php $__env->startSection('content'); ?>
<div class="card">
    <div class="card-body">
        <div class="table-responsive">
<?php /*            
            <!--table class="display nowrap table table-bordered table-striped {{ count($users) > 0 ? 'datatable' : '' }} dt-select">
                <thead>
                    <tr>
                        <th style="text-align:center;"><input type="checkbox" id="select-all" class="filled-in chk-col-brown" /></th>
                        <th>Name</th>
                        <th>Email</th>
                        <th>Role</th>
                        <th>&nbsp;</th>
                    </tr>
                </thead>

                <tbody>
                    @if (count($users) > 0)
                        @foreach ($users as $user)
                            <tr data-entry-id="{{ $user->id }}">
                                <td></td>
                                <td>{{ $user->name }}</td>
                                <td>{{ $user->email }}</td>
                                <td>{{ $user->role->title or '' }}</td>
                                <td><a href="{{ route('users.show',[$user->id]) }}" class="btn btn-xs btn-primary">View</a><a href="{{ route('users.edit',[$user->id]) }}" class="btn btn-xs btn-info">Edit</a>{!! Form::open(array(
                'style' => 'display: inline-block;',
                'method' => 'DELETE',
                'onsubmit' => "return confirm('".trans("Are you sure?")."');",
                'route' => ['users.destroy', $user->id])) !!}
    {!! Form::submit('Delete', array('class' => 'btn btn-xs btn-danger')) !!}
    {!! Form::close() !!}</td>
                            </tr>
                        @endforeach
                    @else
                        <tr>
                            <td colspan="7">No entries in table</td>
                        </tr>
                    @endif
                </tbody>
            </table-->
*/ ?>
            <table class="table table-bordered" id="users-table">
                    <thead>
                        <tr>
                            <th>S. No.</th>
                            <th>Business Partner ID</th>
                            <th>Business Partner Name</th>
                            <th>Introducer ID</th>
                            <th>Introducer Name</th>
                            <th>Joining Date</th>
                            <th>Booking</th>
                            <th>Allotment+Installment</th>
                            <th>Total Business</th>
                            <th>Status</th>
                        </tr>
                    </thead>
                </table>
        </div>
    </div>
</div>
<div class="modal fade" id="loadModalAjax" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="display: none;" aria-hidden="true">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
    </div>
    <!-- /.modal-content -->
   </div>
  <!-- /.modal-dialog -->
</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('javascript'); ?>
    <script>
        $('#users-table').DataTable({
                processing: true,
                serverSide: true,
                ajax: '<?php echo url('/'); ?>/users/getDownlinesAnyData',
                dom: 'frtip',
                'lengthMenu': [ [10, 25, 50, -1], [10, 25, 50, "All"] ],
                buttons: [
                            'copy', 'csv', 'excel', 'pdf', 'print'
                        ],
                columns: [
                    { data: 'rownum', name: 'rownum', searchable:false },
                    { data: 'username', name: 'username' },
                    { data: 'full_name', name: 'full_name' },
                    { data: 'sponsor', name: 'sponsor' },
                    { data: 'u2full_name', name: 'u2full_name', searchable:false },
                    { data: 'created_at', name: 'created_at' },
                    { data: 'self_business', name: 'self_business', searchable:false },
                    { data: 'team_business', name: 'team_business', searchable:false },
                    { data: 'total_business', name: 'total_business', searchable:false },
                    { data: 'active', name: 'active', searchable:false }
                ],
                "columnDefs": [
                    {
                        "render": function ( data, type, row ) {
                            return '0.00';
                        },
                        "targets": 6
                    },
                    {
                        "render": function ( data, type, row ) {
                            return '0.00';
                        },
                        "targets": 7
                    },
                    {
                        "render": function ( data, type, row ) {
                            return '0.00';
                        },
                        "targets": 8
                    },
                    {
                        "render": function ( data, type, row ) {
                        if(data==0){
                            return '<span class="label label-danger">In-Active</span>';
                        }else{
                            return '<span class="label label-success">Active</span>';
                        }
                        },
                        "targets": 9
                    }
                ],
                'order': [[1, 'asc']],
                drawCallback: function( settings ) {
                    openModal();
                  }
            });

            function openModal(){
              $('.openModal').click(function(){
              	 $('#loadModalAjax .modal-content').load('<?php echo e(url('/')); ?>/users/' + $(this).attr('data-id'),function(result){
            	    $('#loadModalAjax').modal({show:true});
                  //init_validation('#updateStudentForm', rules, messages);
            	   });
              });
              $('.openModalInvoices').click(function(){
              	 $('#loadModalAjax .modal-content').load('/student_invoices_modal.php?id=' + $(this).attr('data-id'),function(result){
            	    $('#loadModalAjax').modal({show:true});
                  //init_validation('#updateStudentForm', rules, messages);
            	   });
              });
            }

    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH G:\xampp\htdocs\yespropmart2.loc\resources\views/users/getDownlines.blade.php ENDPATH**/ ?>