MERGE_LIVE_OVERALL

This commit is contained in:
Ubuntu 2026-04-17 17:17:24 +05:30
commit 184d7ad147
56 changed files with 2339 additions and 789 deletions

View File

@ -815,13 +815,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

@ -904,7 +904,7 @@ class ClientController extends AdminController
{ {
$this->myLogger->logme('error', 'Edit Client Onboarding function called'); $this->myLogger->logme('error', 'Edit Client Onboarding function called');
$headerData['tab_name'] = 'Edit Client Onboarding'; $headerData['tab_name'] = 'Clients';
$headerData['page_name'] = 'Clients'; $headerData['page_name'] = 'Clients';
$editData['RM'] = $this->userModel->where('is_active', 1)->findAll(); $editData['RM'] = $this->userModel->where('is_active', 1)->findAll();

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 = [
@ -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'] = "";

View File

@ -759,6 +759,7 @@ class RuleImportController extends AdminController
public function ruleList($id) public function ruleList($id)
{ {
$data['tab_name'] = "Rule Manager";
$data['page_name'] = "Rule Manager"; $data['page_name'] = "Rule Manager";
$data['departments'] = $this->departments; $data['departments'] = $this->departments;
$data['commission_file_id'] = $id; $data['commission_file_id'] = $id;

View File

@ -170,7 +170,7 @@
#client_add .tab-content-styles{ #client_add .tab-content-styles{
background-color:#F4F4F4; background-color:#F4F4F4;
margin-right:20px; margin-right:20px;
margin-top:0px !important; margin-top:12px !important; /** margin-top:0px !important; */
border-radius:25px!important; border-radius:25px!important;
min-height: 70vh !important; min-height: 70vh !important;
} }

View File

@ -67,28 +67,54 @@
padding: 4px 12px; padding: 4px 12px;
font-size: 12px; font-size: 12px;
} }
/* Keep DataTable controls aligned like reference UI */
#tpa_variation_modal .dataTables_wrapper .dt-top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 6px;
}
#tpa_variation_modal .dataTables_wrapper .dt-bottom {
display: flex;
justify-content: flex-end;
align-items: center;
margin-top: 6px;
}
#tpa_variation_modal .dataTables_wrapper .dt-top .dataTables_length,
#tpa_variation_modal .dataTables_wrapper .dt-top .dataTables_filter,
#tpa_variation_modal .dataTables_wrapper .dt-bottom .dataTables_paginate {
float: none;
margin: 0;
}
#tpa_variation_modal .dataTables_wrapper .dt-top .dataTables_filter {
text-align: right;
}
/* Compact table + buttons (NHance) */ /* Compact table + buttons (NHance) */
#datatable-buttons thead th, #tickets-table thead th,
#datatable-buttons 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;
} }
/* Action dropdown toggle in rows */ /* Action dropdown toggle in rows */
#datatable-buttons .dropdown-toggle.btn-sm { #tickets-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) */
#datatable-buttons_wrapper .dt-buttons .btn { #tickets-table_wrapper .dt-buttons .btn {
padding: 6px 13px !important; padding: 6px 13px !important;
font-size: 13px; font-size: 13px;
} }
#datatable-buttons_wrapper .dt-buttons .btn .btn-custom { #tickets-table_wrapper .dt-buttons .btn .btn-custom {
font-size: 13px; font-size: 13px;
} }
@ -104,10 +130,10 @@
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
<table data-custom-table-css="table" id="datatable-buttons" class="table table-hover m-0 table-centered dt-responsive w-100"> <table data-custom-table-css="table" id="tickets-table" class="table table-hover m-0 table-centered dt-responsive 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>
<th class="font-weight-medium">Batch Code&nbsp;</th> <th class="font-weight-medium">Batch Code&nbsp;</th>
<th class="font-weight-medium">File Name&nbsp;</th> <th class="font-weight-medium">File Name&nbsp;</th>
<th class="font-weight-medium">Client&nbsp;</th> <th class="font-weight-medium">Client&nbsp;</th>
@ -489,9 +515,8 @@
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);
initVariationDataTable('#not_in_nhance_table'); const activeId = $('#tpaVariationTabs .nav-link.active').attr('id') || 'not-in-nhance-tab';
initVariationDataTable('#not_in_tpa_table'); adjustVariationTableByTabId(activeId);
initVariationDataTable('#need_to_review_table');
} }
function showTPAVariationModal() { function showTPAVariationModal() {
@ -506,18 +531,85 @@
updateTPAProceedButton($activeTab.attr('id')); updateTPAProceedButton($activeTab.attr('id'));
} }
function initVariationDataTable(tableSelector) { function getVariationDataTableConfig() {
const $table = $(tableSelector); return {
dom: "<'dt-top'lf>" +
$table.DataTable({ "rt" +
"<'dt-bottom'p>",
pageLength: 20, pageLength: 20,
lengthMenu: [[10, 20, 50, 100], [10, 20, 50, 100]], lengthMenu: [[10, 20, 50, 100], [10, 20, 50, 100]],
searching: true, searching: true,
paging: true, paging: true,
ordering: false, ordering: false,
info: true, info: false,
autoWidth: false autoWidth: false,
language: {
search: `
<div class="datatable-search-wrapper" style="position:relative; display:inline-block;">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"
style="position:absolute; right:10px; top:50%; transform:translateY(-50%); color:#666;"></i>
<i class="mdi mdi-close-circle datatable-clear-icon"
style="position:absolute; right:10px; top:50%; transform:translateY(-50%); color:#666; display:none; cursor:pointer;"></i>
</div>`,
searchPlaceholder: "Search"
}
};
}
function bindVariationSearchIcons($table) {
const $wrapper = $table.closest('.dataTables_wrapper');
const $searchInput = $wrapper.find('.dataTables_filter input');
const $magnify = $wrapper.find('.datatable-search-icon');
const $clear = $wrapper.find('.datatable-clear-icon');
if (!$searchInput.length) {
return;
}
$searchInput.off('input.variationSearch').on('input.variationSearch', function () {
const hasValue = !!$(this).val();
$magnify.toggle(!hasValue);
$clear.toggle(hasValue);
}); });
$clear.off('click.variationSearch').on('click.variationSearch', function () {
$searchInput.val('').trigger('input').trigger('keyup');
});
const hasInitialValue = !!$searchInput.val();
$magnify.toggle(!hasInitialValue);
$clear.toggle(hasInitialValue);
}
function initVariationDataTable(tableSelector) {
const $table = $(tableSelector);
if (!$table.length) {
return;
}
if (!$.fn.DataTable.isDataTable($table)) {
$table.DataTable(getVariationDataTableConfig());
}
const dt = $table.DataTable();
dt.columns.adjust().draw(false);
bindVariationSearchIcons($table);
}
function adjustVariationTableByTabId(tabId) {
const tabToTableMap = {
'not-in-nhance-tab': '#not_in_nhance_table',
'not-in-tpa-tab': '#not_in_tpa_table',
'need-to-review-tab': '#need_to_review_table'
};
const tableSelector = tabToTableMap[tabId];
if (!tableSelector) {
return;
}
initVariationDataTable(tableSelector);
} }
function destroyVariationDataTable(tableSelector) { function destroyVariationDataTable(tableSelector) {
@ -550,13 +642,25 @@
$(document).ready(function() { $(document).ready(function() {
// Update proceed button label/visibility on tab change // Update proceed button label/visibility and ensure datatable is rendered on tab change
$('#tpaVariationTabs a[data-toggle="tab"]').on('shown.bs.tab', function (e) { $('#tpaVariationTabs a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
const activeId = $(e.target).attr('id'); const activeId = $(e.target).attr('id');
updateTPAProceedButton(activeId); updateTPAProceedButton(activeId);
adjustVariationTableByTabId(activeId);
}); });
$('#datatable-buttons').DataTable({ $('#tpa_variation_modal').on('shown.bs.modal', function () {
const activeId = $('#tpaVariationTabs .nav-link.active').attr('id') || 'not-in-nhance-tab';
adjustVariationTableByTabId(activeId);
});
$('#tpa_variation_modal').on('hidden.bs.modal', function () {
destroyVariationDataTable('#not_in_nhance_table');
destroyVariationDataTable('#not_in_tpa_table');
destroyVariationDataTable('#need_to_review_table');
});
const batchListTable = $('#tickets-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]],
@ -591,19 +695,35 @@
], ],
language: { language: {
search: ` search: `
<div class="datatable-search-wrapper" style="position:relative; display:inline-block;"> <div class="datatable-search-wrapper" style="position:relative; display:inline-block;">
_INPUT_ _INPUT_
<i class="mdi mdi-magnify datatable-search-icon" <i class="mdi mdi-magnify datatable-search-icon"
style="position:absolute; right:10px; top:50%; transform:translateY(-50%); color:#666;"></i> style="position:absolute; right:10px; top:50%; transform:translateY(-50%); color:#666;"></i>
<i class="mdi mdi-close-circle datatable-clear-icon" <i class="mdi mdi-close-circle datatable-clear-icon"
style="position:absolute; right:10px; top:50%; transform:translateY(-50%); color:#666; display:none;"></i> style="position:absolute; right:10px; top:50%; transform:translateY(-50%); color:#666; display:none;"></i>
</div>`, </div>`,
searchPlaceholder: "Search", searchPlaceholder: "Search",
emptyTable: '<div class="text-center text-muted">No Data found</div>' emptyTable: '<div class="text-center text-muted">No Data found</div>'
}, },
paging: true autoWidth: false,
paging: true,
responsive: false
}); });
// Keep TH and TD widths in sync after any table redraw (search/sort/paginate).
batchListTable.on('draw.dt', function () {
batchListTable.columns.adjust();
});
$(window).on('resize', function () {
batchListTable.columns.adjust();
});
// Initial alignment after DataTable renders buttons/filter layout.
setTimeout(function () {
batchListTable.columns.adjust();
}, 0);
}); });
// Function to format a number in Indian Rupees format // Function to format a number in Indian Rupees format

View File

