Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
velz 2026-04-18 16:40:08 +05:30
commit 1f17184365
27 changed files with 556 additions and 188 deletions

View File

@ -847,13 +847,13 @@ class ApiServiceController extends BaseController
$requested_data['insurer_or_tpa'] = 'tpa'; $requested_data['insurer_or_tpa'] = 'tpa';
$requested_data['flag_status'] = $event_mapping[$event] ?? "A"; $requested_data['flag_status'] = $event_mapping[$event] ?? "A";
$ICICILombardController = new ICICILombardController(); // $ICICILombardController = new ICICILombardController();
$apiResponse = $ICICILombardController->ICICIPushEmployeeDetails($requested_data); // $apiResponse = $ICICILombardController->ICICIPushEmployeeDetails($requested_data);
// $r = Jobs::addJob(['job_name' => 'ICICIPushEmployeeDetails', 'payload' => $requested_data]); $r = Jobs::addJob(['job_name' => 'ICICIPushEmployeeDetails', 'payload' => $requested_data]);
// log_message('error', "ICICIPushEmployeeDetails job pushed successfully."); log_message('error', "ICICIPushEmployeeDetails job pushed successfully.");
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Action Triggered','data' => $apiResponse ]); return $this->respond(['status' => true, 'code' => 200, 'message' => 'Action Triggered','data' => [] ]);
} }
} }

View File

