Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
8332cdc5ed
@ -8,6 +8,7 @@ use CodeIgniter\Router\RouteCollection;
|
||||
*/
|
||||
$routes->post('/chat', 'ChatbotControllerNew::index');
|
||||
$routes->get('/widget', 'ChatbotControllerNew::widget');
|
||||
$routes->get('/chatbottest', 'ChatbotControllerNew::chatbotest');
|
||||
$routes->get('/chatbot', 'ChatbotControllerNew::chatbot');
|
||||
|
||||
$routes->get('/swagger', 'SwaggerController::index', ['filter' => 'authMVC']);
|
||||
@ -87,6 +88,8 @@ $routes->group("/client", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->get('deposit/(:num)', 'ClientController::deposit/$1');
|
||||
$routes->get('remove/(:num)', 'ClientController::removeClient/$1');
|
||||
$routes->get("list/(:any)", "ClientController::editClientOnboarding/$1");
|
||||
$routes->post('wipe', 'ClientController::wipeDemoClient');
|
||||
|
||||
// application/config/routes.php
|
||||
|
||||
// Add a route for the view_Deposit method
|
||||
|
||||
@ -23,7 +23,7 @@ class EcardDownloadConversation extends Conversation
|
||||
$policy_list = ChatbotHelper::getListOfPolicies($chat_session_info);
|
||||
$buttons = [];
|
||||
$question = 'Choose Policy to Download Ecard:';
|
||||
log_message('error', ('policy_list : ' . json_encode($policy_list)));
|
||||
// log_message('error', ('policy_list : ' . json_encode($policy_list)));
|
||||
|
||||
if(is_array($policy_list) && count($policy_list))
|
||||
{
|
||||
|
||||
@ -25,9 +25,13 @@ class ChatbotControllerNew extends BaseController
|
||||
public function __construct()
|
||||
{
|
||||
set_session_context('CHATBOT CON');
|
||||
|
||||
$this->myLogger = \Config\Services::mylogger();
|
||||
$this->session = \Config\Services::session();
|
||||
|
||||
$sessionID = session_id();
|
||||
$this->myLogger->logme('error', 'COOKIE - ' . $sessionID);
|
||||
|
||||
// $this->myLogger->logme('error', 'CALLED');
|
||||
|
||||
// Load BotMan driver
|
||||
@ -51,6 +55,9 @@ class ChatbotControllerNew extends BaseController
|
||||
// $this->myLogger->logme('error', $method);
|
||||
|
||||
if (isset($extras) && $method == 'widget') {
|
||||
$request = \Config\Services::request();
|
||||
$cookieHeader = $request->getHeaderLine('Cookie');
|
||||
|
||||
$extras = $extras->parameters;
|
||||
$this->session->set('CHATBOT_EMP_ID', $extras->employee_id);
|
||||
$this->session->set('CHATBOT_ORIGIN', $extras->origin);
|
||||
@ -104,10 +111,10 @@ class ChatbotControllerNew extends BaseController
|
||||
log_message("error","Inside Bot Type Function");
|
||||
|
||||
$bot->types(); // Typing indicator for the first message
|
||||
sleep(0.5); // Delay
|
||||
sleep(0.1); // Delay
|
||||
});
|
||||
// Start the Main Menu when user says "hi" or "start"
|
||||
$this->botman->hears('start|hi|hello', function (BotMan $bot) {
|
||||
$this->botman->hears('start|hi|hello|help|help me', function (BotMan $bot) {
|
||||
if ($this->isMemberLoggedIn){
|
||||
$bot->reply('Hi how can i assist?');
|
||||
$bot->startConversation(new MainMenuConversation());
|
||||
@ -139,9 +146,14 @@ class ChatbotControllerNew extends BaseController
|
||||
|
||||
// }
|
||||
|
||||
public function chatbotest()
|
||||
{
|
||||
$this->loadLayout('chatbottest.php');
|
||||
}
|
||||
|
||||
public function chatbot()
|
||||
{
|
||||
$this->loadLayout('chatbot.php');
|
||||
echo view('chatbot.php');
|
||||
}
|
||||
|
||||
public function widget()
|
||||
|
||||
@ -635,6 +635,7 @@ class ClientController extends AdminController
|
||||
$balances = $this->clientPolicyModel->getBalances($id);
|
||||
$data['balances'] = $balances;
|
||||
|
||||
// dd($data);
|
||||
if($requestFrom == 'rest'){ return $data; }
|
||||
|
||||
echo view('layout/header', $headerData);
|
||||
@ -746,12 +747,15 @@ class ClientController extends AdminController
|
||||
$this->myLogger->logme('error', 'Edit Client Onboarding function called');
|
||||
$headerData['page_name'] = 'Edit Client Onboarding';
|
||||
|
||||
$editData['RM'] = $this->userModel->where('is_active', 1)->findAll();
|
||||
$editData['RM'] = $this->userModel->where('is_active', 1)->findAll();
|
||||
$editData['tpa'] = $this->tpaBranchModel->getTpaBranchesWithTpaNames();
|
||||
$editData['state'] = $this->stateModel->getAllStates();
|
||||
$editData['police'] = $this->policesModel->findAll();
|
||||
$editData['entity'] = $this->kycEntityTypeModel->findAll();
|
||||
$editData['insurer'] = $this->insurerBranchModel->getInsurerBranchesWithInsurerNames();
|
||||
$editData['insurers'] = $this->insurerModel->where('is_active', 1)->findAll();
|
||||
$editData['insurer_branch'] = $this->insurerBranchModel->where('is_active', 1)->findAll();
|
||||
$editData['clients'] = $this->clientModel->where('is_active', 1)->findAll();
|
||||
$editData['kyc_docs'] = $this->kycDocsModel->findAll();
|
||||
$editData['policyGridData'] = $this->policyGridModel->findAll();
|
||||
$editData['policy_types'] = $this->policyTypeModel->findAll();
|
||||
@ -805,7 +809,12 @@ class ClientController extends AdminController
|
||||
$data['is_download_btn'] = 1;
|
||||
}
|
||||
|
||||
if(empty($data['parent_client_id'])){
|
||||
$data['parent_client_id'] = null;
|
||||
}
|
||||
|
||||
$insert = $this->clientModel->insert($data);
|
||||
|
||||
if ($insert) {
|
||||
$client_data = $this->clientModel->where(['id' => $insert, 'is_active' => 1])->first();
|
||||
return $this->respond(['status' => true, 'code' => 200, 'data' => $client_data], 200);
|
||||
@ -834,6 +843,9 @@ class ClientController extends AdminController
|
||||
$data['is_download_btn'] = 1;
|
||||
}
|
||||
|
||||
if(empty($data['parent_client_id'])){
|
||||
$data['parent_client_id'] = null;
|
||||
}
|
||||
// print_r($data);die;
|
||||
|
||||
$update = $this->clientModel->update($id, $data);
|
||||
@ -2545,6 +2557,7 @@ class ClientController extends AdminController
|
||||
// $data['special_condition_label'] = str_replace(',', '', $this->request->getPost("special_condition_label")) ?? [];
|
||||
// $data['special_condition_input'] = str_replace(',', '', $this->request->getPost("special_condition_input")) ?? [];
|
||||
// $data['multiple_sum_insured'] = str_replace(',', '', $this->request->getPost("multiple_sum_insured")) ?? [];
|
||||
|
||||
$fields = [
|
||||
'waiverofpreexistingdiseases' => false,
|
||||
'waiverof1,2,3&4thyearexclusions' => false,
|
||||
@ -2599,6 +2612,8 @@ class ClientController extends AdminController
|
||||
|
||||
if ($value !== null && $value !== '') {
|
||||
$data[$field] = $needsCleanup ? str_replace(',', '', $value) : $value;
|
||||
}else{
|
||||
$data[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2865,6 +2880,8 @@ class ClientController extends AdminController
|
||||
try {
|
||||
$this->myLogger->logme('error', 'Policy GPA Terms CREATE function called');
|
||||
|
||||
// print_r($this->request->getPost()); die;
|
||||
|
||||
/*** Client Policy Table Primary Key(ID) ***/
|
||||
$client_policy_id = $this->request->getPost("client_policy_id");
|
||||
|
||||
@ -2936,6 +2953,8 @@ class ClientController extends AdminController
|
||||
$value = $this->request->getPost($field);
|
||||
if ($value !== null) {
|
||||
$data[$field] = str_replace(',', '', $value);
|
||||
}else{
|
||||
$data[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2944,6 +2963,8 @@ class ClientController extends AdminController
|
||||
$value = $this->request->getPost($field);
|
||||
if ($value !== null) {
|
||||
$data[$field] = $value;
|
||||
}else{
|
||||
$data[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3551,22 +3572,56 @@ class ClientController extends AdminController
|
||||
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Additionaly Rack Rate Data Remove Successfully'], 200);
|
||||
}
|
||||
|
||||
public function get_cd_ac($client_id, $insurer_id)
|
||||
public function get_cd_ac($client_id, $insurer_id, $insurer_branch_id)
|
||||
{
|
||||
// Get client data
|
||||
$client_data = $this->clientModel
|
||||
->where('is_active', 1)
|
||||
->where('id', $client_id)
|
||||
->first();
|
||||
|
||||
$cd_data = $this->CDMasterModel
|
||||
$cd_data = [];
|
||||
|
||||
// If client has a parent, fetch parent client CD data
|
||||
if (!empty($client_data['parent_client_id'])) {
|
||||
$parent_cd_data = $this->CDMasterModel
|
||||
->where('client_id', $client_data['parent_client_id'])
|
||||
->where('insurer_id', $insurer_id)
|
||||
->where('insurer_branch_id', $insurer_branch_id)
|
||||
->where('is_active', 1)
|
||||
->findAll();
|
||||
|
||||
$cd_data = array_merge($cd_data, $parent_cd_data);
|
||||
}
|
||||
|
||||
// Fetch current client CD data
|
||||
$client_cd_data = $this->CDMasterModel
|
||||
->where('client_id', $client_id)
|
||||
->where('insurer_id', $insurer_id)
|
||||
->where('insurer_branch_id', $insurer_branch_id)
|
||||
->where('is_active', 1)
|
||||
->findAll();
|
||||
|
||||
if ($cd_data) {
|
||||
return $this->respond(['status' => true, 'code' => 200, 'data' => $cd_data], 200);
|
||||
$cd_data = array_merge($cd_data, $client_cd_data);
|
||||
|
||||
if (!empty($cd_data)) {
|
||||
return $this->respond([
|
||||
'status' => true,
|
||||
'code' => 200,
|
||||
'data' => $cd_data
|
||||
], 200);
|
||||
} else {
|
||||
return $this->respond(['status' => false, 'code' => 404, 'insurer_id' => $insurer_id, 'client_id' => $client_id], 200);
|
||||
return $this->respond([
|
||||
'status' => false,
|
||||
'code' => 404,
|
||||
'client_id' => $client_id,
|
||||
'insurer_id' => $insurer_id,
|
||||
'insurer_branch_id' => $insurer_branch_id
|
||||
], 200);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function otherPolicyTermsFormSubmit()
|
||||
{
|
||||
|
||||
@ -4095,21 +4150,60 @@ class ClientController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getCDAccNoByClientAndInsurer($client, $insurer)
|
||||
public function getCDAccNoByClientAndInsurer($client_id, $insurer_id, $insurer_branch_id)
|
||||
{
|
||||
$cdmData = $this->CDMasterModel
|
||||
->where('client_id', $client)
|
||||
->where('insurer_id', $insurer)
|
||||
->where('is_active', 1)
|
||||
->findAll();
|
||||
// Get client data
|
||||
$client_data = $this->clientModel
|
||||
->where('is_active', 1)
|
||||
->where('id', $client_id)
|
||||
->first();
|
||||
|
||||
if ($cdmData) {
|
||||
return $this->respond(['status' => true, 'data' => $cdmData], 200);
|
||||
$cd_data = [];
|
||||
|
||||
// If client has a parent, fetch parent client CD data
|
||||
if (!empty($client_data['parent_client_id'])) {
|
||||
$parent_cd_data = $this->CDMasterModel
|
||||
->where('client_id', $client_data['parent_client_id'])
|
||||
->where('insurer_id', $insurer_id)
|
||||
->where('insurer_branch_id', $insurer_branch_id)
|
||||
->where('is_active', 1)
|
||||
->findAll();
|
||||
|
||||
$cd_data = array_merge($cd_data, $parent_cd_data);
|
||||
}
|
||||
|
||||
// Fetch current client CD data
|
||||
$client_cd_data = $this->CDMasterModel
|
||||
->where('client_id', $client_id)
|
||||
->where('insurer_id', $insurer_id)
|
||||
->where('insurer_branch_id', $insurer_branch_id)
|
||||
->where('is_active', 1)
|
||||
->findAll();
|
||||
|
||||
$cd_data = array_merge($cd_data, $client_cd_data);
|
||||
|
||||
if (!empty($cd_data)) {
|
||||
return $this->respond([ 'status' => true,'code' => 200, 'data' => $cd_data], 200);
|
||||
} else {
|
||||
return $this->respond(['status' => false], 200);
|
||||
return $this->respond(['status' => false,'code' => 404,'client_id' => $client_id,'insurer_id' => $insurer_id,'insurer_branch_id' => $insurer_branch_id ], 200);
|
||||
}
|
||||
}
|
||||
|
||||
// public function getCDAccNoByClientAndInsurer($client, $insurer, $insurer_branch_id)
|
||||
// {
|
||||
// $cdmData = $this->CDMasterModel
|
||||
// ->where('client_id', $client)
|
||||
// ->where('insurer_id', $insurer)
|
||||
// ->where('insurer_branch_id', $insurer_branch_id)
|
||||
// ->where('is_active', 1)
|
||||
// ->findAll();
|
||||
|
||||
// if ($cdmData) {
|
||||
// return $this->respond(['status' => true, 'data' => $cdmData], 200);
|
||||
// } else {
|
||||
// return $this->respond(['status' => false], 200);
|
||||
// }
|
||||
// }
|
||||
|
||||
public function createClientWithMinimalData()
|
||||
{
|
||||
@ -6141,7 +6235,7 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------
|
||||
// ---------------- HR ACCESS CONTROL -----------------------------------------------------------------------------------
|
||||
|
||||
public function viewHrAccessData()
|
||||
{
|
||||
@ -6208,6 +6302,14 @@ class ClientController extends AdminController
|
||||
|
||||
$pre_client_data = $db2->table('clients')->where('is_active', 1)->where('short_name', $post_client_data['short_name'])->get()->getRowArray();
|
||||
|
||||
if(empty($pre_client_data)){
|
||||
|
||||
$hrAccessData['pre_hr_data'] = [];
|
||||
$hrAccessData['pre_policy_data'] = [];
|
||||
$combinedHrAccessData = $this->constructHrAccessData($hrAccessData, $client_id);
|
||||
return $combinedHrAccessData;
|
||||
}
|
||||
|
||||
$hrAccessData['pre_hr_data'] = $db2->table('client_branch')
|
||||
->select('lc.id as pre_hr_id, lc.name as hr_name, lc.mobile as hr_mobile, lc.email as hr_mail')
|
||||
->join('level_contacts lc', 'client_branch.id = lc.ref_id')
|
||||
@ -6479,8 +6581,585 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------- DEMO CLIENT FUNCTION --------------------------------------------------------------------------------
|
||||
|
||||
// public function wipeDemoClient()
|
||||
// {
|
||||
// // $this->myLogger->logme('error', "Wipe Demo Client function called");
|
||||
// $this->myLogger->logme('error', "Wipe Demo Client function called"); // Red text
|
||||
|
||||
// $this->myLogger->logme('error', "Wipe Demo client Payload : " . json_encode($this->request->getPost() ?? []));
|
||||
// $client_id = $this->request->getPost('client_id');
|
||||
|
||||
// if (empty($client_id)) {
|
||||
// return $this->respond(['status' => false, 'message' => 'Client id required'], 404);
|
||||
// }
|
||||
|
||||
// // 1. Client Model
|
||||
// $client_data = $this->clientModel->where('id', $client_id)->where('is_active', 1)->first();
|
||||
// $this->myLogger->logme('error', "Client data : " . json_encode($client_data ?? []));
|
||||
|
||||
// if (!empty($client_data)) {
|
||||
// $is_deleted = $this->clientModel->where('id', $client_id)->delete();
|
||||
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "Client data removed successfully.");
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Client record does not exist.");
|
||||
// }
|
||||
// } else {
|
||||
// return $this->respond(['status' => false, 'message' => 'Client not found'], 404);
|
||||
// }
|
||||
|
||||
// // 2. Client RM Model
|
||||
// $client_rm_data = $this->clientRMModel->where('client_id', $client_id)->first();
|
||||
// $this->myLogger->logme('error', "Client Relationship Manager data : " . json_encode($client_rm_data ?? []));
|
||||
|
||||
// if (!empty($client_rm_data)) {
|
||||
// $is_deleted = $this->clientRMModel->where('client_id', $client_id)->delete();
|
||||
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "Client Relationship Manager data removed successfully.");
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Client Relationship Manager record does not exist. To delete");
|
||||
// }
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Client Relationship Manager data not found.");
|
||||
// }
|
||||
|
||||
// // 3. Client KYC Docs Model
|
||||
// $client_kyc_data = $this->clientKYCDocsModel->where('client_id', $client_id)->findAll();
|
||||
// $this->myLogger->logme('error', "Client KYC Docs data : " . json_encode($client_kyc_data ?? []));
|
||||
|
||||
// if (!empty($client_kyc_data)) {
|
||||
// $is_deleted = $this->clientKYCDocsModel->where('client_id', $client_id)->delete();
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "Client KYC Docs data removed successfully.");
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Client KYC Docs record does not exist. To delete");
|
||||
// }
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Client KYC Docs data not found.");
|
||||
// }
|
||||
|
||||
// // 4. Client Branch Model
|
||||
// $client_branch_data = $this->clientBranchModel->where('client_id', $client_id)->findAll();
|
||||
// $this->myLogger->logme('error', "Client Branch data : " . json_encode($client_branch_data ?? []));
|
||||
|
||||
// $branch_ids = array_column($client_branch_data, 'id') ?? [];
|
||||
// $this->myLogger->logme('error', "Client Branch id count : " . count($branch_ids ?? []));
|
||||
|
||||
// if (!empty($client_branch_data)) {
|
||||
|
||||
// $is_deleted = $this->clientBranchModel->where('client_id', $client_id)->delete();
|
||||
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "Client Branch data removed successfully.");
|
||||
|
||||
// if(!empty($branch_ids)){
|
||||
|
||||
// $level_contact_data = $this->levelContactModel->where('contact_type', 'client')->whereIn('ref_id', $branch_ids)->findAll();
|
||||
// $this->myLogger->logme('error', "Level Contact data : " . json_encode($level_contact_data ?? []));
|
||||
|
||||
// $is_deleted = $this->levelContactModel->where('contact_type', 'client')->whereIn('ref_id', $branch_ids)->delete();
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "Level Contact data removed successfully.");
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Level Contact record does not exist. To delete");
|
||||
// }
|
||||
|
||||
// }else{
|
||||
// $this->myLogger->logme('error', "Level Contact data not found.");
|
||||
// }
|
||||
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Client Branch record does not exist. To delete");
|
||||
// }
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Client Branch data not found.");
|
||||
// }
|
||||
|
||||
// // 5. Client Policy Model
|
||||
// $client_policy_data = $this->clientPolicyModel->where('client_id', $client_id)->findAll();
|
||||
// $this->myLogger->logme('error', "Client Policy data : " . json_encode($client_policy_data ?? []));
|
||||
|
||||
// $policy_ids = array_column($client_policy_data, 'id') ?? [];
|
||||
// $this->myLogger->logme('error', "Client Policy id count : " . count($policy_ids ?? []));
|
||||
|
||||
// if (!empty($client_policy_data)) {
|
||||
// $is_deleted = $this->clientPolicyModel->where('client_id', $client_id)->delete();
|
||||
// if ($is_deleted) {
|
||||
|
||||
// $this->myLogger->logme('error', "Client Policy data removed successfully.");
|
||||
|
||||
// if(!empty($policy_ids)){
|
||||
|
||||
// $employee_policy_data = $this->employeePolicyModel->whereIn('client_policy_id', $policy_ids)->findAll();
|
||||
// $this->myLogger->logme('error', "Employee Policy data count : " . count($employee_policy_data ?? []));
|
||||
|
||||
// $is_deleted = $this->employeePolicyModel->whereIn('client_policy_id', $policy_ids)->delete();
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "Employee policy data removed successfully.");
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Employee policy record does not exist. To delete");
|
||||
// }
|
||||
|
||||
// }else{
|
||||
// $this->myLogger->logme('error', "Employee policy data not found.");
|
||||
// }
|
||||
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Client Policy record does not exist. To delete");
|
||||
// }
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Client Policy data not found.");
|
||||
// }
|
||||
|
||||
// // 6. Employee Model
|
||||
// $employee_data = $this->employeeModel->where('client_id', $client_id)->findAll();
|
||||
// $this->myLogger->logme('error', "Employee data count : " . count($employee_data ?? []));
|
||||
|
||||
// if (!empty($employee_data)) {
|
||||
|
||||
// $is_deleted = $this->employeeModel->where('client_id', $client_id)->delete();
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "Employee data removed successfully.");
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Employee record does not exist. To delete");
|
||||
// }
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Employee data not found.");
|
||||
// }
|
||||
|
||||
// // 7. Client Deposit Model
|
||||
// $client_deposit_data = $this->clientDepositModel->where('client_id', $client_id)->findAll();
|
||||
// $this->myLogger->logme('error', "Client Deposit data : " . json_encode($client_deposit_data ?? []));
|
||||
|
||||
// if (!empty($client_deposit_data)) {
|
||||
// $is_deleted = $this->clientDepositModel->where('client_id', $client_id)->delete();
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "Client Deposit data removed successfully.");
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Client Deposit record does not exist. To delete");
|
||||
// }
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Client Deposit data not found.");
|
||||
// }
|
||||
|
||||
// // 8. Policy Premium 1 Model
|
||||
// $policy_premium1_data = $this->policyPremium1Model->where('client_id', $client_id)->findAll();
|
||||
// $this->myLogger->logme('error', "Policy Premium 1 data count : " . count($policy_premium1_data ?? []));
|
||||
|
||||
// if (!empty($policy_premium1_data)) {
|
||||
// $is_deleted = $this->policyPremium1Model->where('client_id', $client_id)->delete();
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "Policy Premium 1 data removed successfully.");
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Policy Premium 1 record does not exist. To delete");
|
||||
// }
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Policy Premium 1 data not found.");
|
||||
// }
|
||||
|
||||
// // 9. Policy Premium 2 Model
|
||||
// $policy_premium2_data = $this->policyPremium2Model->where('client_id', $client_id)->findAll();
|
||||
// $this->myLogger->logme('error', "Policy Premium 2 data count: " . count($policy_premium2_data ?? []));
|
||||
|
||||
// if (!empty($policy_premium2_data)) {
|
||||
// $is_deleted = $this->policyPremium2Model->where('client_id', $client_id)->delete();
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "Policy Premium 2 data removed successfully.");
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Policy Premium 2 record does not exist. To delete");
|
||||
// }
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Policy Premium 2 data not found.");
|
||||
// }
|
||||
|
||||
// // 10. Notification Model
|
||||
// $notification_data = $this->notificationModel->where('client_id', $client_id)->findAll();
|
||||
// $this->myLogger->logme('error', "Notification data : " . json_encode($notification_data ?? []));
|
||||
|
||||
// if (!empty($notification_data)) {
|
||||
// $is_deleted = $this->notificationModel->where('client_id', $client_id)->delete();
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "Notification data removed successfully.");
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Notification record does not exist. To delete");
|
||||
// }
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Notification data not found.");
|
||||
// }
|
||||
|
||||
// // 11. CD Master Model
|
||||
// $cd_master_data = $this->CDMasterModel->where('client_id', $client_id)->findAll();
|
||||
// $this->myLogger->logme('error', "CD Master data : " . json_encode($cd_master_data ?? []));
|
||||
|
||||
// if (!empty($cd_master_data)) {
|
||||
// $is_deleted = $this->CDMasterModel->where('client_id', $client_id)->delete();
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "CD Master data removed successfully.");
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "CD Master record does not exist. To delete");
|
||||
// }
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "CD Master data not found.");
|
||||
// }
|
||||
|
||||
// // 12. Policy Transaction Model
|
||||
// $policy_transaction_data = $this->policyTransactionModel->where('client_id', $client_id)->findAll();
|
||||
// $this->myLogger->logme('error', "Policy Transaction data : " . json_encode($policy_transaction_data ?? []));
|
||||
|
||||
// $pt_ids = array_column($policy_transaction_data, 'id') ?? [];
|
||||
// $this->myLogger->logme('error', "Policy Transaction id count : " . count($pt_ids ?? []));
|
||||
|
||||
// if (!empty($policy_transaction_data)) {
|
||||
// $is_deleted = $this->policyTransactionModel->where('client_id', $client_id)->delete();
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "Policy Transaction data removed successfully.");
|
||||
|
||||
// if(!empty($pt_ids)){
|
||||
|
||||
// $pt_co_share_data = $this->PTCOShareDetailsModel->whereIn('pt_id', $pt_ids)->findAll();
|
||||
// $this->myLogger->logme('error', "PT CO Share data : " . json_encode($pt_co_share_data ?? []));
|
||||
|
||||
// $is_deleted = $this->PTCOShareDetailsModel->whereIn('pt_id', $pt_ids)->delete();
|
||||
// if ($is_deleted) {
|
||||
// $this->myLogger->logme('error', "PT CO Share data removed successfully.");
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "PT CO Share record does not exist. To delete");
|
||||
// }
|
||||
|
||||
// }else{
|
||||
// $this->myLogger->logme('error', "PT CO Share data not found.");
|
||||
// }
|
||||
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Policy Transaction record does not exist. To delete");
|
||||
// }
|
||||
// } else {
|
||||
// $this->myLogger->logme('error', "Policy Transaction data not found.");
|
||||
// }
|
||||
|
||||
// $this->myLogger->logme('error', "Wipe Demo Client function closed");
|
||||
// return $this->respond(['status' => true, 'message' => 'Demo client data wiped successfully'], 200);
|
||||
// }
|
||||
|
||||
public function wipeDemoClient()
|
||||
{
|
||||
$this->myLogger->logme('error', "========================================");
|
||||
$this->myLogger->logme('error', "WIPE DEMO CLIENT FUNCTION STARTED");
|
||||
$this->myLogger->logme('error', "========================================");
|
||||
|
||||
$this->myLogger->logme('error', "Request Payload: " . json_encode($this->request->getPost() ?? []));
|
||||
$client_id = $this->request->getPost('client_id');
|
||||
|
||||
if (empty($client_id)) {
|
||||
$this->myLogger->logme('error', "ERROR: Client ID is required");
|
||||
return $this->respond(['status' => false, 'message' => 'Client id required'], 404);
|
||||
}
|
||||
|
||||
$this->myLogger->logme('error', "Client ID to wipe: " . $client_id);
|
||||
$this->myLogger->logme('error', "----------------------------------------");
|
||||
|
||||
// ========================================
|
||||
// 1. CLIENT MODEL DELETION
|
||||
// ========================================
|
||||
$this->myLogger->logme('error', "1. PROCESSING CLIENT MODEL");
|
||||
$client_data = $this->clientModel->where('id', $client_id)->where('is_active', 1)->first();
|
||||
$this->myLogger->logme('error', " Found Client Data: " . json_encode($client_data ?? []));
|
||||
|
||||
if (!empty($client_data)) {
|
||||
$is_deleted = $this->clientModel->where('id', $client_id)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ Client data removed successfully");
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete client record");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Client not found or inactive");
|
||||
return $this->respond(['status' => false, 'message' => 'Client not found'], 404);
|
||||
}
|
||||
$this->myLogger->logme('error', "----------------------------------------");
|
||||
|
||||
// ========================================
|
||||
// 2. CLIENT RM MODEL DELETION
|
||||
// ========================================
|
||||
$this->myLogger->logme('error', "2. PROCESSING CLIENT RM MODEL");
|
||||
$client_rm_data = $this->clientRMModel->where('client_id', $client_id)->first();
|
||||
$this->myLogger->logme('error', " Found Client RM Data: " . json_encode($client_rm_data ?? []));
|
||||
|
||||
if (!empty($client_rm_data)) {
|
||||
$is_deleted = $this->clientRMModel->where('client_id', $client_id)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ Client RM data removed successfully");
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete Client RM record");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No Client RM data found");
|
||||
}
|
||||
$this->myLogger->logme('error', "----------------------------------------");
|
||||
|
||||
// ========================================
|
||||
// 3. CLIENT KYC DOCS MODEL DELETION
|
||||
// ========================================
|
||||
$this->myLogger->logme('error', "3. PROCESSING CLIENT KYC DOCS MODEL");
|
||||
$client_kyc_data = $this->clientKYCDocsModel->where('client_id', $client_id)->findAll();
|
||||
$this->myLogger->logme('error', " Found Client KYC Records: " . count($client_kyc_data ?? []));
|
||||
$this->myLogger->logme('error', " Client KYC Data: " . json_encode($client_kyc_data ?? []));
|
||||
|
||||
if (!empty($client_kyc_data)) {
|
||||
$is_deleted = $this->clientKYCDocsModel->where('client_id', $client_id)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ Client KYC Docs data removed successfully");
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete Client KYC Docs records");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No Client KYC Docs data found");
|
||||
}
|
||||
$this->myLogger->logme('error', "----------------------------------------");
|
||||
|
||||
// ========================================
|
||||
// 4. CLIENT BRANCH MODEL DELETION
|
||||
// ========================================
|
||||
$this->myLogger->logme('error', "4. PROCESSING CLIENT BRANCH MODEL");
|
||||
$client_branch_data = $this->clientBranchModel->where('client_id', $client_id)->findAll();
|
||||
$branch_ids = array_column($client_branch_data, 'id') ?? [];
|
||||
$this->myLogger->logme('error', " Found Client Branch Records: " . count($client_branch_data ?? []));
|
||||
$this->myLogger->logme('error', " Branch IDs: " . json_encode($branch_ids));
|
||||
$this->myLogger->logme('error', " Client Branch Data: " . json_encode($client_branch_data ?? []));
|
||||
|
||||
if (!empty($client_branch_data)) {
|
||||
$is_deleted = $this->clientBranchModel->where('client_id', $client_id)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ Client Branch data removed successfully");
|
||||
|
||||
// Delete related Level Contact data
|
||||
if (!empty($branch_ids)) {
|
||||
$this->myLogger->logme('error', " 4a. PROCESSING RELATED LEVEL CONTACT DATA");
|
||||
$level_contact_data = $this->levelContactModel->where('contact_type', 'client')->whereIn('ref_id', $branch_ids)->findAll();
|
||||
$this->myLogger->logme('error', " Found Level Contact Records: " . count($level_contact_data ?? []));
|
||||
$this->myLogger->logme('error', " Level Contact Data: " . json_encode($level_contact_data ?? []));
|
||||
|
||||
$is_deleted = $this->levelContactModel->where('contact_type', 'client')->whereIn('ref_id', $branch_ids)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ Level Contact data removed successfully");
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete Level Contact records");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No Branch IDs available for Level Contact deletion");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete Client Branch records");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No Client Branch data found");
|
||||
}
|
||||
$this->myLogger->logme('error', "----------------------------------------");
|
||||
|
||||
// ========================================
|
||||
// 5. CLIENT POLICY MODEL DELETION
|
||||
// ========================================
|
||||
$this->myLogger->logme('error', "5. PROCESSING CLIENT POLICY MODEL");
|
||||
$client_policy_data = $this->clientPolicyModel->where('client_id', $client_id)->findAll();
|
||||
$policy_ids = array_column($client_policy_data, 'id') ?? [];
|
||||
$this->myLogger->logme('error', " Found Client Policy Records: " . count($client_policy_data ?? []));
|
||||
$this->myLogger->logme('error', " Policy IDs: " . json_encode($policy_ids));
|
||||
$this->myLogger->logme('error', " Client Policy Data: " . json_encode($client_policy_data ?? []));
|
||||
|
||||
if (!empty($client_policy_data)) {
|
||||
$is_deleted = $this->clientPolicyModel->where('client_id', $client_id)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ Client Policy data removed successfully");
|
||||
|
||||
// Delete related Employee Policy data
|
||||
if (!empty($policy_ids)) {
|
||||
$this->myLogger->logme('error', " 5a. PROCESSING RELATED EMPLOYEE POLICY DATA");
|
||||
$employee_policy_data = $this->employeePolicyModel->whereIn('client_policy_id', $policy_ids)->findAll();
|
||||
$this->myLogger->logme('error', " Found Employee Policy Records: " . count($employee_policy_data ?? []));
|
||||
|
||||
$is_deleted = $this->employeePolicyModel->whereIn('client_policy_id', $policy_ids)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ Employee Policy data removed successfully");
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete Employee Policy records");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No Policy IDs available for Employee Policy deletion");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete Client Policy records");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No Client Policy data found");
|
||||
}
|
||||
$this->myLogger->logme('error', "----------------------------------------");
|
||||
|
||||
// ========================================
|
||||
// 6. EMPLOYEE MODEL DELETION
|
||||
// ========================================
|
||||
$this->myLogger->logme('error', "6. PROCESSING EMPLOYEE MODEL");
|
||||
$employee_data = $this->employeeModel->where('client_id', $client_id)->findAll();
|
||||
$this->myLogger->logme('error', " Found Employee Records: " . count($employee_data ?? []));
|
||||
|
||||
if (!empty($employee_data)) {
|
||||
$is_deleted = $this->employeeModel->where('client_id', $client_id)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ Employee data removed successfully");
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete Employee records");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No Employee data found");
|
||||
}
|
||||
$this->myLogger->logme('error', "----------------------------------------");
|
||||
|
||||
// ========================================
|
||||
// 7. CLIENT DEPOSIT MODEL DELETION
|
||||
// ========================================
|
||||
$this->myLogger->logme('error', "7. PROCESSING CLIENT DEPOSIT MODEL");
|
||||
$client_deposit_data = $this->clientDepositModel->where('client_id', $client_id)->findAll();
|
||||
$this->myLogger->logme('error', " Found Client Deposit Records: " . count($client_deposit_data ?? []));
|
||||
$this->myLogger->logme('error', " Client Deposit Data: " . json_encode($client_deposit_data ?? []));
|
||||
|
||||
if (!empty($client_deposit_data)) {
|
||||
$is_deleted = $this->clientDepositModel->where('client_id', $client_id)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ Client Deposit data removed successfully");
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete Client Deposit records");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No Client Deposit data found");
|
||||
}
|
||||
$this->myLogger->logme('error', "----------------------------------------");
|
||||
|
||||
// ========================================
|
||||
// 8. POLICY PREMIUM 1 MODEL DELETION
|
||||
// ========================================
|
||||
$this->myLogger->logme('error', "8. PROCESSING POLICY PREMIUM 1 MODEL");
|
||||
$policy_premium1_data = $this->policyPremium1Model->where('client_id', $client_id)->findAll();
|
||||
$this->myLogger->logme('error', " Found Policy Premium 1 Records: " . count($policy_premium1_data ?? []));
|
||||
|
||||
if (!empty($policy_premium1_data)) {
|
||||
$is_deleted = $this->policyPremium1Model->where('client_id', $client_id)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ Policy Premium 1 data removed successfully");
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete Policy Premium 1 records");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No Policy Premium 1 data found");
|
||||
}
|
||||
$this->myLogger->logme('error', "----------------------------------------");
|
||||
|
||||
// ========================================
|
||||
// 9. POLICY PREMIUM 2 MODEL DELETION
|
||||
// ========================================
|
||||
$this->myLogger->logme('error', "9. PROCESSING POLICY PREMIUM 2 MODEL");
|
||||
$policy_premium2_data = $this->policyPremium2Model->where('client_id', $client_id)->findAll();
|
||||
$this->myLogger->logme('error', " Found Policy Premium 2 Records: " . count($policy_premium2_data ?? []));
|
||||
|
||||
if (!empty($policy_premium2_data)) {
|
||||
$is_deleted = $this->policyPremium2Model->where('client_id', $client_id)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ Policy Premium 2 data removed successfully");
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete Policy Premium 2 records");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No Policy Premium 2 data found");
|
||||
}
|
||||
$this->myLogger->logme('error', "----------------------------------------");
|
||||
|
||||
// ========================================
|
||||
// 10. NOTIFICATION MODEL DELETION
|
||||
// ========================================
|
||||
$this->myLogger->logme('error', "10. PROCESSING NOTIFICATION MODEL");
|
||||
$notification_data = $this->notificationModel->where('client_id', $client_id)->findAll();
|
||||
$this->myLogger->logme('error', " Found Notification Records: " . count($notification_data ?? []));
|
||||
$this->myLogger->logme('error', " Notification Data: " . json_encode($notification_data ?? []));
|
||||
|
||||
if (!empty($notification_data)) {
|
||||
$is_deleted = $this->notificationModel->where('client_id', $client_id)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ Notification data removed successfully");
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete Notification records");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No Notification data found");
|
||||
}
|
||||
$this->myLogger->logme('error', "----------------------------------------");
|
||||
|
||||
// ========================================
|
||||
// 11. CD MASTER MODEL DELETION
|
||||
// ========================================
|
||||
$this->myLogger->logme('error', "11. PROCESSING CD MASTER MODEL");
|
||||
$cd_master_data = $this->CDMasterModel->where('client_id', $client_id)->findAll();
|
||||
$this->myLogger->logme('error', " Found CD Master Records: " . count($cd_master_data ?? []));
|
||||
$this->myLogger->logme('error', " CD Master Data: " . json_encode($cd_master_data ?? []));
|
||||
|
||||
if (!empty($cd_master_data)) {
|
||||
$is_deleted = $this->CDMasterModel->where('client_id', $client_id)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ CD Master data removed successfully");
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete CD Master records");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No CD Master data found");
|
||||
}
|
||||
$this->myLogger->logme('error', "----------------------------------------");
|
||||
|
||||
// ========================================
|
||||
// 12. POLICY TRANSACTION MODEL DELETION
|
||||
// ========================================
|
||||
$this->myLogger->logme('error', "12. PROCESSING POLICY TRANSACTION MODEL");
|
||||
$policy_transaction_data = $this->policyTransactionModel->where('client_id', $client_id)->findAll();
|
||||
$pt_ids = array_column($policy_transaction_data, 'id') ?? [];
|
||||
$this->myLogger->logme('error', " Found Policy Transaction Records: " . count($policy_transaction_data ?? []));
|
||||
$this->myLogger->logme('error', " Policy Transaction IDs: " . json_encode($pt_ids));
|
||||
$this->myLogger->logme('error', " Policy Transaction Data: " . json_encode($policy_transaction_data ?? []));
|
||||
|
||||
if (!empty($policy_transaction_data)) {
|
||||
$is_deleted = $this->policyTransactionModel->where('client_id', $client_id)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ Policy Transaction data removed successfully");
|
||||
|
||||
// Delete related PT CO Share data
|
||||
if (!empty($pt_ids)) {
|
||||
$this->myLogger->logme('error', " 12a. PROCESSING RELATED PT CO SHARE DATA");
|
||||
$pt_co_share_data = $this->PTCOShareDetailsModel->whereIn('pt_id', $pt_ids)->findAll();
|
||||
$this->myLogger->logme('error', " Found PT CO Share Records: " . count($pt_co_share_data ?? []));
|
||||
$this->myLogger->logme('error', " PT CO Share Data: " . json_encode($pt_co_share_data ?? []));
|
||||
|
||||
$is_deleted = $this->PTCOShareDetailsModel->whereIn('pt_id', $pt_ids)->delete();
|
||||
if ($is_deleted) {
|
||||
$this->myLogger->logme('error', " ✓ PT CO Share data removed successfully");
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete PT CO Share records");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No Policy Transaction IDs available for PT CO Share deletion");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ✗ Failed to delete Policy Transaction records");
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', " ℹ No Policy Transaction data found");
|
||||
}
|
||||
|
||||
$this->myLogger->logme('error', "========================================");
|
||||
$this->myLogger->logme('error', "WIPE DEMO CLIENT FUNCTION COMPLETED");
|
||||
$this->myLogger->logme('error', "Client ID: " . $client_id . " - Successfully processed");
|
||||
$this->myLogger->logme('error', "========================================");
|
||||
|
||||
return $this->respond(['status' => true, 'message' => 'Demo client data wiped successfully'], 200);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -199,13 +199,21 @@ class EmpDataServiceController extends BaseController
|
||||
|
||||
$totals = round($totals, 2);
|
||||
|
||||
if($export_data['insurer_or_tpa'] == 'insurer') //check CD amt related issue for only insurer, not tpa
|
||||
//check CD amt insufficient only insurer, not tpa // DO NOT REMOVE THIS
|
||||
if($export_data['insurer_or_tpa'] == 'insurer')
|
||||
{
|
||||
if (!empty($cash_balance)) {
|
||||
if ((int) $cash_balance['balance'] < (int) $totals) {
|
||||
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount.');
|
||||
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount. CASH BALANCE : {balance} and TOTAL AMOUNT : {total}', ['balance' => $cash_balance['balance'], 'total' => $totals]);
|
||||
return 0;
|
||||
session()->set('cd_balance', false);
|
||||
session()->set('cd_amount', $cash_balance['balance']);
|
||||
session()->set('excel_file_amt', $totals);
|
||||
}else{
|
||||
session()->set('cd_balance', true);
|
||||
session()->set('cd_amount', $cash_balance['balance']);
|
||||
session()->set('excel_file_amt', $totals);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -700,13 +708,21 @@ class EmpDataServiceController extends BaseController
|
||||
// echo '<pre>';
|
||||
// print_r($ids); die;
|
||||
|
||||
if($export_data['insurer_or_tpa'] == 'insurer') //check CD amt related issue for only insurer, not tpa
|
||||
//check CD amt insufficiend for only insurer, not tpa // DO NOT REMOVE THIS
|
||||
if($export_data['insurer_or_tpa'] == 'insurer')
|
||||
{
|
||||
if (!empty($cash_balance)) {
|
||||
if ((int) $cash_balance['balance'] < (int) $rounded_totals) {
|
||||
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount.');
|
||||
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount. CASH BALANCE : {balance} and TOTAL AMOUNT : {total}', ['balance' => $cash_balance['balance'], 'total' => $totals]);
|
||||
return 0;
|
||||
session()->set('cd_balance', false);
|
||||
session()->set('cd_amount', $cash_balance['balance']);
|
||||
session()->set('excel_file_amt', $rounded_totals);
|
||||
}else{
|
||||
session()->set('cd_balance', true);
|
||||
session()->set('cd_amount', $cash_balance['balance']);
|
||||
session()->set('excel_file_amt', $rounded_totals);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1003,22 +1019,29 @@ class EmpDataServiceController extends BaseController
|
||||
$cash_balance['balance'] = $balance['opening_bal'];
|
||||
}
|
||||
|
||||
// Calculate the total amount from the objects
|
||||
$totals = 0;
|
||||
foreach ($inceptionData as $item) {
|
||||
$totals = $totals + $item->total;
|
||||
}
|
||||
|
||||
|
||||
// Calculate the total amount from the objects
|
||||
$totals = 0;
|
||||
foreach ($inceptionData as $item) {
|
||||
$totals = $totals + $item->total;
|
||||
}
|
||||
$totals = round($totals, 2);
|
||||
|
||||
if($export_data['insurer_or_tpa'] != 'tpa')// check overal emp premium amt with cd balance only for insurer export, not tpa export
|
||||
|
||||
if($export_data['insurer_or_tpa'] != 'tpa')// check overal emp premium amt with cd balance only for insurer export, not tpa export
|
||||
{
|
||||
if (!empty($cash_balance)) {
|
||||
if ((int) $cash_balance['balance'] < (int) $totals) {
|
||||
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount.');
|
||||
$this->myLogger->logme('error', 'Inception export failed due to insufficient deposit amount. CASH BALANCE : {balance} and TOTAL AMOUNT : {total}', ['balance' => $cash_balance['balance'], 'total' => $totals]);
|
||||
return 0;
|
||||
session()->set('cd_balance', false);
|
||||
session()->set('cd_amount', $cash_balance['balance']);
|
||||
session()->set('excel_file_amt', $totals);
|
||||
}else{
|
||||
session()->set('cd_balance', true);
|
||||
session()->set('cd_amount', $cash_balance['balance']);
|
||||
session()->set('excel_file_amt', $totals);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1359,6 +1382,8 @@ class EmpDataServiceController extends BaseController
|
||||
$batch_code = $file['batch_code'];
|
||||
$user_id = $file['created_by'];
|
||||
|
||||
$client_policy_data = $this->clientPolicyModel->where('id', $client_policy_id)->first();
|
||||
|
||||
$insurer_or_tpa = $file['insurer_or_tpa'];
|
||||
if ($insurer_or_tpa == 'tpa') {
|
||||
$id = 'tpa_id';
|
||||
@ -1516,37 +1541,40 @@ class EmpDataServiceController extends BaseController
|
||||
|
||||
//--- TPA ID Duplicate check start ---
|
||||
|
||||
$current_tpa_id = $excel_data[$key][13];
|
||||
// Duplicate checking for only GMC's and GPA
|
||||
if(in_array($client_policy_data['policy_type_id'], [1,2,3,4,5])){
|
||||
$current_tpa_id = $excel_data[$key][13];
|
||||
|
||||
if (isset($tpa_id_all[$current_tpa_id])) {
|
||||
if (isset($tpa_id_all[$current_tpa_id])) {
|
||||
|
||||
// Add the current row to errors
|
||||
$errors[$key][] = [
|
||||
'row' => $key,
|
||||
'column' => 13,
|
||||
'db_data' => "Duplicate TPA ID Found",
|
||||
'excel_data' => $current_tpa_id
|
||||
];
|
||||
|
||||
// Add all existing rows with the same TPA ID to errors
|
||||
foreach ($tpa_id_all[$current_tpa_id] as $existing_row) {
|
||||
$errors[$existing_row][] = [
|
||||
'row' => $existing_row,
|
||||
// Add the current row to errors
|
||||
$errors[$key][] = [
|
||||
'row' => $key,
|
||||
'column' => 13,
|
||||
'db_data' => "Duplicate TPA ID Found",
|
||||
'excel_data' => $current_tpa_id
|
||||
];
|
||||
}
|
||||
|
||||
// Add all existing rows with the same TPA ID to errors
|
||||
foreach ($tpa_id_all[$current_tpa_id] as $existing_row) {
|
||||
$errors[$existing_row][] = [
|
||||
'row' => $existing_row,
|
||||
'column' => 13,
|
||||
'db_data' => "Duplicate TPA ID Found",
|
||||
'excel_data' => $current_tpa_id
|
||||
];
|
||||
}
|
||||
|
||||
} else {
|
||||
if($current_tpa_id != "" && $current_tpa_id != null){
|
||||
$tpa_id_all[$current_tpa_id][] = $key;
|
||||
}
|
||||
} else {
|
||||
if($current_tpa_id != "" && $current_tpa_id != null){
|
||||
$tpa_id_all[$current_tpa_id][] = $key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--- TPA ID Duplicate check end ---
|
||||
|
||||
if ($insurer_or_tpa == 'tpa') {
|
||||
if ($insurer_or_tpa == 'tpa' && in_array($client_policy_data['policy_type_id'], [1,2,3,4,5])) {
|
||||
|
||||
if ($excel_data[$key][13] === null) {
|
||||
$missing_id[$key][] = [
|
||||
@ -1688,7 +1716,7 @@ class EmpDataServiceController extends BaseController
|
||||
];
|
||||
}
|
||||
|
||||
if ($insurer_or_tpa == 'tpa') {
|
||||
if ($insurer_or_tpa == 'tpa' && in_array($client_policy_data['policy_type_id'], [1,2,3,4,5])) {
|
||||
|
||||
if ($emp_value['uhid'] != $excel_data[$key][14]) {
|
||||
$errors[$key][] = [
|
||||
@ -1699,7 +1727,7 @@ class EmpDataServiceController extends BaseController
|
||||
];
|
||||
}
|
||||
|
||||
} else if ($insurer_or_tpa == 'insurer') {
|
||||
} else if ($insurer_or_tpa == 'insurer' && in_array($client_policy_data['policy_type_id'], [1,2,3,4,5])) {
|
||||
|
||||
if ($emp_value['tpa_id'] != $excel_data[$key][13]) {
|
||||
$errors[$key][] = [
|
||||
|
||||
@ -302,9 +302,11 @@ class EmployeeController extends AdminController
|
||||
//for TPA/insurer upload
|
||||
$data['events'] = ['inception' => 'Inception (Employee + Dependents)', 'missed_inception' => 'Missed Inception (Employee + Dependents)', 'addition' => 'Addition (Employee + Dependents)', 'dependent_addition' => 'Dependent Addition (Only Dependents)', 'deletion' => 'Deletion', 'correction' => 'Correction', 'si_enhancement' => 'SI Enhancement'];
|
||||
//for inception upload
|
||||
$data['actions'] = ['inception' => 'Inception (Employee + Dependents)', 'missed_inception' => 'Missed Inception (Employee + Dependents)', 'addition' => 'Addition (Employee + Dependents)', 'dependent_addition' => 'Dependent Addition (Only Dependents)', 'deletion' => 'Deletion', 'correction' => 'Correction', 'si_enhancement' => 'SI Enhancement','enrollment' => 'Enrolment'];
|
||||
|
||||
$data['import_or_export'] = ['import' => 'Import', 'export' => 'Export'];
|
||||
$data['actions'] = ['inception' => 'Inception (Employee + Dependents)', 'missed_inception' => 'Missed Inception (Employee + Dependents)', 'addition' => 'Addition (Employee + Dependents)', 'dependent_addition' => 'Dependent Addition (Only Dependents)', 'deletion' => 'Deletion', 'correction' => 'Correction', 'si_enhancement' => 'SI Enhancement'];
|
||||
// $data['actions'] = ['inception' => 'Inception (Employee + Dependents)', 'missed_inception' => 'Missed Inception (Employee + Dependents)', 'addition' => 'Addition (Employee + Dependents)', 'dependent_addition' => 'Dependent Addition (Only Dependents)', 'deletion' => 'Deletion', 'correction' => 'Correction', 'si_enhancement' => 'SI Enhancement','enrollment' => 'Enrolment'];
|
||||
|
||||
// $data['import_or_export'] = ['import' => 'Import', 'export' => 'Export'];
|
||||
$data['import_or_export'] = ['import' => 'Upload', 'export' => 'Download'];
|
||||
$data['insurer_or_tpa'] = ['insurer' => 'Insurer', 'tpa' => 'TPA'];
|
||||
|
||||
// $data['fileList'] = $this->fileModel
|
||||
|
||||
@ -1319,6 +1319,7 @@ class EmployeeServiceController extends AdminController
|
||||
//get file name
|
||||
$file_id = $params['file_id'];
|
||||
$file = $this->fileModel->find($file_id);
|
||||
// dd($file);
|
||||
|
||||
$file_name_with_path = WRITEPATH."/uploads/excel/".$file['file_name'];
|
||||
|
||||
@ -1330,6 +1331,7 @@ class EmployeeServiceController extends AdminController
|
||||
$excel_data = $sheet->rangeToArray('A1:' . $allowedHighestColumn['col_cell_name'] . $highestRowAndColumn['row']);
|
||||
// $excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
||||
|
||||
// dd($excel_data);
|
||||
unset($excel_data[0]);
|
||||
// kint::dump($excel_data);
|
||||
$endorsement_data = [];
|
||||
@ -1379,10 +1381,14 @@ class EmployeeServiceController extends AdminController
|
||||
->where('employee_polices.client_policy_id',$file['policy_id'])
|
||||
->where('employees.emp_status !=','truncated')
|
||||
->where('employees.is_active', 1)
|
||||
->where('employee_polices.status !=','truncated')
|
||||
->where('employee_polices.is_active', 1)
|
||||
->first();
|
||||
|
||||
// $employee = $this->employeeModel->where('emp_code', $row[1])->where('name',$row[2])->where('client_id',$file['client_id'])->first();
|
||||
// dd($employee);
|
||||
// kint::dump($employee);
|
||||
|
||||
if(is_array($employee) && count($employee))
|
||||
{
|
||||
// dd($employee);
|
||||
@ -1406,7 +1412,13 @@ class EmployeeServiceController extends AdminController
|
||||
|
||||
if(!in_array($employee['id'],$endorsement_data))//make entry in endorsement firsttime only with checking that PK of emp exisintg in variable $endorsement_data
|
||||
{
|
||||
$employee_policy = $this->employeePolicyModel->where('employee_id',$employee['id'])->where('client_policy_id',$file['policy_id'])->first();
|
||||
$employee_policy = $this->employeePolicyModel
|
||||
->where('employee_id',$employee['id'])
|
||||
->where('client_policy_id',$file['policy_id'])
|
||||
->where('status !=','truncated')
|
||||
->where('is_active', 1)
|
||||
->first();
|
||||
|
||||
$data = ['emp_id' => $employee['id'],'name' => $employee['name'],'emp_status' => $employee['emp_status'],'emp_policy_id' => $employee_policy['id'],'emp_code' => $employee['emp_code'],'change_event' => $employee['change_event'],'date_of_exit' => $employee_policy['date_of_exit'],'reason_for_exit' => $employee_policy['reason_for_exit'],'status' => $employee_policy['status'],'claim_status' => $employee_policy['claim_status']];
|
||||
$endorsement($data,$file,$row);
|
||||
$endorsement_data[] = $employee['id'];
|
||||
@ -1447,7 +1459,7 @@ class EmployeeServiceController extends AdminController
|
||||
|
||||
//set success msg to pull notifications
|
||||
$this->setPullNotification($this->getFileMetaDataByFileId($file_id,'success'));
|
||||
return $endorsement_data;
|
||||
return $endorsement_data;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -207,6 +207,8 @@ class LeadsController extends BaseController
|
||||
private function prepareLeadData()
|
||||
{
|
||||
$data = $this->request->getPost();
|
||||
$data['client_type'] = 1;
|
||||
$data['pan'] = "";
|
||||
|
||||
if ($data['lead_type'] != 1) {
|
||||
$client_data = $this->clientModel->where('id', $data['client_id'])->where('is_active', 1)->first();
|
||||
|
||||
@ -1225,53 +1225,204 @@ class MasterController extends AdminController
|
||||
$data['page_name'] = 'CD Master List';
|
||||
$data['CD_Master_Data'] = $this->CDMasterModel->getCDMasterList();
|
||||
$data['insurers'] = $this->insurerModel->where('is_active', 1)->findAll();
|
||||
$data['insurer_branch'] = $this->insurerBranchModel->where('is_active', 1)->findAll();
|
||||
$data['clients'] = $this->clientModel->where('is_active', 1)->findAll();
|
||||
$this->loadLayout('cd_master_list', $data);
|
||||
}
|
||||
|
||||
public function createCDMasterData()
|
||||
{
|
||||
// public function createCDMasterData()
|
||||
// {
|
||||
|
||||
// $data = $this->request->getPost();
|
||||
// $id = $data['PrimaryKey'];
|
||||
// $date = (string) $this->request->getPost('opening_date');
|
||||
// $data['opening_date'] = date('Y-m-d', strtotime($date));
|
||||
// // print_rr($data);die();
|
||||
|
||||
// $loggedInUserID = get_session_userid();
|
||||
|
||||
// if (empty($id)) {
|
||||
|
||||
// if ($data) {
|
||||
|
||||
// $insert = $this->CDMasterModel->insert($data);
|
||||
|
||||
// if ($insert) {
|
||||
|
||||
// // Prepare the array with data
|
||||
// $cd_tranction_data = [
|
||||
// 'amount' => $data['opening_bal'],
|
||||
// 'sub_type_id' => 7,
|
||||
// 'client_id' => $data['client_id'],
|
||||
// 'client_policy_id' => null,
|
||||
// 'cd_ac_no' => $data['cd_ac_no'],
|
||||
// 'endorsement_no' => null,
|
||||
// 'insurer_id' => $data['insurer_id'],
|
||||
// 'description' => 'opening Amount',
|
||||
// 'transaction_type' => 'Credit',
|
||||
// 'event_name' => null,
|
||||
// 'updated_by' => 1,
|
||||
// ];
|
||||
|
||||
// $cd_tranction_data['cd_ac_pk'] = $this->CDMasterModel->insertID();
|
||||
// $response = DepositHelper::saveDeposit($cd_tranction_data, $loggedInUserID);
|
||||
|
||||
// session()->setFlashdata('success', "Cash Deposite Master Added Successfully");
|
||||
// return redirect()->to(base_url('/master/cash_deposite/list'));
|
||||
// } else {
|
||||
|
||||
// session()->setFlashdata('error', "Cash Deposite Master Added Failed");
|
||||
// return redirect()->to(base_url('/master/cash_deposite/list'));
|
||||
// }
|
||||
// } else {
|
||||
|
||||
// session()->setFlashdata('error', "Cash Deposite Master Added Failed. Data Not Found");
|
||||
// return redirect()->to(base_url('/master/cash_deposite/list'));
|
||||
// }
|
||||
|
||||
// } else {
|
||||
|
||||
// if ($data) {
|
||||
|
||||
// $insert = $this->CDMasterModel->where('id', $id)->set($data)->update();
|
||||
|
||||
// $data = $this->CDMasterModel->where('id', $id)->first();
|
||||
|
||||
// $cd_transaction_updated_data = [
|
||||
// 'balance' => $data['opening_bal'],
|
||||
// 'amount' => $data['opening_bal']
|
||||
// ];
|
||||
|
||||
// $cd_tranction = $this->clientDepositModel
|
||||
// ->where('client_id', $data['client_id'])
|
||||
// ->where('insurer_id', $data['insurer_id'])
|
||||
// ->where('cd_ac_no', $data['cd_ac_no'])
|
||||
// ->where('sub_type', 7)
|
||||
// ->set($cd_transaction_updated_data)->update();
|
||||
|
||||
// if ($insert) {
|
||||
|
||||
// session()->setFlashdata('success', "Cash Deposite Master Updated Successfully");
|
||||
// return redirect()->to(base_url('/master/cash_deposite/list'));
|
||||
// } else {
|
||||
|
||||
// session()->setFlashdata('error', "Cash Deposite Master Update Failed");
|
||||
// return redirect()->to(base_url('/master/cash_deposite/list'));
|
||||
// }
|
||||
// } else {
|
||||
|
||||
// session()->setFlashdata('error', "Cash Deposite Master Update Failed. Data Not Found");
|
||||
// return redirect()->to(base_url('/master/cash_deposite/list'));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
public function createCDMasterData()
|
||||
{
|
||||
$this->myLogger->logme("error", 'Create CD Master Data API called.');
|
||||
$data = $this->request->getPost();
|
||||
$date = (string) $this->request->getPost('opening_date');
|
||||
$this->myLogger->logme("error", 'Received POST data: ' . json_encode($data));
|
||||
|
||||
$id = $data['PrimaryKey'] ?? null;
|
||||
$date = (string) ($data['opening_date'] ?? '');
|
||||
$data['opening_date'] = date('Y-m-d', strtotime($date));
|
||||
// print_rr($data);die();
|
||||
// Prepare the array with data
|
||||
$cd_tranction_data = [
|
||||
'amount' => $data['opening_bal'],
|
||||
'sub_type_id' => 7,
|
||||
'client_id' => $data['client_id'],
|
||||
'client_policy_id' => null,
|
||||
'cd_ac_no' => $data['cd_ac_no'],
|
||||
'endorsement_no' => null,
|
||||
'insurer_id' => $data['insurer_id'],
|
||||
'description' => 'opening Amount',
|
||||
'transaction_type' => 'Credit',
|
||||
'event_name' => null,
|
||||
'updated_by' => 1,
|
||||
];
|
||||
$this->myLogger->logme("error", 'Formatted opening_date: ' . $data['opening_date']);
|
||||
|
||||
$loggedInUserID = get_session_userid();
|
||||
|
||||
if ($data) {
|
||||
$this->myLogger->logme("error", 'Logged in user ID: ' . $loggedInUserID);
|
||||
|
||||
// === INSERT ===
|
||||
if (empty($id)) {
|
||||
|
||||
$this->myLogger->logme("error", 'Performing INSERT operation.');
|
||||
$insert = $this->CDMasterModel->insert($data);
|
||||
$this->myLogger->logme("error", 'Insert result: ' . json_encode($insert));
|
||||
|
||||
if ($insert) {
|
||||
$cd_tranction_data['cd_ac_pk'] = $this->CDMasterModel->insertID();
|
||||
$response = DepositHelper::saveDeposit($cd_tranction_data, $loggedInUserID);
|
||||
|
||||
session()->setFlashdata('success', "Cash Deposite Master Added Successfully");
|
||||
return redirect()->to(base_url('/master/cash_deposite/list'));
|
||||
$cd_tranction_data = [
|
||||
'amount' => $data['opening_bal'],
|
||||
'sub_type_id' => 7,
|
||||
'client_id' => $data['client_id'],
|
||||
'client_policy_id' => null,
|
||||
'cd_ac_no' => $data['cd_ac_no'],
|
||||
'endorsement_no' => null,
|
||||
'insurer_id' => $data['insurer_id'],
|
||||
'description' => 'Opening Amount',
|
||||
'transaction_type' => 'Credit',
|
||||
'event_name' => null,
|
||||
'updated_by' => 1,
|
||||
'cd_ac_pk' => $insert,
|
||||
];
|
||||
|
||||
$this->myLogger->logme("error", 'Saving initial deposit with data: ' . json_encode($cd_tranction_data));
|
||||
$response = DepositHelper::saveDeposit($cd_tranction_data, $loggedInUserID);
|
||||
$this->myLogger->logme("error", 'Deposit save response: ' . json_encode($response));
|
||||
|
||||
$cd_master_data = $this->CDMasterModel->where('is_active', 1)->where('id', $insert)->first();
|
||||
$this->myLogger->logme("error", 'Inserted CD Master data: ' . json_encode($cd_master_data));
|
||||
|
||||
$cd_master_full_data = $this->CDMasterModel->where('is_active', 1)
|
||||
->where('client_id', $data['client_id'])
|
||||
->where('insurer_id', $data['insurer_id'])
|
||||
->where('insurer_branch_id', $data['insurer_branch_id'])
|
||||
->findAll();
|
||||
|
||||
return $this->respond([
|
||||
'status' => true,
|
||||
'code' => 500,
|
||||
'message' => "CD Master Added Successfully",
|
||||
'cd_master_data' => $cd_master_data,
|
||||
'data' => $cd_master_full_data
|
||||
]);
|
||||
|
||||
} else {
|
||||
|
||||
session()->setFlashdata('error', "Cash Deposite Master Added Failed");
|
||||
return redirect()->to(base_url('/master/cash_deposite/list'));
|
||||
$this->myLogger->logme('error', 'CD Master Insert Failed.');
|
||||
return $this->respond([
|
||||
'status' => true,
|
||||
'code' => 500,
|
||||
'message' => "CD Master Add Failed",
|
||||
], 200);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
session()->setFlashdata('error', "Cash Deposite Master Added Failed. Data Not Found");
|
||||
return redirect()->to(base_url('/master/cash_deposite/list'));
|
||||
// === UPDATE ===
|
||||
$this->myLogger->logme("error", 'Performing UPDATE operation for ID: ' . $id);
|
||||
|
||||
$updated = $this->CDMasterModel->where('id', $id)->set($data)->update();
|
||||
$this->myLogger->logme("error", 'Update result: ' . json_encode($updated));
|
||||
|
||||
$existingData = $this->CDMasterModel->where('is_active', 1)->where('id', $id)->first();
|
||||
$this->myLogger->logme("error", 'Existing data after update: ' . json_encode($existingData));
|
||||
|
||||
$cd_transaction_updated_data = [
|
||||
'balance' => $existingData['opening_bal'],
|
||||
'amount' => $existingData['opening_bal']
|
||||
];
|
||||
|
||||
$updateDeposit =$this->clientDepositModel
|
||||
->where('client_id', $existingData['client_id'])
|
||||
->where('insurer_id', $existingData['insurer_id'])
|
||||
->where('cd_ac_no', $existingData['cd_ac_no'])
|
||||
->where('sub_type', 7)
|
||||
->set($cd_transaction_updated_data)
|
||||
->update();
|
||||
$this->myLogger->logme("error", 'Client Deposit Update result: ' . json_encode($updateDeposit));
|
||||
|
||||
if ($updated) {
|
||||
$this->myLogger->logme("error", 'CD Master Updated Successfully.');
|
||||
return $this->respond([
|
||||
'status' => true,
|
||||
'message' => "CD Master Updated Successfully"
|
||||
]);
|
||||
} else {
|
||||
$this->myLogger->logme('error', 'CD Master Update Failed.');
|
||||
return $this->respond([
|
||||
'status' => true,
|
||||
'code' => 500,
|
||||
'message' => "CD Master Updated Failed",
|
||||
], 200);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1598,7 +1749,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function generateNewGmailAPIToken()
|
||||
{
|
||||
$gmailapi = \Config\Services::gmailapi();
|
||||
@ -1609,49 +1759,46 @@ class MasterController extends AdminController
|
||||
//testing a sample mail from front end
|
||||
public function testGmailAPI()
|
||||
{
|
||||
|
||||
if ($this->request->getMethod() == 'post') {
|
||||
// $gmailapi = \Config\Services::gmailapi();
|
||||
|
||||
$to = $this->request->getPost('to');
|
||||
$subject = $this->request->getPost('subject');
|
||||
$mail_content = $this->request->getPost('content');
|
||||
$common = ['mail_type'=>'test_mail_ui'];
|
||||
/*****CHOOSE ANY ONE AT A TIME, COMMENT ANOTHER ONE******/
|
||||
if ($this->request->getMethod() == 'post') {
|
||||
// $gmailapi = \Config\Services::gmailapi();
|
||||
|
||||
/*****CALLING DIRECLT USING LIB******/
|
||||
// $res = $gmailapi->sendMessage($to, $subject, $mail_content, 'info@nhanceindia.in', 'info@nhanceindia.in', $cc = [], $bcc = []);
|
||||
$to = $this->request->getPost('to');
|
||||
$subject = $this->request->getPost('subject');
|
||||
$mail_content = $this->request->getPost('content');
|
||||
$common = ['mail_type' => 'test_mail_ui'];
|
||||
/*****CHOOSE ANY ONE AT A TIME, COMMENT ANOTHER ONE******/
|
||||
|
||||
// if($res['status'])
|
||||
// {
|
||||
// return $this->respond(['status' => 'success','code' => 200,'data' => $res],200);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $this->respond(['status' => 'failed','code' => 500,'data' => $res],200);
|
||||
// }
|
||||
/*****CALLING DIRECLT USING LIB******/
|
||||
/*****CALLING DIRECLT USING LIB******/
|
||||
// $res = $gmailapi->sendMessage($to, $subject, $mail_content, 'info@nhanceindia.in', 'info@nhanceindia.in', $cc = [], $bcc = []);
|
||||
|
||||
/*****CALLING VIA MAIL HELPER******/
|
||||
$res = MailHelper::send_email(['mail' => $to, 'subject' => $subject,'common'=>$common ,'message' => $mail_content]);
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $res],200);
|
||||
/*****CALLING VIA MAIL HELPER******/
|
||||
// if($res['status'])
|
||||
// {
|
||||
// return $this->respond(['status' => 'success','code' => 200,'data' => $res],200);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $this->respond(['status' => 'failed','code' => 500,'data' => $res],200);
|
||||
// }
|
||||
/*****CALLING DIRECLT USING LIB******/
|
||||
|
||||
}
|
||||
/*****CALLING VIA MAIL HELPER******/
|
||||
$res = MailHelper::send_email(['mail' => $to, 'subject' => $subject, 'common' => $common, 'message' => $mail_content]);
|
||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $res], 200);
|
||||
/*****CALLING VIA MAIL HELPER******/
|
||||
}
|
||||
|
||||
$this->loadLayout('mail_test');
|
||||
|
||||
}
|
||||
|
||||
|
||||
//testing a sample mail from cli
|
||||
|
||||
//testing a sample mail from cli
|
||||
public function testGmailAPIViaCLI(string $email_id = 'velmurugan.s@venbainfotech.com')
|
||||
{
|
||||
|
||||
|
||||
$email_id = CLI::getOption('to') ? CLI::getOption('to') : $email_id;
|
||||
// print_r($email_id);die();
|
||||
// $gmailapi = \Config\Services::gmailapi();
|
||||
$message = '<style>body{font-family:Arial,sans-serif;color:#333;line-height:1.6;margin:0;padding:0}.email-container{width:100%;max-width:600px;margin:0 auto;padding:20px;border:1px solid #e0e0e0;background-color:#f9f9f9}.header{background-color:#4a90e2;color:#fff;padding:15px;text-align:center}.header h1{margin:0;font-size:24px}.content{padding:20px;background-color:#fff}.content h2{color:#4a90e2;font-size:20px;margin-top:0}.content p{margin:10px 0}.details-table{width:100%;border-collapse:collapse;margin-top:20px}.details-table td,.details-table th{border:1px solid #ddd;padding:10px;text-align:left}.details-table th{background-color:#f2f2f2}.footer{margin-top:20px;font-size:12px;color:#777;text-align:center}.attachment-note{margin-top:20px;padding:10px;background-color:#f7f7f7;border-left:4px solid #4a90e2;font-style:italic}</style><div class=email-container><div class=header><h1>Request for Quotation (RFQ)</h1></div><div class=content><h2>Dear {{RECIPIENT_NAME}},</h2><p>We are reaching out to request a quotation for the following insurance coverage. Please review the details below and provide your quote at your earliest convenience.<h2>RFQ Details</h2><table class=details-table><tr><th>Client name<td>{{CLIENT_NAME}}<tr><th>Coverage Type<td>{{POLICY_LONG_NAME}}<tr><th>Policy Start Date<td>{{POLICY_START_DATE}}<tr><th>Policy Duration<td>{{DURATION}}</table><div class=attachment-note>Please note: Additional terms and details are included in the attachment for your reference.</div><p>Please feel free to reach out if you require any further information to prepare the quote. We look forward to receiving your proposal.<p>Best regards,<p><strong>Nhance India Pvt Ltd</strong><br></div><div class=footer><p>© Nhance India Pvt Ltd. All rights reserved.</div></div>';
|
||||
// $gmailapi = \Config\Services::gmailapi();
|
||||
$message = '<style>body{font-family:Arial,sans-serif;color:#333;line-height:1.6;margin:0;padding:0}.email-container{width:100%;max-width:600px;margin:0 auto;padding:20px;border:1px solid #e0e0e0;background-color:#f9f9f9}.header{background-color:#4a90e2;color:#fff;padding:15px;text-align:center}.header h1{margin:0;font-size:24px}.content{padding:20px;background-color:#fff}.content h2{color:#4a90e2;font-size:20px;margin-top:0}.content p{margin:10px 0}.details-table{width:100%;border-collapse:collapse;margin-top:20px}.details-table td,.details-table th{border:1px solid #ddd;padding:10px;text-align:left}.details-table th{background-color:#f2f2f2}.footer{margin-top:20px;font-size:12px;color:#777;text-align:center}.attachment-note{margin-top:20px;padding:10px;background-color:#f7f7f7;border-left:4px solid #4a90e2;font-style:italic}</style><div class=email-container><div class=header><h1>Request for Quotation (RFQ)</h1></div><div class=content><h2>Dear {{RECIPIENT_NAME}},</h2><p>We are reaching out to request a quotation for the following insurance coverage. Please review the details below and provide your quote at your earliest convenience.<h2>RFQ Details</h2><table class=details-table><tr><th>Client name<td>{{CLIENT_NAME}}<tr><th>Coverage Type<td>{{POLICY_LONG_NAME}}<tr><th>Policy Start Date<td>{{POLICY_START_DATE}}<tr><th>Policy Duration<td>{{DURATION}}</table><div class=attachment-note>Please note: Additional terms and details are included in the attachment for your reference.</div><p>Please feel free to reach out if you require any further information to prepare the quote. We look forward to receiving your proposal.<p>Best regards,<p><strong>Nhance India Pvt Ltd</strong><br></div><div class=footer><p>© Nhance India Pvt Ltd. All rights reserved.</div></div>';
|
||||
|
||||
// $attachments = [
|
||||
// ["filePath" => WRITEPATH."uploads/excel/sample/correction.xls","fileName" => "correction.xls"],
|
||||
@ -1661,34 +1808,34 @@ class MasterController extends AdminController
|
||||
// ];
|
||||
|
||||
$attachments = [
|
||||
["filePath" => ROOTPATH."public/sample_excel/sample_addition.xls","fileName" => "sample_addition.xls"],
|
||||
["filePath" => ROOTPATH."public/sample_excel/sample_inception.xls","fileName" => "sample_inception.xls"],
|
||||
["filePath" => ROOTPATH."public/assets/images/login_bg.jpg","fileName" => "login_bg.jpg"]
|
||||
["filePath" => ROOTPATH . "public/sample_excel/sample_addition.xls", "fileName" => "sample_addition.xls"],
|
||||
["filePath" => ROOTPATH . "public/sample_excel/sample_inception.xls", "fileName" => "sample_inception.xls"],
|
||||
["filePath" => ROOTPATH . "public/assets/images/login_bg.jpg", "fileName" => "login_bg.jpg"]
|
||||
];
|
||||
$common = ['mail_type'=>'test_mail_cli'];
|
||||
$common = ['mail_type' => 'test_mail_cli'];
|
||||
$email_id = CLI::getOption('to') ? CLI::getOption('to') : $email_id;
|
||||
$res = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Mail Via CLI', 'message' => $message,'attachments' => $attachments,'common'=>$common]);
|
||||
echo "Inside the master controller";
|
||||
print_r($res);
|
||||
|
||||
$res = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Mail Via CLI', 'message' => $message, 'attachments' => $attachments, 'common' => $common]);
|
||||
echo "Inside the master controller";
|
||||
print_r($res);
|
||||
}
|
||||
|
||||
public function testZeptoSMTP() {
|
||||
public function testZeptoSMTP()
|
||||
{
|
||||
$message = '<style>body{font-family:Arial,sans-serif;color:#333;line-height:1.6;margin:0;padding:0}.email-container{width:100%;max-width:600px;margin:0 auto;padding:20px;border:1px solid #e0e0e0;background-color:#f9f9f9}.header{background-color:#4a90e2;color:#fff;padding:15px;text-align:center}.header h1{margin:0;font-size:24px}.content{padding:20px;background-color:#fff}.content h2{color:#4a90e2;font-size:20px;margin-top:0}.content p{margin:10px 0}.details-table{width:100%;border-collapse:collapse;margin-top:20px}.details-table td,.details-table th{border:1px solid #ddd;padding:10px;text-align:left}.details-table th{background-color:#f2f2f2}.footer{margin-top:20px;font-size:12px;color:#777;text-align:center}.attachment-note{margin-top:20px;padding:10px;background-color:#f7f7f7;border-left:4px solid #4a90e2;font-style:italic}</style><div class=email-container><div class=header><h1>Request for Quotation (RFQ)</h1></div><div class=content><h2>Dear {{RECIPIENT_NAME}},</h2><p>We are reaching out to request a quotation for the following insurance coverage. Please review the details below and provide your quote at your earliest convenience.<h2>RFQ Details</h2><table class=details-table><tr><th>Client name<td>{{CLIENT_NAME}}<tr><th>Coverage Type<td>{{POLICY_LONG_NAME}}<tr><th>Policy Start Date<td>{{POLICY_START_DATE}}<tr><th>Policy Duration<td>{{DURATION}}</table><div class=attachment-note>Please note: Additional terms and details are included in the attachment for your reference.</div><p>Please feel free to reach out if you require any further information to prepare the quote. We look forward to receiving your proposal.<p>Best regards,<p><strong>Nhance India Pvt Ltd</strong><br></div><div class=footer><p>© Nhance India Pvt Ltd. All rights reserved.</div></div>';
|
||||
$attachments = [
|
||||
["filePath" => ROOTPATH."public/sample_excel/sample_addition.xls","fileName" => "sample_addition.xls"],
|
||||
["filePath" => ROOTPATH."public/sample_excel/sample_inception.xls","fileName" => "sample_inception.xls"],
|
||||
["filePath" => ROOTPATH."public/assets/images/login_bg.jpg","fileName" => "login_bg.jpg"]
|
||||
["filePath" => ROOTPATH . "public/sample_excel/sample_addition.xls", "fileName" => "sample_addition.xls"],
|
||||
["filePath" => ROOTPATH . "public/sample_excel/sample_inception.xls", "fileName" => "sample_inception.xls"],
|
||||
["filePath" => ROOTPATH . "public/assets/images/login_bg.jpg", "fileName" => "login_bg.jpg"]
|
||||
];
|
||||
$email_id = ['srinivas.saravanan@venbainfotech.com','srinivassaravanan2002@gmail.com'];
|
||||
$params = ['mail'=>$email_id];
|
||||
$common = ['mail_type'=>'test_mail_cli'];
|
||||
$email_id = ['srinivas.saravanan@venbainfotech.com', 'srinivassaravanan2002@gmail.com'];
|
||||
$params = ['mail' => $email_id];
|
||||
$common = ['mail_type' => 'test_mail_cli'];
|
||||
// $bcc = "vijayalakshmi@nhanceindia.in,vitvelz@gmail.com,velmurugan.s@venbainfotech.com,hariharan@nhanceindia.in,hariharan@jubiliant.in,srinivas.saravanan@venbainfotech.com";
|
||||
// Send email and get response
|
||||
$result = MailHelper::send_email(['mail' => $email_id, 'params'=>$params,'subject' => 'Mail Via CLI','message' => $message,'attachments' => $attachments,'common'=>$common]);
|
||||
|
||||
$result = MailHelper::send_email(['mail' => $email_id, 'params' => $params, 'subject' => 'Mail Via CLI', 'message' => $message, 'attachments' => $attachments, 'common' => $common]);
|
||||
|
||||
log_message('error',json_encode($result));
|
||||
|
||||
log_message('error', json_encode($result));
|
||||
// Format the response for display/debugging
|
||||
$response = [
|
||||
'success' => $result['success'] ?? false,
|
||||
@ -1703,15 +1850,16 @@ class MasterController extends AdminController
|
||||
// Return JSON response
|
||||
return $this->response->setJSON($result);
|
||||
}
|
||||
|
||||
public function testCheckBounceMails()
|
||||
{
|
||||
$gmailapi = \Config\Services::gmailapi();
|
||||
$from_date = CLI::getOption('from') ? CLI::getOption('from') : null;
|
||||
$to_date = CLI::getOption('to') ? CLI::getOption('to') : null;
|
||||
$count = CLI::getOption('count') ? CLI::getOption('count') : null;
|
||||
$page = CLI::getOption('page') ? CLI::getOption('page') : null;
|
||||
$res = $gmailapi->checkBounceStatus(from_date:$from_date,to_date:$to_date,count:$count,page:$page);
|
||||
print_r($res);
|
||||
$gmailapi = \Config\Services::gmailapi();
|
||||
$from_date = CLI::getOption('from') ? CLI::getOption('from') : null;
|
||||
$to_date = CLI::getOption('to') ? CLI::getOption('to') : null;
|
||||
$count = CLI::getOption('count') ? CLI::getOption('count') : null;
|
||||
$page = CLI::getOption('page') ? CLI::getOption('page') : null;
|
||||
$res = $gmailapi->checkBounceStatus(from_date: $from_date, to_date: $to_date, count: $count, page: $page);
|
||||
print_r($res);
|
||||
}
|
||||
|
||||
public function appCheckList()
|
||||
@ -1721,7 +1869,6 @@ class MasterController extends AdminController
|
||||
$this->checkGoogleOAuthCredentialsinDB();
|
||||
$this->getCronJobsList();
|
||||
$this->checkGdriveRootFolderID();
|
||||
|
||||
}
|
||||
|
||||
public function checkAndCreateDirectories()
|
||||
@ -1740,7 +1887,7 @@ class MasterController extends AdminController
|
||||
'tmp' => WRITEPATH . 'tmp/',
|
||||
'e_card_imgs' => ROOTPATH . 'public/e_card_imgs',
|
||||
'uploads' => ROOTPATH . 'public/uploads',
|
||||
'add_image_upload' => ROOTPATH . 'public/uploads/add_image_upload/',//adverdisement images for enrollment app
|
||||
'add_image_upload' => ROOTPATH . 'public/uploads/add_image_upload/', //adverdisement images for enrollment app
|
||||
'logo' => ROOTPATH . 'public/uploads/logo/',
|
||||
'template_bg' => ROOTPATH . 'public/uploads/template_bg/',
|
||||
'attachments' => WRITEPATH . 'uploads/attachments/',
|
||||
@ -1776,21 +1923,18 @@ class MasterController extends AdminController
|
||||
|
||||
echo "################ CHECKING GMAIL OAUTH FOR EMAIL ###################\n";
|
||||
if (is_array($token) && is_null($token['gmail_api_oauth_credentials'])) {
|
||||
|
||||
|
||||
echo "Email OAuth credentials not found in database.\n";
|
||||
echo "Check the following..!\n";
|
||||
echo "1. Update Gmail Oauth credentials in 'gmail_api_oauth_credentials' field in 'settings' table in JSON format.\n";
|
||||
echo "2. Call this cli route to generate new access token: 'php public/index.php cli/new_gmail_token' from root of the project.\n";
|
||||
echo "3. Call this cli route : 'php public/index.php cli/send_mail_cli --to someone@gmail.com' to send test mail to testGmailAPIViaCLI ( replace someone@gmail.com with real time mail).\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
echo "Gmail OAuth for sending email is set in DB\n";
|
||||
}
|
||||
echo "################################################################\n\n";
|
||||
}
|
||||
|
||||
|
||||
function getCronJobsList()
|
||||
{
|
||||
// Execute the shell command to get cron jobs
|
||||
@ -1806,7 +1950,7 @@ class MasterController extends AdminController
|
||||
} elseif ($output) {
|
||||
// Return the cron job list
|
||||
echo nl2br($output);
|
||||
echo "\n" ;// Convert newlines to <br> for easier HTML rendering
|
||||
echo "\n"; // Convert newlines to <br> for easier HTML rendering
|
||||
} else {
|
||||
echo "Error retrieving cron jobs or no cron jobs set.\n";
|
||||
}
|
||||
@ -1818,13 +1962,10 @@ class MasterController extends AdminController
|
||||
{
|
||||
echo "#################### CHECKING GDRIVE FOLDER ID IN ENV FILE ############################\n";
|
||||
$id = getenv('GDRIVE_ROOT_FOLDER_ID');
|
||||
if($id)
|
||||
{
|
||||
echo $this->cli_colors['green'] . "ID is :". $id . $this->cli_colors['reset']. "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $this->cli_colors['red'] ."Gdrive Folder id not set in env file. set it under 'GDRIVE_ROOT_FOLDER_ID' in env file.". $this->cli_colors['reset'] ."\n";
|
||||
if ($id) {
|
||||
echo $this->cli_colors['green'] . "ID is :" . $id . $this->cli_colors['reset'] . "\n";
|
||||
} else {
|
||||
echo $this->cli_colors['red'] . "Gdrive Folder id not set in env file. set it under 'GDRIVE_ROOT_FOLDER_ID' in env file." . $this->cli_colors['reset'] . "\n";
|
||||
}
|
||||
echo "################################################################\n\n";
|
||||
}
|
||||
@ -1834,16 +1975,16 @@ class MasterController extends AdminController
|
||||
|
||||
$message = '<style>body{font-family:Arial,sans-serif;color:#333;line-height:1.6;margin:0;padding:0}.email-container{width:100%;max-width:600px;margin:0 auto;padding:20px;border:1px solid #e0e0e0;background-color:#f9f9f9}.header{background-color:#4a90e2;color:#fff;padding:15px;text-align:center}.header h1{margin:0;font-size:24px}.content{padding:20px;background-color:#fff}.content h2{color:#4a90e2;font-size:20px;margin-top:0}.content p{margin:10px 0}.details-table{width:100%;border-collapse:collapse;margin-top:20px}.details-table td,.details-table th{border:1px solid #ddd;padding:10px;text-align:left}.details-table th{background-color:#f2f2f2}.footer{margin-top:20px;font-size:12px;color:#777;text-align:center}.attachment-note{margin-top:20px;padding:10px;background-color:#f7f7f7;border-left:4px solid #4a90e2;font-style:italic}</style><div class=email-container><div class=header><h1>Request for Quotation (RFQ)</h1></div><div class=content><h2>Dear {{RECIPIENT_NAME}},</h2><p>We are reaching out to request a quotation for the following insurance coverage. Please review the details below and provide your quote at your earliest convenience.<h2>RFQ Details</h2><table class=details-table><tr><th>Client name<td>{{CLIENT_NAME}}<tr><th>Coverage Type<td>{{POLICY_LONG_NAME}}<tr><th>Policy Start Date<td>{{POLICY_START_DATE}}<tr><th>Policy Duration<td>{{DURATION}}</table><div class=attachment-note>Please note: Additional terms and details are included in the attachment for your reference.</div><p>Please feel free to reach out if you require any further information to prepare the quote. We look forward to receiving your proposal.<p>Best regards,<p><strong>Nhance India Pvt Ltd</strong><br></div><div class=footer><p>© Nhance India Pvt Ltd. All rights reserved.</div></div>';
|
||||
$attachments = [
|
||||
["filePath" => ROOTPATH."public/sample_excel/sample_addition.xls","fileName" => "sample_addition.xls"],
|
||||
["filePath" => ROOTPATH."public/sample_excel/sample_inception.xls","fileName" => "sample_inception.xls"],
|
||||
["filePath" => ROOTPATH."public/assets/images/login_bg.jpg","fileName" => "login_bg.jpg"]
|
||||
["filePath" => ROOTPATH . "public/sample_excel/sample_addition.xls", "fileName" => "sample_addition.xls"],
|
||||
["filePath" => ROOTPATH . "public/sample_excel/sample_inception.xls", "fileName" => "sample_inception.xls"],
|
||||
["filePath" => ROOTPATH . "public/assets/images/login_bg.jpg", "fileName" => "login_bg.jpg"]
|
||||
];
|
||||
$email_id = 'venkateshraman786@gmail.com';
|
||||
$params = ['mail'=>$email_id];
|
||||
$params = ['mail' => $email_id];
|
||||
$multi_mails = ['venkateshraman786@gmail.com', 'gowtham.manavalan.la@gmail.com', 'venkatesh.r@venbainfotech.com'];
|
||||
$common = ['mail_type'=>'test_mail_cli'];
|
||||
$common = ['mail_type' => 'test_mail_cli'];
|
||||
$bcc = "vitvelz@gmail.com,velmurugan.s@venbainfotech.com,srinivas.saravanan@venbainfotech.com";
|
||||
$result = MailHelper::send_email(['mail' => $multi_mails, 'bcc'=>$bcc, 'params'=>$params,'subject' => 'Send Multiple " To " emails','message' => $message,'attachments' => $attachments,'common'=>$common]);
|
||||
$result = MailHelper::send_email(['mail' => $multi_mails, 'bcc' => $bcc, 'params' => $params, 'subject' => 'Send Multiple " To " emails', 'message' => $message, 'attachments' => $attachments, 'common' => $common]);
|
||||
dd($result);
|
||||
}
|
||||
|
||||
|
||||
@ -484,7 +484,7 @@ class RestAuthenticationController extends AdminController
|
||||
$this->authHistoryModel->insert($data);
|
||||
}
|
||||
|
||||
|
||||
$employeeData['token_type'] = "post";
|
||||
$result = JWTToken::encode($employeeData);
|
||||
|
||||
if(isset($this->request->getJSON()->otp)){
|
||||
@ -1081,6 +1081,7 @@ class RestAuthenticationController extends AdminController
|
||||
]);
|
||||
}
|
||||
|
||||
$employeeData['token_type'] = "post";
|
||||
$token = JWTToken::encode($employeeData);
|
||||
|
||||
log_message('error', ' ');
|
||||
|
||||
@ -42,6 +42,8 @@ class TicketController extends BaseController
|
||||
public $placeHolders;
|
||||
public $extraFields;
|
||||
public $nonIDReason;
|
||||
public $removeArrayKey;
|
||||
|
||||
|
||||
protected $clientModel;
|
||||
protected $ticketMasterModel;
|
||||
@ -280,7 +282,6 @@ class TicketController extends BaseController
|
||||
58 => ['cancel_remark' => 'Cancel Remark']
|
||||
];
|
||||
|
||||
|
||||
$this->nonIDReason = [
|
||||
"Newborn Baby" => "Newborn Baby",
|
||||
"Newly Wedded Spouse" => "Newly Wedded Spouse",
|
||||
@ -289,6 +290,46 @@ class TicketController extends BaseController
|
||||
"Exceptional Case" => "Exceptional Case"
|
||||
];
|
||||
|
||||
$this->removeArrayKey = [
|
||||
2 => [],
|
||||
6 => [],
|
||||
12 => [],
|
||||
15 => [],
|
||||
16 => [],
|
||||
17 => [],
|
||||
18 => [],
|
||||
19 => [],
|
||||
21 => [],
|
||||
22 => [],
|
||||
23 => [],
|
||||
25 => [],
|
||||
26 => [],
|
||||
27 => [],
|
||||
28 => [],
|
||||
29 => [],
|
||||
31 => [],
|
||||
32 => [],
|
||||
33 => [],
|
||||
35 => [],
|
||||
36 => [],
|
||||
37 => [],
|
||||
38 => [],
|
||||
39 => [],
|
||||
41 => [],
|
||||
42 => [],
|
||||
43 => [],
|
||||
45 => [],
|
||||
46 => [],
|
||||
49 => [],
|
||||
50 => [],
|
||||
51 => [],
|
||||
52 => [],
|
||||
55 => [],
|
||||
56 => [],
|
||||
57 => [],
|
||||
60 => []
|
||||
];
|
||||
|
||||
$this->ticketMasterModel = new TicketMasterModel();
|
||||
$this->claimStatus = new TicketClaimStatusModel();
|
||||
$this->clientModel = new ClientModel();
|
||||
@ -1712,9 +1753,22 @@ class TicketController extends BaseController
|
||||
$lastMatchedStatus = $incoming_form_values['claim_status_id'];
|
||||
|
||||
// Use the provided `extra_fields_array_for_validate` from the incoming data
|
||||
$statusMapping = json_decode($incoming_form_values['extra_fields_array_for_validate']);
|
||||
$statusMapping = json_decode($incoming_form_values['extra_fields_array_for_validate'], true);
|
||||
// print_r($statusMapping);
|
||||
// echo "-------------------------------";
|
||||
|
||||
//for remove the non used arrays
|
||||
foreach ($statusMapping as $key1 => $value1) {
|
||||
foreach ($this->removeArrayKey as $key2 => $value2) {
|
||||
if($key1 === $key2){
|
||||
unset($statusMapping[$key1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// print_r($statusMapping); die;
|
||||
|
||||
if($incoming_form_values['claim_status_id'] != $old_ticket_data['claim_status_id']){
|
||||
// if($incoming_form_values['claim_status_id'] != $old_ticket_data['claim_status_id']){
|
||||
|
||||
foreach ($statusMapping as $status => $requiredFields) {
|
||||
|
||||
if(!empty($requiredFields) && $status != $old_ticket_data['claim_status_id']){
|
||||
@ -1749,7 +1803,8 @@ class TicketController extends BaseController
|
||||
$lastMatchedStatus = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// }
|
||||
|
||||
return $lastMatchedStatus;
|
||||
}
|
||||
|
||||
@ -664,12 +664,18 @@ if(!function_exists('generate_insurer_based_excel')){
|
||||
|
||||
$rowData = [];
|
||||
foreach ($excel_header_array as $header) {
|
||||
|
||||
$fieldName = $header['db_column_name'];
|
||||
$defaultValue = isset($header['default_value']) ? $header['default_value'] : null;
|
||||
|
||||
if ($fieldName === 'index') {
|
||||
$value = $serialNumber;
|
||||
} else {
|
||||
$value = $row->$fieldName ?? '';
|
||||
if(empty($fieldName) && !empty($defaultValue)){
|
||||
$value = $defaultValue;
|
||||
}else{
|
||||
$value = $row->$fieldName ?? '';
|
||||
}
|
||||
}
|
||||
|
||||
$rowData[] = $value;
|
||||
|
||||
@ -17,6 +17,7 @@ class CDMasterModel extends Model
|
||||
'id',
|
||||
'client_id',
|
||||
'insurer_id',
|
||||
'insurer_branch_id',
|
||||
'cd_ac_no',
|
||||
'opening_bal',
|
||||
'opening_date',
|
||||
@ -66,9 +67,10 @@ class CDMasterModel extends Model
|
||||
|
||||
$query = $this->db->table('cd_master')
|
||||
|
||||
->select('cd_master.*, clients.client_name, clients.short_name, insurers.name AS insurer_name, user_profiles.first_name AS user_name, IFNULL(cd_ac_counts.cd_ac_no_count, 0) AS cd_ac_no_count, IFNULL(cd_ac_counts_for_cdt.cd_ac_no_count_cd_tranction, 0) AS cd_ac_no_count_cd_tranction')
|
||||
->select('cd_master.*, clients.client_name, clients.short_name, insurers.name AS insurer_name, user_profiles.first_name AS user_name, IFNULL(cd_ac_counts.cd_ac_no_count, 0) AS cd_ac_no_count, IFNULL(cd_ac_counts_for_cdt.cd_ac_no_count_cd_tranction, 0) AS cd_ac_no_count_cd_tranction, insurer_branch.branch_name as insurer_branch_name')
|
||||
->join('clients', 'clients.id = cd_master.client_id')
|
||||
->join('insurers', 'insurers.id = cd_master.insurer_id')
|
||||
->join('insurer_branch', 'cd_master.insurer_branch_id = insurer_branch.id', "left")
|
||||
->join('user_profiles', 'user_profiles.id = cd_master.created_by')
|
||||
->join(
|
||||
'(SELECT cd_master.cd_ac_no, cd_master.id, COUNT(client_policy.cd_ac_no) AS cd_ac_no_count
|
||||
@ -102,6 +104,7 @@ class CDMasterModel extends Model
|
||||
->where('clients.is_active', 1)
|
||||
->where('insurers.is_active', 1)
|
||||
->where('user_profiles.is_active', 1)
|
||||
->orderBy('cd_master.id', "desc")
|
||||
->get();
|
||||
|
||||
$result = $query->getResultArray();
|
||||
|
||||
@ -40,6 +40,7 @@ class ClientModel extends Model
|
||||
"reply_to",
|
||||
"mail_domain",
|
||||
"addon_subheading",
|
||||
"parent_client_id",
|
||||
];
|
||||
|
||||
|
||||
|
||||
@ -174,10 +174,11 @@ class ClientPolicyModel extends Model
|
||||
|
||||
$builder = $this->db->table('client_policy')
|
||||
->select('client_policy.*, cd_master.cd_ac_no as cd_master_account_no')
|
||||
->select('insurers.name as insurer_name, insurers.short_name as insurer_short')
|
||||
->select('insurers.name as insurer_name, insurers.short_name as insurer_short, insurer_branch.branch_name as insurer_branch_name')
|
||||
->select('clients.client_name as client_name')
|
||||
->join('clients', 'clients.id = client_policy.client_id')
|
||||
->join('insurers', 'insurers.id = client_policy.insurer_id')
|
||||
->join('insurer_branch', 'client_policy.insurer_branch_id = insurer_branch.id', 'left')
|
||||
->join('cd_master', 'cd_master.insurer_id = insurers.id AND cd_master.client_id = client_policy.client_id')
|
||||
->where('client_policy.client_id', $id)
|
||||
->where('cd_master.id = client_policy.cd_ac_pk')
|
||||
@ -190,7 +191,9 @@ class ClientPolicyModel extends Model
|
||||
$builder->whereIn('client_policy.id', $policyId);
|
||||
}
|
||||
|
||||
return $builder->get()->getResult();
|
||||
$data = $builder->get()->getResult();
|
||||
// dd($this->db->getLastQuery());
|
||||
return $data;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1085,10 +1085,10 @@ class EmployeePolicyModel extends Model
|
||||
}
|
||||
|
||||
$status_condition = "{$insurer_or_tpa}" === 'tpa'
|
||||
? "employee_polices.status = 'inactive' AND employees.emp_status = 'active'"
|
||||
? "employee_polices.status = 'active' AND employees.emp_status = 'active'"
|
||||
: "employee_polices.status = 'active' AND employees.emp_status = 'active'";
|
||||
|
||||
$endorsement_condition = "{$insurer_or_tpa}" === 'tpa' ? "AND (a.endorsement_id IS NOT NULL OR a.endorsement_id != '')" : "AND (a.endorsement_id IS NULL OR a.endorsement_id = '')";
|
||||
$endorsement_condition = "{$insurer_or_tpa}" === 'tpa' ? "AND (a.endorsement_id IS NULL OR a.endorsement_id = '')" : "AND (a.endorsement_id IS NULL OR a.endorsement_id = '')";
|
||||
|
||||
$query = $this->db->query("
|
||||
SELECT DISTINCT
|
||||
|
||||
@ -765,7 +765,12 @@ class PolicyTransactionModel extends Model
|
||||
),
|
||||
2
|
||||
) AS unbilled_amt,
|
||||
created_user.first_name as user_name
|
||||
created_user.first_name as user_name,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
@ -986,7 +991,12 @@ class PolicyTransactionModel extends Model
|
||||
pt_co_share_details.tp_amt AS tp,
|
||||
clients.pan,
|
||||
DATE_FORMAT(policy_transaction.created_at, '%d %b %Y %h:%i %p') AS created_at,
|
||||
user_profiles.first_name as user_name
|
||||
user_profiles.first_name as user_name,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('clients', 'clients.id = policy_transaction.client_id', 'left')
|
||||
@ -1049,8 +1059,8 @@ class PolicyTransactionModel extends Model
|
||||
|
||||
// Optimize Query Execution
|
||||
$builder->orderBy('policy_transaction.id', 'desc');
|
||||
|
||||
return $builder->get()->getResultArray();
|
||||
$data = $builder->get()->getResultArray();
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@ -1065,7 +1075,12 @@ class PolicyTransactionModel extends Model
|
||||
client_branch.branch_name as client_branch_name,
|
||||
insurers.name AS insurer_name,
|
||||
insurers.short_name AS insurer_short_name,
|
||||
policy_type.policy_type
|
||||
policy_type.policy_type ,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
')
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('clients', 'policy_transaction.client_id = clients.id', 'left')
|
||||
@ -1228,7 +1243,12 @@ class PolicyTransactionModel extends Model
|
||||
AND co_share_stmt_details.is_active = 1
|
||||
),
|
||||
2
|
||||
) AS variance_amt
|
||||
) AS variance_amt,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
|
||||
|
||||
")
|
||||
@ -1317,7 +1337,6 @@ class PolicyTransactionModel extends Model
|
||||
'clients.client_name',
|
||||
'insurers.name AS insurer_name',
|
||||
'policy_type.policy_type',
|
||||
'policy_transaction.policy_no',
|
||||
'policy_transaction.endorsement_no',
|
||||
"CASE
|
||||
WHEN policy_transaction.action_type = 'inception' THEN 'I'
|
||||
@ -1327,7 +1346,12 @@ class PolicyTransactionModel extends Model
|
||||
'pt_co_share_details.bp_amt',
|
||||
'pt_co_share_details.tp_amt',
|
||||
'pt_co_share_details.tep_amt',
|
||||
'policy_transaction.status'
|
||||
'policy_transaction.status',
|
||||
'CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`'
|
||||
])
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('clients', 'clients.id = policy_transaction.client_id', 'left')
|
||||
@ -1417,7 +1441,12 @@ class PolicyTransactionModel extends Model
|
||||
policy_transaction.action_type AS action_type_full,
|
||||
pt_co_share_details.exp_amt,
|
||||
pt_co_share_details.variance,
|
||||
policy_transaction.status
|
||||
policy_transaction.status,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('clients', 'clients.id = policy_transaction.client_id', 'left')
|
||||
@ -1490,7 +1519,6 @@ class PolicyTransactionModel extends Model
|
||||
clients.client_name,
|
||||
insurers.name AS insurer_name,
|
||||
policy_type.policy_type,
|
||||
policy_transaction.policy_no,
|
||||
policy_transaction.endorsement_no,
|
||||
CASE
|
||||
WHEN policy_transaction.action_type = 'inception' THEN 'I'
|
||||
@ -1525,7 +1553,12 @@ class PolicyTransactionModel extends Model
|
||||
inv_payment_details.statement_id = insurer_statements.id
|
||||
AND inv_payment_details.is_active = 1
|
||||
),
|
||||
2) AS outstanding_amount
|
||||
2) AS outstanding_amount,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('insurer_statements', 'pt_co_share_details.statement_id = insurer_statements.id', 'left')
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<style>
|
||||
<!-- <style>
|
||||
body {
|
||||
.multiselect-native-select {
|
||||
position: relative;
|
||||
@ -34,7 +34,197 @@ body {
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
</style> -->
|
||||
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.multiselect-native-select {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.multiselect-native-select select {
|
||||
border: 0 !important;
|
||||
clip: rect(0 0 0 0) !important;
|
||||
height: 1px !important;
|
||||
margin: -1px -1px -1px -3px !important;
|
||||
overflow: hidden !important;
|
||||
padding: 0 !important;
|
||||
position: absolute !important;
|
||||
width: 1px !important;
|
||||
left: 50%;
|
||||
top: 30px;
|
||||
}
|
||||
|
||||
.multiselect-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.multiselect-selected-text {
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
/* Tooltip Styles */
|
||||
.tooltip-trigger {
|
||||
color: #007bff;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.tooltip-trigger:hover {
|
||||
color: #0056b3;
|
||||
}
|
||||
|
||||
.tooltip-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
pointer-events: none;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
|
||||
.tooltip {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
||||
padding: 15px;
|
||||
transition: opacity 0.3s, visibility 0.3s;
|
||||
max-width: 600px;
|
||||
min-width: 500px;
|
||||
max-height: 600px; /* Limits height */
|
||||
overflow-y: auto; /* Enables scrolling */
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
/* Optional: Custom scrollbar styling */
|
||||
.tooltip::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
.tooltip::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.tooltip::-webkit-scrollbar-thumb {
|
||||
background: #c1c1c1;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.tooltip::-webkit-scrollbar-thumb:hover {
|
||||
background: #a8a8a8;
|
||||
}
|
||||
|
||||
/* .tooltip {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
||||
padding: 15px;
|
||||
transition: opacity 0.3s, visibility 0.3s;
|
||||
max-width: 600px;
|
||||
min-width: 500px;
|
||||
pointer-events: auto;
|
||||
} */
|
||||
|
||||
.tooltip::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
border-width: 5px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.tooltip.show {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.tooltip-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 12px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.tooltip-table th {
|
||||
background-color: #f8f9fa;
|
||||
font-weight: bold;
|
||||
padding: 8px;
|
||||
border: 1px solid #dee2e6;
|
||||
text-align: left;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.tooltip-table td {
|
||||
padding: 6px 8px;
|
||||
border: 1px solid #dee2e6;
|
||||
vertical-align: top;
|
||||
font-size: 11px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.tooltip-table tbody tr:nth-child(even) {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.tooltip-table tbody tr:hover {
|
||||
background-color: #e3f2fd;
|
||||
}
|
||||
|
||||
.team-cell {
|
||||
font-weight: bold;
|
||||
background-color: #e7f3ff !important;
|
||||
}
|
||||
|
||||
/* Form styling for demo */
|
||||
.form-group {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
color: #495057;
|
||||
background-color: #fff;
|
||||
border: 1px solid #ced4da;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.text-danger {
|
||||
color: #dc3545;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- End ADD and EDIT Page HTML -->
|
||||
<div class="row" id="List-page">
|
||||
<div class="col-12">
|
||||
@ -96,7 +286,7 @@ table.dataTable tbody td {
|
||||
|
||||
<!-- modal content -->
|
||||
|
||||
<div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||||
<div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;" data-backdrop="static">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -142,7 +332,9 @@ table.dataTable tbody td {
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="emp_code">User Role<span class="text-danger">*</span></label>
|
||||
<label for="emp_code">User Role<span class="text-danger">*</span>
|
||||
<span class="tooltip-trigger fa fa-info-circle" id="roleAccessMatrixTrigger"></span>
|
||||
</label>
|
||||
<select class="form-control" id="role" name="role" required>
|
||||
<option value="">Select Role</option>
|
||||
<?php foreach($roleData as $value) { ?>
|
||||
@ -153,7 +345,9 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="profile">User Team<span class="text-danger">*</span></label>
|
||||
<label for="profile">User Team<span class="text-danger">*</span>
|
||||
<span class="tooltip-trigger fa fa-info-circle" id="accessMatrixTrigger"></span>
|
||||
</label>
|
||||
<select hidden class="form-control" id="team" name="team[]" multiple required>
|
||||
<?php foreach($teamData as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
|
||||
@ -175,145 +369,449 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- Tooltip container separate from trigger -->
|
||||
<div class="tooltip-container" id="tooltipContainer">
|
||||
<div class="tooltip" id="accessMatrixTooltip">
|
||||
<table class="tooltip-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Team</th>
|
||||
<th>Module</th>
|
||||
<th>Access Rights</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="team-cell">Management</td>
|
||||
<td>BDS - All access</td>
|
||||
<td>All access</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="team-cell" rowspan="5">Finance</td>
|
||||
<td>BDS - Policy Transaction</td>
|
||||
<td>Policy | Endorsement | Statement Upload</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BDS - Report</td>
|
||||
<td>TAT wise | ACM Status wise | ACM TAT wise</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BDS - Pending Actions</td>
|
||||
<td>Finance Team</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BDS - Masters</td>
|
||||
<td>Vehicle | CD</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BDS - Documents</td>
|
||||
<td>✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="team-cell" rowspan="5">Business</td>
|
||||
<td>BDS - Policy Transaction</td>
|
||||
<td>Policy | Endorsement</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BDS - Report</td>
|
||||
<td>TAT wise | ACM Status wise | ACM TAT wise</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BDS - Pending Actions</td>
|
||||
<td>Business Team</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BDS - Masters</td>
|
||||
<td>Vehicle | CD</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BDS - Documents</td>
|
||||
<td>✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="team-cell" rowspan="2">POS</td>
|
||||
<td>BDS - Policy Transaction</td>
|
||||
<td>Policy | Endorsement</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BDS - Report</td>
|
||||
<td>BDS, TAT wise | ACM Status wise | ACM TAT wise</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="team-cell">Enrollment</td>
|
||||
<td>Inception File Upload</td>
|
||||
<td>All access</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="team-cell">Claims</td>
|
||||
<td>Claims</td>
|
||||
<td>All access</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="team-cell">Sales</td>
|
||||
<td>LEAD</td>
|
||||
<td>Lead creation | RFQ creation</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="team-cell">Business Support</td>
|
||||
<td>LEAD</td>
|
||||
<td>All access</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tooltip-container" id="roleTooltipContainer">
|
||||
<div class="tooltip" id="roleAccessMatrixTooltip">
|
||||
<table class="tooltip-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Team</th>
|
||||
<th>Module</th>
|
||||
<th>Access Rights</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="team-cell">Head</td>
|
||||
<td>All modules</td>
|
||||
<td>All access</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="team-cell">Admin</td>
|
||||
<td>All modules</td>
|
||||
<td>All access</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="team-cell">Manager</td>
|
||||
<td>Access to all modules except the "Masters" module</td>
|
||||
<td>All access</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="team-cell">Account Manager</td>
|
||||
<td>Access to all modules except the "Masters" module</td>
|
||||
<td>All access without "Delete option"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="team-cell">Staff</td>
|
||||
<td>Based on the "Teams"</td>
|
||||
<td>Based on the "Teams"</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function () {
|
||||
$(document).ready(function () {
|
||||
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" + // Keep your original alignment for the search and buttons
|
||||
"<'row'<'col-sm-12'tr>>" + // Table rows
|
||||
"<'row'<'col-sm-6'i><'col-sm-6'p>>",
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'UserList',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" + // Keep your original alignment for the search and buttons
|
||||
"<'row'<'col-sm-12'tr>>" + // Table rows
|
||||
"<'row'<'col-sm-6'i><'col-sm-6'p>>",
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'UserList',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
],
|
||||
|
||||
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('#team').multiselect({
|
||||
nonSelectedText: 'Select Team',
|
||||
enableFiltering: false,
|
||||
enableCaseInsensitiveFiltering: false,
|
||||
includeSelectAllOption : false,
|
||||
buttonWidth:'100%'
|
||||
});
|
||||
|
||||
|
||||
$('#btnAdd').click(function(){
|
||||
$('#first_name').val('');
|
||||
$('#last_name').val('');
|
||||
$('#email').val('');
|
||||
$('#mobile').val('');
|
||||
$('#emp_code').val('');
|
||||
$('#UserForm').attr('action', '<?php echo base_url('/user/create');?>');
|
||||
})
|
||||
|
||||
|
||||
$('.close').click(function(){
|
||||
$('#UserId').val('');
|
||||
$('#first_name').val('');
|
||||
$('#email').val('');
|
||||
$('#mobile').val('');
|
||||
$('#emp_code').val('');
|
||||
$('#role').val('')
|
||||
})
|
||||
|
||||
|
||||
$('body').on('click', '.btnEdit', function () {
|
||||
var user_id = $(this).attr('data-id');
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('user/getuser/');?>'+user_id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
console.log(res)
|
||||
$('#updateModal').modal('show');
|
||||
$('#role').val('')
|
||||
$('#UserForm').attr('action', '<?php echo base_url('user/edit');?>');
|
||||
$('#UserId').val(res.data.id);
|
||||
$('#first_name').val(res.data.first_name);
|
||||
$('#last_name').val(res.data.last_name);
|
||||
$('#email').val(res.data.email);
|
||||
$('#mobile').val(res.data.mobile);
|
||||
$('#emp_code').val(res.data.emp_code);
|
||||
$('#role option[value="' + res.data.role + '"]').prop('selected', true);
|
||||
$('#btnSubmit').html('Update');
|
||||
|
||||
$.each(res.userTeamData, function(index, item) {
|
||||
$('#team option[value="' + item.team_id + '"]').prop('selected', true);
|
||||
$('#team').multiselect('refresh');
|
||||
});
|
||||
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error("Error Details:");
|
||||
console.error("Status Code:", xhr.status);
|
||||
console.error("Status Text:", xhr.statusText);
|
||||
console.error("Response Text:", xhr.responseText);
|
||||
console.error("Ready State:", xhr.readyState);
|
||||
console.error("Response Headers:", xhr.getAllResponseHeaders());
|
||||
console.error("Error Thrown:", error);
|
||||
console.error("Status:", status);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('#team').multiselect({
|
||||
nonSelectedText: 'Select Team',
|
||||
enableFiltering: false,
|
||||
enableCaseInsensitiveFiltering: false,
|
||||
includeSelectAllOption : false,
|
||||
buttonWidth:'100%'
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '.btnDelete', function () {
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this user",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
var student_id = $(this).attr('data-id');
|
||||
$.get('<?php echo base_url('user/deactive/');?>'+student_id, function (data) {
|
||||
console.log(data);
|
||||
toastr.success('User removed successfully', 'success');
|
||||
window.location.reload()
|
||||
})
|
||||
}
|
||||
$('#btnAdd').click(function(){
|
||||
$('#first_name').val('');
|
||||
$('#last_name').val('');
|
||||
$('#email').val('');
|
||||
$('#mobile').val('');
|
||||
$('#emp_code').val('');
|
||||
$('#UserForm').attr('action', '<?php echo base_url('/user/create');?>');
|
||||
})
|
||||
|
||||
|
||||
$('.close').click(function(){
|
||||
$('#UserId').val('');
|
||||
$('#first_name').val('');
|
||||
$('#email').val('');
|
||||
$('#mobile').val('');
|
||||
$('#emp_code').val('');
|
||||
$('#role').val('')
|
||||
})
|
||||
|
||||
|
||||
$('body').on('click', '.btnEdit', function () {
|
||||
var user_id = $(this).attr('data-id');
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('user/getuser/');?>'+user_id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
console.log(res)
|
||||
$('#updateModal').modal('show');
|
||||
$('#role').val('')
|
||||
$('#UserForm').attr('action', '<?php echo base_url('user/edit');?>');
|
||||
$('#UserId').val(res.data.id);
|
||||
$('#first_name').val(res.data.first_name);
|
||||
$('#last_name').val(res.data.last_name);
|
||||
$('#email').val(res.data.email);
|
||||
$('#mobile').val(res.data.mobile);
|
||||
$('#emp_code').val(res.data.emp_code);
|
||||
$('#role option[value="' + res.data.role + '"]').prop('selected', true);
|
||||
$('#btnSubmit').html('Update');
|
||||
|
||||
$.each(res.userTeamData, function(index, item) {
|
||||
$('#team option[value="' + item.team_id + '"]').prop('selected', true);
|
||||
$('#team').multiselect('refresh');
|
||||
});
|
||||
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error("Error Details:");
|
||||
console.error("Status Code:", xhr.status);
|
||||
console.error("Status Text:", xhr.statusText);
|
||||
console.error("Response Text:", xhr.responseText);
|
||||
console.error("Ready State:", xhr.readyState);
|
||||
console.error("Response Headers:", xhr.getAllResponseHeaders());
|
||||
console.error("Error Thrown:", error);
|
||||
console.error("Status:", status);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '.btnDelete', function () {
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this user",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
});
|
||||
var student_id = $(this).attr('data-id');
|
||||
$.get('<?php echo base_url('user/deactive/');?>'+student_id, function (data) {
|
||||
console.log(data);
|
||||
toastr.success('User removed successfully', 'success');
|
||||
window.location.reload()
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function onlyNumbers(event){
|
||||
var charcode;
|
||||
charcode = event.which || event.keyCode;
|
||||
if(charcode>= 48 && charcode <= 57)return true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
var form = document.getElementById("UserForm");
|
||||
function onlyNumbers(event){
|
||||
var charcode;
|
||||
charcode = event.which || event.keyCode;
|
||||
if(charcode>= 48 && charcode <= 57)return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Add submit event listener to the form
|
||||
form.addEventListener("submit", function(event) {
|
||||
// Disable the submit button to avoid multiple submissions
|
||||
// document.getElementById("btnSubmit").disabled = true;
|
||||
});
|
||||
var form = document.getElementById("UserForm");
|
||||
|
||||
// Add submit event listener to the form
|
||||
form.addEventListener("submit", function(event) {
|
||||
// Disable the submit button to avoid multiple submissions
|
||||
// document.getElementById("btnSubmit").disabled = true;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function initializeTooltip() {
|
||||
|
||||
const trigger = document.getElementById('accessMatrixTrigger');
|
||||
console.log(trigger);
|
||||
const tooltip = document.getElementById('accessMatrixTooltip');
|
||||
console.log(tooltip);
|
||||
const tooltipContainer = document.getElementById('tooltipContainer');
|
||||
console.log(tooltipContainer);
|
||||
|
||||
if (!trigger || !tooltip || !tooltipContainer) {
|
||||
console.error('Tooltip elements not found');
|
||||
return;
|
||||
}
|
||||
|
||||
function positionTooltip(event) {
|
||||
const triggerRect = trigger.getBoundingClientRect();
|
||||
const tooltipRect = tooltip.getBoundingClientRect();
|
||||
const viewportWidth = window.innerWidth;
|
||||
const viewportHeight = window.innerHeight;
|
||||
|
||||
let left = triggerRect.right + 10; // 10px to the right of trigger
|
||||
let top = triggerRect.top;
|
||||
|
||||
// Check if tooltip goes off-screen to the right
|
||||
if (left + tooltipRect.width > viewportWidth) {
|
||||
left = triggerRect.left - tooltipRect.width - 10; // Show to the left instead
|
||||
}
|
||||
|
||||
// Check if tooltip goes off-screen at the bottom
|
||||
if (top + tooltipRect.height > viewportHeight) {
|
||||
top = viewportHeight - tooltipRect.height - 10;
|
||||
}
|
||||
|
||||
// Ensure tooltip doesn't go above viewport
|
||||
if (top < 10) {
|
||||
top = 10;
|
||||
}
|
||||
|
||||
tooltipContainer.style.left = left + 'px';
|
||||
tooltipContainer.style.top = top + 'px';
|
||||
|
||||
// Position arrow
|
||||
const arrow = tooltip.querySelector('::after');
|
||||
if (left < triggerRect.left) {
|
||||
// Tooltip is to the left, arrow should point right
|
||||
tooltip.style.setProperty('--arrow-position', 'right');
|
||||
} else {
|
||||
// Tooltip is to the right, arrow should point left
|
||||
tooltip.style.setProperty('--arrow-position', 'left');
|
||||
}
|
||||
}
|
||||
|
||||
// Show tooltip on hover
|
||||
trigger.addEventListener('mouseenter', function(event) {
|
||||
positionTooltip(event);
|
||||
tooltip.classList.add('show');
|
||||
});
|
||||
|
||||
// Hide tooltip when mouse leaves trigger
|
||||
trigger.addEventListener('mouseleave', function() {
|
||||
tooltip.classList.remove('show');
|
||||
});
|
||||
|
||||
// Keep tooltip visible when hovering over the tooltip itself
|
||||
tooltip.addEventListener('mouseenter', function() {
|
||||
tooltip.classList.add('show');
|
||||
});
|
||||
|
||||
tooltip.addEventListener('mouseleave', function() {
|
||||
tooltip.classList.remove('show');
|
||||
});
|
||||
|
||||
// Reposition on window resize
|
||||
window.addEventListener('resize', function() {
|
||||
if (tooltip.classList.contains('show')) {
|
||||
positionTooltip();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initializeRoleTooltip() {
|
||||
|
||||
const trigger = document.getElementById('roleAccessMatrixTrigger');
|
||||
console.log(trigger);
|
||||
const tooltip = document.getElementById('roleAccessMatrixTooltip');
|
||||
console.log(tooltip);
|
||||
const tooltipContainer = document.getElementById('roleTooltipContainer');
|
||||
console.log(tooltipContainer);
|
||||
|
||||
if (!trigger || !tooltip || !tooltipContainer) {
|
||||
console.error('Tooltip elements not found');
|
||||
return;
|
||||
}
|
||||
|
||||
function positionTooltip(event) {
|
||||
const triggerRect = trigger.getBoundingClientRect();
|
||||
const tooltipRect = tooltip.getBoundingClientRect();
|
||||
const viewportWidth = window.innerWidth;
|
||||
const viewportHeight = window.innerHeight;
|
||||
|
||||
let left = triggerRect.right + 10; // 10px to the right of trigger
|
||||
let top = triggerRect.top;
|
||||
|
||||
// Check if tooltip goes off-screen to the right
|
||||
if (left + tooltipRect.width > viewportWidth) {
|
||||
left = triggerRect.left - tooltipRect.width - 10; // Show to the left instead
|
||||
}
|
||||
|
||||
// Check if tooltip goes off-screen at the bottom
|
||||
if (top + tooltipRect.height > viewportHeight) {
|
||||
top = viewportHeight - tooltipRect.height - 10;
|
||||
}
|
||||
|
||||
// Ensure tooltip doesn't go above viewport
|
||||
if (top < 10) {
|
||||
top = 10;
|
||||
}
|
||||
|
||||
tooltipContainer.style.left = left + 'px';
|
||||
tooltipContainer.style.top = top + 'px';
|
||||
|
||||
// Position arrow
|
||||
const arrow = tooltip.querySelector('::after');
|
||||
if (left < triggerRect.left) {
|
||||
// Tooltip is to the left, arrow should point right
|
||||
tooltip.style.setProperty('--arrow-position', 'right');
|
||||
} else {
|
||||
// Tooltip is to the right, arrow should point left
|
||||
tooltip.style.setProperty('--arrow-position', 'left');
|
||||
}
|
||||
}
|
||||
|
||||
// Show tooltip on hover
|
||||
trigger.addEventListener('mouseenter', function(event) {
|
||||
positionTooltip(event);
|
||||
tooltip.classList.add('show');
|
||||
});
|
||||
|
||||
// Hide tooltip when mouse leaves trigger
|
||||
trigger.addEventListener('mouseleave', function() {
|
||||
tooltip.classList.remove('show');
|
||||
});
|
||||
|
||||
// Keep tooltip visible when hovering over the tooltip itself
|
||||
tooltip.addEventListener('mouseenter', function() {
|
||||
tooltip.classList.add('show');
|
||||
});
|
||||
|
||||
tooltip.addEventListener('mouseleave', function() {
|
||||
tooltip.classList.remove('show');
|
||||
});
|
||||
|
||||
// Reposition on window resize
|
||||
window.addEventListener('resize', function() {
|
||||
if (tooltip.classList.contains('show')) {
|
||||
positionTooltip();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Initialize when DOM is ready
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', initializeTooltip);
|
||||
document.addEventListener('DOMContentLoaded', initializeRoleTooltip);
|
||||
} else {
|
||||
initializeTooltip();
|
||||
initializeRoleTooltip();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -62,8 +62,8 @@
|
||||
<!-- <td><?php echo isset($file['policy_name']) ? $file['policy_name'] : '' ?> - <?php echo isset($file['policy_no']) ? $file['policy_no'] : '' ?> - <?php echo isset($file['policy_type']) ? $file['policy_type'] : '' ?></td> -->
|
||||
<td><?php echo isset($file['policy_type']) ? $file['policy_type'] : '' ?> - <?php echo isset($file['policy_no']) ? $file['policy_no'] : '' ?></td>
|
||||
<td><?php echo $file['event_type'] ?></td>
|
||||
<td><?php echo $file['insurer_or_tpa'] ?></td>
|
||||
<td><?php echo $file['actions'] ?></td>
|
||||
<td><?php echo $insurer_or_tpa[$file['insurer_or_tpa']] ?></td>
|
||||
<td><?php echo $import_or_export[$file['actions']] ?></td>
|
||||
<td><?php echo $file['count'] == null ? '-' : $file['count'] ?></td>
|
||||
|
||||
<td><?php echo format_indian_number($file['amount'])?></td>
|
||||
|
||||
306
app/Views/cd_master_add_modal.php
Normal file
306
app/Views/cd_master_add_modal.php
Normal file
@ -0,0 +1,306 @@
|
||||
<!-- modal content -->
|
||||
<div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
|
||||
<div class="modal-dialog" <?= !isset($CD_Master_Data) ? 'style="max-width: 35% !important;"' : '' ?>>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="title">Add Opening Amount</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="resetCdMasterFormModal()">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body p-4">
|
||||
<div class="">
|
||||
<form role="form" class="parsley-examples" id="CDMasterForm" enctype="multipart/form-data">
|
||||
<input type="hidden" name="PrimaryKey" id="CD_Master_ID" />
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="emp_code">Client<span class="text-danger">*</span></label>
|
||||
<select class="form-control <?= !isset($CD_Master_Data) ? 'readonly-select' : '' ?>" id="cd_client_id" name="client_id" required>
|
||||
<option value="" >Select Client</option>
|
||||
<?php foreach($clients as $value) {
|
||||
if(isset($client['id']) && $value['id'] == $client['id']){
|
||||
$client_select = "selected";
|
||||
}else{
|
||||
$client_select = "";
|
||||
}
|
||||
?>
|
||||
|
||||
<option value="<?= $value['id'] ?>" <?= $client_select ?>><?= $value['client_name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="profile">Insurer<span class="text-danger">*</span></label>
|
||||
<select class="form-control <?= !isset($CD_Master_Data) ? 'readonly-select' : '' ?>" id="insurer_id_for_cd" name="insurer_id" <?= isset($CD_Master_Data) ? 'onchange="filterInsurerBranch(this)"' : '' ?> required>
|
||||
<option value="">Select Insurer</option>
|
||||
<?php foreach($insurers as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="insurer_branch_id">Insurer Branch<span class="text-danger">*</span></label>
|
||||
<select class="form-control <?= !isset($CD_Master_Data) ? 'readonly-select' : '' ?>" id="insurer_branch_id" name="insurer_branch_id" required>
|
||||
<option value="">Select Insurer Branch</option>
|
||||
<?php if(isset($insurer_branch) && !empty($insurer_branch))
|
||||
{ foreach($insurer_branch as $branch) { ?>
|
||||
<option data-insurer="<?= $branch['insurer_id'] ?>" value="<?= $branch['id'] ?>"><?= $branch['branch_name'] ?></option>
|
||||
<?php } } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="email">Opening Date<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="opening_date" id="opening_date" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="mobile">CD Account Number<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="cd_ac_no_for_cd_master" name="cd_ac_no" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="mobile">Opening Amount<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="opening_bal" name="opening_bal" onkeypress="return onlyNumbers(event)" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="cdButtonWrapper" class="form-group text-right m-b-0">
|
||||
<button class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||
<!-- <button type="button" class="btn btn-secondry waves-effect waves-light mr-1" data-dismiss="modal" aria-hidden="true">Close</button> -->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
|
||||
<script>
|
||||
|
||||
//checking and setting this is CD master page or not
|
||||
var isCdMasterPage = <?php echo isset($CD_Master_Data) ? 'true' : 'false'; ?>;
|
||||
console.log("isCdMasterPage", isCdMasterPage);
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
var openingDatePicker = flatpickr("#opening_date", {
|
||||
dateFormat: "d-m-Y",
|
||||
allowInput: false
|
||||
});
|
||||
|
||||
if(isCdMasterPage == true){
|
||||
$('#cd_client_id').select2();
|
||||
$('#insurer_id_for_cd').select2();
|
||||
$('#insurer_branch_id').select2();
|
||||
}
|
||||
})
|
||||
|
||||
$('#cd_ac_no_for_cd_master').keyup(function(){
|
||||
console.log('key chnage detected');
|
||||
var cd_ac_no = $(this).val();
|
||||
console.log(cd_ac_no +'-'+cd_ac_no.length);
|
||||
cd_ac_no = cd_ac_no.trim();
|
||||
console.log(cd_ac_no +'-'+cd_ac_no.length);
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('util/check_cd_ac_no/');?>'+cd_ac_no,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
|
||||
console.log(res)
|
||||
if(res.status == true){
|
||||
toastr.warning(res.message, 'warning');
|
||||
// $('#cd_ac_no').val('');
|
||||
$('#btnSubmit').prop('disabled',true);
|
||||
return;
|
||||
}
|
||||
$('#btnSubmit').prop('disabled',false);
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
$('#CDMasterForm').submit(function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
console.log("submit CD Master Form Data function called");
|
||||
|
||||
var isValid = $('#CDMasterForm').parsley().validate();
|
||||
|
||||
if (!isValid) {
|
||||
$('#CDMasterForm').find('input, select, textarea').each(function() {
|
||||
if ($(this).parsley().isValid() === false && !$(this).val()) {
|
||||
console.log('Empty field ID:', this.id);
|
||||
}
|
||||
});
|
||||
console.log('Form is Empty', 'Warning');
|
||||
return;
|
||||
}
|
||||
|
||||
let formData = new FormData($('#CDMasterForm')[0]);
|
||||
console.log("formData", formData);
|
||||
|
||||
let url = '<?= base_url('master/cash_deposite/create') ?>';
|
||||
console.log("url", url);
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: url,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
console.log('CD Mater Form Submit Responce', res);
|
||||
|
||||
if (res.status == true) {
|
||||
toastr.success(res.message, 'Success');
|
||||
|
||||
if(isCdMasterPage == false){
|
||||
appendCDACNO(res.data, res.cd_master_data.id);
|
||||
// appendCdAccNo(res.cd_master_data);
|
||||
}
|
||||
|
||||
} else {
|
||||
toastr.warning(res.message, 'WARNING');
|
||||
}
|
||||
|
||||
//this function for reset the form values after submitting the form or closing the form
|
||||
resetCdMasterFormModal()
|
||||
$('.close').click();
|
||||
|
||||
//if this page is CD mater form page than the page reload other wise not to reload
|
||||
if(isCdMasterPage == true){
|
||||
window.location.href = '<?= base_url('master/cash_deposite/list') ?>';
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.error('An error occurred while adding the CD account number.', 'ERROR');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function onlyNumbers(event) {
|
||||
var charcode;
|
||||
charcode = event.which || event.keyCode;
|
||||
if (charcode >= 48 && charcode <= 57 || charcode == 46) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function resetCdMasterFormModal(){
|
||||
|
||||
console.log("resetCdMasterFormModal() function called");
|
||||
|
||||
$('#CD_Master_ID').val('');
|
||||
$('#opening_date').val('');
|
||||
$('#cd_ac_no_for_cd_master').val('');
|
||||
$('#opening_bal').val('');
|
||||
$('#CDMasterForm').parsley().reset();
|
||||
$('#cd_ac_no_for_cd_master').prop("disabled", false);
|
||||
$('#opening_bal').prop("disabled", false);
|
||||
|
||||
if(isCdMasterPage == true){
|
||||
$('#client_id').val('').change();
|
||||
$('#insurer_id_for_cd').val('').change();
|
||||
$('#insurer_branch_id').val('').change();
|
||||
|
||||
$('#client_id').prop("disabled", false);
|
||||
$('#insurer_id_for_cd').prop("disabled", false);
|
||||
$('#insurer_branch_id').prop("disabled", false);
|
||||
|
||||
$('#CDMasterForm')[0].reset();
|
||||
}
|
||||
}
|
||||
|
||||
function filterInsurerBranch(input) {
|
||||
|
||||
console.log("filterInsurerBranch function called");
|
||||
|
||||
let insurer_id = $(input).val();
|
||||
console.log("insurer_id", insurer_id);
|
||||
|
||||
let branch_data = <?= isset($insurer_branch) && !empty($insurer_branch) ? json_encode($insurer_branch) : '[]' ?>;
|
||||
console.log("branch_data", branch_data);
|
||||
|
||||
let filteredBranches = branch_data.filter(branch => branch.insurer_id == insurer_id);
|
||||
console.log("filteredBranches", filteredBranches);
|
||||
|
||||
let $branchSelect = $('#insurer_branch_id');
|
||||
$branchSelect.empty().append('<option value="">Select Insurer Branch</option>');
|
||||
|
||||
filteredBranches.forEach(branch => {
|
||||
$branchSelect.append(
|
||||
$('<option>', {
|
||||
value: branch.id,
|
||||
text: branch.branch_name
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
$branchSelect.val('').trigger('change.select2');
|
||||
}
|
||||
|
||||
function showCdMasterAddModal(){
|
||||
|
||||
if(isCdMasterPage == true){
|
||||
$('#client_id').val('');
|
||||
$('#insurer_id_for_cd').val('');
|
||||
$('#insurer_branch_id').val('');
|
||||
}
|
||||
|
||||
$('#opening_date').val('');
|
||||
$('#cd_ac_no_for_cd_master').val('');
|
||||
$('#opening_bal').val('');
|
||||
// $('#CDMasterForm').attr('action', '<?php echo base_url('master/cash_deposite/create');?>');
|
||||
$('#title').html('Add Opening Amount');
|
||||
$('#btnSubmit').html('Submit');
|
||||
|
||||
var myModal = new bootstrap.Modal(document.getElementById('con-close-modal'));
|
||||
myModal.show();
|
||||
}
|
||||
|
||||
function appendCdAccNo(data) {
|
||||
|
||||
console.log("appendCdAccNo function called :", data);
|
||||
const option = $('<option>', {
|
||||
value: data.id,
|
||||
text: data.cd_ac_no,
|
||||
selected: true // directly set selected in the object
|
||||
});
|
||||
|
||||
console.log("option", option);
|
||||
$('#cd_ac_no_for_cd_master').append(option);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@ -16,6 +16,7 @@ table.dataTable thead th {
|
||||
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.custom-dropdown-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
@ -42,6 +43,15 @@ table.dataTable thead th {
|
||||
color: #16181b !important;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
.addbtnStyle{
|
||||
margin-left: 20px !important;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="row" id="client_list">
|
||||
@ -53,17 +63,18 @@ table.dataTable thead th {
|
||||
<h4 style="position: relative;">CD Master List</h4>
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right; position: relative;top: 56px;">
|
||||
<button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light"
|
||||
<!-- <button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light"
|
||||
data-toggle="modal" data-target="#con-close-modal" data-placement="top" title="Add"
|
||||
data-trigger="hover">ADD</button>
|
||||
data-trigger="hover">ADD</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-sm table-hover m-0 table-centered dt-responsive w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap" >
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">S.No.</th>
|
||||
<th class="font-weight-medium">Client Name</th>
|
||||
<th class="font-weight-medium">Insurer Name</th>
|
||||
<th class="font-weight-medium">Insurer Branch Name</th>
|
||||
<th class="font-weight-medium">Opening Date</th>
|
||||
<th class="font-weight-medium">CD Account No</th>
|
||||
<th class="font-weight-medium">Opening Amount</th>
|
||||
@ -71,17 +82,17 @@ table.dataTable thead th {
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php foreach($CD_Master_Data as $row){ ?>
|
||||
<?php foreach($CD_Master_Data as $index => $row){ ?>
|
||||
<tr>
|
||||
<td><?= $index + 1; ?></td>
|
||||
<td><?php echo $row['client_name']; ?>( <?= $row['short_name'] ?> )</td>
|
||||
<td><?php echo $row['insurer_name']; ?></td>
|
||||
<td><?php echo $row['insurer_branch_name']; ?></td>
|
||||
<td><?php echo date('d-m-Y', strtotime($row['opening_date'])); ?></td>
|
||||
<td><?php echo $row['cd_ac_no']; ?></td>
|
||||
<td><?php echo $row['opening_bal']; ?></td>
|
||||
<td><?php echo date('d-M-Y h:i A', strtotime($row['created_at'])) ?> by
|
||||
<?php echo $row['user_name']; ?></td>
|
||||
<td><?php echo date('d-M-Y h:i A', strtotime($row['created_at'])) ?> by <?php echo $row['user_name']; ?></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>
|
||||
@ -103,199 +114,129 @@ table.dataTable thead th {
|
||||
</div>
|
||||
<!-- end row -->
|
||||
|
||||
<?php include("cd_master_add_modal.php"); ?>
|
||||
|
||||
<!-- modal content -->
|
||||
|
||||
<div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
|
||||
aria-hidden="true" data-backdrop="static" style="display: none;">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="title">Add Opening Amount</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body p-4">
|
||||
<div class="">
|
||||
|
||||
<form role="form" class="parsley-examples" method="post" id="CDMasterForm" action=""
|
||||
enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="CD_Master_ID" />
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="emp_code">Client<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="client_id" name="client_id" required>
|
||||
<option value="">Select Client</option>
|
||||
<?php foreach($clients as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['client_name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="profile">Insurer<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="insurer_id" name="insurer_id" required>
|
||||
<option value="">Select Insurer</option>
|
||||
<?php foreach($insurers as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="email">Opening Date<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="opening_date" id="opening_date" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="mobile">CD Account Number<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="cd_ac_no" name="cd_ac_no" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="mobile">Opening Amount<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="opening_bal" name="opening_bal" onkeypress="return onlyNumbers(event)" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
<!-- <button type="button" class="btn btn-secondry waves-effect waves-light mr-1" data-dismiss="modal" aria-hidden="true">Close</button> -->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.modal -->
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const table = document.getElementById("tickets-table");
|
||||
|
||||
// Create custom dropdown
|
||||
function createCustomDropdown(row) {
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const table = document.getElementById("scroll-horizontal-datatable");
|
||||
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
// Create custom dropdown
|
||||
function createCustomDropdown(row) {
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
|
||||
return customDropdown;
|
||||
}
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
let activeDropdown = null;
|
||||
return customDropdown;
|
||||
}
|
||||
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
let activeDropdown = null;
|
||||
|
||||
row.customDropdown = customDropdown;
|
||||
document.body.appendChild(customDropdown);
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the last column (action column)
|
||||
if (event.target.closest('td') === row.lastElementChild) {
|
||||
return;
|
||||
}
|
||||
row.customDropdown = customDropdown;
|
||||
document.body.appendChild(customDropdown);
|
||||
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown && activeDropdown !== customDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
|
||||
// Toggle the dropdown display
|
||||
const isActive = customDropdown.style.display === 'block';
|
||||
customDropdown.style.display = isActive ? 'none' : 'block';
|
||||
|
||||
// Set the position of the dropdown
|
||||
const rect = event.target.closest('td').getBoundingClientRect();
|
||||
customDropdown.style.position = 'absolute';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`;
|
||||
|
||||
// Set as active dropdown
|
||||
activeDropdown = isActive ? null : customDropdown;
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Preserve click handlers for modal actions
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
const isModalAction = this.hasAttribute('data-toggle') && this.getAttribute('data-toggle') === 'modal';
|
||||
if (isModalAction) {
|
||||
return; // Allow modal to function normally
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the last column (action column)
|
||||
if (event.target.closest('td') === row.lastElementChild) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Close the dropdown if it's not related to modal
|
||||
if (activeDropdown) {
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown && activeDropdown !== customDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
// Toggle the dropdown display
|
||||
const isActive = customDropdown.style.display === 'block';
|
||||
customDropdown.style.display = isActive ? 'none' : 'block';
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
}
|
||||
// Set the position of the dropdown
|
||||
const rect = event.target.closest('td').getBoundingClientRect();
|
||||
customDropdown.style.position = 'absolute';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`;
|
||||
|
||||
e.stopPropagation();
|
||||
// Set as active dropdown
|
||||
activeDropdown = isActive ? null : customDropdown;
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Preserve click handlers for modal actions
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
const isModalAction = this.hasAttribute('data-toggle') && this.getAttribute('data-toggle') === 'modal';
|
||||
if (isModalAction) {
|
||||
return; // Allow modal to function normally
|
||||
}
|
||||
|
||||
// Close the dropdown if it's not related to modal
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function() {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function() {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
$('#scroll-horizontal-datatable').DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'CD-Master-List',
|
||||
className: 'my_class',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
}],
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'CD-Master-List',
|
||||
className: 'my_class',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
},
|
||||
{
|
||||
text: 'Add',
|
||||
className: 'buttons-html5 addbtnStyle',
|
||||
action: function (e, dt, node, config) {
|
||||
showCdMasterAddModal();
|
||||
}
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
@ -314,45 +255,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
<?php if (session()->has('success')) : ?>
|
||||
toastr.success('<?= session()->getFlashdata('success') ?>', 'success');
|
||||
<?php endif; ?>
|
||||
|
||||
var endDatePicker = flatpickr("#opening_date", {
|
||||
dateFormat: "d-m-Y",
|
||||
// defaultDate: endDate,
|
||||
allowInput: false
|
||||
});
|
||||
|
||||
$('#client_id').select2();
|
||||
$('#insurer_id').select2();
|
||||
|
||||
})
|
||||
|
||||
$('#btnAdd').click(function(){
|
||||
$('#client_id').val('');
|
||||
$('#insurer_id').val('');
|
||||
$('#opening_date').val('');
|
||||
$('#cd_ac_no').val('');
|
||||
$('#opening_bal').val('');
|
||||
$('#CDMasterForm').attr('action', '<?php echo base_url('master/cash_deposite/create');?>');
|
||||
$('#title').html('Add Opening Amount');
|
||||
$('#btnSubmit').html('Submit');
|
||||
|
||||
|
||||
})
|
||||
|
||||
$('.close').click(function(){
|
||||
$('#CD_Master_ID').val('');
|
||||
$('#client_id').val('').change();
|
||||
$('#insurer_id').val('').change();
|
||||
$('#opening_date').val('');
|
||||
$('#cd_ac_no').val('');
|
||||
$('#opening_bal').val('');
|
||||
$('#CDMasterForm')[0].reset();
|
||||
$('#CDMasterForm').parsley().reset();
|
||||
$('#client_id').prop("disabled", false);
|
||||
$('#insurer_id').prop("disabled", false);
|
||||
$('#cd_ac_no').prop("disabled", false);
|
||||
$('#opening_bal').prop("disabled", false)
|
||||
|
||||
})
|
||||
|
||||
$('body').on('click', '.btnEdit', function () {
|
||||
@ -371,10 +273,12 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
$('#updateModal').modal('show');
|
||||
$('#CDMasterForm').attr('action', '<?php echo base_url('master/cash_deposite/edit');?>');
|
||||
$('#CD_Master_ID').val(res.data.id);
|
||||
$('#client_id').val(res.data.client_id).change();
|
||||
$('#client_id').prop("disabled", true);
|
||||
$('#insurer_id').val(res.data.insurer_id).change();
|
||||
$('#insurer_id').prop("disabled", true);
|
||||
$('#cd_client_id').val(res.data.client_id).change();
|
||||
$('#cd_client_id').prop("disabled", true);
|
||||
$('#insurer_id_for_cd').val(res.data.insurer_id).change();
|
||||
$('#insurer_id_for_cd').prop("disabled", true);
|
||||
$('#insurer_branch_id').val(res.data.insurer_id).change();
|
||||
$('#insurer_branch_id').prop("disabled", true);
|
||||
$('#opening_date').val(res.data.opening_date);
|
||||
$('#cd_ac_no').val(res.data.cd_ac_no);
|
||||
//$('#cd_ac_no').prop("disabled", true);
|
||||
@ -394,37 +298,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
});
|
||||
});
|
||||
|
||||
$('#cd_ac_no').keyup(function(){
|
||||
console.log('key chnage detected');
|
||||
var cd_ac_no = $(this).val();
|
||||
console.log(cd_ac_no +'-'+cd_ac_no.length);
|
||||
cd_ac_no = cd_ac_no.trim();
|
||||
console.log(cd_ac_no +'-'+cd_ac_no.length);
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('util/check_cd_ac_no/');?>'+cd_ac_no,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
|
||||
console.log(res)
|
||||
if(res.status == true){
|
||||
toastr.warning(res.message, 'warning');
|
||||
// $('#cd_ac_no').val('');
|
||||
$('#btnSubmit').prop('disabled',true);
|
||||
return;
|
||||
}
|
||||
$('#btnSubmit').prop('disabled',false);
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
function removeCDMaster(element) {
|
||||
|
||||
Swal.fire({
|
||||
@ -470,10 +343,4 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
}
|
||||
|
||||
function onlyNumbers(event) {
|
||||
var charcode;
|
||||
charcode = event.which || event.keyCode;
|
||||
if (charcode >= 48 && charcode <= 57 || charcode == 46) return true;
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@ -4,81 +4,567 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Insurance ChatBot</title>
|
||||
|
||||
</head>
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<body>
|
||||
<h1>Welcome to Insurance ChatBot </h1>
|
||||
|
||||
<h1>Loading...Please wait </h1>
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||
<script src='https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/js/widget.js'></script>
|
||||
<script>
|
||||
// var botmanWidget = {
|
||||
// frameEndpoint: 'https://localhost/PHP828APPS/ruc/nhance/chat', // This should match your CI4 route
|
||||
// introMessage: "Hi! I am your Insurance Bot. How can I assist you today?",
|
||||
// placeholderText: "Type your message here...",
|
||||
// title: "Insurance Bot",
|
||||
// mainColor: "#5C6BC0",
|
||||
// bubbleBackground: "#673AB7"
|
||||
// };
|
||||
var emp_name = 'Kumar';
|
||||
var uid = Math.floor(100000 + Math.random() * 900000);
|
||||
console.log('CURRENT_USER' + uid);
|
||||
var botmanWidget = {
|
||||
chatServer: `<?=base_url('chat')?>`, // Make sure this URL is correct
|
||||
frameEndpoint: `<?=base_url('widget')?>`, // This should match your CI4
|
||||
title: "Ask ILA",
|
||||
introMessage: "",
|
||||
bubbleBackground: "#007bff",
|
||||
mainColor: "#007bff",
|
||||
placeholderText: "Type your message here...",
|
||||
aboutText: "Insurance Assistant ILA",
|
||||
enableAttachments: false,
|
||||
// Add extra parameters
|
||||
parameters: {
|
||||
employee_id: '12288', //PK of emp
|
||||
session_id: "XYZ789", // token
|
||||
origin: "mobile", // origin
|
||||
emp_code:"HTL-007",
|
||||
client_id:159,
|
||||
client_branch_id:126
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Send a first load request when the chat widget opens
|
||||
// window.addEventListener("load", function () {
|
||||
// setTimeout(function () {
|
||||
// fetch("https://localhost/PHP828APPS/ruc/nhance/chat", {
|
||||
// method: "POST",
|
||||
// headers: { "Content-Type": "application/json" },
|
||||
// body: JSON.stringify({ first_load: "true", user_id: "12345" })
|
||||
// });
|
||||
// }, 2000); // Slight delay to ensure the widget is ready
|
||||
// });
|
||||
|
||||
|
||||
window.addEventListener("load", function () {
|
||||
setTimeout(function () {
|
||||
if (window.botmanWidget) {
|
||||
botmanChatWidget.open();
|
||||
setTimeout(function(){
|
||||
botmanChatWidget.sayAsBot('Hi '+ (typeof emp_name !== "undefined" && emp_name !== null && emp_name !== "" ? emp_name : "Guest User") +',This is ILA your Insurance Assistant, plz choose the following options')
|
||||
botmanChatWidget.whisper('Hi');
|
||||
},3000);
|
||||
|
||||
}
|
||||
}, 2000); // Delay to ensure widget is initialized
|
||||
});
|
||||
|
||||
|
||||
const queryParams = getQueryParams();
|
||||
console.log(queryParams);
|
||||
|
||||
const isMobile = window.innerWidth <= 600;
|
||||
const calcHeight = Math.floor(window.innerHeight * 0.6);
|
||||
const calcWidth = isMobile
|
||||
? (window.innerWidth)
|
||||
: Math.min(400, window.innerWidth - 50);
|
||||
|
||||
var botmanWidget = {
|
||||
// chatServer: 'https://venbait.in/nhance/chatbot/chat',
|
||||
// frameEndpoint: 'https://venbait.in/nhance/chatbot/widget',
|
||||
chatServer: `<?=base_url('chat')?>`,
|
||||
frameEndpoint: `<?=base_url('widget')?>`,
|
||||
title: "Ask ILA",
|
||||
placeholderText: "Type your message here...",
|
||||
aboutText: "Insurance Assistant ILA",
|
||||
enableAttachments: false,
|
||||
introMessage:'Welcome Kumar...! Say Hi...',
|
||||
bubbleAvatarUrl:"https://botman.io/img/logo.png",
|
||||
parameters: {
|
||||
employee_id: queryParams['employee_id'],
|
||||
session_id: "XYZ789",
|
||||
origin: "mobile",
|
||||
emp_code: queryParams['emp_code'],
|
||||
client_id: 63,
|
||||
client_branch_id: 32
|
||||
}
|
||||
};
|
||||
|
||||
// Also add scrolling when new messages arrive by observing the chat area
|
||||
function setupMessageObserver() {
|
||||
if (!currentIframe) {
|
||||
console.log('No iframe available for message observer');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const doc = currentIframe.contentDocument || currentIframe.contentWindow.document;
|
||||
if (!doc) {
|
||||
console.log('Cannot access iframe document for message observer');
|
||||
return;
|
||||
}
|
||||
|
||||
const waitForChatArea = () => {
|
||||
const chatArea = doc.querySelector("#messageArea .chat") ||
|
||||
doc.querySelector("#messageArea ol.chat") ||
|
||||
doc.querySelector("ol.chat");
|
||||
|
||||
if (chatArea) {
|
||||
console.log('Chat area found, setting up mutation observer');
|
||||
|
||||
// Create observer instance
|
||||
const observer = new MutationObserver((mutations) => {
|
||||
// Check if any mutations added nodes
|
||||
const hasNewMessages = mutations.some(mutation =>
|
||||
mutation.addedNodes && mutation.addedNodes.length > 0
|
||||
);
|
||||
|
||||
if (hasNewMessages) {
|
||||
// Scroll to bottom when new messages arrive
|
||||
setTimeout(() => {
|
||||
scrollToBottom();
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
||||
// Start observing the chat area for child list changes
|
||||
observer.observe(chatArea, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
|
||||
// Also scroll to bottom initially
|
||||
setTimeout(() => {
|
||||
scrollToBottom();
|
||||
}, 500);
|
||||
|
||||
} else {
|
||||
console.log('Chat area not found yet, retrying...');
|
||||
setTimeout(waitForChatArea, 200);
|
||||
}
|
||||
};
|
||||
|
||||
waitForChatArea();
|
||||
} catch (error) {
|
||||
console.error('Error setting up message observer:', error);
|
||||
}
|
||||
}
|
||||
// Improved CSS injection function with better timing and specificity
|
||||
function injectCSS(frame) {
|
||||
console.log('injectCSS called');
|
||||
|
||||
// Store the iframe reference for later use
|
||||
currentIframe = frame;
|
||||
|
||||
try {
|
||||
const doc = frame.contentDocument || frame.contentWindow.document;
|
||||
if (!doc) {
|
||||
console.error("Cannot access iframe document");
|
||||
return;
|
||||
}
|
||||
|
||||
// Wait for the document to be ready
|
||||
const waitForElement = () => {
|
||||
const messageArea = doc.querySelector("#messageArea");
|
||||
const chatElement = doc.querySelector("#messageArea .chat");
|
||||
|
||||
if (messageArea && chatElement) {
|
||||
console.log('Elements found, injecting CSS');
|
||||
|
||||
// Set initial height based on device
|
||||
const initialHeight = isMobile ? 700 : 800; // Default to keyboard closed state
|
||||
|
||||
// Method 1: Create style element with high specificity
|
||||
const style = doc.createElement("style");
|
||||
style.id = 'dynamic-chat-height';
|
||||
style.textContent = `
|
||||
/* High specificity selectors */
|
||||
#messageArea ol.chat,
|
||||
#messageArea .chat,
|
||||
ol.chat {
|
||||
height: ${initialHeight}px !important;
|
||||
max-height: ${initialHeight}px !important;
|
||||
min-height: ${initialHeight}px !important;
|
||||
transition: height 0.3s ease;
|
||||
}
|
||||
|
||||
/* Additional styling to ensure proper display */
|
||||
#messageArea {
|
||||
height: auto !important;
|
||||
}
|
||||
`;
|
||||
doc.head.appendChild(style);
|
||||
|
||||
// Method 2: Direct style application as backup
|
||||
setTimeout(() => {
|
||||
const chatElements = doc.querySelectorAll("#messageArea .chat, #messageArea ol.chat, ol.chat");
|
||||
chatElements.forEach(element => {
|
||||
if (element) {
|
||||
element.style.setProperty("height", initialHeight + "px", "important");
|
||||
element.style.setProperty("max-height", initialHeight + "px", "important");
|
||||
element.style.setProperty("min-height", initialHeight + "px", "important");
|
||||
element.style.setProperty("transition", "height 0.3s ease", "important");
|
||||
console.log('Direct style applied to:', element);
|
||||
}
|
||||
});
|
||||
|
||||
// Update current height
|
||||
currentChatHeight = initialHeight;
|
||||
|
||||
// Setup input focus listeners after CSS is applied
|
||||
setTimeout(() => {
|
||||
setupInputFocusListeners();
|
||||
}, 500);
|
||||
|
||||
// setTimeout(() => {
|
||||
// setupMessageObserver();
|
||||
// }, 500);
|
||||
|
||||
}, 500);
|
||||
|
||||
} else {
|
||||
console.log('Elements not found yet, retrying...');
|
||||
setTimeout(waitForElement, 200);
|
||||
}
|
||||
};
|
||||
|
||||
// Start checking for elements
|
||||
if (doc.readyState === 'complete') {
|
||||
waitForElement();
|
||||
} else {
|
||||
doc.addEventListener('DOMContentLoaded', waitForElement);
|
||||
// Fallback timeout
|
||||
setTimeout(waitForElement, 1000);
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error injecting CSS:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Improved iframe detection with better timing
|
||||
function waitForBotmanIframe(callback) {
|
||||
console.log('waitForBotmanIframe');
|
||||
|
||||
const checkForIframe = () => {
|
||||
const iframe = document.querySelector("#chatBotManFrame") ||
|
||||
document.querySelector("iframe[src*='widget']") ||
|
||||
document.querySelector("#botmanChatRoot iframe");
|
||||
|
||||
if (iframe) {
|
||||
console.log('Iframe found:', iframe);
|
||||
callback(iframe);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
// Check immediately
|
||||
if (checkForIframe()) return;
|
||||
|
||||
// Use MutationObserver as fallback
|
||||
const container = document.querySelector("#botmanChatRoot") || document.body;
|
||||
const observer = new MutationObserver((mutations, obs) => {
|
||||
if (checkForIframe()) {
|
||||
obs.disconnect();
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe(container, {
|
||||
childList: true,
|
||||
subtree: true,
|
||||
attributes: true
|
||||
});
|
||||
|
||||
// Timeout fallback
|
||||
setTimeout(() => {
|
||||
observer.disconnect();
|
||||
checkForIframe();
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
// Enhanced CSS application for the main document
|
||||
function applyBotManChatCSS() {
|
||||
console.log('applyBotManChatCSS called');
|
||||
|
||||
const style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.innerHTML = `
|
||||
/* Hide unwanted elements */
|
||||
div[style*="background: rgb(64, 133, 145)"][style*="line-height: 30px"] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
div[class*="desktop-closed-message-avatar"] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Iframe styling */
|
||||
iframe#chatBotManFrame {
|
||||
height: 100% !important;
|
||||
width: 100% !important;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Additional iframe selectors */
|
||||
iframe[src*="widget"] {
|
||||
height: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
`;
|
||||
document.getElementsByTagName('head')[0].appendChild(style);
|
||||
}
|
||||
|
||||
// Input focus-based height adjustment
|
||||
let currentChatHeight = 800; // Default height
|
||||
let isInputFocused = false;
|
||||
let currentIframe = null;
|
||||
|
||||
function adjustChatHeight(height) {
|
||||
console.log('Adjusting chat height to:', height);
|
||||
currentChatHeight = height;
|
||||
|
||||
if (currentIframe) {
|
||||
try {
|
||||
const doc = currentIframe.contentDocument || currentIframe.contentWindow.document;
|
||||
if (doc) {
|
||||
// Update existing style
|
||||
let styleElement = doc.querySelector('#dynamic-chat-height');
|
||||
if (!styleElement) {
|
||||
styleElement = doc.createElement('style');
|
||||
styleElement.id = 'dynamic-chat-height';
|
||||
doc.head.appendChild(styleElement);
|
||||
}
|
||||
|
||||
styleElement.textContent = `
|
||||
#messageArea ol.chat,
|
||||
#messageArea .chat,
|
||||
ol.chat {
|
||||
height: ${height}px !important;
|
||||
max-height: ${height}px !important;
|
||||
min-height: ${height}px !important;
|
||||
transition: height 0.3s ease;
|
||||
}
|
||||
`;
|
||||
|
||||
// Direct style application as backup
|
||||
const chatElements = doc.querySelectorAll("#messageArea .chat, #messageArea ol.chat, ol.chat");
|
||||
chatElements.forEach(element => {
|
||||
if (element) {
|
||||
element.style.setProperty("height", height + "px", "important");
|
||||
element.style.setProperty("max-height", height + "px", "important");
|
||||
element.style.setProperty("min-height", height + "px", "important");
|
||||
}
|
||||
});
|
||||
|
||||
console.log('Chat height adjusted successfully to:', height);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error adjusting chat height:', error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Setup input focus/blur listeners for height adjustment
|
||||
function setupInputFocusListeners() {
|
||||
if (!currentIframe) {
|
||||
console.log('No iframe available for input listeners');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const doc = currentIframe.contentDocument || currentIframe.contentWindow.document;
|
||||
if (!doc) {
|
||||
console.log('Cannot access iframe document for input listeners');
|
||||
return;
|
||||
}
|
||||
|
||||
// Function to find and attach listeners to the userText input
|
||||
const attachInputListeners = () => {
|
||||
const userTextInput = doc.querySelector('#userText');
|
||||
if (userTextInput) {
|
||||
console.log('Found userText input, attaching listeners');
|
||||
|
||||
// Remove existing listeners to prevent duplicates
|
||||
userTextInput.removeEventListener('focus', handleInputFocus);
|
||||
userTextInput.removeEventListener('blur', handleInputBlur);
|
||||
|
||||
// Add new listeners
|
||||
userTextInput.addEventListener('focus', handleInputFocus);
|
||||
userTextInput.addEventListener('blur', handleInputBlur);
|
||||
|
||||
console.log('Input focus/blur listeners attached successfully');
|
||||
return true;
|
||||
} else {
|
||||
console.log('userText input not found, retrying...');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// Try to attach listeners immediately
|
||||
if (!attachInputListeners()) {
|
||||
// If input not found, set up a mutation observer to wait for it
|
||||
const observer = new MutationObserver((mutations, obs) => {
|
||||
if (attachInputListeners()) {
|
||||
obs.disconnect();
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe(doc.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
|
||||
// Stop observing after 10 seconds
|
||||
setTimeout(() => {
|
||||
observer.disconnect();
|
||||
console.log('Stopped observing for userText input');
|
||||
}, 10000);
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error setting up input focus listeners:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle input focus event
|
||||
function handleInputFocus(event) {
|
||||
console.log('Input focused - userText field');
|
||||
if (!isInputFocused && isMobile) {
|
||||
// alert('focused');
|
||||
isInputFocused = true;
|
||||
// Adjust height when input is focused (keyboard likely open)
|
||||
adjustChatHeight(400); // Smaller height when keyboard is open
|
||||
scrollToBottom();
|
||||
|
||||
// Add scroll to bottom when input is focused
|
||||
setTimeout(() => {
|
||||
scrollToBottom();
|
||||
}, 300); // Small delay to allow height adjustment to complete
|
||||
}
|
||||
}
|
||||
|
||||
// Handle input blur event
|
||||
function handleInputBlur(event) {
|
||||
console.log('Input blurred - userText field');
|
||||
// alert('blurred');
|
||||
if (isInputFocused && isMobile) {
|
||||
isInputFocused = false;
|
||||
// Small delay to ensure keyboard is fully closed
|
||||
setTimeout(() => {
|
||||
// Adjust height when input is blurred (keyboard likely closed)
|
||||
adjustChatHeight(700); // Larger height when keyboard is closed
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
function scrollToBottom() {
|
||||
if (!currentIframe) return;
|
||||
|
||||
try {
|
||||
console.info('CALLED START: scrollToBottom');
|
||||
const doc = currentIframe.contentDocument || currentIframe.contentWindow.document;
|
||||
if (!doc) return;
|
||||
|
||||
const messageArea = doc.querySelector("#messageArea .chat") ||
|
||||
doc.querySelector("#messageArea ol.chat") ||
|
||||
doc.querySelector("ol.chat");
|
||||
|
||||
if (messageArea) {
|
||||
// Scroll to bottom with smooth behavior
|
||||
console.info('CALLED WORKING: scrollToBottom');
|
||||
messageArea.scrollTo({
|
||||
top: messageArea.scrollHeight,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
|
||||
console.info('CALLED ENDs: scrollToBottom');
|
||||
} catch (error) {
|
||||
console.error('Error scrolling to bottom:', error);
|
||||
}
|
||||
}
|
||||
|
||||
function getQueryParams() {
|
||||
const params = {};
|
||||
const queryString = window.location.search;
|
||||
const urlParams = new URLSearchParams(queryString);
|
||||
|
||||
for (const [key, value] of urlParams.entries()) {
|
||||
params[key] = value;
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
// Main initialization
|
||||
window.addEventListener("load", function () {
|
||||
console.log('Page loaded, initializing bot');
|
||||
|
||||
setTimeout(function () {
|
||||
if (window.botmanWidget) {
|
||||
botmanChatWidget.open();
|
||||
|
||||
setTimeout(function(){
|
||||
botmanChatWidget.sayAsBot('Hi ' + (typeof emp_name !== "undefined" && emp_name !== null && emp_name !== "" ? emp_name : "Guest User") + ', This is ILA your Insurance Assistant, plz choose the following options');
|
||||
botmanChatWidget.whisper('Hi');
|
||||
}, 1000);
|
||||
|
||||
applyBotManChatCSS();
|
||||
|
||||
// Multiple attempts to inject CSS with different timings
|
||||
waitForBotmanIframe((chatFrame) => {
|
||||
console.log('Iframe detected, attempting CSS injection');
|
||||
|
||||
// Immediate attempt
|
||||
injectCSS(chatFrame);
|
||||
|
||||
// Delayed attempts for better reliability
|
||||
setTimeout(() => injectCSS(chatFrame), 1000);
|
||||
setTimeout(() => injectCSS(chatFrame), 2000);
|
||||
setTimeout(() => injectCSS(chatFrame), 3000);
|
||||
|
||||
// Listen for iframe load events
|
||||
chatFrame.addEventListener("load", () => {
|
||||
console.log('Iframe loaded event triggered');
|
||||
setTimeout(() => injectCSS(chatFrame), 100);
|
||||
});
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
// Additional fallback - try to inject CSS periodically and setup input listeners
|
||||
setInterval(() => {
|
||||
const iframe = document.querySelector("#chatBotManFrame") ||
|
||||
document.querySelector("iframe[src*='widget']") ||
|
||||
document.querySelector("#botmanChatRoot iframe");
|
||||
|
||||
if (iframe && !currentIframe) {
|
||||
currentIframe = iframe;
|
||||
console.log('Iframe reference updated via periodic check');
|
||||
// Setup input listeners when iframe is found
|
||||
setTimeout(() => setupInputFocusListeners(), 1000);
|
||||
}
|
||||
|
||||
if (iframe && currentIframe) {
|
||||
try {
|
||||
const doc = iframe.contentDocument || iframe.contentWindow.document;
|
||||
const chatElement = doc?.querySelector("#messageArea .chat");
|
||||
|
||||
if (chatElement) {
|
||||
const expectedHeight = isMobile ? (isInputFocused ? 400 : 700) : 800;
|
||||
const actualHeight = parseInt(chatElement.style.height);
|
||||
|
||||
if (actualHeight !== expectedHeight) {
|
||||
console.log('Periodic CSS injection attempt - height mismatch');
|
||||
adjustChatHeight(expectedHeight);
|
||||
}
|
||||
|
||||
// Check if input listeners need to be setup
|
||||
const userTextInput = doc.querySelector('#userText');
|
||||
if (userTextInput && !userTextInput.hasAttribute('data-listeners-attached')) {
|
||||
console.log('Input found without listeners, setting up...');
|
||||
setupInputFocusListeners();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// Silently handle cross-origin errors
|
||||
}
|
||||
}
|
||||
}, 3000);
|
||||
|
||||
// Debug function to manually test height changes
|
||||
window.debugChatHeight = function(height) {
|
||||
console.log('Manual height adjustment:', height);
|
||||
adjustChatHeight(height);
|
||||
};
|
||||
|
||||
// Debug function to check current state
|
||||
window.debugInputState = function() {
|
||||
console.log('Current state:', {
|
||||
isMobile: isMobile,
|
||||
isInputFocused: isInputFocused,
|
||||
currentChatHeight: currentChatHeight,
|
||||
currentIframe: !!currentIframe
|
||||
});
|
||||
|
||||
if (currentIframe) {
|
||||
try {
|
||||
const doc = currentIframe.contentDocument || currentIframe.contentWindow.document;
|
||||
const userTextInput = doc?.querySelector('#userText');
|
||||
console.log('userText input found:', !!userTextInput);
|
||||
if (userTextInput) {
|
||||
console.log('Input is focused:', document.activeElement === userTextInput);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('Cannot access iframe document');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Debug function to manually setup input listeners
|
||||
window.debugSetupInputListeners = function() {
|
||||
console.log('Manually setting up input listeners');
|
||||
setupInputFocusListeners();
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<!-- <script src="https://cdn.jsdelivr.net/npm/botman-web-widget@latest"></script> -->
|
||||
<!-- <script id="botmanWidget" src='https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/js/chat.js'></script> -->
|
||||
|
||||
<!-- <script src='https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/js/widget.js'></script> -->
|
||||
<script src='https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/js/widget.js'></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
84
app/Views/chatbottest.php
Normal file
84
app/Views/chatbottest.php
Normal file
@ -0,0 +1,84 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Insurance ChatBot</title>
|
||||
|
||||
</head>
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
<body>
|
||||
<h1>Welcome to Insurance ChatBot </h1>
|
||||
|
||||
<script>
|
||||
// var botmanWidget = {
|
||||
// frameEndpoint: 'https://localhost/PHP828APPS/ruc/nhance/chat', // This should match your CI4 route
|
||||
// introMessage: "Hi! I am your Insurance Bot. How can I assist you today?",
|
||||
// placeholderText: "Type your message here...",
|
||||
// title: "Insurance Bot",
|
||||
// mainColor: "#5C6BC0",
|
||||
// bubbleBackground: "#673AB7"
|
||||
// };
|
||||
var emp_name = 'Kumar';
|
||||
var uid = Math.floor(100000 + Math.random() * 900000);
|
||||
console.log('CURRENT_USER' + uid);
|
||||
var botmanWidget = {
|
||||
chatServer: `<?=base_url('chat')?>`, // Make sure this URL is correct
|
||||
frameEndpoint: `<?=base_url('widget')?>`, // This should match your CI4
|
||||
title: "Ask ILA",
|
||||
introMessage: "",
|
||||
bubbleBackground: "#007bff",
|
||||
mainColor: "#007bff",
|
||||
placeholderText: "Type your message here...",
|
||||
aboutText: "Insurance Assistant ILA",
|
||||
enableAttachments: false,
|
||||
// Add extra parameters
|
||||
parameters: {
|
||||
employee_id: '12288', //PK of emp
|
||||
session_id: "XYZ789", // token
|
||||
origin: "mobile", // origin
|
||||
emp_code:"HTL-007",
|
||||
client_id:159,
|
||||
client_branch_id:126
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Send a first load request when the chat widget opens
|
||||
// window.addEventListener("load", function () {
|
||||
// setTimeout(function () {
|
||||
// fetch("https://localhost/PHP828APPS/ruc/nhance/chat", {
|
||||
// method: "POST",
|
||||
// headers: { "Content-Type": "application/json" },
|
||||
// body: JSON.stringify({ first_load: "true", user_id: "12345" })
|
||||
// });
|
||||
// }, 2000); // Slight delay to ensure the widget is ready
|
||||
// });
|
||||
|
||||
|
||||
window.addEventListener("load", function () {
|
||||
setTimeout(function () {
|
||||
if (window.botmanWidget) {
|
||||
botmanChatWidget.open();
|
||||
setTimeout(function(){
|
||||
botmanChatWidget.sayAsBot('Hi '+ (typeof emp_name !== "undefined" && emp_name !== null && emp_name !== "" ? emp_name : "Guest User") +',This is ILA your Insurance Assistant, plz choose the following options')
|
||||
botmanChatWidget.whisper('Hi');
|
||||
},3000);
|
||||
|
||||
}
|
||||
}, 2000); // Delay to ensure widget is initialized
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<!-- <script src="https://cdn.jsdelivr.net/npm/botman-web-widget@latest"></script> -->
|
||||
<!-- <script id="botmanWidget" src='https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/js/chat.js'></script> -->
|
||||
|
||||
<!-- <script src='https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/js/widget.js'></script> -->
|
||||
<script src='https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/js/widget.js'></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -111,6 +111,17 @@ input:checked + .slider:before {
|
||||
<label for="gst">GST<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="gst" placeholder="Enter GST Number" data-parsley-error-message="Invalid GST Number. Example: 12ABCDE1234F5Z6" value="<?= isset($client['gst']) ? $client['gst'] : '' ?>" name="gst" data-parsley-trigger="change" data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="parent_client_id">Parent Group<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="parent_client_id" name="parent_client_id">
|
||||
<option value="" >Select Parent</option>
|
||||
<?php foreach($clients as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>" <?= isset($client['parent_client_id']) && $client['parent_client_id'] == $value['id'] ? "selected" : '' ?>><?= $value['client_name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
@ -171,9 +182,10 @@ input:checked + .slider:before {
|
||||
var form_action = '';
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#client_logo').change(function() {
|
||||
validateFile(this);
|
||||
});
|
||||
$('#client_logo').change(function() {
|
||||
validateFile(this);
|
||||
});
|
||||
$('#parent_client_id').select2();
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Insurer Name</th>
|
||||
<th class="font-weight-medium">Insurer Branch Name</th>
|
||||
<th class="font-weight-medium">CD Account Number</th>
|
||||
<th class="font-weight-medium">Current Balance</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
@ -33,6 +34,7 @@
|
||||
<?php foreach ($clientData as $value): ?>
|
||||
|
||||
<td><?php echo $value->insurer_name;?></td>
|
||||
<td><?php echo $value->insurer_branch_name;?></td>
|
||||
<td><?php echo $value->cd_master_account_no;?></td>
|
||||
|
||||
<td>₹
|
||||
|
||||
@ -93,7 +93,7 @@ table.dataTable thead th {
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="<?= base_url("client/list/"); ?><?= $row->id;?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a class="dropdown-item" href="<?= base_url("client/deposit/{$row->id}"); ?>"><i class="mdi mdi-cash mr-2 text-muted font-18 vertical-middle"></i>CD Transactions</a>
|
||||
<?php if(get_role_id() != 3 && get_role_id() != 4) { ?>
|
||||
<?php if(in_array(get_role_id(), [1, 5])) { ?>
|
||||
<a class="dropdown-item" data-id="<?= $row->id;?>" onclick="removeClient(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
@ -316,39 +316,105 @@ $(document).ready(function()
|
||||
});
|
||||
})
|
||||
|
||||
//DO NOT REMOVE THIS FUNCTION >>> THI FUNCTION FOR CLIENT SOFT DELETE
|
||||
// function removeClient(element)
|
||||
// {
|
||||
|
||||
// Swal.fire({
|
||||
// title: "Are you sure?",
|
||||
// text: "You need to remove this client.",
|
||||
// icon: "info",
|
||||
// showCancelButton: true,
|
||||
// confirmButtonColor: "#3085d6",
|
||||
// confirmButtonText: "Yes",
|
||||
// }).then((result) => {
|
||||
|
||||
// if (result.isConfirmed) {
|
||||
|
||||
// $('.loader').fadeIn();
|
||||
// $('.loader-mask').fadeIn();
|
||||
|
||||
// var id = element.getAttribute('data-id');
|
||||
// var form_action = '<?= base_url("client/remove/") ?>' + id;
|
||||
// $.ajax({
|
||||
// url: form_action,
|
||||
// type: "GET",
|
||||
// dataType: 'json',
|
||||
// processData: false,
|
||||
// contentType: false,
|
||||
// success: function(res) {
|
||||
|
||||
// $('.loader').fadeOut();
|
||||
// $('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
// if(res){
|
||||
// if (res.status == true) {
|
||||
// toastr.success('Client removed successfully.', 'success');
|
||||
// location.reload();
|
||||
// } else {
|
||||
// Swal.fire({
|
||||
// title: "warning!",
|
||||
// text: res.message,
|
||||
// icon: "warning"
|
||||
// });
|
||||
// // toastr.warning(res.message, 'warning');
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// error: function (xhr, status, error) {
|
||||
// console.error(xhr.responseText);
|
||||
// console.error(status, error);
|
||||
// $('.loader').fadeOut();
|
||||
// $('.loader-mask').delay(350).fadeOut('slow');
|
||||
// console.log('Something Wrong!', 'warning');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// });
|
||||
|
||||
// }
|
||||
|
||||
function removeClient(element)
|
||||
{
|
||||
{
|
||||
console.log("Remove client function called")
|
||||
console.log('element', element);
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this client.",
|
||||
icon: "info",
|
||||
html: `Is this a Demo Client?, Please reconfirm by clicking Yes to delete. <br> <span style = "color : red; font-size : 14px;">Note : This data will be deleted permanently and cannot be recovered.</span>`,
|
||||
icon: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
}).then((result) => {
|
||||
|
||||
console.log('Print the result : ', result)
|
||||
if (result.isConfirmed) {
|
||||
|
||||
console.log('Click Yes : ', result.isConfirmed);
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
var id = element.getAttribute('data-id');
|
||||
var form_action = '<?= base_url("client/remove/") ?>' + id;
|
||||
console.log('client_id', id);
|
||||
|
||||
var form_action = '<?= base_url("/client/wipe") ?>';
|
||||
console.log('URL : ', form_action);
|
||||
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
type: "GET",
|
||||
type: "POST",
|
||||
data: {client_id : id},
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
console.log('Client remove function response : ', res);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
if(res){
|
||||
if (res.status == true) {
|
||||
toastr.success('Client removed successfully.', 'success');
|
||||
toastr.success(res.message, 'success');
|
||||
location.reload();
|
||||
} else {
|
||||
Swal.fire({
|
||||
@ -358,7 +424,6 @@ function removeClient(element)
|
||||
});
|
||||
// toastr.warning(res.message, 'warning');
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
@ -371,7 +436,6 @@ function removeClient(element)
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('click', '.client_info', function() {
|
||||
|
||||
@ -32,6 +32,13 @@ body {
|
||||
margin: 0 5px 10px!important;
|
||||
}
|
||||
|
||||
.readonly-select {
|
||||
pointer-events: none;
|
||||
/* background-color: #f0f0f0; */
|
||||
background-color: #e0e0e0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
|
||||
@ -1,5 +1,26 @@
|
||||
<div class="tab-pane fade" id="police-tab">
|
||||
<style>
|
||||
|
||||
.save-indicator {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
background: #28a745;
|
||||
color: white;
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
font-size: 11px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
|
||||
.save-indicator.show {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="save-indicator" id="saveIndicator">Saved</div>
|
||||
<div class="tab-pane fade" id="police-tab">
|
||||
|
||||
<div class="row float-right" style="padding-bottom: 10px; position: relative;right: 13px;">
|
||||
<button type="button" id="BtnAdd" class="btn btn-primary waves-effect waves-light btnAdd btn-sm" style="position: relative;right: 10px;"><span class="fa fa-plus-square" aria-hidden="true" style="padding: 5px 10px;"></span>Add Policy</button>
|
||||
@ -7,9 +28,8 @@
|
||||
</div>
|
||||
|
||||
<div class="table-responsive" id="table_list">
|
||||
|
||||
<table class="table table-borderless table mb-0" id="table-client-policy">
|
||||
<thead class="thead-light">
|
||||
<table class="table table-borderless table mb-0" id="table-client-policy">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>Insurer</th>
|
||||
<th>Policy</th>
|
||||
@ -56,7 +76,6 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="policy_type"> Policy Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="policy_type" name="policy_type_id" required>
|
||||
@ -80,10 +99,10 @@
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="insurer">Insurer<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="insurer" name="insurer" required>
|
||||
<select class="form-control" id="insurer" name="insurer" onchange="setInsuerAndBranchValue(this)" required>
|
||||
<option value="">Select Insurer</option>
|
||||
<?php foreach ($insurer as $value) { ?>
|
||||
<option value="<?= $value['id'] . '-' . $value['insurer_id'] ?>">
|
||||
<option data-id="<?= $value['insurer_id']?>" value="<?= $value['id'] . '-' . $value['insurer_id'] ?>">
|
||||
<?= $value['insurer_name'] . '-' . $value['branch_code'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
@ -199,6 +218,7 @@
|
||||
</div>
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end -->
|
||||
|
||||
@ -206,6 +226,7 @@
|
||||
<?php include('policy_gmc_terms.php'); ?>
|
||||
<?php include('policy_gpa_terms.php'); ?>
|
||||
<?php include('other_policy_terms.php'); ?>
|
||||
<?php include('cd_master_add_modal.php'); ?>
|
||||
|
||||
<!-- Center modal content -->
|
||||
<div class="modal fade" id="lead_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="false">
|
||||
@ -237,8 +258,7 @@
|
||||
</div>
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<script>
|
||||
|
||||
<script>
|
||||
// $('#inception_type').change(function () {
|
||||
// var open_data = $('#open_date').parent();
|
||||
// var close_data = $('#close_date').parent();
|
||||
@ -259,6 +279,8 @@
|
||||
|
||||
var policy_PrimaryKey = $('#client_id_policy').val();
|
||||
var policy_client = $('#policy_PrimaryKey').val();
|
||||
var submitInterval = null;
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
// Initialize select2
|
||||
@ -325,6 +347,7 @@
|
||||
|
||||
|
||||
if (policy_PrimaryKey !== '') {
|
||||
|
||||
var policyTable = '';
|
||||
var data = <?= isset($client_policy) ? json_encode($client_policy) : '[]' ?>;
|
||||
console.log('client_policy_data',data)
|
||||
@ -395,7 +418,7 @@
|
||||
<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>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyMaster" data-toggle="modal"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyMaster" ><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>`;
|
||||
|
||||
// Conditionally render the delete option based on the role
|
||||
@ -639,7 +662,7 @@
|
||||
<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>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyMaster" data-toggle="modal"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyMaster" ><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>`;
|
||||
|
||||
// Conditionally render the delete option based on the role
|
||||
@ -690,36 +713,43 @@
|
||||
$('#insurer').change(function() {
|
||||
|
||||
var id = $(this).val();
|
||||
var insurer_id = $(this).find('option:selected').data('id');
|
||||
console.log('insurer_id', insurer_id)
|
||||
console.log('insurer and branch ids', id)
|
||||
var client_id = $('#client_id_policy').val()
|
||||
var parts = id.split('-');
|
||||
|
||||
var firstPart = parts[0];
|
||||
var secondPart = parts[1];
|
||||
|
||||
console.log('firstPart', firstPart);
|
||||
console.log('secondPart', secondPart);
|
||||
|
||||
var url = "<?= base_url("util/police-by-insurer/") ?>" + secondPart;
|
||||
var url_for_cd = "<?= base_url("util/get_cd_ac/") ?>" + client_id + '/' + secondPart;
|
||||
var url_for_cd = "<?= base_url("util/get_cd_ac/") ?>" + client_id + '/' + secondPart + '/' + firstPart;
|
||||
|
||||
var selectedOption = $('#base_policy').find(':selected');
|
||||
var base_policy_data_id = selectedOption.data('id');
|
||||
|
||||
if(secondPart && firstPart){
|
||||
$.get(url_for_cd, function(response){
|
||||
|
||||
|
||||
$.get(url_for_cd, function(response){
|
||||
|
||||
// console.log(response)
|
||||
// console.log(response.data)
|
||||
|
||||
if(response.status == false && response.insurer_id != 'undefined'){
|
||||
toastr.warning('The CD Account Number not found.', 'Warning');
|
||||
return;
|
||||
}
|
||||
|
||||
appendCDACNO(response.data)
|
||||
|
||||
}).fail(function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
});
|
||||
// console.log(response)
|
||||
// console.log(response.data)
|
||||
|
||||
if(response.status == false && response.insurer_id != 'undefined'){
|
||||
toastr.warning('The CD Account Number not found.', 'Warning');
|
||||
return;
|
||||
}
|
||||
appendCDACNO(response.data)
|
||||
|
||||
}).fail(function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
@ -1099,7 +1129,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function checkDateStatus(inputDate, bg = false) {
|
||||
|
||||
var givenDate = new Date(inputDate);
|
||||
@ -1204,7 +1233,6 @@
|
||||
return word.trim();
|
||||
}
|
||||
|
||||
|
||||
function convertCommaNumberToWords(input) {
|
||||
|
||||
let number;
|
||||
@ -1244,7 +1272,6 @@
|
||||
return result.trim();
|
||||
}
|
||||
|
||||
|
||||
function onlyNumbers(event) {
|
||||
var charcode;
|
||||
charcode = event.which || event.keyCode;
|
||||
@ -1252,7 +1279,6 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function formatNumber(input, maxLength) {
|
||||
|
||||
//console.log("input", input);
|
||||
@ -1344,7 +1370,6 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
$('#policy_type').change(function() {
|
||||
|
||||
$('#insurer').val('').change();
|
||||
@ -1683,19 +1708,28 @@
|
||||
text: 'Select CD Account Number'
|
||||
}));
|
||||
|
||||
$('#cd_ac_no').append($('<option>', {
|
||||
value: 'add_cd',
|
||||
text: '+ Add New CD'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
const option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.cd_ac_no
|
||||
});
|
||||
|
||||
if (select === item.id) {
|
||||
if (select == item.id) {
|
||||
//console.log('selected');
|
||||
option.attr('selected', true);
|
||||
}
|
||||
|
||||
$('#cd_ac_no').append(option);
|
||||
});
|
||||
|
||||
if (select) {
|
||||
$('#cd_ac_no').val(select).trigger('change');
|
||||
}
|
||||
}
|
||||
|
||||
// append Base Policy to the dropdown for edit only
|
||||
@ -2095,4 +2129,148 @@
|
||||
});
|
||||
}
|
||||
|
||||
// for CD master
|
||||
$('#cd_ac_no').change(function(){
|
||||
|
||||
let cd_ac_no = $(this).val();
|
||||
|
||||
if(cd_ac_no == "add_cd"){
|
||||
showCdMasterAddModal();
|
||||
$(this).val("");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
function setInsuerAndBranchValue(input){
|
||||
|
||||
var id = $(input).val();
|
||||
console.log('id', id);
|
||||
|
||||
var parts = id.split('-');
|
||||
console.log('parts', parts);
|
||||
|
||||
var firstPart = parts[0];
|
||||
console.log('firstPart', firstPart);
|
||||
|
||||
var secondPart = parts[1];
|
||||
console.log('secondPart', secondPart);
|
||||
|
||||
$('#insurer_branch_id').val(firstPart).trigger('change');
|
||||
$('#insurer_id_for_cd').val(secondPart).trigger('change');
|
||||
}
|
||||
// End
|
||||
|
||||
function numberToWordsIndian(num) {
|
||||
|
||||
num = num.toString();
|
||||
if (typeof num === 'string') {
|
||||
// Remove all commas and convert to number
|
||||
num = parseFloat(num.replace(/,/g, ''));
|
||||
// Check if conversion resulted in NaN
|
||||
if (isNaN(num)) {
|
||||
return "invalid number";
|
||||
}
|
||||
}
|
||||
|
||||
if (num === 0) return "zero";
|
||||
if (num < 0) return "minus " + numberToWordsIndian(-num);
|
||||
|
||||
const ones = [
|
||||
"", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",
|
||||
"ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen",
|
||||
"seventeen", "eighteen", "nineteen"
|
||||
];
|
||||
|
||||
const tens = [
|
||||
"", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"
|
||||
];
|
||||
|
||||
function convertHundreds(n) {
|
||||
let result = "";
|
||||
|
||||
if (n >= 100) {
|
||||
result += ones[Math.floor(n / 100)] + " hundred";
|
||||
n %= 100;
|
||||
if (n > 0) result += " ";
|
||||
}
|
||||
|
||||
if (n >= 20) {
|
||||
result += tens[Math.floor(n / 10)];
|
||||
n %= 10;
|
||||
if (n > 0) result += " " + ones[n];
|
||||
} else if (n > 0) {
|
||||
result += ones[n];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
let result = "";
|
||||
let crores = Math.floor(num / 10000000);
|
||||
num %= 10000000;
|
||||
|
||||
let lakhs = Math.floor(num / 100000);
|
||||
num %= 100000;
|
||||
|
||||
let thousands = Math.floor(num / 1000);
|
||||
num %= 1000;
|
||||
|
||||
let hundreds = num;
|
||||
|
||||
if (crores > 0) {
|
||||
result += convertHundreds(crores) + " crore";
|
||||
if (lakhs > 0 || thousands > 0 || hundreds > 0) result += " ";
|
||||
}
|
||||
|
||||
if (lakhs > 0) {
|
||||
result += convertHundreds(lakhs) + " lakh";
|
||||
if (thousands > 0 || hundreds > 0) result += " ";
|
||||
}
|
||||
|
||||
if (thousands > 0) {
|
||||
result += convertHundreds(thousands) + " thousand";
|
||||
if (hundreds > 0) result += " ";
|
||||
}
|
||||
|
||||
if (hundreds > 0) {
|
||||
result += convertHundreds(hundreds);
|
||||
}
|
||||
|
||||
return result.trim();
|
||||
}
|
||||
|
||||
// Start the interval
|
||||
function startAutoSubmit(attrId) {
|
||||
if (!submitInterval) {
|
||||
submitInterval = setInterval(function() {
|
||||
if(attrId == "GMC"){
|
||||
autoSaveGmcTerms();
|
||||
}else if(attrId == "GPA"){
|
||||
autoSaveGpaTerms();
|
||||
}else if(attrId == "OTHERS"){
|
||||
autoSaveOtherTerms();
|
||||
}
|
||||
}, 20000);
|
||||
console.log("Auto-submit started.");
|
||||
}
|
||||
}
|
||||
|
||||
// Stop the interval
|
||||
function stopAutoSubmit() {
|
||||
if (submitInterval) {
|
||||
clearInterval(submitInterval);
|
||||
submitInterval = null;
|
||||
console.log("Auto-submit stopped.");
|
||||
}
|
||||
}
|
||||
|
||||
//Tiny Toastr
|
||||
function showTinyToast(attrId = "saveIndicator"){
|
||||
const saveIndicator = document.getElementById(attrId);
|
||||
saveIndicator.classList.add('show');
|
||||
setTimeout(() => {
|
||||
saveIndicator.classList.remove('show');
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -89,7 +89,7 @@ input:checked + .slider:before {
|
||||
<input id="addition_add_day" type="checkbox" name="addition_add_day" <?= (isset($insurer['addition_add_day']) && $insurer['addition_add_day'] == 1) ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
<label for="addition_add_day" style="position: relative;top: 30px;left: 82px;">Add one day to date of coverage when Addition/Dependent addition</label>
|
||||
<label for="addition_add_day" style="position: relative;top: 30px;left: 82px;">Add one day to date of coverage when <br> Addition/Dependent addition</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
|
||||
@ -80,7 +80,7 @@
|
||||
<th>S.NO</th>
|
||||
<th>Policy Type</th>
|
||||
<th>Event Type</th>
|
||||
<th>Import/Export</th>
|
||||
<th>Upload/Download</th>
|
||||
<th>Template</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
@ -92,7 +92,7 @@
|
||||
<td><?= $key+1; ?></td>
|
||||
<td><?= $value['policy_type']; ?></td>
|
||||
<td><?= $events[$value['event_name']]; ?></td>
|
||||
<td><?= $value['type_name']; ?></td>
|
||||
<td><?= $value['type_name'] == 'import' ? 'Upload' : 'Download'; ?></td>
|
||||
<td style="overflow: hidden;" class="truncate" ><?= $value['jsoncolumns']; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
@ -471,13 +471,14 @@
|
||||
const newRow = document.createElement('div');
|
||||
newRow.className = 'form-row dynamic-form-row';
|
||||
newRow.innerHTML = `
|
||||
<div class="form-group col-md-5">
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="excel_column_name">Header Name<span class="text-danger">*</span></label>
|
||||
<input id="excel_column_name" value="${data !== null && data !== undefined && data !== '' ? data.column_name : ''}" class="form-control" type="text" name="excel_column_name[]" placeholder="Excel Header Column Name">
|
||||
</div>
|
||||
<div class="form-group col-md-5">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="db_column_name">DataBase Column Name<span class="text-danger"></span></label>
|
||||
<select class="form-control db-column-name-select" name="db_column_name[]" onchange="checkForDuplicates(this)">
|
||||
<select class="form-control db-column-name-select dbColumn" name="db_column_name[]" onchange="checkForDuplicates(this)" ${data !== null && data !== undefined && data !== '' && data.default_value != "" && data.default_value != null ? 'disabled' : ''}>
|
||||
<option value="" selected >Select</option>
|
||||
<?php if (!empty($db_column_name)){ ?>
|
||||
<?php foreach ($db_column_name as $key => $value) { ?>
|
||||
@ -486,17 +487,25 @@
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="default_value">Default Value<span class="text-danger"></span></label>
|
||||
<input id="default_value" value="${data != null && data != undefined && data != '' && data.default_value != "" && data.default_value != null ? data.default_value : ''}" class="form-control" type="text" name="default_value[]" placeholder="Excel Default value">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2" style="position: relative;top: 28px;">
|
||||
<a class="btn btn-primary waves-effect waves-light mr-1" onclick="addHTMLInput(this)">+</a>
|
||||
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this)">x</a>
|
||||
</div>
|
||||
`;
|
||||
container.appendChild(newRow);
|
||||
|
||||
if (data !== null && data.db_column_name !== undefined) {
|
||||
if (data != null && data.db_column_name != undefined) {
|
||||
const selectElement = newRow.querySelector('.db-column-name-select');
|
||||
selectElement.value = data.db_column_name;
|
||||
$('.dbColumn').select2();
|
||||
}
|
||||
|
||||
$('.dbColumn').select2();
|
||||
}
|
||||
|
||||
// function removeHTMLInput(element)
|
||||
@ -523,6 +532,7 @@
|
||||
|
||||
try {
|
||||
var columnNames = $('input[name="excel_column_name[]"]');
|
||||
var defaultValues = $('input[name="default_value[]"]');
|
||||
var dbColumnNames = $('select[name="db_column_name[]"]');
|
||||
|
||||
// Check if both arrays are of the same length
|
||||
@ -534,6 +544,7 @@
|
||||
columnNames.each(function(index) {
|
||||
var columnName = $(this).val();
|
||||
var dbColumnName = dbColumnNames.eq(index).val() ?? null;
|
||||
var defaultValue = defaultValues.eq(index).val() ?? null;
|
||||
|
||||
// if (!columnName) {
|
||||
// throw new Error(`Column name at index ${index} is empty.`);
|
||||
@ -545,7 +556,8 @@
|
||||
var columnObj = {
|
||||
'column_index': index,
|
||||
'column_name': columnName,
|
||||
'db_column_name': dbColumnName
|
||||
'db_column_name': dbColumnName,
|
||||
'default_value': defaultValue
|
||||
};
|
||||
formArray.push(columnObj);
|
||||
});
|
||||
@ -695,4 +707,17 @@
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('input', 'input[name="default_value[]"]', function () {
|
||||
let $defaultInput = $(this);
|
||||
let $row = $defaultInput.closest('.form-row, .row'); // Adjust based on your actual container
|
||||
let $dbSelect = $row.find('select[name="db_column_name[]"]');
|
||||
|
||||
if ($defaultInput.val().trim() !== '') {
|
||||
$dbSelect.val('').trigger('change').prop('disabled', true);
|
||||
} else {
|
||||
$dbSelect.prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@ -33,7 +33,7 @@
|
||||
<li class="nav-item">
|
||||
<a href="#template-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="insurer_export_templete">
|
||||
<span class="mr-1"><i class="mdi mdi-file-export font-16"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Insurer Export Templete</span>
|
||||
<span class="d-none d-sm-inline-block">Insurer Download Templete</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
@ -653,10 +653,8 @@
|
||||
|
||||
});
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
$('#import_excel_download').click(function() {
|
||||
|
||||
// Check if the element with ID "import_excel_download" has the href attribute set
|
||||
@ -682,4 +680,87 @@
|
||||
}
|
||||
});
|
||||
|
||||
//------------- CHECK CD BALANCE in SESSION -----------------------------------------------------------------------------------------
|
||||
|
||||
// Global variables
|
||||
var submitInterval = null;
|
||||
var messageShown = false; // Flag to prevent duplicate messages
|
||||
|
||||
//function for checking the session
|
||||
function checkCDBalance() {
|
||||
|
||||
<?php if (session()->has('cd_balance')): ?>
|
||||
var cdBalance = <?php echo json_encode(session()->get('cd_balance')); ?>;
|
||||
var cdAmount = <?php echo json_encode(session()->get('cd_amount')); ?>;
|
||||
var excel_file_amt = <?php echo json_encode(session()->get('excel_file_amt')); ?>;
|
||||
|
||||
console.log("cdBalance : ", cdBalance);
|
||||
console.log("cdAmount : ", cdAmount);
|
||||
console.log("excel_file_amt : ", excel_file_amt);
|
||||
|
||||
// Only show message once and if status is false
|
||||
if (cdBalance === false && !messageShown) {
|
||||
// toastr.warning('Insufficient CD Balance deducated. Please wait the file will be downloaded', 'WARNING');
|
||||
var message1 = 'Insufficient CD Balance deducted. Please wait the file will be downloaded<br>' +
|
||||
'<strong>CD Amount:</strong> ₹' + (cdAmount || 0) + '<br>' +
|
||||
'<strong>Total Amount:</strong> ₹' + (excel_file_amt || 0);
|
||||
|
||||
toastr.warning(message1, 'WARNING', {
|
||||
allowHtml: true,
|
||||
timeOut: 10000,
|
||||
extendedTimeOut: 3000
|
||||
});
|
||||
messageShown = true; // Prevent showing message again
|
||||
stopInterval();
|
||||
} else if (cdBalance === true) {
|
||||
console.log("CD Balance is sufficient");
|
||||
stopInterval();
|
||||
}
|
||||
|
||||
<?php
|
||||
session()->remove('cd_balance');
|
||||
session()->remove('cd_amount');
|
||||
session()->remove('excel_file_amt');
|
||||
?>
|
||||
|
||||
<?php else: ?>
|
||||
console.log("No cd_balance session found");
|
||||
<?php endif; ?>
|
||||
}
|
||||
|
||||
// Start the interval
|
||||
function startInterval() {
|
||||
if (!submitInterval) {
|
||||
messageShown = false; // Reset message flag
|
||||
submitInterval = setInterval(function() {
|
||||
checkCDBalance();
|
||||
}, 2000);
|
||||
console.log("Checking CD balance started...");
|
||||
}
|
||||
}
|
||||
|
||||
// Stop the interval
|
||||
function stopInterval() {
|
||||
if (submitInterval) {
|
||||
clearInterval(submitInterval);
|
||||
submitInterval = null;
|
||||
<?php
|
||||
session()->remove('cd_balance');
|
||||
session()->remove('cd_amount');
|
||||
session()->remove('excel_file_amt');
|
||||
?>
|
||||
console.log("Interval stopped.");
|
||||
}
|
||||
}
|
||||
|
||||
// When click the button to start the interval
|
||||
$(document).ready(function() {
|
||||
$('#emp_form_submit_button_2').on('click', function() {
|
||||
console.log("Submit button clicked, starting interval...");
|
||||
startInterval();
|
||||
});
|
||||
});
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
</script>
|
||||
@ -170,7 +170,7 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 freshFields">
|
||||
<!-- <div class="form-group col-md-3 freshFields">
|
||||
<label for="client_type">Client Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="client_type" name="client_type" required>
|
||||
<option value="">Select Client type</option>
|
||||
@ -182,7 +182,7 @@
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-3 freshFields">
|
||||
<label for="entity_type_id">Entity Type<span class="text-danger">*</span></label>
|
||||
@ -210,7 +210,7 @@
|
||||
placeholder="Enter Client Short Name" onkeyup="validateInput(this, 'clients', 'short_name')" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 renewalFields" style="display: none;">
|
||||
<!-- <div class="form-group col-md-3 renewalFields" style="display: none;">
|
||||
<label for="source_policy_id"> Source Policy <span id="base_danger"
|
||||
class="text-danger">*</span></label>
|
||||
<select class="form-control" id="source_policy_id" name="source_policy_id">
|
||||
@ -226,14 +226,14 @@
|
||||
<div class="form-group col-md-3 renewalFields" style="display: none;">
|
||||
<label for="source_policy_end_date">Source Policy End Date<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="source_policy_end_date" name="source_policy_end_date" readonly>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<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" name="pan"
|
||||
data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$">
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
<!-- end client row -->
|
||||
@ -263,15 +263,14 @@
|
||||
placeholder="Enter Branch Code" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="contact_person_summary">Contact Person's</label>
|
||||
<div class="form-group col-md-3 renewalFields">
|
||||
<label for="contact_person_summary">Contact Person</label>
|
||||
<select class="form-control" name="contact_person_summary" id="contact_person_summary">
|
||||
<option value="">Select a Person</option>
|
||||
<option value="">Select a Contact</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<div class="form-group col-md-3 freshFields">
|
||||
<label for="client_branch">Contact Person Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="contact_person_name" name="contact_person_name"
|
||||
placeholder="Enter Contact Name" required>
|
||||
@ -302,9 +301,9 @@
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="salse_person_id">Salse Person<span class="text-danger">*</span></label>
|
||||
<label for="salse_person_id">Sales Person<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="salse_person_id" name="salse_person_id" multiple required>
|
||||
<option value="">Select Salse Person</option>
|
||||
<option value="">Select Sales Person</option>
|
||||
<?php if (isset($salse_team)) { ?>
|
||||
<?php foreach ($salse_team as $value) { ?>
|
||||
<option value="<?= $value['id']; ?>">
|
||||
@ -337,7 +336,7 @@
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="notes">Note</label>
|
||||
<label for="notes">Remarks</label>
|
||||
<textarea class="form-control" id="notes" name="notes" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@ -771,7 +770,8 @@
|
||||
|
||||
if (value.name && value.email) {
|
||||
|
||||
let display_value = `${value.name} - ${value.email} - ${value.mobile}`;
|
||||
// let display_value = `${value.name} - ${value.email} - ${value.mobile}`;
|
||||
let display_value = value.name;
|
||||
|
||||
$('#contact_person_summary').append($('<option>', {
|
||||
value: key, // index or key in array/object
|
||||
@ -1059,6 +1059,24 @@
|
||||
// Main div
|
||||
newRow.innerHTML += `
|
||||
|
||||
<div class="form-group col-md-3 renewalFields" style="display: none;">
|
||||
<label for="source_policy_id"> Source Policy <span id="base_danger"
|
||||
class="text-danger">*</span></label>
|
||||
<select class="form-control" id="source_policy_id" name="source_policy_id">
|
||||
<option value="" selected>Select Source Policy</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 renewalFields" style="display: none;">
|
||||
<label for="source_policy_start_date">Source Policy Start Date<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control readonly-select" id="source_policy_start_date" name="source_policy_start_date" readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 renewalFields" style="display: none;">
|
||||
<label for="source_policy_end_date">Source Policy End Date<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="source_policy_end_date" name="source_policy_end_date" readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="policy_type_id">Policy Type <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="policy_type_id_${increment}" name="policy_type_id[]" onchange="getCustomFields(this, ${increment})" required>
|
||||
@ -2054,8 +2072,10 @@
|
||||
$("#client_branch_id").select2();
|
||||
|
||||
if ($(this).is(':checked')) {
|
||||
|
||||
$('#client_id').closest('.form-group').show();
|
||||
$('#client_branch_id').closest('.form-group').show();
|
||||
$('#contact_person_summary').closest('.form-group').show();
|
||||
|
||||
$('#client_type').addClass('readonly-select');
|
||||
$('#entity_type_id').addClass('readonly-select');
|
||||
@ -2066,9 +2086,20 @@
|
||||
$("#client_id").prop("required", true);
|
||||
$("#client_branch_id").prop("required", true);
|
||||
|
||||
$("#contact_person_summary").prop("required", true);
|
||||
|
||||
$("#contact_person_name").prop("required", false);
|
||||
$('#contact_person_name').closest('.form-group').hide();
|
||||
|
||||
$("#client_name").prop("required", false);
|
||||
$('#client_name').closest('.form-group').hide();
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$('#client_id').closest('.form-group').hide();
|
||||
$('#client_branch_id').closest('.form-group').hide();
|
||||
$('#contact_person_summary').closest('.form-group').hide();
|
||||
|
||||
$('#client_type').removeClass('readonly-select');
|
||||
$('#entity_type_id').removeClass('readonly-select');
|
||||
@ -2078,6 +2109,14 @@
|
||||
|
||||
$("#client_id").prop("required", false);
|
||||
$("#client_branch_id").prop("required", false);
|
||||
|
||||
$("#contact_person_summary").prop("required", false);
|
||||
|
||||
$("#contact_person_name").prop("required", true);
|
||||
$('#contact_person_name').closest('.form-group').show();
|
||||
|
||||
$("#client_name").prop("required", true);
|
||||
$('#client_name').closest('.form-group').show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -165,7 +165,7 @@ if (isset($selected_lead_type)) {
|
||||
$('#client_id').select2();
|
||||
$('#client_branch_id').select2();
|
||||
$('#salse_person_id').select2({
|
||||
placeholder: "Select Salse Person",
|
||||
placeholder: "Select Sales Person",
|
||||
});
|
||||
|
||||
$('#policy_type_id').select2();
|
||||
|
||||
@ -63,7 +63,85 @@ table.dataTable tbody td {
|
||||
background-color: #f8f9fa !important;
|
||||
color: #16181b !important;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
}
|
||||
|
||||
.addbtnStyle{
|
||||
margin-left: 20px !important;
|
||||
}
|
||||
|
||||
/* Modeal class */
|
||||
.modal-content {
|
||||
border-radius: 4px;
|
||||
border: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
background: #f8f9fa;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
padding: 1rem 1.5rem;
|
||||
}
|
||||
|
||||
.modal-title {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 500;
|
||||
color: #495057;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.policy-label {
|
||||
font-weight: 500;
|
||||
color: #495057;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.radio-option {
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 4px;
|
||||
padding: 0.75rem 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.radio-option:hover {
|
||||
border-color: #007bff;
|
||||
background: #f8f9fa;
|
||||
}
|
||||
|
||||
.radio-option.selected {
|
||||
border-color: #007bff;
|
||||
background: #e7f3ff;
|
||||
}
|
||||
|
||||
.form-check {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.form-check-input {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
.form-check-label {
|
||||
cursor: pointer;
|
||||
font-weight: normal;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
border-top: 1px solid #dee2e6;
|
||||
padding: 1rem 1.5rem;
|
||||
}
|
||||
|
||||
.btn {
|
||||
font-size: 0.9rem;
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
|
||||
/* Modeal class */
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@ -77,7 +155,7 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
|
||||
<div class="col-3" id="status_change" style="text-align: right; position: relative;top: 56px; left: 291px;">
|
||||
<button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" onclick="openLeadTypeAskModal();">Add</button>
|
||||
<!-- <button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" onclick="openLeadTypeAskModal();">Add</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
@ -130,11 +208,13 @@ table.dataTable tbody td {
|
||||
<a href="<?= base_url('/rfq/list/').$row['id'] . '/' . 1; ?>" class="dropdown-item btnEdit2" data-id="<?= $row['id']; ?>">
|
||||
<i class="mdi mdi-note-text mr-2 text-muted font-18 vertical-middle"></i>RFQ
|
||||
</a>
|
||||
<!-- <?php if($row['qcr_count'] > 0) { ?>
|
||||
<a href="<?= base_url('/rfq/list/').$row['id'] . '/' . 2; ?>" class="dropdown-item btnEdit" data-id="<?= $row['id']; ?>">
|
||||
<i class="mdi mdi-note-text mr-2 text-muted font-18 vertical-middle"></i>QCR
|
||||
</a>
|
||||
<?php } ?> -->
|
||||
<?php if(!in_array($row['status'], ['queued', 'rfq_created', 'rfq_sent'])) { ?>
|
||||
<?php if(in_array(get_role_id(), [1, 5, 2, 3]) || in_array(BUSINESS_SUPPORT_TEAM_ID, user_team()) ) { ?>
|
||||
<a href="<?= base_url('/rfq/list/').$row['id'] . '/' . 2; ?>" class="dropdown-item btnEdit3" data-id="<?= $row['id']; ?>">
|
||||
<i class="mdi mdi-note-text mr-2 text-muted font-18 vertical-middle"></i>QCR
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
@ -155,26 +235,31 @@ table.dataTable tbody td {
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade" id="New_Lead_modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myCenterModalLabel"></h4>
|
||||
<h4 class="modal-title" id="myCenterModalLabel">Select Leaad Type</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="lead_form_type"> Policy Type <span class="text-danger"></span></label>
|
||||
<select class="form-control" id="openLeadTypeAskModal">
|
||||
<option value="1">Lead EB</option>
|
||||
<option value="2">Lead Non-EB</option>
|
||||
</select>
|
||||
|
||||
<div class="radio-option selected" onclick="selectOption(this, 'lead_eb')">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="lead_form_type" id="lead_eb" value="1" checked>
|
||||
<label class="form-check-label" for="lead_eb">Lead EB</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="radio-option" onclick="selectOption(this, 'lead_non_eb')">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="lead_form_type" id="lead_non_eb" value="2">
|
||||
<label class="form-check-label" for="lead_non_eb">Lead Non-EB</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-primary" onclick="submitToRedirectLeadNewUrl(this)">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -293,18 +378,27 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
// scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-7'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Policy-Tranction-Inception-List',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
}, ],
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Policy-Tranction-Inception-List',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
},
|
||||
{
|
||||
text: 'Add',
|
||||
className: 'buttons-html5 addbtnStyle',
|
||||
action: function (e, dt, node, config) {
|
||||
openLeadTypeAskModal();
|
||||
}
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
@ -327,7 +421,8 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
console.log('function called')
|
||||
|
||||
let Lead_type = $('#openLeadTypeAskModal').val()
|
||||
// let Lead_type = $('#openLeadTypeAskModal').val()
|
||||
let Lead_type = $('input[name="lead_form_type"]:checked').val();
|
||||
console.log('Lead_type ', Lead_type)
|
||||
let url = '<?=base_url('/util/getLeadNonEB/')?>' + Lead_type
|
||||
console.log('url ', url)
|
||||
@ -346,3 +441,32 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function selectOption(element, radioId) {
|
||||
// Remove selected class from all options
|
||||
document.querySelectorAll('.radio-option').forEach(option => {
|
||||
option.classList.remove('selected');
|
||||
});
|
||||
|
||||
// Add selected class to clicked option
|
||||
element.classList.add('selected');
|
||||
|
||||
// Check the corresponding radio button
|
||||
document.getElementById(radioId).checked = true;
|
||||
}
|
||||
|
||||
// Add click event to radio inputs directly
|
||||
document.querySelectorAll('input[name="lead_form_type"]').forEach(radio => {
|
||||
radio.addEventListener('change', function() {
|
||||
// Remove selected class from all options
|
||||
document.querySelectorAll('.radio-option').forEach(option => {
|
||||
option.classList.remove('selected');
|
||||
});
|
||||
|
||||
// Add selected class to parent of checked radio
|
||||
this.closest('.radio-option').classList.add('selected');
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@ -363,7 +363,7 @@
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="notes">Note</label>
|
||||
<label for="notes">Remarks</label>
|
||||
<textarea class="form-control" id="notes" name="notes" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -97,8 +97,6 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<div id="policyGMCTerms" style="display:none">
|
||||
<span id="policyGMCTermsClose"
|
||||
style="float: right;font-size: 26px;color: red;margin-top: -42px;margin-left: 3px;margin-right: 7px;">x</span>
|
||||
@ -878,7 +876,6 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var policy_grid_id = $('#client_id').val();
|
||||
var grid_html = '';
|
||||
@ -1012,7 +1009,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var specialConditions = [];
|
||||
|
||||
$(".removeDom").each(function() {
|
||||
@ -1086,7 +1082,6 @@
|
||||
}, 500);
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '.btnPolicyMaster', function() {
|
||||
// alert("HELLO");
|
||||
|
||||
@ -1127,18 +1122,16 @@
|
||||
}, 1000);
|
||||
// $('#nameOfThePolicyInGMC').html(' - ' + response.policy_name.name);
|
||||
$('gmc_emp_count').val(response.count);
|
||||
|
||||
|
||||
|
||||
if (response) {
|
||||
|
||||
if (response.emp_count_by_policy != 0) {
|
||||
|
||||
$('#btnGridSubmit1').hide();
|
||||
$('#myButtonSpecialCondition').hide();
|
||||
|
||||
} else {
|
||||
$('#btnGridSubmit1').show();
|
||||
$('#myButtonSpecialCondition').show();
|
||||
startAutoSubmit('GMC');
|
||||
}
|
||||
|
||||
let jsonObject = JSON.parse(response.data);
|
||||
@ -1558,27 +1551,12 @@
|
||||
$("#numberToWordGMC").text("");
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Jodit RTE -->
|
||||
<script>
|
||||
// $(document).ready(function() {
|
||||
// var editor = new Jodit('#additionalsicknessbenefit', {
|
||||
// buttons: 'bold,italic,underline,|,align,alignCenter,alignRight,alignJustify',
|
||||
// });
|
||||
|
||||
// var editor = new Jodit('#Wellness', {
|
||||
// buttons: 'bold,italic,underline,|,align,alignCenter,alignRight,alignJustify',
|
||||
// });
|
||||
// });
|
||||
//
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<!-- Policy terms Add Special Condition -->
|
||||
<script>
|
||||
|
||||
document.getElementById('myButtonSpecialCondition').addEventListener('click', function(event) {
|
||||
//console.log('specialCondition callback clicked')
|
||||
event.preventDefault();
|
||||
@ -1632,7 +1610,6 @@
|
||||
'multiple_sum_insured'
|
||||
];
|
||||
|
||||
|
||||
function specialCondition(count = 0) {
|
||||
|
||||
//console.log('specialCondition function called')
|
||||
@ -1670,6 +1647,10 @@
|
||||
|
||||
// Close the Policy terms
|
||||
$(document).on('click', '#policyGMCTermsClose', function() {
|
||||
|
||||
//clear the intervel for the autosave
|
||||
stopAutoSubmit();
|
||||
|
||||
$('#policyGMCTerms').css('display', 'none');
|
||||
$('#police-tab').css('display', '');
|
||||
$('.nav.nav-pills.navtab-bg').css('display', '');
|
||||
@ -1930,4 +1911,64 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function autoSaveGmcTerms()
|
||||
{
|
||||
|
||||
console.log("autoSaveGmcTerms function called");
|
||||
|
||||
var specialConditions = [];
|
||||
|
||||
$(".removeDom").each(function() {
|
||||
var isChecked = $(this).find("input[name='special_condition_display[]']").is(":checked");
|
||||
|
||||
if (isChecked) {
|
||||
var label = $(this).find("input[name='special_condition_label[]']").val();
|
||||
var input = $(this).find("input[name='special_condition_input[]']").val();
|
||||
|
||||
specialConditions.push({
|
||||
[label]: input
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log("specialConditions", specialConditions);
|
||||
|
||||
var formData = new FormData($('#policyJsonForm')[0]);
|
||||
console.log("formData", formData);
|
||||
|
||||
var policy_form_action = '<?= base_url("client/policy/policyGMCTerms") ?>';
|
||||
console.log("policy_form_action", policy_form_action);
|
||||
|
||||
formData.append("special_condition_display_value", JSON.stringify(specialConditions));
|
||||
// console.log('formData', formData);
|
||||
formData.forEach((value, key) => {
|
||||
// console.log(key + ':', value);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: policy_form_action,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
console.log('Auto Save Response : ', res);
|
||||
|
||||
if (res.status == true) {
|
||||
showTinyToast();
|
||||
}else{
|
||||
console.log('Policy terms Dose Not save', 'Error');
|
||||
return;
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
@ -189,6 +189,7 @@ $(document).on('click', '.close', function() {
|
||||
|
||||
var rarc_rate_json_array = [];
|
||||
|
||||
//Submit function
|
||||
$(document).on('submit', 'form[id^="GridForm_"]', function(event) {
|
||||
console.log('submitted function called')
|
||||
event.preventDefault(); // Prevent the default form submission
|
||||
@ -619,8 +620,6 @@ $('body').on('click', '.btnPolicyModel', function()
|
||||
$('#no_data').html('The policy has no Policy Rack Rate');
|
||||
toastr.warning("The policy has no Policy Rack Rate", "Warning")
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$(document).on('change', 'select[id^="grid_"]', function(event)
|
||||
|
||||
@ -421,15 +421,15 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="bp_cgst">Latest Action Date</label>
|
||||
<input id="last_action_date" type="text" class="form-control" name="last_action_date" placeholder="DD/MM/YYYY">
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="fund_received">Fund Recd / Sent to Insurer</label>
|
||||
<input id="fund_received" value="" type="text" class="form-control" name="fund_received">
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label class="switch" style="position: relative;top: 32px;left: 20px;">
|
||||
@ -2983,16 +2983,18 @@ function getCDAccountNumber(input)
|
||||
let client_id = $('#client_id').val();
|
||||
let client_type = $('#client_type').val();
|
||||
let insurer_id = $(input).find('option:selected').attr('data-id');
|
||||
let insurer_branch_id = $(input).find('option:selected').attr('data-bid');
|
||||
|
||||
console.log('insurer', insurer);
|
||||
console.log('follow_insurer_id client_id', client_id);
|
||||
console.log('follow_insurer_id insurer_id', insurer_id);
|
||||
console.log('follow_insurer_id insurer_branch_id', insurer_branch_id);
|
||||
console.log('follow_insurer_id unique_id', unique_id);
|
||||
|
||||
if(client_id && insurer_id){
|
||||
if(client_type == 1){
|
||||
$.ajax({
|
||||
url: '<?= base_url("/util/getCDAccNoByClientAndInsurer/") ?>' + client_id + '/' + insurer_id,
|
||||
url: '<?= base_url("/util/getCDAccNoByClientAndInsurer/") ?>' + client_id + '/' + insurer_id + '/' + insurer_branch_id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
@ -42,13 +42,13 @@
|
||||
|
||||
#rfqTable th:nth-child(-n+3),
|
||||
#rfqTable td:nth-child(-n+3) {
|
||||
border: 3px solid snow;
|
||||
border: 2px solid #007bff;
|
||||
}
|
||||
|
||||
#rfqTable th:nth-child(n+4),
|
||||
#rfqTable td:nth-child(n+4) {
|
||||
border: 2px solid #007bff;
|
||||
/* outline: none; */
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#rfqTable thead th {
|
||||
@ -59,6 +59,7 @@
|
||||
#rfqTable_for_calc th,
|
||||
#rfqTable_for_calc td {
|
||||
border: 2px solid #007bff;
|
||||
|
||||
}
|
||||
|
||||
/* Remove border from first 2 and last column */
|
||||
@ -240,11 +241,26 @@
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.save-indicator {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
background: #28a745;
|
||||
color: white;
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
font-size: 11px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
|
||||
.save-indicator.show {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<div class="row" id="inception_list">
|
||||
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
@ -277,13 +293,14 @@
|
||||
<input type="hidden" id="qcr_count" value="<?= isset($qcr_count) ? $qcr_count : 0 ?>">
|
||||
<!-- <button id="openDialogBtn">Open Dialog</button> -->
|
||||
|
||||
<div class="save-indicator" id="saveIndicator">Saved</div>
|
||||
<div class="table-container" id="first_table">
|
||||
<table id="rfqTable" class="table table-bordered mt-3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="sticky no-border" style="border-right: 3px solid snow !important; border-left: 3px solid snow !important; border-top: 3px solid snow !important; min-width: 72px !important;"><span class="key_name" style="display: none;">Sno</span><span class="display_name">S.No.</span></th>
|
||||
<th class="hidden no-border" style="border-right: 2px solid snow !important;">Item Key</th>
|
||||
<th class="sticky no-border" style="border-top: 3px solid snow !important; border-right: 3px solid snow !important;">Particulars</th>
|
||||
<th class="sticky no-border" style="border-right: 2px solid rgb(0, 123, 255) !important; border-left: 2px solid rgb(0, 123, 255) !important; border-top: 2px solid rgb(0, 123, 255) !important; min-width: 72px !important;"><span class="key_name" style="display: none;">Sno</span><span class="display_name">S.No.</span></th>
|
||||
<th class="hidden no-border" style="border-right: 2px solid rgb(0, 123, 255) !important;">Item Key</th>
|
||||
<th class="sticky no-border" style="border-top: 2px solid rgb(0, 123, 255) !important; border-right: 2px solid rgb(0, 123, 255) !important;">Particulars</th>
|
||||
<th contenteditable="false" id="first_proposel_title" ><span class="key_name" style="display: none;">Proposal 1</span><span class="display_name">Proposal Coverage 1</span>
|
||||
<span class="dropdown" onclick="showThreeDottedMenu(event)">
|
||||
<button class="dropbtn">⋮</button>
|
||||
@ -301,14 +318,14 @@
|
||||
</div>
|
||||
</span>
|
||||
</th>
|
||||
<th class="action">Action</th>
|
||||
<th class="action no-border" style="border-right: 2px solid rgb(0, 123, 255) !important; border-left: 2px solid rgb(0, 123, 255) !important; border-top: 2px solid rgb(0, 123, 255) !important;">Action</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="sticky no-border" style="color: rgb(191, 224, 226); border-right: 3px solid snow !important; border-left: 3px solid snow !important; min-width: 72px !important;"> - </th>
|
||||
<th class="hidden no-border" style="color: #bfe0e2; border-right: 2px solid snow !important;"> - </th>
|
||||
<th class="sticky no-border" style="color: rgb(191, 224, 226); border-bottom: 3px solid snow !important; border-right: 3px solid snow !important;"> - </th>
|
||||
<th class="sticky no-border" style="color: rgb(191, 224, 226); border-right: 2px solid rgb(0, 123, 255) !important; border-left: 2px solid rgb(0, 123, 255) !important; min-width: 72px !important;"> - </th>
|
||||
<th class="hidden no-border" style="color: #bfe0e2; border-right: 2px solid rgb(0, 123, 255) !important;"> - </th>
|
||||
<th class="sticky no-border" style="color: rgb(191, 224, 226); border-bottom: 2px solid rgb(0, 123, 255) !important; border-right: 2px solid rgb(0, 123, 255) !important;"> - </th>
|
||||
<th colspan="X" style="background-color: inherit;"><span class="key_name" style="display: none;">Quote Asked</span><span class="display_name">Quote Asked</span></th>
|
||||
<th class="action"> - </th>
|
||||
<th class="action no-border" style="color: rgb(255, 255, 255); border-right: 2px solid rgb(0, 123, 255) !important; border-left: 2px solid rgb(0, 123, 255) !important;"> - </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -446,7 +463,7 @@
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="to">To </label>
|
||||
<label for="to">TO</label>
|
||||
<select class="form-control" id="to" name="to" required>
|
||||
<?php if (isset($userList)) { ?>
|
||||
<?php foreach ($userList as $user) { ?>
|
||||
@ -604,16 +621,16 @@
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="proposals"> Proposals/Insurer <span id="base_danger"class="text-danger">*</span></label>
|
||||
<label for="proposals"> Proposal(s) / Insurer(s) <span id="base_danger"class="text-danger">*</span></label>
|
||||
<select class="form-control" id="proposals"name="proposals" onchange="getInsurerBranchContacts(this)" required>
|
||||
<option value="" >Select Proposals</option>
|
||||
<option value="" >Select a Proposal</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="placement_to"> To <span id="base_danger"class="text-danger">*</span></label>
|
||||
<label for="placement_to"> TO <span id="base_danger"class="text-danger">*</span></label>
|
||||
<select class="form-control" id="placement_to" name="placement_to" required>
|
||||
<option value="" >Select To Mail</option>
|
||||
<option value="" >Select TO Mail</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -684,6 +701,7 @@
|
||||
var multi_file_data = [];
|
||||
var totalSumAssuredData = [];
|
||||
var snoColumnWidth = "72px";
|
||||
var borderPixel = "2px solid #007bff";
|
||||
|
||||
const editorConfig = {
|
||||
buttons: [
|
||||
@ -851,15 +869,15 @@
|
||||
});
|
||||
|
||||
$('#proposals').select2({
|
||||
placeholder: 'Select To proposal',
|
||||
placeholder: 'Select proposal',
|
||||
});
|
||||
|
||||
$('#placement_to').select2({
|
||||
placeholder: 'Select To Mail',
|
||||
placeholder: 'Select TO Mail',
|
||||
});
|
||||
|
||||
$('#to').select2({
|
||||
placeholder: 'Select To Mail',
|
||||
placeholder: 'Select TO Mail',
|
||||
});
|
||||
|
||||
$("textarea.select2-search__field").attr('rows', '1');
|
||||
@ -1410,7 +1428,6 @@ function addSuggestionsToTable() {
|
||||
actionCell.classList.add('action');
|
||||
actionCell.innerHTML =
|
||||
'<input type="checkbox" name="qcr" onchange="setRowWiseQCRandSTCDatachange(this)" checked> <span class="qcr_check_box_title">QCR</span> <input type="checkbox" name="client" onchange="setRowWiseQCRandSTCDatachange(this)" checked> Client <button class="btn btn-danger btn-sm removeRow">−</button> ';
|
||||
|
||||
suggestionKeys.push(key);
|
||||
}
|
||||
}
|
||||
@ -3953,7 +3970,7 @@ function ajaxRequest(formData) {
|
||||
|
||||
console.log(res);
|
||||
if (res.status == 'success' && res.code == 200) {
|
||||
toastr.success('Mail send Successfully', 'SUCCESS')
|
||||
toastr.success('Mail sent Successfully', 'SUCCESS')
|
||||
if(res.is_placement == true){
|
||||
clearInterval(intervalId);
|
||||
console.log('******** Intervel Cleared ********')
|
||||
@ -3979,18 +3996,18 @@ function ajaxRequest(formData) {
|
||||
});
|
||||
|
||||
$('#to').select2({
|
||||
placeholder: 'Select To Mail',
|
||||
placeholder: 'Select TO Mail',
|
||||
});
|
||||
$('#cc').val('').select2({
|
||||
placeholder : 'select CC Mail'
|
||||
placeholder : 'Select CC Mail'
|
||||
});
|
||||
// $('#subject').val('');
|
||||
$('#proposals').val('');
|
||||
$('#placement_to').val('').select2({
|
||||
placeholder : 'select To Mail'
|
||||
placeholder : 'Select TO Mail'
|
||||
});
|
||||
$('#placement_cc').val('').select2({
|
||||
placeholder : 'select CC Mail'
|
||||
placeholder : 'Select CC Mail'
|
||||
});
|
||||
// $('#placement_subject').val('');
|
||||
|
||||
@ -4040,7 +4057,7 @@ function appendInsurerContact(data) {
|
||||
// Clear existing options and CC entries
|
||||
$('#placement_to').empty().append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select'
|
||||
text: 'Select TO Mail'
|
||||
}));
|
||||
$('.ccInsurerMail').remove();
|
||||
|
||||
@ -4072,19 +4089,19 @@ function appendInsurerContact(data) {
|
||||
$('.close').click(function(){
|
||||
|
||||
$('#to').select2({
|
||||
placeholder: 'Select To Mail',
|
||||
placeholder: 'Select TO Mail',
|
||||
});
|
||||
|
||||
$('#cc').val('').select2({
|
||||
placeholder : 'select CC Mail'
|
||||
placeholder : 'Select CC Mail'
|
||||
});
|
||||
// $('#subject').val('');
|
||||
$('#proposals').val('');
|
||||
$('#placement_to').val('').select2({
|
||||
placeholder : 'select To Mail'
|
||||
placeholder : 'Select TO Mail'
|
||||
});
|
||||
$('#placement_cc').val('').select2({
|
||||
placeholder : 'select CC Mail'
|
||||
placeholder : 'Select CC Mail'
|
||||
});
|
||||
// $('#placement_subject').val('');
|
||||
|
||||
@ -4625,19 +4642,27 @@ function jsonToTable(json) {
|
||||
|
||||
if (header.parentHeader === "Particulars") {
|
||||
parentTh.classList.add('sticky', 'no-border');
|
||||
parentTh.style.setProperty('border-top', '3px solid snow', 'important');
|
||||
parentTh.style.setProperty('border-right', '3px solid snow', 'important');
|
||||
parentTh.style.setProperty('border-top', borderPixel, 'important');
|
||||
parentTh.style.setProperty('border-right', borderPixel, 'important');
|
||||
|
||||
}
|
||||
|
||||
if (header.parentHeader === "Sno") {
|
||||
parentTh.classList.add('sticky', 'no-border');
|
||||
parentTh.style.setProperty('border-right', '3px solid snow', 'important');
|
||||
parentTh.style.setProperty('border-left', '3px solid snow', 'important');
|
||||
parentTh.style.setProperty('border-top', '3px solid snow', 'important');
|
||||
parentTh.style.setProperty('border-right', borderPixel, 'important');
|
||||
parentTh.style.setProperty('border-left', borderPixel, 'important');
|
||||
parentTh.style.setProperty('border-top', borderPixel, 'important');
|
||||
parentTh.style.setProperty('min-width', snoColumnWidth, 'important');
|
||||
}
|
||||
|
||||
if (header.parentHeader === "Action") {
|
||||
|
||||
parentTh.classList.add('no-border');
|
||||
parentTh.style.setProperty('border-right', borderPixel, 'important');
|
||||
parentTh.style.setProperty('border-left', borderPixel, 'important');
|
||||
parentTh.style.setProperty('border-top', borderPixel, 'important');
|
||||
}
|
||||
|
||||
if (RFQ_or_QCR == 2) {
|
||||
if (proposels[header.parentHeader] && proposels[header.parentHeader].qcr !== undefined) {
|
||||
if (proposels[header.parentHeader].qcr == 0 || proposels[header.parentHeader].qcr == false) {
|
||||
@ -4659,24 +4684,31 @@ function jsonToTable(json) {
|
||||
if (header.parentHeader === "Item Key") {
|
||||
subTh.classList.add('hidden', 'no-border');
|
||||
subTh.style.color = '#bfe0e2';
|
||||
subTh.style.setProperty('border-right', '2px solid snow', 'important');
|
||||
subTh.style.setProperty('border-right', borderPixel, 'important');
|
||||
}
|
||||
|
||||
if (header.parentHeader === "Particulars") {
|
||||
subTh.classList.add('sticky', 'no-border');
|
||||
subTh.style.color = '#bfe0e2';
|
||||
subTh.style.setProperty('border-bottom', '3px solid snow', 'important');
|
||||
subTh.style.setProperty('border-right', '3px solid snow', 'important');
|
||||
subTh.style.setProperty('border-bottom', borderPixel, 'important');
|
||||
subTh.style.setProperty('border-right', borderPixel, 'important');
|
||||
}
|
||||
|
||||
if (header.parentHeader === "Sno") {
|
||||
subTh.classList.add('sticky', 'no-border');
|
||||
subTh.style.color = '#bfe0e2';
|
||||
subTh.style.setProperty('border-right', '3px solid snow', 'important');
|
||||
subTh.style.setProperty('border-left', '3px solid snow', 'important');
|
||||
subTh.style.setProperty('border-right', borderPixel, 'important');
|
||||
subTh.style.setProperty('border-left', borderPixel, 'important');
|
||||
subTh.style.setProperty('min-width', snoColumnWidth, 'important');
|
||||
}
|
||||
|
||||
if (header.parentHeader === "Action") {
|
||||
subTh.classList.add('no-border');
|
||||
subTh.style.color = '#fff';
|
||||
subTh.style.setProperty('border-right', borderPixel, 'important');
|
||||
subTh.style.setProperty('border-left', borderPixel, 'important');
|
||||
}
|
||||
|
||||
// Add dropdown menu only if subHeader is not "Quote Asked" or "-"
|
||||
if (!["Quote Asked", "-", ""].includes(subHeader)) {
|
||||
|
||||
@ -4809,7 +4841,7 @@ function jsonToTable(json) {
|
||||
const td = document.createElement('td');
|
||||
|
||||
if(rowData.SNO == "1"){
|
||||
td.style.setProperty('border-top', '2px solid #007bff', 'important');
|
||||
td.style.setProperty('border-top', borderPixel, 'important');
|
||||
}
|
||||
|
||||
if (dataEntry.parentth === "Action") {
|
||||
@ -4952,14 +4984,22 @@ function populateTable(json) {
|
||||
|
||||
// Create the parent header
|
||||
const th = document.createElement("th");
|
||||
let calc_renewal_or_rollover = header.parentHeader;
|
||||
let calc_renewal_or_rollover_display_name = "Proposal Coverage " + (proposel_count);
|
||||
|
||||
if(["Sno", "Particulars", "Action"].includes(header.parentHeader)){
|
||||
th.textContent = header.parentHeader;
|
||||
}else{
|
||||
|
||||
let calc_renewal_or_rollover = header.parentHeader;
|
||||
let calc_renewal_or_rollover_display_name = "Proposal Coverage " + (proposel_count);
|
||||
|
||||
if(["Existing Renewal", "Existing Rollover"].includes(header.parentHeader)){
|
||||
calc_renewal_or_rollover_display_name = "Existing Coverage";
|
||||
}else{
|
||||
proposel_count ++;
|
||||
}
|
||||
|
||||
th.innerHTML = `<span class="key_name" style="display: none;">${calc_renewal_or_rollover}</span><span class="display_name">${calc_renewal_or_rollover_display_name}</span>`
|
||||
proposel_count ++
|
||||
|
||||
}
|
||||
|
||||
if (header.parentHeader === "Particulars") {
|
||||
@ -5785,7 +5825,12 @@ function appendMultiFileData(data) {
|
||||
console.log('Data sent successfully:', response);
|
||||
|
||||
if (response.status == true) {
|
||||
toastr.success(response.message, 'SUCCESS');
|
||||
if(input == 1){
|
||||
console.log(response.message, 'SUCCESS');
|
||||
showTinyToast();
|
||||
}else{
|
||||
toastr.success(response.message, 'SUCCESS');
|
||||
}
|
||||
$('#rfq_primaryKey').val(response.id);
|
||||
} else {
|
||||
toastr.warning(response.message, 'WARNING');
|
||||
@ -6659,7 +6704,6 @@ function appendMultiFileData(data) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
setTimeout(function(){
|
||||
$('.payment_date').flatpickr({
|
||||
@ -6667,5 +6711,18 @@ function appendMultiFileData(data) {
|
||||
});
|
||||
}, 2000)
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function showTinyToast(){
|
||||
const saveIndicator = document.getElementById('saveIndicator');
|
||||
saveIndicator.classList.add('show');
|
||||
setTimeout(() => {
|
||||
saveIndicator.classList.remove('show');
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -5,13 +5,12 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.btn-custom {
|
||||
background-color: #007bff;
|
||||
color: #fff;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.readonly-select {
|
||||
pointer-events: none;
|
||||
background-color: #f0f0f0;
|
||||
@ -35,12 +34,12 @@
|
||||
background-color: #bfe0e2;
|
||||
border: 1px solid #007bff;
|
||||
}
|
||||
|
||||
table thead tr:nth-child(2) th {
|
||||
background-color: #bfe0e2;
|
||||
border: 1px solid #007bff;
|
||||
}
|
||||
|
||||
|
||||
/* Apply styles to the first column, accounting for rowspan */
|
||||
table th:nth-child(1),
|
||||
table td:nth-child(1) {
|
||||
@ -48,8 +47,6 @@
|
||||
background-color: #bfe0e2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Ensure rowspan cells in the first column inherit the same styles */
|
||||
table td[rowspan]:nth-child(1) {
|
||||
width: 110px;
|
||||
@ -69,14 +66,13 @@
|
||||
text-align: left; /* Optional: Aligns text inside cells */
|
||||
}
|
||||
|
||||
|
||||
|
||||
th:nth-child(2),
|
||||
td:nth-child(2) {
|
||||
width: 720px;
|
||||
background-color: #bfe0e2;
|
||||
/* Adjust first column width */
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
@ -116,7 +112,6 @@
|
||||
background-color: white !important;
|
||||
}
|
||||
|
||||
|
||||
.dropdown-content button {
|
||||
display: block;
|
||||
width: 100%;
|
||||
@ -261,7 +256,23 @@
|
||||
line-height: 33px !important;
|
||||
}
|
||||
|
||||
|
||||
.save-indicator {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
background: #28a745;
|
||||
color: white;
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
font-size: 11px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
|
||||
.save-indicator.show {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@ -297,6 +308,7 @@
|
||||
<input type="hidden" id="lead_id" value="<?= htmlspecialchars($lead_data['id'] ?? "", ENT_QUOTES, 'UTF-8') ?>" />
|
||||
<input type="hidden" id="rfq_primaryKey" name="rfq_primaryKey" value="<?= isset($rfq_data['id']) ? $rfq_data['id'] : '' ?>">
|
||||
|
||||
<div class="save-indicator" id="saveIndicator">Saved</div>
|
||||
<div id="allTableContainer">
|
||||
<div id="tablesContainer"></div>
|
||||
<?php include('policyRegisterModel.php'); ?>
|
||||
@ -355,7 +367,7 @@
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="to">To </label>
|
||||
<label for="to">TO</label>
|
||||
<select class="form-control" id="to" name="to" required>
|
||||
<?php if (isset($userList)) { ?>
|
||||
<?php foreach ($userList as $user) { ?>
|
||||
@ -509,16 +521,16 @@
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="proposals"> Proposals/Insurer <span id="base_danger" class="text-danger">*</span></label>
|
||||
<label for="proposals"> Proposal(s) / Insurer(s) <span id="base_danger" class="text-danger">*</span></label>
|
||||
<select class="form-control" id="proposals" name="proposals" onchange="getInsurerBranchContacts(this)" required>
|
||||
<option value="">Select Proposals</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="placement_to"> To <span id="base_danger" class="text-danger">*</span></label>
|
||||
<label for="placement_to"> TO <span id="base_danger" class="text-danger">*</span></label>
|
||||
<select class="form-control" id="placement_to" name="placement_to" required>
|
||||
<option value="">Select To Mail</option>
|
||||
<option value="">Select TO Mail</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -2629,7 +2641,6 @@
|
||||
$('.loader-mask').fadeIn();
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: formData,
|
||||
@ -2639,10 +2650,9 @@
|
||||
console.log('RFQ NON EB FORM SUBMIT RESPONSE : ', response);
|
||||
|
||||
if (response.status == true) {
|
||||
toastr.success(response.message, "Success");
|
||||
|
||||
|
||||
if (!isAutoSave) {
|
||||
|
||||
toastr.success(response.message, "Success");
|
||||
localStorage.removeItem('policyData');
|
||||
|
||||
$('.actionBtns').show();
|
||||
@ -2651,6 +2661,8 @@
|
||||
}
|
||||
} else {
|
||||
$('#rfq_primaryKey').val(response.id);
|
||||
console.log(response.message, "Success");
|
||||
showTinyToast()
|
||||
}
|
||||
// window.location.reload();
|
||||
} else {
|
||||
@ -4435,15 +4447,15 @@
|
||||
});
|
||||
|
||||
$('#proposals').select2({
|
||||
placeholder: 'Select To proposal',
|
||||
placeholder: 'Select proposal',
|
||||
});
|
||||
|
||||
$('#placement_to').select2({
|
||||
placeholder: 'Select To Mail',
|
||||
placeholder: 'Select TO Mail',
|
||||
});
|
||||
|
||||
$('#to').select2({
|
||||
placeholder: 'Select To Mail',
|
||||
placeholder: 'Select TO Mail',
|
||||
});
|
||||
|
||||
$("textarea.select2-search__field").attr('rows', '1');
|
||||
@ -5059,18 +5071,18 @@
|
||||
});
|
||||
|
||||
$('#to').select2({
|
||||
placeholder: 'Select To Mail',
|
||||
placeholder: 'Select TO Mail',
|
||||
});
|
||||
$('#cc').val('').select2({
|
||||
placeholder: 'select CC Mail'
|
||||
placeholder: 'Select CC Mail'
|
||||
});
|
||||
// $('#subject').val('');
|
||||
$('#proposals').val('');
|
||||
$('#placement_to').val('').select2({
|
||||
placeholder: 'select To Mail'
|
||||
placeholder: 'Select TO Mail'
|
||||
});
|
||||
$('#placement_cc').val('').select2({
|
||||
placeholder: 'select CC Mail'
|
||||
placeholder: 'Select CC Mail'
|
||||
});
|
||||
$('#placement_subject').val('');
|
||||
|
||||
@ -5135,19 +5147,19 @@
|
||||
$('.close').click(function() {
|
||||
|
||||
$('#to').select2({
|
||||
placeholder: 'Select To Mail',
|
||||
placeholder: 'Select TO Mail',
|
||||
});
|
||||
|
||||
$('#cc').val('').select2({
|
||||
placeholder: 'select CC Mail'
|
||||
placeholder: 'Select CC Mail'
|
||||
});
|
||||
// $('#subject').val('');
|
||||
$('#proposals').val('');
|
||||
$('#placement_to').val('').select2({
|
||||
placeholder: 'select To Mail'
|
||||
placeholder: 'Select TO Mail'
|
||||
});
|
||||
$('#placement_cc').val('').select2({
|
||||
placeholder: 'select CC Mail'
|
||||
placeholder: 'Select CC Mail'
|
||||
});
|
||||
$('#placement_subject').val('');
|
||||
|
||||
@ -5804,6 +5816,14 @@
|
||||
});
|
||||
}
|
||||
|
||||
function showTinyToast(){
|
||||
const saveIndicator = document.getElementById('saveIndicator');
|
||||
saveIndicator.classList.add('show');
|
||||
setTimeout(() => {
|
||||
saveIndicator.classList.remove('show');
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -12,10 +12,11 @@ self.addEventListener('activate', function(event) {
|
||||
|
||||
// Fetch event
|
||||
self.addEventListener('fetch', function(event) {
|
||||
// console.log('Fetching:', event.request.url);
|
||||
event.respondWith(
|
||||
fetch(event.request).catch(function() {
|
||||
return caches.match(event.request);
|
||||
caches.match(event.request).then(function(response) {
|
||||
// Respond with cached version or fetch from network
|
||||
return response || fetch(event.request);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user