<?php $__env->startSection('content'); ?>
<div class="card">
    <div class="card-body">
        <h4 class="card-title">All Pins</h4>
        <h6 class="card-subtitle">Export data to Copy, CSV, Excel, PDF & Print</h6>
    <p>
        <a href="<?php echo e(route('admin.pins.create')); ?>" class="btn btn-success">Add new</a>
    </p>
        <div class="table-responsive">
            <table class="table table-bordered" id="pins-table">
                    <thead>
                        <tr>
                            <th>Id</th>
                            <th>Name</th>
                            <th>For User</th>
                            <th>Created At</th>
                            <th>Updated At</th>
                            <th>Action</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>
        $('#pins-table').DataTable({
                processing: true,
                serverSide: true,
                ajax: '<?php echo url('/'); ?>/admin/pins/anydata',
                dom: 'Bfrtip',
                'lengthMenu': [ [10, 25, 50, -1], [10, 25, 50, "All"] ],
                buttons: [
                            'copy', 'csv', 'excel', 'pdf', 'print'
                        ],
                columns: [
                    { data: 'id', name: 'id' },
                    { data: 'name', name: 'name' },
                    { data: 'user_id', name: 'user_id' },
                    { data: 'created_at', name: 'created_at' },
                    { data: 'updated_at', name: 'updated_at' },
                    { data: 'action', name: 'action' }
                ],
                'order': [[1, 'asc']],
                drawCallback: function( settings ) {
                    openModal();
                  }
            });

            function openModal(){
              $('.openModal').click(function(){
              	 $('#loadModalAjax .modal-content').load('<?php echo e(url('/')); ?>/admin/pins/' + $(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\yeselectricv.loc\resources\views/admin/pins/index.blade.php ENDPATH**/ ?>