minor changes in order and dashboard, records

This commit is contained in:
divya abdar
2025-12-19 16:15:18 +05:30
parent 7ef28e06ae
commit 48f7ab82ff
6 changed files with 113 additions and 45 deletions

View File

@@ -912,10 +912,6 @@
</label>
<select class="filter-control" id="companyFilter">
<option value="" selected>All Companies</option>
<option value="ABC Corporation">ABC Corporation</option>
<option value="XYZ Enterprises">XYZ Enterprises</option>
<option value="Global Traders">Global Traders</option>
<option value="Tech Solutions Ltd">Tech Solutions Ltd</option>
</select>
</div>
<div class="filter-group">
@@ -1101,6 +1097,7 @@
document.addEventListener('DOMContentLoaded', function() {
// Initialize statistics and pagination
populateCompanyFilter(allReports);
updateStatistics();
renderTable();
updatePaginationControls();
@@ -1403,5 +1400,33 @@
// Initial filter application
filterTable();
});
function populateCompanyFilter(reports) {
const companySelect = document.getElementById('companyFilter');
if (!companySelect) return;
// Collect unique company names
const companies = new Set();
reports.forEach(r => {
if (r.company_name && r.company_name.trim() !== '') {
companies.add(r.company_name.trim());
}
});
// Sort alphabetically
const sortedCompanies = Array.from(companies).sort();
// Remove existing options except "All Companies"
companySelect.innerHTML = '<option value="">All Companies</option>';
// Append options
sortedCompanies.forEach(company => {
const option = document.createElement('option');
option.value = company;
option.textContent = company;
companySelect.appendChild(option);
});
}
</script>
@endsection