@ -1,4 +1,52 @@
<style> <style>
.image-preview {
border: 1px solid #00999E;
border-radius: 12px;
width: 70px;
height: 70px;
display: flex;
align-items: center;
justify-content: center;
/* margin-right: 15px; */
}
.image-preview img {
width: 50px;
height: 50px;
object-fit: contain;
transition: transform 0.2s ease-in-out;
}
.image-preview:hover img {
transform: scale(1.2);
cursor: zoom-in;
}
.upload-btn {
background-color: #00999E;
color: #fff;
border: none;
border-radius: 25px;
padding: 6px 20px;
margin-right: 10px;
cursor: pointer;
font-size: 14px;
}
.helper-text {
font-size: 12px;
color: #666;
margin-top: 8px;
word-wrap: break-word;
overflow-wrap: break-word;
white-space: normal;
max-width: 285px;
}
.hidden-input {
display: none;
}
.switch { .switch {
position: relative; position: relative;
display: inline-block; display: inline-block;
@ -70,7 +118,7 @@ input:checked + .slider:before {
<input type="hidden" name="PrimaryKey" id="general_PrimaryKey" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/> <input type="hidden" name="PrimaryKey" id="general_PrimaryKey" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
<input type="hidden" name="client_id" id="client_id" /> <input type="hidden" name="client_id" id="client_id" />
<div class="form-group"> <div class="form-group">
<div class="form-row"> <!-- <div class="form-row">
<div class="form-group"> <div class="form-group">
<label for="">Upload Your Logo</label> <br> <label for="">Upload Your Logo</label> <br>
<img <img
@ -87,7 +135,47 @@ input:checked + .slider:before {
<br> <br>
</div> </div>
</div> </div> -->
<!-- Client Logo -->
<div class="form-group col-md-12">
<label for="client_logo">Upload Your Logo</label>
<div class="row align-items-center">
<!-- Left column: Image -->
<div class="col-auto">
<div class="image-preview">
<img src="<?= isset($client['client_logo']) && !empty($client['client_logo']) ? base_url() . "public/uploads/logo/" . $client['client_logo'] : base_url() . "public/assets/images/avatar_2x.png" ?>"
id="uploadPreview0"
class="avatar img-circle img-thumbnail"
alt="Client Logo" onerror="this.src='<?= base_url() . 'public/assets/images/avatar_2x.png' ?>'" />
</div>
</div>
<!-- Right column: Buttons + text -->
<div class="col">
<div class="d-flex">
<button type="button" class="upload-btn" onclick="document.getElementById('client_logo').click();">Upload</button>
<!-- <button type="button" class="delete-btn" onclick="removeImage0();">Delete</button> -->
</div>
<div class="helper-text" id="fileNameText0">
<?= isset($client['client_logo']) && !empty($client['client_logo']) ? $client['client_logo'] : '( Upload Your Logo )' ?>
</div>
</div>
</div>
<small class="mt-1 text-muted d-block">Allowed: PNG, JPG, JPEG. Size : 200KB Dimension : 100 X 100 Pixels</small>
<div id="client_logo_error_container"></div>
<!-- Hidden File Input -->
<input type="file" class="hidden-input"
id="client_logo" name="client_logo"
accept="image/jpeg, image/jpg, image/png"
onchange="PreviewImage0(event);"
data-parsley-max-file-size="200"
data-parsley-file-extension="jpg,jpeg,png"
data-parsley-errors-container="#client_logo_error_container"
/>
</div>
<!-- TPA Logo Ends -->
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="entity_type_id">Entity Type <span <label for="entity_type_id">Entity Type <span
@ -110,13 +198,15 @@ input:checked + .slider:before {
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="client_name">Client Name<span <label for="client_name">Client Name<span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input type="text" class="form-control" id="client_name" data-old-name="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>" <input type="text" class="form-control" id="client_name" data-old-name="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>"
placeholder="Enter Client Name" value="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>" name="client_name" required> placeholder="Enter Client Name" value="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>" name="client_name"
required maxlength="255" data-parsley-maxlength="255">
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="short_name">Client Short Name<span <label for="short_name">Client Short Name<span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input type="text" class="form-control" id="short_name" <input type="text" class="form-control" id="short_name"
maxlength="100" data-parsley-maxlength="100"
data-old-short="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>" data-old-short="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>"
placeholder="Enter Short Name" value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>" name="short_name" onkeyup="validateInput(this, 'clients', 'short_name', 'clientBtnSubmit')" required> placeholder="Enter Short Name" value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>" name="short_name" onkeyup="validateInput(this, 'clients', 'short_name', 'clientBtnSubmit')" required>
</div> </div>
@ -125,7 +215,8 @@ input:checked + .slider:before {
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="pan">PAN<span class="text-danger"></span></label> <label for="pan">PAN<span class="text-danger"></span></label>
<input type="text" class="form-control" id="pan" placeholder="Enter PAN Number" data-parsley-error-message="Invalid PAN Number. Example: ABCDE1234F" value="<?= isset($client['pan']) ? $client['pan'] : '' ?>" name="pan" data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$"> <input type="text" class="form-control" id="pan" placeholder="Enter PAN Number" data-parsley-error-message="Invalid PAN Number. Example: ABCDE1234F" value="<?= isset($client['pan']) ? $client['pan'] : '' ?>" name="pan"
maxlength="10" data-parsley-maxlength="10" data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$">
</div> </div>
<!-- <div class="form-group col-md-4"> <!-- <div class="form-group col-md-4">
<label for="gst">GST<span class="text-danger">*</span></label> <label for="gst">GST<span class="text-danger">*</span></label>
@ -151,7 +242,7 @@ input:checked + .slider:before {
type="radio" type="radio"
name="hr_file_processed_by" name="hr_file_processed_by"
id="hr_processed" id="hr_processed"
value="1" <?php echo(isset($client['hr_file_processed_by']) && $client['hr_file_processed_by'] == 1) ? 'checked' : '' ?>> value="1" required <?php echo(isset($client['hr_file_processed_by']) && $client['hr_file_processed_by'] == 1) ? 'checked' : '' ?>>
<label class="form-check-label" for="hr_processed">HR</label> <label class="form-check-label" for="hr_processed">HR</label>
</div> </div>
@ -196,7 +287,17 @@ input:checked + .slider:before {
</div> </div>
<!-- end --> <!-- end -->
<!-- Image Preview Modal -->
<div class="modal fade" id="imagePreviewModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg">
<div class="modal-content" style="background: transparent; border: 0;">
<div class="modal-body text-center p-0">
<img src="" id="modalImage" class="img-fluid rounded" alt="Full-size preview" style="max-height: 90vh; cursor: zoom-out;">
</div>
</div>
</div>
</div>
<!-- /.modal -->
<script> <script>
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
@ -211,8 +312,30 @@ input:checked + .slider:before {
}); });
</script> </script>
<script>function PreviewImage0(event) {
const input = event.target;
const file = input.files[0];
if (file) {
// Show preview
const reader = new FileReader();
reader.onload = function(e) {
document.getElementById('uploadPreview0').src = e.target.result;
};
reader.readAsDataURL(file);
// Show file name
document.getElementById('fileNameText0').innerText = file.name;
}
}
function removeImage0() {
// Reset preview to default
document.getElementById('uploadPreview0').src = "<?= base_url() . 'public/assets/images/avatar_2x.png' ?>";
document.getElementById('fileNameText0').innerText = '( Upload Your TPA Logo )';
document.getElementById('client_logo').value = ""; // clear file input
}
</script>
<script> <script>
var PrimaryKey = $('#general_PrimaryKey').val(); var PrimaryKey = $('#general_PrimaryKey').val();
@ -224,6 +347,21 @@ input:checked + .slider:before {
return; return;
}); });
$('#parent_client_id').select2(); $('#parent_client_id').select2();
// Handle image preview click to open modal
$('.image-preview').on('click', function() {
const imgSrc = $(this).find('img').attr('src');
// Don't open modal for the placeholder image
if (imgSrc && !imgSrc.includes('avatar_2x.png')) {
$('#modalImage').attr('src', imgSrc);
$('#imagePreviewModal').modal('show');
}
});
// Close modal on click (either on image or backdrop)
$('#imagePreviewModal').on('click', function() {
$(this).modal('hide');
});
}); });
$(document).ready(function () { $(document).ready(function () {
@ -327,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"> <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>
<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}"/>
@ -392,30 +530,6 @@ input:checked + .slider:before {
} }
function PreviewImage() {
console.log('function called');
var fileInput = document.getElementById("client_logo");
var file = fileInput.files[0];
if (file) {
var allowedExtensions = ["jpg", "jpeg", "png"];
var fileExtension = file.name.split('.').pop().toLowerCase();
if (!allowedExtensions.includes(fileExtension) || file.size > 200 * 1024) {
toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.');
fileInput.value = ""; // Clear the file input
document.getElementById("uploadPreview").src = "<?= base_url()?>/public/assets/images/avatar_2x.png"; // Remove the preview image
} else {
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function (event) {
document.getElementById("uploadPreview").src = event.target.result;
};
}
}
}
function validateFile(input) { function validateFile(input) {
if (!input.files || !input.files[0]) return; if (!input.files || !input.files[0]) return;

View File

@ -1,7 +1,7 @@
<script> <script>
var pageSubTitle = 'Client Deposit - <?= $clientName[0]["client_name"]; ?>'; var pageHideMainNavTitle = true;
var pageTitle = 'Client Deposit - <?= $clientName[0]["client_name"]; ?>';
var pageBackButton = '<a href="<?= base_url("client/list"); ?>" data-toggle="tooltip" data-placement="top" title="Back to Client List"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>'; var pageBackButton = '<a href="<?= base_url("client/list"); ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back to Client List" aria-label="Back to Client List"><i class="ri-arrow-left-s-line"></i></a>';
</script> </script>
<div class="row" id="client_list"> <div class="row" id="client_list">
<div class="col-12"> <div class="col-12">

View File

@ -67,6 +67,23 @@ table.dataTable thead th {
.dataTables_length label {height: 21px !important;} .dataTables_length label {height: 21px !important;}
#tickets-table .btn-group.dropdown,
#tickets-table .dropdown {
position: relative;
}
#tickets-table .dropdown-menu {
z-index: 30000 !important;
max-height: 170px;
overflow-y: auto;
overflow-x: hidden;
scroll-behavior: smooth;
}
#tickets-table .dropdown-menu.show {
z-index: 30000 !important;
}
@ -408,6 +425,40 @@ $('#toggleButtons').on('change', function() {
}) })
// Client list specific guard: keep action menu above table header
// and always show from the top (prevents first item from appearing hidden).
$(document).on('show.bs.dropdown', '#tickets-table tbody .dropdown', function () {
var $dd = $(this);
var $menu = $dd.children('.dropdown-menu');
var $row = $dd.closest('tr');
var $tbodyRows = $row.closest('tbody').children('tr:visible');
var $toggle = $dd.children('[data-toggle="dropdown"]').first();
var toggleEl = $toggle[0];
$dd.closest('.card-body').css('overflow', 'visible');
$dd.closest('.table-responsive').css('overflow', 'visible');
if (toggleEl && toggleEl.getClientRects().length) {
var rect = toggleEl.getBoundingClientRect();
var below = Math.max(0, window.innerHeight - rect.bottom - 8);
var above = Math.max(0, rect.top - 8);
var menuHeight = ($menu.outerHeight() || 150);
var openUp = (below < menuHeight && above > below);
$dd.toggleClass('dropup', openUp);
}
if ($menu.length) {
$menu.css('z-index', '30000');
$menu.scrollTop(0);
}
});
$(document).on('hidden.bs.dropdown', '#tickets-table tbody .dropdown', function () {
var $dd = $(this);
$dd.removeClass('dropup');
$dd.children('.dropdown-menu').scrollTop(0).css('z-index', '');
});
function renderRows(incomingData) { function renderRows(incomingData) {
let actualList = []; let actualList = [];

View File

@ -272,8 +272,9 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<script> <script>
var pageSubTitle = 'Client Onboarding <span id="client_heading"><?php if (isset($client)) { echo ' - ' . addslashes($client['client_name']); } ?></span>'; var pageHideMainNavTitle = true;
var pageBackButton = '<a href="<?= base_url("client/list"); ?>" aria-label="Back to list"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>'; var pageTitle = 'Client Onboarding <span id="client_heading"><?php if (isset($client)) { echo ' - ' . addslashes($client['client_name']); } ?></span>';
var pageBackButton = '<a href="<?= base_url("client/list"); ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back to list"><i class="ri-arrow-left-s-line"></i></a>';
</script> </script>
<!-- <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;">
@ -296,7 +297,7 @@
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false" <a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
class="nav-link px-3 py-2 active" id="general_tab"> 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">General</span> <span class="d-none d-sm-inline-block">General</span>
</a> </a>

125
app/Views/errors/403.php Executable file
View File

@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><?= isset($page_name) ? $page_name : 'NHance'; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="" name="description" />
<meta content="NHANCE" name="NHANCE" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- App favicon -->
<link rel="shortcut icon" href="<?= base_url()."public"; ?>/assets/images/Nhance_Favi.svg">
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
font-family: 'Poppins', sans-serif;
color: #103245;
background-color: #ffffff;
background-image: radial-gradient(circle at 0 0, rgba(87, 233, 255, 0.16) 0, rgba(87, 233, 255, 0.16) 180px, transparent 180px), radial-gradient(circle at 100% 100%, rgba(87, 233, 255, 0.16) 0, rgba(87, 233, 255, 0.16) 220px, transparent 220px);
padding: 24px;
}
.error-wrapper {
width: 100%;
max-width: 900px;
text-align: center;
}
.error-image {
width: min(100%, 560px);
height: auto;
display: block;
margin: 0 auto 10px auto;
}
.error-title {
font-size: clamp(34px, 3.8vw, 54px);
line-height: 1.2;
letter-spacing: 0.02em;
margin-bottom: 10px;
font-weight: 700;
text-transform: uppercase;
color: #0f2f44;
}
.error-subtitle {
font-size: clamp(15px, 1.4vw, 32px);
color: #415b69;
margin-bottom: 24px;
font-weight: 400;
}
.go-back-btn {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 142px;
height: 48px;
border: 0;
border-radius: 10px;
background: #00a9c5;
color: #ffffff;
font-size: 16px;
font-weight: 600;
text-decoration: none;
cursor: pointer;
transition: transform 0.2s ease, background-color 0.2s ease;
}
.go-back-btn:hover {
background: #008ea6;
transform: translateY(-1px);
}
.go-back-btn:focus-visible {
outline: 3px solid rgba(0, 169, 197, 0.35);
outline-offset: 2px;
}
@media screen and (max-width: 640px) {
body {
padding: 20px;
background-image: radial-gradient(circle at 0 0, rgba(87, 233, 255, 0.12) 0, rgba(87, 233, 255, 0.12) 120px, transparent 120px), radial-gradient(circle at 100% 100%, rgba(87, 233, 255, 0.12) 0, rgba(87, 233, 255, 0.12) 140px, transparent 140px);
}
.error-image {
margin-bottom: 20px;
}
.error-subtitle {
margin-bottom: 24px;
}
}
</style>
</head>
<body>
<main class="error-wrapper">
<img class="error-image" src="<?= base_url()."public"; ?>/assets/images/errors/403_illustration.jpeg" alt="403 access denied">
<h1 class="error-title">ACCESS DENIED</h1>
<p class="error-subtitle">
<?= isset($message) && !empty($message) ? $message : "You don't have permission to access this page." ?>
</p>
<a class="go-back-btn" href="javascript:history.back()">Go Back</a>
</main>
</body>
</html>

View File

@ -15,7 +15,7 @@
<style> <style>
@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
* { * {
margin: 0; margin: 0;
@ -24,134 +24,86 @@
} }
body { body {
position: relative; min-height: 100vh;
display: flex; display: flex;
justify-content: center;
align-items: center; align-items: center;
height: 100vh; justify-content: center;
background: #22232e;
font-family: 'Poppins', sans-serif; font-family: 'Poppins', sans-serif;
color: #103245;
background-color: #ffffff;
background-image: radial-gradient(circle at 0 0, rgba(87, 233, 255, 0.16) 0, rgba(87, 233, 255, 0.16) 180px, transparent 180px), radial-gradient(circle at 100% 100%, rgba(87, 233, 255, 0.16) 0, rgba(87, 233, 255, 0.16) 220px, transparent 220px);
padding: 24px;
} }
a { .error-wrapper {
text-decoration: none;
}
ul {
list-style: disc;
color: #e0ffff;
}
section {
width: 100%; width: 100%;
max-width: 900px;
text-align: center;
} }
.container { .error-image {
display: flex; width: min(100%, 560px);
justify-content: center; height: auto;
align-items: center;
flex-direction: row;
column-gap: 20px;
}
.container img {
width: 420px;
}
.text {
display: block; display: block;
padding: 40px 40px; margin: 0 auto 10px auto;
width: 450px;
} }
.text h1 { .error-title {
color: #00c2cb; font-size: clamp(34px, 3.8vw, 54px);
font-size: 35px; line-height: 1.2;
letter-spacing: 0.02em;
margin-bottom: 10px;
font-weight: 700; font-weight: 700;
margin-bottom: 15px; text-transform: uppercase;
color: #0f2f44;
} }
.text p { .error-subtitle {
font-size: 15px; font-size: clamp(15px, 1.4vw, 32px);
color: #e0ffff; color: #415b69;
margin-bottom: 15px; margin-bottom: 24px;
line-height: 1.5rem; font-weight: 400;
margin-bottom: 15px;
} }
.text .input-box { .go-back-btn {
position: relative; display: inline-flex;
display: flex;
width: 100%;
}
.input-box input {
width: 85%;
height: 40px;
padding: 5px 15px;
font-family: 'Jost', sans-serif;
font-size: 16px;
color: #22232e;
border-radius: 5px 0px 0px 5px;
border: 2px solid #42455a;
outline: none;
}
.input-box button {
display: flex;
width: 15%;
border: 1px solid #004958;
border-radius: 0px 5px 5px 0px;
background: #004958;
color: #e0ffff;
font-size: 22px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
min-width: 142px;
height: 48px;
border: 0;
border-radius: 10px;
background: #00a9c5;
color: #ffffff;
font-size: 16px;
font-weight: 600;
text-decoration: none;
cursor: pointer; cursor: pointer;
transition: transform 0.2s ease, background-color 0.2s ease;
} }
.menu { .go-back-btn:hover {
display: flex; background: #008ea6;
flex-direction: column; transform: translateY(-1px);
margin-top: 15px;
margin-left: 30px;
} }
.menu li a { .go-back-btn:focus-visible {
display: flex; outline: 3px solid rgba(0, 169, 197, 0.35);
font-size: 1rem; outline-offset: 2px;
color: #00c2cb;
transition: 0.1s;
} }
@media screen and (max-width:600px) { @media screen and (max-width: 640px) {
.container { body {
display: flex; padding: 20px;
flex-direction: column-reverse; background-image: radial-gradient(circle at 0 0, rgba(87, 233, 255, 0.12) 0, rgba(87, 233, 255, 0.12) 120px, transparent 120px), radial-gradient(circle at 100% 100%, rgba(87, 233, 255, 0.12) 0, rgba(87, 233, 255, 0.12) 140px, transparent 140px);
} }
.text, .error-image {
.image { margin-bottom: 20px;
width: 100%;
} }
.container { .error-subtitle {
min-width: 200px; margin-bottom: 24px;
padding: 40px 0px;
}
.text {
display: block;
width: 100%;
padding: 20px 40px;
}
.image {
display: flex;
width: 200px;
align-self: center;
justify-content: center;
margin: auto;
} }
} }
</style> </style>
@ -160,16 +112,14 @@
<body> <body>
<section> <main class="error-wrapper">
<div class="container"> <img class="error-image" src="<?= base_url()."public"; ?>/assets/images/errors/404_illustration.jpg" alt="404 page not found illustration">
<div class="text" style="text-align: center;"> <h1 class="error-title">PAGE NOT FOUND</h1>
<h1><?= isset($message) && !empty($message) ? $message : '404 PAGE NOT FOUND' ?></h1> <p class="error-subtitle">
</div> <?= isset($message) && !empty($message) ? $message : "Sorry, the page you're looking for doesn't exist or has been moved." ?>
<div><img class="image" src="https://omjsblog.files.wordpress.com/2023/07/errorimg.png" alt=""></div> </p>
</div> <a class="go-back-btn" href="javascript:history.back()">Go Back</a>
</div> </main>
</section>
</body> </body>
</html> </html>

175
app/Views/errors/404_old.php Executable file
View File

@ -0,0 +1,175 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><?= isset($page_name) ? $page_name : 'NHance'; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="" name="description" />
<meta content="NHANCE" name="NHANCE" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- App favicon -->
<link rel="shortcut icon" href="<?= base_url()."public"; ?>/assets/images/Nhance_Favi.svg">
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
position: relative;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #22232e;
font-family: 'Poppins', sans-serif;
}
a {
text-decoration: none;
}
ul {
list-style: disc;
color: #e0ffff;
}
section {
width: 100%;
}
.container {
display: flex;
justify-content: center;
align-items: center;
flex-direction: row;
column-gap: 20px;
}
.container img {
width: 420px;
}
.text {
display: block;
padding: 40px 40px;
width: 450px;
}
.text h1 {
color: #00c2cb;
font-size: 35px;
font-weight: 700;
margin-bottom: 15px;
}
.text p {
font-size: 15px;
color: #e0ffff;
margin-bottom: 15px;
line-height: 1.5rem;
margin-bottom: 15px;
}
.text .input-box {
position: relative;
display: flex;
width: 100%;
}
.input-box input {
width: 85%;
height: 40px;
padding: 5px 15px;
font-family: 'Jost', sans-serif;
font-size: 16px;
color: #22232e;
border-radius: 5px 0px 0px 5px;
border: 2px solid #42455a;
outline: none;
}
.input-box button {
display: flex;
width: 15%;
border: 1px solid #004958;
border-radius: 0px 5px 5px 0px;
background: #004958;
color: #e0ffff;
font-size: 22px;
align-items: center;
justify-content: center;
cursor: pointer;
}
.menu {
display: flex;
flex-direction: column;
margin-top: 15px;
margin-left: 30px;
}
.menu li a {
display: flex;
font-size: 1rem;
color: #00c2cb;
transition: 0.1s;
}
@media screen and (max-width:600px) {
.container {
display: flex;
flex-direction: column-reverse;
}
.text,
.image {
width: 100%;
}
.container {
min-width: 200px;
padding: 40px 0px;
}
.text {
display: block;
width: 100%;
padding: 20px 40px;
}
.image {
display: flex;
width: 200px;
align-self: center;
justify-content: center;
margin: auto;
}
}
</style>
</head>
<body>
<section>
<div class="container">
<div class="text" style="text-align: center;">
<h1><?= isset($message) && !empty($message) ? $message : '404 PAGE NOT FOUND' ?></h1>
</div>
<div><img class="image" src="https://omjsblog.files.wordpress.com/2023/07/errorimg.png" alt=""></div>
</div>
</div>
</section>
</body>
</html>

View File

@ -220,6 +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>
<button type="submit" class="btn btn-primary">Upload</button> <button type="submit" class="btn btn-primary">Upload</button>
</form> </form>
</div> </div>

View File

@ -1,9 +1,57 @@
<style> <style>
.table th,
.table td {
padding: 8px;
}
table.dataTable tbody td {
padding: 4px 4px !important;
}
.select2-container .select2-selection--multiple .select2-selection__choice { .select2-container .select2-selection--multiple .select2-selection__choice {
padding: 5px 7px 5px 0 !important; padding: 5px 7px 5px 0 !important;
color: #000000; color: #000000;
} }
.dataTables_length label {height: 21px !important;} .dataTables_length label {height: 21px !important;}
#hr_tickets_table {
width: 100% !important;
}
#hr_tickets_table thead th {
white-space: nowrap;
vertical-align: middle;
}
#hr_tickets_table_wrapper .dataTables_filter {
margin-bottom: 12px;
}
#hr_tickets_table_wrapper .datatable-search-wrapper {
width: auto !important;
}
#hr_tickets_table_wrapper .dataTables_filter input {
width: 220px !important;
background: #F0F0F0;
border: none;
border-radius: 8px;
padding-right: 34px !important;
}
#hr_tickets_table_wrapper .datatable-search-icon,
#hr_tickets_table_wrapper .datatable-clear-icon {
right: 11px !important;
}
#hr_tickets_table_wrapper .dt-buttons {
display: flex;
justify-content: flex-end;
align-items: center;
}
#hr_tickets_table_wrapper .dt-buttons .app-btn-secondary,
#hr_tickets_table_wrapper .dt-buttons .btn-secondary {
border-radius: 10px;
}
#hr_tickets_table_wrapper .dataTables_scrollHeadInner,
#hr_tickets_table_wrapper .dataTables_scrollHeadInner table,
#hr_tickets_table_wrapper .dataTables_scrollBody table {
width: 100% !important;
}
#hr_tickets_table tbody tr:hover {
background-color: #e0e0e0;
}
</style> </style>
@ -117,7 +165,8 @@
</div> </div>
</div> </div>
<table data-custom-table-css="table" class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" <div class="table-responsive">
<table data-custom-table-css="table" class="table mb-0 nowrap w-100 table-centered" cellspacing="0"
id="hr_tickets_table"> id="hr_tickets_table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
@ -155,6 +204,7 @@
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</div> </div>
</div><!-- end col --> </div><!-- end col -->
@ -180,6 +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>
<button type="submit" class="btn btn-primary">Upload</button> <button type="submit" class="btn btn-primary">Upload</button>
</form> </form>
</div> </div>
@ -276,13 +327,26 @@
tbody = `<tr><td colspan="9" class="text-center">No records found</td></tr>`; tbody = `<tr><td colspan="9" class="text-center">No records found</td></tr>`;
} }
$("#hr_tickets_table tbody").html(tbody); if (window.hrFileTableInstance) {
window.hrFileTableInstance.clear();
$("#hr_tickets_table tbody").html(tbody);
window.hrFileTableInstance.rows.add($("#hr_tickets_table tbody tr")).draw();
window.hrFileTableInstance.columns.adjust().draw(false);
} else {
$("#hr_tickets_table tbody").html(tbody);
}
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
console.error("Error:", error); console.error("Error:", error);
$("#hr_tickets_table tbody").html( const errorRow = `<tr><td colspan="9" class="text-center text-danger">Something went wrong</td></tr>`;
`<tr><td colspan="9" class="text-center text-danger">Something went wrong</td></tr>` if (window.hrFileTableInstance) {
); window.hrFileTableInstance.clear();
$("#hr_tickets_table tbody").html(errorRow);
window.hrFileTableInstance.rows.add($("#hr_tickets_table tbody tr")).draw();
window.hrFileTableInstance.columns.adjust().draw(false);
} else {
$("#hr_tickets_table tbody").html(errorRow);
}
}, },
}); });
}); });
@ -357,8 +421,27 @@
// ---------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------
// for datatable // for datatable
window.hrFileTableInstance = window.hrFileTableInstance || null;
function fixHrUploadTableHeaderWidth() {
const $wrapper = $('#hr_tickets_table_wrapper');
if (!$wrapper.length) {
return;
}
$wrapper.find('.dataTables_scrollHeadInner, .dataTables_scrollHeadInner table, .dataTables_scrollBody table')
.css('width', '100%');
if (window.hrFileTableInstance) {
window.hrFileTableInstance.columns.adjust().draw(false);
}
}
$(document).ready(function() { $(document).ready(function() {
$('#hr_tickets_table').DataTable({ if (window.hrFileTableInstance) {
return;
}
window.hrFileTableInstance = $('#hr_tickets_table').DataTable({
scrollX: false,
autoWidth: false,
// dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" + // dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" +
// "<'row'<'col-sm-12'tr>>" + // "<'row'<'col-sm-12'tr>>" +
// "<'row'<'col-sm-5'i><'col-sm-7'p>>", // "<'row'<'col-sm-5'i><'col-sm-7'p>>",
@ -396,7 +479,20 @@
emptyTable: '<div class="text-center text-muted">No Data found</div>' emptyTable: '<div class="text-center text-muted">No Data found</div>'
}, },
paging: true, paging: true,
ordering: false,
}); });
$('.dataTables_filter input').css({
'background': '#F0F0F0',
'border': 'none',
'border-radius': '8px',
'padding-right': '34px'
});
setTimeout(fixHrUploadTableHeaderWidth, 0);
});
$(document).on('shown.bs.tab shown.bs.collapse shown.bs.modal', function() {
setTimeout(fixHrUploadTableHeaderWidth, 50);
}); });
//for initialize the file upload for the files table //for initialize the file upload for the files table

View File

