Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
VENKATESHWARAN 2025-10-29 17:11:27 +05:30
commit 3c046e246a
6 changed files with 105 additions and 78 deletions

View File

@ -54,6 +54,7 @@ use Illuminate\Http\Request;
use App\Controllers\EmployeeServiceController;
use App\Models\ClaimFilesModel;
use App\Models\TicketMailTemplateModel;
use Composer\Pcre\Preg;
use Kreait\Firebase\Factory;
use Kreait\Firebase\Messaging\CloudMessage;
use Kreait\Firebase\Messaging\Notification;
@ -4179,7 +4180,7 @@ class EmployeeRestController extends AdminController
// Save into DB
$result = $this->hrFileUploadModel->insert($data);
if($result && $data['file_action'] == "addition"){
if($result){
$this->giveNotificationToClientsAccountManager($data);
}
@ -4196,24 +4197,12 @@ class EmployeeRestController extends AdminController
}
private function giveNotificationToClientsAccountManager($data){
// $data = [
// 'client_id' => $this->request->getPost('client_id'),
// 'client_branch_id' => $this->request->getPost('client_branch_id'),
// 'policy_id' => $this->request->getPost('policy_id'),
// 'policy_no' => $this->request->getPost('policy_no'),
// 'file_name' => $newFileName,
// 'file_action' => $this->request->getPost('file_action'),
// 'status' => 'Yet to start',
// 'created_by' => $this->request->getPost('created_by'),
// 'updated_by' => $this->request->getPost('created_by'),
// ];
$client_name = $this->clientModel->where('id',$data['client_id'])->findAll()[0]['client_name'] ?? [] ;
$account_manager_email = $this->clientRMModel->findAccountManagerEmail($data['client_id']);
$templateName = "inception_addition";
$templateName = "hr_endorsement_template";
$mailTemplate = $this->ticketMailTemplateModel->where('template_name', $templateName)->findAll()[0] ?? [];
@ -4222,10 +4211,16 @@ class EmployeeRestController extends AdminController
log_message("error","Empty mail template for inception_addition please update the template in database or create one..!!");
return ;
}
$data['file_action'] = ucwords(preg_replace("/_/", " ", $data['file_action']));
$mailTemplate['mail_content'] = str_replace('%file_action%', $data['file_action'] ?? '', $mailTemplate['mail_content']);
$mailTemplate['mail_content'] = str_replace('%client_name%', $client_name ?? '', $mailTemplate['mail_content']);
$mailTemplate['mail_content'] = str_replace('%policy_no%', $data['policy_no'] ?? '', $mailTemplate['mail_content']);
$mailTemplate['subject'] = str_replace('%subject%',$data['file_action']??'',$mailTemplate['subject']);
$mailTemplate['subject'] = str_replace('%client_name%',$client_name??'',$mailTemplate['subject']);
$from_mail = "";
$to_mail = $account_manager_email;
$subject = $mailTemplate['subject'];

View File

