diff --git a/app/Controllers/SalesController.php b/app/Controllers/SalesController.php
index 4e139caa..362a695b 100644
--- a/app/Controllers/SalesController.php
+++ b/app/Controllers/SalesController.php
@@ -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);
}
@@ -78,7 +78,8 @@ class SalesController extends BaseController
$data = [
'users' => [],
- 'sales_manager_ids' => []
+ 'sales_manager_ids' => [],
+ 'sales_role' => ''
];
$row = $db->table('user_profiles')->select('*')
@@ -89,6 +90,7 @@ class SalesController extends BaseController
// Is the logged-in user a Sales Manager? (Role 4, Team 5)
if ($role == 4 && in_array(5, $team_id)) {
+ $data['sales_role'] = "Sales Manager";
$data['sales_manager_ids'] = [$logged_user_id];
$data['users'] = [
@@ -102,7 +104,7 @@ class SalesController extends BaseController
}
// Otherwise fetch ALL sales managers in this branch
elseif (in_array($role,[1,5])) {
-
+ $data['sales_role'] = "Sales Head";
$data['users'] = $db->table('user_profiles up')
->select('up.id, up.first_name, up.last_name, up.nhance_branch_id')
->join('user_teams ut', 'ut.user_id = up.id')
diff --git a/app/Models/SalesActivityModel.php b/app/Models/SalesActivityModel.php
index 8d82097f..c27f526f 100644
--- a/app/Models/SalesActivityModel.php
+++ b/app/Models/SalesActivityModel.php
@@ -38,7 +38,7 @@ class SalesActivityModel extends Model
// Validation
protected $validationRules = [
'lead_id' => 'required|integer',
- 'activity_type' => 'required|in_list[Call,Email,Meeting,Demo,Share,Todo,Visit]',
+ 'activity_type' => 'required|in_list[Call,Email,Meeting,Visit,Demo,Share Docs,To Do]',
'notes' => 'required',
'scheduled_date' => 'required',
'assigned_to' => 'required|integer',
diff --git a/app/Views/DashBoard.php b/app/Views/DashBoard.php
index e71d67ff..0eff67a2 100755
--- a/app/Views/DashBoard.php
+++ b/app/Views/DashBoard.php
@@ -245,7 +245,7 @@
/assets/images/active_leads_and_bds_renewal.png" alt="Logo" height="14"
class="active_leads " style="display:none;">
- Leads and BDS Renewals
+ Opportunities and BDS Renewals
diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php
index 224a7bd8..365caf67 100755
--- a/app/Views/layout/header.php
+++ b/app/Views/layout/header.php
@@ -2106,7 +2106,7 @@
-->
- Team Targets
+ Sales Team Targets
diff --git a/app/Views/leads_dash.php b/app/Views/leads_dash.php
index 0833c740..7fb07fb6 100644
--- a/app/Views/leads_dash.php
+++ b/app/Views/leads_dash.php
@@ -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) {
diff --git a/app/Views/sales/activity_view.php b/app/Views/sales/activity_view.php
index 0f82bc8f..3edb0181 100644
--- a/app/Views/sales/activity_view.php
+++ b/app/Views/sales/activity_view.php
@@ -256,8 +256,8 @@
-
-
+
+
@@ -326,8 +326,8 @@
-
-
+
+
@@ -429,7 +429,15 @@ function resetFlatpicker(){
});
}
-const activityIcons = { Call: "📞", Email: "✉️", Meeting: "📅", Visit: "🚗",Demo: "🖥️", Share: "📄", Todo: "✓" };
+const activityIcons = {
+ "Call": "📞",
+ "Email": "✉️",
+ "Meeting": "📅",
+ "Visit": "🚗",
+ "Demo": "🖥️",
+ "Share Docs": "📄",
+ "To Do": "✓"
+};
const salesManagerIds = = json_encode($sales_manager_ids ?? []) ?>;
const API = '= base_url('sales') ?>';
@@ -441,6 +449,7 @@ let selectedFollowUpActivityType = '';
let currentPage = 1;
let limit = 10;
let currentOffset = 0;
+const department = '= $sales_role ?>';
function openModal(id) { document.getElementById(id).classList.add('active'); resetFlatpicker(); }
diff --git a/app/Views/sales/branch_level_dashboard_view.php b/app/Views/sales/branch_level_dashboard_view.php
index fe1f6dba..efc8d3cb 100644
--- a/app/Views/sales/branch_level_dashboard_view.php
+++ b/app/Views/sales/branch_level_dashboard_view.php
@@ -135,8 +135,8 @@
'Meeting' => '📅',
'Visit' => '🚗',
'Demo' => '🖥️',
- 'Share' => '📄',
- 'Todo' => '✓'
+ 'Share Docs' => '📄',
+ 'To Do' => '✓'
];
$icon = $activityIcons[$a['activity_type']] ?? '📌';
$statusClass = strtolower(str_replace(' ', '-', $a['status']));
@@ -217,8 +217,8 @@
'Meeting' => ['color' => '#4299e1', 'icon' => '📅'],
'Visit' => ['color' => '#ecc94b', 'icon' => '🚗'],
'Demo' => ['color' => '#9f7aea', 'icon' => '🖥️'],
- 'Share' => ['color' => '#ed8936', 'icon' => '📄'],
- 'Todo' => ['color' => '#718096', 'icon' => '✓'],
+ 'Share Docs' => ['color' => '#ed8936', 'icon' => '📄'],
+ 'To Do' => ['color' => '#718096', 'icon' => '✓'],
];
?>
@@ -248,14 +248,14 @@
diff --git a/app/Views/sales/sales_manager_level_dashboard.php b/app/Views/sales/sales_manager_level_dashboard.php
index cfca7b7b..56891fb3 100644
--- a/app/Views/sales/sales_manager_level_dashboard.php
+++ b/app/Views/sales/sales_manager_level_dashboard.php
@@ -134,7 +134,7 @@
-->
'📞', 'Email' => '✉️', 'Meeting' => '📅', 'Visit' => '🚗', 'Demo' => '🖥️', 'Share' => '📄', 'Todo' => '✓' ];
+ $activityIcons = [ 'Call' => '📞', 'Email' => '✉️', 'Meeting' => '📅', 'Visit' => '🚗', 'Demo' => '🖥️', 'Share Docs' => '📄', 'To Do' => '✓' ];
$icon = $activityIcons[$u['activity_type']] ?? '📌';
$formattedscheduledDate = date('M d, Y, h:i A', strtotime($u['scheduled_date']));
?>
diff --git a/app/Views/sales/target_view.php b/app/Views/sales/target_view.php
index a500a2ba..3c6c79b3 100644
--- a/app/Views/sales/target_view.php
+++ b/app/Views/sales/target_view.php
@@ -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;
+}
@@ -240,7 +248,7 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-
- | Person |
+ Sales Manager |
Action |
@@ -448,7 +456,13 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-
tbody.innerHTML = '| No targets added yet. |
';
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 => `
| ${r.fy_year} |
@@ -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.');
}
diff --git a/app/Views/sales/tracker_view.php b/app/Views/sales/tracker_view.php
index 7e8c4a92..d25a725e 100644
--- a/app/Views/sales/tracker_view.php
+++ b/app/Views/sales/tracker_view.php
@@ -285,8 +285,8 @@
-
-
+
+
@@ -354,8 +354,8 @@
-
-
+
+
@@ -936,7 +936,15 @@ function renderCard(opps) {
}
function renderTimeline(acts) {
const cont = document.getElementById('timelineContainer');
- const activityIcons = { Call: "📞", Email: "✉️", Meeting: "📅", Visit: "🚗",Demo: "🖥️", Share: "📄", Todo: "✓" };
+ const activityIcons = {
+ "Call": "📞",
+ "Email": "✉️",
+ "Meeting": "📅",
+ "Visit": "🚗",
+ "Demo": "🖥️",
+ "Share Docs": "📄",
+ "To Do": "✓"
+};
if (acts.length === 0) {
cont.classList.add('no-line');