@ -10,6 +10,17 @@
margin-top: 5px; margin-top: 5px;
color: #6c757d; color: #6c757d;
} }
.field-error {
color: #dc3545;
font-size: 12px;
margin-top: 4px;
display: block;
}
.is-invalid {
border-color: #dc3545 !important;
}
</style> </style>
<!-- Optional CSS --> <!-- Optional CSS -->
<style> <style>
@ -76,13 +87,13 @@
<div class="modal-header flex-column"> <div class="modal-header flex-column">
<div class="d-flex w-100 justify-content-between align-items-center"> <div class="d-flex w-100 justify-content-between align-items-center">
<h4 class="modal-title mb-0" id="modalLabel">New Branch</h4> <h4 class="modal-title mb-0" id="modalLabel">New Branch</h4>
<button type="button" class="close js-branch-modal-close" data-dismiss="modal" data-bs-dismiss="modal" aria-hidden="true">×</button> <button type="button" class="close js-branch-modal-close" data-dismiss="modal" data-bs-dismiss="modal" aria-hidden="true" onclick="hideBranchModal()">×</button>
</div> </div>
</div> </div>
<!-- Modal Body --> <!-- Modal Body -->
<div class="modal-body"> <div class="modal-body">
<form id="insurer_branch_form" role="form" class="parsley-examples" method="post" action="" enctype="multipart/form-data"> <form id="insurer_branch_form" role="form" class="parsley-examples" novalidate method="post" action="" enctype="multipart/form-data">
<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" name="PrimaryKey" id="insurer_Branch_PrimaryKey" /> <input type="hidden" name="PrimaryKey" id="insurer_Branch_PrimaryKey" />
<input type="hidden" name="insurer_id" id="insurer_id_branch" value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>"/> <input type="hidden" name="insurer_id" id="insurer_id_branch" value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>"/>
@ -143,16 +154,16 @@
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="pincode">Pincode <span class="text-danger">*</span></label> <label for="pincode">Pincode <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required> <input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required maxlength="6" inputmode="numeric">
</div> </div>
</div> </div>
<!-- Submit / Cancel --> <!-- Submit / Cancel -->
<div class="form-row"> <div class="form-row">
<!-- <div class="form-group col-md-12 mt-2"> --> <!-- <div class="form-group col-md-12 mt-2"> -->
<div style="margin-top: 85px;"> <div class="w-100 d-flex justify-content-end" style="margin-top: 85px;">
<button type="submit" class="btn btn-primary mr-2" id="btnSubmit">Submit</button> <button type="submit" class="btn btn-primary mr-2" id="btnSubmit">Submit</button>
<button type="button" class="btn app-btn-outline-secondary btnBack" id="btnBack" data-dismiss="modal" data-bs-dismiss="modal" aria-hidden="true">Cancel</button> <button type="button" class="btn app-btn-outline-secondary btnBack" id="btnBack" data-dismiss="modal" data-bs-dismiss="modal" aria-hidden="true" onclick="hideBranchModal()">Cancel</button>
</div> </div>
<!-- </div> --> <!-- </div> -->
</div> </div>
@ -326,46 +337,63 @@
function hideBranchModal() { function hideBranchModal() {
var $m = $('#insurerBranchModal'); var $m = $('#insurerBranchModal');
if (typeof jQuery !== 'undefined' && jQuery.fn && typeof jQuery.fn.modal === 'function') { var modalEl = document.getElementById('insurerBranchModal');
$m.modal('hide'); if (!modalEl) {
return; return;
} }
var modalEl = document.getElementById('insurerBranchModal');
if (window.bootstrap && bootstrap.Modal) { var closed = false;
if (typeof bootstrap.Modal.getOrCreateInstance === 'function') {
bootstrap.Modal.getOrCreateInstance(modalEl).hide(); try {
return; if (typeof jQuery !== 'undefined' && jQuery.fn && typeof jQuery.fn.modal === 'function') {
$m.modal('hide');
closed = true;
} }
if (typeof bootstrap.Modal.getInstance === 'function') { if (!closed && window.bootstrap && bootstrap.Modal && modalEl) {
var existing = bootstrap.Modal.getInstance(modalEl); if (typeof bootstrap.Modal.getOrCreateInstance === 'function') {
if (existing) { bootstrap.Modal.getOrCreateInstance(modalEl).hide();
existing.hide(); closed = true;
return; }
if (!closed && typeof bootstrap.Modal.getInstance === 'function') {
var existing = bootstrap.Modal.getInstance(modalEl);
if (existing) {
existing.hide();
closed = true;
}
}
if (!closed) {
(new bootstrap.Modal(modalEl)).hide();
closed = true;
} }
} }
try { } catch (e) {
(new bootstrap.Modal(modalEl)).hide(); console.error(branchDebugPrefix + ' hide modal failed; forcing close', e);
} catch (e) {} }
// Guarantee immediate close even if modal plugin state is broken.
if (!closed || modalEl.classList.contains('show')) {
forceHideBranchModal();
} }
} }
function resetInsurerBranchFormState() { function forceHideBranchModal() {
var $form = $('#insurer_branch_form'); var modalEl = document.getElementById('insurerBranchModal');
if ($form.length && $form[0] && typeof $form[0].reset === 'function') { if (!modalEl) {
$form[0].reset(); return;
} }
if ($form.length && typeof $form.parsley === 'function') { modalEl.classList.remove('show');
try { modalEl.style.display = 'none';
$form.parsley().reset(); modalEl.setAttribute('aria-hidden', 'true');
} catch (e) {} modalEl.removeAttribute('aria-modal');
} document.body.classList.remove('modal-open');
document.body.style.removeProperty('padding-right');
contactCount = 1; $('.modal-backdrop').remove();
$('#container').empty(); }
$('#contact_1_wrapper input').val('');
$('#insurer_Branch_PrimaryKey').val(''); function setBranchModalTitle(title) {
toggleAddButton(); $('#modalLabel').text(title || 'New Branch');
} }
function renderBranchRows(rows) { function renderBranchRows(rows) {
@ -385,6 +413,121 @@
$('#insurer_branch_list').html(html); $('#insurer_branch_list').html(html);
} }
function getFieldKey($field) {
var name = ($field.attr('name') || '').trim();
var id = ($field.attr('id') || '').trim();
if (name === 'name[]') return 'contact_name';
if (name === 'designation[]') return 'designation';
if (name === 'email[]') return 'email';
if (name === 'mobile[]') return 'mobile';
if (id) return id;
return name.replace(/\[\]$/, '');
}
function getErrorMessage(key, value) {
var v = (value || '').toString().trim();
var alphaHyphenSpace = /^[a-zA-Z\s\-]+$/;
var alphaNumHyphenSpace = /^[a-zA-Z0-9\s\-]+$/;
var contactNamePattern = /^[a-zA-Z0-9\s_-]+$/;
var emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
switch (key) {
case 'branch_name':
return '';
case 'branch_code':
return '';
case 'address1':
return '';
case 'state':
if (!alphaHyphenSpace.test(v)) return 'State name can only contain letters, spaces, and hyphens.';
return '';
case 'district':
if (!alphaNumHyphenSpace.test(v)) return 'District can contain letters, numbers, spaces, and hyphens.';
return '';
case 'branch_city':
if (!alphaNumHyphenSpace.test(v)) return 'City can contain letters, numbers, spaces, and hyphens.';
return '';
case 'pincode':
if (!/^\d+$/.test(v)) return 'Pincode must be digits only.';
if (!/^\d{6}$/.test(v)) return 'Pincode must be exactly 6 digits.';
return '';
case 'contact_name':
if (v.length < 2) return 'Contact name must be at least 2 characters';
if (!contactNamePattern.test(v)) return 'Contact name is invalid Format';
return '';
case 'designation':
return '';
case 'email':
if (!emailPattern.test(v)) return 'Please enter a valid email format (e.g., name@domain.com).';
return '';
case 'mobile':
if (!/^\d+$/.test(v)) return 'Mobile must contain only digits';
if (!/^\d{10}$/.test(v)) return 'Mobile number must be exactly 10 digits';
return '';
default:
return '';
}
}
function getErrorElement($field) {
var $next = $field.next('.field-error');
if ($next.length) return $next;
var $error = $('<small class="field-error"></small>');
$field.after($error);
return $error;
}
function validateField($field) {
if (!$field || !$field.length) return true;
var key = getFieldKey($field);
var value = $field.val();
if (key === 'state') {
var selectedText = ($field.find('option:selected').text() || '').trim();
value = (selectedText === 'Select State') ? '' : selectedText;
}
var message = getErrorMessage(key, value);
var $error = getErrorElement($field);
if (message) {
$field.addClass('is-invalid');
$error.text(message);
return false;
}
$field.removeClass('is-invalid');
$error.text('');
return true;
}
function validateInsurerBranchForm() {
var isValid = true;
var selectors = [
'#branch_name',
'#branch_code',
'#address1',
'#state',
'#district',
'#branch_city',
'#pincode',
'input[name="name[]"]',
'input[name="designation[]"]',
'input[name="email[]"]',
'input[name="mobile[]"]'
];
$(selectors.join(',')).each(function () {
if (!validateField($(this))) {
isValid = false;
}
});
return isValid;
}
function initBranchDataTable() { function initBranchDataTable() {
if ($.fn.DataTable.isDataTable('#branch-datatable')) { if ($.fn.DataTable.isDataTable('#branch-datatable')) {
$('#branch-datatable').DataTable().destroy(); $('#branch-datatable').DataTable().destroy();
@ -431,6 +574,7 @@
insurer_branch_form_action = '<?= base_url("master/insurer/branch/create"); ?>'; insurer_branch_form_action = '<?= base_url("master/insurer/branch/create"); ?>';
contactCount = 1; contactCount = 1;
setBranchModalTitle('New Branch');
showBranchModal(); showBranchModal();
@ -494,8 +638,18 @@
} }
}); });
$('#insurerBranchModal').on('hidden.bs.modal', function () { $(document).on('input change', '#insurer_branch_form input, #insurer_branch_form select', function () {
resetInsurerBranchFormState(); validateField($(this));
});
$(document).on('input', '#pincode', function () {
this.value = (this.value || '').replace(/\D/g, '').slice(0, 6);
validateField($(this));
});
$(document).on('input', 'input[name="mobile[]"]', function () {
this.value = (this.value || '').replace(/\D/g, '').slice(0, 10);
validateField($(this));
}); });
}); });
@ -503,8 +657,32 @@
if (e && typeof e.preventDefault === 'function') { if (e && typeof e.preventDefault === 'function') {
e.preventDefault(); e.preventDefault();
} }
var $fb = $('#insurer_branch_form');
if ($fb.length && $fb[0] && typeof $fb[0].reset === 'function') {
$fb[0].reset();
}
contactCount = 1
hideBranchModal(); hideBranchModal();
}); // $('#add_branch').hide();
// $('#branch_table').show();
// $('.btnBack').hide();
// $('#btnBranchAdd').show();
$('#branch_name').val('');
$('#branch_code').val('');
$('#state').val('');
$('#district').val('');
$('#branch_city').val('');
$('#name').val('');
$('#email').val('');
$('#mobile').val('');
$('#designation').val('');
$('#container').empty(); $('#contact_1_wrapper input').val('');
})
$(document).on('click', '.js-branch-modal-close', function(e){ $(document).on('click', '.js-branch-modal-close', function(e){
if (e && typeof e.preventDefault === 'function') { if (e && typeof e.preventDefault === 'function') {
@ -517,7 +695,7 @@
$("#insurer_branch_form").submit(function(events) { $("#insurer_branch_form").submit(function(events) {
console.log(1, insurer_branch_form_action); console.log(1, insurer_branch_form_action);
events.preventDefault(); events.preventDefault();
var isValid = $('#insurer_branch_form').parsley().validate(); var isValid = validateInsurerBranchForm();
if (isValid) { if (isValid) {
var formData = new FormData($('#insurer_branch_form')[0]); var formData = new FormData($('#insurer_branch_form')[0]);
@ -580,6 +758,7 @@
$('#insurer_Branch_PrimaryKey').val(branch_id); $('#insurer_Branch_PrimaryKey').val(branch_id);
insurer_branch_form_action = '<?= base_url("master/insurer/branch/edit"); ?>'; insurer_branch_form_action = '<?= base_url("master/insurer/branch/edit"); ?>';
setBranchModalTitle('Edit Branch');
console.log(insurer_branch_form_action) console.log(insurer_branch_form_action)

View File

@ -47,6 +47,21 @@
#dynamic-form-container::-webkit-scrollbar-track { #dynamic-form-container::-webkit-scrollbar-track {
background-color: #f1f1f1; /* Background color of the scrollbar track */ background-color: #f1f1f1; /* Background color of the scrollbar track */
} }
#template_modal {
padding-right: 0 !important;
z-index: 1060;
}
#template_modal.show {
display: flex !important;
align-items: center;
justify-content: center;
}
.modal-backdrop {
z-index: 1050;
}
</style> </style>
<div class="tab-pane fade" id="template-tab" style="padding-left: 25px;"> <div class="tab-pane fade" id="template-tab" style="padding-left: 25px;">
@ -120,12 +135,12 @@
<!-- Center modal content --> <!-- Center modal content -->
<div class="modal fade" id="template_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" <div class="modal fade" id="template_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
aria-hidden="true" aria-modal="true" data-backdrop="static" style="padding-right: 15px"> aria-hidden="true" aria-modal="true" data-backdrop="static">
<div class="modal-dialog modal-full-width"> <div class="modal-dialog modal-full-width modal-dialog-centered">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title" id="myCenterModalLabel">Create Template</h4> <h4 class="modal-title" id="myCenterModalLabel">Create Template</h4>
<button type="button" id="close_btn" class="close" data-dismiss="modal" aria-hidden="true">×</button> <button type="button" id="close_btn" class="close js-template-modal-close" data-dismiss="modal" data-bs-dismiss="modal" aria-hidden="true" onclick="hideTemplateModal()">×</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form class="parsley-examples" method="post" id="templateForm" enctype="multipart/form-data"> <form class="parsley-examples" method="post" id="templateForm" enctype="multipart/form-data">
@ -260,27 +275,136 @@
<script> <script>
var insurerTemplateDataTable = null; var insurerTemplateDataTable = null;
var templateDebugPrefix = '[InsurerTemplate]';
function showTemplateModal() { function showTemplateModal() {
var $modal = $('#template_modal');
var modalEl = document.getElementById('template_modal'); var modalEl = document.getElementById('template_modal');
if (!modalEl) {
return;
}
if (typeof jQuery !== 'undefined' && jQuery.fn && typeof jQuery.fn.modal === 'function') {
try {
$modal.modal('show');
setTimeout(function () {
if (!$modal.hasClass('show') || !$modal.is(':visible')) {
forceShowTemplateModal();
}
}, 120);
} catch (e) {
console.error(templateDebugPrefix + ' jQuery.modal show failed:', e);
forceShowTemplateModal();
}
return;
}
if (window.bootstrap && bootstrap.Modal) { if (window.bootstrap && bootstrap.Modal) {
if (typeof bootstrap.Modal.getOrCreateInstance === 'function') { if (typeof bootstrap.Modal.getOrCreateInstance === 'function') {
bootstrap.Modal.getOrCreateInstance(modalEl).show(); try {
bootstrap.Modal.getOrCreateInstance(modalEl).show();
} catch (e) {
console.error(templateDebugPrefix + ' bootstrap getOrCreateInstance show failed:', e);
forceShowTemplateModal();
}
return; return;
} }
if (typeof bootstrap.Modal.getInstance === 'function') { if (typeof bootstrap.Modal.getInstance === 'function') {
var existing = bootstrap.Modal.getInstance(modalEl); var existing = bootstrap.Modal.getInstance(modalEl);
if (existing) { if (existing) {
existing.show(); try {
existing.show();
} catch (e) {
console.error(templateDebugPrefix + ' bootstrap existing show failed:', e);
forceShowTemplateModal();
}
return; return;
} }
} }
try { try {
(new bootstrap.Modal(modalEl)).show(); (new bootstrap.Modal(modalEl)).show();
return; return;
} catch (e) {} } catch (e) {
console.error(templateDebugPrefix + ' bootstrap constructor show failed:', e);
forceShowTemplateModal();
return;
}
} }
$('#template_modal').modal('show');
forceShowTemplateModal();
}
function forceShowTemplateModal() {
var modalEl = document.getElementById('template_modal');
if (!modalEl) {
return;
}
modalEl.style.display = 'block';
modalEl.classList.add('show');
modalEl.removeAttribute('aria-hidden');
modalEl.setAttribute('aria-modal', 'true');
document.body.classList.add('modal-open');
if (!document.querySelector('.modal-backdrop')) {
var backdrop = document.createElement('div');
backdrop.className = 'modal-backdrop fade show';
document.body.appendChild(backdrop);
}
}
function hideTemplateModal() {
var $modal = $('#template_modal');
var modalEl = document.getElementById('template_modal');
if (!modalEl) {
return;
}
var closed = false;
try {
if (typeof jQuery !== 'undefined' && jQuery.fn && typeof jQuery.fn.modal === 'function') {
$modal.modal('hide');
closed = true;
}
if (!closed && window.bootstrap && bootstrap.Modal) {
if (typeof bootstrap.Modal.getOrCreateInstance === 'function') {
bootstrap.Modal.getOrCreateInstance(modalEl).hide();
closed = true;
}
if (!closed && typeof bootstrap.Modal.getInstance === 'function') {
var existing = bootstrap.Modal.getInstance(modalEl);
if (existing) {
existing.hide();
closed = true;
}
}
if (!closed) {
(new bootstrap.Modal(modalEl)).hide();
closed = true;
}
}
} catch (e) {
console.error(templateDebugPrefix + ' hide modal failed:', e);
}
if (!closed || modalEl.classList.contains('show')) {
forceHideTemplateModal();
}
}
function forceHideTemplateModal() {
var modalEl = document.getElementById('template_modal');
if (!modalEl) {
return;
}
modalEl.classList.remove('show');
modalEl.style.display = 'none';
modalEl.setAttribute('aria-hidden', 'true');
modalEl.removeAttribute('aria-modal');
document.body.classList.remove('modal-open');
document.body.style.removeProperty('padding-right');
$('.modal-backdrop').remove();
} }
function initInsurerTemplateDataTable() { function initInsurerTemplateDataTable() {

View File

@ -1,6 +1,7 @@
<script> <script>
var pageSubTitle = 'Insurer'; var pageHideMainNavTitle = true;
var pageBackButton = '<a href="#" onclick="history.back(); return false;" data-toggle="tooltip" data-placement="top" title="Back"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>'; var pageTitle = 'Insurer';
var pageBackButton = '<a href="<?= base_url('master/insurer/list') ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back"><i class="ri-arrow-left-s-line"></i></a>';
</script> </script>
<div class="row" id="insurer_add"> <div class="row" id="insurer_add">
<div class="col-12"> <div class="col-12">

View File

@ -12,12 +12,32 @@
#table-kyc-docs_wrapper .datatable-clear-icon{ #table-kyc-docs_wrapper .datatable-clear-icon{
right: 11px !important; right: 11px !important;
} }
/* Unset position on datatables filter to fix alignment issues */
#table-kyc-docs_wrapper div.dataTables_filter {
position: unset !important;
}
#kycdocsModal {
padding-right: 0 !important;
z-index: 1060;
}
#kycdocsModal.show {
display: flex !important;
align-items: center;
justify-content: center;
}
.modal-backdrop {
z-index: 1050;
}
</style> </style>
<div class="tab-pane fade" id="branch-tab"> <div class="tab-pane fade" id="branch-tab">
<div class="row float-right" style="padding-bottom: 10px;position: relative;right: 13px;"> <div class="row float-right" style="padding-bottom: 10px;position: relative;right: 13px;">
<button type="button" id="btnBranchAdd" class="btn btn-primary waves-effect waves-light btn-sm"><span class="mdi mdi-plus-box-outline" aria-hidden="true" style="padding: 5px 10px;"></span>Add KYC Docs</button> <button type="button" id="btnKycDocsAdd" class="btn btn-primary waves-effect waves-light btn-sm"><span class="mdi mdi-plus-box-outline" aria-hidden="true" style="padding: 5px 10px;"></span>Add KYC Docs</button>
</div> </div>
<div class="table-responsive" id="branch_table" > <div class="table-responsive" id="branch_table" >
@ -80,7 +100,7 @@
<div class="modal-header flex-column"> <div class="modal-header flex-column">
<div class="d-flex w-100 justify-content-between align-items-center"> <div class="d-flex w-100 justify-content-between align-items-center">
<h4 class="modal-title mb-0" id="modalLabel">KYC Docs</h4> <h4 class="modal-title mb-0" id="modalLabel">KYC Docs</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close js-kyc-docs-close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span> <span aria-hidden="true">×</span>
</button> </button>
</div> </div>
@ -104,11 +124,11 @@
</div> </div>
<!-- Form Actions --> <!-- Form Actions -->
<div class="form-group text-right mb-0"> <div class="form-group d-flex justify-content-end mb-0" id="hide_smbt_btn">
<button type="button" class="btn app-btn-outline-secondary waves-effect btnBack" id="btnBack" data-dismiss="modal"> <button type="button" class="btn app-btn-outline-secondary mr-2 waves-effect js-kyc-docs-cancel" data-bs-dismiss="modal">
Cancel Cancel
</button> </button>
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit"> <button type="submit" class="btn app-btn-secondary waves-effect waves-light" id="btnSubmit">
Submit Submit
</button> </button>
</div> </div>
@ -124,101 +144,249 @@
$(document).ready(function () { $(document).ready(function () {
var kyc_Docs_PrimaryKey = $('#kyc_type_id').val(); var kyc_Docs_PrimaryKey = $('#kyc_General_PrimaryKey').val();
var kyc_docs_form_action = ''; var kyc_docs_form_action = '';
var kycDocsTable = null; var kycDocsTable = null;
var myModal = new bootstrap.Modal(document.getElementById('kycdocsModal'));
myModal.hide(); var kycDocsDebugPrefix = '[KYCDocs]';
function resetKYCDocsForm() {
console.log(kycDocsDebugPrefix + ' resetKYCDocsForm() called.');
var $form = $('#kyc_docs_form');
// Reset the form fields
if ($form.length && typeof $form[0].reset === 'function') {
$form[0].reset();
}
// Reset Parsley validation state
if ($form.length && typeof $form.parsley === 'function') {
try {
$form.parsley().reset();
} catch (e) {
console.warn(kycDocsDebugPrefix + ' Could not reset parsley form.', e);
}
}
// Explicitly clear fields just in case .reset() fails or they are not part of the form
$('#file_name').val('');
$('#kyc_Docs_PrimaryKey').val('');
}
function normalizeKYCDocsRows(response) {
if (!response) return [];
if (Array.isArray(response)) return response;
if (Array.isArray(response.kyc_docs)) return response.kyc_docs;
if (Array.isArray(response.data)) return response.data;
if (response.data && Array.isArray(response.data.kyc_docs)) return response.data.kyc_docs;
return [];
}
function renderKYCDocsTableRows(rows) {
var html = '';
$.each(rows || [], function(index, item) {
var fileName = (item && (item.file_name || item.fileName || item.document_name || item.name)) || '';
var rowId = (item && (item.id || item.primarykey || item.PrimaryKey)) || '';
html += `
<tr>
<td>${fileName}</td>
<td>
<a class="btnBranchEdit" data-id="${rowId}" href="#"><i data-id="${rowId}" class="mdi mdi-lead-pencil btnBranchEdit" style="font-size:18px;"></i></a>
<a style="color:#02a8b5" data-id="${rowId}" onclick="removeKYCDocs(this)"><i data-id="${rowId}" class="mdi mdi-delete" style="font-size:18px;"></i></a>
</td>
</tr>
`;
});
$('#kyc_docs_list').html(html);
}
window.forceHideKYCDocsModal = function () {
console.log(kycDocsDebugPrefix + ' forceHideKYCDocsModal() called.');
var modalEl = document.getElementById('kycdocsModal');
if (modalEl) {
modalEl.classList.remove('show');
modalEl.classList.remove('in');
modalEl.style.display = 'none';
modalEl.setAttribute('aria-hidden', 'true');
modalEl.removeAttribute('aria-modal');
}
document.body.classList.remove('modal-open');
document.body.style.removeProperty('padding-right');
$('.modal-backdrop').remove();
console.log(kycDocsDebugPrefix + ' forceHideKYCDocsModal() finished.');
};
window.forceShowKYCDocsModal = function () {
console.log(kycDocsDebugPrefix + ' forceShowKYCDocsModal() called.');
var modalEl = document.getElementById('kycdocsModal');
if (!modalEl) {
console.log(kycDocsDebugPrefix + ' Modal element not found. Aborting.');
return;
}
console.log(kycDocsDebugPrefix + ' Displaying modal element.');
modalEl.style.display = 'block';
modalEl.classList.add('show');
modalEl.removeAttribute('aria-hidden');
modalEl.setAttribute('aria-modal', 'true');
document.body.classList.add('modal-open');
if (!document.querySelector('.modal-backdrop')) {
console.log(kycDocsDebugPrefix + ' Creating and appending modal-backdrop.');
var backdrop = document.createElement('div');
backdrop.className = 'modal-backdrop fade show';
document.body.appendChild(backdrop);
} else {
console.log(kycDocsDebugPrefix + ' Modal-backdrop already exists.');
}
console.log(kycDocsDebugPrefix + ' forceShowKYCDocsModal() finished.');
};
window.showKYCDocsModal = function () {
console.log(kycDocsDebugPrefix + ' showKYCDocsModal() called.');
var $modal = $('#kycdocsModal');
var modalEl = document.getElementById('kycdocsModal');
try {
console.log(kycDocsDebugPrefix + ' Trying to show modal using jQuery/Bootstrap.');
if (typeof jQuery !== 'undefined' && jQuery.fn && typeof jQuery.fn.modal === 'function') {
console.log(kycDocsDebugPrefix + ' Using jQuery modal("show").');
$modal.modal('show');
console.log(kycDocsDebugPrefix + ' Setting timeout to check if modal is visible.');
setTimeout(function () {
console.log(kycDocsDebugPrefix + ' Timeout check: Modal has "show" class:', $modal.hasClass('show'), 'Is visible:', $modal.is(':visible'));
if (!$modal.hasClass('show') || !$modal.is(':visible')) {
console.log(kycDocsDebugPrefix + ' Modal not visible after timeout, forcing show.');
window.forceShowKYCDocsModal();
}
}, 120);
console.log(kycDocsDebugPrefix + ' showKYCDocsModal() finished via jQuery path.');
return;
}
console.log(kycDocsDebugPrefix + ' jQuery modal not available. Checking for Bootstrap 5 API.');
if (window.bootstrap && bootstrap.Modal && modalEl) {
if (typeof bootstrap.Modal.getOrCreateInstance === 'function') {
console.log(kycDocsDebugPrefix + ' Using bootstrap.Modal.getOrCreateInstance().show().');
bootstrap.Modal.getOrCreateInstance(modalEl).show();
console.log(kycDocsDebugPrefix + ' showKYCDocsModal() finished via BS5 getOrCreateInstance.');
return;
}
if (typeof bootstrap.Modal.getInstance === 'function') {
console.log(kycDocsDebugPrefix + ' Using bootstrap.Modal.getInstance().');
var existing = bootstrap.Modal.getInstance(modalEl);
if (existing) {
console.log(kycDocsDebugPrefix + ' Existing BS5 instance found, calling show().');
existing.show();
console.log(kycDocsDebugPrefix + ' showKYCDocsModal() finished via existing BS5 instance.');
return;
}
}
console.log(kycDocsDebugPrefix + ' Using new bootstrap.Modal().show().');
(new bootstrap.Modal(modalEl)).show();
console.log(kycDocsDebugPrefix + ' showKYCDocsModal() finished via new BS5 instance.');
return;
}
} catch (e) {
console.error('[KYCDocs] Failed to show modal:', e);
console.log(kycDocsDebugPrefix + ' Falling back to forceShowKYCDocsModal().');
window.forceShowKYCDocsModal();
return;
}
console.log(kycDocsDebugPrefix + ' No standard modal methods found, falling back to forceShowKYCDocsModal().');
window.forceShowKYCDocsModal();
};
window.hideKYCDocsModal = function () {
console.log(kycDocsDebugPrefix + ' hideKYCDocsModal() called.');
var $modal = $('#kycdocsModal');
var modalEl = document.getElementById('kycdocsModal');
if (!modalEl) {
console.log(kycDocsDebugPrefix + ' Modal element not found. Aborting.');
return;
}
var closed = false;
try {
console.log(kycDocsDebugPrefix + ' Trying to hide modal using jQuery/Bootstrap.');
if (typeof jQuery !== 'undefined' && jQuery.fn && typeof jQuery.fn.modal === 'function') {
console.log(kycDocsDebugPrefix + ' Using jQuery modal("hide").');
$modal.modal('hide');
closed = true;
}
if (!closed && window.bootstrap && bootstrap.Modal && modalEl) {
console.log(kycDocsDebugPrefix + ' jQuery modal not available/failed. Checking for Bootstrap 5 API.');
if (typeof bootstrap.Modal.getOrCreateInstance === 'function') {
console.log(kycDocsDebugPrefix + ' Using bootstrap.Modal.getOrCreateInstance().hide().');
bootstrap.Modal.getOrCreateInstance(modalEl).hide();
closed = true;
}
if (!closed && typeof bootstrap.Modal.getInstance === 'function') {
console.log(kycDocsDebugPrefix + ' Using bootstrap.Modal.getInstance().');
var existing = bootstrap.Modal.getInstance(modalEl);
if (existing) {
console.log(kycDocsDebugPrefix + ' Existing BS5 instance found, calling hide().');
existing.hide();
closed = true;
}
}
if (!closed) {
console.log(kycDocsDebugPrefix + ' Using new bootstrap.Modal().hide().');
(new bootstrap.Modal(modalEl)).hide();
closed = true;
}
}
} catch (e) {
console.error('[KYCDocs] Failed to hide modal, using fallback:', e);
}
// In mixed Bootstrap environments, plugin hide() can return without visually closing.
// Validate with class and visibility checks, then force cleanup if needed.
setTimeout(function () {
var stillVisible = $modal.is(':visible');
var stillOpen = modalEl.classList.contains('show') || modalEl.classList.contains('in');
if (!closed || stillVisible || stillOpen) {
console.log(kycDocsDebugPrefix + ' Modal still open after hide attempt, forcing close.');
window.forceHideKYCDocsModal();
}
}, 120);
};
// $('#add_branch').hide(); // $('#add_branch').hide();
// $('.btnBack').hide(); // $('.btnBack').hide();
loadKYCDocsList(); loadKYCDocsList();
$('#btnBranchAdd').click(function(e){ $('#btnKycDocsAdd').click(function(){
if (e && typeof e.preventDefault === 'function') { console.log(kycDocsDebugPrefix + ' #btnKycDocsAdd clicked.');
e.preventDefault();
}
kyc_docs_form_action = '<?= base_url("master/kyc/kycdocs/createpost"); ?>'; kyc_docs_form_action = '<?= base_url("master/kyc/kycdocs/createpost"); ?>';
var myModal = new bootstrap.Modal(document.getElementById('kycdocsModal')); console.log(kycDocsDebugPrefix + ' Set form action to:', kyc_docs_form_action);
myModal.show();
// $('#add_branch').show();
// $('#branch_table').hide();
// $('.btnBack').show();
// $('#btnBranchAdd').hide();
$('#file_name').val(''); // Reset form before showing to ensure it's clean
$('#state').val(''); resetKYCDocsForm();
$('#district').val('');
$('#branch_city').val('');
$('#name0').val('');
$('#email0').val('');
$('#mobile0').val('');
$('#designation0').val('');
$('#name1').val(''); console.log(kycDocsDebugPrefix + ' Calling showKYCDocsModal().');
$('#email1').val(''); window.showKYCDocsModal();
$('#mobile1').val(''); console.log(kycDocsDebugPrefix + ' #btnKycDocsAdd click handler finished.');
$('#designation1').val(''); });
$('#name2').val(''); // When the modal is completely hidden, reset the form.
$('#email2').val(''); // This is the recommended Bootstrap way to handle cleanup.
$('#mobile2').val(''); $('#kycdocsModal').on('hidden.bs.modal', function () {
$('#designation2').val(''); console.log(kycDocsDebugPrefix + ' #kycdocsModal hidden.bs.modal event fired.');
}) resetKYCDocsForm();
});
$('.btnBack').click(function(e){ // Add explicit click handlers for close/cancel buttons as data-bs-dismiss might be unreliable.
if (e && typeof e.preventDefault === 'function') { // This makes it consistent with the working insurer_branch.php modal.
e.preventDefault(); $(document).on('click', '.js-kyc-docs-close, .js-kyc-docs-cancel', function (e) {
} e.preventDefault();
var myModal = new bootstrap.Modal(document.getElementById('kycdocsModal')); window.hideKYCDocsModal();
myModal.hide(); });
// $('#add_branch').hide();
// $('#branch_table').show();
// $('.btnBack').hide();
// $('#btnBranchAdd').show();
$('#file_name').val('');
$('#state').val('');
$('#district').val('');
$('#branch_city').val('');
$('#name0').val('');
$('#email0').val('');
$('#mobile0').val('');
$('#designation0').val('');
$('#name1').val('');
$('#email1').val('');
$('#mobile1').val('');
$('#designation1').val('');
$('#name2').val('');
$('#email2').val('');
$('#mobile2').val('');
$('#designation2').val('');
})
if(kyc_Docs_PrimaryKey !== ''){ if(kyc_Docs_PrimaryKey !== ''){
var branchTable = ''; var data = <?= isset($insurer_branch) ? json_encode($insurer_branch) : '[]' ?>;
var data = <?= isset($kyc_docs) ? json_encode($kyc_docs) : '[]' ?>; renderKYCDocsTableRows(data);
$.each(data, function(index, item) {
branchTable += `
<tr>
<td>${item.file_name}</td>
<td>
<a class="btnBranchEdit" data-id="${item.id}" href="#"><i data-id="${item.id}" class="mdi mdi-lead-pencil btnBranchEdit" style="font-size:18px;"></i></a>
<a style="color:#02a8b5" data-id="${item.id}" onclick="removeKYCDocs(this)"><i data-id="${item.id}" class="mdi mdi-delete" style="font-size:18px;"></i></a>
</td>
</tr>
`;
});
$('#kyc_docs_list').append(branchTable);
} }
@ -249,22 +417,14 @@ $(document).ready(function () {
$('.loader-mask').delay(350).fadeOut('slow'); $('.loader-mask').delay(350).fadeOut('slow');
}, 1000); }, 1000);
console.log(res); console.log(res);
$('#kyc_docs_list tr').remove(); var rows = normalizeKYCDocsRows(res);
var insurerBranchTableInsert = '' if (rows.length) {
$.each(res.data, function(index, item) { renderKYCDocsTableRows(rows);
insurerBranchTableInsert += ` } else {
<tr> // Edit API may return only status/message; refresh from list endpoint.
<td>${item.file_name}</td> loadKYCDocsList();
<td> }
<a class="btnBranchEdit" data-id="${item.id}" href="#"><i data-id="${item.id}" class="mdi mdi-lead-pencil btnBranchEdit" style="font-size:18px;"></i></a> window.hideKYCDocsModal();
<a style="color:#02a8b5" data-id="${item.id}" onclick="removeKYCDocs(this)"><i data-id="${item.id}" class="mdi mdi-delete" style="font-size:18px;"></i></a>
</td>
</tr>
`;
});
$('#kyc_docs_list').append(insurerBranchTableInsert);
var myModal = new bootstrap.Modal(document.getElementById('kycdocsModal'));
myModal.hide();
// $('#add_branch').hide(); // $('#add_branch').hide();
// $('#branch_table').show(); // $('#branch_table').show();
// $('.btnBack').hide(); // $('.btnBack').hide();
@ -320,8 +480,7 @@ $(document).ready(function () {
$('.loader-mask').delay(350).fadeOut('slow'); $('.loader-mask').delay(350).fadeOut('slow');
}, 1000); }, 1000);
console.log("right........."); console.log("right.........");
var myModal = new bootstrap.Modal(document.getElementById('kycdocsModal')); window.showKYCDocsModal();
myModal.show();
// $('#add_branch').show(); // $('#add_branch').show();
// $('#branch_table').hide(); // $('#branch_table').hide();
// $('.btnBack').show(); // $('.btnBack').show();
@ -367,19 +526,10 @@ $(document).ready(function () {
}); });
}); });
$('body').on('click', '#btnSubmit', function() {
$('#kyc_docs_list').html("");
console.log($('#kyc_docs_list')[0]);
setTimeout(function() {
console.log("hjknjkhiulhjulihj----------------------");
// loadKYCDocsList();
}, 1000) });
function loadKYCDocsList() { function loadKYCDocsList() {
var base_url = '<?= base_url("master/kyc/kycdocs/list/"); ?>'; var base_url = '<?= base_url("master/kyc/kycdocs/list/"); ?>';
var kyc_Docs_PrimaryKey_1 = $('#kyc_type_id').val(); var kyc_Docs_PrimaryKey_1 = $('#kyc_General_PrimaryKey').val();
// console.log("kyc_Docs_PrimaryKey_1"); // console.log("kyc_Docs_PrimaryKey_1");
// console.log(kyc_Docs_PrimaryKey_1); // console.log(kyc_Docs_PrimaryKey_1);
@ -402,20 +552,8 @@ $(document).ready(function () {
$('.loader').fadeOut(); $('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow'); $('.loader-mask').delay(350).fadeOut('slow');
}, 1000); }, 1000);
var insurerBranchTableInsert = ''; var rows = normalizeKYCDocsRows(res);
$.each(res.kyc_docs, function(index, item) { renderKYCDocsTableRows(rows);
insurerBranchTableInsert += `
<tr>
<td>${item.file_name}</td>
<td>
<a class="btnBranchEdit" data-id="${item.id}"><i data-id="${item.id}" class="mdi mdi-lead-pencil btnBranchEdit" style="font-size:18px;"></i></a>
<a style="color:#02a8b5" data-id="${item.id}" onclick="removeKYCDocs(this)"><i data-id="${item.id}" class="mdi mdi-delete" style="font-size:18px;"></i></a>
</td>
</tr>
`;
});
console.log($('#kyc_docs_list')[0]);
$('#kyc_docs_list').append(insurerBranchTableInsert);
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
console.error(xhr.responseText); console.error(xhr.responseText);

