2024-04-16 15:43:24 +05:45

161 lines
5.3 KiB
PHP

<!-- JAVASCRIPT -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js" integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="{{asset('newtemplate/js/bundle.js')}}"></script>
<script src="{{asset('newtemplate/js/scripts.js')}}"></script>
<script src="{{asset('newtemplate/js/charts/marketing-chart.js')}}"></script>
<script src="{{asset('newtemplate/js/data-tables/jquery.dataTables.min.js')}}"></script>
<script src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.html5.min.js"></script>
{{-- <script src="https://cdn.datatables.net/buttons/2.3.2/js/dataTables.buttons.min.js"></script> --}}
<script src="{{asset('js/select2.min.js')}}"></script>
<script src="{{ asset('js/toastr/toastr.js') }}"></script>
<script>
$(document).ready(function() {
$('.js-example-basic-multiple').select2();
});
function deleteThis(obj) {
let data = obj.getAttribute("link");
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
window.location = data;
Swal.fire(
'Deleted!',
'Your file has been deleted.',
'success'
)
} else {
Swal.fire(
'Cancelled!',
'Your file has been Cancelled.',
'error'
)
}
})
}
function proceedThis(obj) {
let data = obj.getAttribute("link");
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Proceed Forward'
}).then((result) => {
if (result.isConfirmed) {
window.location = data;
Swal.fire(
'Deleted!',
'Your file has been deleted.',
'success'
)
} else {
Swal.fire(
'Cancelled!',
'Proceed has been Cancelled.',
'error'
)
}
})
}
$(document).ready(function() {
$(document).on('click', '.btn-delete', function(e) {
e.preventDefault();
var currentObj = $(this);
var route = $(this).data('route');
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Delete!'
}).then((result) => {
if (result.isConfirmed) {
// var delete_id = $(this).attr("data-id").split('~');
// var currentID = $(this).parent().parent();
$.ajax({
type: "get",
url: route,
dataType: "json",
success: (data) => {
if (data.status) {
$('#example').DataTable().ajax.reload();
Swal.fire(
'Deleted!',
'Your file has been deleted.',
'success'
)
} else {
Swal.fire({
icon: 'error',
title: 'Oops...',
text: 'Something went wrong!',
footer: ''
})
}
}
})
} else {
Swal.fire(
'Cancelled!',
'Your file has been Cancelled.',
'error'
)
}
})
});
});
$('#CustomTable').DataTable({
dom: 'Blfrtip',
// buttons: [
// // 'copyHtml5',
// 'excelHtml5',
// // 'csvHtml5',
// 'pdfHtml5'
// ],
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print' // Add export buttons here
],
"lengthMenu": [
[10, 25, 50, -1],
[10, 25, 50, "All"]
],
});
</script>
<script src="{{ asset('js/dropify.min.js') }}"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.dropify').dropify();
});
</script>
@yield('page-specific-scripts')
{!! Toastr::message() !!}
</body>
</html>