@ -447,7 +447,7 @@ class LeadsController extends BaseController
], ],
]; ];
if (isset($postData['lead_type']) && $postData['lead_type'] == 1) { if (isset($postData['lead_type']) && in_array((int) $postData['lead_type'], [1, 3], true)) {
$rules['entity_type_id'] = [ $rules['entity_type_id'] = [
'rules' => 'required', 'rules' => 'required',
@ -659,8 +659,7 @@ class LeadsController extends BaseController
$request_data = $this->request->getPost(); $request_data = $this->request->getPost();
$data = sanitizeInputArrayAdvanced($request_data); $data = sanitizeInputArrayAdvanced($request_data);
$data['client_type'] = 1; $data['client_type'] = 1;
if (! in_array((int) $data['lead_type'], [1, 3], true)) {
if ($data['lead_type'] != 1) {
$client_data = $this->clientModel->where('id', $data['client_id'])->where('is_active', 1)->first(); $client_data = $this->clientModel->where('id', $data['client_id'])->where('is_active', 1)->first();
$data['client_name'] = $client_data['client_name']; $data['client_name'] = $client_data['client_name'];
$data['client_short_name'] = $client_data['short_name']; $data['client_short_name'] = $client_data['short_name'];
@ -760,7 +759,8 @@ class LeadsController extends BaseController
$form_docs_name = "docs_name_" . $index_plus_one; $form_docs_name = "docs_name_" . $index_plus_one;
$leads_file_primary_key = $data['leads_file_id'] ?? []; $leads_file_primary_key = $data['leads_file_id'] ?? [];
$files = $this->request->getFileMultiple($form_file_name); $files = $this->request->getFileMultiple($form_file_name);
$multi_file_data = $this->uploadMultiFiles($files, $data[$form_docs_name], $leads_file_primary_key); $docs_names_from_post = $data[$form_docs_name] ?? [];
$multi_file_data = $this->uploadMultiFiles($files, $docs_names_from_post, $leads_file_primary_key);
// Separate the insurer and insurer branch, handle missing or invalid data // Separate the insurer and insurer branch, handle missing or invalid data
if (isset($data['insurer'][$index]) && strpos($data['insurer'][$index], '-') !== false) { if (isset($data['insurer'][$index]) && strpos($data['insurer'][$index], '-') !== false) {
@ -950,7 +950,7 @@ class LeadsController extends BaseController
$insertCount[] = $insert; $insertCount[] = $insert;
$this->insertLeadStatus($insert, $value['status'], 3); $this->insertLeadStatus($insert, $value['status'], 3);
if ($value['lead_type'] == 1 && $value['status'] == 'won') { if (in_array((int) $value['lead_type'], [1, 3], true) && $value['status'] == 'won') {
$leadDataForClient = $this->leadsModel->find($insert); $leadDataForClient = $this->leadsModel->find($insert);
$this->createClientWithLeadData($leadDataForClient); $this->createClientWithLeadData($leadDataForClient);
} }
@ -981,7 +981,7 @@ class LeadsController extends BaseController
$this->insertMultiFilesData($data[0]['multi_file_data'], $id, $data[0]['lead_form_type']); $this->insertMultiFilesData($data[0]['multi_file_data'], $id, $data[0]['lead_form_type']);
$this->insertLeadStatus($id, $data[0]['status'], 3); $this->insertLeadStatus($id, $data[0]['status'], 3);
if ($data[0]['lead_type'] == 1 && $data[0]['status'] == 'won') { if (in_array((int) $data[0]['lead_type'], [1, 3], true) && $data[0]['status'] == 'won') {
$leadDataForClient = $this->leadsModel->find($id); $leadDataForClient = $this->leadsModel->find($id);
if (empty($leadDataForClient['is_client_created'])) { if (empty($leadDataForClient['is_client_created'])) {
$this->createClientWithLeadData($leadDataForClient); $this->createClientWithLeadData($leadDataForClient);
@ -1079,7 +1079,7 @@ class LeadsController extends BaseController
$file_name = file_Upload_for_lead($value, $uploadFilePath, UPLOAD_EXT_LEAD_FILES); $file_name = file_Upload_for_lead($value, $uploadFilePath, UPLOAD_EXT_LEAD_FILES);
$multi_file_data[] = [ $multi_file_data[] = [
'file_name' => $file_name, 'file_name' => $file_name,
'docs_name' => $docs_names[$index], 'docs_name' => $docs_names[$index] ?? '',
'id' => $primaryKey[$index] ?? "", 'id' => $primaryKey[$index] ?? "",
]; ];
} }
@ -1402,7 +1402,7 @@ class LeadsController extends BaseController
} }
// 4. Conditional query - only fetch if needed // 4. Conditional query - only fetch if needed
if ($lead_data['lead_type'] != 1) { if (! in_array((int) $lead_data['lead_type'], [1, 3], true)) {
$client_policy_data = $this->clientPolicyModel $client_policy_data = $this->clientPolicyModel
->select('policy_terms, placement_json') ->select('policy_terms, placement_json')
->where('is_active', 1) ->where('is_active', 1)
@ -2165,7 +2165,7 @@ class LeadsController extends BaseController
} // dd($data); } // dd($data);
$lead_data = []; $lead_data = [];
if ($rfq_data['lead_type'] == 1) { if (in_array((int) $rfq_data['lead_type'], [1, 3], true)) {
if (in_array($rfq_data['policy_type_id'], [2, 3, 4, 5])) { if (in_array($rfq_data['policy_type_id'], [2, 3, 4, 5])) {
$lead_data = [ $lead_data = [
@ -4774,7 +4774,7 @@ class LeadsController extends BaseController
// 🔹 Client Details (Single Row) // 🔹 Client Details (Single Row)
$data['actual_lead_client_details'] = $this->leadModel $data['actual_lead_client_details'] = $this->leadModel
->select('sales_actual_leads.company_name, clients.short_name, sales_actual_leads.email, sales_actual_leads.phone, sales_actual_leads.address, sales_actual_leads.website, sales_actual_leads.gst_number, sales_actual_leads.status, sales_actual_leads.assigned_to') ->select('sales_actual_leads.company_name, clients.short_name, clients.client_type, sales_actual_leads.email, sales_actual_leads.phone, sales_actual_leads.address, sales_actual_leads.website, sales_actual_leads.gst_number, sales_actual_leads.status, sales_actual_leads.assigned_to')
->join('clients', 'clients.id = sales_actual_leads.client_id', 'left') ->join('clients', 'clients.id = sales_actual_leads.client_id', 'left')
->where('sales_actual_leads.lead_id', $actual_lead_id) ->where('sales_actual_leads.lead_id', $actual_lead_id)
->first(); // first row only ->first(); // first row only
@ -4842,7 +4842,7 @@ class LeadsController extends BaseController
$data['lead_edit_data']['multi_file_html'] = trim($html) !== '' ? $html : null; $data['lead_edit_data']['multi_file_html'] = trim($html) !== '' ? $html : null;
} }
if ($data['lead_edit_data']['lead_type'] != 1 && $data['lead_edit_data']['lead_form_type'] == 2) { if (! in_array((int) $data['lead_edit_data']['lead_type'], [1, 3], true) && $data['lead_edit_data']['lead_form_type'] == 2) {
$data['lead_edit_data']['claims_details_html'] = view('rfq/claims_details_non_eb', $data['lead_edit_data']); $data['lead_edit_data']['claims_details_html'] = view('rfq/claims_details_non_eb', $data['lead_edit_data']);
} else { } else {
$data['lead_edit_data']['claims_details_html'] = ""; $data['lead_edit_data']['claims_details_html'] = "";
@ -5527,7 +5527,7 @@ class LeadsController extends BaseController
* *
* @param string $recipientType insurer|client|internal * @param string $recipientType insurer|client|internal
*/ */
protected function downloadFileFromGoogleSheet(array $lead_data, string $recipientType = 'insurer'): array protected function downloadFileFromGoogleSheet(array $lead_data, string $recipientType = 'insurer'): ?array
{ {
try { try {
$leadId = (int) ($lead_data['id'] ?? 0); $leadId = (int) ($lead_data['id'] ?? 0);

View File

@ -596,7 +596,7 @@ class MediAssistApiController extends BaseController
"Confirmation Awaited" => 4, "Confirmation Awaited" => 4,
"Information Awaited Reminder" => 4, "Information Awaited Reminder" => 4,
"Information Awaited Final Reminder" => 4, "Information Awaited Final Reminder" => 4,
"Insurer Concurrence Awaited" => 6, "Insurer Concurrence Awaited" => 7,
"Closed" => 12, "Closed" => 12,
"Physical Documents Awaited" => 9, "Physical Documents Awaited" => 9,
@ -944,7 +944,7 @@ class MediAssistApiController extends BaseController
"Confirmation Awaited" => 4, "Confirmation Awaited" => 4,
"Information Awaited Reminder" => 4, "Information Awaited Reminder" => 4,
"Information Awaited Final Reminder" => 4, "Information Awaited Final Reminder" => 4,
"Insurer Concurrence Awaited" => 6, "Insurer Concurrence Awaited" => 7,
"Closed" => 12, "Closed" => 12,
"Physical Documents Awaited" => 9, "Physical Documents Awaited" => 9,
@ -1191,7 +1191,7 @@ class MediAssistApiController extends BaseController
"Confirmation Awaited" => 4, "Confirmation Awaited" => 4,
"Information Awaited Reminder" => 4, "Information Awaited Reminder" => 4,
"Information Awaited Final Reminder" => 4, "Information Awaited Final Reminder" => 4,
"Insurer Concurrence Awaited" => 6, "Insurer Concurrence Awaited" => 7,
"Closed" => 12, "Closed" => 12,
"Physical Documents Awaited" => 9, "Physical Documents Awaited" => 9,

View File

@ -737,6 +737,8 @@ class TicketController extends BaseController
public function ticket_form($ticket_type) public function ticket_form($ticket_type)
{ {
$data = $this->ticket_form_data($ticket_type); $data = $this->ticket_form_data($ticket_type);
$data['tab_name'] = "Claims";
$data['page_name'] = "Claims";
// dd($data); // dd($data);
return $this->loadLayout('ticket_form_handler', $data); return $this->loadLayout('ticket_form_handler', $data);
} }

View File

@ -1,15 +1,105 @@
<?php
$batch_header_labels = [
'S.No', 'Batch Code', 'File Name', 'Client', 'Client Branch', 'Client Policy',
'Event Type', 'Insurer/ TPA', 'Action', 'Count', '(₹)Amount', 'User/Time', 'Status', 'Action',
];
$batch_col_count = count($batch_header_labels);
$batch_col_max_len = array_fill(0, $batch_col_count, 0);
for ($i = 0; $i < $batch_col_count; $i++) {
$batch_col_max_len[$i] = mb_strlen($batch_header_labels[$i]);
}
$insurer_or_tpa = $insurer_or_tpa ?? [];
$import_or_export = $import_or_export ?? [];
if (!empty($batch_list) && is_array($batch_list)) {
foreach ($batch_list as $key => $file) {
$batch_col_max_len[0] = max($batch_col_max_len[0], mb_strlen((string) ($key + 1)));
$batch_col_max_len[1] = max($batch_col_max_len[1], mb_strlen((string) ($file['batch_code'] ?? '')));
$batch_col_max_len[2] = max($batch_col_max_len[2], mb_strlen((string) ($file['file_name'] ?? '')));
$batch_col_max_len[3] = max($batch_col_max_len[3], mb_strlen((string) ($file['client_short_name'] ?? '')));
$batch_col_max_len[4] = max($batch_col_max_len[4], mb_strlen((string) ($file['branch_name'] ?? '')));
$policy_display_len = trim(
(isset($file['policy_type']) ? $file['policy_type'] : '')
. ' - '
. (isset($file['policy_no']) ? $file['policy_no'] : '')
);
$batch_col_max_len[5] = max($batch_col_max_len[5], mb_strlen($policy_display_len));
$batch_col_max_len[6] = max($batch_col_max_len[6], mb_strlen((string) ($file['event_type'] ?? '')));
$insLabel = $insurer_or_tpa[$file['insurer_or_tpa'] ?? ''] ?? '';
$batch_col_max_len[7] = max($batch_col_max_len[7], mb_strlen((string) $insLabel));
$actKey = $file['actions'] ?? '';
$actLabel = $import_or_export[$actKey] ?? ucfirst((string) $actKey);
$batch_col_max_len[8] = max($batch_col_max_len[8], mb_strlen((string) $actLabel));
$countStr = ($file['count'] ?? null) === null ? '-' : (string) $file['count'];
$batch_col_max_len[9] = max($batch_col_max_len[9], mb_strlen($countStr));
$batch_col_max_len[10] = max($batch_col_max_len[10], mb_strlen((string) format_indian_number($file['amount'])));
$userTime = change_date_format($file['created_at'] ?? '', 'Y-m-d H:i:s', 'd M Y h:i a')
. ' by '
. get_username($file['created_by'] ?? '');
$batch_col_max_len[11] = max($batch_col_max_len[11], mb_strlen($userTime));
$batch_col_max_len[12] = max($batch_col_max_len[12], mb_strlen((string) ($file['status'] ?? '')));
$batch_col_max_len[13] = max($batch_col_max_len[13], 2);
}
}
$batch_col_min_px = [48, 72, 100, 72, 80, 120, 88, 96, 72, 56, 80, 160, 96, 52];
$batch_col_max_px = [64, 220, 480, 240, 240, 640, 200, 200, 140, 110, 160, 560, 320, 64];
$batch_col_width_px = [];
for ($i = 0; $i < $batch_col_count; $i++) {
$chars = max($batch_col_max_len[$i], mb_strlen($batch_header_labels[$i]));
$px = (int) round($chars * 7.0 + 26);
$batch_col_width_px[$i] = min(
$batch_col_max_px[$i],
max($batch_col_min_px[$i], $px)
);
}
?>
<style> <style>
.reload:hover { .reload:hover {
cursor: pointer; cursor: pointer;
} }
.truncate { /* Column widths from max data length (see PHP above).
max-width: 80px; Avoid table-layout:fixed + identical max-width on TH it fights DataTables col sizing and skews TH vs TD.
white-space: nowrap; Do not max-width THEAD cells (sort icons use position:absolute; narrow max clips them). */
<?php for ($i = 0; $i < $batch_col_count; $i++) : ?>
#batch-list-table_wrapper .dataTables_scrollHead table thead th:nth-child(<?= $i + 1 ?>),
#batch-list-table thead th:nth-child(<?= $i + 1 ?>) {
min-width: <?= (int) $batch_col_width_px[$i] ?>px;
width: <?= (int) $batch_col_width_px[$i] ?>px;
box-sizing: border-box;
vertical-align: middle;
overflow: visible !important;
}
#batch-list-table tbody td:nth-child(<?= $i + 1 ?>) {
width: <?= (int) $batch_col_width_px[$i] ?>px;
max-width: <?= (int) $batch_col_width_px[$i] ?>px;
min-width: <?= (int) $batch_col_width_px[$i] ?>px;
box-sizing: border-box;
vertical-align: middle;
}
<?php endfor; ?>
#batch-list-table tbody td:nth-child(1),
#batch-list-table tbody td:nth-child(2),
#batch-list-table tbody td:nth-child(3),
#batch-list-table tbody td:nth-child(4),
#batch-list-table tbody td:nth-child(5),
#batch-list-table tbody td:nth-child(6),
#batch-list-table tbody td:nth-child(7),
#batch-list-table tbody td:nth-child(8),
#batch-list-table tbody td:nth-child(9),
#batch-list-table tbody td:nth-child(10),
#batch-list-table tbody td:nth-child(11),
#batch-list-table tbody td:nth-child(12) {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
#batch-list-table tbody td:nth-child(13),
#batch-list-table tbody td:nth-child(14) {
overflow: visible;
text-overflow: clip;
}
/* TPA variation modal layout */ /* TPA variation modal layout */
#tpa_variation_modal .modal-dialog { #tpa_variation_modal .modal-dialog {
@ -93,31 +183,50 @@
#tpa_variation_modal .dataTables_wrapper .dt-top .dataTables_filter { #tpa_variation_modal .dataTables_wrapper .dt-top .dataTables_filter {
text-align: right; text-align: right;
} }
/* Compact table + buttons (NHance) */ /* Compact tbody; thead must keep padding-right for sort triangles (custom.css uses ~2.35rem). */
#tickets-table thead th, #batch-list-table tbody td {
#tickets-table tbody td {
padding: 5px 11px !important; padding: 5px 11px !important;
font-size: 13px; font-size: 13px;
line-height: 1.25; line-height: 1.25;
} }
#batch-list-table_wrapper .dataTables_scrollHead table thead th,
#batch-list-table thead th {
padding: 5px 2.35rem 5px 11px !important;
font-size: 13px;
line-height: 1.25;
}
/* Action dropdown toggle in rows */ /* Action dropdown toggle in rows */
#tickets-table .dropdown-toggle.btn-sm { #batch-list-table .dropdown-toggle.btn-sm {
padding: 4px 9px !important; padding: 4px 9px !important;
font-size: 13px; font-size: 13px;
line-height: 1.2; line-height: 1.2;
} }
/* DataTables toolbar buttons (Export/Filter/Clear Filter) */ /* DataTables toolbar buttons (Export/Filter/Clear Filter) */
#tickets-table_wrapper .dt-buttons .btn { #batch-list-table_wrapper .dt-buttons .btn {
padding: 6px 13px !important; padding: 6px 13px !important;
font-size: 13px; font-size: 13px;
} }
#tickets-table_wrapper .dt-buttons .btn .btn-custom { #batch-list-table_wrapper .dt-buttons .btn .btn-custom {
font-size: 13px; font-size: 13px;
} }
/*
* One horizontal scrollbar without breaking thead/tbody width sync:
* - Do NOT set overflow-x:visible on .dataTables_scrollBody that breaks DataTables
* scrollHead/scrollBody width matching so <th> looks cut off.
* - When there is no .dataTables_scrollBody (scrollX off, single table), outer scrolls.
* - When .dataTables_scrollBody exists (scrollX on), only that inner strip scrolls (custom.css);
* outer .table-responsive stays overflow visible via nh-dt-no-outer-scroll / :has() rules.
*/
#second_page .card-body > .table-responsive:not(:has(.dataTables_scrollBody)) {
overflow-x: auto !important;
-webkit-overflow-scrolling: touch;
max-width: 100%;
}
</style> </style>
<div class="col-12" id="second_page"> <div class="col-12" id="second_page">
@ -130,7 +239,7 @@
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
<table data-custom-table-css="table" id="tickets-table" class="table table-hover m-0 table-centered dt-responsive w-100"> <table data-custom-table-css="table" id="batch-list-table" class="table table-hover m-0 table-centered nowrap w-100">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">S.No&nbsp;</th> <th class="font-weight-medium">S.No&nbsp;</th>
@ -159,14 +268,25 @@
<tr> <tr>
<td class="text-center"><b><?php echo ($key + 1) ?></b></td> <td class="text-center"><b><?php echo ($key + 1) ?></b></td>
<td><?php echo $file['batch_code'] ?></td> <td><?php echo $file['batch_code'] ?></td>
<td style="overflow: hidden;" class="reload truncate" data-toggle="tooltip" data-placement="top" title="<?php echo $file['file_name'] ?>"> <td class="reload batch-file-cell" data-toggle="tooltip" data-placement="top" title="<?php echo htmlspecialchars($file['file_name'] ?? '', ENT_QUOTES, 'UTF-8') ?>">
<?php echo $file['file_name']?> <?php echo $file['file_name']?>
</td> </td>
<td><?php echo $file['client_short_name'] ?></td> <td><?php echo $file['client_short_name'] ?></td>
<td><?php echo $file['branch_name'] ?></td> <td><?php echo $file['branch_name'] ?></td>
<!-- <td><?php echo isset($file['policy_name']) ? $file['policy_name'] : '' ?> - <?php echo isset($file['policy_no']) ? $file['policy_no'] : '' ?> - <?php echo isset($file['policy_type']) ? $file['policy_type'] : '' ?></td> --> <!-- <td><?php echo isset($file['policy_name']) ? $file['policy_name'] : '' ?> - <?php echo isset($file['policy_no']) ? $file['policy_no'] : '' ?> - <?php echo isset($file['policy_type']) ? $file['policy_type'] : '' ?></td> -->
<td><?php echo isset($file['policy_type']) ? $file['policy_type'] : '' ?> - <?php echo isset($file['policy_no']) ? $file['policy_no'] : '' ?></td> <?php
$policy_display = trim(
(isset($file['policy_type']) ? $file['policy_type'] : '')
. ' - '
. (isset($file['policy_no']) ? $file['policy_no'] : '')
);
?>
<td class="batch-policy-cell reload"
data-toggle="tooltip"
data-placement="top"
title="<?= esc($policy_display) ?>"><?= esc($policy_display) ?></td>
<td><?php echo $file['event_type'] ?></td> <td><?php echo $file['event_type'] ?></td>
<td><?php echo $insurer_or_tpa[$file['insurer_or_tpa']] ?> <td><?php echo $insurer_or_tpa[$file['insurer_or_tpa']] ?>
<?php $insurer_or_tpa_display = $insurer_or_tpa[$file['insurer_or_tpa']] == 'TPA' ? $file['tpa_short_name'] : $file['insurer_short_name'] ?> <?php $insurer_or_tpa_display = $insurer_or_tpa[$file['insurer_or_tpa']] == 'TPA' ? $file['tpa_short_name'] : $file['insurer_short_name'] ?>
@ -175,6 +295,7 @@
data-toggle="tooltip" data-placement="top" title="<?php echo $insurer_or_tpa_display ?>"></a> data-toggle="tooltip" data-placement="top" title="<?php echo $insurer_or_tpa_display ?>"></a>
</td> </td>
<td><?php echo $import_or_export[$file['actions']] ?? ucfirst($file['actions']) ?></td> <td><?php echo $import_or_export[$file['actions']] ?? ucfirst($file['actions']) ?></td>
<td><?php echo $file['count'] == null ? '-' : $file['count'] ?></td> <td><?php echo $file['count'] == null ? '-' : $file['count'] ?></td>
@ -354,7 +475,7 @@
<div class="modal-body"> <div class="modal-body">
<ul class="nav nav-tabs" id="tpaVariationTabs" role="tablist"> <ul class="nav nav-tabs" id="tpaVariationTabs" role="tablist">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link active" id="not-in-nhance-tab" data-toggle="tab" href="#not_in_nhance_tab" role="tab" aria-controls="not_in_nhance_tab" aria-selected="true">Not in Nhance</a> <a class="nav-link active active_tab" id="not-in-nhance-tab" data-toggle="tab" href="#not_in_nhance_tab" role="tab" aria-controls="not_in_nhance_tab" aria-selected="true">Not in Nhance</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" id="not-in-tpa-tab" data-toggle="tab" href="#not_in_tpa_tab" role="tab" aria-controls="not_in_tpa_tab" aria-selected="false">Not in TPA</a> <a class="nav-link" id="not-in-tpa-tab" data-toggle="tab" href="#not_in_tpa_tab" role="tab" aria-controls="not_in_tpa_tab" aria-selected="false">Not in TPA</a>
@ -446,6 +567,23 @@
], ],
}; };
/** Activate a TPA variation tab by id (not-in-nhance-tab, not-in-tpa-tab, need-to-review-tab). Works without jQuery .tab('show'). */
function showTPAVariationTabByLinkId(tabLinkId) {
var paneMap = {
'not-in-nhance-tab': 'not_in_nhance_tab',
'not-in-tpa-tab': 'not_in_tpa_tab',
'need-to-review-tab': 'need_to_review_tab'
};
var paneId = paneMap[tabLinkId];
if (!paneId) {
return;
}
$('#tpaVariationTabs .nav-link').removeClass('active').attr('aria-selected', 'false');
$('#' + tabLinkId).addClass('active').attr('aria-selected', 'true');
$('#tpaVariationTabContent .tab-pane').removeClass('show active');
$('#' + paneId).addClass('show active');
}
function renderVariationTable(tableSelector, rows, columns) { function renderVariationTable(tableSelector, rows, columns) {
const $table = $(tableSelector); const $table = $(tableSelector);
const $thead = $table.find('thead'); const $thead = $table.find('thead');
@ -522,8 +660,10 @@
renderVariationTable('#not_in_tpa_table', notInTpa, tpaVariationColumns.not_in_tpa); renderVariationTable('#not_in_tpa_table', notInTpa, tpaVariationColumns.not_in_tpa);
renderVariationTable('#need_to_review_table', reviewData, tpaVariationColumns.need_to_review); renderVariationTable('#need_to_review_table', reviewData, tpaVariationColumns.need_to_review);
const activeId = $('#tpaVariationTabs .nav-link.active').attr('id') || 'not-in-nhance-tab'; // Default tab: Not in Nhance — select tab and init DataTable for #not_in_nhance_table as soon as data is rendered.
adjustVariationTableByTabId(activeId); showTPAVariationTabByLinkId('not-in-nhance-tab');
updateTPAProceedButton('not-in-nhance-tab');
adjustVariationTableByTabId('not-in-nhance-tab');
} }
function showTPAVariationModal() { function showTPAVariationModal() {
@ -657,8 +797,10 @@
}); });
$('#tpa_variation_modal').on('shown.bs.modal', function () { $('#tpa_variation_modal').on('shown.bs.modal', function () {
const activeId = $('#tpaVariationTabs .nav-link.active').attr('id') || 'not-in-nhance-tab'; // Always show "Not in Nhance" first; re-measure DataTable now that the modal is visible.
adjustVariationTableByTabId(activeId); showTPAVariationTabByLinkId('not-in-nhance-tab');
updateTPAProceedButton('not-in-nhance-tab');
adjustVariationTableByTabId('not-in-nhance-tab');
}); });
$('#tpa_variation_modal').on('hidden.bs.modal', function () { $('#tpa_variation_modal').on('hidden.bs.modal', function () {
@ -667,10 +809,40 @@
destroyVariationDataTable('#need_to_review_table'); destroyVariationDataTable('#need_to_review_table');
}); });
const batchListTable = $('#tickets-table').DataTable({ /* footer.php sets scrollX/scrollY on $.fn.dataTable.defaults — force off for this init so DT does not split thead into .dataTables_scrollHead / tbody into .dataTables_scrollBody (only the body strip would scroll horizontally). */
var _dtDefScroll = {
scrollX: $.fn.dataTable.defaults.scrollX,
scrollY: $.fn.dataTable.defaults.scrollY,
scrollCollapse: $.fn.dataTable.defaults.scrollCollapse
};
$.extend($.fn.dataTable.defaults, { scrollX: false, scrollY: false, scrollCollapse: false });
const batchListTable = $('#batch-list-table').DataTable({
dom: "<'row'<'col-sm-7'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-7'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row align-items-center'<'col-5 text-start'i><'col-7 d-flex justify-content-end align-items-center'<'me-2'l>p>>", lengthMenu: [[10, 20, 50, 100], [10, 20, 50, 100]], "<'row align-items-center'<'col-5 text-start'i><'col-7 d-flex justify-content-end align-items-center'<'me-2'l>p>>",
lengthMenu: [[10, 20, 50, 100], [10, 20, 50, 100]],
scrollX: false,
scrollY: false,
scrollCollapse: false,
initComplete: function () {
var $wrap = $(this.api().table().container());
var $body = $wrap.find('.dataTables_scrollBody');
var $head = $wrap.find('.dataTables_scrollHead');
if ($body.length && $head.length) {
$body.off('scroll.nhBatchHScroll').on('scroll.nhBatchHScroll', function () {
$head.scrollLeft($(this).scrollLeft());
});
$head.off('scroll.nhBatchHScroll').on('scroll.nhBatchHScroll', function () {
$body.scrollLeft($(this).scrollLeft());
});
}
},
columnDefs: [
<?php for ($i = 0; $i < $batch_col_count; $i++) : ?>
{ targets: <?= $i ?>, width: '<?= (int) $batch_col_width_px[$i] ?>px' },
<?php endfor; ?>
],
buttons: [ buttons: [
{ {
extend: 'collection', extend: 'collection',
@ -717,6 +889,8 @@
responsive: false responsive: false
}); });
$.extend($.fn.dataTable.defaults, _dtDefScroll);
// Keep TH and TD widths in sync after any table redraw (search/sort/paginate). // Keep TH and TD widths in sync after any table redraw (search/sort/paginate).
batchListTable.on('draw.dt', function () { batchListTable.on('draw.dt', function () {
batchListTable.columns.adjust(); batchListTable.columns.adjust();

View File

@ -85,6 +85,10 @@
} }
</style> </style>
<script>
var pageHideMainNavTitle = true;
var pageTitle = 'Claim Dump Upload';
</script>
<!-- <div class="row"> <!-- <div class="row">
<div class="col-xl-12" style="margin-left: 14px;max-width: 98%;"> <div class="col-xl-12" style="margin-left: 14px;max-width: 98%;">
@ -125,12 +129,12 @@
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="padding-bottom: 10px;"> <!-- <div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Claim Dump Upload</h4> <h4 style="position: relative;">Claim Dump Upload</h4>
</div> </div>
</div> </div> -->
<table data-custom-table-css="table" class="table table-hover m-0 table-centered w-100" cellspacing="0" id="tickets-table"> <table data-custom-table-css="table" class="table table-hover m-0 table-centered w-100" cellspacing="0" id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>

View File

@ -162,7 +162,7 @@ input:checked + .slider:before {
</div> </div>
</div> </div>
</div> </div>
<small class="mt-1 text-muted d-block">Allowed: PNG, JPG, JPEG. Size : 200KB Dimension : 100 X 100 Pixels</small> <small class="mt-1 text-muted d-block">Allowed: JPG, JPEG, PNG. Size : 200KB Dimension : 100 X 100 Pixels</small>
<div id="client_logo_error_container"></div> <div id="client_logo_error_container"></div>
<!-- Hidden File Input --> <!-- Hidden File Input -->
@ -465,7 +465,7 @@ input:checked + .slider:before {
$.each(res.data, function (index, item) { $.each(res.data, function (index, item) {
var row = `<tr> var row = `<tr>
<td> ${item.file_name}</td> <td> ${item.file_name}</td>
<td id="form_${item.id}" style=""><form class="ajax" ><input class="file-input__input" type="file" name="file_name" accept=".jpg,.jpeg,.png"><br><small class="text-muted">Allowed: PNG, JPG, JPEG.</small> <td id="form_${item.id}" style=""><form class="ajax" ><input class="file-input__input" type="file" name="file_name" accept=".jpg,.jpeg,.png"><br><small class="text-muted">Allowed: JPG, JPEG, PNG.</small>
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" /> <input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
<input type="hidden" class="form-control" value="${item.id}" name="kyc_doc_type_id" /> <input type="hidden" class="form-control" value="${item.id}" name="kyc_doc_type_id" />
<input type="hidden" name="client_id" id="id_for_kyc_file" value="${client_id_for_file}"/> <input type="hidden" name="client_id" id="id_for_kyc_file" value="${client_id_for_file}"/>

View File

@ -220,7 +220,7 @@
<input type="hidden" id="file_upload_actions" name="upload-action-type"> <input type="hidden" id="file_upload_actions" name="upload-action-type">
<input type="file" id="fileInput" name="emplist" required <input type="file" id="fileInput" name="emplist" required
accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet"> accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet">
<small class="text-muted d-block">Allowed: XLS, XLSX. Size : 25MB Dimension : 100 X 100</small> <small class="text-muted d-block">Allowed: XLS, XLSX. Size : 25MB</small>
<button type="submit" class="btn btn-primary">Upload</button> <button type="submit" class="btn btn-primary">Upload</button>
</form> </form>
</div> </div>

View File

@ -230,7 +230,7 @@
<input type="hidden" id="hr_file_upload_actions" name="upload-action-type"> <input type="hidden" id="hr_file_upload_actions" name="upload-action-type">
<input type="file" id="fileInput" name="emplist" required <input type="file" id="fileInput" name="emplist" required
accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet"> accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet">
<small class="text-muted d-block">Allowed: XLS, XLSX. Size : 25MB Dimension : 100 X 100</small> <small class="text-muted d-block">Allowed: XLS, XLSX. Size : 25MB</small>
<button type="submit" class="btn btn-primary">Upload</button> <button type="submit" class="btn btn-primary">Upload</button>
</form> </form>
</div> </div>

View File

@ -258,7 +258,7 @@ table.dataTable thead th {
<button class="scroll-btn left-btn" type="button">&#9664;</button> <button class="scroll-btn left-btn" type="button">&#9664;</button>
</li> </li>
<li class="nav-item d-flex justify-content-center align-items-center"> <li class="nav-item d-flex justify-content-center align-items-center">
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2 active-tab " id="general_tab"> <a href="#general-q-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2 active-tab active" id="general_tab">
<span class="mr-1"><i class="mdi mdi-contacts"></i></span> <span class="mr-1"><i class="mdi mdi-contacts"></i></span>
<span class="d-none d-sm-inline-block ">Data From Client</span> <span class="d-none d-sm-inline-block ">Data From Client</span>
</a> </a>

View File

@ -176,7 +176,7 @@ input:checked + .slider:before {
<i class="mdi mdi-upload additional-icon"></i> <i class="mdi mdi-upload additional-icon"></i>
</div> </div>
<div id="logo_error_container"></div> <div id="logo_error_container"></div>
<small class="text-muted">Allowed: JPG, JPEG, PNG. Max size: 200KB.</small> <small class="text-muted">Allowed: JPG, JPEG, PNG. Size: 200KB.</small>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<img src="<?= isset($insurer['insurer_logo']) && !empty($insurer['insurer_logo']) ? base_url() . "public/uploads/logo/" . $insurer['insurer_logo'] : base_url() . "public/assets/images/avatar_2x.png" ?>" <img src="<?= isset($insurer['insurer_logo']) && !empty($insurer['insurer_logo']) ? base_url() . "public/uploads/logo/" . $insurer['insurer_logo'] : base_url() . "public/assets/images/avatar_2x.png" ?>"

View File

@ -474,6 +474,8 @@
<script> <script>
var actualLeadClientName = '';
var actualLeadShortName = '';
let claimIndex = 1; let claimIndex = 1;
setTimeout(() => { setTimeout(() => {
@ -539,8 +541,8 @@
var lead_type = $(this).val(); var lead_type = $(this).val();
var increment = 1; // Example increment value (modify as needed) var increment = 1; // Example increment value (modify as needed)
var start_date_id = lead_type == "1" ? `policy_start_date_${increment}` : "policy_start_date"; var start_date_id = (lead_type == "1" || lead_type == "3") ? `policy_start_date_${increment}` : "policy_start_date";
var end_date_id = lead_type == "1" ? `policy_end_date_${increment}` : "policy_end_date"; var end_date_id = (lead_type == "1" || lead_type == "3") ? `policy_end_date_${increment}` : "policy_end_date";
$(".policy_start_date").attr("id", start_date_id); $(".policy_start_date").attr("id", start_date_id);
// $("label[for]").attr("for", start_date_id); // $("label[for]").attr("for", start_date_id);
@ -551,7 +553,7 @@
// $('#leads_form_id')[0].reset(); // $('#leads_form_id')[0].reset();
// console.log("Updated ID:", newId); // console.log("Updated ID:", newId);
if (lead_type == 1) { if (lead_type == 1 || lead_type == 3) {
var policy_start_datePicker = flatpickr("#policy_start_date_" + increment, { var policy_start_datePicker = flatpickr("#policy_start_date_" + increment, {
dateFormat: "d/m/Y", dateFormat: "d/m/Y",
@ -583,32 +585,7 @@
// } // }
} }
}); });
} else if (lead_type == 3) { } else if (lead_type != 1 && lead_type != 3) {
if ($('#client_id option[value="add_client"]').length === 0) {
$('#client_id').prepend($('<option>', {
value: 'add_client',
text: '+ Add Client'
}));
}
$("#source_policy_id").removeAttr("required");
$("#source_policy_id").closest("div").find("label .text-danger").remove();
$("#source_policy_id").hide();
$('#source_policy_id').closest('.form-group').hide();
$("#source_policy_start_date").removeAttr("required");
$("#source_policy_start_date").closest("div").find("label .text-danger").remove();
$("#source_policy_start_date").hide();
$('#source_policy_start_date').closest('.form-group').hide();
$("#source_policy_end_date").removeAttr("required");
$("#source_policy_end_date").closest("div").find("label .text-danger").remove();
$("#source_policy_end_date").hide();
$('#source_policy_end_date').closest('.form-group').hide();
} else if (lead_type != 3) {
$("#source_policy_id").prop("required", true); $("#source_policy_id").prop("required", true);
$("#source_policy_start_date").prop("required", true); $("#source_policy_start_date").prop("required", true);
$("#source_policy_end_date").prop("required", true); $("#source_policy_end_date").prop("required", true);
@ -647,7 +624,7 @@
} }
if (lead_type != 1) { if (lead_type != 1 && lead_type != 3) {
dataIncrement = 1; dataIncrement = 1;
// updateRenewalFields(dataIncrement); // updateRenewalFields(dataIncrement);
@ -755,7 +732,7 @@
leadTypeBsedHideAndShow(lead_type) leadTypeBsedHideAndShow(lead_type)
if (lead_type == 1) { if (lead_type == 1 || lead_type == 3) {
$('.claim-row').hide(); $('.claim-row').hide();
@ -833,8 +810,19 @@
$('#lost_reason').val(res.data.lost_reason || ''); $('#lost_reason').val(res.data.lost_reason || '');
$('#notes').val(res.data.notes); $('#notes').val(res.data.notes);
let existingClientId = res.data.client_id || res.data.is_client_created || 0;
console.log('existingClientId', existingClientId);
if (lead_type == 3) {
if (existingClientId && existingClientId != 0) {
$('#exixting_client').prop('checked', true).trigger('change');
} else {
$('#exixting_client').prop('checked', false).trigger('change');
}
}
setTimeout(function() { setTimeout(function() {
$('#client_id').val(res.data.client_id).change(); $('#client_id').val(existingClientId).change();
setTimeout(function() { setTimeout(function() {
$('#client_branch_id').val(res.data.client_branch_id).change(); $('#client_branch_id').val(res.data.client_branch_id).change();
setTimeout(function() { setTimeout(function() {
@ -1130,7 +1118,7 @@
leadTypeBsedHideAndShow(lead_type) leadTypeBsedHideAndShow(lead_type)
if (lead_type == 1) { if (lead_type == 1 || lead_type == 3) {
$('.claim-row').hide(); $('.claim-row').hide();
@ -1146,7 +1134,7 @@
$('.lifeClaimFields').show(); $('.lifeClaimFields').show();
} else { } else {
if (lead_type == 1) { if (lead_type == 1 || lead_type == 3) {
updateRenewalFields(dataIncrement); updateRenewalFields(dataIncrement);
} }
@ -1350,7 +1338,7 @@
// $(".policy_end_date").attr("id", end_date_id); // $(".policy_end_date").attr("id", end_date_id);
// Initialize date pickers // Initialize date pickers
if (lead_type == 1) { if (lead_type == 1 || lead_type == 3) {
var policy_start_datePicker = flatpickr("#policy_start_date_" + increment, { var policy_start_datePicker = flatpickr("#policy_start_date_" + increment, {
dateFormat: "d/m/Y", dateFormat: "d/m/Y",
@ -1564,7 +1552,7 @@
console.log('Lead Type:', lead_type); console.log('Lead Type:', lead_type);
let increment = input.id.split('_').pop(); // Extract increment let increment = input.id.split('_').pop(); // Extract increment
if (lead_type == 1) { if (lead_type == 1 || lead_type == 3) {
return; return;
} }
@ -1682,7 +1670,7 @@
var lead_type = $('#lead_type').val(); var lead_type = $('#lead_type').val();
if (lead_type == 1) { if (lead_type == 1 || lead_type == 3) {
let formRow = input.closest('.form-row'); let formRow = input.closest('.form-row');
@ -1855,7 +1843,7 @@
let value = $(this).val() let value = $(this).val()
leadTypeBsedHideAndShow(value, true) leadTypeBsedHideAndShow(value, true)
if (value != 1) { if (value != 1 && value != 3) {
removeExtraForms(); removeExtraForms();
} }
@ -1936,6 +1924,22 @@
console.warn(`Incurred claim date field #${incurred_claim_date_id} not found.`); console.warn(`Incurred claim date field #${incurred_claim_date_id} not found.`);
} }
// --- Re-populate Actual Lead data if it was cleared ---
if ($('#actual_lead_id').val() && $('#actual_lead_id').val() != 0) {
$('#client_name').val(actualLeadClientName);
// Re-generate short name from the stored client name to ensure consistency
if (actualLeadClientName.trim() !== '') {
let baseName = actualLeadClientName
.trim()
.substring(0, 10)
.replace(/\s+/g, '')
.toUpperCase();
makeUniqueShortName(baseName);
} else {
$('#client_short_name').val('').parsley().reset();
}
}
}) })
function insurerChange(input, unique_id) { function insurerChange(input, unique_id) {
@ -2284,8 +2288,7 @@
function leadTypeBsedHideAndShow(value, resetValues = false) { function leadTypeBsedHideAndShow(value, resetValues = false) {
if (value == 1) { if (value == 1 || value == 3) {
$('.btnDiv').show(); $('.btnDiv').show();
$('.claim-row').hide(); $('.claim-row').hide();
@ -2509,17 +2512,20 @@
// CLIENT DETAILS AUTO FILL // CLIENT DETAILS AUTO FILL
// ------------------------------- // -------------------------------
if (actual_lead_client_details) { if (actual_lead_client_details) {
actualLeadClientName = actual_lead_client_details.company_name || '';
$('#client_name').val(actual_lead_client_details.company_name || ''); $('#client_name').val(actualLeadClientName);
$('#gst').val(actual_lead_client_details.gst_number || ''); $('#gst').val(actual_lead_client_details.gst_number || '');
if (actual_lead_client_details.client_type !== undefined && actual_lead_client_details.client_type !== null && actual_lead_client_details.client_type !== '') {
$('#client_type').val(String(actual_lead_client_details.client_type));
}
existingShortName = actual_lead_client_details.short_name || ''; // existingShortName = actual_lead_client_details.short_name || '';
if (existingShortName) { // if (existingShortName) {
// ── Short name EXISTS — just populate and validate ──────── // // ── Short name EXISTS — just populate and validate ────────
$('#client_short_name').val(existingShortName); // $('#client_short_name').val(existingShortName);
// validateInput($('#client_short_name')[0], 'clients', 'short_name'); // // validateInput($('#client_short_name')[0], 'clients', 'short_name');
} else { // } else { }
// Auto-generate short name from company name // Auto-generate short name from company name
// Use a small delay to ensure DOM is ready // Use a small delay to ensure DOM is ready
setTimeout(function () { setTimeout(function () {
@ -2531,8 +2537,30 @@
makeUniqueShortName(baseName); makeUniqueShortName(baseName);
}, 300); }, 300);
} }
// Auto-generate short name from client name on user input.
$('#client_name').on('input', function() {
let clientName = $(this).val();
if (clientName.trim() !== '') {
let baseName = clientName
.trim()
.substring(0, 10)
.replace(/\s+/g, '')
.toUpperCase();
makeUniqueShortName(baseName);
} else {
$('#client_short_name').val('').parsley().reset();
} }
});
// Keep short name variable in sync if it's generated or changed
$('#client_short_name').on('input change', function() {
if ($('#actual_lead_id').val() && $('#actual_lead_id').val() != 0) {
actualLeadShortName = $(this).val();
}
});
// ------------------------------- // -------------------------------
// CONTACT PERSON AUTO FILL // CONTACT PERSON AUTO FILL

View File

@ -525,10 +525,14 @@ if (isset($selected_lead_type)) {
} }
if(client_type == ""){ if(client_type == ""){
var aid = $('#actual_lead_id').val();
if (!aid || aid === '0') {
toastr.warning('Please select the client type', 'Warning'); toastr.warning('Please select the client type', 'Warning');
$('#client_short_name').val('') $('#client_short_name').val('');
return; return;
} }
// Actual-lead autofill: short name may be set before client type is chosen; do not clear it.
}
let value = $(input).val(); let value = $(input).val();
let label = $(input).closest('.form-group').find('label').text().replace('*', '').trim(); let label = $(input).closest('.form-group').find('label').text().replace('*', '').trim();
@ -839,7 +843,7 @@ if (isset($selected_lead_type)) {
$('.loader-mask').fadeIn(); $('.loader-mask').fadeIn();
if (lead_type == 1) { if (lead_type == 1 || lead_type == 3) {
$('.claim-row').hide(); $('.claim-row').hide();
if(data.is_client_created == null || data.is_client_created == 0 || data.is_client_created == ""){ if(data.is_client_created == null || data.is_client_created == 0 || data.is_client_created == ""){
@ -1088,7 +1092,7 @@ if (isset($selected_lead_type)) {
temp_client_id = data.client_id temp_client_id = data.client_id
} }
if(lead_type == 1){ if(lead_type == 1 || lead_type == 3){
if(data.is_client_created == null || data.is_client_created == 0 || data.is_client_created == ""){ if(data.is_client_created == null || data.is_client_created == 0 || data.is_client_created == ""){
$('#exixting_client').prop('checked', false); $('#exixting_client').prop('checked', false);

View File

@ -189,7 +189,7 @@
</a> </a>
<div class="dropdown-menu dropdown-menu-right"> <div class="dropdown-menu dropdown-menu-right">
<?php $isNonEb = isset($row['lead_form_type']) && (int) $row['lead_form_type'] === 2; ?> <?php $isNonEb = isset($row['lead_form_type']) && (int) $row['lead_form_type'] === 2; ?>
<a class="dropdown-item btnEdit" data-id="<?php echo $row['id']; ?>" data-ft="<?php echo $row['lead_form_type']; ?>" onclick="getLeadsDataForEdit('<?php echo htmlspecialchars($row['id'], ENT_QUOTES) ?>', '<?php echo htmlspecialchars($row['lead_form_type'], ENT_QUOTES) ?>')"> <a class="dropdown-item btnEdit" data-id="<?php echo $row['id']; ?>" data-ft="<?php echo $row['lead_form_type']; ?>" onclick="getLeadsDataForEdit('<?php echo htmlspecialchars($row['id'], ENT_QUOTES) ?>', '<?php echo htmlspecialchars($row['lead_form_type'], ENT_QUOTES) ?>', '<?php echo htmlspecialchars($row['actual_lead_id'] ?? 0, ENT_QUOTES) ?>')">
<i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit <i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit
</a> </a>
<?php if ($isNonEb) {?> <?php if ($isNonEb) {?>
@ -820,11 +820,12 @@
} }
function getLeadsDataForEdit(lead_id, lead_form_type){ function getLeadsDataForEdit(lead_id, lead_form_type, actual_lead_id = 0){
console.log('lead_id', lead_id); console.log('lead_id', lead_id);
console.log('lead_form_type', lead_form_type); console.log('lead_form_type', lead_form_type);
let actual_lead_id = 0; // Hardcoded to 0 since this is an edit operation console.log('actual_lead_id', actual_lead_id);
// let actual_lead_id = 0; // Hardcoded to 0 since this is an edit operation
//Here After Edit URL: /type / actual_lead_id (0) / lead_id //Here After Edit URL: /type / actual_lead_id (0) / lead_id
let url = '<?php echo base_url('/util/getLeadNonEB/') ?>' + lead_form_type + '/' + actual_lead_id + '/' + lead_id; let url = '<?php echo base_url('/util/getLeadNonEB/') ?>' + lead_form_type + '/' + actual_lead_id + '/' + lead_id;
// old URL // old URL
@ -835,13 +836,23 @@
} }
function showEmailHistoryModal() { function showEmailHistoryModal() {
var $modal = $('#EmailModal'); const el = document.getElementById('EmailModal');
if (typeof jQuery !== 'undefined' && jQuery.fn && typeof jQuery.fn.modal === 'function') { if (!el) return;
$modal.modal('show');
// Prefer Bootstrap 5 modal API (used by other modals in this file).
if (window.bootstrap && bootstrap.Modal) {
// Some Bootstrap builds don't include getOrCreateInstance()
if (typeof bootstrap.Modal.getOrCreateInstance === 'function') {
bootstrap.Modal.getOrCreateInstance(el).show();
} else {
new bootstrap.Modal(el).show();
}
return; return;
} }
if (window.bootstrap && bootstrap.Modal) {
bootstrap.Modal.getOrCreateInstance(document.getElementById('EmailModal')).show(); // Fallback for legacy Bootstrap setups that attach $.fn.modal.
if (typeof jQuery !== 'undefined' && jQuery.fn && typeof jQuery.fn.modal === 'function') {
$('#EmailModal').modal('show');
} }
} }
@ -853,6 +864,19 @@
function getLeadsDataForMailHistory(lead_id){ function getLeadsDataForMailHistory(lead_id){
console.log("******** Inside Fnz :", lead_id); console.log("******** Inside Fnz :", lead_id);
// Open the modal immediately; then fill the table after API response.
// This prevents the click from looking "non-working" while the request runs.
const container = document.querySelector(".history-container");
if (container) {
container.innerHTML = `
<div class="d-flex justify-content-center align-items-center" style="height: 50vh; width:100%;">
<p class="text-center font-color-black"><i>Loading...</i></p>
</div>
`;
}
showEmailHistoryModal();
let url = '<?php echo base_url('/util/getLeadEmailHistory/') ?>' + lead_id; let url = '<?php echo base_url('/util/getLeadEmailHistory/') ?>' + lead_id;
console.log("******** Fetching:", url); console.log("******** Fetching:", url);
@ -862,8 +886,7 @@
}) })
.then(response => response.json()) .then(response => response.json())
.then(response => { .then(response => {
let container = document.querySelector(".history-container"); if (container) container.innerHTML = "";
container.innerHTML = "";
if (response.status === "success" && response.data.length > 0) { if (response.status === "success" && response.data.length > 0) {
console.log("******** 1" + response.status); console.log("******** 1" + response.status);
let table = ` let table = `
@ -974,7 +997,7 @@
}) })
.catch(error => { .catch(error => {
console.log("******** 3" + error); console.log("******** 3" + error);
document.querySelector(".history-container").innerHTML = ` if (container) container.innerHTML = `
<div class="d-flex justify-content-center align-items-center" style="height: 50vh; width:100%;"> <div class="d-flex justify-content-center align-items-center" style="height: 50vh; width:100%;">
<p class="text-center font-color-black"><i>No Data Found</i></p> <p class="text-center font-color-black"><i>No Data Found</i></p>
</div> </div>

View File

@ -489,6 +489,8 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
<script> <script>
var actualLeadClientName = '';
var actualLeadShortName = '';
$(document).ready(function() { $(document).ready(function() {
$('#rfq_qcr_viewers').parsley({ $('#rfq_qcr_viewers').parsley({
@ -611,7 +613,7 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
console.log(response.message, 'WARNING'); console.log(response.message, 'WARNING');
} }
if (lead_type != 1) { if (lead_type != 1 && lead_type != 3) {
let html = `<hr><div class="form-row"> <div class="form-group col-md-3"><h4> Claim Details </h4></div></div>` let html = `<hr><div class="form-row"> <div class="form-group col-md-3"><h4> Claim Details </h4></div></div>`
let referenceDiv = document.getElementById('appendAreaForClaim'); let referenceDiv = document.getElementById('appendAreaForClaim');
@ -765,7 +767,7 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
$('#lead_type').change(function() { $('#lead_type').change(function() {
let value = $(this).val() let value = $(this).val()
// alert(value); // alert(value);
if (value == 3) { if (value == 1 || value == 3) {
// alert("Function Called"); // alert("Function Called");
if ($('#client_id option[value="add_client"]').length === 0) { if ($('#client_id option[value="add_client"]').length === 0) {
@ -780,7 +782,7 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
$('#source_policy_id').closest('.form-group').hide(); $('#source_policy_id').closest('.form-group').hide();
} else if (value != 3) { } else if (value != 1 && value != 3) {
$("#source_policy_id").prop("required",true); $("#source_policy_id").prop("required",true);
$("#source_policy_id").prop("required", true); $("#source_policy_id").prop("required", true);
if(value == 2){ if(value == 2){
@ -848,12 +850,31 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
$('#policy_end_date').val(""); $('#policy_end_date').val("");
$("#appendArea_1").empty(); $("#appendArea_1").empty();
// --- Re-populate Actual Lead data if it was cleared ---
if ($('#actual_lead_id').val() && $('#actual_lead_id').val() != 0) {
$('#client_name').val(actualLeadClientName);
if (actualLeadShortName.trim() !== '') {
$('#client_short_name').val(actualLeadShortName);
} else if (actualLeadClientName.trim() !== '') {
// Fallback only when no persisted short name is available.
let baseName = actualLeadClientName
.trim()
.substring(0, 10)
.replace(/\s+/g, '')
.toUpperCase();
makeUniqueShortName(baseName);
} else {
$('#client_short_name').val('').parsley().reset();
}
}
}) })
function leadTypeBsedHideAndShow(value, resetValues = false) { function leadTypeBsedHideAndShow(value, resetValues = false) {
if (value == 1) { var actual_lead_id = $('#actual_lead_id').val();
if (value == 1 || value == 3) {
$('.btnDiv').show(); $('.btnDiv').show();
$('.claim-row').hide(); $('.claim-row').hide();
@ -1336,19 +1357,20 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
// CLIENT DETAILS AUTO FILL // CLIENT DETAILS AUTO FILL
// ------------------------------- // -------------------------------
if (actual_lead_client_details) { if (actual_lead_client_details) {
actualLeadClientName = actual_lead_client_details.company_name || '';
$('#client_name').val(actual_lead_client_details.company_name || ''); $('#client_name').val(actualLeadClientName);
$('#gst').val(actual_lead_client_details.gst_number || ''); $('#gst').val(actual_lead_client_details.gst_number || '');
existingShortName = actual_lead_client_details.short_name || ''; if (actual_lead_client_details.client_type !== undefined && actual_lead_client_details.client_type !== null && actual_lead_client_details.client_type !== '') {
$('#client_type').val(String(actual_lead_client_details.client_type));
}
let existingShortName = actual_lead_client_details.short_name || '';
if (existingShortName) { if (existingShortName) {
// ── Short name EXISTS — just populate and validate ──────── // Prefer persisted short name while editing.
actualLeadShortName = existingShortName;
$('#client_short_name').val(existingShortName); $('#client_short_name').val(existingShortName);
// validateInput($('#client_short_name')[0], 'clients', 'short_name');
} else { } else {
// Auto-generate short name from company name // Fallback: generate only when short name is unavailable.
// Use a small delay to ensure DOM is ready
setTimeout(function () { setTimeout(function () {
let baseName = actual_lead_client_details.company_name let baseName = actual_lead_client_details.company_name
.trim() .trim()
@ -1361,6 +1383,28 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
} }
} }
// Auto-generate short name from client name on user input.
$('#client_name').on('input', function() {
let clientName = $(this).val();
if (clientName.trim() !== '') {
let baseName = clientName
.trim()
.substring(0, 10)
.replace(/\s+/g, '')
.toUpperCase();
makeUniqueShortName(baseName);
} else {
$('#client_short_name').val('').parsley().reset();
}
});
// Keep short name variable in sync if it's generated or changed
$('#client_short_name').on('input change', function() {
if ($('#actual_lead_id').val() && $('#actual_lead_id').val() != 0) {
actualLeadShortName = $(this).val();
}
});
// ------------------------------- // -------------------------------
// CONTACT PERSON AUTO FILL // CONTACT PERSON AUTO FILL
// ------------------------------- // -------------------------------

View File

@ -1010,7 +1010,7 @@
<div class="form-group col-md-5"> <div class="form-group col-md-5">
<label for="file">Upload File<span class="text-danger">${required_star}</span></label> <label for="file">Upload File<span class="text-danger">${required_star}</span></label>
<input type="file" class="form-control" id="file_name" name="file[]" ${required} accept=".pdf,.jpg,.jpeg,.png"> <input type="file" class="form-control" id="file_name" name="file[]" ${required} accept=".pdf,.jpg,.jpeg,.png">
<small class="text-muted d-block">Allowed: PDF, XLSX, XLS, PNG, JPG, JPEG. <= Default</small> <small class="text-muted d-block">Allowed: PDF, PNG, JPG, JPEG. </small>
</div> </div>
<div class="form-group col-md-2" style="position: relative;top: 28px;"> <div class="form-group col-md-2" style="position: relative;top: 28px;">
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this, '${container_id}')">x</a> <a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this, '${container_id}')">x</a>

View File

@ -321,9 +321,11 @@
<input type="hidden" id="entity_type_id"> <input type="hidden" id="entity_type_id">
<div class="row" id="inception_form"> <div class="row" id="inception_form">
<div class="col-xl-12" style="max-width: 100% !important;"> <div class="col-xl-12" style="max-width: 100% !important;">
<!--
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="margin-bottom:1rem;"> -->
<!-- <div class="row" style="margin-bottom:1rem;"> -->
<!-- <div class="col-6" style="align-self: center;"> <!-- <div class="col-6" style="align-self: center;">
<h4 id="page_title" style="position: relative;">Add Policy</h4> <h4 id="page_title" style="position: relative;">Add Policy</h4>
@ -335,7 +337,7 @@
<a href="<?= base_url('policy_tranction/inception/list') ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" <a href="<?= base_url('policy_tranction/inception/list') ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light"
>Back</a> >Back</a>
</div> --> </div> -->
</div> <!-- </div> -->
<form role="form" class="parsley-examples" method="post" id="inception_form_id" enctype="multipart/form-data" novalidate> <form role="form" class="parsley-examples" method="post" id="inception_form_id" enctype="multipart/form-data" novalidate>
<input type="hidden" name="id" id="policy_tranction_primarykey"> <input type="hidden" name="id" id="policy_tranction_primarykey">
@ -1151,8 +1153,10 @@
id="btnSubmit">Submit</button> id="btnSubmit">Submit</button>
</div> </div>
</form> </form>
<!--
</div> </div>
</div> </div>
-->
</div> </div>
</div> </div>
</div> </div>

View File

@ -1175,7 +1175,7 @@ function addHTMLInput(data = null, container_id = 'dynamic-form-container')
<div class="form-group col-md-5"> <div class="form-group col-md-5">
<label for="file">Upload File<span class="text-danger">${required_star}</span></label> <label for="file">Upload File<span class="text-danger">${required_star}</span></label>
<input type="file" class="form-control" id="file_name" name="file[]" ${required} accept=".pdf,.jpg,.jpeg,.png"> <input type="file" class="form-control" id="file_name" name="file[]" ${required} accept=".pdf,.jpg,.jpeg,.png">
<small class="text-muted d-block">Allowed: PDF, XLSX, XLS, PNG, JPG, JPEG. <= Default</small> <small class="text-muted d-block">Allowed: PDF, JPG, JPEG, PNG.</small>
</div> </div>
<div class="form-group col-md-2" style="position: relative;top: 28px;"> <div class="form-group col-md-2" style="position: relative;top: 28px;">
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this, '${container_id}')">x</a> <a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this, '${container_id}')">x</a>

View File

@ -1017,7 +1017,7 @@ function addHTMLInput(data = null)
<div class="form-group col-md-5"> <div class="form-group col-md-5">
<label for="file">Upload File<span class="text-danger">*</span></label> <label for="file">Upload File<span class="text-danger">*</span></label>
<input type="file" class="form-control" id="file_name" name="file[]" accept=".pdf,.jpg,.jpeg,.png" required> <input type="file" class="form-control" id="file_name" name="file[]" accept=".pdf,.jpg,.jpeg,.png" required>
<small class="text-muted d-block">Allowed: PDF, XLSX, XLS, PNG, JPG, JPEG. <= Default</small> <small class="text-muted d-block">Allowed: PDF, JPG, JPEG, PNG.</small>
</div> </div>
<div class="form-group col-md-2" style="position: relative;top: 28px;"> <div class="form-group col-md-2" style="position: relative;top: 28px;">
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this)">x</a> <a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this)">x</a>

View File

@ -128,10 +128,12 @@
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="email">Email<span class="text-danger">*</span></label> <label for="email">Email<span class="text-danger">*</span></label>
<input type="email" class="form-control" id="email" name="email" placeholder="Enter Email" required data-parsley-type="email" data-parsley-trigger="keyup"> <input type="email" class="form-control" id="email" name="email" placeholder="Enter Email" required data-parsley-type="email" data-parsley-trigger="keyup">
<small id="email_error" class="text-danger d-none"></small>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="mobile">Mobile<span class="text-danger">*</span></label> <label for="mobile">Mobile<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="mobile" name="mobile" placeholder="Enter Mobile" required data-parsley-pattern="^[6-9]\d{9}$" data-parsley-trigger="keyup" data-parsley-length="[10,10]" data-parsley-validation-threshold="10" data-parsley-length-message="Mobile number must be 10 digits." data-parsley-pattern-message="Please enter a valid 10-digit mobile number starting with 6, 7, 8, or 9."> <input type="text" class="form-control" id="mobile" name="mobile" placeholder="Enter Mobile" maxlength="10" inputmode="numeric" pattern="[0-9]{10}" required>
<small id="mobile_error" class="text-danger d-none"></small>
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
@ -173,7 +175,7 @@
<input type="file" class="form-control" name="aadhar_file_name" id="aadhar_file_name" accept=".pdf,.jpg,.jpeg,.png" data-parsley-file-validation> <input type="file" class="form-control" name="aadhar_file_name" id="aadhar_file_name" accept=".pdf,.jpg,.jpeg,.png" data-parsley-file-validation>
<i class="mdi mdi-upload additional-icon"></i> <i class="mdi mdi-upload additional-icon"></i>
</div> </div>
<small class="text-muted d-block">Allowed: PDF, XLSX, XLS, PNG, JPG, JPEG. <= Default</small> <small class="text-muted d-block">Allowed: PDF, PNG, JPG, JPEG.</small>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="pan_file_name">PAN</label> <label for="pan_file_name">PAN</label>
@ -181,7 +183,7 @@
<input type="file" class="form-control" name="pan_file_name" id="pan_file_name" accept=".pdf,.jpg,.jpeg,.png" data-parsley-file-validation> <input type="file" class="form-control" name="pan_file_name" id="pan_file_name" accept=".pdf,.jpg,.jpeg,.png" data-parsley-file-validation>
<i class="mdi mdi-upload additional-icon"></i> <i class="mdi mdi-upload additional-icon"></i>
</div> </div>
<small class="text-muted d-block">Allowed: PDF, XLSX, XLS, PNG, JPG, JPEG. <= Default</small> <small class="text-muted d-block">Allowed: PDF, PNG, JPG, JPEG.</small>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="certificate_file_name">Certificate</label> <label for="certificate_file_name">Certificate</label>
@ -189,7 +191,7 @@
<input type="file" class="form-control" name="certificate_file_name" id="certificate_file_name" accept=".pdf,.jpg,.jpeg,.png" data-parsley-file-validation> <input type="file" class="form-control" name="certificate_file_name" id="certificate_file_name" accept=".pdf,.jpg,.jpeg,.png" data-parsley-file-validation>
<i class="mdi mdi-upload additional-icon"></i> <i class="mdi mdi-upload additional-icon"></i>
</div> </div>
<small class="text-muted d-block">Allowed: PDF, XLSX, XLS, PNG, JPG, JPEG. <= Default</small> <small class="text-muted d-block">Allowed: PDF, PNG, JPG, JPEG.</small>
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
@ -227,41 +229,6 @@
</div> </div>
<script> <script>
// Parsley custom validator for file type and size
window.Parsley.addValidator('fileValidation', {
requirementType: 'string',
validateString: function(value, requirement, parsleyInstance) {
const file = parsleyInstance.$element[0].files[0];
if (!file) {
return true; // Skip validation if no file is selected (unless 'required' is also present)
}
const maxImageSize = 500 * 1024; // 500KB
const maxPdfSize = 25 * 1024 * 1024; // 25MB
const imageTypes = ['image/jpeg', 'image/png', 'image/jpg'];
const pdfType = 'application/pdf';
if (imageTypes.includes(file.type)) {
if (file.size > maxImageSize) {
this.errorMessage = 'Image size cannot exceed 500KB.';
return false;
}
} else if (file.type === pdfType) {
if (file.size > maxPdfSize) {
this.errorMessage = 'PDF size cannot exceed 25MB.';
return false;
}
} else {
this.errorMessage = 'Allowed file types are JPG, JPEG, PNG, and PDF.';
return false;
}
return true;
},
messages: {
en: 'File is invalid.' // Default fallback message
}
});
var table; var table;
$(document).ready(function () { $(document).ready(function () {
$('#manager_id').select2(); $('#manager_id').select2();
@ -493,18 +460,77 @@
$('#partnerPOSForm').on('submit', function(e) { $('#partnerPOSForm').on('submit', function(e) {
e.preventDefault(); e.preventDefault();
var $form = $(this); const form = this;
// Validate the form using Parsley // HTML5 built-in validation
$form.parsley().validate(); if (!form.checkValidity()) {
form.reportValidity(); // shows required/pattern tooltips
return;
}
// Custom validation
if (!validateForm()) return;
// Check if the form is valid
if ($form.parsley().isValid()) {
// If valid, submit via AJAX // If valid, submit via AJAX
handleSaveEditAndDelete('submit'); handleSaveEditAndDelete('submit');
}
}); });
function validateForm() {
let isValid = true;
// Clear old errors
$('.text-danger').addClass('d-none').text('');
// Regex patterns
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
const mobileRegex = /^[6-9]\d{9}$/;
const aadharRegex = /^\d{12}$/;
const panRegex = /^[A-Z]{5}[0-9]{4}[A-Z]$/;
// EMAIL
const email = $('#email').val().trim();
if (email === '') {
$('#email_error').text('Email is required').removeClass('d-none');
isValid = false;
} else if (!emailRegex.test(email)) {
$('#email_error').text('Enter a valid email').removeClass('d-none');
isValid = false;
}
// MOBILE
const mobile = $('#mobile').val().trim();
if (mobile === '') {
$('#mobile_error').text('Mobile number is required').removeClass('d-none');
isValid = false;
} else if (!mobileRegex.test(mobile)) {
$('#mobile_error').text('Enter a valid 10-digit mobile number').removeClass('d-none');
isValid = false;
}
// AADHAAR
const aadhar = $('#aadhar').val().trim();
if (aadhar === '') {
$('#aadhar_error').text('Aadhaar is required').removeClass('d-none');
isValid = false;
} else if (!aadharRegex.test(aadhar)) {
$('#aadhar_error').text('Aadhaar must be 12 digits').removeClass('d-none');
isValid = false;
}
// PAN
const pan = $('#pan').val().trim();
if (pan === '') {
$('#pan_error').text('PAN is required').removeClass('d-none');
isValid = false;
} else if (!panRegex.test(pan)) {
$('#pan_error').text('Invalid PAN format (AAAPA1234A)').removeClass('d-none');
isValid = false;
}
return isValid;
}
</script> </script>
<script> <script>
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
@ -594,5 +620,4 @@
} }
}); });
}); });
</script> </script>

View File

@ -1,5 +1,6 @@
<div class="row" id="pt_onboarding"> <!-- style="position: relative; bottom: 25px; display:none;" --> <div class="row" id="pt_onboarding"> <!-- style="position: relative; bottom: 25px; display:none;" -->
<div class="col-xl-12"> <div class="col-xl-12">
<div style="margin-top:10px !important;"></div>
<div class="card-body"> <div class="card-body">
<div class="tab-wrapper position-relative"> <div class="tab-wrapper position-relative">
<ul class="nav nav-pills navtab-bg" id="myTab"> <ul class="nav nav-pills navtab-bg" id="myTab">

View File

@ -37,18 +37,21 @@ table.dataTable tbody td {
.dataTables_length label {height: 21px !important;} .dataTables_length label {height: 21px !important;}
</style> </style>
<script>
var pageHideMainNavTitle = true;
var pageTitle = 'Claim Feedback List';
</script>
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="padding-bottom: 10px;"> <!-- <div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Claim Feedback List </h4> <h4 style="position: relative;">Claim Feedback List </h4>
</div> </div>
</div> </div> -->
<div class="table-responsive"> <div class="table-responsive">
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap"> <table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
<thead class="bg-light"> <thead class="bg-light">

View File

@ -28,7 +28,13 @@
font-size: 0.875rem; font-size: 0.875rem;
} }
</style> </style>
<?php if (!isset($ticket_data)) { ?>
<script>
var pageHideMainNavTitle = true;
var pageTitle = '<?= isset($claim_ticket_type_id) && $claim_ticket_type_id == 72 ? 'Claim OPD' : 'Claim GMC' ?>';
var pageBackButton = '<a href="<?= base_url('ticket/list') ?>" class="topbar-icon-btn" title="Back"><i class="ri-arrow-left-s-line"></i></a>';
</script>
<?php } ?>
<div class="container-fluid-min"> <div class="container-fluid-min">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
@ -36,6 +42,7 @@
<div class="card-body"> <div class="card-body">
<?php if (!isset($ticket_data)) { ?> <?php if (!isset($ticket_data)) { ?>
<!-- Header Section --> <!-- Header Section -->
<!--
<div class="row mb-3"> <div class="row mb-3">
<div class="col-6 d-flex align-items-center"> <div class="col-6 d-flex align-items-center">
<h4 class="mb-0"><?= isset($claim_ticket_type_id) && $claim_ticket_type_id == 72 ? 'Claim OPD' : 'Claim GMC' ?></h4> <h4 class="mb-0"><?= isset($claim_ticket_type_id) && $claim_ticket_type_id == 72 ? 'Claim OPD' : 'Claim GMC' ?></h4>
@ -46,6 +53,7 @@
</a> </a>
</div> </div>
</div> </div>
-->
<?php } ?> <?php } ?>
<form role="form" class="parsley-examples" method="post" id="ticket_form_data" onsubmit="submitClaimForm(event, this)" enctype="multipart/form-data"> <form role="form" class="parsley-examples" method="post" id="ticket_form_data" onsubmit="submitClaimForm(event, this)" enctype="multipart/form-data">

View File

@ -22,13 +22,20 @@
} }
</style> </style>
<?php if (!isset($ticket_data)) { ?>
<script>
var pageHideMainNavTitle = true;
var pageTitle = 'Claim <?= $ticket_form ?>';
var pageBackButton = '<a href="<?= base_url('ticket/list') ?>" class="topbar-icon-btn" title="Back"><i class="ri-arrow-left-s-line"></i></a>';
</script>
<?php } ?>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="<?= !isset($ticket_data) ? "card" : "" ?>" style="margin-right: 23px;"> <div class="<?= !isset($ticket_data) ? "card" : "" ?>" style="margin-right: 23px;">
<div class="card-body"> <div class="card-body">
<?php if (!isset($ticket_data)) { ?> <?php if (!isset($ticket_data)) { ?>
<!-- Header Section --> <!-- Header Section -->
<!--
<div class="row mb-3"> <div class="row mb-3">
<div class="col-6 d-flex align-items-center"> <div class="col-6 d-flex align-items-center">
<h4 class="mb-0">Claim <?= $ticket_form ?></h4> <h4 class="mb-0">Claim <?= $ticket_form ?></h4>
@ -39,6 +46,7 @@
</a> </a>
</div> </div>
</div> </div>
-->
<?php } ?> <?php } ?>
<form role="form" class="parsley-examples" method="post" id="ticket_form_data" onsubmit="submitClaimForm(event, this)" <form role="form" class="parsley-examples" method="post" id="ticket_form_data" onsubmit="submitClaimForm(event, this)"
enctype="multipart/form-data"> enctype="multipart/form-data">

View File

@ -22,13 +22,20 @@
} }
</style> </style>
<?php if (!isset($ticket_data)) { ?>
<script>
var pageHideMainNavTitle = true;
var pageTitle = 'Claim <?= $ticket_form ?>';
var pageBackButton = '<a href="<?= base_url('ticket/list') ?>" class="topbar-icon-btn" title="Back"><i class="ri-arrow-left-s-line"></i></a>';
</script>
<?php }?>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="<?= !isset($ticket_data) ? "card" : "" ?>" style="margin-right: 23px;"> <div class="<?= !isset($ticket_data) ? "card" : "" ?>" style="margin-right: 23px;">
<div class="card-body"> <div class="card-body">
<?php if (!isset($ticket_data)) { ?> <?php if (!isset($ticket_data)) { ?>
<!-- Header Section --> <!-- Header Section -->
<!--
<div class="row mb-3"> <div class="row mb-3">
<div class="col-6 d-flex align-items-center"> <div class="col-6 d-flex align-items-center">
<h4 class="mb-0">Claim <?= $ticket_form ?></h4> <h4 class="mb-0">Claim <?= $ticket_form ?></h4>
@ -39,6 +46,7 @@
</a> </a>
</div> </div>
</div> </div>
-->
<?php } ?> <?php } ?>
<form role="form" class="parsley-examples" method="post" id="ticket_form_data" <form role="form" class="parsley-examples" method="post" id="ticket_form_data"
onsubmit="return validateBeforeSubmit(event, this)" onsubmit="return validateBeforeSubmit(event, this)"

View File

@ -57,16 +57,20 @@
} }
.dataTables_length label {height: 21px !important;} .dataTables_length label {height: 21px !important;}
</style> </style>
<script>
var pageHideMainNavTitle = true;
var pageTitle = 'Mail Template List';
</script>
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="padding-bottom: 10px;"> <!-- <div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Mail Template List </h4> <h4 style="position: relative;">Mail Template List </h4>
</div> </div>
</div> </div> -->
<div class="table-responsive"> <div class="table-responsive">
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap"> <table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
<thead class="bg-light"> <thead class="bg-light">

View File

@ -698,6 +698,34 @@ div.dataTables_wrapper {
max-width: 100%; max-width: 100%;
} }
/*
* DataTables consistent minimum height on main app pages (10" laptops large monitors).
* vmin tracks the smaller viewport edge; caps limit empty space on very large displays.
* Scroll split: min height on .dataTables_scroll / .dataTables_scrollBody.
* No scroll split: min height on wrapper only (avoids stacking min-heights with scroll region).
*/
.content-page div.dataTables_wrapper:not(:has(.dataTables_scroll)) {
min-height: clamp(18rem, 36vmin, 40rem);
}
.content-page div.dataTables_wrapper .dataTables_scroll {
min-height: clamp(16rem, 32vmin, 34rem);
}
.content-page div.dataTables_wrapper .dataTables_scrollBody {
min-height: clamp(14rem, 28vmin, 30rem);
}
/* Modals / overlays: do not reserve main-page list height */
.modal div.dataTables_wrapper,
.modal div.dataTables_wrapper .dataTables_scroll,
.modal div.dataTables_wrapper .dataTables_scrollBody,
#tpa_variation_modal div.dataTables_wrapper,
#tpa_variation_modal div.dataTables_wrapper .dataTables_scroll,
#tpa_variation_modal div.dataTables_wrapper .dataTables_scrollBody {
min-height: 0 !important;
}
/* Let the middle row shrink inside flex layouts so the wrapper doesnt widen the page */ /* Let the middle row shrink inside flex layouts so the wrapper doesnt widen the page */
div.dataTables_wrapper > .row .dataTables_scroll { div.dataTables_wrapper > .row .dataTables_scroll {
max-width: 100%; max-width: 100%;