FIX_salesTracker8

This commit is contained in:
sanjeev.p 2026-02-27 15:38:58 +05:30
parent 3cdd73a7ee
commit 9b154ee3a1
6 changed files with 32 additions and 11 deletions

View File

@ -60,8 +60,8 @@ class SalesController extends BaseController
public function loadtargets(){
$data = $this->getSalesStaffData();
$data['tab_name'] = 'Team Target';
$data['page_name'] = 'Team Target';
$data['tab_name'] = 'Sales Team Targets';
$data['page_name'] = 'Sales Team Targets';
return $this->loadLayout('sales/target_view', $data);
}

View File

@ -245,7 +245,7 @@
<img src="<?= base_url() . "public"; ?>/assets/images/active_leads_and_bds_renewal.png" alt="Logo" height="14"
class="active_leads " style="display:none;">
&nbsp;&nbsp;
<span class="d-none d-sm-inline-block dash-tab dash-tab-font">Leads and BDS Renewals</span>
<span class="d-none d-sm-inline-block dash-tab dash-tab-font">Opportunities and BDS Renewals</span>
</a>
</li>
&nbsp;&nbsp;&nbsp;&nbsp;

View File

@ -2106,7 +2106,7 @@
</li> -->
<?php if (in_array(get_role_id(), [1, 5])){ ?>
<li>
<a href="<?= base_url('sales/loadtargets') ?>"><i class="ri-group-2-fill"></i> Team Targets </a>
<a href="<?= base_url('sales/loadtargets') ?>"><i class="ri-group-2-fill"></i>Sales Team Targets </a>
</li>
<?php } ?>
</ul>

View File

@ -347,7 +347,7 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID, user_
if (type == 1 && leadType != null && leadType == 1) {
$('.leadStatusTitle_1').show();
$('#main_tile').text(" Leads");
$('#main_tile').text("Opportunities");
}
if (type == 1 && leadType != null && leadType == 2) {

View File

@ -248,14 +248,14 @@
<div class="card" style="grid-column: 1 / -1; width: 100%; box-sizing: border-box;">
<div class="table-header">
<h3 style="font-size: 16px; font-weight: 700;">All Leads Overview <?php echo !empty($leads_overview) ? "<i>(".count($leads_overview).")</i>" : ""; ?></h3>
<!-- <span style="color: #718096; font-size: 12px; font-weight: 600;">Click a lead to see details</span> -->
<h3 style="font-size: 16px; font-weight: 700;">All Leads Overview </h3>
<!-- <span style="color: #718096; font-size: 12px; font-weight: 600;">Click a lead to see details</span>
<a href="<?= base_url('sales') ?>"
style="color: #718096; font-size: 12px; font-weight: 600; text-decoration: none; padding: 4px 8px; transition: color 0.2s ease; display: inline-block; cursor: pointer;"
onmouseover="this.style.color='#ff6b35';"
onmouseout="this.style.color='#718096';">
Click a lead to see details
</a>
</a> -->
</div>
<table>
<thead>

View File

@ -225,6 +225,14 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-
grid-template-columns: 1fr; /* stack vertically on mobile */
}
}
@keyframes fadeHighlight {
0% { background-color: #fffbcc; }
100% { background-color: transparent; }
}
.row-highlight {
animation: fadeHighlight 2s ease forwards;
}
</style>
<div class="main-content">
@ -240,7 +248,7 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-
<table class="tt-main-table">
<thead>
<tr>
<th>Person</th>
<th>Sales Manager</th>
<th>Action</th>
</tr>
</thead>
@ -448,7 +456,13 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-
tbody.innerHTML = '<tr class="empty-row"><td colspan="3">No targets added yet.</td></tr>';
return;
}
records.sort((a, b) => b.id - a.id);
// records.sort((a, b) => b.id - a.id);
records.sort((a, b) => {
let startYearA = parseInt(a.fy_year.split('-')[0], 10);
let startYearB = parseInt(b.fy_year.split('-')[0], 10);
return startYearB - startYearA;
});
tbody.innerHTML = records.map(r => `
<tr id="row_${r.id}">
<td>${r.fy_year}</td>
@ -522,7 +536,14 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-
document.getElementById('recordId').value = '';
document.getElementById('targetAmount').value = '';
populateFY();
renderDetailTable(userId);
await renderDetailTable(userId);
const savedId = result.data?.id || recordId;
const targetRow = document.getElementById(`row_${savedId}`);
if (targetRow) {
targetRow.scrollIntoView({ behavior: 'smooth', block: 'center' });
targetRow.classList.add('row-highlight');
setTimeout(() => targetRow.classList.remove('row-highlight'), 3000);
}
} else {
toastr.error(result.message || 'Failed to save target.');
}