MERGE_TEST_LIVE_ISSUE_UI

This commit is contained in:
Ubuntu 2026-06-11 17:12:37 +05:30
commit 005ff63f19
6 changed files with 62 additions and 92 deletions

View File

@ -2474,11 +2474,11 @@ class ClientController extends AdminController
] ]
], ],
'name.*' => [ 'name.*' => [
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\-_]+$/]', 'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s.\-_]+$/]',
'errors' => [ 'errors' => [
'required' => 'Contact name is required', 'required' => 'Contact name is required',
'min_length' => 'Contact name must be at least 3 characters long', 'min_length' => 'Contact name must be at least 3 characters long',
'regex_match' => 'Contact name can only contain letters, numbers, spaces, hyphens and underscores.' 'regex_match' => 'Contact name can only contain letters, numbers, spaces, periods, hyphens and underscores.'
] ]
], ],
'designation.*' => [ 'designation.*' => [
@ -2658,11 +2658,11 @@ class ClientController extends AdminController
] ]
], ],
'name.*' => [ 'name.*' => [
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\-_]+$/]', 'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s.\-_]+$/]',
'errors' => [ 'errors' => [
'required' => 'Contact name is required', 'required' => 'Contact name is required',
'min_length' => 'Contact name must be at least 3 characters long', 'min_length' => 'Contact name must be at least 3 characters long',
'regex_match' => 'Contact name can only contain letters, numbers, spaces, hyphens and underscores.' 'regex_match' => 'Contact name can only contain letters, numbers, spaces, periods, hyphens and underscores.'
] ]
], ],
'designation.*' => [ 'designation.*' => [

View File

@ -202,7 +202,7 @@ input:checked + .slider-branch-contact:before {
<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 foreach($state as $value) { ?> <?php foreach($state ?? [] as $value) { ?>
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option> <option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
<?php } ?> <?php } ?>
</select> </select>
@ -265,8 +265,8 @@ input:checked + .slider-branch-contact:before {
<label for="first_name">Name<span class="text-danger">*</span></label> <label for="first_name">Name<span class="text-danger">*</span></label>
<input value="" type="text" class="form-control" placeholder="Enter Contact Name" <input value="" type="text" class="form-control" placeholder="Enter Contact Name"
name="name[]" id="name" required name="name[]" id="name" required
data-parsley-pattern="^[A-Za-z\s]+$" data-parsley-pattern="^[A-Za-z\s.]+$"
data-parsley-pattern-message="Contact name may contain only letters and spaces."> data-parsley-pattern-message="Contact name may contain only letters, spaces, and periods.">
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="designation">Designation<span class="text-danger">*</span></label> <label for="designation">Designation<span class="text-danger">*</span></label>
@ -773,8 +773,8 @@ function appendContactHtml(contact = false, reset = false) {
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label> <label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label>
<input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required <input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required
data-parsley-pattern="^[A-Za-z\s]+$" data-parsley-pattern="^[A-Za-z\\s.]+$"
data-parsley-pattern-message="Contact name may contain only letters and spaces."> data-parsley-pattern-message="Contact name may contain only letters, spaces, and periods.">
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label> <label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label>

View File

@ -37,9 +37,12 @@
font-weight: 500; font-weight: 500;
color: #333; color: #333;
justify-content: flex-end; justify-content: flex-end;
margin-right: 40px;
} }
.expired-policies-toggle-wrap {
padding-bottom: 10px;
}
.switch-label input { .switch-label input {
opacity: 0; opacity: 0;
width: 0; width: 0;
@ -144,17 +147,14 @@ input:checked + .slider_blue::before {
<button type="button" id="BtnAddSuccess" class="btn btn-success waves-effect waves-light BtnAddSuccess btn-sm" onclick="showModal()"><span class="mdi mdi-plus-box-outline" aria-hidden="true" style="padding: 5px 10px;"></span>Add Policy From Opportunities</button> <button type="button" id="BtnAddSuccess" class="btn btn-success waves-effect waves-light BtnAddSuccess btn-sm" onclick="showModal()"><span class="mdi mdi-plus-box-outline" aria-hidden="true" style="padding: 5px 10px;"></span>Add Policy From Opportunities</button>
</div> </div>
<br>
<div class="expired-policies-toggle-wrap" style="padding-bottom: 10px; position: absolute; right: 0; z-index: 10;">
<label class="switch-label" for="chk-show-expired">
<input type="checkbox" id="chk-show-expired">
<span class="slider"></span>
<span class="switch-text">Expired Policies</span>
</label>
</div>
<div class="table-responsive" id="table_list"> <div class="table-responsive" id="table_list">
<div class="expired-policies-toggle-wrap d-flex justify-content-end">
<label class="switch-label" for="chk-show-expired">
<input type="checkbox" id="chk-show-expired">
<span class="slider"></span>
<span class="switch-text">Expired Policies</span>
</label>
</div>
<table data-custom-table-css="table" class="table table-borderless table mb-0 w-100 nowrap" id="table-client-policy"> <table data-custom-table-css="table" class="table table-borderless table mb-0 w-100 nowrap" id="table-client-policy">
<thead class=""> <thead class="">
<tr style="color:black !important;"> <tr style="color:black !important;">
@ -177,8 +177,8 @@ input:checked + .slider_blue::before {
<div class="col-12"> <div class="col-12">
<div class="card-body"> <div class="card-body">
<div class="row float-right" style="position: relative; bottom: 20px; right: 13px;"> <div class="d-flex justify-content-end mb-2" style="padding-right: 13px;">
<button type="button" id="btnPolicyBack" class="btn btn-primary waves-effect waves-light btn-sm btnBack btn-sm"><span class="mdi mdi-format-list-bulleted" aria-hidden="true" style="padding: 5px 10px;"></span>Back To List</button> <button type="button" id="btnPolicyBack" class="btn btn-primary waves-effect waves-light btn-sm btnBack"><span class="mdi mdi-format-list-bulleted" aria-hidden="true" style="padding: 5px 10px;"></span>Back To List</button>
</div> </div>
<hr> <hr>

View File

@ -767,10 +767,7 @@ async function fetchActivities(isLoadMore = false) {
.sort((a, b) => Number(b.activity_id) - Number(a.activity_id)) .sort((a, b) => Number(b.activity_id) - Number(a.activity_id))
.map(a => { .map(a => {
let formattedCreatedDate = a.created_at let formattedCreatedDate = a.created_at
? new Date(a.created_at).toLocaleString('en-US', { ? formatIndianDate(a.created_at)
month: 'short', day: 'numeric', year: 'numeric',
hour: '2-digit', minute: '2-digit', hour12: true
})
: 'N/A'; : 'N/A';
let displayNote = 'N/A'; let displayNote = 'N/A';
@ -910,14 +907,7 @@ function renderCard(opps) {
let opp_status_value = o.status?.replace(/[-_']/g, ' ').toUpperCase(); let opp_status_value = o.status?.replace(/[-_']/g, ' ').toUpperCase();
let formattedDate = new Date(o.created_at).toLocaleString('en-US', { let formattedDate = formatIndianDate(o.created_at);
month: 'short',
day: 'numeric',
year: 'numeric',
hour: '2-digit',
minute: '2-digit',
hour12: true
});
// ${o.client_short_name} // ${o.client_short_name}
return ` return `
<div class="opportunities-list" id="leadOpportunitiesList"> <div class="opportunities-list" id="leadOpportunitiesList">
@ -971,14 +961,7 @@ function renderTimeline(acts) {
const icon = activityIcons[a.activity_type] || ""; const icon = activityIcons[a.activity_type] || "";
const formattedType = a.activity_type?.toUpperCase() || ""; const formattedType = a.activity_type?.toUpperCase() || "";
const formattedDate = new Date(a.scheduled_date).toLocaleString('en-US', { const formattedDate = formatIndianDate(a.scheduled_date);
month: 'short',
day: 'numeric',
year: 'numeric',
hour: '2-digit',
minute: '2-digit',
hour12: true
});
// Then use the variable in your HTML: // Then use the variable in your HTML:
// <span style="font-size:11px; color:#999">${formattedDate}</span> // <span style="font-size:11px; color:#999">${formattedDate}</span>
@ -1406,14 +1389,16 @@ function formatIndianDate(value) {
const date = new Date(String(value).replace(' ', 'T')); const date = new Date(String(value).replace(' ', 'T'));
if (Number.isNaN(date.getTime())) return value; if (Number.isNaN(date.getTime())) return value;
return date.toLocaleString('en-IN', { const day = String(date.getDate()).padStart(2, '0');
day: '2-digit', const month = String(date.getMonth() + 1).padStart(2, '0');
month: '2-digit', const year = date.getFullYear();
year: 'numeric', let hours = date.getHours();
hour: '2-digit', const minutes = String(date.getMinutes()).padStart(2, '0');
minute: '2-digit', const seconds = String(date.getSeconds()).padStart(2, '0');
hour12: true const ampm = hours >= 12 ? 'PM' : 'AM';
}).replace(',', '').toUpperCase(); hours = hours % 12 || 12;
return `${day}/${month}/${year} ${String(hours).padStart(2, '0')}:${minutes}:${seconds} ${ampm}`;
} }
function downloadCsv(filename, rows) { function downloadCsv(filename, rows) {
@ -1473,7 +1458,7 @@ function initActivityExportDateRangePicker() {
opens: 'left', opens: 'left',
drops: 'down', drops: 'down',
locale: { locale: {
format: 'DD-MM-YYYY', format: 'DD/MM/YYYY',
applyLabel: 'Generate Excel', applyLabel: 'Generate Excel',
cancelLabel: 'Cancel' cancelLabel: 'Cancel'
}, },

View File

@ -1176,10 +1176,7 @@ async function fetchLeads(isLoadMore = false) {
.sort((a, b) => Number(b.lead_id) - Number(a.lead_id)) .sort((a, b) => Number(b.lead_id) - Number(a.lead_id))
.map(l => { .map(l => {
let formattedCreatedDate = l.created_at let formattedCreatedDate = l.created_at
? new Date(l.created_at).toLocaleString('en-US', { ? formatIndianDate(l.created_at)
month: 'short', day: 'numeric', year: 'numeric',
hour: '2-digit', minute: '2-digit', hour12: true
})
: 'N/A'; : 'N/A';
return ` return `
@ -1308,14 +1305,7 @@ function renderCard(opps) {
let formattedDate = new Date(o.created_at).toLocaleString('en-US', { let formattedDate = formatIndianDate(o.created_at);
month: 'short',
day: 'numeric',
year: 'numeric',
hour: '2-digit',
minute: '2-digit',
hour12: true
});
// ${o.client_short_name} // ${o.client_short_name}
return ` return `
<div class="opportunities-list" id="leadOpportunitiesList"> <div class="opportunities-list" id="leadOpportunitiesList">
@ -1368,14 +1358,7 @@ function renderTimeline(acts) {
const icon = activityIcons[a.activity_type] || ""; const icon = activityIcons[a.activity_type] || "";
const formattedType = a.activity_type?.toUpperCase() || ""; const formattedType = a.activity_type?.toUpperCase() || "";
const formattedDate = new Date(a.scheduled_date).toLocaleString('en-US', { const formattedDate = formatIndianDate(a.scheduled_date);
month: 'short',
day: 'numeric',
year: 'numeric',
hour: '2-digit',
minute: '2-digit',
hour12: true
});
// Then use the variable in your HTML: // Then use the variable in your HTML:
// <span style="font-size:11px; color:#999">${formattedDate}</span> // <span style="font-size:11px; color:#999">${formattedDate}</span>
@ -2568,14 +2551,16 @@ function formatIndianDate(value) {
const date = new Date(String(value).replace(' ', 'T')); const date = new Date(String(value).replace(' ', 'T'));
if (Number.isNaN(date.getTime())) return value; if (Number.isNaN(date.getTime())) return value;
return date.toLocaleString('en-IN', { const day = String(date.getDate()).padStart(2, '0');
day: '2-digit', const month = String(date.getMonth() + 1).padStart(2, '0');
month: '2-digit', const year = date.getFullYear();
year: 'numeric', let hours = date.getHours();
hour: '2-digit', const minutes = String(date.getMinutes()).padStart(2, '0');
minute: '2-digit', const seconds = String(date.getSeconds()).padStart(2, '0');
hour12: true const ampm = hours >= 12 ? 'PM' : 'AM';
}).replace(',', '').toUpperCase(); hours = hours % 12 || 12;
return `${day}/${month}/${year} ${String(hours).padStart(2, '0')}:${minutes}:${seconds} ${ampm}`;
} }
function downloadCsv(filename, rows) { function downloadCsv(filename, rows) {
@ -2635,7 +2620,7 @@ function initLeadExportDateRangePicker() {
opens: 'left', opens: 'left',
drops: 'down', drops: 'down',
locale: { locale: {
format: 'DD-MM-YYYY', format: 'DD/MM/YYYY',
applyLabel: 'Generate Excel', applyLabel: 'Generate Excel',
cancelLabel: 'Cancel' cancelLabel: 'Cancel'
}, },

View File

@ -887,17 +887,17 @@
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="policy_start_date">Policy Start Date <span class="text-danger">*</span></label> <label for="policy_start_date">Policy Start Date <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="policy_start_date" name="policy_start_date" placeholder="DD/MM/YYY" value="<?= isset($lead_data['policy_start_date']) ? date('d-m-Y', strtotime($lead_data['policy_start_date'])) : "" ?>" required> <input type="text" class="form-control" id="policy_start_date" name="policy_start_date" placeholder="DD/MM/YYYY" value="<?= isset($lead_data['policy_start_date']) ? date('d/m/Y', strtotime($lead_data['policy_start_date'])) : "" ?>" required>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="policy_end_date">Policy End Date <span class="text-danger">*</span></label> <label for="policy_end_date">Policy End Date <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="policy_end_date" name="policy_end_date" placeholder="DD/MM/YYY" value="<?= isset($lead_data['policy_end_date']) ? date('d-m-Y', strtotime($lead_data['policy_end_date'])) : "" ?>" required> <input type="text" class="form-control" id="policy_end_date" name="policy_end_date" placeholder="DD/MM/YYYY" value="<?= isset($lead_data['policy_end_date']) ? date('d/m/Y', strtotime($lead_data['policy_end_date'])) : "" ?>" required>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="placement_date">Placement Date</label> <label for="placement_date">Placement Date</label>
<input type="text" class="form-control" id="placement_date" name="placement_date" placeholder="DD/MM/YYY" value="<?= isset($lead_data['placement_date']) ? date('d-m-Y', strtotime($lead_data['placement_date'])) : "" ?>"> <input type="text" class="form-control" id="placement_date" name="placement_date" placeholder="DD/MM/YYYY" value="<?= isset($lead_data['placement_date']) ? date('d/m/Y', strtotime($lead_data['placement_date'])) : "" ?>">
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
@ -945,7 +945,7 @@
<?php if (isset($lead_data['is_installment']) && $lead_data['is_installment'] == 0 || !isset($lead_data['is_installment'])) { ?> <?php if (isset($lead_data['is_installment']) && $lead_data['is_installment'] == 0 || !isset($lead_data['is_installment'])) { ?>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="payment_date">Payment Date</label> <label for="payment_date">Payment Date</label>
<input type="text" class="form-control payment_date" id="payment_date" name="payment_date" placeholder="DD/MM/YYY" value="<?= isset($lead_data['payment_date']) ? date('d-m-Y', strtotime($lead_data['payment_date'])) : "" ?>"> <input type="text" class="form-control payment_date" id="payment_date" name="payment_date" placeholder="DD/MM/YYYY" value="<?= isset($lead_data['payment_date']) ? date('d/m/Y', strtotime($lead_data['payment_date'])) : "" ?>">
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
@ -1327,22 +1327,22 @@
const editor2 = Jodit.make("#internal_mail_content", editorConfig); const editor2 = Jodit.make("#internal_mail_content", editorConfig);
var placement_date_datePicker = flatpickr("#placement_date", { var placement_date_datePicker = flatpickr("#placement_date", {
dateFormat: "d-m-Y", dateFormat: "d/m/Y",
allowInput: false, allowInput: false,
}); });
var payment_date_datePicker = flatpickr("#payment_date", { var payment_date_datePicker = flatpickr("#payment_date", {
dateFormat: "d-m-Y", dateFormat: "d/m/Y",
allowInput: false, allowInput: false,
}); });
var policy_start_date_datePicker = flatpickr("#policy_start_date", { var policy_start_date_datePicker = flatpickr("#policy_start_date", {
dateFormat: "d-m-Y", dateFormat: "d/m/Y",
allowInput: false, allowInput: false,
}); });
var policy_end_date_datePicker = flatpickr("#policy_end_date", { var policy_end_date_datePicker = flatpickr("#policy_end_date", {
dateFormat: "d-m-Y", dateFormat: "d/m/Y",
allowInput: false, allowInput: false,
}); });
@ -7046,7 +7046,7 @@ function appendMultiFileData(data) {
newhtml = ` newhtml = `
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="payment_date">Payment Date</label> <label for="payment_date">Payment Date</label>
<input type="text" class="form-control payment_date" id="payment_date" name="payment_date" placeholder="DD/MM/YYY"> <input type="text" class="form-control payment_date" id="payment_date" name="payment_date" placeholder="DD/MM/YYYY">
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
@ -7056,7 +7056,7 @@ function appendMultiFileData(data) {
`; `;
$('#not_installment').append(newhtml); $('#not_installment').append(newhtml);
$('.payment_date').flatpickr({ $('.payment_date').flatpickr({
dateFormat: 'd-m-Y', dateFormat: 'd/m/Y',
}); });
} else { } else {
toastr.error(response.message, 'Warning'); toastr.error(response.message, 'Warning');
@ -7155,7 +7155,7 @@ function appendMultiFileData(data) {
$('#installment_form_row').append(html); $('#installment_form_row').append(html);
$('.payment_date').flatpickr({ $('.payment_date').flatpickr({
dateFormat: 'd-m-Y', dateFormat: 'd/m/Y',
}); });
} }
@ -7312,7 +7312,7 @@ function appendMultiFileData(data) {
$(document).ready(function(){ $(document).ready(function(){
setTimeout(function(){ setTimeout(function(){
$('.payment_date').flatpickr({ $('.payment_date').flatpickr({
dateFormat: 'd-m-Y', dateFormat: 'd/m/Y',
}); });
}, 2000) }, 2000)
}) })