bug fixes, daily reports, holidays
This commit is contained in:
@@ -270,6 +270,7 @@ $(document).ready(function() {
|
||||
window.location.href = base_url + "/clients/export?" + queryParams;
|
||||
});
|
||||
|
||||
// Render Table Rows
|
||||
// Render Table Rows
|
||||
function renderTable(clients) {
|
||||
let html = '';
|
||||
@@ -310,13 +311,22 @@ $(document).ready(function() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Extract Account Manager name safely
|
||||
let amName = 'Unassigned';
|
||||
if (client.account_manager && client.account_manager.name) {
|
||||
amName = client.account_manager.name;
|
||||
}
|
||||
|
||||
// CONDITIONAL EDIT BUTTON LOGIC
|
||||
let editButtonHtml = '';
|
||||
if (typeof currentUserId !== 'undefined' && client.auth_user_id == currentUserId) {
|
||||
editButtonHtml = `
|
||||
<button class="btn btn-sm btn-light text-primary btn-edit-client" data-id="${client.id}" title="Edit Client">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
|
||||
html += `
|
||||
<tr>
|
||||
<td>
|
||||
@@ -329,13 +339,13 @@ $(document).ready(function() {
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="fw-semibold">${client.contact_person || 'N/A'}</div>
|
||||
<div class="fw-semibold">${client.contact_person || 'N/A'}</div>
|
||||
<div class="text-secondary" style="font-size: 0.8rem;">${client.email || 'N/A'}</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="text-dark fw-medium" style="font-size: 0.85rem;">
|
||||
<i class="bi bi-person-badge text-secondary me-1"></i>${amName}
|
||||
</span>
|
||||
</td>
|
||||
<div class="text-secondary" style="font-size: 0.8rem;">${client.email || 'N/A'}</div>
|
||||
</td>
|
||||
<td style="max-width: 200px; white-space: normal;">
|
||||
${servicesHtml}
|
||||
@@ -348,9 +358,7 @@ $(document).ready(function() {
|
||||
<button class="btn btn-sm btn-light text-primary me-1 btn-view-client" data-id="${client.id}" title="View Details">
|
||||
<i class="bi bi-eye"></i>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-light text-primary btn-edit-client" data-id="${client.id}" title="Edit Client">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</button>
|
||||
${editButtonHtml}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -412,5 +420,5 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
// Call loadCountries on page load so it's ready for the create modal
|
||||
loadCountries();
|
||||
loadCountries();
|
||||
});
|
||||
Reference in New Issue
Block a user