Spaces:
Build error
Build error
File size: 1,333 Bytes
33bb0d3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
$(document).ready(function() {
// Download Excel button
$('#downloadBtn').click(function() {
window.location.href = '/download_excel';
});
// View ticket modal
$('.view-btn').click(function() {
const ticketId = $(this).data('id');
// In a real app, you would fetch the ticket details from the server
// For now, we'll just show a sample modal
$('#viewTicketModal').modal('show');
});
// Delete ticket button
$('.delete-btn').click(function() {
const ticketId = $(this).data('id');
if (confirm('Are you sure you want to delete this ticket?')) {
// In a real app, you would send a DELETE request to the server
alert('Ticket would be deleted here (implementation needed)');
}
});
// Refresh button
$('.refresh-btn').click(function() {
location.reload();
});
// Search functionality
$('.search-box input').on('keyup', function() {
const value = $(this).val().toLowerCase();
$('table tbody tr').filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
// Simulate loading data
setTimeout(function() {
$('.table-responsive').addClass('loaded');
}, 500);
}); |