File size: 2,411 Bytes
92fd412
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
document.addEventListener('DOMContentLoaded', function() {
    // Initialize tooltips
    const tooltipElements = document.querySelectorAll('[data-tooltip]');
    
    // Add event listeners for table actions
    const editButtons = document.querySelectorAll('button:contains("Изменить")');
    const deleteButtons = document.querySelectorAll('button:contains("Удалить")');
    
    editButtons.forEach(button => {
        button.addEventListener('click', function() {
            const studentName = this.closest('tr').querySelector('td:first-child div.text-sm.font-medium').textContent;
            console.log(`Редактирование студента: ${studentName}`);
            // Here would be the edit functionality
        });
    });
    
    deleteButtons.forEach(button => {
        button.addEventListener('click', function() {
            const studentName = this.closest('tr').querySelector('td:first-child div.text-sm.font-medium').textContent;
            if (confirm(`Вы уверены, что хотите удалить студента ${studentName}?`)) {
                console.log(`Удаление студента: ${studentName}`);
                // Here would be the delete functionality
            }
        });
    });
    
    // Pagination functionality
    const paginationButtons = document.querySelectorAll('[aria-label="Pagination"] button');
    paginationButtons.forEach(button => {
        button.addEventListener('click', function() {
            if (!this.hasAttribute('aria-current')) {
                // Here would be pagination logic
                console.log(`Переход на страницу ${this.textContent.trim()}`);
            }
        });
    });
    
    // Export button functionality
    const exportButton = document.querySelector('button:contains("Экспорт")');
    if (exportButton) {
        exportButton.addEventListener('click', function() {
            console.log('Экспорт данных');
            // Here would be export functionality
        });
    }
    
    // Filter button functionality
    const filterButton = document.querySelector('button:contains("Фильтр")');
    if (filterButton) {
        filterButton.addEventListener('click', function() {
            console.log('Открытие фильтров');
            // Here would be filter functionality
        });
    }
});