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['flag_status'] = $event_mapping[$event] ?? "A";
$ICICILombardController = new ICICILombardController();
$apiResponse = $ICICILombardController->ICICIPushEmployeeDetails($requested_data);
// $ICICILombardController = new ICICILombardController();
// $apiResponse = $ICICILombardController->ICICIPushEmployeeDetails($requested_data);
// $r = Jobs::addJob(['job_name' => 'ICICIPushEmployeeDetails', 'payload' => $requested_data]);
// log_message('error', "ICICIPushEmployeeDetails job pushed successfully.");
$r = Jobs::addJob(['job_name' => 'ICICIPushEmployeeDetails', 'payload' => $requested_data]);
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' => 'required',
@ -659,8 +659,7 @@ class LeadsController extends BaseController
$request_data = $this->request->getPost();
$data = sanitizeInputArrayAdvanced($request_data);
$data['client_type'] = 1;
if ($data['lead_type'] != 1) {
if (! in_array((int) $data['lead_type'], [1, 3], true)) {
$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'];
@ -760,7 +759,8 @@ class LeadsController extends BaseController
$form_docs_name = "docs_name_" . $index_plus_one;
$leads_file_primary_key = $data['leads_file_id'] ?? [];
$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
if (isset($data['insurer'][$index]) && strpos($data['insurer'][$index], '-') !== false) {
@ -950,7 +950,7 @@ class LeadsController extends BaseController
$insertCount[] = $insert;
$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);
$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->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);
if (empty($leadDataForClient['is_client_created'])) {
$this->createClientWithLeadData($leadDataForClient);
@ -1079,7 +1079,7 @@ class LeadsController extends BaseController
$file_name = file_Upload_for_lead($value, $uploadFilePath, UPLOAD_EXT_LEAD_FILES);
$multi_file_data[] = [
'file_name' => $file_name,
'docs_name' => $docs_names[$index],
'docs_name' => $docs_names[$index] ?? '',
'id' => $primaryKey[$index] ?? "",
];
}
@ -1402,7 +1402,7 @@ class LeadsController extends BaseController
}
// 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
->select('policy_terms, placement_json')
->where('is_active', 1)
@ -2165,7 +2165,7 @@ class LeadsController extends BaseController
} // dd($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])) {
$lead_data = [
@ -4774,7 +4774,7 @@ class LeadsController extends BaseController
// 🔹 Client Details (Single Row)
$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')
->where('sales_actual_leads.lead_id', $actual_lead_id)
->first(); // first row only
@ -4842,7 +4842,7 @@ class LeadsController extends BaseController
$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']);
} else {
$data['lead_edit_data']['claims_details_html'] = "";
@ -5527,7 +5527,7 @@ class LeadsController extends BaseController
*
* @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 {
$leadId = (int) ($lead_data['id'] ?? 0);

View File

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

View File

@ -737,6 +737,8 @@ class TicketController extends BaseController
public function ticket_form($ticket_type)
{
$data = $this->ticket_form_data($ticket_type);
$data['tab_name'] = "Claims";
$data['page_name'] = "Claims";
// dd($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>
.reload:hover {
cursor: pointer;
}
.truncate {
max-width: 80px;
white-space: nowrap;
/* Column widths from max data length (see PHP above).
Avoid table-layout:fixed + identical max-width on TH it fights DataTables col sizing and skews TH vs TD.
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;
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 .modal-dialog {
@ -93,31 +183,50 @@
#tpa_variation_modal .dataTables_wrapper .dt-top .dataTables_filter {
text-align: right;
}
/* Compact table + buttons (NHance) */
#tickets-table thead th,
#tickets-table tbody td {
/* Compact tbody; thead must keep padding-right for sort triangles (custom.css uses ~2.35rem). */
#batch-list-table tbody td {
padding: 5px 11px !important;
font-size: 13px;
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 */
#tickets-table .dropdown-toggle.btn-sm {
#batch-list-table .dropdown-toggle.btn-sm {
padding: 4px 9px !important;
font-size: 13px;
line-height: 1.2;
}
/* DataTables toolbar buttons (Export/Filter/Clear Filter) */
#tickets-table_wrapper .dt-buttons .btn {
#batch-list-table_wrapper .dt-buttons .btn {
padding: 6px 13px !important;
font-size: 13px;
}
#tickets-table_wrapper .dt-buttons .btn .btn-custom {
#batch-list-table_wrapper .dt-buttons .btn .btn-custom {
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>
<div class="col-12" id="second_page">
@ -130,7 +239,7 @@
</div>
<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">
<tr>
<th class="font-weight-medium">S.No&nbsp;</th>
@ -159,14 +268,25 @@
<tr>
<td class="text-center"><b><?php echo ($key + 1) ?></b></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']?>
</td>
<td><?php echo $file['client_short_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_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 $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'] ?>
@ -175,6 +295,7 @@
data-toggle="tooltip" data-placement="top" title="<?php echo $insurer_or_tpa_display ?>"></a>
</td>
<td><?php echo $import_or_export[$file['actions']] ?? ucfirst($file['actions']) ?></td>
<td><?php echo $file['count'] == null ? '-' : $file['count'] ?></td>
@ -354,7 +475,7 @@
<div class="modal-body">
<ul class="nav nav-tabs" id="tpaVariationTabs" role="tablist">
<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 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>
@ -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) {
const $table = $(tableSelector);
const $thead = $table.find('thead');
@ -522,8 +660,10 @@
renderVariationTable('#not_in_tpa_table', notInTpa, tpaVariationColumns.not_in_tpa);
renderVariationTable('#need_to_review_table', reviewData, tpaVariationColumns.need_to_review);
const activeId = $('#tpaVariationTabs .nav-link.active').attr('id') || 'not-in-nhance-tab';
adjustVariationTableByTabId(activeId);
// Default tab: Not in Nhance — select tab and init DataTable for #not_in_nhance_table as soon as data is rendered.
showTPAVariationTabByLinkId('not-in-nhance-tab');
updateTPAProceedButton('not-in-nhance-tab');
adjustVariationTableByTabId('not-in-nhance-tab');
}
function showTPAVariationModal() {
@ -657,8 +797,10 @@
});
$('#tpa_variation_modal').on('shown.bs.modal', function () {
const activeId = $('#tpaVariationTabs .nav-link.active').attr('id') || 'not-in-nhance-tab';
adjustVariationTableByTabId(activeId);
// Always show "Not in Nhance" first; re-measure DataTable now that the modal is visible.
showTPAVariationTabByLinkId('not-in-nhance-tab');
updateTPAProceedButton('not-in-nhance-tab');
adjustVariationTableByTabId('not-in-nhance-tab');
});
$('#tpa_variation_modal').on('hidden.bs.modal', function () {
@ -667,10 +809,40 @@
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
"<'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: [
{
extend: 'collection',
@ -717,6 +889,8 @@
responsive: false
});
$.extend($.fn.dataTable.defaults, _dtDefScroll);
// Keep TH and TD widths in sync after any table redraw (search/sort/paginate).
batchListTable.on('draw.dt', function () {
batchListTable.columns.adjust();

View File

@ -85,6 +85,10 @@
}
</style>
<script>
var pageHideMainNavTitle = true;
var pageTitle = 'Claim Dump Upload';
</script>
<!-- <div class="row">
<div class="col-xl-12" style="margin-left: 14px;max-width: 98%;">
@ -125,12 +129,12 @@
<div class="col-12">
<div class="card">
<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;">
<h4 style="position: relative;">Claim Dump Upload</h4>
</div>
</div>
</div> -->
<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">
<tr>

View File

@ -162,7 +162,7 @@ input:checked + .slider:before {
</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>
<!-- Hidden File Input -->
@ -465,7 +465,7 @@ input:checked + .slider:before {
$.each(res.data, function (index, item) {
var row = `<tr>
<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="${item.id}" name="kyc_doc_type_id" />
<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="file" id="fileInput" name="emplist" required
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>
</form>
</div>

View File

@ -230,7 +230,7 @@
<input type="hidden" id="hr_file_upload_actions" name="upload-action-type">
<input type="file" id="fileInput" name="emplist" required
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>
</form>
</div>

View File

@ -258,7 +258,7 @@ table.dataTable thead th {
<button class="scroll-btn left-btn" type="button">&#9664;</button>
</li>
<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="d-none d-sm-inline-block ">Data From Client</span>
</a>

View File

@ -176,7 +176,7 @@ input:checked + .slider:before {
<i class="mdi mdi-upload additional-icon"></i>
</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 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" ?>"

View File

@ -474,6 +474,8 @@
<script>
var actualLeadClientName = '';
var actualLeadShortName = '';
let claimIndex = 1;
setTimeout(() => {
@ -539,8 +541,8 @@
var lead_type = $(this).val();
var increment = 1; // Example increment value (modify as needed)
var start_date_id = lead_type == "1" ? `policy_start_date_${increment}` : "policy_start_date";
var end_date_id = lead_type == "1" ? `policy_end_date_${increment}` : "policy_end_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" || lead_type == "3") ? `policy_end_date_${increment}` : "policy_end_date";
$(".policy_start_date").attr("id", start_date_id);
// $("label[for]").attr("for", start_date_id);
@ -551,7 +553,7 @@
// $('#leads_form_id')[0].reset();
// 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, {
dateFormat: "d/m/Y",
@ -583,32 +585,7 @@
// }
}
});
} else if (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) {
} else if (lead_type != 1 && lead_type != 3) {
$("#source_policy_id").prop("required", true);
$("#source_policy_start_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;
// updateRenewalFields(dataIncrement);
@ -755,7 +732,7 @@
leadTypeBsedHideAndShow(lead_type)
if (lead_type == 1) {
if (lead_type == 1 || lead_type == 3) {
$('.claim-row').hide();
@ -833,8 +810,19 @@
$('#lost_reason').val(res.data.lost_reason || '');
$('#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() {
$('#client_id').val(res.data.client_id).change();
$('#client_id').val(existingClientId).change();
setTimeout(function() {
$('#client_branch_id').val(res.data.client_branch_id).change();
setTimeout(function() {
@ -1130,7 +1118,7 @@
leadTypeBsedHideAndShow(lead_type)
if (lead_type == 1) {
if (lead_type == 1 || lead_type == 3) {
$('.claim-row').hide();
@ -1146,7 +1134,7 @@
$('.lifeClaimFields').show();
} else {
if (lead_type == 1) {
if (lead_type == 1 || lead_type == 3) {
updateRenewalFields(dataIncrement);
}
@ -1350,7 +1338,7 @@
// $(".policy_end_date").attr("id", end_date_id);
// Initialize date pickers
if (lead_type == 1) {
if (lead_type == 1 || lead_type == 3) {
var policy_start_datePicker = flatpickr("#policy_start_date_" + increment, {
dateFormat: "d/m/Y",
@ -1564,7 +1552,7 @@
console.log('Lead Type:', lead_type);
let increment = input.id.split('_').pop(); // Extract increment
if (lead_type == 1) {
if (lead_type == 1 || lead_type == 3) {
return;
}
@ -1682,7 +1670,7 @@
var lead_type = $('#lead_type').val();
if (lead_type == 1) {
if (lead_type == 1 || lead_type == 3) {
let formRow = input.closest('.form-row');
@ -1855,7 +1843,7 @@
let value = $(this).val()
leadTypeBsedHideAndShow(value, true)
if (value != 1) {
if (value != 1 && value != 3) {
removeExtraForms();
}
@ -1936,6 +1924,22 @@
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) {
@ -2284,8 +2288,7 @@
function leadTypeBsedHideAndShow(value, resetValues = false) {
if (value == 1) {
if (value == 1 || value == 3) {
$('.btnDiv').show();
$('.claim-row').hide();
@ -2509,17 +2512,20 @@
// CLIENT DETAILS AUTO FILL
// -------------------------------
if (actual_lead_client_details) {
$('#client_name').val(actual_lead_client_details.company_name || '');
actualLeadClientName = actual_lead_client_details.company_name || '';
$('#client_name').val(actualLeadClientName);
$('#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 || '';
if (existingShortName) {
// ── Short name EXISTS — just populate and validate ────────
$('#client_short_name').val(existingShortName);
// validateInput($('#client_short_name')[0], 'clients', 'short_name');
} else {
// existingShortName = actual_lead_client_details.short_name || '';
// if (existingShortName) {
// // ── Short name EXISTS — just populate and validate ────────
// $('#client_short_name').val(existingShortName);
// // validateInput($('#client_short_name')[0], 'clients', 'short_name');
// } else { }
// Auto-generate short name from company name
// Use a small delay to ensure DOM is ready
setTimeout(function () {
@ -2531,9 +2537,31 @@
makeUniqueShortName(baseName);
}, 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
// -------------------------------

View File

@ -525,9 +525,13 @@ if (isset($selected_lead_type)) {
}
if(client_type == ""){
toastr.warning('Please select the client type', 'Warning');
$('#client_short_name').val('')
return;
var aid = $('#actual_lead_id').val();
if (!aid || aid === '0') {
toastr.warning('Please select the client type', 'Warning');
$('#client_short_name').val('');
return;
}
// Actual-lead autofill: short name may be set before client type is chosen; do not clear it.
}
let value = $(input).val();
@ -839,7 +843,7 @@ if (isset($selected_lead_type)) {
$('.loader-mask').fadeIn();
if (lead_type == 1) {
if (lead_type == 1 || lead_type == 3) {
$('.claim-row').hide();
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
}
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 == ""){
$('#exixting_client').prop('checked', false);

View File

@ -189,7 +189,7 @@
</a>
<div class="dropdown-menu dropdown-menu-right">
<?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
</a>
<?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_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
let url = '<?php echo base_url('/util/getLeadNonEB/') ?>' + lead_form_type + '/' + actual_lead_id + '/' + lead_id;
// old URL
@ -835,13 +836,23 @@
}
function showEmailHistoryModal() {
var $modal = $('#EmailModal');
if (typeof jQuery !== 'undefined' && jQuery.fn && typeof jQuery.fn.modal === 'function') {
$modal.modal('show');
const el = document.getElementById('EmailModal');
if (!el) return;
// 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;
}
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){
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;
console.log("******** Fetching:", url);
@ -862,8 +886,7 @@
})
.then(response => response.json())
.then(response => {
let container = document.querySelector(".history-container");
container.innerHTML = "";
if (container) container.innerHTML = "";
if (response.status === "success" && response.data.length > 0) {
console.log("******** 1" + response.status);
let table = `
@ -974,7 +997,7 @@
})
.catch(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%;">
<p class="text-center font-color-black"><i>No Data Found</i></p>
</div>

View File

@ -106,8 +106,8 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
<div class="form-group col-md-4">
<label for="lead_type">Opportunity Type<span class="text-danger">*</span></label>
<select class="form-control" id="lead_type" name="lead_type" required>
<option value="">Select Opportunity Type</option>
<?php
<option value="">Select Opportunity Type</option>
<?php
if (isset($lead_type) && count($lead_type)) {
foreach ($lead_type as $key => $value) {
if ($key == 1) {
@ -489,6 +489,8 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
<script>
var actualLeadClientName = '';
var actualLeadShortName = '';
$(document).ready(function() {
$('#rfq_qcr_viewers').parsley({
@ -611,7 +613,7 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
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 referenceDiv = document.getElementById('appendAreaForClaim');
@ -765,7 +767,7 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
$('#lead_type').change(function() {
let value = $(this).val()
// alert(value);
if (value == 3) {
if (value == 1 || value == 3) {
// alert("Function Called");
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();
} else if (value != 3) {
} else if (value != 1 && value != 3) {
$("#source_policy_id").prop("required",true);
$("#source_policy_id").prop("required", true);
if(value == 2){
@ -848,12 +850,31 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
$('#policy_end_date').val("");
$("#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) {
if (value == 1) {
var actual_lead_id = $('#actual_lead_id').val();
if (value == 1 || value == 3) {
$('.btnDiv').show();
$('.claim-row').hide();
@ -1336,19 +1357,20 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
// CLIENT DETAILS AUTO FILL
// -------------------------------
if (actual_lead_client_details) {
$('#client_name').val(actual_lead_client_details.company_name || '');
actualLeadClientName = actual_lead_client_details.company_name || '';
$('#client_name').val(actualLeadClientName);
$('#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) {
// ── Short name EXISTS — just populate and validate ────────
// Prefer persisted short name while editing.
actualLeadShortName = existingShortName;
$('#client_short_name').val(existingShortName);
// validateInput($('#client_short_name')[0], 'clients', 'short_name');
} else {
// Auto-generate short name from company name
// Use a small delay to ensure DOM is ready
// Fallback: generate only when short name is unavailable.
setTimeout(function () {
let baseName = actual_lead_client_details.company_name
.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
// -------------------------------

View File

@ -1010,7 +1010,7 @@
<div class="form-group col-md-5">
<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">
<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 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>

View File

@ -321,9 +321,11 @@
<input type="hidden" id="entity_type_id">
<div class="row" id="inception_form">
<div class="col-xl-12" style="max-width: 100% !important;">
<!--
<div class="card">
<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;">
<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"
>Back</a>
</div> -->
</div>
<!-- </div> -->
<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">
@ -1151,8 +1153,10 @@
id="btnSubmit">Submit</button>
</div>
</form>
<!--
</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">
<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">
<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 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>

View File

@ -1017,7 +1017,7 @@ function addHTMLInput(data = null)
<div class="form-group col-md-5">
<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>
<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 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>

View File

@ -128,10 +128,12 @@
<div class="form-group col-md-3">
<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">
<small id="email_error" class="text-danger d-none"></small>
</div>
<div class="form-group col-md-3">
<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 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>
<i class="mdi mdi-upload additional-icon"></i>
</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 class="form-group col-md-4">
<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>
<i class="mdi mdi-upload additional-icon"></i>
</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 class="form-group col-md-4">
<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>
<i class="mdi mdi-upload additional-icon"></i>
</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-row">
@ -227,41 +229,6 @@
</div>
<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;
$(document).ready(function () {
$('#manager_id').select2();
@ -493,18 +460,77 @@
$('#partnerPOSForm').on('submit', function(e) {
e.preventDefault();
var $form = $(this);
// Validate the form using Parsley
$form.parsley().validate();
const form = this;
// Check if the form is valid
if ($form.parsley().isValid()) {
// If valid, submit via AJAX
handleSaveEditAndDelete('submit');
// HTML5 built-in validation
if (!form.checkValidity()) {
form.reportValidity(); // shows required/pattern tooltips
return;
}
// Custom validation
if (!validateForm()) return;
// If valid, submit via AJAX
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>
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="col-xl-12">
<div style="margin-top:10px !important;"></div>
<div class="card-body">
<div class="tab-wrapper position-relative">
<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;}
</style>
<script>
var pageHideMainNavTitle = true;
var pageTitle = 'Claim Feedback List';
</script>
<div class="col-12">
<div class="card">
<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;">
<h4 style="position: relative;">Claim Feedback List </h4>
</div>
</div>
</div> -->
<div class="table-responsive">
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
<thead class="bg-light">

View File

@ -28,7 +28,13 @@
font-size: 0.875rem;
}
</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="row">
<div class="col-12">
@ -36,6 +42,7 @@
<div class="card-body">
<?php if (!isset($ticket_data)) { ?>
<!-- Header Section -->
<!--
<div class="row mb-3">
<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>
@ -46,6 +53,7 @@
</a>
</div>
</div>
-->
<?php } ?>
<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>
<?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="col-12">
<div class="<?= !isset($ticket_data) ? "card" : "" ?>" style="margin-right: 23px;">
<div class="card-body">
<?php if (!isset($ticket_data)) { ?>
<!-- Header Section -->
<!--
<div class="row mb-3">
<div class="col-6 d-flex align-items-center">
<h4 class="mb-0">Claim <?= $ticket_form ?></h4>
@ -39,6 +46,7 @@
</a>
</div>
</div>
-->
<?php } ?>
<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>
<?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="col-12">
<div class="<?= !isset($ticket_data) ? "card" : "" ?>" style="margin-right: 23px;">
<div class="card-body">
<?php if (!isset($ticket_data)) { ?>
<!-- Header Section -->
<!--
<div class="row mb-3">
<div class="col-6 d-flex align-items-center">
<h4 class="mb-0">Claim <?= $ticket_form ?></h4>
@ -39,6 +46,7 @@
</a>
</div>
</div>
-->
<?php } ?>
<form role="form" class="parsley-examples" method="post" id="ticket_form_data"
onsubmit="return validateBeforeSubmit(event, this)"

View File

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

View File

@ -698,6 +698,34 @@ div.dataTables_wrapper {
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 */
div.dataTables_wrapper > .row .dataTables_scroll {
max-width: 100%;