diff --git a/app/Config/Routes.php b/app/Config/Routes.php index d9a05733..6e7b375a 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -914,6 +914,8 @@ $routes->group('sales', function($routes) { $routes->get('/', 'SalesController::index'); $routes->get('loadactivities', 'SalesController::loadactivities'); + + $routes->get('loadtargets', 'SalesController::loadtargets'); $routes->get('page/(:segment)', 'SalesController::noPage/$1'); diff --git a/app/Controllers/SalesController.php b/app/Controllers/SalesController.php index 3d2363ee..dccd9d91 100644 --- a/app/Controllers/SalesController.php +++ b/app/Controllers/SalesController.php @@ -53,6 +53,15 @@ class SalesController extends BaseController return $this->loadLayout('sales/activity_view', $data); } + public function loadtargets(){ + $data = $this->getSalesStaffData(); + + $data['tab_name'] = 'Team Target'; + $data['page_name'] = 'Team Target'; + + return $this->loadLayout('sales/target_view', $data); + } + /** * HELPER: Fetches Sales Managers based on the logged-in user's role and branch */ diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index b7271a2c..224a7bd8 100755 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -2104,6 +2104,11 @@ + +
  • + Team Targets +
  • + diff --git a/app/Views/sales/tracker_view.php b/app/Views/sales/tracker_view.php index d3ccc2ea..98936f85 100644 --- a/app/Views/sales/tracker_view.php +++ b/app/Views/sales/tracker_view.php @@ -1592,7 +1592,7 @@ if (btnSaveContact) { // Use .value instead of .val() let name = document.getElementById('contact_name').value.trim(); let mobile = document.getElementById('contact_mobile').value.trim(); - let lead_id = document.getElementById('lead_id').value.trim(); + let lead_id = document.getElementById('hidden_lead_id').value.trim(); if (!name || !mobile) { return toastr.warning('Please enter both contact person name and mobile number.');