89 lines
4.8 KiB
JavaScript
89 lines
4.8 KiB
JavaScript
$(document).ready(function () {
|
|
$('#zero-config').DataTable({
|
|
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
|
"<'table-responsive'tr>" +
|
|
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
|
|
"oLanguage": {
|
|
"oPaginate": {
|
|
"sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>',
|
|
"sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>'
|
|
},
|
|
"sInfo": "Showing page _PAGE_ of _PAGES_",
|
|
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
|
"sSearchPlaceholder": "Search...",
|
|
"sLengthMenu": "Results : _MENU_",
|
|
},
|
|
"stripeClasses": [],
|
|
"lengthMenu": [7, 10, 20, 50],
|
|
"pageLength": 10
|
|
});
|
|
|
|
$('#zero-config-scheduled').DataTable({
|
|
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
|
"<'table-responsive'tr>" +
|
|
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
|
|
"oLanguage": {
|
|
"oPaginate": {
|
|
"sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>',
|
|
"sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>'
|
|
},
|
|
"sInfo": "Showing page _PAGE_ of _PAGES_",
|
|
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
|
"sSearchPlaceholder": "Search...",
|
|
"sLengthMenu": "Results : _MENU_",
|
|
},
|
|
"stripeClasses": [],
|
|
"lengthMenu": [7, 10, 20, 50],
|
|
"pageLength": 10
|
|
});
|
|
});
|
|
|
|
|
|
|
|
function toggleDropdown(event) {
|
|
event.stopPropagation();
|
|
const dropdownMenu = event.currentTarget.nextElementSibling;
|
|
const isVisible = dropdownMenu.style.display === 'block';
|
|
document.querySelectorAll('.dropdown-menu').forEach(menu => menu.style.display = 'none');
|
|
dropdownMenu.style.display = isVisible ? 'none' : 'block';
|
|
}
|
|
|
|
document.addEventListener('click', () => {
|
|
document.querySelectorAll('.dropdown-menu').forEach(menu => menu.style.display = 'none');
|
|
});
|
|
|
|
document.querySelectorAll('.dropdown-menu').forEach(menu => {
|
|
menu.addEventListener('click', (event) => {
|
|
event.stopPropagation();
|
|
});
|
|
});
|
|
|
|
$(document).ready(function() {
|
|
$('.admin_delete_btn').on('click', function() {
|
|
var id = $(this).data('id');
|
|
$('#sub_admin_delete').val(id);
|
|
});
|
|
|
|
|
|
let base_url = url_path;
|
|
|
|
|
|
$('.admin_delete').on('click', function() {
|
|
var id = $('#sub_admin_delete').val();
|
|
$.ajax({
|
|
url: base_url + '/manage_delete_notifications/' + id,
|
|
|
|
type: 'POST',
|
|
data: {
|
|
_token: '{{ csrf_token() }}'
|
|
},
|
|
success: function(result) {
|
|
location.reload();
|
|
},
|
|
error: function(xhr) {
|
|
alert('An error occurred: ' + xhr.responseText);
|
|
}
|
|
});
|
|
});
|
|
});
|