Reset Password

Back
`); win.document.close(); win.print(); } //For Excel Export for employee detail function exportSelectedToExcel() { let cols = Array.from( document.querySelectorAll('#printModal input:checked') ).map(cb => parseInt(cb.value)); if (cols.length === 0) { alert('Select at least one column'); return; } cols.sort((a, b) => a - b); let table = document.getElementById('table1'); let rows = table.querySelectorAll('tbody tr'); let csvContent = ''; // HEADER let headers = cols.map(i => `"${table.querySelectorAll('thead th')[i].innerText}"`); csvContent += headers.join(',') + '\n'; // BODY rows.forEach(r => { let rowData = cols.map(i => `"${r.children[i].innerText}"`); csvContent += rowData.join(',') + '\n'; }); let blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' }); let url = URL.createObjectURL(blob); let a = document.createElement('a'); a.href = url; a.download = 'employee_data.csv'; document.body.appendChild(a); a.click(); document.body.removeChild(a); } //For Excel Export for Account detail function exportToExcel() { let cols = Array.from( document.querySelectorAll('#printModal input:checked') ).map(cb => parseInt(cb.value)); if (cols.length === 0) { alert('Select at least one column'); return; } cols.sort((a, b) => a - b); let table = document.getElementById('salaryTable'); let rows = table.querySelectorAll('tbody tr'); let csvContent = ''; // HEADER let headers = cols.map(i => '"' + table.querySelectorAll('thead th')[i].innerText + '"'); csvContent += headers.join(',') + '\n'; // BODY rows.forEach(r => { let rowData = cols.map(i => '"' + r.children[i].innerText + '"'); csvContent += rowData.join(',') + '\n'; }); let blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' }); let url = URL.createObjectURL(blob); let a = document.createElement('a'); a.href = url; a.download = 'employee_data.csv'; document.body.appendChild(a); a.click(); document.body.removeChild(a); } //Select all document.addEventListener('DOMContentLoaded', function () { const selectAll = document.getElementById('selectAllCols'); const checkboxes = document.querySelectorAll('#printModal .col-check'); if (!selectAll) return; // Select / Deselect all selectAll.addEventListener('change', function () { checkboxes.forEach(cb => cb.checked = this.checked); }); // If any checkbox is unchecked → uncheck Select All checkboxes.forEach(cb => { cb.addEventListener('change', function () { selectAll.checked = [...checkboxes].every(c => c.checked); }); }); }); //for Employee detail Searh filter document.addEventListener('DOMContentLoaded', function() { const searchInput = document.getElementById('searchInput'); const table = document.getElementById('table1'); const salaryTable = document.getElementById('salaryTable') const rows = table.querySelectorAll('tbody tr'); searchInput.addEventListener('input', function() { const searchTerm = this.value.toLowerCase(); rows.forEach(row => { const rowText = row.textContent.toLowerCase(); row.style.display = rowText.includes(searchTerm) ? '' : 'none'; }); }); }); // Print Functionality for Employee Salary function printSalary() { let cols = Array.from( document.querySelectorAll('#printModal input:checked') ).map(cb => parseInt(cb.value)); if (cols.length === 0) { alert('Select at least one column'); return; } cols.sort((a, b) => a - b); let table = document.getElementById('salaryTable'); let rows = table.querySelectorAll('tbody tr'); let newTable = document.createElement('table'); newTable.style.width = '100%'; newTable.style.borderCollapse = 'collapse'; // HEADER let thead = document.createElement('thead'); let trh = document.createElement('tr'); cols.forEach(i => { let th = document.createElement('th'); th.innerText = table.querySelectorAll('thead th')[i].innerText; th.style.border = '1px solid black'; th.style.padding = '6px'; trh.appendChild(th); }); thead.appendChild(trh); newTable.appendChild(thead); // BODY let tbody = document.createElement('tbody'); rows.forEach(r => { let tr = document.createElement('tr'); cols.forEach(i => { let td = document.createElement('td'); td.innerText = r.children[i].innerText; td.style.border = '1px solid black'; td.style.padding = '6px'; tr.appendChild(td); }); tbody.appendChild(tr); }); newTable.appendChild(tbody); let orientation = cols.length > 8 ? 'landscape' : 'portrait'; let win = window.open('', '', 'width=900,height=600'); win.document.close(); win.print(); } //For employee account detail search document.addEventListener('DOMContentLoaded', function() { const searchInput = document.getElementById('searchInput'); const table = document.getElementById('salaryTable'); const salaryTable = document.getElementById('salaryTable') const rows = table.querySelectorAll('tbody tr'); searchInput.addEventListener('input', function() { const searchTerm = this.value.toLowerCase(); rows.forEach(row => { const rowText = row.textContent.toLowerCase(); row.style.display = rowText.includes(searchTerm) ? '' : 'none'; }); }); }); document.addEventListener('DOMContentLoaded', function() { const searchInput = document.getElementById('searchInput'); const table = document.getElementById('searchbutton'); const salaryTable = document.getElementById('salaryTable') const rows = table.querySelectorAll('tbody tr'); searchInput.addEventListener('input', function() { const searchTerm = this.value.toLowerCase(); rows.forEach(row => { const rowText = row.textContent.toLowerCase(); row.style.display = rowText.includes(searchTerm) ? '' : 'none'; }); }); }); `); win.document.close(); win.print(); } //For Excel Export for employee detail function exportSelectedToExcel() { let cols = Array.from( document.querySelectorAll('#printModal input:checked') ).map(cb => parseInt(cb.value)); if (cols.length === 0) { alert('Select at least one column'); return; } cols.sort((a, b) => a - b); let table = document.getElementById('table1'); let rows = table.querySelectorAll('tbody tr'); let csvContent = ''; // HEADER let headers = cols.map(i => `"${table.querySelectorAll('thead th')[i].innerText}"`); csvContent += headers.join(',') + '\n'; // BODY rows.forEach(r => { let rowData = cols.map(i => `"${r.children[i].innerText}"`); csvContent += rowData.join(',') + '\n'; }); let blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' }); let url = URL.createObjectURL(blob); let a = document.createElement('a'); a.href = url; a.download = 'employee_data.csv'; document.body.appendChild(a); a.click(); document.body.removeChild(a); } //For Excel Export for Account detail function exportToExcel() { let cols = Array.from( document.querySelectorAll('#printModal input:checked') ).map(cb => parseInt(cb.value)); if (cols.length === 0) { alert('Select at least one column'); return; } cols.sort((a, b) => a - b); let table = document.getElementById('salaryTable'); let rows = table.querySelectorAll('tbody tr'); let csvContent = ''; // HEADER let headers = cols.map(i => '"' + table.querySelectorAll('thead th')[i].innerText + '"'); csvContent += headers.join(',') + '\n'; // BODY rows.forEach(r => { let rowData = cols.map(i => '"' + r.children[i].innerText + '"'); csvContent += rowData.join(',') + '\n'; }); let blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' }); let url = URL.createObjectURL(blob); let a = document.createElement('a'); a.href = url; a.download = 'employee_data.csv'; document.body.appendChild(a); a.click(); document.body.removeChild(a); } //Select all document.addEventListener('DOMContentLoaded', function () { const selectAll = document.getElementById('selectAllCols'); const checkboxes = document.querySelectorAll('#printModal .col-check'); if (!selectAll) return; // Select / Deselect all selectAll.addEventListener('change', function () { checkboxes.forEach(cb => cb.checked = this.checked); }); // If any checkbox is unchecked → uncheck Select All checkboxes.forEach(cb => { cb.addEventListener('change', function () { selectAll.checked = [...checkboxes].every(c => c.checked); }); }); }); //for Employee detail Searh filter document.addEventListener('DOMContentLoaded', function() { const searchInput = document.getElementById('searchInput'); const table = document.getElementById('table1'); const salaryTable = document.getElementById('salaryTable') const rows = table.querySelectorAll('tbody tr'); searchInput.addEventListener('input', function() { const searchTerm = this.value.toLowerCase(); rows.forEach(row => { const rowText = row.textContent.toLowerCase(); row.style.display = rowText.includes(searchTerm) ? '' : 'none'; }); }); }); // Print Functionality for Employee Salary function printSalary() { let cols = Array.from( document.querySelectorAll('#printModal input:checked') ).map(cb => parseInt(cb.value)); if (cols.length === 0) { alert('Select at least one column'); return; } cols.sort((a, b) => a - b); let table = document.getElementById('salaryTable'); let rows = table.querySelectorAll('tbody tr'); let newTable = document.createElement('table'); newTable.style.width = '100%'; newTable.style.borderCollapse = 'collapse'; // HEADER let thead = document.createElement('thead'); let trh = document.createElement('tr'); cols.forEach(i => { let th = document.createElement('th'); th.innerText = table.querySelectorAll('thead th')[i].innerText; th.style.border = '1px solid black'; th.style.padding = '6px'; trh.appendChild(th); }); thead.appendChild(trh); newTable.appendChild(thead); // BODY let tbody = document.createElement('tbody'); rows.forEach(r => { let tr = document.createElement('tr'); cols.forEach(i => { let td = document.createElement('td'); td.innerText = r.children[i].innerText; td.style.border = '1px solid black'; td.style.padding = '6px'; tr.appendChild(td); }); tbody.appendChild(tr); }); newTable.appendChild(tbody); let orientation = cols.length > 8 ? 'landscape' : 'portrait'; let win = window.open('', '', 'width=900,height=600'); win.document.close(); win.print(); } //For employee account detail search document.addEventListener('DOMContentLoaded', function() { const searchInput = document.getElementById('searchInput'); const table = document.getElementById('salaryTable'); const salaryTable = document.getElementById('salaryTable') const rows = table.querySelectorAll('tbody tr'); searchInput.addEventListener('input', function() { const searchTerm = this.value.toLowerCase(); rows.forEach(row => { const rowText = row.textContent.toLowerCase(); row.style.display = rowText.includes(searchTerm) ? '' : 'none'; }); }); }); document.addEventListener('DOMContentLoaded', function() { const searchInput = document.getElementById('searchInput'); const table = document.getElementById('searchbutton'); const salaryTable = document.getElementById('salaryTable') const rows = table.querySelectorAll('tbody tr'); searchInput.addEventListener('input', function() { const searchTerm = this.value.toLowerCase(); rows.forEach(row => { const rowText = row.textContent.toLowerCase(); row.style.display = rowText.includes(searchTerm) ? '' : 'none'; }); }); });