MERGE_UAT_CLAIM_FEEDBACK_FORM&FEEBBACKS

This commit is contained in:
Ubuntu 2025-04-03 17:45:14 +05:30
commit 21f86e9b5d
25 changed files with 3590 additions and 722 deletions

View File

@ -52,6 +52,10 @@ $routes->get('/update-emp-policy-status', 'ClientController::updateEmpAndPolicyS
$routes->get('download-e-card/(:any)', 'EmployeeController::generateIDCardForEmployee/$1');
$routes->get('download-kyc-docs/(:segment)', 'ClientController::downloadKYCDocument/$1');
$routes->get('claim-form-download/(:any)', 'TicketController::downloadClaimForm/$1');
$routes->match (['get','post'],"claims-feedback-form/(:any)/(:any)", "TicketController::viewClaimFeedbackForm/$1/$2");
$routes->match (['get','post'],"claims-feedback-form/(:any)", "TicketController::viewClaimFeedbackForm/$1");
$routes->group("/user", ["filter" => "authMVC"], function ($routes) {
$routes->post("create", "UserController::create");
@ -440,6 +444,9 @@ $routes->post("/employeeRest/verifyMpin", "RestAuthenticationController::verifyM
$routes->post("/employeeRest/checkMpin", "RestAuthenticationController::checkMpin");
$routes->post("/employeeRest/verifyEmployeeEmailId", "RestAuthenticationController::verifyEmployeeWithEmailId");
$routes->post("/employeeRest/updateEmpOTP", "RestAuthenticationController::updateEmpOTP");
$routes->post("/employeeRest/updateEmpMPIN", "RestAuthenticationController::updateEmpMPIN");
// $routes->post("/employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
//HR login api's
$routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber");
@ -460,6 +467,11 @@ $routes->group("/api", ["filter" => "authJWT"], function ($routes) {
$routes->get('get_ticket_data',"EmployeeRestController::get_ticket_data");
});
$routes->post("employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
$routes->post("employeeRest/updateMpin", "RestAuthenticationController::updateMpin");
$routes->get("getEmployeePolicy", "EmployeeRestController::getEmployeePolicy");
$routes->get("getAddOnPolicy", "EmployeeRestController::getAddOnPolicy");
$routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
@ -467,8 +479,7 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
$routes->post("getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData");
$routes->post("storeFireBase", "EmployeeRestController::storeFireBase");
$routes->post("saveMpin", "RestAuthenticationController::saveMpin");
$routes->post("updateMpin", "RestAuthenticationController::updateMpin");
// $routes->post("updateMpin", "RestAuthenticationController::updateMpin");
$routes->post("getChatResponse", "ChatBotController::getChatResponse");
$routes->get("getEmployeeProfile", "EmployeeRestController::getEmployeeProfile");
@ -526,6 +537,7 @@ $routes->group("/bdsReport", ["filter" => "authMVC"], function ($routes) {
//New Tickets
$routes->group("/ticket", ["filter" => "authMVC"], function ($routes) {
$routes->match( ['get', 'post'], 'list','TicketController::ticketList');
$routes->get('feedback-list','TicketController::feedbackList');
$routes->get('new/(:any)','TicketController::ticket_form/$1');
$routes->post('create','TicketController::createTicket');
$routes->post('update','TicketController::updateTicket');

View File

@ -3675,6 +3675,7 @@ class ClientController extends AdminController
}
}
//Function for get all client, branch and policy data
public function getClientAndBranchAndPolicy()
{
// ---------for client-----------------------------------------------------------------------------
@ -3725,6 +3726,7 @@ class ClientController extends AdminController
policy_type.iep,
policy_type.itp,
policy_type.bap,
policy_type.allocg,
DATE_FORMAT(client_policy.policy_start_date, '%d/%m/%Y') as policy_start_date,
DATE_FORMAT(client_policy.policy_end_date, '%d/%m/%Y') as policy_end_date
")
@ -4713,8 +4715,42 @@ class ClientController extends AdminController
// dd($data);
// $LeadsController = new LeadsController();
// $LeadsController->constructNonEbExcelToSaveTemp(92, 2, "Proposal 2-ICICIPRU-ICICI001");
$LeadsController = new LeadsController();
$RFQModel = new RFQModel();
// $path = $LeadsController->constructNonEbExcelToSaveTemp(106, 2, "Proposal 2-ICICIPRU-ICICI001");
// $filepath = $path['filePath'];
// if (file_exists($filepath)) {
// // Set headers to force download
// header('Content-Description: File Transfer');
// header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
// header('Content-Disposition: attachment; filename="' . basename($filepath) . '"');
// header('Content-Length: ' . filesize($filepath));
// header('Pragma: public');
// // Output the file content
// readfile($filepath);
// // Delete the file after download
// unlink($filepath);
// exit;
// } else {
// echo "File does not exist.";
// }
// $data = $this->leadsModel->where('leads.id', 125)->where('leads.is_active', 1)->first();
// $RFQdata = $RFQModel->getRFQTableDataWithLeadIDAndType(125, 2);
// // Kint::dump($RFQdata);
// $returnData = $LeadsController->getPlacementJson($data);
// Kint::dump($returnData);
// $policy_terms = $LeadsController->convertNonEbQCRJsonToPolicyTerms(json_decode($returnData, true));
// Kint::dump($policy_terms);
// // $this->clientPolicyModel->where('id', 6050)->set('placement_json', $returnData)->update();
// $this->clientPolicyModel->where('id', 6050)->set('policy_terms', $policy_terms)->update();
// dd($returnData);
}
// -------------------------------------------------------------------------------------------------------

View File

@ -360,12 +360,13 @@ class EmployeeController extends AdminController
batch_files.status,
batch_files.client_branch_id,
CASE
WHEN batch_files.status = 'partially success' THEN
batch_files.error_data
CASE
WHEN batch_files.status = 'partially success' OR batch_files.status = 'in-progress-partially' THEN
batch_files.error_data
ELSE
error_data = null
END AS error_data,
NULL
END AS error_data,
clients.short_name as client_short_name,
client_branch.branch_name,

View File

@ -3112,6 +3112,8 @@ class EmployeeRestController extends AdminController
}
// ---------------- TICKET API's ---------------------------------------------------------------------------------------------------
//Get Data from post for inserting ticket and message
public function initiateClaim()
{
@ -3171,22 +3173,27 @@ class EmployeeRestController extends AdminController
->first()['id'];
$fetchData['priority'] = 1;
$fetchData['mode_of_intimation'] = 1;
$fetchData['mode_of_intimation'] = 3;
$fetchData['claim_type'] = 1;
$fetchData = array_merge($fetchData, $received_data);
$fetchData['relationship'] = strtolower($fetchData['relationship']) ?? $fetchData['relationship'];
// print_r($fetchData); die;
$insert_status = $this->ticketMaster->insert($fetchData);
$ticket_id = $this->ticketMaster->insertID();
if ($insert_status && !empty($ticket_id)) {
//insert first history
$this->ticketController->putHistoryAfterInsert($fetchData, $ticket_id);
$messagesData = [
'ticket_id' => $ticket_id ?? null,
'sender' => 'user',
'claim_status' => $fetchData['claim_status_id'] ?? null,
'emp_mail' => $fetchData['emp_mail'] ?? null,
'mail_subject' => $fetchData['subject'] ?? null,
'mail_content' => $fetchData['message'] ?? null,
'mail_subject' => $fetchData['subject'] ?? "New Claim",
'mail_content' => $fetchData['message'] ?? "New Claim",
];
if (!empty($messagesData['ticket_id'])) {

View File

@ -177,7 +177,7 @@ class LeadsController extends BaseController
{
$data = $this->request->getPost();
if ($data['lead_type'] == 2) {
if ($data['lead_type'] != 1) {
$client_data = $this->clientModel->where('id', $data['client_id'])->where('is_active', 1)->first();
$data['client_name'] = $client_data['client_name'];
$data['client_short_name'] = $client_data['short_name'];
@ -549,7 +549,7 @@ class LeadsController extends BaseController
// dd($lead_data);
if ($lead_data['lead_type'] == 2) {
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'];
}
@ -576,7 +576,7 @@ class LeadsController extends BaseController
$data['subject'] = $this->transformMailContent($lead_data, $subject, $data['page_name']);
// dd($data);
if ($data['lead_data']['lead_form_type'] == 1) {
$this->loadLayout('view_rfq.php', $data);
@ -584,10 +584,20 @@ class LeadsController extends BaseController
$data['occupancy'] = $this->occupancyModel->findAll();
// dd($data['occupancy']);
$data['policies'] = json_decode($data['question_json'], true)['policies'];
$data["child_table_data"] = json_decode($data['question_json'], true)['child_table_data'];
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(!empty($data['question_json'])){
$data['policies'] = json_decode($data['question_json'], true)['policies'];
$data["child_table_data"] = json_decode($data['question_json'], true)['child_table_data'];
}
// $data['lead_register_data'] = json_decode($data['lead_data']['custom_fields']);
// dd($data['lead_register_data']);
// dd($data);
$data['client_type'] = $this->clientType;
$data['buisness_type'] = $this->buisnessType;
$this->loadLayout('view_rfq_non_eb', $data);
@ -681,6 +691,7 @@ class LeadsController extends BaseController
], 200);
}
public function createQCR()
{
@ -857,6 +868,7 @@ class LeadsController extends BaseController
$data = $this->convertJsonForQCR($data, $type);
// dd($data);
}
// dd($data);
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
@ -1022,7 +1034,7 @@ class LeadsController extends BaseController
// Merge header cells if it spans multiple subheaders
if ($subHeaderCount > 1) {
$endColumn = chr(ord($startColumn) + $subHeaderCount - 1); // Calculate the end column
$endColumn = Coordinate::stringFromColumnIndex(Coordinate::columnIndexFromString($startColumn) + $subHeaderCount - 1);
$sheet->mergeCells("{$startColumn}{$rowNumber}:{$endColumn}{$rowNumber}");
} else {
$endColumn = $startColumn; // No merge needed if only one subheader
@ -1050,7 +1062,8 @@ class LeadsController extends BaseController
}
// Apply border to the header range
$headerRange = "A{$rowNumber}:" . chr(ord($columnLetter) - 1) . "{$subHeaderRow}";
$prevColumn1 = $this->getPreviousColumn($columnLetter);
$headerRange = "A{$rowNumber}:" . "{$prevColumn1}" . "{$subHeaderRow}";
$sheet->getStyle($headerRange)->applyFromArray([
'borders' => [
'allBorders' => [
@ -1089,7 +1102,8 @@ class LeadsController extends BaseController
$serial_no++;
}
$dataRange = "A" . ($subHeaderRow + 1) . ":" . chr(ord($columnLetter) - 1) . ($rowNumber - 1);
$prevColumn2 = $this->getPreviousColumn($columnLetter);
$dataRange = "A" . ($subHeaderRow + 1) . ":" . "{$prevColumn2}" . ($rowNumber - 1);
$sheet->getStyle($dataRange)->applyFromArray([
'borders' => [
'allBorders' => [
@ -1136,7 +1150,8 @@ class LeadsController extends BaseController
$rowNumber++;
}
$premiumRange = "B" . ($rowNumber - 4) . ":" . chr(ord($columnLetter) - 2) . ($rowNumber - 1);
$prevColumn3 = $this->getPreviousColumn($columnLetter, 2);
$premiumRange = "B" . ($rowNumber - 4) . ":" . "{$prevColumn3}" . ($rowNumber - 1);
// dd($premiumRange);
$sheet->getStyle($premiumRange)->applyFromArray([
'borders' => [
@ -2271,8 +2286,6 @@ class LeadsController extends BaseController
'policy_status' => 1,
];
$terms = $this->preparePolicyTermsFromRFQ($data);
$policy_type_id = $data['policy_type_id'];
if (in_array($policy_type_id, [1, 2, 6, 7])) {
$client_policy_data['is_addon'] = 1; // Base Policy
@ -2286,8 +2299,17 @@ class LeadsController extends BaseController
// }
}
$client_policy_data['policy_terms'] = $this->preparePolicyTermsFromRFQ($data);
if($data['lead_form_type'] == 1){
$client_policy_data['policy_terms'] = $this->preparePolicyTermsFromRFQ($data);
}else{
$placementJson = $this->getPlacementJson($data);
if ($placementJson) {
$client_policy_data['placement_json'] = $placementJson;
$client_policy_data['policy_terms'] = $this->convertNonEbQCRJsonToPolicyTerms(json_decode($placementJson, true));
}
}
// print_r($client_policy_data); die;
return $client_policy_data;
@ -2297,7 +2319,7 @@ class LeadsController extends BaseController
{
$proposel_data = json_decode($data['proposel_data'], true);
$QCRData = $this->RFQModel->where('is_active', 1)->where('type', 2)->where('lead_id', $data['id'])->first();
$QCRData = $this->RFQModel->where('is_active', 1)->where('lead_id', $data['id'])->first();
$JSON = json_decode($QCRData['json'], true);
@ -2384,6 +2406,53 @@ class LeadsController extends BaseController
return json_encode($terms_array);
}
public function convertNonEbQCRJsonToPolicyTerms($allTableData)
{
if (!empty($allTableData)) {
array_pop($allTableData); // Remove the last item from the array
$terms_array = [];
foreach ($allTableData as $TableIndex => $tableGroup) {
if ($TableIndex == 0) {
continue;
}
foreach ($tableGroup['table_data']['data'] as $dataRow) {
$item = $dataRow['items'] ?? '';
foreach ($dataRow['data'] as $cellData) {
$parentth = $cellData['parentth'] ?? '';
$subth = $cellData['subth'] ?? '';
$value = $cellData['display_content'] ?? '';
// Skip unwanted keys
if (in_array($parentth, ['SNO', 'Particulars', 'Action']) || $subth === 'Quote Asked') {
continue;
}
// Skip if item matches parentth
if ($item === $parentth) {
continue;
}
// Set the value directly, overwriting with latest encountered
if (!empty($item) && !empty($value)) {
$terms_array[$item] = $value;
}
}
}
}
return json_encode($terms_array);
} else {
return null;
}
}
public function featchClientPolicyFromLead($client_id, $branch_id, $lead_id)
{
$data = $this->leadsModel->where('leads.id', $lead_id)->where('leads.is_active', 1)->first();
@ -2404,6 +2473,58 @@ class LeadsController extends BaseController
return $this->respond(['status' => false, 'message' => 'Failed to create policy', 'data' => $data], 200);
}
public function getPlacementJson(array $data): ?string
{
$proposel_data = json_decode($data['proposel_data'], true);
$QCRData = $this->RFQModel
->where('is_active', 1)
->where('lead_id', $data['id'])
->first();
if (!$QCRData || empty($QCRData['json'])) {
return null;
}
$jsonArray = json_decode($QCRData['json'], true);
$proposalData = array_pop($jsonArray); // Get last item and remove it from the array
if (empty($jsonArray)) {
return null;
}
$placement_json_data = array_map(function ($jsonData) use ($proposel_data) {
return $this->transformNonEbProposelData(
$jsonData,
$proposel_data['proposel_name'] ?? '',
$proposel_data['insurer_name'] ?? '', null, 1
);
}, $jsonArray);
if (!empty($proposalData)) {
foreach ($proposalData['proposal_data']['over_all_column_data'] as $key => &$proposal) {
// Keep only the required proposal
if ($key !== $proposel_data['proposel_name']) {
unset($proposalData['proposal_data']['over_all_column_data'][$key]);
} else {
// Within the matched proposal, filter insurers
if (!empty($proposal['insurers'])) {
$proposal['insurers'] = array_values(array_filter($proposal['insurers'], function ($insurer) use ($proposel_data) {
return $insurer['display_name'] === $proposel_data['insurer_name'];
}));
}
}
}
unset($proposal); // Good practice after foreach by reference
}
$placement_json_data[] = $proposalData;
return json_encode($placement_json_data);
}
//------------------------------------------------------------------------------------------------
@ -2652,6 +2773,7 @@ class LeadsController extends BaseController
// Initialize max width tracking variables
$maxWidthB = 0;
//Lead Data
foreach ($lead_data as $key => $value) {
$formattedKey = ucwords(str_replace('_', ' ', $key));
@ -2692,9 +2814,113 @@ class LeadsController extends BaseController
$sheet->getColumnDimension('C')->setWidth($maxWidthB * 1.2);
$rowNumber += 2;
//Policy Registration
if (!empty($policy_registration_data)) {
foreach ($policy_registration_data as $key => $value) {
// Kint::dump($jsonData);
$startRow = $rowNumber; // Track where the block starts
// Title Row
$titleMergeRangeKey = "A{$rowNumber}:C{$rowNumber}";
$sheet->mergeCells($titleMergeRangeKey);
$sheet->setCellValue("A{$rowNumber}", ucfirst($key) . " Policy Details");
// Title Style
$sheet->getStyle($titleMergeRangeKey)->applyFromArray([
'font' => ['bold' => true],
'alignment' => [
'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
],
'fill' => [
'fillType' => Fill::FILL_SOLID,
'startColor' => ['rgb' => 'ADD8E6'],
],
]);
$rowNumber++; // Move to next row
// Policy Type
if (isset($value['policyType'])) {
$sheet->mergeCells("A{$rowNumber}:B{$rowNumber}");
$sheet->setCellValue("A{$rowNumber}", "Policy Type");
$sheet->setCellValue("C{$rowNumber}", $value['policyType']);
$sheet->getStyle("A{$rowNumber}:C{$rowNumber}")->applyFromArray([
'font' => ['bold' => true],
'alignment' => [
'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
],
]);
$rowNumber++;
}else{
$sheet->mergeCells("A{$rowNumber}:B{$rowNumber}");
$sheet->setCellValue("A{$rowNumber}", "Policy Type");
$sheet->setCellValue("C{$rowNumber}", ucfirst($key) . " Policy");
$sheet->getStyle("A{$rowNumber}:C{$rowNumber}")->applyFromArray([
'font' => ['bold' => true],
'alignment' => [
'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
],
]);
$rowNumber++;
}
// Type of Business & Nature of Business
if (isset($value['productSelection']) && !empty($value['productSelection'])) {
// Type of Business
$sheet->mergeCells("A{$rowNumber}:B{$rowNumber}");
$sheet->setCellValue("A{$rowNumber}", "Type of Business");
$sheet->setCellValue("C{$rowNumber}", $this->buisnessType[$value['productSelection']['type_of_buisness']] ?? '');
$sheet->getStyle("A{$rowNumber}")->applyFromArray([
'font' => ['bold' => true],
'alignment' => [
'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
],
]);
$rowNumber++;
// Nature of Business
$sheet->mergeCells("A{$rowNumber}:B{$rowNumber}");
$sheet->setCellValue("A{$rowNumber}", "Nature of Business");
$sheet->setCellValue("C{$rowNumber}", $value['productSelection']['buisness_nature'] ?? '');
$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
$sheet->getStyle("A{$startRow}:C{$endRow}")->applyFromArray([
'borders' => [
'allBorders' => [
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN,
'color' => ['argb' => '000000'],
],
],
]);
$rowNumber += 2; // Add space before the next block
}
}
//Table Data
foreach ($jsonData as $key => $data) {
// Kint::dump($data, 'First');
@ -2768,7 +2994,7 @@ class LeadsController extends BaseController
// Merge header cells if it spans multiple subheaders
if ($subHeaderCount > 1) {
$endColumn = chr(ord($startColumn) + $subHeaderCount - 1); // Calculate the end column
$endColumn = Coordinate::stringFromColumnIndex(Coordinate::columnIndexFromString($startColumn) + $subHeaderCount - 1);
$sheet->mergeCells("{$startColumn}{$rowNumber}:{$endColumn}{$rowNumber}");
} else {
$endColumn = $startColumn; // No merge needed if only one subheader
@ -2796,7 +3022,8 @@ class LeadsController extends BaseController
}
// Apply border to the header range
$headerRange = "A{$rowNumber}:" . chr(ord($columnLetter) - 1) . "{$subHeaderRow}";
$prevColumn4 = $this->getPreviousColumn($columnLetter);
$headerRange = "A{$rowNumber}:" . "{$prevColumn4}" . "{$subHeaderRow}";
$sheet->getStyle($headerRange)->applyFromArray([
'borders' => [
'allBorders' => [
@ -2812,13 +3039,17 @@ class LeadsController extends BaseController
$rowNumber = $subHeaderRow + 2;
$column_data = $data['table_data']['data'];
// dd($column_data);
$serial_no = 1;
$maxColumnWidths = [];
$RowSpanEnable = false;
// Add table data rows
foreach ($column_data as $dataRow) {
$columnLetter = 'A';
$hasPolicy = in_array('Policy', array_column($dataRow['data'], 'parentth'));
// Kint::dump($hasPolicy);
foreach ($dataRow['data'] as $cellData) {
@ -2837,16 +3068,31 @@ class LeadsController extends BaseController
$sheet->getStyle("{$columnLetter}{$mergeStart}:{$columnLetter}{$mergeEnd}")
->getAlignment()->setVertical(\PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER);
} else {
$sheet->setCellValue("{$columnLetter}{$rowNumber}", $cellData['display_content']);
if(!$hasPolicy && $key == 0){
$RowSpanEnable = true;
$columnLetter++;
$sheet->setCellValue("{$columnLetter}{$rowNumber}", $cellData['display_content']);
}else{
$sheet->setCellValue("{$columnLetter}{$rowNumber}", $cellData['display_content']);
}
}
$columnLetter++;
if (!($key === 0 && !$hasPolicy)) {
$columnLetter++;
}
}
$rowNumber++;
$serial_no++;
}
$dataRange = "A" . ($subHeaderRow + 1) . ":" . chr(ord($columnLetter) - 1) . ($rowNumber - 1);
if($key == 0 && $RowSpanEnable == true){
$columnLetter++;
}
// dd($columnLetter);
$prevColumn5 = $this->getPreviousColumn($columnLetter);
$dataRange = "A" . ($subHeaderRow + 1) . ":" . "{$prevColumn5}" . ($rowNumber - 1);
$sheet->getStyle($dataRange)->applyFromArray([
'borders' => [
'allBorders' => [
@ -2991,8 +3237,12 @@ class LeadsController extends BaseController
}
// Row-wise Check: Remove rows if qcr == 0 for actions
$groupedRows = [];
foreach ($first_json['table_data']['data'] as $rowKey => $rowData) {
foreach ($rowData['data'] as $data) {
$groupedRows[$rowData['row_id']][] = $rowData;
foreach ($rowData['data'] as $keyIndex => $data) {
if ($indexOfTheTable == 0) {
@ -3013,6 +3263,42 @@ class LeadsController extends BaseController
}
}
$finalRows = [];
if (!empty($groupedRows)) {
// Loop through each row_id group and check for Policy status
foreach ($groupedRows as $rowId => $rows) {
$hasPolicy = false;
$isChecked = false;
foreach ($rows as $row) {
foreach ($row['data'] as $cell) {
if ($cell['parentth'] === 'Policy') {
$hasPolicy = true;
if (trim(strtolower($cell['input_value'])) === 'checked') {
$isChecked = true;
}
break 2; // Found Policy, no need to continue further
}
}
}
// Step 3: If parent Policy is "Checked", retain the entire group
if (!$hasPolicy || $isChecked) {
foreach ($rows as $r) {
$finalRows[] = $r;
}
}
}
if (!empty($finalRows)) {
// Update the original data
$first_json['table_data']['data'] = array_values($finalRows);
}
}
// Reindex arrays to maintain proper structure
$first_json['table_data']['headers'] = array_values($first_json['table_data']['headers']);
$first_json['table_data']['data'] = array_values($first_json['table_data']['data']);
@ -3033,6 +3319,7 @@ class LeadsController extends BaseController
}
//Remove insurer Row wise data for RFQ
$groupedRows = [];
foreach ($first_json['table_data']['data'] as &$row) {
// Filter the inner data array
@ -3044,11 +3331,48 @@ class LeadsController extends BaseController
);
$row['data'] = array_values($row['data']);
}
$groupedRows[$row['row_id']][] = $row;
}
// Ensure to unset the reference after the loop
unset($row);
$finalRows = [];
if (!empty($groupedRows)) {
// Loop through each row_id group and check for Policy status
foreach ($groupedRows as $rowId => $rows) {
$hasPolicy = false;
$isChecked = false;
foreach ($rows as $row) {
foreach ($row['data'] as $cell) {
if ($cell['parentth'] === 'Policy') {
$hasPolicy = true;
if (trim(strtolower($cell['input_value'])) === 'checked') {
$isChecked = true;
}
break 2; // Found Policy, no need to continue further
}
}
}
// Step 3: If parent Policy is "Checked", retain the entire group
if (!$hasPolicy || $isChecked) {
foreach ($rows as $r) {
$finalRows[] = $r;
}
}
}
if (!empty($finalRows)) {
// Update the original data
$first_json['table_data']['data'] = array_values($finalRows);
}
}
// Remove insurers from Proposal Data key for RFQ
foreach ($proposeldata['proposal_data']['over_all_column_data'] as $key => &$proposal) {
if (isset($proposal['insurers'])) {
@ -3060,12 +3384,12 @@ class LeadsController extends BaseController
// Ensure to reset the reference
unset($proposal);
}
return $first_json;
return $first_json;
return null;
}
public function transformNonEbProposelData(&$data, $proposal, $insurer, $tableCount)
public function transformNonEbProposelData(&$data, $proposal, $insurer, $tableCount=null, $actionColumn = null)
{
// Kint::dump($data, $proposal, $insurer, $tableCount);
@ -3102,6 +3426,13 @@ class LeadsController extends BaseController
// Update the original data's headers
$data['table_data']['headers'] = $headerData;
if(!empty($actionColumn)){
$data['table_data']['headers'][] = [
'parentHeader' => "Action",
'subHeaders' => ['-']
];
}
foreach ($data['table_data']['data'] as &$entry) {
$sno = $entry['SNO'];
@ -3126,6 +3457,12 @@ class LeadsController extends BaseController
if ($item['parentth'] === $proposal && $item['subth'] === $insurer) {
$filteredData[] = $item;
}
if(!empty($actionColumn)){
if($item['parentth'] === "Action"){
$filteredData[] = $item;
}
}
}
// Update the entry with filtered data
@ -3139,5 +3476,20 @@ class LeadsController extends BaseController
// kint::dump($data);
return $data;
}
// function getPreviousColumn($columnLetter)
// {
// $colIndex = Coordinate::columnIndexFromString($columnLetter);
// if ($colIndex > 1) {
// $colIndex--;
// }
// return Coordinate::stringFromColumnIndex($colIndex);
// }
function getPreviousColumn($columnLetter, $decrement = 1) {
$colIndex = Coordinate::columnIndexFromString($columnLetter);
$colIndex = max(1, $colIndex - $decrement); // ensure column index doesn't go below 1
return Coordinate::stringFromColumnIndex($colIndex);
}
}

View File

@ -418,7 +418,7 @@ class PolicyTransactionController extends BaseController
// die;
if(isset($data['co_share_id']) && !empty($data['co_share_id'])){
$this->removePtCoShareRecords($data['co_share_id']);
$this->removePtCoShareRecords($data['co_share_id'], $pt_id);
}
if(isset($data['follow_insurer_id'])){
@ -967,21 +967,26 @@ class PolicyTransactionController extends BaseController
}
//function for soft delete for pt_co_share_details records
public function removePtCoShareRecords($primaryKeys)
public function removePtCoShareRecords($primaryKeys, $pt_id)
{
// print_r($primaryKeys); die;
if (empty($primaryKeys)) {
return false;
}
// Convert array to a comma-separated string for query binding
// Convert array to a comma-separated string of placeholders for query binding
$placeholders = implode(',', array_fill(0, count($primaryKeys), '?'));
$sql = "UPDATE pt_co_share_details SET is_active = 0 WHERE id NOT IN ($placeholders)";
return db_connect()->query($sql, $primaryKeys);
// Prepare the query with proper binding
$sql = "UPDATE pt_co_share_details SET is_active = 0 WHERE pt_id = ? AND id NOT IN ($placeholders)";
// Merge pt_id with primary keys for binding
$params = array_merge([$pt_id], $primaryKeys);
// Execute the query with bound parameters
return db_connect()->query($sql, $params);
}
//------------------------------------------------------------------------------------------------

View File

@ -178,6 +178,46 @@ class RestAuthenticationController extends AdminController
}
public function updateEmpMPIN()
{
$requestData = $this->request->getJSON();
$mobile_number = $requestData->mobile_number ?? null;
$email_id = $requestData->email_id ?? null;
$new_mpin = $requestData->new_mpin ?? $requestData->mpin ?? null;
$old_mpin = $requestData->old_mpin ?? null;
if (!$new_mpin) {
return $this->response->setJSON(['status' => false, 'message' => 'MPIN is required.']);
}
$query = $this->employeeModel->where('relationship', 'self');
if ($mobile_number) {
$query->where('mobile', $mobile_number);
} elseif ($email_id) {
$query->where('email_corporate', $email_id);
} else {
return $this->response->setJSON(['status' => false, 'message' => 'Mobile number or Email ID is required.']);
}
if (!empty($old_mpin)) {
$query->where('mpin', $old_mpin);
}
// Fetch employee data
$employeeData = $query->first();
if (!$employeeData) {
return $this->response->setJSON(['status' => false, 'message' => 'Employee not found or invalid MPIN.']);
}
// Update MPIN
$updated = $this->employeeModel->update($employeeData['id'], ['mpin' => $new_mpin]);
return true;
}
public function getVerifiedUserData()
{
@ -401,15 +441,14 @@ class RestAuthenticationController extends AdminController
$mobile_number = isset($this->request->getJSON()->mobile_number) ? $this->request->getJSON()->mobile_number : null;
$email_id = isset($this->request->getJSON()->email_id) ? $this->request->getJSON()->email_id : null;
$mpin = $this->request->getJSON()->mpin;
if (isset($mobile_number))
{
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first();
}else{
$employeeData = $this->employeeModel->where('email_corporate', $email_id)->where('relationship', 'self')->first();
}
if ($employeeData && $mpin == $employeeData["mpin"]) {
$auth = HttpRequestHelper::getRequestInfo();
if ($auth) {
$data = [
@ -427,6 +466,7 @@ class RestAuthenticationController extends AdminController
$result = JWTToken::encode($employeeData);
// $result = $employeeData;
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
} else {
return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP"],200);
@ -441,7 +481,7 @@ class RestAuthenticationController extends AdminController
try {
$mobile_number = isset($this->request->getJSON()->mobile_number) ? $this->request->getJSON()->mobile_number : null;
$email_id = isset($this->request->getJSON()->email_id) ? $this->request->getJSON()->email_id : null;
$mpin = $this->request->getJSON()->mpin;
// $mpin = $this->request->getJSON()->mpin;
if (isset($mobile_number))
{

View File

@ -120,6 +120,8 @@ class TicketController extends BaseController
'((POLICY_TYPE))' => 'policy_type',
'((AUTO_QUERY_CONTENT))' => 'auto_query_content',
'((CLAIM_FORM_LINK))' => 'claim_form_link',
'((CLAIM_FEEDBACK_FORM))' => 'claim_feedback_form',
'((SETTLED_LETTER))' => 'settle_letter',
];
$this->extraFields = [
1 => ['non_id_reason'],
@ -232,7 +234,9 @@ class TicketController extends BaseController
'tcs.claim_status AS status',
'tm.claim_number AS claim_no',
'tm.tpa_id',
'tm.tpa_no',
'tm.emp_name',
'tm.emp_code',
'i.name AS insurer_name',
'c.client_name',
'tm.insured_name',
@ -272,7 +276,9 @@ class TicketController extends BaseController
'tm.claim_status_id',
'tm.is_head_approved',
'tm.tpa_id',
'tm.tpa_no',
'tm.emp_name',
'tm.emp_code',
'i.name AS insurer_name',
'c.client_name',
'tm.insured_name',
@ -456,7 +462,18 @@ class TicketController extends BaseController
$data['placeHolders'] = $this->placeHolders;
$data['message_data'] = $this->getTicketMessage($ticket_id);
$data['view_ticket_page'] = [];
$data['member_data'] = $this->employeeModel->getEmployeeByEmployeeCode($ticket_data['emp_code']);
if($ticket_data['ticket_type_id'] == 1){
$data['member_data'] = $this->employeeModel->getEmployeeByEmployeeCode($ticket_data['emp_code']);
}else{
$data['member_data'] = array_filter(
$this->employeeModel->getEmployeeByEmployeeCode($ticket_data['emp_code']),
function ($member) {
return isset($member['emp_relationship']) && $member['emp_relationship'] == 'Self';
}
);
}
$data['ticket_history'] = $this->ticketHistory($ticket_id);
$data['ticket_check_list'] = db_connect()->table('ticket_check_list')->where('is_active', 1)->where('ticket_type_id', $ticket_data['ticket_type_id'])->get()->getResultArray();
if (!empty($ticket_data['client_policy_id'])){
@ -578,7 +595,9 @@ class TicketController extends BaseController
$return_value = $this->ticketMasterModel->insert($ticket_data);
if ($return_value) {
//mail trigger part
$this->putHistoryAfterInsert($ticket_data, $return_value);
$mail_responce = $this->sendAutoMailTrigger($return_value);
$this->autoMessageInsertBasedOnMailResponse($mail_responce, $return_value);
return $this->respond(['status' => true, 'ticket_id' => $return_value, 'code' => 200, 'data' => $ticket_data, "message" => "Claim created successfully", 'mail_responce' => $mail_responce], 200);
} else {
return $this->respond(['status' => false, 'code' => 404, 'message' => 'Failed to create claim'], 200);
@ -601,8 +620,12 @@ class TicketController extends BaseController
$return_value = $this->ticketMasterModel->where('id', $ticket_id)->set($ticket_data)->update();
if ($return_value) {
//mail trigger part
$mail_responce = $this->sendAutoMailTrigger($ticket_id);
$mail_responce = null;
if($old_ticket_data['claim_status_id'] != $ticket_data['claim_status_id']){
//mail trigger part
$mail_responce = $this->sendAutoMailTrigger($ticket_id);
$this->autoMessageInsertBasedOnMailResponse($mail_responce, $ticket_id);
}
//send mail to the head for rejected ticket approvel
if($ticket_data['claim_status_id'] == 8 && $ticket_data['is_head_approved'] == 0){
@ -837,7 +860,7 @@ class TicketController extends BaseController
}
// Construct Mail Data
$mailData = [
$mailData[] = [
'mail' => $ticket_data['emp_mail'],
'subject' => $subject,
'message' => $message,
@ -845,6 +868,17 @@ class TicketController extends BaseController
'attachments' => []
];
// if the employee personal mail is not empty then send the mail to the employee personal mail
if(!empty($ticket_data['emp_personal_mail'])){
$mailData[] = [
'mail' => $ticket_data['emp_personal_mail'],
'subject' => $subject,
'message' => $message,
'cc' => $ticket_data['common_mails'] ?? '',
'attachments' => []
];
}
// print_r($mailData); die;
$this->myLogger->logme('error', "Final Email Data");
@ -869,6 +903,10 @@ class TicketController extends BaseController
$replaceData = str_replace("Claim-", "", $this->ticketType[$ticket_data['ticket_type_id']] ?? "");
} else if ($value == "claim_form_link"){
$replaceData = '<a href="' . base_url('claim-form-download/' . md5($ticket_data['insurer_id'])) . '" target="_blank">Click here to download Claim Form</a>';
} else if ($value == "claim_feedback_form" && $ticket_data['ticket_type_id'] == 1){
$replaceData = '<a href="' . base_url('claims-feedback-form/' . md5($ticket_data['id'])) . '" target="_blank">Click to open Claim Feedback Form</a>';
} else if ($value == "settle_letter"){
$replaceData = '<a href="' . $ticket_data['settle_letter'] . '" target="_blank"> View Settlement Letter </a>';
}else {
$replaceData = isset($ticket_data[$value]) ? $ticket_data[$value] : '';
}
@ -927,6 +965,27 @@ class TicketController extends BaseController
$this->myLogger->logme('error', "Fetched ACM emails");
if(!empty($ticket_data['emp_personal_mail'])){
$this->myLogger->logme('error', "Send employee personal mail start");
$emailPersonalData = [
'mail' => $ticket_data['emp_personal_mail'],
'subject' => $mail_data['mail_subject'],
'message' => $mail_data['mail_content'],
'common' => [],
'cc' => $acm_mails['common_mails'],
'attachments' => []
];
$this->sendTrigger($emailPersonalData);
$this->myLogger->logme('error', "Send employee personal mail successfully");
}else{
$this->myLogger->logme('error', "Send employee personal mail is empty");
}
$emailData = [
'mail' => $mail_data['emp_mail'],
'subject' => $mail_data['mail_subject'],
@ -950,7 +1009,10 @@ class TicketController extends BaseController
if (!empty($auto_mail_enable) && $auto_mail_enable['is_auto_mail'] == 1) {
$mail_content = $this->constructMailContent($ticket_id);
// print_r($mail_content); die;
$mail_responce = $this->sendTrigger($mail_content);
foreach ($mail_content as $key => $value) {
$mail_responce = $this->sendTrigger($value);
$this->myLogger->logme('error', '{data} - Auto Mail Sent, Successfully', ['data' => $key + 1]);
}
} elseif (!empty($auto_mail_enable) && $auto_mail_enable['is_auto_mail'] == 0) {
$this->myLogger->logme('error', 'Auto Mail Not Sent, Reason: Automail Not Enabled');
} else {
@ -1371,7 +1433,8 @@ class TicketController extends BaseController
}
}
public function getPoliciesbyEmpID() {
public function getPoliciesbyEmpID()
{
$received_data = $this->request->getPost();
$emp_id = $received_data['emp_id'];
@ -1443,5 +1506,121 @@ class TicketController extends BaseController
return $this->response->setStatusCode(500)->setBody('An error occurred while downloading the file.');
}
}
// -------------------------------------------------------------------------------------------------------------------------
public function autoMessageInsertBasedOnMailResponse($mail_sent_status, $ticket_id)
{
if (gettype($mail_sent_status) == 'array') {
$this->myLogger->logme('error', "auto Message Insert Based On Mail Response Failed because is array :$ticket_id ");
} else {
$mail_sent_status = json_decode($mail_sent_status);
$this->myLogger->logme('error', "mail_sent_status is object :$ticket_id ");
}
if (!empty($mail_sent_status) && isset($mail_sent_status->status) && $mail_sent_status->status == 'success') {
$sent_message_data['ticket_id'] = $ticket_id;
$sent_message_data['sender'] = 'staff';
$sent_message_data['emp_mail'] = $mail_sent_status->data->params->mail;
$sent_message_data['mail_subject'] = $mail_sent_status->data->params->subject;
$sent_message_data['mail_content'] = $mail_sent_status->data->params->message;
$message_insert_status = $this->ticketMessageModel->insert($sent_message_data);
if ($message_insert_status) {
$this->myLogger->logme('error', "Claim initiated, Mail sent Successfully, successfully store message:$ticket_id ");
} else {
$this->myLogger->logme('error', "Claim initiated, Mail sent Successfully, Failed to store message:$ticket_id ");
}
return true;
} else {
$this->myLogger->logme('error', "Failed to send Mail :$ticket_id ");
return true;
}
}
public function putHistoryAfterInsert($ticket_data, $ticket_id)
{
$this->myLogger->logme('error', "Put History After Insert function called : $ticket_id");
if(!empty($ticket_data)){
$history_data = [
'ticket_id' => $ticket_id,
'field_name' => 'claim_status_id',
'display_name' => 'Ticket Created',
'old_value' => null,
'new_value' => $ticket_data['claim_status_id'],
'created_by' => get_session_userid(),
'is_active' => 1
];
$this->myLogger->logme('error', "Put History After Insert function called : " . json_encode($history_data));
$history_insert = $this->ticketHistoryModel->insert($history_data);
if($history_insert){
$this->myLogger->logme('error', "Put History After Insert Ticket Data Successfully");
}else{
$this->myLogger->logme('error', "Put History After Insert Ticket Data Failed");
}
}else{
$this->myLogger->logme('error', "Put History After Insert Ticket Data is empty");
}
return true;
}
public function viewClaimFeedbackForm($md5_ticket_id,$empView = null)
{
if ($this->request->is("get")){
$data['ticket_id'] = $md5_ticket_id;
$data['ticket_data'] = $this->ticketMasterModel->select('ticket_master.*,clients.client_name')->join('clients','clients.id = ticket_master.client_id')->where('MD5(ticket_master.id)',$md5_ticket_id)->where('ticket_master.is_active',1)->first();
$data['form_submitted'] = !empty($data['ticket_data']['feedback_json'])? 1 : 0;
$data['viewer'] = !empty($empView) ? $empView : 0;
// dd($data);
return view('ticket_feedback_form', $data);
}else{
$formDataJson = json_encode($this->request->getPost());
// log_message("error","Form data : ".$formDataJson);
$data_to_store = [
'feedback_json' => $formDataJson
];
if (!empty($formDataJson)){
// $this->ticketMasterModel->save($data_to_store);
$this->ticketMasterModel->where('MD5(id)', $md5_ticket_id)->set($data_to_store)->update();
return $this->respond(['status' => true,'id'=> $md5_ticket_id,'received_data' => $formDataJson], 200);
}else{
return $this->respond(['status' => false,'id'=> $md5_ticket_id,'received_data' => $formDataJson], 200);
}
}
}
public function feedbackList(){
$data['feedback_data'] = $this->ticketMasterModel->select("ticket_master.*,clients.client_name")->join("clients","clients.id = ticket_master.client_id")->where("ticket_master.is_active",1)->where("ticket_master.feedback_json IS NOT NULL", null, false)->where("ticket_master.feedback_json !=", "")->findAll();
// dd($data);
$this->loadLayout("ticket_feedback_list",$data);
}
}

View File

@ -29,6 +29,7 @@ class ExcelSanitizeHelper
$cleanData[$key] = self::sanitizeArrayData($value); // Recursive call for nested arrays
} elseif (is_string($value)) {
// Remove non-printable characters and trim whitespace from strings
$value = str_replace("\u00a0", " ", $value);
$cleanData[$key] = trim(preg_replace(self::$nonPrintablePattern, '', $value));
} else {
$cleanData[$key] = $value; // Keep non-string/non-array data as is

View File

@ -665,3 +665,15 @@ if (!function_exists('check_pay_by_employee_or_company')) {
}
if (!function_exists('is_json_string')) {
function is_json_string($string)
{
if (!is_string($string)) {
return false;
}
$decoded = json_decode($string, true);
return (json_last_error() === JSON_ERROR_NONE && is_array($decoded));
}
}

View File

@ -54,6 +54,7 @@ class ClientPolicyModel extends Model
"is_member_modify_allowed",
"cd_ac_pk",
"is_lgbtq",
"placement_json",
];
// Callbacks

View File

@ -81,6 +81,146 @@ class EmployeePolicyModel extends Model
}
// ----------------------------------------------------------------------------------------------------------
// public function getEmployeePolicy($client_id = 0, $policy_id = 0, $status = [], $branch_id = 0, $emp_code = "", $emp_name = "")
// {
// // dd($status);
// $result = $this->select([
// 'employee_polices.*',
// 'policy_type.policy_type as policy_name',
// 'im.short_name as insurer_short_name',
// 'ib.branch_name as insurer_branch_name',
// 'ib.branch_code as insurer_branch_code',
// 'tpam.name as tpa_name',
// 'tpam.short_name as tpa_short_name',
// 'tpab.branch_code as tpa_branch_code',
// 'cm.client_name',
// 'cm.short_name as client_short_name',
// // 'emp.id as employee_primary_id',
// 'emp.relationship',
// 'emp.relationship_code',
// 'emp.change_event',
// 'emp.emp_code',
// 'emp.name',
// 'emp.email_corporate',
// 'emp.dob',
// 'DATE_FORMAT(emp.dob, "%d/%m/%Y") AS formatted_dob',
// 'emp.gender',
// 'emp.emp_status',
// 'emp.is_active as emp_is_active',
// 'emp.mobile as mobile',
// 'emp.doj',
// 'emp.basic_pay',
// 'emp.band as grade',
// 'policy_type.policy_type',
// 'client_branch.branch_name as client_branch_name',
// 'client_branch.branch_code as client_branch_code',
// 'cp.policy_no',
// 'cp.policy_type_id',
// // Name audit trail
// '(SELECT old_value FROM auditing_history WHERE pk = emp.id AND field_name = "name" AND table_name = "employees" ORDER BY id ASC LIMIT 1) AS name_first_old',
// '(SELECT new_value FROM auditing_history WHERE pk = emp.id AND field_name = "name" AND table_name = "employees" ORDER BY id DESC LIMIT 1) AS name_last_new',
// // DOB audit trail
// '(SELECT old_value FROM auditing_history WHERE pk = emp.id AND field_name = "dob" AND table_name = "employees" ORDER BY id ASC LIMIT 1) AS dob_first_old',
// '(SELECT new_value FROM auditing_history WHERE pk = emp.id AND field_name = "dob" AND table_name = "employees" ORDER BY id DESC LIMIT 1) AS dob_last_new',
// // Gender audit trail
// '(SELECT old_value FROM auditing_history WHERE pk = emp.id AND field_name = "gender" AND table_name = "employees" ORDER BY id ASC LIMIT 1) AS gender_first_old',
// '(SELECT new_value FROM auditing_history WHERE pk = emp.id AND field_name = "gender" AND table_name = "employees" ORDER BY id DESC LIMIT 1) AS gender_last_new',
// '(CASE
// WHEN emp.relationship = "Self"
// THEN (SELECT COUNT(id) FROM employees WHERE emp_code = emp.emp_code AND is_active = 0 AND emp_status != "truncated")
// ELSE NULL
// END) AS removed_count',
// '(CASE
// WHEN emp.relationship != "Self" AND emp.created_at != (
// SELECT created_at
// FROM employees
// WHERE emp_code = emp.emp_code AND relationship = "Self" AND is_active = 1
// LIMIT 1
// )
// THEN "Newly Added"
// ELSE NULL
// END) AS newly_added',
// ])
// ->join('employees emp', 'employee_polices.employee_id = emp.id')
// ->join('client_policy cp', 'employee_polices.client_policy_id = cp.id') //cp - client policy
// ->join('policies pm', 'cp.policy_id = pm.id', 'left') //pm - policy master
// ->join('policy_type', 'policy_type.id = cp.policy_type_id')
// ->join('insurers im', 'cp.insurer_id = im.id') //im - insurer master
// ->join('insurer_branch ib', 'cp.insurer_branch_id = ib.id') //ib - insurer branch
// ->join('tpa tpam', 'cp.tpa_id = tpam.id', 'left') //tpam - tpa master
// ->join('tpa_branch tpab', 'cp.tpa_branch_id = tpab.id', 'left') //tpab - tpa branch
// ->join('clients cm', 'cp.client_id = cm.id') //cm - client master
// ->join('client_branch', 'emp.client_branch_id = client_branch.id') //cm - client master
// ->orderBy('emp.emp_code', 'ASC')
// ->orderBy('employee_polices.employee_id', 'ASC');
// // Conditionally add where clauses
// if ($client_id != 0 && !empty($client_id)) {
// $result->where('emp.client_id', $client_id);
// }
// if ($branch_id != 0 && !empty($branch_id)) {
// $result->where('emp.client_branch_id', $branch_id);
// }
// if ($policy_id != 0 && !empty($policy_id)) {
// $result->where('employee_polices.client_policy_id', $policy_id);
// }
// if (is_array($status) && count($status) > 0) {
// $result->where('employee_polices.status !=', 'expired');
// if (in_array("active", $status)) {
// $result->where('employee_polices.tpa_id IS NOT NULL');
// $result->where('employee_polices.uhid IS NOT NULL');
// $result->whereIn('employee_polices.status', $status);
// } elseif (in_array("pending", $status)) {
// $result->where('employee_polices.tpa_id IS NULL');
// $result->where('employee_polices.uhid IS NULL');
// $result->whereIn('employee_polices.status', array_merge($status, ['active']));
// } else {
// $result->whereIn('employee_polices.status', $status);
// }
// // if($status == 'active'){
// // $result->where('employee_polices.tpa_id IS NOT NULL');
// // $result->where('employee_polices.uhid IS NOT NULL');
// // }else if($status == 'pending'){
// // $status = 'active';
// // $result->where('employee_polices.status', $status);
// // }else{
// // $result->where('employee_polices.status', $status);
// // }
// }
// if (!empty($emp_code)) {
// $result->where('emp.emp_code', $emp_code);
// }
// if (!empty($emp_name)) {
// $result->like('emp.name', $emp_name);
// }
// // Always check these conditions
// $result->where('employee_polices.is_active', 1)
// ->where('emp.is_active', 1);
// $res = $result->findAll();
// // dd($this->db->getLastQuery());
// return $res;
// } // remarks do not remove
public function getEmployeePolicy($client_id = 0, $policy_id = 0, $status = [], $branch_id = 0, $emp_code = "", $emp_name = "")
{
// dd($status);
@ -179,9 +319,11 @@ class EmployeePolicyModel extends Model
}
// Always check these conditions
$result->where('employee_polices.is_active', 1)
->where('emp.is_active', 1);
$result
->where('employee_polices.is_active', 1)
->where('emp.is_active', 1)
->where('employee_polices.status !=', 'inactive');
$res = $result->findAll();
// dd($this->db->getLastQuery());

View File

@ -12,7 +12,7 @@ class TicketHistoryModel extends Model
protected $returnType = 'array';
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = ['id','field_name','display_name','old_value',
protected $allowedFields = ['id', "ticket_id", 'field_name','display_name','old_value',
'new_value','created_by','created_at','updated_by','updated_at','is_active'];
// Callbacks

View File

@ -15,6 +15,7 @@ class TicketMasterModel extends Model
protected $allowedFields = [
'id',
'ticket_type_id',
'feedback_json',
'claim_status_id',
'acm_id',
'insurer_id',
@ -689,6 +690,7 @@ class TicketMasterModel extends Model
$query = $this->select('ticket_master.*, tms.mail_subject as subject')
->join('ticket_messages tms', 'ticket_master.id = tms.ticket_id', 'left')
->where('ticket_master.is_active', 1)
->where('tms.sender', "user")
->where('ticket_master.emp_id', $emp_id);
if (!empty($ticket_id)) {

View File

@ -90,6 +90,17 @@
&nbsp;
<?php } ?>
<?php } else if ($file['status'] == 'in-progress-partially') { ?>
<?php echo $file['status']; ?>
<?php if (!is_json_string($file['error_data'])) { ?>
<a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top" title="<?= $file['error_data'] ?>"></a>
&nbsp;
<?php } ?>
<?php } else if ($file['status'] == 'failed-1') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
@ -146,7 +157,7 @@
onclick="getBatchFileData(this)" class="dropdown-item upload_button" ><i class="mdi mdi-upload mr-2 text-muted font-18 vertical-middle"></i>Re-Upload</a>
<?php } ?>
<?php if (str_starts_with($file['status'], 'failed')) { ?>
<?php if ($file['actions'] == "import") { ?>
<a href="<?= base_url('/util/download_import_file/') . $file['id'] ?>" class="dropdown-item" style="color: #000;" aria-hidden="true" target="_blank" ><i class="mdi mdi-download mr-2 text-muted font-18 vertical-middle"></i>Download</a>
<?php } ?>

View File

@ -71,13 +71,10 @@ $(document).ready(function(){
$('#client_rm_edit').hide()
$('#account_manager').multiselect({
nonSelectedText: 'Select Account Manager',
enableFiltering: false,
enableCaseInsensitiveFiltering: false,
includeSelectAllOption : false,
buttonWidth:'100%'
});
$('#account_manager').prop('disabled', true);
$("textarea.select2-search__field").attr('rows', '1');
$("textarea.select2-search__field").css('resize', 'none');
var data = <?= isset($client_relation) ? json_encode($client_relation) : '[]' ?>;
@ -94,10 +91,16 @@ $(document).ready(function(){
}
});
$('#account_manager').multiselect('refresh');
$('#account_manager').select2({
placeholder: "Select Account Manager",
}).prop('disabled', true);
$("textarea.select2-search__field").attr('rows', '1');
$("textarea.select2-search__field").css('resize', 'none');
$('#head').prop('disabled', true);
$('#manager').prop('disabled', true);
$('#account_manager').multiselect('disable');
}
@ -172,14 +175,25 @@ $(document).ready(function(){
$('#manager').prop('disabled', !isDisabled);
if (isDisabled) {
$('#account_manager').multiselect('enable');
$('#account_manager').select2({
placeholder: "Select Account Manager",
}).prop('disabled', false);
$('#client_rm_btnSubmit').show();
$(this).html('<span id="rm_icons" class="fa fa-times-circle"></span> Close Edit ');
} else {
$('#account_manager').multiselect('disable');
$('#account_manager').select2({
placeholder: "Select Account Manager"
}).prop('disabled', true);
$('#client_rm_btnSubmit').hide();
$(this).html('<span id="rm_icons" class="mdi mdi-lead-pencil"></span> Edit ');
}
$("textarea.select2-search__field").attr('rows', '1');
$("textarea.select2-search__field").css('resize', 'none');
});

View File

@ -81,6 +81,13 @@
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script>
<!-- srinivas -->
<script src="https://editor.unlayer.com/embed.js"></script>
<!-- MD5 Hash Start -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/blueimp-md5/2.19.0/js/md5.min.js"></script>
<!-- MD5 Hash End -->
<!-- <script src="<?= base_url('public/unlayer/js/embed.js') . '' ?>"></script> -->
<!-- srinivas -->
<style>
@ -668,6 +675,9 @@
<li>
<a href="<?= base_url('/ticket/ticket_reports') ?>">Claim Reports</a>
</li>
<li>
<a href="<?= base_url('/ticket/feedback-list') ?>">Claim Feedback List</a>
</li>
</ul>
</div>
</li>

View File

@ -85,6 +85,7 @@ if (isset($selected_lead_type)) {
var policy_list = ''; // local variable for storing the client policy list
var temp_client_id = 0;
var temp_branch_id = 0;
var selected_lead_form_type = <?= isset($selected_lead_type) ? $selected_lead_type : 0 ?>;
// select2 document ready
$(document).ready(function() {
@ -188,7 +189,9 @@ if (isset($selected_lead_type)) {
}
function appendRenewalPolicies(data) {
console.log('appendRenewalPolicies', data);
console.log('selected_lead_form_type', selected_lead_form_type);
$('#source_policy_id').empty();
@ -196,16 +199,27 @@ if (isset($selected_lead_type)) {
value: '',
text: 'Select Policy',
}));
$.each(data, function(index, item) {
let shouldAppend = false;
var option = $('<option>', {
value: item.id,
text: item.policy_type + '-' + item.policy_no,
});
if (selected_lead_form_type == 1) {
shouldAppend = (item.allocg !== "Non-EB" && item.allocg !== "Marine");
} else if (selected_lead_form_type == 2) {
shouldAppend = (item.allocg === "Non-EB" || item.allocg === "Marine");
} else {
shouldAppend = true;
}
$('#source_policy_id').append(option);
if (shouldAppend) {
const option = $('<option>', {
value: item.id,
text: item.policy_type + ' - ' + item.policy_no,
});
$('#source_policy_id').append(option);
}
});
}
//--------------------------------------------------------------------------------------------------------
@ -294,6 +308,25 @@ if (isset($selected_lead_type)) {
$('#salse_person_id').trigger('change');
}
function validateInput(input, table, field){
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!";
}
checkDuplicateTableFieldValue(table, field, value, function(isDuplicate) {
if (isDuplicate) {
toastr.warning(message, 'WARNING');
$(input).val('')
}
});
}
</script>

View File

@ -238,19 +238,19 @@
<script>
var totalSI;
var finalData = {};
console.log("policyName : ", $('#policyName').val());
// console.log("policyName : ", $('#policyName').val());
var policyName = $('#policyName').val();
const occupancyMaster = <?= json_encode($occupancy) ?>;
console.log("Occupancy : ", occupancyMaster);
// console.log("Occupancy : ", occupancyMaster);
var storedPolicyData = {};
storedPolicyData = JSON.parse(localStorage.getItem('policyData'));
$(document).ready(function() {
// resetAllform();
console.log("Stored date Found : ", typeof(storedPolicyData));
// console.log("Stored date Found : ", typeof(storedPolicyData));
if (!$.isEmptyObject(storedPolicyData)) {
// prepareDataForEdit(storedPolicyData);
} else {
console.log("inside else trying to open product sleection tab");
// console.log("inside else trying to open product sleection tab");
// const productSelectionTab = new bootstrap.Tab(document.getElementById);
const productSelectionTab = new bootstrap.Tab(document.getElementById('product-selection-tab'));
productSelectionTab.show();
@ -306,22 +306,22 @@
});
$('#productSelectionForm').submit(function(event) {
console.log("Submit function called");
// console.log("Submit function called");
event.preventDefault();
var isValid = $('#productSelectionForm').parsley().validate();
console.log('isValid', isValid)
// console.log('isValid', isValid)
if (!isValid) {
$('#productSelectionForm').find('input, select, textarea').each(function() {
if ($(this).parsley().isValid() === false && !$(this).val()) {
console.log('Empty field ID:', this.id);
// console.log('Empty field ID:', this.id);
}
});
console.log('Form is Empty', 'Warning');
// console.log('Form is Empty', 'Warning');
return;
}
productSelectionData = {};
// console.log("submit function is clicked");
// // console.log("submit function is clicked");
// event.preventDefault();
var formDataProductSelection = $("#productSelectionForm").serializeArray();
@ -340,14 +340,14 @@
policydetailsOpen();
}
console.log("form data product selection : ", productSelectionData);
// console.log("form data product selection : ", productSelectionData);
})
function policydetailsOpen() {
// PolicyTabOpened();
console.log("function is called");
// console.log("function is called");
// Use the ID for the Policy Details tab button.
// const policyDetailsTab = new bootstrap.Tab(document.getElementById('policy-details-tab'));
const policyDetailsTab = new bootstrap.Tab(document.getElementById('policy-details-tab'));
@ -361,15 +361,15 @@
var isValid = $('#policyRiskSplitUpForm').parsley().validate();
console.log('isValid', isValid);
// console.log('isValid', isValid);
if (!isValid) {
$('#policyRiskSplitUpForm').find('input, select, textarea').each(function() {
if ($(this).parsley().isValid() === false && !$(this).val()) {
console.log('Empty field ID:', this.id);
// console.log('Empty field ID:', this.id);
}
});
console.log('Form is Empty', 'Warning');
// console.log('Form is Empty', 'Warning');
return;
}
@ -393,7 +393,7 @@
value: $(`#lossIN3Years_${i}`).is(':checked') ? 'on' : 'off'
});
}
console.log("form from : ", formDataSplitUp);
// console.log("form from : ", formDataSplitUp);
if (productSelectionData.multipleProduct == 'on') {
let selectionType = productSelectionData.multilocation_type;
@ -413,11 +413,19 @@
toastr.error("Sum Insured Exceeds Allowed Limit", "ERROR");
return false;
}
console.log("Total SI: ", totalSI);
// console.log("Total SI: ", totalSI);
}else{
let InProcess = [...document.querySelectorAll('[id^="stockInProcess_"]')].map(el => Number(el.value) || 0);
let rawMaterial = [...document.querySelectorAll('[id^="rawMaterial_"]')].map(el => Number(el.value) || 0);
let findMaterial = [...document.querySelectorAll('[id^="finishedStock_"]')].map(el => Number(el.value) || 0);
totalSI = InProcess.reduce((acc, val) => acc + val, 0) +
rawMaterial.reduce((acc, val) => acc + val, 0) +
findMaterial.reduce((acc, val) => acc + val, 0);
}
}
console.log("Form is trying to submit : ", formDataSplitUp);
// console.log("Form is trying to submit : ", formDataSplitUp);
const groupData = [];
@ -454,7 +462,7 @@
policyRiskSplitUpData = groupData;
console.log("Grouped Data as Objects: ", policyRiskSplitUpData);
// console.log("Grouped Data as Objects: ", policyRiskSplitUpData);
savePolicyDataLocal();
});
@ -464,15 +472,15 @@
$("#policyRiskAddressForm").submit(function(event) {
event.preventDefault();
var isValid = $('#policyRiskAddressForm').parsley().validate();
console.log('isValid', isValid)
// console.log('isValid', isValid)
if (!isValid) {
$('#policyRiskAddressForm').find('input, select, textarea').each(function() {
if ($(this).parsley().isValid() === false && !$(this).val()) {
console.log('Empty field ID:', this.id);
// console.log('Empty field ID:', this.id);
}
});
console.log('Form is Empty', 'Warning');
// console.log('Form is Empty', 'Warning');
return;
}
const formData = $("#policyRiskAddressForm").serializeArray();
@ -505,7 +513,7 @@
});
policyRiskAddress = groupedData;
console.log("Grouped Data as Objects: ", policyRiskAddress);
// console.log("Grouped Data as Objects: ", policyRiskAddress);
if (productSelectionData.singleProduct == 'on') {
savePolicyDataLocal();
@ -518,25 +526,25 @@
event.preventDefault();
var isValid = $('#policyDetailsForm').parsley().validate();
console.log('isValid', isValid)
// console.log('isValid', isValid)
if (!isValid) {
$('#policyDetailsForm').find('input, select, textarea').each(function() {
if ($(this).parsley().isValid() === false && !$(this).val()) {
console.log('Empty field ID:', this.id);
// console.log('Empty field ID:', this.id);
}
});
console.log('Form is Empty', 'Warning');
// console.log('Form is Empty', 'Warning');
return;
}
var formData = $("#policyDetailsForm").serializeArray();
$.each(formData, function(i, field) {
policyDetailsData[field.name] = field.value;
});
// console.log("form data", policyDetailsData.location_no);
// // console.log("form data", policyDetailsData.location_no);
if (formData !== null && formData !== '') {
console.log("form submitted trying to open the ris info tab");
// console.log("form submitted trying to open the ris info tab");
// riskInfoTabOpened();
const riskTab = new bootstrap.Tab(document.getElementById('risk-info-tab'));
riskTab.show();
@ -567,11 +575,11 @@
}
} else if (e.target.id === 'risk-splitup-tab') {
contianertoCheck = document.getElementById("addRiskSplitUp");
console.log("policy det", policyRiskAddress.length)
// console.log("policy det", policyRiskAddress.length)
if (!$.isEmptyObject(policyRiskAddress)) {
if (increment2 == 1) {
policyRiskAddress.forEach(function() {
console.log("increment count is ", increment2)
// console.log("increment count is ", increment2)
addHTMLInputForRiskSplitUP();
validatePolicyBasedOnProductSelection();
hideAndShowBurglary();
@ -585,20 +593,20 @@
}
} else if (e.target.id === 'risk-info-tab') {
console.log("function called ");
// console.log("function called ");
contianertoCheck = document.getElementById("addRiskInfo");
// console.log("policy details data ", policyDetailsData);
// // console.log("policy details data ", policyDetailsData);
if (!$.isEmptyObject(policyDetailsData)) {
if (increment == 1) {
console.log("inside if ");
// console.log("inside if ");
addHTMLInputForRiskAddress();
$('select[id^="occupancy_"]').select2();
validatePolicyBasedOnProductSelection();
}
} else {
console.log("inside else ");
// console.log("inside else ");
if (contianertoCheck.innerHTML == "") {
addHTMLInputForRiskAddressWarninig();
@ -624,11 +632,11 @@
}
function addHTMLInputForRiskSplitUP() {
// console.log("Function called ", increment2, " times");
// // console.log("Function called ", increment2, " times");
const container = document.getElementById("addRiskSplitUp");
// container.innerHTML = '';
const newRowRisk = document.createElement("div");
// console.log("Risk Split Up for address : ", policyRiskAddress.length)
// // console.log("Risk Split Up for address : ", policyRiskAddress.length)
// policyRiskAddress
newRowRisk.innerHTML += `
@ -743,7 +751,7 @@
const container = document.getElementById('addRiskInfo');
// container.innerHTML = "";
const newRow = document.createElement('div');
// console.log("policy details ", policyDetailsData);
// // console.log("policy details ", policyDetailsData);
newRow.className = 'form-row dynamic-form-row mb-3';
newRow2 = document.createElement("div");
@ -882,8 +890,8 @@
$(document).on('click', '.duplicate-btn', function() {
console.log("button is clicked");
console.log("increment cout ", increment);
// console.log("button is clicked");
// console.log("increment cout ", increment);
if (policyDetailsData.location_no >= increment) {
@ -933,7 +941,7 @@
})
function addOrRemoveAdd() {
console.log("chceck box clicked");
// console.log("chceck box clicked");
if ($("#sameAsCommunicationAddress").is(":checked")) {
$("#pin_code_1").val(policyDetailsData.pin_code);
$("#address1_1").val(policyDetailsData.address1);
@ -952,7 +960,7 @@
if (selectedProduct.singleProduct == 'on') {
console.log("inside if ");
// console.log("inside if ");
$('[class*="single_location"]').show();
$("#locationNoDIV").hide();
$("#location_no").removeAttr("required", false);
@ -970,7 +978,7 @@
} else if (selectedProduct.multipleProduct == 'on') {
console.log("inside elseif");
// console.log("inside elseif");
$('[class*="single_location"]').hide().removeAttr('required');
// $('[class*="single_location_occupancy"]').hide().removeAttr('required');
$('[class*="multi_location_company"]').show();
@ -1002,28 +1010,28 @@
// alert(element);
var selectedOccupancy = $(`#${element}`).val();
var selectedOccupancyMasterRow = occupancyMaster.find(iib => iib.id == selectedOccupancy);
console.log("selected occupancy masater ", selectedOccupancyMasterRow)
console.log("selected occupancy masater ", occupancyMaster)
// console.log("selected occupancy masater ", selectedOccupancyMasterRow)
// console.log("selected occupancy masater ", occupancyMaster)
var iibCODE = selectedOccupancyMasterRow.iib_code;
console.log("selected occupancy masater ", iibCODE)
// console.log("selected occupancy masater ", iibCODE)
var elementID = element;
let increment = elementID.split("_").pop();
console.log("selected occupancy masater increment ", increment)
console.log("selected occupancy masater element ", $(`#iibCode_${increment}`))
// console.log("selected occupancy masater increment ", increment)
// console.log("selected occupancy masater element ", $(`#iibCode_${increment}`))
setTimeout(function() {
$(`#iibCode_${increment}`).val(iibCODE); // Set the value
console.log("Selected --------------------", $(`#iibCode_${increment}`).val()); // Log the value
// console.log("Selected --------------------", $(`#iibCode_${increment}`).val()); // Log the value
}, 1000);
}
console.log("onchange occupancy function called ");
// console.log("onchange occupancy function called ");
// console.log("onchange occupancy function called ", selectedOccupancy);
// console.log("onchange occupancy function called ", selectedOccupancyMasterRow);
// console.log("onchange occupancy function called ", iibCODE);
// console.log("onchange occupancy function called ", increment);
// // console.log("onchange occupancy function called ", selectedOccupancy);
// // console.log("onchange occupancy function called ", selectedOccupancyMasterRow);
// // console.log("onchange occupancy function called ", iibCODE);
// // console.log("onchange occupancy function called ", increment);
$('[class*="common_location_occupancy"]').show().prop("required", "required");
@ -1032,22 +1040,22 @@
$('[class*="single_location_occupancy"]').show().prop("required", "required");
} else if (selectedProduct.multipleProduct == 'on') {
// console.log("Muliple location");f
// // console.log("Muliple location");f
$('[class*="multiLocationOccupancy"]').show().prop('required', 'required');
if (selectedProduct.multilocation_type == "multiLocation") {
// console.log("multiple location without Floater");
// // console.log("multiple location without Floater");
$('[class*="multiLocationOccupancyWithoutFloater"]').show().prop('required', 'required');
} else if (selectedProduct.multilocation_type == "multiFloater") {
// console.log("Muliple location With Floater");
// // console.log("Muliple location With Floater");
$('[class*="multiLocationOccupancyWithoutFloater"]').hide().removeAttr('required', false);
} else if (selectedProduct.multilocation_type == "stockFloater") {
// console.log("multiple location with stock floater");
// // console.log("multiple location with stock floater");
$('[class*="multiLocationOccupancyWithoutFloater"]').show().prop('required', 'required');
$('[class*="stockSI"]').hide().removeAttr('required', false);
}
@ -1109,7 +1117,7 @@
// Ensure policyName is correctly retrieved
var policyName = $('#policyName').val();
if (!policyName) {
console.error("Policy name is undefined. Cannot save data.");
// console.error("Policy name is undefined. Cannot save data.");
return;
}
policyName = policyName.toLowerCase();
@ -1120,7 +1128,7 @@
localStorage.setItem('policyData', JSON.stringify(existingData));
if (!$.isEmptyObject(existingData)) {
console.log("DATA FROM DB : ", (existingData));
// console.log("DATA FROM DB : ", (existingData));
let data = (existingData);
Object.keys(data).forEach(key => {
@ -1128,8 +1136,12 @@
prependTable(policySummary[key],key);
});
}
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
toastr.success("Policy Information Collected ","SUCCESS");
console.log("Updated policy data in localStorage:", existingData);
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
// console.log("Updated policy data in localStorage:", existingData);
}
function saveTODB(data, leadID) {
@ -1137,7 +1149,7 @@
var url = '<?= base_url('rfq/savePolicyInfo') ?>';
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
console.log("trying to submit data : ", data, " with this lead id : ", leadID);
// console.log("trying to submit data : ", data, " with this lead id : ", leadID);
$.ajax({
url: url,
data: {
@ -1159,8 +1171,8 @@
error: function(xhr, status, error) {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
console.error(xhr.responseText);
console.error(status, error);
// console.error(xhr.responseText);
// console.error(status, error);
}
})
}
@ -1184,14 +1196,14 @@
// alert("Data restored to original variables.");
} else {
console.log("No policy data found in local storage.");
// console.log("No policy data found in local storage.");
}
}
function prepareDataForEdit(data) {
// alert(policyName);
console.log("Prepare data : ",data);
// console.log("Prepare data : ",data);
if (policyName == "Fire") {
data = data.fire;
if (!data) {
@ -1211,7 +1223,7 @@
}else{
// alert("nothing");
}
console.log("policy data : ", data);
// console.log("policy data : ", data);
// Populate Product Selection
// Show first tab
@ -1229,7 +1241,7 @@
$('#singleProduct').prop('checked', data.productSelection.singleProduct === 'on');
$('#multipleProduct').prop('checked', data.productSelection.multipleProduct === 'on');
console.log($('#multipleProduct').is(":checked") ? "yes" : "no");
// console.log($('#multipleProduct').is(":checked") ? "yes" : "no");
$('#multipleProduct').is(":checked") ? $('#multilocation_type').show() : $('#multilocation_type').hide();
$('#multilocation_type').val(data.productSelection.multilocation_type);
$("#client_type").val(data.productSelection.client_type);
@ -1243,7 +1255,7 @@
const policyDetails = data.policyDetails;
Object.keys(policyDetails).forEach(key => {
$(`#${key}`).val(policyDetails[key]);
// console.log("Key ",key," set value : ",policyDetails[key]);
// // console.log("Key ",key," set value : ",policyDetails[key]);
});
// Populate Risk Addresses
@ -1320,18 +1332,19 @@
function assignLeadData() {
const lead_data = <?= json_encode(json_decode($lead_data['custom_fields'])) ?>;
var clientName = <?= isset($lead_data['client_name']) ? json_encode($lead_data['client_name']) : ""?>;
var client_type = <?= isset($lead_data['client_type']) ? $lead_data['client_type'] : "" ?>;
var mobile = <?= isset($lead_data['client_type']) ? $lead_data['client_type'] : "" ?>;
var email = <?= isset($lead_data['client_type']) ? $lead_data['client_type'] : "" ?>;
var panNo = <?= isset($lead_data['client_type']) ? $lead_data['client_type'] : "" ?>;
console.log("client_type : ".client_type);
// console.log("client_type : ".client_type);
if (lead_data) {
// lead_data = JSON.parse(lead_data);
console.log("Lead Data : ", typeof(lead_data));
// console.log("Lead Data : ", typeof(lead_data));
if (lead_data.risk_location == "Single") {
console.log("single ");
// console.log("single ");
$("#singleProduct").prop("checked", true).trigger("change");
} else if (lead_data.risk_location.startsWith("multi")) {
@ -1346,15 +1359,15 @@
}
$("#client_type").val(client_type).trigger("change");
$("#insured_name").val(insured_name);
$("#insured_name").val(clientName);
$("#address1").val(lead_data.address);
}
}
function hideAndShowBurglary() {
console.log("hide and show function called ");
// console.log("hide and show function called ");
policyName = $("#policyName").val();
console.log("hiding the other policy not ths : ", policyName);
// console.log("hiding the other policy not ths : ", policyName);
if (policyName == "Burglary") {
$('[class*="burglary"]').show();
$('[class*="fire"]').hide().removeAttr('required', false);
@ -1365,7 +1378,7 @@
}
function resetAllform() {
console.log("FORM RESETED SUCCESSFULLY");
// console.log("FORM RESETED SUCCESSFULLY");
$("#productSelectionForm")[0].reset();
$("#policyDetailsForm")[0].reset();
$("#policyRiskAddressForm")[0].reset();
@ -1398,7 +1411,7 @@
})
function copyFirePolicy() {
console.log("Copying Fire Policy Data...");
// console.log("Copying Fire Policy Data...");
storedPolicyData = JSON.parse(localStorage.getItem('policyData'));
if (storedPolicyData.fire) {

View File

@ -0,0 +1,837 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- App favicon -->
<link rel="shortcut icon" href="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi.svg">
<title>Nhance Experience Form</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/parsleyjs@2.9.2/dist/parsley.min.js"></script>
<style>
.navbar-custom {
top: -10px !important;
height: 61px !important;
/* background-color: #02a8b5;
*/
background-color: #02a8b5;
}
.logo-box {
top: -10px !important;
height: 50px !important;
}
body {
background-color: #f0f0f0;
font-family: 'Roboto', sans-serif;
}
.nhance-form-card {
max-width: 740px;
margin: 32px auto;
background: #fff;
border-radius: 30px;
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1);
padding: 32px 24px;
}
.nhance-form-card-details {
max-width: 740px;
margin: 20px auto;
/* Reduced vertical margin */
background: #fff;
border-radius: 20px;
/* Slightly smaller radius */
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1);
padding: 20px 16px;
/* Reduced padding */
}
/* Adjust form group spacing */
.nhance-form-card-details .form-group {
margin-bottom: 12px;
/* Reduced spacing between rows */
}
/* Compact label styling */
.nhance-form-card-details label {
font-size: 14px;
/* Smaller font size */
margin-bottom: 0;
}
/* Compact input styling */
.nhance-form-card-details .form-control-plaintext {
font-size: 14px;
/* Smaller font size */
padding-top: 4px !important;
padding-bottom: 4px !important;
}
/* Adjust grid columns spacing */
.nhance-form-card-details .col-md-4 {
padding-right: 8px;
}
.nhance-form-card-details .col-md-8 {
padding-left: 8px;
}
.nhance-form-header {
font-size: 32px;
font-weight: 400;
color: #202124;
margin-bottom: 8px;
}
.nhance-form-subtitle {
font-size: 14px;
color: #5f6368;
margin-bottom: 24px;
}
.divider {
border-top: 1px solid #dadce0;
margin: 24px 0;
}
.form-group {
margin-bottom: 24px;
}
label {
font-size: 16px;
font-weight: 400;
color: #202124;
display: block;
}
.form-control {
height: 48px;
border: 1px solid #dadce0;
border-radius: 4px;
padding: 12px 14px;
font-size: 14px;
color: #202124;
transition: border-color 0.2s;
}
.form-control:focus {
border-color: #1a73e8;
box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
outline: none;
}
textarea.form-control {
height: auto;
min-height: 100px;
resize: vertical;
}
.required-asterisk {
color: #d93025;
margin-left: 4px;
}
.btn-nhance {
background-color: #1a73e8;
color: white;
border-radius: 4px;
padding: 12px 24px;
border: none;
font-size: 14px;
font-weight: 500;
letter-spacing: 0.25px;
text-transform: uppercase;
transition: background-color 0.2s, box-shadow 0.2s;
}
.btn-nhance:hover {
background-color: #1557b0;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.half-framed-textbox {
position: relative;
margin: 20px 0;
}
.border-animation {
position: absolute;
bottom: -2px;
/* Align with input bottom */
height: 2px;
background: #6200ea;
width: 0;
transition: width 0.3s ease;
}
.col-md-9 {
position: relative;
/* Contain the animation within the input column */
}
.half-framed-textbox input {
width: 100%;
padding: 8px;
font-size: 16px;
outline: none;
background: transparent;
position: relative;
text-align: left !important;
height: auto !important;
/* padding-left: 0 !important; */
/* padding-bottom: 0 !important; */
}
.half-framed-textbox .form-control {
border: none !important;
border-bottom: 2px solid #dadce0 !important;
box-shadow: none !important;
text-align: left !important;
height: auto !important;
height: auto !important;
padding-top: 18px !important;
padding-bottom: 0px !important;
line-height: 1.5 !important;
margin-bottom: 21px;
/* padding-left: 0 !important; */
/* padding-bottom: 0 !important; */
}
.form-control {
height: auto !important;
min-height: 48px;
}
.navbar-custom {
position: fixed;
top: 0;
width: 100%;
height: 61px;
background-color: #02a8b5;
display: flex;
align-items: center;
/* Center vertically */
justify-content: space-between;
/* Align logo and header properly */
padding: 0 20px;
/* Add some spacing */
z-index: 1000;
/* Ensure it stays above other content */
}
.logo-box img {
margin-top: auto;
height: 35px;
}
main {
flex: 1;
}
.feedback-header {
flex-grow: 1;
/* Allow it to take remaining space */
text-align: center;
font-size: 18px;
font-weight: bold;
color: white;
font-size: 32px;
font-weight: 400;
margin-top: auto;
font-family: 'sans-serif', serif;
}
</style>
<style>
.swal-modal {
background-color: white;
width: 80%;
max-width: 400px;
padding: 30px;
border-radius: 10px;
text-align: center;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}
.swal-title {
color: #595959;
font-size: 24px;
margin: 0 0 10px 0;
}
.swal-text {
color: #545454;
font-size: 16px;
margin: 15px 0;
}
.swal-icon {
width: 80px;
height: 80px;
border-radius: 50%;
margin: 0 auto 20px;
background-color: #a5dc86;
display: flex;
align-items: center;
justify-content: center;
animation: scaleIn 0.4s ease-out;
}
.swal-icon::after {
content: '';
display: block;
width: 30px;
height: 50px;
border: solid white;
border-width: 0 4px 4px 0;
transform: rotate(45deg);
margin-top: -8px;
}
@keyframes scaleIn {
from {
transform: scale(0);
}
to {
transform: scale(1);
}
}
@media (max-width: 480px) {
.swal-modal {
width: 90%;
padding: 20px;
}
}
</style>
<!-- Style for Loader -->
<style>
.loader-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #00000069;
z-index: 99999;
}
.loader {
position: absolute;
left: 50%;
top: 50%;
width: 50px;
height: 50px;
font-size: 0;
color: #00c9d0;
display: inline-block;
margin: -25px 0 0 -25px;
text-indent: -9999em;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
}
.loader div {
background-color: #6ad9cf;
display: inline-block;
float: none;
position: absolute;
top: 0;
left: 0;
width: 50px;
height: 50px;
opacity: .5;
border-radius: 50%;
-webkit-animation: ballPulseDouble 2s ease-in-out infinite;
animation: ballPulseDouble 2s ease-in-out infinite;
}
.loader div:last-child {
-webkit-animation-delay: -1s;
animation-delay: -1s;
}
</style>
<style>
.parsley-required{
color: red !important;
}
.swal-icon-error {
background-color: #f27474;
}
.swal-icon-error::before,
.swal-icon-error::after {
content: '';
position: absolute;
width: 40px;
height: 4px;
background-color: white;
}
.swal-icon-error::before {
transform: rotate(45deg);
}
.swal-icon-error::after {
transform: rotate(-45deg);
}
.swal-button-error {
background-color: #dc3545;
}
.swal-button-error:hover {
background-color: #bb2d3b;
}
</style>
</head>
<body>
<!-- Topbar Start -->
<div class="navbar-custom">
<div class="logo-box d-flex align-items-center">
<img src="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi_white_2.png" alt="Logo">
</div>
<div class="feedback-header">
Nhance Experience Form
</div>
</div>
<!-- end Topbar -->
<input type="hidden" id="ticket_id" value="<?= $ticket_id ?>">
<input type="hidden" id="login_type" value="<?= $viewer ?>">
<input type="hidden" id="form_submission_state" value="<?= $form_submitted ?>">
<!-- <div class="nhance-form-card">
<div class="nhance-form-header">Nhance Experience Form</div>
<div class="nhance-form-subtitle">Fill in the details to enhance your experience</div>
</div> -->
<form id="feedbackForm" data-parsley-validate>
<div class="nhance-form-card-details" style="margin-top : 70px;">
<div class="form-group d-flex align-items-center">
<div class="col-md-4">
<label for="email" class="mb-0 mr-2">Email &nbsp; </label>
</div>
<div class="col-md-8">
<input type="text" value="<?= isset($ticket_data['emp_mail']) ? $ticket_data['emp_mail'] : "" ?>" class="form-control-plaintext" id="email" readonly>
</div>
</div>
<div class="form-group d-flex align-items-center">
<div class="col-md-4">
<label for="name">Your name </label>
</div>
<div class="col-md-8">
<input type="text" value="<?= isset($ticket_data['emp_name']) ? $ticket_data['emp_name'] : "" ?>" class="form-control-plaintext" id="name" readonly>
</div>
</div>
<div class="form-group d-flex align-items-center">
<div class="col-md-4">
<label for="client_name">Your Employer </label>
</div>
<div class="col-md-8">
<input type="text" value="<?= isset($ticket_data['client_name']) ? $ticket_data['client_name'] : "" ?>" class="form-control-plaintext" id="client_name" readonly>
</div>
</div>
<div class="form-group d-flex align-items-center ">
<div class="col-md-4">
<label for="emp_code">Your Employer ID </label>
</div>
<div class="col-md-8">
<input type="text" value="<?= isset($ticket_data['emp_code']) ? $ticket_data['emp_code'] : "" ?>" class="form-control-plaintext" id="emp_code" readonly>
</div>
</div>
<div class="form-group d-flex align-items-center">
<div class="col-md-4">
<label for="claim_number">Your Claim ID</label>
</div>
<div class="col-md-8">
<input type="text" value="<?= isset($ticket_data['claim_number']) ? $ticket_data['claim_number'] : "" ?>" class="form-control-plaintext" id="claim_number" readonly>
</div>
</div>
</div>
<div class="nhance-form-card">
<div class="form-group">
<label for="satisfaction_level">Your satisfaction level with Nhance in explanation of the claims settlement process<span class="text-danger"> *</span></label>
<div class="error-container" id="responsiveness-error"></div>
<div class="form-check">
<input class="form-check-input" type="radio" name="your_satisfaction_level_with_nhance_in_explanation_of_the_claims_settlement_process" id="highly_satisfied" required data-parsley-errors-container="#responsiveness-error">
<label class="form-check-label" for="highly_satisfied">
Highly satisfied
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="your_satisfaction_level_with_nhance_in_explanation_of_the_claims_settlement_process" id="satisfied" required>
<label class="form-check-label" for="satisfied">
Satisfied
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="your_satisfaction_level_with_nhance_in_explanation_of_the_claims_settlement_process" id="neutral" required>
<label class="form-check-label" for="neutral">
Neutral
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="your_satisfaction_level_with_nhance_in_explanation_of_the_claims_settlement_process" id="dissatisfied" required>
<label class="form-check-label" for="dissatisfied">
Dissatisfied
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="your_satisfaction_level_with_nhance_in_explanation_of_the_claims_settlement_process" id="highly_dissatisfied" required>
<label class="form-check-label" for="highly_dissatisfied">
Highly dissatisfied
</label>
</div>
</div>
<div class="form-group">
<label for="claim_number">Your satisfaction level with Nhance responsiveness & professionalism throughout the process<span class="text-danger"> *</span></label>
<div class="error-container" id="responsiveness-error_1"></div>
<div class="form-check">
<input class="form-check-input" type="radio" name="your_satisfaction_level_with_nhance_responsiveness_and_professionalism_throughout_the_process" id="highly_satisfied_1" required data-parsley-errors-container="#responsiveness-error_1">
<label class="form-check-label" for="highly_satisfied_1">
Highly satisfied
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="your_satisfaction_level_with_nhance_responsiveness_and_professionalism_throughout_the_process" id="satisfied_1" required>
<label class="form-check-label" for="satisfied_1">
Satisfied
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="your_satisfaction_level_with_nhance_responsiveness_and_professionalism_throughout_the_process" id="neutral_1" required>
<label class="form-check-label" for="neutral_1">
Neutral
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="your_satisfaction_level_with_nhance_responsiveness_and_professionalism_throughout_the_process" id="dissatisfied_1" required>
<label class="form-check-label" for="dissatisfied_1">
Dissatisfied
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="your_satisfaction_level_with_nhance_responsiveness_and_professionalism_throughout_the_process" id="highly_dissatisfied_1" required>
<label class="form-check-label" for="highly_dissatisfied_1">
Highly dissatisfied
</label>
</div>
</div>
<div class="form-group">
<label for="claim_number">How satisfied were you with the time taken for Claim settlement? <span class="text-danger"> *</span></label>
<div class="error-container" id="responsiveness-error_2"></div>
<div class="form-check">
<input class="form-check-input" type="radio" name="how_satisfied_were_you_with_the_time_taken_for_claim_settlement" id="claim_was_settled_on_time" required data-parsley-errors-container="#responsiveness-error_2">
<label class="form-check-label" for="claim_was_settled_on_time">
Claim was settled on time
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="how_satisfied_were_you_with_the_time_taken_for_claim_settlement" id="claim_settlement_took_longer_than_expected">
<label class="form-check-label required" for="claim_settlement_took_longer_than_expected">
Claim settlement took longer than expected
</label>
</div>
</div>
<div class="form-group">
<label for="claim_number">How satisfied are you with the Policy's terms and coverage<span class="text-danger"> *</span></label>
<div class="error-container" id="responsiveness-error_3"></div>
<div class="form-check">
<input class="form-check-input" type="radio" name="how_satisfied_are_you_with_the_policys_terms_and_coverage" id="highly_satisfied_2" required data-parsley-errors-container="#responsiveness-error_3">
<label class="form-check-label" for="highly_satisfied_2">
Highly satisfied
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="how_satisfied_are_you_with_the_policys_terms_and_coverage" id="satisfied_2" required>
<label class="form-check-label" for="satisfied_2">
Satisfied
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="how_satisfied_are_you_with_the_policys_terms_and_coverage" id="neutral_2" required>
<label class="form-check-label" for="neutral_2">
Neutral
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="how_satisfied_are_you_with_the_policys_terms_and_coverage" id="dissatisfied_2" required>
<label class="form-check-label" for="dissatisfied_2">
Dissatisfied
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="how_satisfied_are_you_with_the_policys_terms_and_coverage" id="highly_dissatisfied_2" required>
<label class="form-check-label" for="highly_dissatisfied_2">
Highly dissatisfied
</label>
</div>
</div>
<div class="form-group">
<label for="claim_number">Would you recommend us? <span class="text-danger">*</span></label>
<div class="error-container" id="responsiveness-error_4"></div>
<div class="form-check">
<input class="form-check-input" type="radio" id="absolutely" name="would_you_recommend_us" required data-parsley-errors-container="#responsiveness-error_4">
<label class="form-check-label" for="absolutely">
Absolutely!
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="would_you_recommend_us" id="maybe_depends_on_improvements" required>
<label class="form-check-label" for="maybe_depends_on_improvements">
May be, depends on improvements.
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="would_you_recommend_us" id="no" required>
<label class="form-check-label" for="no">
No
</label>
</div>
</div>
<div class="form-group half-framed-textbox">
<label for="feedback"> Tell us how we can do better!</label>
<input type="text" class="form-control" id="feedback" name="feedback">
</div>
</div>
<div class="d-flex justify-content-center mt-3">
<button type="submit" id="feedbackFormSubmitButton" class="btn-nhance">Submit</button>
</div>
</form>
<div id="formSuccessPage">
</div>
<!-- Loader start -->
<div class="loader-mask">
<div class="loader">
<img src="<?= base_url() . "public" ?>/assets/images/nhance-loader-fast.gif" height="40" width="40" alt="Loading...">
</div>
</div>
<!-- Loader end -->
<footer class="text-center py-3 mt-auto" style="background-color: #f8f9fa; color: #5f6368;">
<p class="mb-0">© 2025 Nhance India Pvt Ltd. All Rights Reserved.</p>
</footer>
<script>
$(document).ready(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
var form_submitted_state = $("#form_submission_state").val();
var login_type = $("#login_type").val();
if (form_submitted_state == 1 && login_type != 1) {
$("#feedbackForm").hide();
const container = document.getElementById("formSuccessPage");
container.innerHTML = `
<div class = "nhance-form-card" style="margin-top : 70px;">
<div class="swal-icon"></div>
<h2 class="swal-title d-flex justify-content-center">Success!</h2>
<div class="swal-text d-flex justify-content-center">Your Feedback has been Received Successfully.</div>
</div>
`;
} else if (form_submitted_state == 1 && login_type == 1) {
$("#feedbackFormSubmitButton").hide();
var formData = <?= !empty($ticket_data['feedback_json']) ? $ticket_data['feedback_json'] : '{}' ?>;
console.log("Form data received : ", formData);
var feedbackText = formData.feedback;
$("#feedback").val(feedbackText).prop("readonly", true);
delete formData.feedback;
Object.values(formData).forEach((data, key) => {
console.log("key : ", data);
if (data.length > 1) {
$(`#${data}`).prop("checked", true);
}
})
} else if (form_submitted_state == 0 && login_type == 1) {
$("#feedbackForm").hide();
const container = document.getElementById("formSuccessPage");
container.innerHTML = `
<div class="nhance-form-card" style="margin-top: 70px;">
<div class="swal-icon swal-icon-error"></div>
<h2 class="swal-title d-flex justify-content-center">Error!</h2>
<div class="swal-text d-flex justify-content-center" id="errorMessage">User has not Submitted the Feedback Yet</div>
</div>
`;
}
})
$("#feedbackForm").submit(function(event) {
event.preventDefault();
if (!$(this).parsley().isValid()) {
return;
}
formData = $("#feedbackForm").serializeArray();
var would_you_recommend_us_id = $("[name='would_you_recommend_us']:checked").attr("id") || "";
var how_satisfied_are_you_with_the_policys_terms_and_coverage_id = $("[name='how_satisfied_are_you_with_the_policys_terms_and_coverage']:checked").attr("id") || "";
var how_satisfied_were_you_with_the_time_taken_for_claim_settlement_id = $("[name='how_satisfied_were_you_with_the_time_taken_for_claim_settlement']:checked").attr("id") || "";
var your_satisfaction_level_with_nhance_responsiveness_and_professionalism_throughout_the_process_id = $("[name='your_satisfaction_level_with_nhance_responsiveness_and_professionalism_throughout_the_process']:checked").attr("id") || "";
var your_satisfaction_level_with_nhance_in_explanation_of_the_claims_settlement_process_id = $("[name='your_satisfaction_level_with_nhance_in_explanation_of_the_claims_settlement_process']:checked").attr("id") || "";
formData.push({
name: "your_satisfaction_level_with_nhance_in_explanation_of_the_claims_settlement_process",
value: your_satisfaction_level_with_nhance_in_explanation_of_the_claims_settlement_process_id
});
formData.push({
name: "would_you_recommend_us",
value: would_you_recommend_us_id
});
formData.push({
name: "your_satisfaction_level_with_nhance_responsiveness_and_professionalism_throughout_the_process",
value: your_satisfaction_level_with_nhance_responsiveness_and_professionalism_throughout_the_process_id
});
formData.push({
name: "how_satisfied_were_you_with_the_time_taken_for_claim_settlement",
value: how_satisfied_were_you_with_the_time_taken_for_claim_settlement_id
});
formData.push({
name: "how_satisfied_are_you_with_the_policys_terms_and_coverage",
value: how_satisfied_are_you_with_the_policys_terms_and_coverage_id
});
var data = filterFormData(formData);
var ticket_id = $("#ticket_id").val();
console.log("Form Data : ", data);
console.log("Form Dataticket_id : ", ticket_id);
var url = "<?= base_url('claims-feedback-form') ?>" + `/${ticket_id}`;
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
$.ajax({
url: url,
data: data,
type: 'POST',
success: function(response) {
if (response.status) {
console.log("Success:", response);
} else {
console.log("Failure");
}
location.reload(true);
},
error: function(xhr, status, error) {
console.error("AJAX Error:", error);
}
})
$("#feedbackForm")[0].reset();
});
function filterFormData(data) {
return data.filter(entry => entry.value !== "on");
}
</script>
</body>
</html>

View File

@ -0,0 +1,148 @@
<style>
.table th,
.table td {
padding: 8px;
}
table.dataTable tbody td {
padding: 4px 4px !important;
}
.col-12 {
max-width: 98% !important;
}
.dataTables_filter {
position: absolute;
}
.right-align-input {
text-align: right;
}
.addbtnStyle {
margin-left: 20px !important;
}
</style>
<style>
.table th:nth-child(1),
.table td:nth-child(1) {
max-width: 200px !important;
min-width: 100px !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
white-space: nowrap !important;
}
</style>
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Claim Feedback List </h4>
</div>
</div>
<div class="table-responsive">
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
<thead class="bg-light">
<tr>
<th>Claim Number</th>
<th>Emp Code</th>
<th>Emp name</th>
<th>Corporate name</th>
</tr>
</thead>
<tbody>
<?php if (isset($feedback_data)) { ?>
<?php foreach($feedback_data as $data){ ?>
<tr onclick="viewFeedbackForm(<?php echo $data['id']; ?>)">
<td><?php echo $data['claim_number']; ?></td>
<td><?php echo $data['emp_code']; ?></td>
<td><?php echo $data['emp_name']; ?></td>
<td><?php echo $data['client_name']; ?></td>
</tr>
<?php } ?>
<?php } ?>
</tbody>
</table>
<div>
</div>
</div>
</div><!-- end col -->
</div>
</div>
<!-------------------------------------------------------------------------------------------------->
<script>
// Datatable document ready
$(document).ready(function() {
var ticketsTable = $('#scroll-horizontal-datatable');
if (ticketsTable.length) {
ticketsTable.DataTable({
scrollX: true,
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [{
extend: 'csv',
text: 'CSV',
title: 'Claim-List',
},
{
extend: 'excel',
text: 'Excel',
title: 'claim-List',
exportOptions: {
orthogonal: 'sort'
},
},
],
language: {
search: "_INPUT_",
searchPlaceholder: "Search..."
},
paging: true, // Enable pagination
pageLength: 25, // Set default number of rows per page (optional)
ordering: false,
});
} else {
console.error("Table atet found.");
}
});
function viewFeedbackForm(ticket_id){
console.log("Ticket ID : ",ticket_id);
var md5Hash_ticket_id = md5(ticket_id);
console.log("MD5 Ticket ID : ",md5Hash_ticket_id);
// alert(md5Hash);
feedbackPage = `<?= base_url("claims-feedback-form/") ?>${md5Hash_ticket_id}/1`
// window.location.href = feedbackPage;
window.open(feedbackPage, "_blank");
}
</script>

View File

@ -20,8 +20,9 @@
<td><?php echo $row['display_name']; ?></td>
<td><?php echo $row['old_value'].' => '.$row['new_value']; ?></td>
<!-- <td><?php //echo $row['new_value']; ?></td> -->
<td><?php echo $row['modified_by']; ?></td>
<td><?php echo $row['created_at']; ?></td>
<td><?php echo $row['modified_by'] ?? "Created by employee"; ?></td>
<!-- <td><?php //echo $row['created_at']; ?></td> -->
<td><?php echo date("d-m-Y H:i:s a", strtotime($row['created_at'])) ?? " - "; ?></td>
</tr>
<?php } ?>
<?php } ?>

View File

@ -35,6 +35,10 @@ table.dataTable tbody td {
white-space: nowrap !important;
}
#scroll-horizontal-datatable tbody tr:hover {
background-color: #e0e0e0;
}
</style>
@ -57,6 +61,7 @@ table.dataTable tbody td {
<th>Policy Type</th>
<th>Claim number</th>
<th>TPA ID</th>
<th>Emp ID</th>
<th>Emp name</th>
<th>Insured Name</th>
<th>Corporate name</th>
@ -66,7 +71,7 @@ table.dataTable tbody td {
<tbody>
<?php if (isset($ticket_data)) { ?>
<?php foreach($ticket_data as $index => $row){ ?>
<tr onclick="viewTicket(<?php echo $row['id']; ?>)">
<tr onclick="viewTicket(<?php echo $row['id']; ?>)" style="cursor: pointer;">
<td data-toggle="tooltip" data-placement="top"
@ -109,7 +114,8 @@ table.dataTable tbody td {
<td><?php echo str_replace("Claim-", "", $ticket_type[$row['ticket_type_id']] ?? ""); ?></td>
<td><?php echo $row['claim_no']; ?></td>
<td><?php echo $row['tpa_id']; ?></td>
<td><?php echo $row['tpa_no']; ?></td>
<td><?php echo $row['emp_code']; ?></td>
<td><?php echo $row['emp_name']; ?></td>
<td><?php echo $row['insured_name']; ?></td>
<td><?php echo $row['short_name']; ?></td>
@ -184,8 +190,12 @@ $(document).ready(function() {
function viewTicket(ticket_id){
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
let url = '<?= base_url('ticket/view/'); ?>' + ticket_id
window.location.href = url
}
</script>

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,7 @@ class ExcelSanitizeHelperTest extends TestCase
"validString" => "HelloWorld",
"withNonPrintable" => "71030034240400000016",
"withWhitespace" => " Trim me ",
"withNonInBetween" => "Santosh\u00a0Badatya",
"nonStringValue" => 'Hello
World',
];
@ -23,6 +24,7 @@ World',
"validString" => "HelloWorld",
"withNonPrintable" => "71030034240400000016",
"withWhitespace" => "Trim me",
"withNonInBetween" => "Santosh Badatya",
"nonStringValue" => 'HelloWorld',
];
$result = ExcelSanitizeHelper::sanitizeArrayData($input);