FIX_salesTracker8
This commit is contained in:
parent
3cdd73a7ee
commit
9b154ee3a1
@ -60,8 +60,8 @@ class SalesController extends BaseController
|
|||||||
public function loadtargets(){
|
public function loadtargets(){
|
||||||
$data = $this->getSalesStaffData();
|
$data = $this->getSalesStaffData();
|
||||||
|
|
||||||
$data['tab_name'] = 'Team Target';
|
$data['tab_name'] = 'Sales Team Targets';
|
||||||
$data['page_name'] = 'Team Target';
|
$data['page_name'] = 'Sales Team Targets';
|
||||||
|
|
||||||
return $this->loadLayout('sales/target_view', $data);
|
return $this->loadLayout('sales/target_view', $data);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -245,7 +245,7 @@
|
|||||||
<img src="<?= base_url() . "public"; ?>/assets/images/active_leads_and_bds_renewal.png" alt="Logo" height="14"
|
<img src="<?= base_url() . "public"; ?>/assets/images/active_leads_and_bds_renewal.png" alt="Logo" height="14"
|
||||||
class="active_leads " style="display:none;">
|
class="active_leads " style="display:none;">
|
||||||
|
|
||||||
<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>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@ -2106,7 +2106,7 @@
|
|||||||
</li> -->
|
</li> -->
|
||||||
<?php if (in_array(get_role_id(), [1, 5])){ ?>
|
<?php if (in_array(get_role_id(), [1, 5])){ ?>
|
||||||
<li>
|
<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>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@ -347,7 +347,7 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID, user_
|
|||||||
|
|
||||||
if (type == 1 && leadType != null && leadType == 1) {
|
if (type == 1 && leadType != null && leadType == 1) {
|
||||||
$('.leadStatusTitle_1').show();
|
$('.leadStatusTitle_1').show();
|
||||||
$('#main_tile').text(" Leads");
|
$('#main_tile').text("Opportunities");
|
||||||
|
|
||||||
}
|
}
|
||||||
if (type == 1 && leadType != null && leadType == 2) {
|
if (type == 1 && leadType != null && leadType == 2) {
|
||||||
|
|||||||
@ -248,14 +248,14 @@
|
|||||||
|
|
||||||
<div class="card" style="grid-column: 1 / -1; width: 100%; box-sizing: border-box;">
|
<div class="card" style="grid-column: 1 / -1; width: 100%; box-sizing: border-box;">
|
||||||
<div class="table-header">
|
<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>
|
<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> -->
|
<!-- <span style="color: #718096; font-size: 12px; font-weight: 600;">Click a lead to see details</span>
|
||||||
<a href="<?= base_url('sales') ?>"
|
<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;"
|
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';"
|
onmouseover="this.style.color='#ff6b35';"
|
||||||
onmouseout="this.style.color='#718096';">
|
onmouseout="this.style.color='#718096';">
|
||||||
Click a lead to see details
|
Click a lead to see details
|
||||||
</a>
|
</a> -->
|
||||||
</div>
|
</div>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@ -225,6 +225,14 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-
|
|||||||
grid-template-columns: 1fr; /* stack vertically on mobile */
|
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>
|
</style>
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
@ -240,7 +248,7 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-
|
|||||||
<table class="tt-main-table">
|
<table class="tt-main-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Person</th>
|
<th>Sales Manager</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</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>';
|
tbody.innerHTML = '<tr class="empty-row"><td colspan="3">No targets added yet.</td></tr>';
|
||||||
return;
|
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 => `
|
tbody.innerHTML = records.map(r => `
|
||||||
<tr id="row_${r.id}">
|
<tr id="row_${r.id}">
|
||||||
<td>${r.fy_year}</td>
|
<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('recordId').value = '';
|
||||||
document.getElementById('targetAmount').value = '';
|
document.getElementById('targetAmount').value = '';
|
||||||
populateFY();
|
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 {
|
} else {
|
||||||
toastr.error(result.message || 'Failed to save target.');
|
toastr.error(result.message || 'Failed to save target.');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user