@ -521,12 +521,13 @@ table.dataTable tbody td {
<?php foreach($roleData as $value) {
$headRoleValue = $value['id']??"";
// $headRoleValue = $value['id']??"";
// we are showing head role only to head's who logged in
if($headRoleValue == "5" && $currentLogInRole != "5" ){
continue;
}
// // we are showing head role only to head's who logged in
// if($headRoleValue == "5" && $currentLogInRole != "5" ){
// continue;
// }
?>
<option value="<?= $value['id'] ?>"><?= $value['role'] ?></option>
<?php } ?>

View File

@ -46,33 +46,40 @@
height: 0;
}
.slider {
position: relative;
width: 50px;
height: 25px;
background-color: #fff;
border-radius: 25px;
box-shadow: 0 0 5px rgba(0,0,0,0.2);
transition: 0.3s;
.slider,
.slider_blue {
position: relative;
width: 50px;
height: 25px;
background-color: #fff;
border-radius: 25px;
box-shadow: 0 0 5px rgba(0,0,0,0.2);
transition: 0.3s;
}
.slider::before {
content: "";
position: absolute;
height: 19px;
width: 19px;
left: 3px;
top: 3px;
background-color: #ccc;
border-radius: 50%;
transition: 0.3s;
.slider::before ,
.slider_blue::before {
content: "";
position: absolute;
height: 19px;
width: 19px;
left: 3px;
top: 3px;
background-color: #ccc;
border-radius: 50%;
transition: 0.3s;
}
input:checked + .slider {
background-color: #ff4d4d; /* red when ON */
}
input:checked + .slider::before {
input:checked + .slider_blue {
background-color: #268ef5ff; /* blue when ON */
}
input:checked + .slider::before ,
input:checked + .slider_blue::before {
transform: translateX(25px);
background-color: #fff;
}
@ -269,23 +276,18 @@ input:checked + .slider::before {
<textarea class="form-control" placeholder="Enter Disclaimer" name="disclaimer" id="disclaimer" ></textarea>
</div>
<div class="form-group col-md-4 EB">
<label class="switch" style="position: relative;top: 43px;left: 20px;">
<div class="form-group col-md-12 EB mt-3 ">
<label class="switch-label">
<input id="policy_visibility" type="checkbox" name="enrolment_visibility" checked>
<span class="slider round" style="height: 27px;"></span>
<span class="slider_blue"></span>
<span class="switch-text">Policy Visibilty in Employee App</span>
</label>
<!-- <label for="policy_visibility" style="position: relative;bottom: 5px;left: 85px;">Policy Visibilty in Enrollment App</label> -->
<label for="policy_visibility" style="position: relative;bottom: 5px;left: 85px;">Policy Visibilty in Employee App</label>
</div>
<div class="form-group col-md-4 EB">
<label class="switch" style="position: relative;top: 43px;left: 20px;">
<label class="switch-label" >
<input id="is_lgbtq" type="checkbox" name="is_lgbtq">
<span class="slider round" style="height: 27px;"></span>
<span class="slider_blue"></span>
<span class="switch-text">Is LGBTQ Enable</span>
</label>
<label for="is_lgbtq" style="position: relative;bottom: 5px;left: 85px;"> Is LGBTQ Enable</label>
</div>
</div>

View File

@ -958,21 +958,7 @@
/* aligns text properly */
}
</style>
<!-- additional table fix for dropdown -->
<style>
.table-responsive {
overflow: visible !important;
}
.btn-group,
.dropdown {
position: relative;
}
.dropdown-menu {
z-index: 9999;
}
</style>
<!-- modal section -->
<style>

View File

@ -164,7 +164,7 @@ table.dataTable tbody td {
<thead class="bg-light">
<tr>
<th><div class="column-header">S.No&nbsp;</div></th>
<th><div class="column-header">S.No &nbsp;</div></th>
<th><div class="column-header">Lead Type &nbsp;</div></th>
<th><div class="column-header">Issuer &nbsp;</div></th>
<th><div class="column-header">Client Type &nbsp;</div></th>
@ -209,8 +209,10 @@ table.dataTable tbody td {
<td><?php echo $lead_status[$row['status']] ?? '-'; ?></td>
<td>
<div class="btn-group dropdown">
<a href="javascript:void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false">
<i class="mdi mdi-dots-horizontal"></i>
<a href="javascript:void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm"
data-toggle="dropdown"
aria-expanded="false"
data-boundary="window"> <i class="mdi mdi-dots-horizontal"></i>
</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item btnEdit" data-id="<?= $row['id']; ?>" data-ft="<?= $row['lead_form_type']; ?>" onclick="getLeadsDataForEdit('<?= htmlspecialchars($row['id'], ENT_QUOTES) ?>', '<?= htmlspecialchars($row['lead_form_type'], ENT_QUOTES) ?>')">
@ -331,12 +333,19 @@ table.dataTable tbody td {
document.body.appendChild(customDropdown);
row.addEventListener("click", function(event) {
// Ignore clicks on the action column
if (event.target.closest('td:last-child')) {
return;
}
row.addEventListener("click", function(event) {
// 1. CRITICAL CHECK: Stop propagation if the click came from the dropdown toggle itself.
if (event.target.closest('.dropdown-toggle')) {
event.stopPropagation();
// **IMPORTANT:** Since you're using a custom script, you need to
// manually trigger the logic for your custom detached dropdown here.
// The code below should run when the dropdown toggle is clicked:
const originalDropdown = event.target.closest('.btn-group').querySelector('.dropdown-menu');
if (originalDropdown) {
// This is the code that opens your custom dropdown
if (activeDropdown) {
activeDropdown.style.display = 'none';
}
@ -349,8 +358,32 @@ table.dataTable tbody td {
customDropdown.style.top = `${rect.bottom + 5}px`;
activeDropdown = customDropdown;
event.stopPropagation();
});
}
return; // Exit the row listener early
}
// 2. Ignore clicks on the entire action column (your existing, good check)
if (event.target.closest('td:last-child')) {
return;
}
// ... rest of your row logic for general row clicks ...
if (activeDropdown) {
activeDropdown.style.display = 'none';
}
const rect = event.target.getBoundingClientRect();
customDropdown.style.display = 'block';
customDropdown.style.position = 'fixed';
customDropdown.style.left = `${rect.left}px`;
customDropdown.style.top = `${rect.bottom + 5}px`;
activeDropdown = customDropdown;
event.stopPropagation(); // Only needed if there is a parent handler
});
// Handle clicks on dropdown items
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {

View File

@ -79,7 +79,7 @@ table.dataTable tbody td {
<thead class="bg-light">
<tr>
<th>S. No</th>
<th style="display: none;">User</th>
<th>User</th>
<th>Month</th>
<!-- <th style="display: none;">Business Type</th> -->
<th style="display: none;">Client Type</th>
@ -92,12 +92,17 @@ table.dataTable tbody td {
<th>Endorsement No</th>
<!-- <th style="display: none;">Insurer Name</th> -->
<th>Insurer Branch</th>
<!-- <th style="display: none;">TPA</th> -->
<th style="display: none;">Endorsement <br> Effective Date</th>
<th style="display: none;">Policy <br> Effective Date</th>
<th style="display: none;">Policy <br> Expiry Date</th>
<th style="display: none;">Reference</th>
<th style="display: none;">Remarks</th>
<th>BP Premium</th>
<th>TP/Ter Premium</th>
<th style="display: none;">Premium <br> (without GST)</th>
@ -105,7 +110,7 @@ table.dataTable tbody td {
<th>Total Premium</th>
<th>BP %</th>
<th>TP/Ter %</th>
<th style="display: none;">Rewards</th>
<th>Rewards</th>
<th>Agreed Amount</th>
<th>Invoiced Amount</th>
<th>Outstanding Amount</th>
@ -221,11 +226,16 @@ table.dataTable tbody td {
<!-- <td style="display: none;"><?php echo $row['insurer_name'] ?: 'N/A'; ?> </td> -->
<td><?php echo $row['insurer_branch_name'] ?: 'N/A'; ?></td>
<!-- <td style="display: none;"><?php echo $row['tpa_name']; ?></td> -->
<td style="display: none;"><?php echo empty($row['endorse_eff_date']) ? 'N/A' : date('d/m/Y', strtotime($row['endorse_eff_date'])) ?></td>
<td style="display: none;"><?php echo empty($row['policy_start_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_start_date'])); ?></td>
<td style="display: none;"><?php echo empty($row['policy_end_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_end_date'])); ?></td>
<td style="display: none;"><?php echo $row['ref'] ?: 'N/A'; ?></td>
<td style="display: none;"><?php echo $row['remarks'] ?: 'N/A'; ?></td>
<td class="right-align-input"><?php echo $row['bp_amt']; ?></td>
<td class="right-align-input"><?php echo $row['tp_or_ter']; ?></td>
<td class="right-align-input" style="display: none;"><?php echo $row['premium_wo_gst']; ?></td>