From 65b405d3e4f5d939749140baafe94facf44b665b Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Sat, 17 May 2025 12:33:20 +0530 Subject: [PATCH] FIX_ADD_CLIENT --- app/Controllers/LeadsController.php | 9 ++++- app/Views/leads_form_handler.php | 28 +++++++------- app/Views/newClientModal.php | 58 ++++++++++++++++++++++++++--- 3 files changed, 74 insertions(+), 21 deletions(-) diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php index 944ab17e..77a6ba81 100644 --- a/app/Controllers/LeadsController.php +++ b/app/Controllers/LeadsController.php @@ -681,7 +681,9 @@ class LeadsController extends BaseController if ($lead_data['lead_type'] != 1) { $client_policy_data = $this->clientPolicyModel->where('is_active', 1)->where('id', $lead_data['source_policy_id'])->first(); - $data['policy_terms'] = $client_policy_data['policy_terms']; + if (isset($client_policy_data)) { + $data['policy_terms'] = $client_policy_data['policy_terms']; + } } $data['question_json'] = $lead_data['question_json']; @@ -740,7 +742,10 @@ class LeadsController extends BaseController if ($lead_data['lead_type'] != 1 && $data['rfq_count'] == 0) { $client_policy_data = $this->clientPolicyModel->where('is_active', 1)->where('id', $lead_data['source_policy_id'])->first(); - $data['rfq_data']['json'] = $client_policy_data['placement_json']; + if (isset($client_policy_data)) { + + $data['rfq_data']['json'] = $client_policy_data['placement_json']; + } } if (!empty($data['question_json'])) { diff --git a/app/Views/leads_form_handler.php b/app/Views/leads_form_handler.php index 023dc0d3..7d9a6006 100644 --- a/app/Views/leads_form_handler.php +++ b/app/Views/leads_form_handler.php @@ -338,24 +338,24 @@ if (isset($selected_lead_type)) { $('#salse_person_id').trigger('change'); } - function validateInput(input, table, field){ + // function validateInput(input, table, field){ - let value = $(input).val(); - let label = $(input).closest('.form-group').find('label').text().replace('*', '').trim(); + // let value = $(input).val(); + // let label = $(input).closest('.form-group').find('label').text().replace('*', '').trim(); - let message = "Value is duplicate!"; - if(label){ - message = label + " already exists!"; - } + // let message = "Value is duplicate!"; + // if(label){ + // message = label + " already exists!"; + // } - checkDuplicateTableFieldValue(table, field, value, function(isDuplicate) { - if (isDuplicate) { - toastr.warning(message, 'WARNING'); - $(input).val('') - } - }); + // checkDuplicateTableFieldValue(table, field, value, function(isDuplicate) { + // if (isDuplicate) { + // toastr.warning(message, 'WARNING'); + // $(input).val('') + // } + // }); - } + // } // -------------------------------------------------------------------------------------------------------- diff --git a/app/Views/newClientModal.php b/app/Views/newClientModal.php index 9f75a734..c4285aac 100644 --- a/app/Views/newClientModal.php +++ b/app/Views/newClientModal.php @@ -22,7 +22,7 @@
- +
@@ -39,7 +39,7 @@
+ onkeypress="return onlyNumbers(event)" onchange="validateInputForClient(this, 'clients', 'phone')">
@@ -48,7 +48,7 @@
- +
@@ -96,7 +96,7 @@
-
@@ -113,8 +113,52 @@