diff --git a/app/Config/Database.php b/app/Config/Database.php index b0c2a6e3..2d388192 100755 --- a/app/Config/Database.php +++ b/app/Config/Database.php @@ -20,7 +20,8 @@ class Database extends Config * use if no other is specified. */ public string $defaultGroup = 'default'; - + public string $enableSSL; + /** * The default database connection. */ @@ -37,7 +38,7 @@ class Database extends Config 'charset' => 'utf8', 'DBCollat' => 'utf8_general_ci', 'swapPre' => '', - 'encrypt' => false, + 'encrypt' =>false, 'compress' => false, 'strictOn' => false, 'failover' => [], @@ -122,6 +123,18 @@ class Database extends Config if (ENVIRONMENT === 'testing') { $this->defaultGroup = 'tests'; } + + $this->enableSSL = env('DB_SSL_ENABLE'); + + if ($this->enableSSL === true || $this->enableSSL === 'true' || $this->enableSSL === 1 || $this->enableSSL === '1') { + + + // Enable SSL authentication + $this->default['encrypt'] = [ + 'ssl_ca' => ROOTPATH . 'ca.pem', + 'ssl_verify' => true, + ]; + } } } diff --git a/app/Controllers/BDSReportController.php b/app/Controllers/BDSReportController.php index d0dd5ac9..6a9d90f1 100644 --- a/app/Controllers/BDSReportController.php +++ b/app/Controllers/BDSReportController.php @@ -15,6 +15,7 @@ use App\Models\PolicyTransactionModel; use App\Models\PTCOShareDetailsModel; use App\Models\COShareStmtDetailsModel; use App\Models\PolicyTypeModel; +use App\Models\NhanceBranchModel; use CodeIgniter\API\ResponseTrait; @@ -34,6 +35,7 @@ class BDSReportController extends AdminController protected $coShareStmtDetailsModel; protected $policyTypeModel; protected $policyTatReportType; + protected $nhanceBranchModel; public function __construct() { @@ -47,6 +49,7 @@ class BDSReportController extends AdminController $this->PTCOShareDetailsModel = new PTCOShareDetailsModel(); $this->coShareStmtDetailsModel = new COShareStmtDetailsModel(); $this->policyTypeModel = new PolicyTypeModel(); + $this->nhanceBranchModel = new NhanceBranchModel(); $this->policyTatReportType = [ @@ -925,7 +928,7 @@ class BDSReportController extends AdminController $default_start = new \DateTime(); $data['default_end'] = $default_start->format('d-m-Y'); $data['default_start'] = $default_start->modify('-60 days')->format('d-m-Y'); - $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance']; + $data['issuer_branch'] = $this->nhanceBranchModel->where('is_active', 1)->findAll();; $data['tab_name'] = "Renewal Reports"; $data['page_name'] = "Renewal Report"; return $this->loadLayout('renewal_search', $data); @@ -935,11 +938,11 @@ class BDSReportController extends AdminController $toDate = $this->request->getPost('toDate'); $client_id = $this->request->getPost('client_id'); $client_type = $this->request->getPost('client_type'); - $issuer = $this->request->getPost('issuer'); + $issuer_branch = $this->request->getPost('issuer_branch'); - $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance']; + $data['issuer_branch'] = $this->nhanceBranchModel->where('is_active', 1)->findAll(); $data['client_type'] = [1 => 'Group', 2 => 'Individual']; - $data['renewal_data'] = $this->policyTransactionModel->getRenewalReportData($fromDate, $toDate, $client_type, $client_id, $issuer); + $data['renewal_data'] = $this->policyTransactionModel->getRenewalReportData($fromDate, $toDate, $client_type, $client_id, $issuer_branch); // print_r($data); die; $view_name = "bds_renewal_report_list"; $html = view('bds_renewal_report_list', $data); diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 859b51d1..bbade156 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -2840,20 +2840,8 @@ class EmployeeRestController extends AdminController ]; $emp_reatail_policy_data = $this->getEmpRetailPolicy($retailUserData); - - $query = $this->clientModel - ->where('is_active', 1) - ->where('client_type', 2); - - if (!empty($receviedPayload['mobile_no'])) { - $query->where('phone', $receviedPayload['mobile_no']); - } else { - $query->where('email', $receviedPayload['email_id'] ?? null); - } - - $retailClientData = $query->first(); $wellness_data = ['status' => 'failed','message' => 'Coming soon........!']; - return $this->respond(['status' => 'success', 'code' => 200, 'data' => [], 'emp_name' => $retailClientData['client_name'] ?? "", 'pre_policy_count' => 0, 'retail_policy_data' => $emp_reatail_policy_data, 'wellness_data' => $wellness_data], 200); + return $this->respond(['status' => 'success', 'code' => 200, 'data' => [], 'emp_name' => $emp_reatail_policy_data[0]['insurerd_name'] ?? "", 'pre_policy_count' => 0, 'retail_policy_data' => $emp_reatail_policy_data, 'wellness_data' => $wellness_data], 200); } } @@ -3540,6 +3528,9 @@ class EmployeeRestController extends AdminController $this->myLogger->logme('error', 'API claim initiate Recevied Params :' . json_encode($received_data ?? [])); $get_file_data = $this->request->getFiles('claim_docs'); $get_docs_name = $this->request->getPost('claim_doc_names') ?? []; + $policy_type_id = $this->request->getPost('policy_type_id') ?? null; + + if (is_string($get_docs_name)) { $decoded = json_decode($get_docs_name, true); @@ -4716,9 +4707,16 @@ class EmployeeRestController extends AdminController $emp_retail_client_data = $this->clientModel ->select(" '{$emp_id}' AS emp_id, + clients.client_name as insurerd_name, + clients.email as insurerd_mail, + clients.phone as insurerd_mobile, + policy_transaction.id as policy_transaction_id, policy_transaction.insurer_id, policy_transaction.policy_type_id, policy_transaction.policy_no, + policy_transaction.client_policy_id, + policy_transaction.vehicle_id, + vehicle.vehicle_no, DATE_FORMAT(policy_transaction.policy_start_date, '%d-%b-%Y') as policy_start_date, DATE_FORMAT(policy_transaction.policy_end_date, '%d-%b-%Y') as policy_end_date, policy_type.policy_type, @@ -4729,17 +4727,28 @@ class EmployeeRestController extends AdminController ->join('policy_transaction', 'policy_transaction.client_id = clients.id') ->join('insurers', 'policy_transaction.insurer_id = insurers.id') ->join('policy_type', 'policy_transaction.policy_type_id = policy_type.id') + ->join('vehicle', 'policy_transaction.vehicle_id = vehicle.id', 'left') ->where('policy_transaction.is_active', 1) + ->where('policy_transaction.action_type', "inception") ->where('clients.is_active', 1) + ->where('clients.client_type', 2) + ->where('clients.phone IS NOT NULL') ->where('clients.phone', $mobile_number) ->findAll(); }else { $emp_retail_client_data = $this->clientModel ->select(" '{$emp_id}' AS emp_id, + clients.client_name as insurerd_name, + clients.email as insurerd_mail, + clients.phone as insurerd_mobile, + policy_transaction.id as policy_transaction_id, policy_transaction.insurer_id, policy_transaction.policy_type_id, policy_transaction.policy_no, + policy_transaction.client_policy_id, + policy_transaction.vehicle_id, + vehicle.vehicle_no, DATE_FORMAT(policy_transaction.policy_start_date, '%d-%b-%Y') as policy_start_date, DATE_FORMAT(policy_transaction.policy_end_date, '%d-%b-%Y') as policy_end_date, policy_type.policy_type, @@ -4750,8 +4759,11 @@ class EmployeeRestController extends AdminController ->join('policy_transaction', 'policy_transaction.client_id = clients.id') ->join('insurers', 'policy_transaction.insurer_id = insurers.id') ->join('policy_type', 'policy_transaction.policy_type_id = policy_type.id') + ->join('vehicle', 'policy_transaction.vehicle_id = vehicle.id', 'left') ->where('policy_transaction.is_active', 1) + ->where('policy_transaction.action_type', "inception") ->where('clients.is_active', 1) + ->where('clients.client_type', 2) ->where('clients.email IS NOT NULL') ->where('clients.email', $email_id) ->findAll(); diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index 5b348a0f..2708abc4 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -825,9 +825,15 @@ // Fetch Sales Team $data['salse_team'] = $this->userModel - ->select('user_profiles.*,nhance_branch.id as nhance_branch_id, nhance_branch.branch_name as nhance_branch_name') + ->select(' + user_profiles.*, + nhance_branch.id as nhance_branch_id, + nhance_branch.branch_name as nhance_branch_name, + rm.first_name AS rm_name + ') ->join('user_teams', 'user_profiles.id = user_teams.user_id') ->join('nhance_branch', 'user_profiles.nhance_branch_id = nhance_branch.id','left') + ->join('user_profiles AS rm', 'user_profiles.rm_id = rm.id', 'left') ->where('user_teams.team_id', 5) ->where('user_teams.is_active', 1) ->where('user_profiles.is_active', 1) @@ -841,9 +847,19 @@ // Fetch ACM $data['ACM'] = $this->userModel - ->where('role', 3) // Assuming `role` is in `user_profiles` - ->where('is_active', 1) - ->findAll(); + ->select(' + user_profiles.*, + nhance_branch.id AS nhance_branch_id, + nhance_branch.branch_name AS nhance_branch_name, + rm.first_name AS rm_name + ') + ->join('user_teams', 'user_profiles.id = user_teams.user_id') + ->join('nhance_branch', 'user_profiles.nhance_branch_id = nhance_branch.id', 'left') + ->join('user_profiles AS rm', 'user_profiles.rm_id = rm.id', 'left') + ->where('user_profiles.role', 3) + ->where('user_profiles.is_active', 1) + ->findAll(); + // echo '
';
// print_r($data['ppTeamsData']); die;
diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php
index b0f56392..9c9065b9 100755
--- a/app/Controllers/RestAuthenticationController.php
+++ b/app/Controllers/RestAuthenticationController.php
@@ -2207,6 +2207,7 @@ class RestAuthenticationController extends AdminController
->select('clients.*')
->join('policy_transaction', 'policy_transaction.client_id = clients.id')
->where('policy_transaction.is_active', 1)
+ ->where('policy_transaction.action_type', "inception")
->where('clients.is_active', 1)
->where('clients.phone', $mobile_number);
@@ -2225,6 +2226,7 @@ class RestAuthenticationController extends AdminController
->select('clients.*')
->join('policy_transaction', 'policy_transaction.client_id = clients.id')
->where('policy_transaction.is_active', 1)
+ ->where('policy_transaction.action_type', "inception")
->where('clients.is_active', 1)
->where('clients.email', $email_id);
diff --git a/app/Controllers/UserController.php b/app/Controllers/UserController.php
index ee62c702..3879b49d 100755
--- a/app/Controllers/UserController.php
+++ b/app/Controllers/UserController.php
@@ -66,6 +66,7 @@ class UserController extends AdminController
// print_r($data); die;
$data['roleData'] = $this->roleModel->select('id, role')->findAll();
$data['teamData'] = $this->teamModel->select('id, name')->where('is_active',1)->findAll();
+ $data['user_data'] = $this->userModel->where('is_active',1)->findAll();
$data['NHanceBranchData'] = $this->nhanceBranchModel->select('id, branch_name')->where('is_active',1)->findAll();
$this->loadLayout('UserList', $data);
}
@@ -74,7 +75,7 @@ class UserController extends AdminController
public function create()
{
$this->myLogger->logme('error', 'User create function called');
- dd($this->request->getPost());
+ // dd($this->request->getPost());
$teams = $this->request->getPost('team');
//if this is get method return to user creation page
diff --git a/app/Models/PolicyTransactionModel.php b/app/Models/PolicyTransactionModel.php
index 44a0550d..1ac58a29 100644
--- a/app/Models/PolicyTransactionModel.php
+++ b/app/Models/PolicyTransactionModel.php
@@ -85,6 +85,9 @@
'agent_code',
'file_id',
'entry_from',
+ 'salse_person_manager_id',
+ 'service_person_manager_id',
+ 'service_person_branch_id',
];
@@ -1784,7 +1787,63 @@
//function for fetch renewal report data
- public function getRenewalReportData($start_date = null, $end_date = null, $client_type = null, $client = null, $issuer = null)
+ public function getRenewalReportData($start_date = null, $end_date = null, $client_type = null, $client = null, $issuer_branch = null)
+ {
+ $fromDate = date('Y-m-d', strtotime('-90 days'));
+ $toDate = date('Y-m-d 23:59:59');
+
+ if (!empty($start_date) && !empty($end_date)) {
+ $fromDate = change_date_format($start_date);
+ $toDate = change_date_format($end_date);
+ }
+
+ $query = $this->db->table('policy_transaction pt')
+ ->select('
+ pt.*,
+ c.client_name,
+ c.short_name AS client_short_name,
+ c.client_type,
+ policy_type.policy_type,
+ i.name as insurer_name,
+ ib.branch_name as insurer_branch_name,
+ vehicle.vehicle_no,
+ leads.status as lead_status
+ ')
+ ->join('clients c', 'pt.client_id = c.id', 'left')
+ ->join('pt_co_share_details pt_co', 'pt.id = pt_co.pt_id and pt_co.co_share_type = 1', 'left')
+ ->join('insurers i', 'pt_co.insurer_id = i.id', 'left')
+ ->join('insurer_branch ib', 'pt_co.insurer_branch_id = ib.id', 'left')
+ ->join('policy_type', 'pt.policy_type_id = policy_type.id', 'left')
+ ->join('vehicle', 'pt.vehicle_id = vehicle.id and vehicle.is_active = 1', 'left')
+ ->join('leads', 'pt.client_policy_id = leads.source_policy_id and leads.source_policy_id != 0 and leads.is_active = 1', 'left')
+ ->where('pt.renewal_date >=', $fromDate)
+ ->where('pt.renewal_date <=', $toDate)
+ ->where('pt.is_active', 1)
+ ->where('pt_co.is_active', 1)
+ ->where('pt.action_type', "inception")
+ ->where("NOT EXISTS (SELECT 1 FROM policy_transaction p2 WHERE p2.source_client_policy_id = pt.client_policy_id AND p2.is_active = 1)");
+
+
+ // Apply filters if parameters are provided
+ if (!empty($client_type)) {
+ $query->where('c.client_type', $client_type);
+ }
+ if (!empty($client)) {
+ $query->where('pt.client_id', $client);
+ }
+ if (!empty($issuer_branch)) { // Corrected condition to check $issuer
+ $query->where('pt.issuer_branch', $issuer_branch);
+ }
+
+ $query->groupBy('pt.id');
+ $query->orderBy('pt.id', 'DESC');
+ // Fetch and return results
+ $results = $query->get()->getResultArray();
+ // print($this->db->getLastQuery()); die;
+ return $results;
+ }
+
+ public function getRenewalReportDataOld($start_date = null, $end_date = null, $client_type = null, $client = null, $issuer = null)
{
$fromDate = date('Y-m-d', strtotime('-90 days'));
$toDate = date('Y-m-d 23:59:59');
diff --git a/app/Models/TicketMasterModel.php b/app/Models/TicketMasterModel.php
index bf40409b..a0189088 100644
--- a/app/Models/TicketMasterModel.php
+++ b/app/Models/TicketMasterModel.php
@@ -83,6 +83,12 @@ class TicketMasterModel extends Model
'manager_id',
'agent_id' ,
'vehicle_id',
+
+ 'hospital_address',
+ 'hospital_state',
+ 'hospital_city',
+ 'hospital_pin_code',
+ 'hospital_phone_no',
];
diff --git a/app/Models/UserModel.php b/app/Models/UserModel.php
index 20baa54c..32272925 100755
--- a/app/Models/UserModel.php
+++ b/app/Models/UserModel.php
@@ -28,6 +28,7 @@ class UserModel extends Model
"updated_at",
"is_active",
"nhance_branch_id",
+ "rm_id",
];
// Dates
diff --git a/app/Views/UserList.php b/app/Views/UserList.php
index 94442753..1382369b 100755
--- a/app/Views/UserList.php
+++ b/app/Views/UserList.php
@@ -488,7 +488,7 @@ table.dataTable tbody td {
-
+
+
+
+
+
-
+
-
+
@@ -514,7 +523,7 @@ table.dataTable tbody td {
-
+
@@ -863,6 +872,7 @@ table.dataTable tbody td {
$(document).ready(function () {
$('#nhance_branch_id').select2();
+ $('#rm_id').select2();
$('#nhance_branch_id')
.val(null) // ✅ MUST be null
@@ -1070,12 +1080,13 @@ table.dataTable tbody td {
$('#mobile').val(res.data.mobile);
$('#emp_code').val(res.data.emp_code);
$('#role option[value="' + res.data.role + '"]').prop('selected', true);
+ $('#rm_id').val(res.data.rm_id).select2(); // ✅ correct trigger
if (res.data.nhance_branch_id !== null &&
res.data.nhance_branch_id !== "" &&
res.data.nhance_branch_id !== 0) {
$('#nhance_branch_id')
.val(res.data.nhance_branch_id)
- .trigger('change.select2'); // ✅ correct trigger
+ .trigger('change.select2');
} else {
$('#nhance_branch_id')
.val(null) // ✅ MUST be null
@@ -1819,6 +1830,7 @@ table.dataTable tbody td {
$('#mobile').val('');
$('#emp_code').val('');
$('#nhance_branch_id').val('0');
+ $('#rm_id').val('0');
$('#UserForm').attr('action', '');
let myModal = new bootstrap.Modal(document.getElementById('con-close-modal'));
myModal.show(); // open modal
@@ -1836,6 +1848,29 @@ table.dataTable tbody td {
myModal.show(); // open modal
});
+
+ function validateInput(input, table, field, submitButId){
+
+ let value = $(input).val();
+ let label = $(input).closest('.form-group').find('label').text().replace('*', '').trim();
+
+ let message = "Value is duplicate!";
+ if(label){
+ message = label + " already exists!";
+ }
+
+ checkDuplicateTableFieldValue(table, field, value, function(isDuplicate) {
+ if (isDuplicate) {
+ toastr.warning(message, 'WARNING');
+ // $(input).val('')
+ $('#' + submitButId).prop('disabled', true);
+ } else{
+ $('#' + submitButId).prop('disabled', false);
+ }
+ });
+
+ }
+
\ No newline at end of file
diff --git a/app/Views/policy_transaction_inception_form_2.php b/app/Views/policy_transaction_inception_form_2.php
index 79ac1444..a1db7f44 100644
--- a/app/Views/policy_transaction_inception_form_2.php
+++ b/app/Views/policy_transaction_inception_form_2.php
@@ -333,6 +333,9 @@
+
+
+
@@ -439,14 +442,21 @@
class="text-right"
style="font-size: x-small;">
+
+
-
-
-
+
+
-
@@ -3303,6 +3328,30 @@
if(res.status == true){
// appendCDAccountNumber(res.data[0].cd_ac_no, unique_id)
appendCDAccountNumber(res.data, unique_id)
+
+
+ let balanceDiv = document.getElementById('cd_current_balance_info_' + unique_id);
+ setTimeout(function(){
+ let dropdown_value = $('#cd_ac_no_' + unique_id).val();
+
+ console.log("dropdown_value",dropdown_value)
+
+ res.data.forEach(function(item) {
+ if (item.id == dropdown_value) { // match found
+ if (item.opening_bal !== null) {
+ $('#cd_current_balance_info_' + unique_id).val(item.opening_bal);
+ balanceDiv.innerHTML =
+ '' + item.opening_bal + '' +
+ ' ✓ CD balance Amount';
+ balanceDiv.classList.add('show');
+ }
+ }
+ });
+ $('.card_group_34').show();
+ $('.card_group_37').show();
+ $("select[name='cd_ac_no_for_child[]']").attr('required', 'required');
+ }, 1000);
+
// if(res.data[0].id){
// $('#cd_ac_pk_for_leader').val(res.data[0].id)
// }
@@ -4767,53 +4816,85 @@
$('#policy_end_date').on('change', function () {
-
- let startDateStr = $('#policy_start_date').val();
- let endDateStr = $('#policy_end_date').val();
- if (!startDateStr || !endDateStr) {
- alert('Please select both Start and End dates');
- return;
- }
+ let startDateStr = $('#policy_start_date').val();
+ let endDateStr = $('#policy_end_date').val();
- // Convert DD/MM/YYYY → Date object
- let startParts = startDateStr.split('/');
- let endParts = endDateStr.split('/');
+ if (!startDateStr || !endDateStr) {
+ alert('Please select both Start and End dates');
+ return;
+ }
- let startDate = new Date(startParts[2], startParts[1] - 1, startParts[0]);
- let endDate = new Date(endParts[2], endParts[1] - 1, endParts[0]);
+ // Convert DD/MM/YYYY → Date object
+ let startParts = startDateStr.split('/');
+ let endParts = endDateStr.split('/');
- if (endDate <= startDate) {
- alert('End Date must be greater than Start Date');
- return;
- }
+ let startDate = new Date(startParts[2], startParts[1] - 1, startParts[0]);
+ let endDate = new Date(endParts[2], endParts[1] - 1, endParts[0]);
- // ✅ Calculate Year Difference
- let yearDiff = endDate.getFullYear() - startDate.getFullYear();
+ if (endDate <= startDate) {
+ alert('End Date must be greater than Start Date');
+ return;
+ }
- // Adjust if end date is before anniversary
- if (
- endDate.getMonth() < startDate.getMonth() ||
- (endDate.getMonth() === startDate.getMonth() && endDate.getDate() < startDate.getDate())
- ) {
- yearDiff--;
- }
-
- console.log('Year Difference:', yearDiff);
-
- // Clear existing cards (optional but recommended)
- // $('#allInsurerCards').empty();
- // $('.insurer-card').remove();
- // insurerCount = 0;
- resetInsurerCards();
-
- // Add cards equal to year difference
- for (let i = 0; i < yearDiff; i++) {
- addInsurerColumn();
- }
+ let yearDiff = calculateYearCount(startDate, endDate);
+ console.log(`YDiff: ${yearDiff}`);
+ adjustInsurerCards(yearDiff);
});
+
+ function calculateYearCount(start, end) {
+ let startDate = new Date(start);
+ let endDate = new Date(end);
+
+ let years = endDate.getFullYear() - startDate.getFullYear();
+
+ // Build the anniversary date for calculated years
+ let anniversary = new Date(
+ startDate.getFullYear() + years,
+ startDate.getMonth(),
+ startDate.getDate()
+ );
+
+ // If end date is before anniversary → reduce 1 year
+ if (endDate < anniversary) {
+ years--;
+ }
+
+ // If there are extra days beyond exact year → round up
+ // (endDate >= anniversary)
+ return years + 1;
+ }
+
+ function adjustInsurerCards(yearDiff) {
+
+ console.log("CurrCount:", insurerCount);
+
+ if (yearDiff > insurerCount) {
+ // ADD missing cards
+ let cardsToAdd = yearDiff - insurerCount;
+ console.log("CaAd:", cardsToAdd);
+
+ for (let i = 0; i < cardsToAdd; i++) {
+ addInsurerColumn(); // your function
+ }
+
+ } else if (yearDiff < insurerCount) {
+ // REMOVE extra cards
+ let cardsToRemove = insurerCount - yearDiff;
+ console.log("CaRe:", cardsToRemove);
+
+ for (let i = 0; i < cardsToRemove; i++) {
+ removeInsurerCard(insurerCount); // remove last
+ }
+ }
+
+ console.log("UpdatedCa:", insurerCount);
+ }
+
+
+
function resetInsurerCards() {
$('#allInsurerCards').empty();
insurerCount = 0;
@@ -6543,7 +6624,7 @@
}
- function setNhanceBranch(select) {
+ function setNhanceBranch(select, show_id) {
if (!select || !select.options || select.selectedIndex < 0) {
console.warn('No option selected yet');
@@ -6558,9 +6639,13 @@
console.log('NB ID:', nbID);
console.log('NB Name:', nbName);
- $('#issuer_branch').val(nbID ? nbID : '');
+ if(show_id == "nhance_branch_info"){
+ $('#issuer_branch').val(nbID ? nbID : '');
+ }else{
+ $('#service_person_branch_id').val(nbID ? nbID : '');
+ }
- let nbDiv = document.getElementById('nhance_branch_info');
+ let nbDiv = document.getElementById(show_id);
if (!nbID || !nbName) {
nbDiv.innerHTML = '';
@@ -6575,6 +6660,42 @@
nbDiv.classList.add('show');
}
+ function setRM(select, show_id) {
+
+ if (!select || !select.options || select.selectedIndex < 0) {
+ console.warn('No option selected yet');
+ return;
+ }
+
+ let selectedOption = select.options[select.selectedIndex];
+
+ let rmid = selectedOption.getAttribute('data-rmid');
+ let rmname = selectedOption.getAttribute('data-rmname');
+
+ console.log('RM ID:', rmid);
+ console.log('RM Name:', rmname);
+
+ if(show_id == "salse_rm_info"){
+ $('#salse_person_manager_id').val(rmid ? rmid : '');
+ }else{
+ $('#service_person_manager_id').val(rmid ? rmid : '');
+ }
+
+ let rmDiv = document.getElementById(show_id);
+
+ if (!rmid || !rmname) {
+ rmDiv.innerHTML = '';
+ rmDiv.classList.remove('show');
+ return;
+ }
+
+ rmDiv.innerHTML =
+ '' + rmname + '' +
+ ' ✓ RM';
+
+ rmDiv.classList.add('show');
+ }
+
function setPolicyIssueMonth(){
let monthDiv = document.getElementById('policy_issue_month_info');
monthAbbr = document.getElementById('month').value;
diff --git a/app/Views/policy_transaction_inception_list.php b/app/Views/policy_transaction_inception_list.php
index 82054906..2c443446 100644
--- a/app/Views/policy_transaction_inception_list.php
+++ b/app/Views/policy_transaction_inception_list.php
@@ -644,6 +644,7 @@ $(document).ready(function(){
var renewal_date = new Date(policy_end_date);
// renewal_date.setMonth(renewal_date.getMonth() - 1);
renewal_datePicker.setDate(renewal_date); // Set renewal date
+ renewal_datePicker.set('maxDate', policy_end_date); // set max date
}
});
diff --git a/app/Views/policy_transaction_inception_list_2.php b/app/Views/policy_transaction_inception_list_2.php
index 0096365d..99ef4eb2 100644
--- a/app/Views/policy_transaction_inception_list_2.php
+++ b/app/Views/policy_transaction_inception_list_2.php
@@ -643,6 +643,7 @@ $(document).ready(function(){
var renewal_date = new Date(policy_end_date);
// renewal_date.setMonth(renewal_date.getMonth() - 1);
renewal_datePicker.setDate(renewal_date); // Set renewal date
+ renewal_datePicker.set('maxDate', policy_end_date); // set max date
}
});
diff --git a/app/Views/renewal_search.php b/app/Views/renewal_search.php
index 5aa04e50..6cdca11d 100644
--- a/app/Views/renewal_search.php
+++ b/app/Views/renewal_search.php
@@ -30,13 +30,13 @@
-
-
-
+
+
+
$value) {
- echo "";
+ if (isset($issuer_branch) && count($issuer_branch)) {
+ foreach ($issuer_branch as $key => $value) {
+ echo "";
}
}
?>
@@ -133,13 +133,13 @@
var toDate = $('#endDate').val();
var client_id = $('#client_id').val();
var client_type = $('#client_type').val();
- var issuer = $('#issuer').val();
+ var issuer_branch = $('#issuer_branch').val();
var requestData = {
fromDate: fromDate,
toDate: toDate,
client_id: client_id,
client_type: client_type,
- issuer: issuer,
+ issuer_branch: issuer_branch,
};
console.log(typeof fromDate);
var url = '= base_url('/bdsReport/renewal_report') ?>';
diff --git a/app/Views/ticket_form_gmc.php b/app/Views/ticket_form_gmc.php
index 554d60c1..1bf0da03 100644
--- a/app/Views/ticket_form_gmc.php
+++ b/app/Views/ticket_form_gmc.php
@@ -283,6 +283,45 @@
name="hospital_name" required>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+