document.addEventListener('DOMContentLoaded', function() { // Confirm deletion const deleteButtons = document.querySelectorAll('.delete-btn'); deleteButtons.forEach(function(button) { button.addEventListener('click', function(e) { if (!confirm('Are you sure you want to delete this item?')) { e.preventDefault(); return false; } }); }); // Toggle user role const toggleRoleButtons = document.querySelectorAll('.toggle-role-btn'); toggleRoleButtons.forEach(function(button) { button.addEventListener('click', function(e) { if (!confirm('Are you sure you want to change this user\'s role?')) { e.preventDefault(); return false; } }); }); // Toggle premium status const togglePremiumButtons = document.querySelectorAll('.toggle-premium-btn'); togglePremiumButtons.forEach(function(button) { button.addEventListener('click', function(e) { if (!confirm('Are you sure you want to change this user\'s premium status?')) { e.preventDefault(); return false; } }); }); // Handle deposit approval/rejection const approveButtons = document.querySelectorAll('.approve-btn'); const rejectButtons = document.querySelectorAll('.reject-btn'); approveButtons.forEach(function(button) { button.addEventListener('click', function(e) { if (!confirm('Are you sure you want to approve this deposit?')) { e.preventDefault(); return false; } }); }); rejectButtons.forEach(function(button) { button.addEventListener('click', function(e) { if (!confirm('Are you sure you want to reject this deposit?')) { e.preventDefault(); return false; } }); }); });