View File

@ -29,8 +29,9 @@
} }
</style> </style>
<script> <script>
var pageSubTitle = 'KYC Entity Type'; var pageHideMainNavTitle = true;
var pageBackButton = '<a href="#" onclick="history.back(); return false;" data-toggle="tooltip" data-placement="top" title="Back"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>'; var pageTitle = 'KYC Entity Type';
var pageBackButton = '<a href="<?= base_url('master/kyc/list') ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back"><i class="ri-arrow-left-s-line"></i></a>';
</script> </script>
<div class="row" id="insurer_add"> <div class="row" id="insurer_add">
<div class="col-12"> <div class="col-12">
@ -91,23 +92,32 @@
<script> <script>
function policy_type_branch_contact() { function policy_type_branch_contact() {
var check_policy_type_id = $('#kyc_General_PrimaryKey'); var check_policy_type_id = $('#kyc_General_PrimaryKey');
var branchBackBtn = $('#btnBranchBack');
var branchAddBtn = $('#btnBranchAdd');
console.log(check_policy_type_id.val()); console.log(check_policy_type_id.val());
if (check_policy_type_id[0].value == '' || check_policy_type_id[0].value == null || check_policy_type_id[0].value == 0) { if (!check_policy_type_id.length || check_policy_type_id[0].value == '' || check_policy_type_id[0].value == null || check_policy_type_id[0].value == 0) {
$('#btnBranchAdd').hide(); if (branchAddBtn.length) {
branchAddBtn.hide();
}
toastr.warning('First Add the KYC Entity Type!', 'Warning', { toastr.warning('First Add the KYC Entity Type!', 'Warning', {
timeOut: 2000 timeOut: 2000
}); });
} else { } else {
if ($('#btnBranchBack')[0].style.display == 'none') { if (!branchBackBtn.length || branchBackBtn[0].style.display == 'none') {
$('#btnBranchAdd').show(); if (branchAddBtn.length) {
branchAddBtn.show();
}
} }
} }
} }
document.getElementById("kyc_docs_id").addEventListener("click", function(event) { var kycDocsTab = document.getElementById("kyc_docs_id");
event.preventDefault(); if (kycDocsTab) {
policy_type_branch_contact(); kycDocsTab.addEventListener("click", function(event) {
}); event.preventDefault();
policy_type_branch_contact();
});
}
</script> </script>

