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