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\Controllers\EmployeeServiceController;
use App\Models\ClaimFilesModel; use App\Models\ClaimFilesModel;
use App\Models\TicketMailTemplateModel; use App\Models\TicketMailTemplateModel;
use Composer\Pcre\Preg;
use Kreait\Firebase\Factory; use Kreait\Firebase\Factory;
use Kreait\Firebase\Messaging\CloudMessage; use Kreait\Firebase\Messaging\CloudMessage;
use Kreait\Firebase\Messaging\Notification; use Kreait\Firebase\Messaging\Notification;
@ -4179,7 +4180,7 @@ class EmployeeRestController extends AdminController
// Save into DB // Save into DB
$result = $this->hrFileUploadModel->insert($data); $result = $this->hrFileUploadModel->insert($data);
if($result && $data['file_action'] == "addition"){ if($result){
$this->giveNotificationToClientsAccountManager($data); $this->giveNotificationToClientsAccountManager($data);
} }
@ -4196,24 +4197,12 @@ class EmployeeRestController extends AdminController
} }
private function giveNotificationToClientsAccountManager($data){ 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'] ?? [] ; $client_name = $this->clientModel->where('id',$data['client_id'])->findAll()[0]['client_name'] ?? [] ;
$account_manager_email = $this->clientRMModel->findAccountManagerEmail($data['client_id']); $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] ?? []; $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..!!"); log_message("error","Empty mail template for inception_addition please update the template in database or create one..!!");
return ; 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('%client_name%', $client_name ?? '', $mailTemplate['mail_content']);
$mailTemplate['mail_content'] = str_replace('%policy_no%', $data['policy_no'] ?? '', $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 = ""; $from_mail = "";
$to_mail = $account_manager_email; $to_mail = $account_manager_email;
$subject = $mailTemplate['subject']; $subject = $mailTemplate['subject'];

View File

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

View File

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

View File

@ -958,21 +958,7 @@
/* aligns text properly */ /* aligns text properly */
} }
</style> </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 --> <!-- modal section -->
<style> <style>

View File

@ -164,7 +164,7 @@ table.dataTable tbody td {
<thead class="bg-light"> <thead class="bg-light">
<tr> <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">Lead Type &nbsp;</div></th>
<th><div class="column-header">Issuer &nbsp;</div></th> <th><div class="column-header">Issuer &nbsp;</div></th>
<th><div class="column-header">Client Type &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><?php echo $lead_status[$row['status']] ?? '-'; ?></td>
<td> <td>
<div class="btn-group dropdown"> <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"> <a href="javascript:void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm"
<i class="mdi mdi-dots-horizontal"></i> data-toggle="dropdown"
aria-expanded="false"
data-boundary="window"> <i class="mdi mdi-dots-horizontal"></i>
</a> </a>
<div class="dropdown-menu dropdown-menu-right"> <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) ?>')"> <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); document.body.appendChild(customDropdown);
row.addEventListener("click", function(event) { row.addEventListener("click", function(event) {
// Ignore clicks on the action column
if (event.target.closest('td:last-child')) { // 1. CRITICAL CHECK: Stop propagation if the click came from the dropdown toggle itself.
return; 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) { if (activeDropdown) {
activeDropdown.style.display = 'none'; activeDropdown.style.display = 'none';
} }
@ -349,8 +358,32 @@ table.dataTable tbody td {
customDropdown.style.top = `${rect.bottom + 5}px`; customDropdown.style.top = `${rect.bottom + 5}px`;
activeDropdown = customDropdown; 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 // Handle clicks on dropdown items
customDropdown.querySelectorAll('.dropdown-item').forEach(item => { customDropdown.querySelectorAll('.dropdown-item').forEach(item => {

View File

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