diff --git a/public/assets/js/page/modules-datatables.js b/public/assets/js/page/modules-datatables.js index 5f91805a..9eb02d85 100644 --- a/public/assets/js/page/modules-datatables.js +++ b/public/assets/js/page/modules-datatables.js @@ -1,40 +1,40 @@ "use strict"; -$("[data-checkboxes]").each(function() { - var me = $(this), - group = me.data('checkboxes'), - role = me.data('checkbox-role'); +$("[data-checkboxes]").each(function () { + var me = $(this), + group = me.data('checkboxes'), + role = me.data('checkbox-role'); - me.change(function() { - var all = $('[data-checkboxes="' + group + '"]:not([data-checkbox-role="dad"])'), - checked = $('[data-checkboxes="' + group + '"]:not([data-checkbox-role="dad"]):checked'), - dad = $('[data-checkboxes="' + group + '"][data-checkbox-role="dad"]'), - total = all.length, - checked_length = checked.length; + me.change(function () { + var all = $('[data-checkboxes="' + group + '"]:not([data-checkbox-role="dad"])'), + checked = $('[data-checkboxes="' + group + '"]:not([data-checkbox-role="dad"]):checked'), + dad = $('[data-checkboxes="' + group + '"][data-checkbox-role="dad"]'), + total = all.length, + checked_length = checked.length; - if(role == 'dad') { - if(me.is(':checked')) { - all.prop('checked', true); - }else{ - all.prop('checked', false); - } - }else{ - if(checked_length >= total) { - dad.prop('checked', true); - }else{ - dad.prop('checked', false); - } - } - }); + if (role == 'dad') { + if (me.is(':checked')) { + all.prop('checked', true); + } else { + all.prop('checked', false); + } + } else { + if (checked_length >= total) { + dad.prop('checked', true); + } else { + dad.prop('checked', false); + } + } + }); }); $("#table-1").dataTable({ - "columnDefs": [ - { "sortable": false, "targets": [2,3] } - ] + "columnDefs": [ + { "sortable": false, "targets": [2] } + ] }); $("#table-2").dataTable({ - "columnDefs": [ - { "sortable": false, "targets": [0,2,3] } - ] + "columnDefs": [ + { "sortable": false, "targets": [0, 2, 3] } + ] }); diff --git a/resources/views/Admin/layout/main.blade.php b/resources/views/Admin/layout/main.blade.php index 7c7f48b3..4e12f172 100644 --- a/resources/views/Admin/layout/main.blade.php +++ b/resources/views/Admin/layout/main.blade.php @@ -64,6 +64,7 @@ gtag('config', 'UA-94034622-3'); </script> + <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script> <script> @@ -199,6 +200,45 @@ <!-- Page Specific JS File --> <script src="assets/js/page/modules-sweetalert.js"></script> + <script> + document.addEventListener('DOMContentLoaded', function() { + const swalWithBootstrapButtons = Swal.mixin({ + customClass: { + confirmButton: 'btn btn-success', + cancelButton: 'btn btn-danger' + }, + buttonsStyling: false + }); + const swalButton = document.getElementById('Swal'); + swalButton.addEventListener('click', function() { + swalWithBootstrapButtons.fire({ + title: 'Are you sure?', + text: "You won't be able to revert this!", + icon: 'warning', + showCancelButton: true, + confirmButtonText: 'Yes, delete it!', + cancelButtonText: 'No, cancel!', + reverseButtons: true + }).then((result) => { + if (result.isConfirmed) { + swalWithBootstrapButtons.fire( + 'Deleted!', + 'Your file has been deleted.', + 'success' + ); + } else if ( + result.dismiss === Swal.DismissReason.cancel + ) { + swalWithBootstrapButtons.fire( + 'Cancelled', + 'Your imaginary file is safe :)', + 'error' + ); + } + }); + }); + }); + </script> </body> diff --git a/resources/views/Admin/profile/index.blade.php b/resources/views/Admin/profile/index.blade.php index dc28af59..d79b5a8d 100644 --- a/resources/views/Admin/profile/index.blade.php +++ b/resources/views/Admin/profile/index.blade.php @@ -10,7 +10,6 @@ <div class="card-head"> <img id="card_head" src="/assets/images/sampul.jpg"></img> </div> - {{-- <div class="card-head"></div> --}} <div class="image-crop"> <img id="avatar" src="/assets/images/dashboard/img_1.jpg"></img> </div><br> diff --git a/resources/views/Admin/refund/history-refund.blade.php b/resources/views/Admin/refund/history-refund.blade.php index 6d57602d..1291537d 100644 --- a/resources/views/Admin/refund/history-refund.blade.php +++ b/resources/views/Admin/refund/history-refund.blade.php @@ -59,7 +59,7 @@ </button> <div class="dropdown-menu"> <a class="dropdown-item" href="/detail_refund">Details</a> - <a class="dropdown-item" href="#">Delete</a> + <a class="dropdown-item" href="#" id="Swal">Delete</a> </div> </div> </td> diff --git a/resources/views/Admin/transaction/History_Transaction.blade.php b/resources/views/Admin/transaction/History_Transaction.blade.php index 76336b0f..1884f162 100644 --- a/resources/views/Admin/transaction/History_Transaction.blade.php +++ b/resources/views/Admin/transaction/History_Transaction.blade.php @@ -61,7 +61,7 @@ <a class="dropdown-item" href="/detail_transaction">Details</a> <a class="dropdown-item" href="#" data-toggle="modal" data-target="#ModalTransaction">Tracking</a> - <a class="dropdown-item" href="#">Delete</a> + <a class="dropdown-item" href="#" id="Swal">Delete</a> </div> </div> </td> diff --git a/resources/views/Admin/users/list-user.blade.php b/resources/views/Admin/users/list-user.blade.php index 3553a0e4..5796c931 100644 --- a/resources/views/Admin/users/list-user.blade.php +++ b/resources/views/Admin/users/list-user.blade.php @@ -60,7 +60,7 @@ </button> <div class="dropdown-menu"> <a class="dropdown-item" href="/detail-user">Details</a> - <a class="dropdown-item" href="#">Delete</a> + <a class="dropdown-item" href="#" id="Swal">Delete</a> </div> </div> </td>