View File

@ -264,52 +264,53 @@
}; };
</script> </script>
<script> <script>
// ── setNavSubtitle: OUTSIDE ready so any page script can call it ── window.__navPageName = "<?= esc($page_name ?? '') ?>";
window.setNavSubtitle = function(subtitle, backUrl) { window.__navUserName = "<?= esc(get_session_userdata()->first_name ?? 'NOT SET') ?>";
$('#nav-sub-text').html(subtitle);
$('#nav-back-btn').attr('href', backUrl);
$('#nav-sub-row').removeClass('hidden');
};
</script>
<script> window.applyTopNavbarTitle = function() {
$(document).ready(function() { var pageName = window.__navPageName || "";
var userName = window.__navUserName || "";
var pageName = "<?= esc($page_name ?? '') ?>"; var extraTitle = (typeof pageTitle !== 'undefined') ? pageTitle : false;
var userName = "<?= esc(get_session_userdata()->first_name ?? 'NOT SET') ?>"; var backButton = (typeof pageBackButton !== 'undefined') ? pageBackButton : false;
// These are set by individual view files BEFORE footer loads
var subTitle = (typeof pageSubTitle !== 'undefined') ? pageSubTitle : false;
var backButton = (typeof pageBackButton !== 'undefined') ? pageBackButton : false;
var titleHtml = ""; var titleHtml = "";
var $titleEl = $(".top-navbar-title"); var $titleEl = $(".top-navbar-title");
var $navDiv = $(".top-navbar-div"); var $navDiv = $(".top-navbar-div");
if (pageName && pageName == "Dashboard") { if (pageName && pageName == "Dashboard") {
titleHtml = `<h6 style="margin-right:5px !important;">Welcome ${userName}</h6> titleHtml = `<h6 style="margin-right:5px !important;">Welcome ${userName}</h6>
<h3>Dashboard</h3>`; <h3>Dashboard</h3>`;
$titleEl.css({ display: "block", bottom: "12px" }); $titleEl.css({ display: "block", bottom: "12px" });
$navDiv.css({ marginTop: "20px" }); // single title → default 20px $navDiv.css({ marginTop: "20px" });
} else if (pageName && extraTitle && typeof pageHideMainNavTitle !== 'undefined' && pageHideMainNavTitle && !backButton) {
titleHtml = `<h3 style="margin-right:5px !important;">${extraTitle}</h3>`;
$titleEl.css({ display: "block", bottom: "12px" });
$navDiv.css({ marginTop: "20px" });
} else if (pageName && backButton && extraTitle && typeof pageHideMainNavTitle !== 'undefined' && pageHideMainNavTitle) {
titleHtml = `<h3 class="d-flex align-items-center" style="margin-right:5px !important; gap:12px;">${backButton}<span>${extraTitle}</span></h3>`;
$titleEl.css({ display: "block", bottom: "12px" });
$navDiv.css({ marginTop: "20px" });
} else if (pageName && backButton && extraTitle) {
titleHtml = `<h3 style="margin-right:5px !important;">${pageName}</h3>`;
titleHtml += `<h6>${backButton}&nbsp;${extraTitle}</h6>`;
$titleEl.css({ display: "block", bottom: "12px" });
$navDiv.css({ marginTop: "0px" });
} else if (pageName && extraTitle) {
titleHtml = `<h3 style="margin-right:5px !important;">${pageName}</h3>`;
titleHtml += `<h6>${extraTitle}</h6>`;
$titleEl.css({ display: "block", bottom: "12px" });
$navDiv.css({ marginTop: "0px" });
} else {
titleHtml = `<h3 style="margin-right:5px !important;">${pageName}</h3>`;
$titleEl.css({ display: "flex", bottom: "0px" });
$navDiv.css({ marginTop: "20px" });
}
} else if (pageName && backButton && subTitle) { $titleEl.html(titleHtml);
titleHtml = `<h3 style="margin-right:5px !important;">${pageName}</h3>`; };
titleHtml += `<h6>${backButton}&nbsp;${subTitle}</h6>`;
$titleEl.css({ display: "block", bottom: "12px" });
$navDiv.css({ marginTop: "0px" }); // double title → 0
} else if (pageName && subTitle) { $(document).ready(function() {
titleHtml = `<h3 style="margin-right:5px !important;">${pageName}</h3>`;
titleHtml += `<h6>${subTitle}</h6>`;
$titleEl.css({ display: "block", bottom: "12px" });
$navDiv.css({ marginTop: "0px" }); // double title → 0
} else { applyTopNavbarTitle();
titleHtml = `<h3 style="margin-right:5px !important;">${pageName}</h3>`;
$titleEl.css({ display: "flex", bottom: "0px" });
$navDiv.css({ marginTop: "20px" }); // single title → default 20px
}
$titleEl.html(titleHtml);
// var pageName = "<?= esc($page_name ?? '') ?>"; // var pageName = "<?= esc($page_name ?? '') ?>";
@ -1441,6 +1442,35 @@ $(function(){
}); });
} }
function nhApplyMenuScrollLimit($menu, usableSpace) {
if (!$menu || !$menu.length) {
return;
}
var $items = $menu.children('.dropdown-item:visible, a:visible, button:visible');
var visibleItems = 3;
var fixedMenuMax = 0;
if ($items.length) {
$items.slice(0, visibleItems).each(function () {
fixedMenuMax += $(this).outerHeight(true) || 0;
});
}
if (!fixedMenuMax) {
fixedMenuMax = 132; // safe default for 3 items
}
fixedMenuMax += 14; // include menu paddings/borders
var viewportMax = Math.max(140, usableSpace - 12);
var finalMax = Math.max(132, Math.min(fixedMenuMax, viewportMax));
$menu.css({
maxHeight: finalMax + 'px',
overflowY: 'auto',
overflowX: 'hidden',
scrollBehavior: 'smooth',
overscrollBehavior: 'contain',
zIndex: '20050'
});
}
function nhNormalizeActionCells(tableApi) { function nhNormalizeActionCells(tableApi) {
if (!tableApi) { if (!tableApi) {
return; return;
@ -1457,26 +1487,13 @@ $(function(){
}); });
} }
function nhApplyBottomRowDropup(tableApi) { function nhClearForcedDropup(tableApi) {
if (!tableApi) { if (!tableApi) {
return; return;
} }
var $table = $(tableApi.table().node()); var $table = $(tableApi.table().node());
var rows = tableApi.rows({ page: 'current' }).nodes().toArray();
$table.find('tbody tr').removeClass('nh-force-dropup'); $table.find('tbody tr').removeClass('nh-force-dropup');
$table.find('tbody td.table-action-cell .btn-group.dropdown').removeClass('dropup'); $table.find('tbody td.table-action-cell .btn-group.dropdown, tbody td.table-action-cell .dropdown').removeClass('dropup');
var target = 0;
for (var i = rows.length - 1; i >= 0 && target < 2; i--) {
var $row = $(rows[i]);
var $group = $row.find('td.table-action-cell .btn-group.dropdown').first();
if (!$group.length) {
continue;
}
$row.addClass('nh-force-dropup');
$group.addClass('dropup');
target++;
}
} }
$(function () { $(function () {
@ -1491,7 +1508,7 @@ $(function(){
nhRowActionDropdownOpts(); nhRowActionDropdownOpts();
var dt = $(this).DataTable(); var dt = $(this).DataTable();
nhNormalizeActionCells(dt); nhNormalizeActionCells(dt);
nhApplyBottomRowDropup(dt); nhClearForcedDropup(dt);
}); });
$(document).on('show.bs.dropdown', '.dataTables_wrapper table.dataTable tbody .dropdown', function () { $(document).on('show.bs.dropdown', '.dataTables_wrapper table.dataTable tbody .dropdown', function () {
@ -1499,16 +1516,6 @@ $(function(){
var $toggle = $dd.children('[data-toggle="dropdown"]').first(); var $toggle = $dd.children('[data-toggle="dropdown"]').first();
var $menu = $dd.children('.dropdown-menu').first(); var $menu = $dd.children('.dropdown-menu').first();
var el = $toggle[0]; var el = $toggle[0];
var $row = $dd.closest('tr');
var isForcedDropup = $row.hasClass('nh-force-dropup');
if (!isForcedDropup) {
// Fallback: if row marker is missing, still force dropup on the last 2 visible rows.
var $tbodyRows = $row.closest('tbody').children('tr:visible');
if ($tbodyRows.length) {
var rowIdx = $tbodyRows.index($row);
isForcedDropup = rowIdx >= ($tbodyRows.length - 2);
}
}
var $scroll = $dd.closest('.dataTables_scrollBody'); var $scroll = $dd.closest('.dataTables_scrollBody');
if ($scroll.length) { if ($scroll.length) {
$scroll.data('nh-prev-overflow', $scroll.css('overflow')); $scroll.data('nh-prev-overflow', $scroll.css('overflow'));
@ -1546,9 +1553,7 @@ $(function(){
// Pick direction by space; prefer the side that can fit the full menu. // Pick direction by space; prefer the side that can fit the full menu.
var openUp = false; var openUp = false;
if (isForcedDropup) { if (menuHeight > 0) {
openUp = true;
} else if (menuHeight > 0) {
if (below >= menuHeight) { if (below >= menuHeight) {
openUp = false; openUp = false;
} else if (above >= menuHeight) { } else if (above >= menuHeight) {
@ -1560,34 +1565,20 @@ $(function(){
openUp = below < 150 && above > below; openUp = below < 150 && above > below;
} }
// Keep explicit per-row dropup (set by nhApplyBottomRowDropup / page scripts). $dd.removeClass('dropup');
if (!isForcedDropup) {
$dd.removeClass('dropup');
}
$dd.removeData('nh-auto-dropup'); $dd.removeData('nh-auto-dropup');
if (openUp) { if (openUp) {
$dd.addClass('dropup'); $dd.addClass('dropup');
if (!isForcedDropup) { $dd.data('nh-auto-dropup', 1);
$dd.data('nh-auto-dropup', 1);
}
} }
// If there still isn't enough room, keep all actions reachable via scroll. // Keep height capped to ~3 items and allow vertical scroll for extra actions.
if ($menu.length && menuHeight > 0) { if ($menu.length && menuHeight > 0) {
var usableSpace = openUp ? above : below; var usableSpace = openUp ? above : below;
var maxVisible = Math.max(140, usableSpace - 12); nhApplyMenuScrollLimit($menu, usableSpace);
if (menuHeight > maxVisible) { $menu.addClass('nh-action-menu-elevated');
$menu.css({ $menu.scrollTop(0);
maxHeight: maxVisible + 'px',
overflowY: 'auto'
});
} else {
$menu.css({
maxHeight: '',
overflowY: ''
});
}
} }
}); });
@ -1623,8 +1614,12 @@ $(function(){
} }
$dd.children('.dropdown-menu').css({ $dd.children('.dropdown-menu').css({
maxHeight: '', maxHeight: '',
overflowY: '' overflowY: '',
}); overflowX: '',
scrollBehavior: '',
overscrollBehavior: '',
zIndex: ''
}).removeClass('nh-action-menu-elevated');
}); });
$(document).on('shown.bs.dropdown', '.dataTables_wrapper .dropdown', function () { $(document).on('shown.bs.dropdown', '.dataTables_wrapper .dropdown', function () {
@ -1732,7 +1727,7 @@ $(function(){
try { try {
var dt = $(settings.nTable).DataTable(); var dt = $(settings.nTable).DataTable();
nhNormalizeActionCells(dt); nhNormalizeActionCells(dt);
nhApplyBottomRowDropup(dt); nhClearForcedDropup(dt);
} catch (err) { } catch (err) {
// keep page running if a table has non-standard setup // keep page running if a table has non-standard setup
} }

View File

@ -1216,6 +1216,44 @@ $(function(){
table.search('').draw(); table.search('').draw();
}); });
// Global listing dropdown behavior: no forced last-row dropup.
(function () {
if (typeof jQuery === 'undefined') {
return;
}
var $ = jQuery;
function clearForcedDropup($scope) {
$scope.find('tbody tr').removeClass('nh-force-dropup');
$scope.find('tbody .btn-group.dropdown, tbody .dropdown').removeClass('dropup');
}
$(document).on('init.dt draw.dt', 'table.dataTable', function () {
clearForcedDropup($(this));
});
$(document).on('show.bs.dropdown', 'table tbody .dropdown', function () {
var $dd = $(this);
var $toggle = $dd.children('[data-toggle="dropdown"]').first();
var $menu = $dd.children('.dropdown-menu').first();
var el = $toggle[0];
$dd.removeClass('dropup');
if (!el || !el.getClientRects().length) {
return;
}
var rect = el.getBoundingClientRect();
var below = Math.max(0, window.innerHeight - rect.bottom - 8);
var above = Math.max(0, rect.top - 8);
var menuHeight = $menu.outerHeight() || 150;
if (below < menuHeight && above > below) {
$dd.addClass('dropup');
}
});
})();
</script> </script>

View File

@ -799,9 +799,9 @@
width: 100% !important; width: 100% !important;
} }
table[data-custom-table-css="table"].dataTable thead th { /* table[data-custom-table-css="table"].dataTable thead th {
padding: 15px !important; padding: 15px !important;
} } */
table[data-custom-table-css="table"] thead.bg-light { table[data-custom-table-css="table"] thead.bg-light {
background-color: transparent !important; background-color: transparent !important;
@ -1932,38 +1932,6 @@ body[data-sidebar-size="condensed"] .footer {
overflow: hidden; overflow: hidden;
line-height: 1; line-height: 1;
} }
.nav-main-title {
font-size: 15px;
font-weight: 700;
color: #101828;
line-height: 1.2;
white-space: nowrap;
}
.nav-welcome {
font-size: 11px;
color: #98a2b3;
margin-top: 2px;
font-weight: 400;
}
.nav-sub-row {
display: flex;
align-items: center;
gap: 6px;
margin-top: 2px;
}
.nav-sub-row.hidden { display: none; }
.nav-sub-text {
font-size: 12px;
color: #5a6a7a;
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 500px;
}
.btn-back { background: none; border: none; font-size: 22px; cursor: pointer; color: #888; width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.btn-back:hover { background: #f0f0f0; color: #333; }
/** Newly Implemented */ /** Newly Implemented */
</style> </style>

View File

@ -12,6 +12,19 @@
color: #666; color: #666;
} }
.input-icon {
position: relative;
}
.input-icon .additional-icon {
position: absolute;
top: 50%;
right: 12px;
transform: translateY(-50%);
pointer-events: none;
color: #495057;
}
hr.solid { hr.solid {
border-top: 3px solid #bbb; border-top: 3px solid #bbb;
} }
@ -35,9 +48,6 @@
margin-right: 5px; margin-right: 5px;
} }
hr {
display: none !important;
}
</style> </style>
<style> <style>
@ -119,11 +129,12 @@
</style> </style>
<?php <?php
$isLeadEditEb = isset($lead_edit_data) && ! empty($lead_edit_data); $isLeadEditEb = isset($lead_edit_data) && ! empty($lead_edit_data);
$ebSubtitle = $isLeadEditEb ? 'Edit Opportunities - (EB)' : 'Add Opportunities - (EB)'; $ebPageTitle = $isLeadEditEb ? 'Edit Opportunities - (EB)' : 'Add Opportunities - (EB)';
?> ?>
<script> <script>
var pageSubTitle = '<?= $ebSubtitle ?>'; var pageHideMainNavTitle = true;
var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="tooltip" data-placement="top" title="Back"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>'; var pageTitle = '<?= $ebPageTitle ?>';
var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back"><i class="ri-arrow-left-s-line"></i></a>';
</script> </script>
<script src="<?= base_url('public/assets/js/pages/leads_form_validation.js') ?>"></script> <script src="<?= base_url('public/assets/js/pages/leads_form_validation.js') ?>"></script>
@ -160,6 +171,8 @@
<div class="card" id="collapseOne"> <div class="card" id="collapseOne">
<div class="card-body"> <div class="card-body">
<h4 class="card-title mb-3">Opportunity Details</h4>
<hr>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
@ -203,18 +216,17 @@
<!-- client row --> <!-- client row -->
<div class="card" id="collapseOne"> <div class="card" id="collapseOne">
<div class="card-body"> <div class="card-body">
<div class="form-row"> <div class="d-flex justify-content-between align-items-center mb-3">
<h4 class="card-title mb-0">Client Information</h4>
<div class="form-group offset-md-10 col-md-2 freshFields" style="float:right;"> <div class="form-group freshFields mb-0 d-flex align-items-center">
<label class="switch"> <label for="exixting_client" class="mb-0 mr-2">Existing Client</label>
<label class="switch mb-0">
<input id="exixting_client" type="checkbox" name="exixting_client"> <input id="exixting_client" type="checkbox" name="exixting_client">
<span class="slider round" style="height: 27px;"></span> <span class="slider round" style="height: 27px;"></span>
</label> </label>
<label for="exixting_client" style="position: relative;top: 2px;">Existing Client</label>
</div> </div>
</div> </div>
<hr>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4 renewalFields" style="display: none;"> <div class="form-group col-md-4 renewalFields" style="display: none;">
@ -307,6 +319,8 @@
<!-- branch row--> <!-- branch row-->
<div class="card" id="collapseOne"> <div class="card" id="collapseOne">
<div class="card-body"> <div class="card-body">
<h4 class="card-title mb-3">Branch Information</h4>
<hr>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
@ -363,6 +377,8 @@
<!-- policy row --> <!-- policy row -->
<div class="card" id="collapseOne"> <div class="card" id="collapseOne">
<div class="card-body"> <div class="card-body">
<h4 class="card-title mb-3">Policy Details</h4>
<hr>
<div id="dynamic-form-container"></div> <div id="dynamic-form-container"></div>
</div> </div>
</div> </div>
@ -371,17 +387,17 @@
<!-- other row --> <!-- other row -->
<div class="card" id="collapseOne"> <div class="card" id="collapseOne">
<div class="card-body"> <div class="card-body">
<div class="form-row"> <div class="d-flex justify-content-between align-items-center mb-3">
<h4 class="card-title mb-0">Sales & Assignment</h4>
<div class="form-group offset-md-9 col-md-3" style="float:right;"> <div class="form-group mb-0 d-flex align-items-center">
<label class="switch"> <label for="is_insurer_auto_mail" class="mb-0 mr-2">Insurer Auto Mail</label>
<label class="switch mb-0">
<input id="is_insurer_auto_mail" type="checkbox" name="is_insurer_auto_mail"> <input id="is_insurer_auto_mail" type="checkbox" name="is_insurer_auto_mail">
<span class="slider round" style="height: 27px;"></span> <span class="slider round" style="height: 27px;"></span>
</label> </label>
<label for="is_insurer_auto_mail" style="position: relative;top: 2px;">Insurer Auto Mail</label>
</div> </div>
</div> </div>
<hr>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
@ -458,6 +474,8 @@
<script> <script>
var actualLeadClientName = '';
var actualLeadShortName = '';
let claimIndex = 1; let claimIndex = 1;
setTimeout(() => { setTimeout(() => {
@ -523,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);
@ -535,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",
@ -567,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);
@ -631,7 +624,7 @@
} }
if (lead_type != 1) { if (lead_type != 1 && lead_type != 3) {
dataIncrement = 1; dataIncrement = 1;
// updateRenewalFields(dataIncrement); // updateRenewalFields(dataIncrement);
@ -739,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();
@ -798,8 +791,11 @@
hide_list_show_add(); hide_list_show_add();
pageSubTitle = 'Edit Opportunities - (EB)'; pageTitle = 'Edit Opportunities - (EB)';
pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="tooltip" data-placement="top" title="Back"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>'; pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back"><i class="ri-arrow-left-s-line"></i></a>';
if (typeof window.applyTopNavbarTitle === 'function') {
window.applyTopNavbarTitle();
}
$('#leads_primarykey').val(res.data.id); $('#leads_primarykey').val(res.data.id);
$('#actual_lead_id').val(res.data.actual_lead_id || 0); $('#actual_lead_id').val(res.data.actual_lead_id || 0);
@ -814,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() {
@ -1111,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();
@ -1127,7 +1134,7 @@
$('.lifeClaimFields').show(); $('.lifeClaimFields').show();
} else { } else {
if (lead_type == 1) { if (lead_type == 1 || lead_type == 3) {
updateRenewalFields(dataIncrement); updateRenewalFields(dataIncrement);
} }
@ -1331,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",
@ -1545,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;
} }
@ -1663,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');
@ -1836,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();
} }
@ -1917,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) {
@ -2265,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();
@ -2490,17 +2512,17 @@
// 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 || ''; // 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 () {
@ -2512,9 +2534,31 @@
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

@ -617,7 +617,7 @@ if (isset($selected_lead_type)) {
let isFirstField = container.childElementCount === 0; // Check if it's the first field let isFirstField = container.childElementCount === 0; // Check if it's the first field
let placeholder = isFirstField ? 'First file must be Demography.' : ''; let placeholder = isFirstField ? 'First file must be Demography.' : '';
let accept = isFirstField ? '.xls,.xlsx' : '.xls,.xlsx,.pdf,.jpg,.jpeg,.png'; let accept = isFirstField ? '.xls,.xlsx' : '.xls,.xlsx,.pdf,.jpg,.jpeg,.png';
let accept_text = isFirstField ? 'First file: Excel only (.xls, .xlsx)' : 'Files: PDF, Excel (.xlsx, .xls), Images (.png, .jpg, .jpeg)'; let accept_text = isFirstField ? 'Allowed: XLS, XLSX.' : 'Allowed: PDF, XLSX, XLS, PNG, JPG, JPEG.';
if(selected_lead_form_type != 1){ if(selected_lead_form_type != 1){
@ -658,8 +658,8 @@ if (isset($selected_lead_type)) {
<div class="input-icon"> <div class="input-icon">
<input type="file" class="form-control" id="file_name_${fileIndex}" name="file_name_${increment}[]" accept="${accept}" style="background: #F5FFFF !important;"> <input type="file" class="form-control" id="file_name_${fileIndex}" name="file_name_${increment}[]" accept="${accept}" style="background: #F5FFFF !important;">
<i class="mdi mdi-upload additional-icon"></i> <i class="mdi mdi-upload additional-icon"></i>
<small style="margin-left: 10px;font-size: 10px;"><span class="text-danger">${accept_text}</span></small>
</div> </div>
<small style="margin-left: 10px;font-size: 10px;"><span class="text-danger">${accept_text}</span></small>
</div> </div>
<div class="col-auto"> <div class="col-auto">
@ -839,7 +839,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 +1088,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
@ -834,9 +835,48 @@
} }
function showEmailHistoryModal() {
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;
}
// Fallback for legacy Bootstrap setups that attach $.fn.modal.
if (typeof jQuery !== 'undefined' && jQuery.fn && typeof jQuery.fn.modal === 'function') {
$('#EmailModal').modal('show');
}
}
$('#EmailModal').on('hidden.bs.modal', function () {
$('body').removeClass('modal-open');
$('.modal-backdrop').remove();
});
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);
@ -846,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 = `
@ -953,18 +992,17 @@
`; `;
} }
// Show modal always // Show modal always
new bootstrap.Modal(document.getElementById("EmailModal")).show(); showEmailHistoryModal();
}) })
.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>
`; `;
let EmailModal = new bootstrap.Modal(document.getElementById("EmailModal")); showEmailHistoryModal();
EmailModal.show();
console.error(error); console.error(error);
}); });
} }
@ -2146,6 +2184,74 @@
}); });
}); });
</script> </script>
<script>
$(document).ready(function() {
// Delegated click handlers for action menu items
// Non-EB RFQ Sheet Creation
$(document).on('click', '.btnRfqSheetList', function(e) {
e.preventDefault();
var leadId = $(this).data('id');
if (leadId) {
createRfqSheetFromList(leadId);
}
});
// Non-EB QCR Sheet Creation
$(document).on('click', '.btnQcrSheetList', function(e) {
e.preventDefault();
var leadId = $(this).data('id');
if (leadId) {
createQcrSheetFromList(leadId);
}
});
// Non-EB Internal Mail
$(document).on('click', '.btnInternalMailList', function(e) {
e.preventDefault();
var leadId = $(this).data('id');
if (leadId) {
openInternalMailFromList(leadId);
}
});
// Non-EB Insurer Mail
$(document).on('click', '.btnInsurerMailList', function(e) {
e.preventDefault();
var leadId = $(this).data('id');
if (leadId) {
openInsurerMailFromList(leadId);
}
});
// Non-EB Client Mail
$(document).on('click', '.btnClientMailList', function(e) {
e.preventDefault();
var leadId = $(this).data('id');
if (leadId) {
openClientMailFromList(leadId);
}
});
// Non-EB Placement
$(document).on('click', '.btnPlacementList', function(e) {
e.preventDefault();
var leadId = $(this).data('id');
if (leadId) {
openPlacementFromList(leadId);
}
});
// Email History
$(document).on('click', '.btnHistory', function(e) {
e.preventDefault();
var leadId = $(this).data('id');
if (leadId) {
getLeadsDataForMailHistory(leadId);
}
});
});
</script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
if (typeof openOpportunitiesListFilterNav !== 'function') { if (typeof openOpportunitiesListFilterNav !== 'function') {
@ -2153,4 +2259,3 @@
} }
}); });
</script> </script>
</script>

View File

@ -14,6 +14,19 @@
color: #666; color: #666;
} }
.input-icon {
position: relative;
}
.input-icon .additional-icon {
position: absolute;
top: 50%;
right: 12px;
transform: translateY(-50%);
pointer-events: none;
color: #495057;
}
hr.solid { hr.solid {
border-top: 3px solid #bbb; border-top: 3px solid #bbb;
} }
@ -49,11 +62,12 @@
</style> </style>
<?php <?php
$isLeadEditNonEb = isset($lead_edit_data) && ! empty($lead_edit_data); $isLeadEditNonEb = isset($lead_edit_data) && ! empty($lead_edit_data);
$nonEbSubtitle = $isLeadEditNonEb ? 'Edit Opportunities - (Non EB)' : 'Add Opportunities - (Non EB)'; $nonEbPageTitle = $isLeadEditNonEb ? 'Edit Opportunities - (Non EB)' : 'Add Opportunities - (Non EB)';
?> ?>
<script> <script>
var pageSubTitle = '<?= $nonEbSubtitle ?>'; var pageHideMainNavTitle = true;
var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="tooltip" data-placement="top" title="Back"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>'; var pageTitle = '<?= $nonEbPageTitle ?>';
var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back"><i class="ri-arrow-left-s-line"></i></a>';
</script> </script>
<div class="row" id="leads_non_eb_form"> <div class="row" id="leads_non_eb_form">
@ -85,13 +99,15 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="toolt
<div class="card" id="collapseOne"> <div class="card" id="collapseOne">
<div class="card-body"> <div class="card-body">
<h4 class="card-title mb-3">Opportunity Details</h4>
<hr>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="lead_type">Opportunity Type<span class="text-danger">*</span></label> <label for="lead_type">Opportunity Type<span class="text-danger">*</span></label>
<select class="form-control" id="lead_type" name="lead_type" required> <select class="form-control" id="lead_type" name="lead_type" required>
<option value="">Select Opportunity Type</option> <option value="">Select Opportunity Type</option>
<?php <?php
if (isset($lead_type) && count($lead_type)) { if (isset($lead_type) && count($lead_type)) {
foreach ($lead_type as $key => $value) { foreach ($lead_type as $key => $value) {
if ($key == 1) { if ($key == 1) {
@ -128,18 +144,17 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="toolt
<!-- client row --> <!-- client row -->
<div class="card" id="collapseOne"> <div class="card" id="collapseOne">
<div class="card-body"> <div class="card-body">
<div class="form-row"> <div class="d-flex justify-content-between align-items-center mb-3">
<h4 class="card-title mb-0">Client Information</h4>
<div class="form-group offset-md-10 col-md-2 freshFields" style="float:right;"> <div class="form-group freshFields mb-0 d-flex align-items-center">
<label class="switch"> <label for="exixting_client" class="mb-0 mr-2">Existing Client</label>
<label class="switch mb-0">
<input id="exixting_client" type="checkbox" name="exixting_client"> <input id="exixting_client" type="checkbox" name="exixting_client">
<span class="slider round" style="height: 27px;"></span> <span class="slider round" style="height: 27px;"></span>
</label> </label>
<label for="exixting_client" style="position: relative;top: 2px;">Existing Client</label>
</div> </div>
</div> </div>
<hr>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4 renewalFields" style="display: none;"> <div class="form-group col-md-4 renewalFields" style="display: none;">
@ -221,6 +236,8 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="toolt
<!-- branch row--> <!-- branch row-->
<div class="card" id="collapseOne"> <div class="card" id="collapseOne">
<div class="card-body"> <div class="card-body">
<h4 class="card-title mb-3">Branch Information</h4>
<hr>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
@ -280,6 +297,8 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="toolt
<!-- policy row --> <!-- policy row -->
<div class="card" id="collapseOne"> <div class="card" id="collapseOne">
<div class="card-body"> <div class="card-body">
<h4 class="card-title mb-3">Policy Details</h4>
<hr>
<div class="form-row" id="dynamic-form-container"> <div class="form-row" id="dynamic-form-container">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
@ -375,6 +394,8 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="toolt
<!-- other row --> <!-- other row -->
<div class="card" id="collapseOne"> <div class="card" id="collapseOne">
<div class="card-body"> <div class="card-body">
<h4 class="card-title mb-3">Sales & Assignment</h4>
<hr>
<div class="form-row"> <div class="form-row">
<?php <?php
$savedViewers = []; $savedViewers = [];
@ -468,6 +489,8 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="toolt
<script> <script>
var actualLeadClientName = '';
var actualLeadShortName = '';
$(document).ready(function() { $(document).ready(function() {
$('#rfq_qcr_viewers').parsley({ $('#rfq_qcr_viewers').parsley({
@ -590,7 +613,7 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="toolt
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');
@ -744,7 +767,7 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="toolt
$('#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) {
@ -759,7 +782,7 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="toolt
$('#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){
@ -827,12 +850,29 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="toolt
$('#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);
// 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 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();
@ -1315,17 +1355,17 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="toolt
// 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 || ''; // 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 () {
@ -1337,9 +1377,30 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" data-toggle="toolt
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

@ -15,8 +15,9 @@
<script> <script>
var base_url = '<?= base_url() ?>'; var base_url = '<?= base_url() ?>';
var pageSubTitle = 'Non-EB Claims'; var pageHideMainNavTitle = true;
var pageBackButton = '<a href="<?= base_url("non-eb-claim/list"); ?>" aria-label="Back to list"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>'; var pageTitle = 'Non-EB Claims';
var pageBackButton = '<a href="<?= base_url("non-eb-claim/list") ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back to list"><i class="ri-arrow-left-s-line"></i></a>';
</script> </script>
<?php <?php

View File

@ -31,8 +31,9 @@
<script> <script>
var base_url = '<?= base_url() ?>'; var base_url = '<?= base_url() ?>';
var pageSubTitle = 'New Non-EB Claim'; var pageHideMainNavTitle = true;
var pageBackButton = '<a href="'+base_url+'non-eb-claim/list"><i class="mdi mdi-arrow-left" style="font-size:17px;"></i></a>'; var pageTitle = 'New Non-EB Claim';
var pageBackButton = '<a href="<?= base_url('non-eb-claim/list') ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back"><i class="ri-arrow-left-s-line"></i></a>';
</script> </script>
<?php $sections = $visible_sections ?? []; ?> <?php $sections = $visible_sections ?? []; ?>

View File

@ -8,7 +8,8 @@
</style> </style>
<script> <script>
var pageSubTitle = 'Non-EB Mail Templates'; var pageHideMainNavTitle = true;
var pageTitle = 'Non-EB Mail Templates';
</script> </script>
<div class="col-12"> <div class="col-12">

View File

@ -7,7 +7,8 @@
</style> </style>
<script> <script>
var pageSubTitle = 'Non-EB Claim Reports'; var pageHideMainNavTitle = true;
var pageTitle = 'Non-EB Claim Reports';
</script> </script>
<div class="col-12"> <div class="col-12">

View File

@ -123,7 +123,8 @@
</div> --> </div> -->
<script> <script>
var pageSubTitle = 'Non-EB Claims'; var pageHideMainNavTitle = true;
var pageTitle = 'Non-EB Claims';
// function goToNewClaim() { // function goToNewClaim() {
// var pt = $('#new_claim_policy_type').val(); // var pt = $('#new_claim_policy_type').val();

View File

@ -1010,6 +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>
</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

@ -314,8 +314,7 @@
} }
</style> </style>
<script> <script>
var pageSubTitle = undefined; var pageHideMainNavTitle = true;
var pageBackButton = undefined;
</script> </script>
<script src="<?= base_url('public/assets/js/pages/policy_transaction_inception_form_validation.js') ?>"></script> <script src="<?= base_url('public/assets/js/pages/policy_transaction_inception_form_validation.js') ?>"></script>
<div class="tab-pane fade active show" id="form"> <div class="tab-pane fade active show" id="form">
@ -2288,8 +2287,11 @@
' - ' + [res.data.client_short_name, res.data.policy_type, res.data.policy_no] ' - ' + [res.data.client_short_name, res.data.policy_type, res.data.policy_no]
.filter(Boolean).join('-') : ''); .filter(Boolean).join('-') : '');
var backUrl = '<?= base_url("policy_tranction/inception/list"); ?>'; var backUrl = '<?= base_url("policy_tranction/inception/list"); ?>';
var backButton = `<a href="${backUrl}" aria-label="Back to list"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>`; pageTitle = page_title;
updateNavTitle(page_title, backButton); pageBackButton = '<a href="' + backUrl + '" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back"><i class="ri-arrow-left-s-line"></i></a>';
if (typeof window.applyTopNavbarTitle === 'function') {
window.applyTopNavbarTitle();
}
$('#client_id_kyc').val(res.data.client_id); $('#client_id_kyc').val(res.data.client_id);
$('#policy_tranction_primarykey_for_file_upload').val(res.data.id); $('#policy_tranction_primarykey_for_file_upload').val(res.data.id);
$('#client_id_for_vehicle_file_upload').val(res.data.client_id); $('#client_id_for_vehicle_file_upload').val(res.data.client_id);

View File

@ -663,8 +663,11 @@ function getAddPage(){
runInceptionAddFlowFromList(); runInceptionAddFlowFromList();
setTimeout(() => { setTimeout(() => {
var backUrl = '<?= base_url("policy_tranction/inception/list"); ?>'; var backUrl = '<?= base_url("policy_tranction/inception/list"); ?>';
var backButton = `<a href="${backUrl}" aria-label="Back to list"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>`; pageTitle = 'Add Policy';
updateNavTitle('Add Policy', backButton); pageBackButton = '<a href="' + backUrl + '" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back"><i class="ri-arrow-left-s-line"></i></a>';
if (typeof window.applyTopNavbarTitle === 'function') {
window.applyTopNavbarTitle();
}
}, 500); }, 500);
} }
} }
@ -822,39 +825,16 @@ $(document).ready(function(){
}) })
//-------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------
var pageName = "<?= esc($page_name ?? '') ?>";
var userName = "<?= esc(get_session_userdata()->first_name ?? 'NOT SET') ?>";
function updateNavTitle(subTitle, backButton) {
var titleHtml = "";
var $titleEl = $(".top-navbar-title");
var $navDiv = $(".top-navbar-div");
if (pageName && backButton && subTitle) {
titleHtml = `<h3 style="margin-right:5px !important;">${pageName}</h3>`;
titleHtml += `<h6>${backButton}&nbsp;${subTitle}</h6>`;
$titleEl.css({ display: "block", bottom: "12px" });
$navDiv.css({ marginTop: "0px" });
} else if (pageName && subTitle) {
titleHtml = `<h3 style="margin-right:5px !important;">${pageName}</h3>`;
titleHtml += `<h6>${subTitle}</h6>`;
$titleEl.css({ display: "block", bottom: "12px" });
$navDiv.css({ marginTop: "0px" });
} else {
titleHtml = `<h3 style="margin-right:5px !important;">${pageName}</h3>`;
$titleEl.css({ display: "flex", bottom: "0px" });
$navDiv.css({ marginTop: "20px" });
}
$titleEl.html(titleHtml);
}
function hide_list_show_add() function hide_list_show_add()
{ {
// $('#page_title').text('Add Policy') // $('#page_title').text('Add Policy')
var backUrl = '<?= base_url("policy_tranction/inception/list"); ?>'; var backUrl = '<?= base_url("policy_tranction/inception/list"); ?>';
var backButton = `<a href="${backUrl}" aria-label="Back to list"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>`; pageTitle = 'Add Policy';
updateNavTitle('Add Policy', backButton); pageBackButton = '<a href="' + backUrl + '" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back"><i class="ri-arrow-left-s-line"></i></a>';
if (typeof window.applyTopNavbarTitle === 'function') {
window.applyTopNavbarTitle();
}
$('#inception_form_id')[0].reset(); $('#inception_form_id')[0].reset();
if (typeof window.resetInceptionFormParsley === 'function') { if (typeof window.resetInceptionFormParsley === 'function') {
window.resetInceptionFormParsley('#inception_form_id'); window.resetInceptionFormParsley('#inception_form_id');
@ -888,9 +868,11 @@ function hide_list_show_add()
function show_list_hide_add() function show_list_hide_add()
{ {
pageSubTitle = undefined; pageTitle = undefined;
pageBackButton = undefined; pageBackButton = undefined;
updateNavTitle(false, false); if (typeof window.applyTopNavbarTitle === 'function') {
window.applyTopNavbarTitle();
}
$('#pt_onboarding').hide() $('#pt_onboarding').hide()
$('#inception_list').show() $('#inception_list').show()
$('#inception_filter').show(); $('#inception_filter').show();
@ -1193,6 +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>
</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,6 +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>
</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

@ -29,8 +29,9 @@
} }
</style> </style>
<script> <script>
var pageSubTitle = 'Policy Type'; var pageHideMainNavTitle = true;
var pageBackButton = '<a href="#" onclick="history.back(); return false;" data-toggle="tooltip" data-placement="top" title="Back"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>'; var pageTitle = 'Policy Type';
var pageBackButton = '<a href="<?= base_url('master/policy/list') ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back"><i class="ri-arrow-left-s-line"></i></a>';
</script> </script>
<div id="policy_add"> <div id="policy_add">
<div class="col-12"> <div class="col-12">
@ -91,23 +92,32 @@
<script> <script>
function policy_type_branch_contact() { function policy_type_branch_contact() {
var check_policy_type_id = $('#policytype_General_PrimaryKey'); var check_policy_type_id = $('#policytype_General_PrimaryKey');
var branchBackBtn = $('#btnBranchBack');
var branchAddBtn = $('#btnBranchAdd');
if (check_policy_type_id[0].value == '' || check_policy_type_id[0].value == null || check_policy_type_id[0].value == 0) { if (!check_policy_type_id.length || check_policy_type_id[0].value == '' || check_policy_type_id[0].value == null || check_policy_type_id[0].value == 0) {
$('#btnBranchAdd').hide(); if (branchAddBtn.length) {
branchAddBtn.hide();
}
toastr.warning('First Add the Policy Type!', 'Warning', { toastr.warning('First Add the Policy Type!', 'Warning', {
timeOut: 2000 timeOut: 2000
}); });
} else { } else {
if ($('#btnBranchBack')[0].style.display == 'none') { if (!branchBackBtn.length || branchBackBtn[0].style.display == 'none') {
$('#btnBranchAdd').show(); if (branchAddBtn.length) {
branchAddBtn.show();
}
} }
} }
} }
document.getElementById("policy_id_type").addEventListener("click", function(event) { var policyTypeTab = document.getElementById("policy_id_type");
event.preventDefault(); if (policyTypeTab) {
policy_type_branch_contact(); policyTypeTab.addEventListener("click", function(event) {
}); event.preventDefault();
policy_type_branch_contact();
});
}
</script> </script>

View File

@ -173,6 +173,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>
</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>
@ -180,6 +181,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>
</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>
@ -187,6 +189,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>
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">

View File

@ -8,7 +8,7 @@ $increment = 1;
$isFirstField = ($index === 0); $isFirstField = ($index === 0);
$placeholder = $isFirstField ? 'First file must be Demography.' : ''; $placeholder = $isFirstField ? 'First file must be Demography.' : '';
$accept = $isFirstField ? '.xls,.xlsx' : '.xls,.xlsx,.pdf,.jpg,.jpeg,.png'; $accept = $isFirstField ? '.xls,.xlsx' : '.xls,.xlsx,.pdf,.jpg,.jpeg,.png';
$accept_text = $isFirstField ? 'First file: Excel only (.xls, .xlsx)' : 'Files: PDF, Excel (.xlsx, .xls), Images (.png, .jpg, .jpeg)'; $accept_text = $isFirstField ? 'Allowed: XLS, XLSX.' : 'Allowed: PDF, XLSX, XLS, PNG, JPG, JPEG.';
$displayIndex = $index + 1; $displayIndex = $index + 1;
?> ?>
@ -70,7 +70,7 @@ $increment = 1;
<input type="file" class="form-control" id="file_name_1" <input type="file" class="form-control" id="file_name_1"
name="file_name_1[]" accept=".xls,.xlsx" onchange="showFileName(this, 1)" style="background: #F5FFFF !important;"> name="file_name_1[]" accept=".xls,.xlsx" onchange="showFileName(this, 1)" style="background: #F5FFFF !important;">
<i class="mdi mdi-upload additional-icon"></i> <i class="mdi mdi-upload additional-icon"></i>
<small style="margin-left: 10px;font-size: 10px;"><span class="text-danger">First file: Excel only (.xls, .xlsx)</span></small> <small style="margin-left: 10px;font-size: 10px;"><span class="text-danger">Allowed: XLS, XLSX.</span></small>
</div> </div>
</div> </div>
<div class="col-auto"> <div class="col-auto">

View File

@ -327,7 +327,7 @@ th:first-child, td:first-child {
<!-- end modal --> <!-- end modal -->
<!-- Edit modal content --> <!-- Edit modal content -->
<div id="emp_modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;"> <div id="emp_modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -438,6 +438,11 @@ th:first-child, td:first-child {
}) })
$('#emp_modal').on('hidden.bs.modal', function () {
$('body').removeClass('modal-open');
$('.modal-backdrop').remove();
});
$(document).ready(function() { $(document).ready(function() {
var ticketsTable = $('#tickets-table'); var ticketsTable = $('#tickets-table');
@ -552,8 +557,6 @@ th:first-child, td:first-child {
$('#relationship').val(data.relationship); $('#relationship').val(data.relationship);
$('#emp_modal').modal('show'); $('#emp_modal').modal('show');
var myModal = new bootstrap.Modal(document.getElementById('emp_modal'));
myModal.show();
}else{ }else{
$('#employee_primary_id').val(''); $('#employee_primary_id').val('');
@ -613,7 +616,7 @@ th:first-child, td:first-child {
if(response.status == true){ if(response.status == true){
toastr.success(response.message, 'Success'); toastr.success(response.message, 'Success');
$('.close').click(); $('#emp_modal').modal('hide');
$('#employee_primary_id').val(''); $('#employee_primary_id').val('');
$('#emp_code_for_edit').val(''); $('#emp_code_for_edit').val('');

View File

@ -134,8 +134,9 @@ hr{
} }
</style> </style>
<script> <script>
var pageSubTitle = 'Ticket ID - <?= $master[0]["thz_id"]; ?>'; var pageHideMainNavTitle = true;
var pageBackButton = '<a href="#" onclick="history.back(); return false;" data-toggle="tooltip" data-placement="top" title="Back"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>'; var pageTitle = 'Ticket ID - <?= $master[0]["thz_id"]; ?>';
var pageBackButton = '<a href="<?= base_url('ticket/list') ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back"><i class="ri-arrow-left-s-line"></i></a>';
</script> </script>
<div class="row" id="notespage"> <div class="row" id="notespage">

View File

@ -40,8 +40,9 @@
<div class="card-body"> <div class="card-body">
<script> <script>
var pageSubTitle = 'Claims<?php if(isset($ticket_data["tpa_claim_push_reference_no"]) && !empty($ticket_data["tpa_claim_push_reference_no"])) { echo " <a href=\"#\" class=\"btn btn-success mr-2\" onclick=\"fetchTpaClaimStatus()\">Fetch Claim Status</a>"; } ?>'; var pageHideMainNavTitle = true;
var pageBackButton = '<a href="<?= base_url("ticket/list"); ?>" aria-label="Back to list"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>'; var pageTitle = 'Claims<?php if(isset($ticket_data["tpa_claim_push_reference_no"]) && !empty($ticket_data["tpa_claim_push_reference_no"])) { echo " <a href=\"#\" class=\"btn btn-success mr-2\" onclick=\"fetchTpaClaimStatus()\">Fetch Claim Status</a>"; } ?>';
var pageBackButton = '<a href="<?= base_url("ticket/list"); ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back to list"><i class="ri-arrow-left-s-line"></i></a>';
</script> </script>
<!-- Header Section --> <!-- Header Section -->
<!-- <div class="row mb-3 align-items-center justify-content-between"> <!-- <div class="row mb-3 align-items-center justify-content-between">

View File

@ -1,7 +1,7 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card-body"> <div class="card-body">
<div class="table-responsive"> <div class="table-responsive ticket-history-table-wrap">
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100"> <table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
@ -33,6 +33,12 @@
</div> </div>
</div> <!-- end col--> </div> <!-- end col-->
<style>
.ticket-history-table-wrap {
overflow: hidden;
}
</style>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
@ -59,10 +65,17 @@ if (ticketsTable.length) {
// } // }
// ], // ],
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'>>" + // Filter left, buttons right dom: "<'row'<'col-sm-6'f><'col-sm-6 text-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>>", autoWidth: false,
lengthMenu: [[10, 20, 50, 100], [10, 20, 50, 100]], scrollY: "320px",
scrollCollapse: true,
columns: [
{ width: "13%" },
{ width: "47.5%" },
{ width: "17.5%" },
{ width: "22%" }
],
language: { language: {
search: ` search: `
<div class="datatable-search-wrapper" style="position:relative; display:inline-block;"> <div class="datatable-search-wrapper" style="position:relative; display:inline-block;">
@ -75,11 +88,13 @@ if (ticketsTable.length) {
searchPlaceholder: "Search", searchPlaceholder: "Search",
emptyTable: '<div class="text-center text-muted">No Data found</div>' emptyTable: '<div class="text-center text-muted">No Data found</div>'
}, },
paging: true, // Enable pagination paging: false,
pageLength: 10, // Set default number of rows per page (optional) info: false,
ordering: false, ordering: false,
}); });
$('.dataTables_length label').css('height', '21px'); ticketsTable.DataTable().columns.adjust();
ticketsTable.closest('.dataTables_wrapper').find('.dataTables_scrollHeadInner').css('width', '');
ticketsTable.closest('.dataTables_wrapper').find('.dataTables_scrollHead').css('overflow', 'hidden');
} else { } else {
console.error("Table atet found."); console.error("Table atet found.");
} }

View File

@ -15,6 +15,12 @@
width: 50px; width: 50px;
height: 50px; height: 50px;
object-fit: contain; object-fit: contain;
transition: transform 0.2s ease-in-out;
}
.image-preview:hover img {
transform: scale(1.2);
cursor: zoom-in;
} }
.upload-btn { .upload-btn {
@ -275,10 +281,38 @@
</div><!-- /.modal-dialog --> </div><!-- /.modal-dialog -->
</div><!-- /.modal --> </div><!-- /.modal -->
<!-- Image Preview Modal -->
<div class="modal fade" id="imagePreviewModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg">
<div class="modal-content" style="background: transparent; border: 0;">
<div class="modal-body text-center p-0">
<img src="" id="modalImage" class="img-fluid rounded" alt="Full-size preview" style="max-height: 90vh; cursor: zoom-out;">
</div>
</div>
</div>
</div>
<!-- /.modal -->
<script> <script>
$(document).ready(function() { $(document).ready(function() {
// Handle image preview click to open modal
$('.image-preview').on('click', function() {
const imgSrc = $(this).find('img').attr('src');
// Don't open modal for the placeholder image
if (imgSrc && !imgSrc.includes('avatar_2x.png')) {
$('#modalImage').attr('src', imgSrc);
$('#imagePreviewModal').modal('show');
}
});
// Close modal on click (either on image or backdrop)
$('#imagePreviewModal').on('click', function() {
$(this).modal('hide');
});
// Custom Parsley validator for file size // Custom Parsley validator for file size
window.Parsley.addValidator('maxFileSize', { window.Parsley.addValidator('maxFileSize', {
validateString: function(value, maxSize, parsleyInstance) { validateString: function(value, maxSize, parsleyInstance) {

View File

@ -29,6 +29,21 @@
max-height: 80vh; max-height: 80vh;
} }
#tpaBranchModal {
padding-right: 0 !important;
z-index: 1060;
}
#tpaBranchModal.show {
display: flex !important;
align-items: center;
justify-content: center;
}
.modal-backdrop {
z-index: 1050;
}
#tpa-branch-datatable{ #tpa-branch-datatable{
width: 100% !important; width: 100% !important;
} }
@ -47,6 +62,11 @@
right: 11px !important; right: 11px !important;
} }
/* Unset position on datatables filter to fix alignment issues */
#tpa-branch-datatable_wrapper div.dataTables_filter {
position: unset !important;
}
/* Fix DataTables scroll header and body alignment */ /* Fix DataTables scroll header and body alignment */
#tpa-branch-datatable_wrapper .dataTables_scrollHeadInner{ #tpa-branch-datatable_wrapper .dataTables_scrollHeadInner{
box-sizing: content-box !important; box-sizing: content-box !important;
@ -203,7 +223,7 @@
<div class="modal-header flex-column"> <div class="modal-header flex-column">
<div class="d-flex w-100 justify-content-between align-items-center"> <div class="d-flex w-100 justify-content-between align-items-center">
<h4 class="modal-title mb-0" id="modalLabel">New Branch</h4> <h4 class="modal-title mb-0" id="modalLabel">New Branch</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <button type="button" class="close js-tpa-branch-close" data-dismiss="modal" data-bs-dismiss="modal" aria-hidden="true" onclick="hideTPABranchModal()">×</button>
</div> </div>
</div> </div>
@ -219,69 +239,61 @@
<!-- Branch Name & Code --> <!-- Branch Name & Code -->
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="branch_name">Branch Name <span class="text-danger">*</span></label> <label for="branch_name">Branch Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_name" <input type="text" class="form-control" id="branch_name" placeholder="Enter Branch Name" name="branch_name" required maxlength="255" data-parsley-maxlength="255">
placeholder="Enter Branch Name" name="branch_name" required>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="branch_code">Branch Code <span class="text-danger">*</span></label> <label for="branch_code">Branch Code <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_code" <input type="text" class="form-control" id="branch_code" placeholder="Enter Branch Code" name="branch_code" required maxlength="100" data-parsley-maxlength="100">
placeholder="Enter Branch Code" name="branch_code" required>
</div> </div>
</div> </div>
<!-- Address Lines --> <!-- Address Lines -->
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="address1">Address Line 1 <span class="text-danger">*</span></label> <label for="address1">Address Line 1 <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="address1" name="address1" placeholder="Enter Address 1" required> <input type="text" class="form-control" id="address1" name="address1" placeholder="Enter Address 1" required maxlength="255" data-parsley-maxlength="255">
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="address2">Address Line 2</label> <label for="address2">Address Line 2</label>
<input type="text" class="form-control" id="address2" placeholder="Enter Address 2" name="address2"> <input type="text" class="form-control" id="address2" placeholder="Enter Address 2" name="address2" maxlength="255" data-parsley-maxlength="255">
</div> </div>
</div> </div>
<!-- State & District --> <!-- State & District -->
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="state">State <span class="text-danger">*</span></label> <label for="state">State <span class="text-danger">*</span></label>
<select class="form-control" id="state" name="state" required> <select class="form-control" id="state" name="state" required>
<option value="">Select State</option> <option value="">Select State</option>
<?php if ($state) { <?php if ($state) {
foreach($state as $value) { ?> foreach($state as $value) { ?>
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option> <option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
<?php } }?> <?php } }?>
</select> </select>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="district">District <span class="text-danger">*</span></label> <label for="district">District <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="district" <input type="text" class="form-control" id="district" placeholder="Enter District" name="district" required maxlength="100" data-parsley-maxlength="100">
placeholder="Enter District" name="district" required>
</div> </div>
</div> </div>
<!-- City & Pincode --> <!-- City & Pincode -->
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="branch_city">City <span class="text-danger">*</span></label> <label for="branch_city">City <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_city" <input type="text" class="form-control" id="branch_city" placeholder="Enter City" name="city" required maxlength="100" data-parsley-maxlength="100">
placeholder="Enter City" name="city" required>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="pincode">Pincode <span class="text-danger">*</span></label> <label for="pincode">Pincode <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required> <input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required data-parsley-type="digits" data-parsley-length="[6,6]" maxlength="6">
</div> </div>
</div> </div>
<!-- Submit / Cancel --> <!-- Submit / Cancel -->
<div class="form-row"> <div class="form-group d-flex justify-content-end m-b-0 mt-4" id="hide_smbt_btn">
<!-- <div class="form-group col-md-12 mt-2"> --> <button type="button" class="btn app-btn-outline-secondary mr-2 js-tpa-branch-cancel" data-dismiss="modal" data-bs-dismiss="modal" aria-hidden="true" onclick="hideTPABranchModal()">Cancel</button>
<div style="margin-top: 85px;"> <button type="submit" class="btn app-btn-secondary waves-effect waves-light" id="btnSubmit">Submit</button>
<button type="submit" class="btn app-btn-secondary mr-2" id="btnSubmit">Submit</button>
<button type="button" class="btn app-btn-outline-secondary btnBack" id="btnBack" data-dismiss="modal" aria-hidden="true">Cancel</button>
</div>
<!-- </div> -->
</div> </div>
</div> </div>
@ -301,13 +313,13 @@
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="name">Name <span class="text-danger">*</span></label> <label for="name">Name <span class="text-danger">*</span></label>
<input value="" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required> <input value="" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required maxlength="100" data-parsley-maxlength="100">
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="designation">Designation <span class="text-danger">*</span></label> <label for="designation">Designation <span class="text-danger">*</span></label>
<input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required> <input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required maxlength="100" data-parsley-maxlength="100">
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
@ -344,6 +356,7 @@
<script> <script>
var contactCount = 1; var contactCount = 1;
var tpaBranchDebugPrefix = '[TPABranch]';
function resetTPABranchFormState() { function resetTPABranchFormState() {
var $form = $('#tpa_branch_form'); var $form = $('#tpa_branch_form');
@ -398,26 +411,175 @@ $(document).ready(function () {
var tpa_Branch_PrimaryKey = $('#tpa_id_branch').val(); var tpa_Branch_PrimaryKey = $('#tpa_id_branch').val();
var tpa_branch_form_action = ''; var tpa_branch_form_action = '';
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
myModal.hide(); window.forceHideTPABranchModal = function () {
console.log(tpaBranchDebugPrefix + ' forceHideTPABranchModal() called.');
var modalEl = document.getElementById('tpaBranchModal');
if (modalEl) {
console.log(tpaBranchDebugPrefix + ' Modal element found. Hiding it.');
modalEl.classList.remove('show');
modalEl.style.display = 'none';
modalEl.setAttribute('aria-hidden', 'true');
modalEl.removeAttribute('aria-modal');
}
console.log(tpaBranchDebugPrefix + ' Removing modal-open class from body.');
document.body.classList.remove('modal-open');
console.log(tpaBranchDebugPrefix + ' Removing body padding-right style.');
document.body.style.removeProperty('padding-right');
console.log(tpaBranchDebugPrefix + ' Removing modal-backdrop.');
$('.modal-backdrop').remove();
console.log(tpaBranchDebugPrefix + ' forceHideTPABranchModal() finished.');
};
window.forceShowTPABranchModal = function () {
console.log(tpaBranchDebugPrefix + ' forceShowTPABranchModal() called.');
var modalEl = document.getElementById('tpaBranchModal');
if (!modalEl) {
console.log(tpaBranchDebugPrefix + ' Modal element not found. Aborting.');
return;
}
console.log(tpaBranchDebugPrefix + ' Displaying modal element.');
modalEl.style.display = 'block';
modalEl.classList.add('show');
modalEl.removeAttribute('aria-hidden');
modalEl.setAttribute('aria-modal', 'true');
document.body.classList.add('modal-open');
if (!document.querySelector('.modal-backdrop')) {
console.log(tpaBranchDebugPrefix + ' Creating and appending modal-backdrop.');
var backdrop = document.createElement('div');
backdrop.className = 'modal-backdrop fade show';
document.body.appendChild(backdrop);
} else {
console.log(tpaBranchDebugPrefix + ' Modal-backdrop already exists.');
}
console.log(tpaBranchDebugPrefix + ' forceShowTPABranchModal() finished.');
};
window.showTPABranchModal = function () {
console.log(tpaBranchDebugPrefix + ' showTPABranchModal() called.');
var $modal = $('#tpaBranchModal');
var modalEl = document.getElementById('tpaBranchModal');
try {
console.log(tpaBranchDebugPrefix + ' Trying to show modal using jQuery/Bootstrap.');
if (typeof jQuery !== 'undefined' && jQuery.fn && typeof jQuery.fn.modal === 'function') {
console.log(tpaBranchDebugPrefix + ' Using jQuery modal("show").');
$modal.modal('show');
console.log(tpaBranchDebugPrefix + ' Setting timeout to check if modal is visible.');
setTimeout(function () {
console.log(tpaBranchDebugPrefix + ' Timeout check: Modal has "show" class:', $modal.hasClass('show'), 'Is visible:', $modal.is(':visible'));
if (!$modal.hasClass('show') || !$modal.is(':visible')) {
console.log(tpaBranchDebugPrefix + ' Modal not visible after timeout, forcing show.');
window.forceShowTPABranchModal();
}
}, 120);
console.log(tpaBranchDebugPrefix + ' showTPABranchModal() finished via jQuery path.');
return;
}
console.log(tpaBranchDebugPrefix + ' jQuery modal not available. Checking for Bootstrap 5 API.');
if (window.bootstrap && bootstrap.Modal && modalEl) {
if (typeof bootstrap.Modal.getOrCreateInstance === 'function') {
console.log(tpaBranchDebugPrefix + ' Using bootstrap.Modal.getOrCreateInstance().show().');
bootstrap.Modal.getOrCreateInstance(modalEl).show();
console.log(tpaBranchDebugPrefix + ' showTPABranchModal() finished via BS5 getOrCreateInstance.');
return;
}
if (typeof bootstrap.Modal.getInstance === 'function') {
console.log(tpaBranchDebugPrefix + ' Using bootstrap.Modal.getInstance().');
var existing = bootstrap.Modal.getInstance(modalEl);
if (existing) {
console.log(tpaBranchDebugPrefix + ' Existing BS5 instance found, calling show().');
existing.show();
console.log(tpaBranchDebugPrefix + ' showTPABranchModal() finished via existing BS5 instance.');
return;
}
}
console.log(tpaBranchDebugPrefix + ' Using new bootstrap.Modal().show().');
(new bootstrap.Modal(modalEl)).show();
console.log(tpaBranchDebugPrefix + ' showTPABranchModal() finished via new BS5 instance.');
return;
}
} catch (e) {
console.error(tpaBranchDebugPrefix + ' failed to show modal:', e);
console.log(tpaBranchDebugPrefix + ' Falling back to forceShowTPABranchModal().');
window.forceShowTPABranchModal();
return;
}
console.log(tpaBranchDebugPrefix + ' No standard modal methods found, falling back to forceShowTPABranchModal().');
window.forceShowTPABranchModal();
};
window.hideTPABranchModal = function () {
console.log(tpaBranchDebugPrefix + ' hideTPABranchModal() called.');
var $modal = $('#tpaBranchModal');
var modalEl = document.getElementById('tpaBranchModal');
if (!modalEl) {
console.log(tpaBranchDebugPrefix + ' Modal element not found. Aborting.');
return;
}
var closed = false;
try {
console.log(tpaBranchDebugPrefix + ' Trying to hide modal using jQuery/Bootstrap.');
if (typeof jQuery !== 'undefined' && jQuery.fn && typeof jQuery.fn.modal === 'function') {
console.log(tpaBranchDebugPrefix + ' Using jQuery modal("hide").');
$modal.modal('hide');
closed = true;
}
if (!closed && window.bootstrap && bootstrap.Modal && modalEl) {
console.log(tpaBranchDebugPrefix + ' jQuery modal not available/failed. Checking for Bootstrap 5 API.');
if (typeof bootstrap.Modal.getOrCreateInstance === 'function') {
console.log(tpaBranchDebugPrefix + ' Using bootstrap.Modal.getOrCreateInstance().hide().');
bootstrap.Modal.getOrCreateInstance(modalEl).hide();
closed = true;
}
if (!closed && typeof bootstrap.Modal.getInstance === 'function') {
console.log(tpaBranchDebugPrefix + ' Using bootstrap.Modal.getInstance().');
var existing = bootstrap.Modal.getInstance(modalEl);
if (existing) {
console.log(tpaBranchDebugPrefix + ' Existing BS5 instance found, calling hide().');
existing.hide();
closed = true;
}
}
if (!closed) {
console.log(tpaBranchDebugPrefix + ' Using new bootstrap.Modal().hide().');
(new bootstrap.Modal(modalEl)).hide();
closed = true;
}
}
} catch (e) {
console.error('[TPABranch] Failed to hide modal, using fallback:', e);
}
if (!closed || modalEl.classList.contains('show')) {
console.log(tpaBranchDebugPrefix + ' Modal not closed or still has "show" class, using fallback.');
window.forceHideTPABranchModal();
}
console.log(tpaBranchDebugPrefix + ' hideTPABranchModal() finished.');
};
// $('#add_branch').hide(); // $('#add_branch').hide();
// $('.btnBack').hide(); // $('.btnBack').hide();
loadBranchList(); loadBranchList();
$('#btnBranchAdd').click(function(e){ $('#btnBranchAdd').click(function(e){
console.log(tpaBranchDebugPrefix + ' #btnBranchAdd clicked.');
if (e && typeof e.preventDefault === 'function') { if (e && typeof e.preventDefault === 'function') {
console.log(tpaBranchDebugPrefix + ' Preventing default click action.');
e.preventDefault(); e.preventDefault();
} }
console.log(tpaBranchDebugPrefix + ' Setting form action for create.');
tpa_branch_form_action = '<?= base_url("master/tpa/branch/create"); ?>'; tpa_branch_form_action = '<?= base_url("master/tpa/branch/create"); ?>';
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal')); console.log(tpaBranchDebugPrefix + ' Calling showTPABranchModal().');
myModal.show(); window.showTPABranchModal();
// $('#add_branch').show(); // $('#add_branch').show();
// $('#branch_table').hide(); // $('#branch_table').hide();
// $('.btnBack').show(); // $('.btnBack').show();
// $('#btnBranchAdd').hide(); // $('#btnBranchAdd').hide();
console.log(tpaBranchDebugPrefix + ' Resetting form fields.');
$('#branch_name').val(''); $('#branch_name').val('');
$('#branch_code').val(''); $('#branch_code').val('');
$('#state').val(''); $('#state').val('');
@ -429,43 +591,44 @@ $(document).ready(function () {
$('#mobile').val(''); $('#mobile').val('');
$('#designation').val(''); $('#designation').val('');
console.log(tpaBranchDebugPrefix + ' Resetting "Add Contact" button visibility.');
var addButton = document.getElementById('add'); var addButton = document.getElementById('add');
if (addButton.style.display === 'none') { if (addButton.style.display === 'none') {
addButton.style.display = 'block'; addButton.style.display = 'block';
} }
console.log(tpaBranchDebugPrefix + ' Resetting contactCount to 1.');
contactCount = 1 contactCount = 1
console.log(tpaBranchDebugPrefix + ' Clearing dynamically added contacts from localStorage and DOM.');
var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || []; var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
console.log(tpaBranchDebugPrefix + ' Found buttonIds in localStorage:', buttonIds);
for (var i = 0; i < buttonIds.length; i++) { for (var i = 0; i < buttonIds.length; i++) {
var firstElement = buttonIds[i].split('_')[0]; var firstElement = buttonIds[i].split('_')[0];
console.log(firstElement); console.log(tpaBranchDebugPrefix + ' Processing buttonId:', buttonIds[i], '-> element to remove ID:', firstElement);
// Find the element by its ID // Find the element by its ID
var elementToRemove = document.getElementById(firstElement); var elementToRemove = document.getElementById(firstElement);
console.log(elementToRemove); console.log(tpaBranchDebugPrefix + ' Found element to remove:', elementToRemove);
if (elementToRemove) { if (elementToRemove) {
console.log(elementToRemove); console.log(tpaBranchDebugPrefix + ' Removing element:', elementToRemove);
elementToRemove.parentNode.removeChild(elementToRemove); elementToRemove.parentNode.removeChild(elementToRemove);
} }
localStorage.removeItem('buttonIds')
} }
}); localStorage.removeItem('buttonIds');
console.log(tpaBranchDebugPrefix + ' #btnBranchAdd click handler finished.');
$('.btnBack').click(function(e){
if (e && typeof e.preventDefault === 'function') {
e.preventDefault();
}
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
myModal.hide();
}); });
$('#tpaBranchModal').on('hidden.bs.modal', function () { $('#tpaBranchModal').on('hidden.bs.modal', function () {
resetTPABranchFormState(); resetTPABranchFormState();
}); });
$(document).on('click', '.js-tpa-branch-close, .js-tpa-branch-cancel', function (e) {
e.preventDefault();
window.hideTPABranchModal();
});
if(tpa_Branch_PrimaryKey !== ''){ if(tpa_Branch_PrimaryKey !== ''){
@ -532,7 +695,7 @@ $(document).ready(function () {
} }
$('#tpa_branch_list').append(tpaBranchTableInsert); $('#tpa_branch_list').append(tpaBranchTableInsert);
$('#container').empty(); $('#contact_1_wrapper input').val(''); $('#container').empty(); $('#contact_1_wrapper input').val('');
$('#tpaBranchModal .close').trigger('click'); window.hideTPABranchModal();
// $('#add_branch').hide(); // $('#add_branch').hide();
// $('#branch_table').show(); // $('#branch_table').show();
// $('.btnBack').hide(); // $('.btnBack').hide();
@ -575,7 +738,7 @@ $(document).ready(function () {
$('.loader').fadeOut(); $('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow'); $('.loader-mask').delay(350).fadeOut('slow');
}, 1000); }, 1000);
$('#tpaBranchModal .close').trigger('click'); window.hideTPABranchModal();
} }
}); });
} }
@ -599,8 +762,7 @@ $(document).ready(function () {
}, 1000); }, 1000);
console.log("tpa............."); console.log("tpa.............");
console.log(res) console.log(res)
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal')); window.showTPABranchModal();
myModal.show();
// $('#add_branch').show(); // $('#add_branch').show();
// $('#branch_table').hide(); // $('#branch_table').hide();
$('.btnBack').show(); $('.btnBack').show();
@ -788,13 +950,13 @@ function renumberContacts() {
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label>Name<span class="text-danger">*</span></label> <label>Name<span class="text-danger">*</span></label>
<input value="${contact ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" required> <input value="${contact ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" required maxlength="100" data-parsley-maxlength="100">
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label>Designation<span class="text-danger">*</span></label> <label>Designation<span class="text-danger">*</span></label>
<input value="${contact ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" required> <input value="${contact ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" required maxlength="100" data-parsley-maxlength="100">
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">

View File

@ -29,8 +29,9 @@
} }
</style> </style>
<script> <script>
var pageSubTitle = 'TPA'; var pageHideMainNavTitle = true;
var pageBackButton = '<a href="#" onclick="history.back(); return false;" data-toggle="tooltip" data-placement="top" title="Back"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>'; var pageTitle = 'TPA';
var pageBackButton = '<a href="<?= base_url('master/tpa/list') ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back"><i class="ri-arrow-left-s-line"></i></a>';
</script> </script>
<div class="row" id="tpa_add"> <div class="row" id="tpa_add">

View File

@ -184,8 +184,8 @@
</div> </div>
</div> </div>
<div class="form-group text-right m-b-0" id="hide_smbt_btn"> <div class="form-group d-flex justify-content-end m-b-0" id="hide_smbt_btn">
<button class="btn app-btn-outline-secondary mr-2 close" type="button" data-dismiss="modal" aria-hidden="true">Cancel</button> <button class="btn app-btn-outline-secondary mr-2" type="button" data-dismiss="modal" aria-hidden="true">Cancel</button>
<button type="submit" id="btnSubmit" class="btn app-btn-secondary waves-effect waves-light" id="cd_master_btn_Submit">Submit</button> <button type="submit" id="btnSubmit" class="btn app-btn-secondary waves-effect waves-light" id="cd_master_btn_Submit">Submit</button>
</div> </div>
</form> </form>

View File

@ -1,61 +1,104 @@
<style> <style>
.table th,
.table td {
padding: 8px;
}
table.dataTable tbody td {
padding: 4px 4px !important;
}
.deposit-header {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
}
.deposit-summary-row {
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}
.metrics{ .metrics{
border:1px solid lightgrey;border-radius:10px;box-shadow: 0px 4px 4px 0px #00000040; border:1px solid lightgrey;
min-width: none; border-radius:10px;
max-width: 350px; box-shadow: 0px 4px 4px 0px #00000040;
width: 100%;
max-width: 100%;
padding: 12px;
min-height: 64px;
} }
.dataTables_length label {height: 21px !important;} .dataTables_length label {height: 21px !important;}
#scroll-horizontal-datatable tbody tr:hover { background-color: #e0e0e0; }
@media (max-width: 767.98px) {
.deposit-title {
font-size: 22px;
}
.deposit-account-title,
.deposit-summary-title {
font-size: 18px;
margin-bottom: 0;
}
}
</style> </style>
<?php
$depositNavTitle = 'Transaction Details - ' . (isset($insurerName->name) ? $insurerName->name : '');
$depositBackUrl = base_url('client/deposit/' . (isset($clientData->id) ? $clientData->id : ''));
?>
<script>
var pageHideMainNavTitle = true;
var pageTitle = <?= json_encode($depositNavTitle, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE) ?>;
var pageBackButton = '<a href="<?= esc($depositBackUrl, 'attr') ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back" aria-label="Back"><i class="ri-arrow-left-s-line"></i></a>';
</script>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div style="display: flex; align-items: center;"> <div class="deposit-summary-row">
<a href="<?= base_url("client/deposit/$clientData->id"); ?>" style="color:black; font-size: 40px; margin-right: 10px;"> <div><h4 class="deposit-account-title">CD Account No : <?php echo isset($insurerName->cd_master_account_no) && !empty($insurerName->cd_master_account_no) ? $insurerName->cd_master_account_no : 'N/A' ?></h4></div>
<i class="mdi mdi-chevron-left"></i> <div><h4 class="deposit-summary-title">Deposit Summary Of <?php echo $clientData->short_name?></h4></div>
</a>
<h3 style="margin: 0;">Transaction Details - <?php echo $insurerName->name; ?></h3>
</div>
<br>
<div class="d-flex justify-content-between">
<div><h4>CD Account No : <?php echo isset($insurerName->cd_master_account_no) && !empty($insurerName->cd_master_account_no) ? $insurerName->cd_master_account_no : 'N/A' ?></h4></div>
<div> <h4>Deposit Summary Of <?php echo $clientData->short_name?></h4></div>
</div> </div>
<div> <div>
<div class="row text-center"> <div class="row text-center">
<div class="col-3 d-flex justify-content-between align-items-center metrics mr-2 mt-2"> <div class="col-12 col-sm-6 col-lg-3 mt-2">
<div class="d-flex justify-content-between align-items-center metrics">
<span class="text-muted font-15 mb-1 text-truncate">Deposits</span> <span class="text-muted font-15 mb-1 text-truncate">Deposits</span>
<h4 style="font-size: 18px;display:inline;"><i <h4 style="font-size: 18px;display:inline;"><i
class="fe-arrow-up text-success mr-1" ></i><?php echo $deposiamount->total_credit?> class="fe-arrow-up text-success mr-1" ></i><?php echo $deposiamount->total_credit?>
</h4> </h4>
</div> </div>
</div>
<div class="col-3 d-flex justify-content-between align-items-center metrics mr-2 mt-2"> <div class="col-12 col-sm-6 col-lg-3 mt-2">
<div class="d-flex justify-content-between align-items-center metrics">
<span class="text-muted font-15 mb-1 text-truncate">Consumed</span> <span class="text-muted font-15 mb-1 text-truncate">Consumed</span>
<h4 style="font-size: 20px;display:inline;"><i <h4 style="font-size: 20px;display:inline;"><i
class="fe-arrow-down text-danger mr-1"></i><?php echo $deposiamount->total_withdraw?> class="fe-arrow-down text-danger mr-1"></i><?php echo $deposiamount->total_withdraw?>
</h4> </h4>
</div> </div>
</div>
<div class="col-3 d-flex justify-content-between align-items-center metrics mr-2 mt-2"> <div class="col-12 col-sm-6 col-lg-3 mt-2">
<div class="d-flex justify-content-between align-items-center metrics">
<span class="text-muted font-15 mb-1 text-truncate">Refund</span> <span class="text-muted font-15 mb-1 text-truncate">Refund</span>
<h4 style="font-size: 20px;display:inline;"><i <h4 style="font-size: 20px;display:inline;"><i
class="fe-arrow-up text-success mr-1"></i><?php echo $deposiamount->total_refund?> class="fe-arrow-up text-success mr-1"></i><?php echo $deposiamount->total_refund?>
</h4> </h4>
</div> </div>
</div>
<div class="col-3 d-flex justify-content-between align-items-center metrics mr-2 mt-2"> <div class="col-12 col-sm-6 col-lg-3 mt-2">
<div class="d-flex justify-content-between align-items-center metrics">
<span class="text-muted font-15 mb-1 text-truncate">Current Balance</span> <span class="text-muted font-15 mb-1 text-truncate">Current Balance</span>
<h4 style="font-size: 20px;display:inline;"><i <h4 style="font-size: 20px;display:inline;"><i
class="fe-credit-card text-sucess mr-1"></i><?php echo $deposiamount->balance?> class="fe-credit-card text-success mr-1"></i><?php echo $deposiamount->balance?>
</h4> </h4>
</div> </div>
</div>
</div> </div>
</div> </div>
@ -79,8 +122,8 @@
</div> </div>
</div> --> </div> -->
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" <div class="table-responsive">
id="tickets-table"> <table data-custom-table-css="table" class="table mb-0 nowrap w-100 table-centered" cellspacing="0" id="scroll-horizontal-datatable">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">Date</th> <th class="font-weight-medium">Date</th>
@ -128,6 +171,7 @@
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -255,7 +299,8 @@
allowInput: false, allowInput: false,
}); });
$('#tickets-table').DataTable({ $('#scroll-horizontal-datatable').DataTable({
scrollX: true,
// dom: "<'row'<'col-sm-2'f><'col-sm-10 text-right'B>>" + // dom: "<'row'<'col-sm-2'f><'col-sm-10 text-right'B>>" +
// "<'row'<'col-sm-12'tr>>" + // "<'row'<'col-sm-12'tr>>" +
// "<'row'<'col-sm-5'i><'col-sm-7'p>>", // "<'row'<'col-sm-5'i><'col-sm-7'p>>",
@ -300,7 +345,7 @@
// } // }
// } // }
// ], // ],
dom: "<'row'<'col-12 d-flex justify-content-between'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" + dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" +
"<'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>>", "<'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]], lengthMenu: [[10, 20, 50, 100], [10, 20, 50, 100]],
@ -326,26 +371,12 @@
className: 'app-btn-primary ', className: 'app-btn-primary ',
}, },
{ {
extend: 'pdf', extend: 'excel',
text: 'PDF', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
text: '<i class="mdi mdi-file-pdf" ></i><span class=" btn-custom"> EXCEL </span>', title: 'CD TransactionDetails',
title: 'TransactionDetails', sheetName: 'CD TransactionDetails',
exportOptions: { exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], orthogonal: 'sort'
format: {
body: function (data, row, column, node) {
return data.replace(/<.*?>/g, '');
}
}
},
customize: function (doc) {
doc.pageOrientation = 'landscape';
doc.styles.tableHeader.alignment = 'left';
doc.defaultStyle.alignment = 'left';
doc.content[1].table.widths = [
'9%', '9%', '8%', '9%', '10%',
'9%', '9%', '9%', '9%', '11%', '8%'
];
} }
} }
] ]

View File

@ -646,14 +646,14 @@ table[data-custom-table-css="second-table"].app-table-card tbody.app-table-body
} }
/* Reduce header/body padding globally for listing tables */ /* Reduce header/body padding globally for listing tables */
table[data-custom-table-css="table"].dataTable thead th, /* table[data-custom-table-css="table"].dataTable thead th,
table[data-custom-table-css="second-table"].dataTable thead th { table[data-custom-table-css="second-table"].dataTable thead th {
padding-top: 10px !important; padding-top: 10px !important;
padding-bottom: 10px !important; padding-bottom: 10px !important; */
/* Match body cell horizontal inset so header labels line up with td text */ /* Match body cell horizontal inset so header labels line up with td text */
padding-left: 0.75rem !important; /* padding-left: 0.75rem !important;
padding-right: 0.75rem !important; padding-right: 0.75rem !important;
} } */
table[data-custom-table-css="table"] tbody td, table[data-custom-table-css="table"] tbody td,
table[data-custom-table-css="second-table"] tbody td { table[data-custom-table-css="second-table"] tbody td {

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB