Файловый менеджер - Редактировать - /home/clickysoft/public_html/securebeans.clickysoft.net/resources/views/admin/permissions/index.blade.php
Назад
@extends('layouts.admin') @section('content') <div class="content"> @if (\Session::has('success')) <p class="alert alert-success"> {!! \Session::get('success') !!} </p> @endif <div id="success"> </div> @can('permission_create') <div style="margin-bottom: 10px;" class="row"> <div class="col-lg-12"> <a class="btn btn-success float-right" href="{{ route('admin.permissions.create') }}"> Add Permission </a> <a class="btn btn-danger float-left" href="" id="delete-selected"> <i class="fa fa-trash" aria-hidden="false"></i> Delete Selected </a> </div> </div> @endcan <div class="card"> <div class="card-header"> Permissions </div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered data-table "> <thead> <tr> <th width="10px"> <input type="checkbox" id="checkbox"> </th> <th>Id</th> <th>Title</th> <th width="100px">Action</th> </tr> </thead> <tbody> </table> </div> </div> </div> </div> @endsection @section('scripts') <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.js"></script> <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> <script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap4.min.js"></script> <script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script type="text/javascript"> $(".table").css("width", "100%"); var selected_ids=[]; var check_id=0; let bit=0; $(function () { var table = $('.data-table').DataTable({ processing: false, serverSide: true, ordering:false, ajax: "{{ route('admin.permissions.index') }}", columns: [ {data: 'checkbox', name: 'checkbox[]', orderable: false, searchable: false}, {data: 'id', name: 'id'}, {data: 'title', name: 'title'}, {data: 'action', name: 'action', orderable: false, searchable: false}, ] }); }); //delete permissions $(document).on('click','#delete',function(event){ var btn = $(this) btn.addClass('focus-none'); btn.prop('focus',false); Swal.fire({ title: 'Are you sure?', showDenyButton: true, showCancelButton: false, confirmButtonText: 'Yes', denyButtonText: `No`, focusDeny:true }).then((result) => { var id = $(this).attr('data-form-id'); if (result.isConfirmed) { document.getElementById('delete-permission'+id).submit(); } else if(result.isDenied) { } }) }) $('#delete-selected').on('click',function(e){ var btn = $(this) btn.addClass('focus-none'); btn.prop('focus',false); e.preventDefault(); if(selected_ids.length==0){ alert("Please Select items from list") } else{ if(bit == 0){ Swal.fire({ title: 'Are you sure?', showDenyButton: true, showCancelButton: false, confirmButtonText: 'Yes', denyButtonText: `No`, focusDeny:true }).then((result) => { if (result.isConfirmed) { $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); $.ajax({ beforeSend: function() { bit=1; }, type:"delete", url:"{{route('admin.permissions.massDestroy')}}", data:{ids:selected_ids}, success:function(response){ if(response.status==200){ $('#success').html("<p class='alert alert-success'>Permissions deleted successfully</p>") location.reload(); } else{ location.reload(); } } }) } else if(result.isDenied) { } }) } } }) $('#checkbox').on('click',function(){ if(check_id==0){ check_id=1; selected_ids=[] $("input[name='checkbox[]']").each( function () { $(this).prop('checked', true); var id=$(this).attr('id'); selected_ids.push(id) }); } else{ check_id=0 $("input[name='checkbox[]']").each( function () { selected_ids=[] $(this).prop('checked', false); }); } }) //onchange checkbox $(document).on('change','.checkbox',function(){ if ($(this).is(':checked')) { selected_ids.push($(this).attr("id")) } else{ const index = selected_ids.indexOf($(this).attr('id')); if (index > -1) { selected_ids.splice(index, 1); } } }) </script> @endsection
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка