diff --git a/app/Config/Routes.php b/app/Config/Routes.php
index 0670bca5..9c1b388e 100755
--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -357,6 +357,7 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
$routes->get('getLeadNonEB/(:any)', 'LeadsController::getLeadNonEB/$1');
$routes->get('getPolicyTypeFields', 'LeadsController::getPolicyTypeFields');
$routes->get('removeMultiFile', 'LeadsController::removeMultiFile');
+ $routes->get('removeInstallments', 'LeadsController::removeInstallments');
});
$routes->group("policy_tranction", ["filter" => "authMVC"], function ($routes) {
diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php
index 5fa86502..39440f05 100755
--- a/app/Controllers/ClientController.php
+++ b/app/Controllers/ClientController.php
@@ -4604,9 +4604,10 @@ class ClientController extends AdminController
// $employeeRestController->employeesEnrollmentInsert(['file_id' => 836]);
// $r = Jobs::addJob(['job_name' => 'employeesEnrollmentInsert','payload' => ['file_id' => 721]]);
$empServiceController = new EmployeeServiceController();
- // $res = $empServiceController->excelFileFormatValidation(['file_id' => '873']);
- // $res = $empServiceController->excelFileDataValidation(['file_id' => '874']);
+ // $res = $empServiceController->excelFileFormatValidation(['file_id' => '865']);
+ // $res = $empServiceController->excelFileDataValidation(['file_id' => '865']);
// $res = $empServiceController->employeesSIEnhanceProcess(['file_id' => '829']);
+ // $res = $empServiceController->employeeDisembark(['file_id' => '858']);
// dd('-----', $res);
diff --git a/app/Controllers/EmpDataServiceController.php b/app/Controllers/EmpDataServiceController.php
index d13676aa..19d57a7d 100755
--- a/app/Controllers/EmpDataServiceController.php
+++ b/app/Controllers/EmpDataServiceController.php
@@ -949,6 +949,9 @@ class EmpDataServiceController extends BaseController
$export_data['event_type'] = 'correction';
$correctionData = $this->employeePolicyModel->getCorrectionEmployeesDataForExportExcel($export_data);
+ }else if($value == "missed_inception"){
+ $export_data['event_type'] = 'missed_inception';
+ $additionData = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($export_data);
}
}
diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php
index de473c0a..a11921fb 100755
--- a/app/Controllers/EmployeeController.php
+++ b/app/Controllers/EmployeeController.php
@@ -190,7 +190,7 @@ class EmployeeController extends AdminController
// print_r($this->request->getPost('upload-action-type'));
// die();
// $empServiceController = new EmployeeServiceController();
- // $res = $empServiceController->excelFileFormatValidation(['file_id' => '42']);
+ // $res = $empServiceController->excelFileDataValidation(['file_id' => '933']);
// dd($res);
// $empServiceController = new EmployeeServiceController();
diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php
index 035fbd37..31c2ff0f 100755
--- a/app/Controllers/EmployeeServiceController.php
+++ b/app/Controllers/EmployeeServiceController.php
@@ -728,6 +728,7 @@ class EmployeeServiceController extends AdminController
$allowedHighestColumn = end($columns_to_check);
// dd($allowedHighestColumn);
$excel_data = $sheet->rangeToArray('A1:' . $allowedHighestColumn['col_cell_name'] . $highestRowAndColumn['row']);
+ $excel_data = ExcelSanitizeHelper::sanitizeArrayData($excel_data);
// !dd(array_chunk($excel_data,20)[0]);
//check no of columns in excel
@@ -997,7 +998,7 @@ class EmployeeServiceController extends AdminController
$allowedHighestColumn = end($columns_to_check);
$excel_data = $sheet->rangeToArray('A1:' . $allowedHighestColumn['col_cell_name'] . $highestRowAndColumn['row']);
- // print_r($keys);die();
+ $excel_data = ExcelSanitizeHelper::sanitizeArrayData($excel_data);
//remove header
unset($excel_data[0]);
@@ -1035,6 +1036,14 @@ class EmployeeServiceController extends AdminController
// kint::dump($family);
$family = data_group_by_family($family)[ $emp_id ];// reason to call this again bring self to first index of the array
}
+ $firstNonTemp = null;
+
+ foreach ($family as $fam) {
+ if (!isset($fam['temp'])) {
+ $firstNonTemp = $fam;
+ break;
+ }
+ }
// kint::dump($family);//die();
//check name dup within a family
@@ -1070,7 +1079,7 @@ class EmployeeServiceController extends AdminController
if(!count($self_details))
{
array_push($result['error_summary'],14); // Self not found
- $result['error_data'][ $family[0][0] ]['sno']['error'][] = "Self not found in Database";
+ $result['error_data'][ $firstNonTemp[0] ]['sno']['error'][] = "Self not found in Database";
}
}
@@ -1078,7 +1087,7 @@ class EmployeeServiceController extends AdminController
if($file['action'] == 'dependent_addition' || $file['action'] == 'addition' || $file['action'] == 'inception'|| $file['action'] == 'missed_inception' || $file['action'] == 'enrollment')
{
$res = check_dependent_conflict($family,$policy_terms,$file['action'],$is_lgbtq);
- // dd($res);
+ // Kint::dump($res);
if(!$res['status'])
{
foreach($res['error_data'] as $key => $value)
@@ -1091,7 +1100,7 @@ class EmployeeServiceController extends AdminController
//check dup with empid and name with db
$res = name_and_empid_check_in_db($family,$file);
- // dd($res);
+ // Kint::dump($res['del']);
// echo '
';
// print_r($res);
if(count($res['del']))
@@ -1113,7 +1122,7 @@ class EmployeeServiceController extends AdminController
}// end of foreach
}// end of if current action I,DA,A
- // return $result;
+ // return $result;
// die();
if(isset($result['error_summary']) && count($result['error_summary']))
{
@@ -1359,7 +1368,15 @@ class EmployeeServiceController extends AdminController
break;
}
// echo '
START- ' . $row[2];
- $employee = $this->employeeModel->where('emp_code', $row[1])->where('name',$row[2])->where('client_id',$file['client_id'])->where('client_branch_id',$file['client_branch_id'])->first();
+
+ $employee = $this->employeeModel
+ ->where('emp_code', $row[1])
+ ->where('name',$row[2])
+ ->where('client_id',$file['client_id'])
+ ->where('client_branch_id',$file['client_branch_id'])
+ ->where('emp_status !=','truncated')
+ ->where('is_active', 1)
+ ->first();
// $employee = $this->employeeModel->where('emp_code', $row[1])->where('name',$row[2])->where('client_id',$file['client_id'])->first();
// dd($employee);
if(is_array($employee) && count($employee))
@@ -1372,6 +1389,7 @@ class EmployeeServiceController extends AdminController
->where('name',$employee['name'])
->where('field_name','emp_status')
->where('status !=','truncated')
+ ->where('is_active', 1)
->findAll();
// dd($existing_endorsements);
diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php
index 79ca3591..b001edf1 100644
--- a/app/Controllers/LeadsController.php
+++ b/app/Controllers/LeadsController.php
@@ -30,6 +30,7 @@ use App\Models\RFQModel;
use App\Models\InsurerModel;
use App\Models\OccupancyMasterModel;
use App\Models\LeadFilesModel;
+use App\Models\LeadInstallmentPaymentDetails;
use App\Helpers\MailHelper;
use App\Helpers\ExcelMergeHelper;
@@ -65,6 +66,7 @@ class LeadsController extends BaseController
protected $insurerModel;
protected $occupancyModel;
protected $leadFilesModel;
+ protected $leadInstallmentPaymentDetails;
//variables for storing array
protected $issuer;
@@ -96,20 +98,27 @@ class LeadsController extends BaseController
$this->insurerModel = new InsurerModel();
$this->occupancyModel = new OccupancyMasterModel();
$this->leadFilesModel = new LeadFilesModel();
+ $this->leadInstallmentPaymentDetails = new LeadInstallmentPaymentDetails();
$this->issuer = [1 => 'JIBS', 2 => 'Nhance'];
$this->clientType = [1 => 'Group', 2 => 'Individual'];
$this->leadType = [1 => 'Fresh', 2 => 'Renewal', 3 => 'Roll Over'];
- $this->buisnessType = [1 => 'Industrial', 2 => 'Non Industrial'];
+ $data = $this->kycEntityTypeModel->where('is_active', 1)->findAll();
+ $this->buisnessType = array_column($data, 'name', 'id');
+ // $this->buisnessType = [1 => 'Public Sector', 2 => 'Private Sector',3=> 'Trust',4 => 'Proprietorship',5 => 'Partnership',6 => 'Private',7 => 'Individual'];
$this->leadsStatus = [
- 'queued' => 'In-Queued',
- 'qcr_sent' => 'QCR sent',
- 'lost' => 'Lost',
- 'co_insurer_pending' => 'Co-Insurer Pending',
- 'won' => 'Won',
- 'completed_with_corrections' => 'Completed with Corrections',
- 'completed_without_corrections' => 'Completed w/o Corrections',
+ 'queued' => 'In-Queued',
+ 'rfq_created' => 'RFQ Created',
+ 'rfq_sent' => 'RFQ Sent',
+ 'qcr_created' => 'QCR Created',
+ 'qcr_sent' => 'QCR Sent',
+ 'lost' => 'Lost',
+ 'co_insurer_pending' => 'Co-Insurer Pending',
+ 'won' => 'Won',
+ 'completed_with_corrections' => 'Completed with Corrections',
+ 'completed_without_corrections' => 'Completed without Corrections',
];
+
$this->claim_type_for_gpa = [
'accident_death' => 'Accident Death',
'permanent_total_disablement' => 'Permanent Total Disablement',
@@ -592,12 +601,14 @@ class LeadsController extends BaseController
$this->leadFilesModel->where('id', $value['id'])->set($lead_file_data)->update();
} else {
- $lead_file_data = [
- 'lead_id' => $lead_id,
- 'docs_name' => $value['docs_name'],
- 'file_name' => $value['file_name'],
- ];
- $this->leadFilesModel->insert($lead_file_data);
+ if (!empty($value['file_name'])) {
+ $lead_file_data = [
+ 'lead_id' => $lead_id,
+ 'docs_name' => $value['docs_name'],
+ 'file_name' => $value['file_name'],
+ ];
+ $this->leadFilesModel->insert($lead_file_data);
+ }
}
if ($key == 0 && !empty($value['file_name'])) {
@@ -619,6 +630,8 @@ class LeadsController extends BaseController
return $this->respond(['status' => false, 'message' => 'File could not be removed.'], 200);
}
}
+
+
//--------RFQ-----------------------------------------------------------------------------------------------
@@ -676,7 +689,7 @@ class LeadsController extends BaseController
$data['exclusiveUserList'] = $this->userModel->getexclusiveUserListForRFQ();
$data['lead_data'] = $lead_data;
- $mail_content = "
+ $mail_content = '
Dear Sir,
Greetings From Nhance India!
Please find attached the {{RFQ_OR_QCR}} for {{POLICY_TYPE}} policy pertaining to {{CLIENT_NAME}}.
@@ -687,13 +700,11 @@ class LeadsController extends BaseController
{{LOGGED_USER_NAME}}
-
Email: {{LOGGED_USER_EMAIL}}
Mobile: {{LOGGED_USER_MOBILE}}
-
-
- ";
+
+ ';
if ($data['lead_data']['policy_end_date'] != null) {
$subject = "{{CLIENT_NAME}} _ {{POLICY_TYPE}} _ {{RFQ_OR_QCR}} _ {{POLICY_YEAR}} {{POLICY_END_DATE}}";
@@ -705,6 +716,8 @@ class LeadsController extends BaseController
$data['subject'] = $this->transformMailContent($lead_data, $subject, $data['page_name']);
$data['multi_file_data'] = $this->leadFilesModel->where('lead_id', $id)->where('is_active', 1)->findAll() ?? null;
+ $installment_data['installments'] = $this->leadInstallmentPaymentDetails->where('lead_id', $id)->where('is_active', 1)->findAll() ?? null;
+ $data['lead_data']['installment_data'] = view('rfq/installment_fields', $installment_data) ?? null;
$data['attachment_html'] = view('rfq/attachment_files', $data) ?? "";
$data['user_team'] = $this->userModel->select("ut.team_id")->join("user_teams ut", "ut.user_id = user_profiles.id and ut.is_active = 1")->where("user_profiles.is_active", 1)->first()['team_id'];
// dd($data);
@@ -727,11 +740,14 @@ class LeadsController extends BaseController
$data["child_table_data"] = json_decode($data['question_json'], true)['child_table_data'];
}
+ $data['product'] = $this->leadsModel->select("policy_type.policy_type")->join('policy_type', 'leads.policy_type_id = policy_type.id')->where('leads.id', $id)->first()['policy_type'];
// $data['lead_register_data'] = json_decode($data['lead_data']['custom_fields']);
// dd($data['lead_register_data']);
+ // $data['entity_type'] = $this->kycEntityTypeModel->where('is_active', 1)->findAll();
+ $data['buisness_type'] = $this->buisnessType;
+
// dd($data);
$data['client_type'] = $this->clientType;
- $data['buisness_type'] = $this->buisnessType;
$this->loadLayout('view_rfq_non_eb', $data);
}
}
@@ -776,12 +792,27 @@ class LeadsController extends BaseController
return $this->respond(['status' => false, 'message' => 'Lead ID is required'], 400);
}
+ $rfq_created = $this->RFQModel->where('lead_id', $lead_id)->where('is_active', 1)->countAllResults();
+ $qcr_created = false;
$inputJson = json_decode($data['json'], true);
if (isset($inputJson['premium_data']) && !empty($inputJson['premium_data'])) {
$sortedJson = $this->reorderProposalsByInsurerTotal($inputJson);
$data['json'] = json_encode($sortedJson);
+ $qcr_created = true;
}
+ if(($data['submit_type'] ?? "") == 'QCR'){
+ $inputJson = json_decode($data['json'], true);
+ $proposal_data = array_pop($inputJson);
+ if(isset($proposal_data['proposal_data']['over_all_column_data'])){
+ $proposel_count = $proposal_data['proposal_data']['over_all_column_data'];
+ foreach ($proposel_count as $key => $value) {
+ if(!empty($value['insurers'])){
+ $qcr_created = true;
+ }
+ }
+ }
+ }
$data['type'] = 1;
@@ -821,6 +852,19 @@ class LeadsController extends BaseController
}
if ($insertId) {
+
+ if(empty($rfq_created)){
+ $this->leadsModel->update($lead_id, ['status' => "rfq_created"]);
+ }
+
+ if($qcr_created == true){
+ $this->leadsModel
+ ->where('id', $lead_id)
+ ->whereNotIn('status', ['qcr_sent', 'lost', 'co_insurer_pending', 'won', 'completed_with_corrections', 'completed_without_corrections'])
+ ->set(['status' => "qcr_created"])
+ ->update();
+ }
+
$message = ($data['submit_type'] ?? '') == 'QCR' ? 'QCR saved successfully' : 'RFQ saved successfully';
return $this->respond([
'status' => true,
@@ -1063,6 +1107,17 @@ class LeadsController extends BaseController
return $result;
}
+ public function removeInstallments()
+ {
+ $id = $this->request->getGet('id');
+ // print_r($id); die;
+ if (!empty($id)) {
+ $this->leadInstallmentPaymentDetails->whereIn('id', $id)->set(['is_active' => 0])->update();
+ return $this->respond(['status' => true, 'message' => 'Removed successfully'], 200);
+ } else {
+ return $this->respond(['status' => false, 'message' => 'Could not be removed.'], 200);
+ }
+ }
//-----RFQ and QCR EXPORT------------------------------------------------------------------------------------------------
@@ -1139,36 +1194,32 @@ class LeadsController extends BaseController
if ($rfq_data['policy_type_id'] == 2) {
$lead_data = [
- 'policy_end_date' => $rfq_data['policy_end_date'],
'Insured' => $rfq_data['client_name'],
- 'Policy Status' => $rfq_data['status'],
+ 'Policy Type' => $this->leadType[$rfq_data['lead_type']] ?? "",
'No of Employees' => $rfq_data['incept_emp_count'],
'No of Dependents' => $rfq_data['incept_dept_count'],
'Total Lives' => $rfq_data['incept_no_of_lives'],
- 'Period of Insurance ' => date('d/m/Y', strtotime($rfq_data['policy_start_date'])) . ' to ' . date('d/m/Y', strtotime($rfq_data['policy_end_date'])),
+ 'Period of Insurance ' => !empty($rfq_data['policy_start_date']) && !empty($rfq_data['policy_end_date']) ? date('d/m/Y', strtotime($rfq_data['policy_start_date'])) . ' to ' . date('d/m/Y', strtotime($rfq_data['policy_end_date'])) : "To be decided",
'Policy Run Days' => $rfq_data['policy_run_days'],
];
} else if ($rfq_data['policy_type_id'] == 1) {
$lead_data = [
- 'policy_end_date' => $rfq_data['policy_end_date'],
'Insured' => $rfq_data['client_name'],
'No of Employees at Inception' => $rfq_data['incept_emp_count'],
'Total Sum Insured at Inception ' => $rfq_data['total_si_at_incept'],
- 'Policy Period' => date('d/m/Y', strtotime($rfq_data['policy_start_date'])) . ' to ' . date('d/m/Y', strtotime($rfq_data['policy_end_date'])),
- 'Policy Status' => $rfq_data['status'],
- 'Existing Insurer' => $rfq_data['insurer_name'],
- 'TPA ' => $rfq_data['tpa_name'],
+ 'Policy Period' => !empty($rfq_data['policy_start_date']) && !empty($rfq_data['policy_end_date']) ? date('d/m/Y', strtotime($rfq_data['policy_start_date'])) . ' to ' . date('d/m/Y', strtotime($rfq_data['policy_end_date'])) : "To be decided",
+ 'Policy Type' => $this->leadType[$rfq_data['lead_type']] ?? "",
];
}
+
} else {
if ($rfq_data['policy_type_id'] == 2) {
$lead_data = [
- 'policy_end_date' => $rfq_data['policy_end_date'],
'Insured' => $rfq_data['client_name'],
- 'Policy Status' => $rfq_data['status'],
+ 'Policy Type' => $this->leadType[$rfq_data['lead_type']] ?? "",
'No of Employees at Inception' => $rfq_data['incept_emp_count'],
'No of Dependents at Inception' => $rfq_data['incept_dept_count'],
@@ -1182,7 +1233,7 @@ class LeadsController extends BaseController
'No of Dependents at Renewal' => $rfq_data['renewal_dept_count'],
'Total Lives at Renewal ' => $rfq_data['renewal_no_of_lives'],
- 'Period of Insurance ' => date('d/m/Y', strtotime($rfq_data['policy_start_date'])) . ' to ' . date('d/m/Y', strtotime($rfq_data['policy_end_date'])),
+ 'Period of Insurance ' => !empty($rfq_data['policy_start_date']) && !empty($rfq_data['policy_end_date']) ? date('d/m/Y', strtotime($rfq_data['policy_start_date'])) . ' to ' . date('d/m/Y', strtotime($rfq_data['policy_end_date'])) : "To be decided",
'Policy Run Days' => $rfq_data['policy_run_days'],
'Inception Premium' => $rfq_data['premium_at_inception'],
'Premium as on (Date - DD MM YYYY should be entered based on the claims dump report)' => $rfq_data['premium_date'],
@@ -1194,12 +1245,11 @@ class LeadsController extends BaseController
];
} else if ($rfq_data['policy_type_id'] == 1) {
$lead_data = [
- 'policy_end_date' => $rfq_data['policy_end_date'],
'Insured' => $rfq_data['client_name'],
'No of Employees at Renewal' => $rfq_data['renewal_emp_count'],
'Total Sum Insured at Renewal ' => $rfq_data['total_si_at_renewal'],
- 'Policy Period' => date('d/m/Y', strtotime($rfq_data['policy_start_date'])) . ' to ' . date('d/m/Y', strtotime($rfq_data['policy_end_date'])),
- 'Policy Status' => $rfq_data['status'],
+ 'Policy Period' => !empty($rfq_data['policy_start_date']) && !empty($rfq_data['policy_end_date']) ? date('d/m/Y', strtotime($rfq_data['policy_start_date'])) . ' to ' . date('d/m/Y', strtotime($rfq_data['policy_end_date'])) : "To be decided",
+ 'Policy Type' => $this->leadType[$rfq_data['lead_type']] ?? "",
'Existing Insurer' => $rfq_data['insurer_name'],
'TPA ' => $rfq_data['tpa_name'],
];
@@ -1209,13 +1259,16 @@ class LeadsController extends BaseController
$data = json_decode($rfq_data['json'], true);
// dd($data);
+ $sheetName = 'Worksheet';
if ($type == 2) {
+ $sheetName = 'QCR';
$data = $this->convertJsonForQCR($data, $type);
if ($propsal_and_insurer !== null) {
list($proposal_key, $insurer_key) = explode('-', $propsal_and_insurer, 2);
$data = $this->transformProposelData($data, $proposal_key, $insurer_key);
}
} else if ($type == 1) {
+ $sheetName = 'RFQ';
$data = $this->convertJsonForQCR($data, $type);
// dd($data);
}
@@ -1223,6 +1276,7 @@ class LeadsController extends BaseController
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
+ $sheet->setTitle($sheetName);
// Start with lead_data at the top
@@ -1242,22 +1296,6 @@ class LeadsController extends BaseController
],
]);
- // Set column width to fit the image properly
- $sheet->getColumnDimension('C')->setWidth(20); // Adjust as needed
- $sheet->getRowDimension($rowNumber)->setRowHeight(40); // Adjust as needed
-
- $drawing = new Drawing();
- $path = ROOTPATH . "public/assets/images/Nhance-Logo-Final.png"; // Use FCPATH for server path
- $drawing->setPath($path);
- $drawing->setCoordinates("C{$rowNumber}"); // Set position in column B
- $drawing->setHeight(35); // Adjust image height
-
- // Center align the image in the cell
- $drawing->setOffsetX(30); // Adjust horizontal offset
- $drawing->setOffsetY(5); // Adjust vertical offset
-
- $drawing->setWorksheet($sheet);
-
// Apply center alignment to the cell
$sheet->getStyle("C{$rowNumber}")->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
$sheet->getStyle("C{$rowNumber}")->getAlignment()->setVertical(\PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER);
@@ -1304,11 +1342,10 @@ class LeadsController extends BaseController
$rowNumber++;
}
- // Set column width based on max content length (adjusted for padding)
+ // // Set column width based on max content length (adjusted for padding)
$sheet->getColumnDimension('A')->setWidth($maxWidthA * 1.2);
$sheet->getColumnDimension('B')->setWidth($maxWidthA * 5);
- $sheet->getColumnDimension('C')->setWidth($maxWidthB * 1.2);
- // $sheet->getColumnDimension('D')->setWidth($maxWidthB * 1.2);
+ $sheet->getColumnDimension('C')->setWidth($maxWidthB * 1.6);
// $rowNumber += 2;
@@ -1350,9 +1387,13 @@ class LeadsController extends BaseController
]);
$sheet->mergeCells($mergeRange);
+ $rowNumber_for_remove_quote_asked = $rowNumber;
$rowNumber = $rowNumber + 1;
-
- $subHeaderRow = $rowNumber + 1;
+ if($type == 2){
+ $subHeaderRow = $rowNumber + 1;
+ }else{
+ $subHeaderRow = $rowNumber_for_remove_quote_asked;
+ }
$columnLetter = 'A';
foreach ($headers as $header) {
@@ -1393,9 +1434,12 @@ class LeadsController extends BaseController
// Add subheaders
foreach ($header['subHeaders'] as $subHeader) {
- $sheet->setCellValue("{$columnLetter}{$subHeaderRow}", $subHeader);
- if ($columnLetter != "A" && $columnLetter != "B" && $columnLetter != "C" && $columnLetter != "D") {
+ if($type == 2){
+ $sheet->setCellValue("{$columnLetter}{$subHeaderRow}", $subHeader);
+ }
+
+ if ($columnLetter != "A" && $columnLetter != "B" && $columnLetter != "C") {
$sheet->getColumnDimension($columnLetter)->setWidth(35);
} else {
$sheet->getColumnDimension('A')->setWidth(10);
@@ -1514,6 +1558,51 @@ class LeadsController extends BaseController
]);
}
+
+ //set imgage and align the row and column
+ // Kint::dump($columnLetter);
+ if($type == 2){
+ $columnLetter_img = $this->getPreviousColumn($columnLetter, 2);
+ }else{
+ $columnLetter_img = $this->getPreviousColumn($columnLetter);
+ }
+ // dd($columnLetter_img);
+
+ $company_name = $this->getPreviousColumn($columnLetter_img);
+ $mergeRange1 = "A1:{$company_name}1";
+ $sheet->mergeCells($mergeRange1);
+
+ $rowCount = count($lead_data);
+ for ($i = 2; $i <= $rowCount + 1; $i++) {
+ $mergeRange1 = "C{$i}:{$columnLetter_img}{$i}";
+ $sheet->mergeCells($mergeRange1);
+ $sheet->getStyle($mergeRange1)->applyFromArray([
+ 'borders' => [
+ 'allBorders' => [
+ 'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN,
+ 'color' => ['argb' => 'FF000000'], // Black color
+ ],
+ ],
+ ]);
+ }
+
+ $sheet->getColumnDimension($columnLetter_img)->setWidth(40);
+ $sheet->getRowDimension(1)->setRowHeight(40); // Adjust as needed
+
+ $drawing = new Drawing();
+ $path = ROOTPATH . "public/assets/images/Nhance-Logo-Final.png"; // Use FCPATH for server path
+ $drawing->setPath($path);
+ $drawing->setCoordinates("{$columnLetter_img}1"); // Set position in column B
+ $drawing->setHeight(35); // Adjust image height
+
+ // Center align the image in the cell
+ $drawing->setOffsetX(110); // Adjust horizontal offset
+ $drawing->setOffsetY(10); // Adjust vertical offset
+ $drawing->setWorksheet($sheet);
+
+ //end
+
+
// Auto-size columns
// foreach ($sheet->getColumnIterator() as $column) {
// $sheet->getColumnDimension($column->getColumnIndex())->setAutoSize(true);
@@ -1551,7 +1640,7 @@ class LeadsController extends BaseController
}
$lastRow = count($lead_data) + 1;
- $leadRange = "A1:C{$lastRow}";
+ $leadRange = "A1:{$columnLetter_img}{$lastRow}";
$sheet->getStyle($leadRange)->applyFromArray([
'borders' => [
@@ -1571,12 +1660,12 @@ class LeadsController extends BaseController
$policy_year = "$current_year-$next_year";
if (!empty($rfq_data['policy_end_date'])) {
- $policy_expiry = strtotime($lead_data['policy_end_date']);
+ $policy_expiry = strtotime($rfq_data['policy_end_date']);
$formatted_policy = date("d-m-Y", $policy_expiry);
-
$filename = "{$rfq_data['client_name']}_{$rfq_data['policy_type']}_{$string}_" . $policy_year . '(Due On ' . $formatted_policy . ')' . '.xlsx';
} else {
+
$filename = "{$rfq_data['client_name']}_{$rfq_data['policy_type']}_{$string}_" . $policy_year . '_' . '.xlsx';
}
@@ -2075,17 +2164,19 @@ class LeadsController extends BaseController
->where('leads.id', $lead_id)
->first();
+ // log_message('error', 'Lead Data' . json_encode($lead_data));
// print_r($lead_data ); die;
$cc_mails = [];
$bcc_mails = [];
//get CC Mails
- if ($recipient_type == 'internal' || $recipient_type == 'placement' || $recipient_type == 'insurer' || $recipient_type == 'client') {
+ if ($recipient_type == 'internal' || $recipient_type == 'insurer' || $recipient_type == 'client') {
$cc_data = isset($params['cc']) ? $params['cc'] : "";
$param_cc_mail = json_decode($cc_data, true);
+
if (isset($param_cc_mail) && is_array($param_cc_mail) && count($param_cc_mail) > 0) {
// Fetch user data where ID is in the param_cc_mail array
$userData = $this->userModel
@@ -2109,6 +2200,8 @@ class LeadsController extends BaseController
// Handle case where param_cc_mail is not valid
// return $this->respond(['status' => 'failed','code' => 400,'data' => '','message' => 'CC mail not found!'], 200);
}
+ }else if($recipient_type == 'placement'){
+ $cc_mails = isset($params['cc']) ? json_decode($params['cc'], true) : "";
}
//get BCC Mails
@@ -2176,6 +2269,7 @@ class LeadsController extends BaseController
$result = $file_info['filePath'];
// return $this->respond(['status' => 'fail', 'code' => 200, 'messgae' => 'File Not Found'], 200);
}
+
// print_rr($result); die;
// print_rr($file_info);
// $file_path = WRITEPATH."uploads/excel/sample/correction.xls";
@@ -2194,15 +2288,11 @@ class LeadsController extends BaseController
//get recipient address
if ($recipient_type == 'insurer' || $recipient_type == 'placement') {
- // print_r($recipient_mail); die;
-
$recipient_data = $this->levelContactModel
->where(['contact_type' => 'insurer', 'is_active' => 1])
->whereIn('id', $recipient_mail)
->findAll();
- // print_r($recipient_data); die;
-
} else if ($recipient_type == 'client') {
$mailIDS = explode(',', $params['contact_mail']);
@@ -2235,9 +2325,9 @@ class LeadsController extends BaseController
foreach ($recipient_data as $recipient) {
$message = $original_message;
- $message = str_replace("{{RECIPIENT_NAME}}", $recipient['name'], $message);
- $message = str_replace("{{CLIENT_NAME}}", $lead_data['client_name'], $message);
- $message = str_replace("{{POLICY_LONG_NAME}}", $lead_data['long_name'], $message);
+ $message = str_replace("{{RECIPIENT_NAME}}", $recipient['name'] != "" ? $recipient['name'] :" ", $message);
+ $message = str_replace("{{CLIENT_NAME}}", $lead_data['client_name'] != "" ? $lead_data['client_name'] : "", $message);
+ $message = str_replace("{{POLICY_LONG_NAME}}",$lead_data['long_name'] != ""? $lead_data['long_name'] : "", $message);
$message = str_replace("{{POLICY_START_DATE}}", change_date_format($lead_data['policy_start_date'], 'Y-m-d', 'd-m-Y'), $message);
$message = str_replace("{{DURATION}}", calculate_days_bw_dates($lead_data['policy_end_date'] ?? "", $lead_data['policy_start_date'] ?? "")->days, $message) ?? '--';
@@ -2264,16 +2354,52 @@ class LeadsController extends BaseController
$data = [
'proposel_data' => json_encode($lead_update_data),
'status' => 'won',
- 'placement_date' => change_date_format($params['placement_date'], 'd/m/Y', 'Y-m-d'),
- 'payment_date' => change_date_format($params['payment_date'], 'd/m/Y', 'Y-m-d'),
- 'utr_no' => $params['utr_no'],
- 'is_cd' => $params['is_cd'],
- 'premium_amount' => $params['premium_amount'],
- 'total_amount' => $params['total_amount'],
- 'cd_amount' => $params['cd_amount'],
+ 'placement_date' => date('Y-m-d', strtotime($params['placement_date']) ?? "") ?? null,
+ 'payment_date' => date('Y-m-d', strtotime($params['payment_date'] ?? "")) ?? null,
+ 'utr_no' => $params['utr_no'] ?? null,
+ 'is_cd' => $params['is_cd'] ?? null ,
+ 'premium_amount' => $params['premium_amount'] ?? null,
+ 'total_amount' => $params['total_amount'] ?? null,
+ 'cd_amount' => $params['cd_amount'] ?? null,
+ 'no_of_installment' => $params['no_of_installment'] ?? null,
+ 'is_installment' => $params['is_installment'] ?? null,
];
$this->leadsModel->where('id', $lead_id)->set($data)->update();
+
+ if(isset($params['installments']) && !empty($params['installments'])){
+
+ $installment_data = json_decode($params['installments'], true);
+ if(!empty($installment_data)){
+ foreach ($installment_data as $key => $value) {
+ $value['payment_date'] = date('Y/m/d', strtotime($value['payment_date'])) ?? null;
+ if(isset($value['id']) && !empty($value['id'])){
+ $this->leadInstallmentPaymentDetails->where('id', $value['id'])->set($value)->update();
+ }else{
+ $this->leadInstallmentPaymentDetails->insert($value);
+ }
+ }
+ }
+ }
+
+ }
+
+ if ($recipient_type == 'client') {
+
+ $this->leadsModel
+ ->where('id', $lead_id)
+ ->whereNotIn('status', ['lost', 'co_insurer_pending', 'won', 'completed_with_corrections', 'completed_without_corrections'])
+ ->set(['status' => "qcr_sent"])
+ ->update();
+ }
+
+ if ($recipient_type == 'insurer') {
+
+ $this->leadsModel
+ ->where('id', $lead_id)
+ ->whereNotIn('status', ['qcr_created', 'qcr_sent', 'lost', 'co_insurer_pending', 'won', 'completed_with_corrections', 'completed_without_corrections'])
+ ->set(['status' => "rfq_sent"])
+ ->update();
}
//delete attachment file
@@ -2808,7 +2934,7 @@ class LeadsController extends BaseController
$value = $cellData['display_content'] ?? '';
// Skip unwanted keys
- if (in_array($parentth, ['SNO', 'Particulars', 'Action']) || $subth === 'Quote Asked') {
+ if (in_array($parentth, ['SNO', 'Particulars', 'Action']) || $subth === 'Sum Insured' || $subth === 'Fidelity Limit') {
continue;
}
@@ -2913,6 +3039,10 @@ class LeadsController extends BaseController
$current_year = date('Y');
$next_year = $current_year + 1;
$policy_year = "$current_year-$next_year";
+ $page_name = $page_name == "QCR" ? "Quote Comparison Report" : $page_name;
+ $log_path = base_url() . '/public/assets/images/Nhance-Logo-Final.png';
+ // $log_path ='https://venbait.in/nhance/dev/public/assets/images/Nhance-Logo-Final.png';
+ // dd($log_path);
$policy_expiry = strtotime($lead_data['policy_end_date']);
@@ -2935,6 +3065,7 @@ class LeadsController extends BaseController
$message = str_replace("{{LOGGED_USER_NAME}}", ucfirst($logged_user_data['first_name']) . " " . ucfirst($logged_user_data['last_name']), $message);
$message = str_replace("{{LOGGED_USER_EMAIL}}", $logged_user_data['email'], $message);
$message = str_replace("{{LOGGED_USER_MOBILE}}", $logged_user_data['mobile'], $message);
+ $message = str_replace("{{LOGO_PATH}}", $log_path, $message);
return $message;
} else {
@@ -3044,7 +3175,6 @@ class LeadsController extends BaseController
$data['lead_edit_data']['claims_details_html'] = "";
}
}
-
// dd($data);
return $this->loadLayout('leads_form_handler', $data);
@@ -3077,6 +3207,7 @@ class LeadsController extends BaseController
3 => 'rfq/gmc',
4 => 'rfq/gmc',
5 => 'rfq/gmc',
+ 17=> 'rfq/burglary',
22 => 'rfq/car',
23 => 'rfq/cpm',
24 => 'rfq/cyber_crime',
@@ -3216,11 +3347,11 @@ class LeadsController extends BaseController
$sheet->getColumnDimension('B')->setWidth($maxWidthA * 1.2);
$sheet->getColumnDimension('C')->setWidth($maxWidthB * 1.2);
- $rowNumber += 2;
+ $rowNumber += 1;
//Policy Registration
if (!empty($policy_registration_data)) {
foreach ($policy_registration_data as $key => $value) {
-
+ // kint::dump($value);
$startRow = $rowNumber; // Track where the block starts
// Title Row
@@ -3307,6 +3438,24 @@ class LeadsController extends BaseController
$rowNumber++;
}
+ if (isset($value['policyDetails']) && !empty($value['policyDetails'])) {
+ // Type of Business
+ $sheet->mergeCells("A{$rowNumber}:B{$rowNumber}");
+ $sheet->setCellValue("A{$rowNumber}", "Terrorism");
+ $sheet->setCellValue("C{$rowNumber}", ucfirst($value['policyDetails']['terrorism'] ?? 'No'));
+
+ $sheet->getStyle("A{$rowNumber}")->applyFromArray([
+ 'font' => ['bold' => true],
+ 'alignment' => [
+ 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
+ 'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
+ ],
+ ]);
+
+ $rowNumber++;
+
+ }
+
$endRow = $rowNumber - 1; // Block ends at previous row
// Apply border to the whole block
@@ -3319,8 +3468,9 @@ class LeadsController extends BaseController
],
]);
- $rowNumber += 2; // Add space before the next block
+ $rowNumber += 1; // Add space before the next block
}
+ // die();
}
//Table Data
@@ -3424,6 +3574,18 @@ class LeadsController extends BaseController
}
}
+ // For the subheader row, merge B and C and set the value
+ $sheet->setCellValue("B{$subHeaderRow}", "Sum Insured");
+ $sheet->mergeCells("B{$subHeaderRow}:C{$subHeaderRow}");
+ $sheet->getStyle("B{$subHeaderRow}:C{$subHeaderRow}")->applyFromArray([
+ 'font' => ['bold' => true],
+ 'alignment' => [
+ 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
+ 'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
+ ],
+ ]);
+
+
// Apply border to the header range
$prevColumn4 = $this->getPreviousColumn($columnLetter);
$headerRange = "A{$rowNumber}:" . "{$prevColumn4}" . "{$subHeaderRow}";
@@ -3440,7 +3602,9 @@ class LeadsController extends BaseController
$sheet->getRowDimension($rowNumber)->setRowHeight(25); // Header row height
$sheet->getRowDimension($subHeaderRow)->setRowHeight(20); // Subheader row height
- $rowNumber = $subHeaderRow + 2;
+ // $rowNumber = $subHeaderRow + 2;
+ $rowNumber = $subHeaderRow + 1;
+
$column_data = $data['table_data']['data'];
// dd($column_data);
$serial_no = 1;
@@ -3728,7 +3892,7 @@ class LeadsController extends BaseController
$row['data'] = array_filter(
$row['data'],
function ($item) {
- return in_array($item['subth'], ['Quote asked', '-']);
+ return in_array($item['subth'], ['Sum Insured', '-',"Liability Limit"]);
}
);
@@ -3817,7 +3981,7 @@ class LeadsController extends BaseController
if ($subHeader === $insurer) {
$headerData[] = [
'parentHeader' => $header['parentHeader'],
- 'subHeaders' => ['Quote asked', $subHeader]
+ 'subHeaders' => ['Sum Insured', $subHeader]
];
break 2; // Exit both loops after match is found
}
@@ -3850,8 +4014,8 @@ class LeadsController extends BaseController
$filteredData[] = $item;
}
- // Include Proposal with Quote Asked
- if ($item['parentth'] === $proposal && $item['subth'] === "Quote asked") {
+ // Include Proposal with Sum Insured
+ if ($item['parentth'] === $proposal && ($item['subth'] === "Sum Insured" || $item['subth'] === "Liability Limit")) {
$filteredData[] = $item;
}
@@ -3898,10 +4062,15 @@ class LeadsController extends BaseController
$lead_file = $this->leadFilesModel->where('lead_id', $lead_id)->where('id', $id)->where('is_active', 1)->first();
if ($lead_file) {
- $attachments[] = [
- 'fileName' => $lead_file['file_name'],
- 'filePath' => $lead_file_path . $lead_file['file_name']
- ];
+
+ $fullPath = $lead_file_path . $lead_file['file_name'];
+
+ if (file_exists($fullPath) && !empty($fileName)) {
+ $attachments[] = [
+ 'fileName' => $lead_file['file_name'],
+ 'filePath' => $fullPath
+ ];
+ }
}
}
}
diff --git a/app/Helpers/excel_util_helper.php b/app/Helpers/excel_util_helper.php
index 593b2d05..d2e30828 100755
--- a/app/Helpers/excel_util_helper.php
+++ b/app/Helpers/excel_util_helper.php
@@ -440,8 +440,20 @@ if (!function_exists('name_dup_check_within_family'))
foreach ($family_data as $rkey => $row)
{
if(in_array($row[2],$temp))
- {
- array_push($result,$row[0]);
+ {
+ // Kint::dump($row);
+ $emp_code = $row[1];
+ $tempFam = null;
+ foreach ($family_data as $family) {
+ if ($family[1] == $emp_code &&!isset($family['temp'])) {
+ $tempFam = $family;
+ break; // Stop at the first match
+ }
+ }
+ // Kint::dump($tempFam);
+ // die();
+
+ array_push($result,$tempFam[0]);
}
else
{
@@ -449,7 +461,7 @@ if (!function_exists('name_dup_check_within_family'))
}
}
-
+ // dd($result);
return $result;
}
}
@@ -519,7 +531,15 @@ if (!function_exists('name_and_empid_check_in_db'))
}
if(($current_action == 'inception' || $current_action == 'dependent_addition' || $current_action == 'addition' || $current_action == 'enrollment') && count($res))
{
- array_push($result['i'],$row[0]);
+ $emp_code = $row[1];
+ $tempFam = null;
+ foreach ($family_data as $family) {
+ if ($family[1] == $emp_code &&!isset($family['temp'])) {
+ $tempFam = $family;
+ break; // Stop at the first match
+ }
+ }
+ array_push($result['i'],$tempFam[0]);
}
}
@@ -566,6 +586,15 @@ if (!function_exists('check_dependent_conflict'))
$allowed_parents_count = $temp['either-parents-pil'] == 0 ? $temp['parents'] : 0;
$allowed_parent_in_laws_count = $temp['either-parents-pil'] == 0 ? $temp['parents-in-law'] : 0;
// dd($allowed_adults == 0);
+ $firstNonTemp = null;
+
+ foreach ($family_data as $family) {
+ if (!isset($family['temp'])) {
+ $firstNonTemp = $family;
+ break;
+ }
+ }
+ // Kint::dump($firstNonTemp);
foreach ($family_data as $key => $row)
{
// dd($family_data[0][0]);
@@ -580,7 +609,7 @@ if (!function_exists('check_dependent_conflict'))
if($relationship == 'self')
{
$self_gender = $row[4];
- $self_emp_row_id = $row[0];
+ $self_emp_row_id = isset($row['temp']) ? null : $row[0];
}
if($relationship == 'spouse')
{
@@ -612,8 +641,9 @@ if (!function_exists('check_dependent_conflict'))
$repeated_count = array_intersect($repeated_relationships_count,$temp_counts);
if(is_array($repeated_count) && count($repeated_count))
{
+ // Kint::dump($firstNonTemp);die();
$result['status'] = false;
- $result['error_data'][] = ['code' => 13,'col_name' => 'relationship','msg' => 'Rule conflict: Twofold relationship found within family','row_id' => $family_data[0][0]];
+ $result['error_data'][] = ['code' => 13,'col_name' => 'relationship','msg' => 'Rule conflict: Twofold relationship found within family','row_id' => $firstNonTemp[0]];
}
}
// print_r($repeated_count);
@@ -630,26 +660,26 @@ if (!function_exists('check_dependent_conflict'))
if($self_gender && $spouse_gender && $self_gender == $spouse_gender)
{
$result['status'] = false;
- $result['error_data'][] = ['code' => 4,'col_name' => 'gender','msg' => 'Rule conflict: Self and Spouse cannot be same gender','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];
+ $result['error_data'][] = ['code' => 4,'col_name' => 'gender','msg' => 'Rule conflict: Self and Spouse cannot be same gender','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $firstNonTemp[0])];
}
}
if(($allowed_spouse_count < $received_spouse_count) || ($allowed_child_count < $received_child_count) )
{
$result['status'] = false;
- $result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: As per policy, count of dependents has exceeded configured count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];//dependent count mismatch
+ $result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: As per policy, count of dependents has exceeded configured count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $firstNonTemp[0])];//dependent count mismatch
}
// || ($allowed_parents_count < $received_parents_count) || ($allowed_parent_in_laws_count < $received_parent_in_laws_count)
if($allowed_adults == 1 && $received_parents_count && $received_parent_in_laws_count )
{
$result['status'] = false;
- $result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: Parents and Parents in law both not allowed','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];
+ $result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: Parents and Parents in law both not allowed','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $firstNonTemp[0])];
if((2 < $received_parents_count) || (2 < $received_parent_in_laws_count))
{
$result['status'] = false;
- $result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: As per policy, count of dependents has exceeded configured count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];//dependent count mismatch
+ $result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: As per policy, count of dependents has exceeded configured count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $firstNonTemp[0])];//dependent count mismatch
}
}
//check for any cross parents but not more than two
@@ -657,7 +687,7 @@ if (!function_exists('check_dependent_conflict'))
{
// dd($allowed_adults);
$result['status'] = false;
- $result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict:As per policy, count of dependents has exceeded configured count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];//dependent count mismatch
+ $result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict:As per policy, count of dependents has exceeded configured count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $firstNonTemp[0])];//dependent count mismatch
}
diff --git a/app/Models/LeadInstallmentPaymentDetails.php b/app/Models/LeadInstallmentPaymentDetails.php
new file mode 100644
index 00000000..53657d03
--- /dev/null
+++ b/app/Models/LeadInstallmentPaymentDetails.php
@@ -0,0 +1,54 @@
+
+ body {
+ margin-top: 20px;
+ background: #FAFAFA;
+ }
-body{
- margin-top:20px;
- background:#FAFAFA;
-}
-.order-card {
- color: #fff;
-}
+ .order-card {
+ color: #fff;
+ }
-.bg-c-blue {
- background: linear-gradient(45deg,#4099ff,#73b4ff);
-}
+ .bg-c-blue {
+ background: linear-gradient(45deg, #4099ff, #73b4ff);
+ }
-.bg-c-green {
- background: linear-gradient(45deg,#2ed8b6,#59e0c5);
-}
+ .bg-c-green {
+ background: linear-gradient(45deg, #2ed8b6, #59e0c5);
+ }
-.bg-c-yellow {
- background: linear-gradient(45deg,#FFB64D,#ffcb80);
-}
+ .bg-c-yellow {
+ background: linear-gradient(45deg, #FFB64D, #ffcb80);
+ }
-.bg-c-pink {
- background: linear-gradient(45deg,#FF5370,#ff869a);
-}
+ .bg-c-pink {
+ background: linear-gradient(45deg, #FF5370, #ff869a);
+ }
-.bg-c-red {
- background: linear-gradient(45deg,#FF4E50,#F9D423);
-}
+ .bg-c-red {
+ background: linear-gradient(45deg, #FF4E50, #F9D423);
+ }
-.bg-c-purple {
- background: linear-gradient(45deg,#9D50BB,#6E48AA);
-}
+ .bg-c-purple {
+ background: linear-gradient(45deg, #9D50BB, #6E48AA);
+ }
-.bg-c-orange {
- background: linear-gradient(45deg,#F2994A,#F2C94C);
-}
+ .bg-c-orange {
+ background: linear-gradient(45deg, #F2994A, #F2C94C);
+ }
-.bg-c-teal {
- background: linear-gradient(45deg,#1ABC9C,#16A085);
-}
+ .bg-c-teal {
+ background: linear-gradient(45deg, #1ABC9C, #16A085);
+ }
-.bg-c-cyan {
- background: linear-gradient(45deg,#00C9FF,#92FE9D);
-}
+ .bg-c-cyan {
+ background: linear-gradient(45deg, #00C9FF, #92FE9D);
+ }
-.bg-c-lime {
- background: linear-gradient(45deg,#A8E063,#56AB2F);
-}
+ .bg-c-lime {
+ background: linear-gradient(45deg, #A8E063, #56AB2F);
+ }
-.bg-c-indigo {
- background: linear-gradient(45deg,#3F51B5,#5A55AE);
-}
+ .bg-c-indigo {
+ background: linear-gradient(45deg, #3F51B5, #5A55AE);
+ }
-.bg-c-Pelorous {
- background: linear-gradient(45deg, #00d6db, #00a8b5);
-}
+ .bg-c-Pelorous {
+ background: linear-gradient(45deg, #00d6db, #00a8b5);
+ }
-.bg-c-Pelorous2 {
- background: linear-gradient(45deg, #02a8b5, #017f8b);
-}
+ .bg-c-Pelorous2 {
+ background: linear-gradient(45deg, #02a8b5, #017f8b);
+ }
-.bg-c-Pelorous3 {
- background: linear-gradient(45deg, #098895, #046063);
-}
+ .bg-c-Pelorous3 {
+ background: linear-gradient(45deg, #098895, #046063);
+ }
-.bg-c-Grenadier {
- background: linear-gradient(45deg, #ff9d37, #ff7a10);
-}
+ .bg-c-Grenadier {
+ background: linear-gradient(45deg, #ff9d37, #ff7a10);
+ }
-.bg-c-Grenadier2 {
- background: linear-gradient(45deg, #ff8010, #ff4c00);
-}
+ .bg-c-Grenadier2 {
+ background: linear-gradient(45deg, #ff8010, #ff4c00);
+ }
-.bg-c-Grenadier3 {
- background: linear-gradient(45deg, #f06306, #cc4b05);
-}
+ .bg-c-Grenadier3 {
+ background: linear-gradient(45deg, #f06306, #cc4b05);
+ }
-.bg-c-SilverChalice {
- background: linear-gradient(45deg, #a3a8a8, #8f9494);
-}
+ .bg-c-SilverChalice {
+ background: linear-gradient(45deg, #a3a8a8, #8f9494);
+ }
-.bg-c-SilverChalice2 {
- background: linear-gradient(45deg, #7e8484, #686e6e);
-}
+ .bg-c-SilverChalice2 {
+ background: linear-gradient(45deg, #7e8484, #686e6e);
+ }
-.bg-c-SilverChalice3 {
- background: linear-gradient(45deg, #5c6363, #434949);
-}
+ .bg-c-SilverChalice3 {
+ background: linear-gradient(45deg, #5c6363, #434949);
+ }
-.card {
- border-radius: 5px;
- -webkit-box-shadow: 0 1px 2.94px 0.06px rgba(4,26,55,0.16);
- box-shadow: 0 1px 2.94px 0.06px rgba(4,26,55,0.16);
- border: none;
- margin-bottom: 30px;
- -webkit-transition: all 0.3s ease-in-out;
- transition: all 0.3s ease-in-out;
-}
+ .card {
+ border-radius: 5px;
+ -webkit-box-shadow: 0 1px 2.94px 0.06px rgba(4, 26, 55, 0.16);
+ box-shadow: 0 1px 2.94px 0.06px rgba(4, 26, 55, 0.16);
+ border: none;
+ margin-bottom: 30px;
+ -webkit-transition: all 0.3s ease-in-out;
+ transition: all 0.3s ease-in-out;
+ }
-.card .card-block {
- padding-top: 10px;
- padding-bottom: 10px;
- padding-left: 25px;
- padding-right: 25px;
-}
+ .card .card-block {
+ padding-top: 10px;
+ padding-bottom: 10px;
+ padding-left: 25px;
+ padding-right: 25px;
+ }
-.order-card i {
- font-size: 26px;
-}
+ .order-card i {
+ font-size: 26px;
+ }
-.f-left {
- float: left;
-}
+ .f-left {
+ float: left;
+ }
-.f-right {
- float: right;
-}
+ .f-right {
+ float: right;
+ }
-.m-b-1{
- margin-top: 0;
- margin-bottom: 5px;
-}
+ .m-b-1 {
+ margin-top: 0;
+ margin-bottom: 5px;
+ }
@@ -133,7 +133,9 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID,user_t
Leads
-
= isset($lead_data)? $lead_data['total'] : 0 ?>
+
= isset($lead_data) ? $lead_data['total'] : 0 ?>
+
@@ -143,7 +145,9 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID,user_t
BDS Renewals
-
= isset($bds_renewal) ? $bds_renewal['total'] : 0?>
+
= isset($bds_renewal) ? $bds_renewal['total'] : 0 ?>
+
@@ -151,39 +155,42 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID,user_t
-
+
+
+
+ $value) : ?>
-
20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus;
- $showTooltip = strlen($formattedStatus) > 20;
+ $formattedStatus = strlen($key) < 5 ? strtoupper($key) : ucwords(str_replace('_', ' ', $key));
+ $truncatedStatus = strlen($formattedStatus) > 20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus;
+ $showTooltip = strlen($formattedStatus) > 20;
?>
-
+
= $value ?>
>
@@ -191,35 +198,45 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID,user_t
-
+
-
- $value) : ?>
-
- $value) : ?>
+
20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus;
- $showTooltip = strlen($formattedStatus) > 20;
+ // Initialize color set and shade indexes
+ $colorSetIndex = floor($index / $shadeCount) % $colorSetCount; // Reset color set after each set
+ $shadeIndex = $index % $shadeCount; // Cycle through shades within the set
+
+ // Get the background color for the current tile
+ $bgColor = $colorShades[$colorSetIndex][$shadeIndex];
+ ?>
+ 20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus;
+ $showTooltip = strlen($formattedStatus) > 20;
?>
-
+
+
= $value ?>
>
@@ -227,23 +244,23 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID,user_t
-
+
\ No newline at end of file
diff --git a/app/Views/leads_form.php b/app/Views/leads_form.php
index fc2ee0f0..265d1f32 100644
--- a/app/Views/leads_form.php
+++ b/app/Views/leads_form.php
@@ -884,7 +884,7 @@
" . $value['policy_type'] . "";
}
}
diff --git a/app/Views/leads_non_eb.php b/app/Views/leads_non_eb.php
index fef3f394..0dc0d785 100644
--- a/app/Views/leads_non_eb.php
+++ b/app/Views/leads_non_eb.php
@@ -256,19 +256,19 @@ hr.solid {
-