minor changes in order and dashboard, records
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user