MERGE_DYNAMIC_RR_FE&BE&DASHBOARD

This commit is contained in:
velz 2024-07-23 15:10:41 +05:30
commit 16b8970fb5
51 changed files with 6731 additions and 4010 deletions

View File

@ -28,17 +28,17 @@ class Email extends BaseConfig
/**
* SMTP Server Hostname
*/
public string $SMTPHost = 'mail.venbait.in';
public string $SMTPHost = 'smtp.gmail.com';
/**
* SMTP Username
*/
public string $SMTPUser = 'bbone@venbait.in';
public string $SMTPUser = 'venbatechnologies@gmail.com';
/**
* SMTP Password
*/
public string $SMTPPass = 'xk!L(N_-R#};';
public string $SMTPPass = 'dsfllmxdzxxkcxgz';
/**
* SMTP Port

View File

@ -14,6 +14,8 @@ $routes->get('/swagger', 'SwaggerController::index', ['filter' => 'authMVC']);
$routes->get("reminder_mail", "NotificationController::reminder_mail");
$routes->get("testing", "ClientController::Testing");
$routes->get("update-policy-terms-for-corrections", "ClientController::updatePolicyTermsForCorrections");
$routes->get("update_rack_rate_json", "ClientController::updateRackRateJson");
$routes->get("updatajson", "EmpDataServiceController::updatajson");
$routes->post("add_advertise_image", "AppContentManagementController::add_advertise_image");
@ -136,6 +138,8 @@ $routes->group("/employee", ["filter" => "authMVC"], function ($routes) {
$routes->post("upload", "EmployeeController::employeesUplodWithEvents");
$routes->get("excel_error/(:any)", "EmployeeController::getExcelFileErrors/$1");
$routes->get("endorsement-list", "EmployeeController::endorsementList");
$routes->get("enrollment-list", "EmployeeController::enrollmentClientList");
$routes->get("empby_client_clientbranch/(:any)/(:any)", "EmployeeController::empby_client_clientbranch/$1/$2");
$routes->get("truncate/(:any)", "EmployeeController::truncateFileData/$1");
$routes->get("test-rack-rate", "EmployeeController::testRackRate");
$routes->post("test-rack-rate", "EmployeeController::testRackRate");
@ -262,6 +266,8 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
$routes->get("getPolicyTermsFormJson/(:any)", "ClientController::getPolicyTermsFormJson/$1");
$routes->get("checkHRNumber/(:any)", "ClientController::checkHRNumber/$1");
$routes->get("check_addition_premium_JSON/(:any)", "ClientController::checkAdditionPremiumJSON/$1");
$routes->get("get_policy_type_for_base_policy/(:any)", "ClientController::getPolicyTypeForBasePolicy/$1");
$routes->get("get_client_details/(:any)", "ClientController::getClientDetails/$1");
});
$routes->cli('cli/processjob', 'JobWorker::processJob');
@ -273,6 +279,8 @@ $routes->get("processjob", "JobWorker::processJob");
//Employee login api's
$routes->post("/employeeRest/verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber");
$routes->post("/employeeRest/getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData");
$routes->post("/employeeRest/verifyMpin", "RestAuthenticationController::verifyMpin");
$routes->post("/employeeRest/checkMpin", "RestAuthenticationController::checkMpin");
//HR login api's
$routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber");
$routes->post("/employeeRest/getVerifiedHrData", "RestAuthenticationController::getVerifiedHrData");
@ -284,10 +292,13 @@ $routes->group("/api", ["filter" => "authJWT"], function ($routes) {
$routes->get("getEmployeePolicy", "EmployeeRestController::getEmployeePolicy");
$routes->get("getAddOnPolicy", "EmployeeRestController::getAddOnPolicy");
$routes->get("getEmployeeActiveOrInactivePolicy", "EmployeeRestController::getEmployeeActiveOrInactivePolicy");
$routes->get("getChatResponse", "ChatBotController::getChatResponse");
$routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
$routes->post("storeFireBase", "EmployeeRestController::storeFireBase");
$routes->post("saveMpin", "RestAuthenticationController::saveMpin");
$routes->post("updateMpin", "RestAuthenticationController::updateMpin");
$routes->get("getChatResponse", "ChatBotController::getChatResponse");
$routes->get("getEmployeeProfile", "EmployeeRestController::getEmployeeProfile");
$routes->post("employeeUpload", "EmployeeRestController::employeeUpload");
@ -319,6 +330,8 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
$routes->get("getAdvertisementImage", "EmployeeRestController::getAdvertisementImage");
});
$routes->get("sendPushNotification", "EmployeeRestController::sendPushNotification");

View File

@ -0,0 +1,13 @@
{
"type": "service_account",
"project_id": "push-notification-enrollment",
"private_key_id": "979d0fcd0ce95d31367f3150d34ee0044ca51b0d",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC4Xsan6ESIzM12\nG15gRU361Yy6PVmoMzTToWtZHPEcDRd9weFNlCXjmX+WAqdgD/hQ42GcZQVCndse\nEQGJHbRu/ifMKGo53zxOpshNZnCSxojAGWIGrIHFE5kFumiKz9drW9vPWsFLtgx0\nEAW0T7su1MejjH33GftHG8k/q3uyWoU0+OFRD6emhYkFdVsucwR27hE7GsFwE+CF\nnRdSWQ5mu2e8J7q9Qbpgot5d7uk7iJgpiyNdChPvqUZ7XeknVrw1F4REZlbAkVjb\nFuwKg5qtG97LZ1NkyYqFmssA1rNkqSi4+T+2/ERegdwyA6W4/HLT9fPbSl4v1MvB\ntJlGYkMpAgMBAAECggEABhspdCUmo+s4gMleQkz5TK3m58IhZocvoDSv4/cn6xhp\n50HVDucxrAyI47R5y54ryK4HLRFRb8ffmmrQxLRFpgln0wShpAIHMsmmR531a38E\nx2vvya3L7HV+M2jdjn9csJMNwBvO3A2O8wcW0UZ0uhPU+s8r2tOy9UNv0lqBEcKM\nUxCtk7UxcLEM3btDP5I4oEHVo2f5jzPeb99KHbYQV/vc0BtA1wtuYTzGT2EhBpTG\nN1rbQhlj6iJ6vMwHETWrctNMohCQNQEv/QIC/NWYPNRqmtrJfNe29XGWN9IIhv0e\n/ZmhdzoO+uhJW4VaWpI93nB5ZAa6LHqJSg+OyrPoawKBgQDd45Aiq7d+4Z+kDZYu\n72bgW5CGhyck2hrqHpBdHA960AYIftw/wHgI9xb9Z8hi+Lh+W18xDywOLoaz7TJV\nElj2Gh3oj2ZLzDpeyqV9UOgz11dbm6yYUK8jl7zyajBt7RhGcdj+4x+YjUTT6O61\nuxm2ZbKsb/0er/W6DlKDVvpWSwKBgQDUtqowATEaGTrd+eutanRwtv+rdptVcadj\nD4H3XdY4PAsVSp1mT9knGgh7c5elI0lBH/VD/IbM5uPXOc7judnIK4RgKScrJT2P\nekyEJnXyFAZGS3WTFG7fzeXn/cNNx5MCZE2Yay7LqqON8Kg08IvvesiTushrDlMJ\nX8cunSyz2wKBgDIOwZigxq/QNNSs4AHMrpfU8GD5IqKUtde1d3oZ94AMaCAIhqW3\nRR04qS4X+MQjOnP/JxWJR7YXVvpGe8FndzxmHfM2Tqyw8UYrT3RbCVeQsDuRfjmK\nkkhkVhMWU8Co6X4S9xJhqOIglLN97ESBZkaY4Ns4FJGUvsnvqzvIJofLAoGBAKJO\ny2eb0TK/46ozJEELxNOo30efVgGJmpa844e0A1yffDl/2MCT1ve+JpDEcAbi+OeH\nkieRTe6Vk27LvnEHhAT4J6cUX73NSb7sK+x+SGsyGmOS+qEC62M8gdxWRqtXyHX/\nwTG3P1rK1sfcxQy4K57NSrVmxbzijjvN6HdKGS0XAoGATtsid5pypcZ0BsYUp/27\neS6z++ewo7QCVCBPa4Ag4nX56/0kdrECvy/ISMDjggNv+mR8hpyCjfm9ztJ88njB\nUBu1jzLBZ+u5gEjmtu43qvuDJNobyb+evDSReEJmify943vFZqnkIhFlwg1PcS6S\nCd+pr559KWURPIgfxb7S/JU=\n-----END PRIVATE KEY-----\n",
"client_email": "firebase-adminsdk-gzzkw@push-notification-enrollment.iam.gserviceaccount.com",
"client_id": "109128197176743587316",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-gzzkw%40push-notification-enrollment.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}

File diff suppressed because it is too large Load Diff

View File

@ -11,12 +11,14 @@ use CodeIgniter\API\ResponseTrait;
use App\Models\MessageModel;
use App\Models\UserMessageModel;
use App\Models\ClientModel;
class DashboardController extends AdminController
{
use ResponseTrait;
protected $messageModel;
protected $clientModel;
protected $userMessageModel;
protected $myLogger;
@ -26,12 +28,97 @@ class DashboardController extends AdminController
$this->messageModel = new MessageModel();
$this->userMessageModel = new UserMessageModel();
$this->myLogger = \Config\Services::mylogger();
$this->clientModel = new ClientModel();
}
public function dashboard()
{
$data = [];
$results = $this->clientModel->select('clients.id as client_id, clients.client_name, clients.short_name,
client_branch.id as client_branch_id, client_branch.branch_name,
client_branch.branch_code, employees.id as employee_id,
employees.name as employee_name, employees.relationship,
employees.emp_code, employees.emp_status, auth_history.user_type')
->join('client_branch','clients.id = client_branch.client_id', 'left')
->join('employees','client_branch.id = employees.client_branch_id', 'left')
->join('auth_history', 'employees.id = auth_history.user_id AND "employee" = auth_history.user_type', 'left')
->findAll();
$groupedData = [];
$employeeId = '';
foreach ($results as $row) {
$clientId = $row['client_id'];
$clientName = $row['client_name'];
$shortName = $row['short_name'];
$branchId = $row['client_branch_id'];
$branchName = $row['branch_name'];
$branchCode = $row['branch_code'];
if($employeeId != $row['employee_id']){
$employeeId = $row['employee_id'];
}else{
$employeeId = null;
}
$employeeName = $row['employee_name'] ;
$employeeRelationship = $row['relationship'] ;
$employeeEmpCode = $row['emp_code'] ;
$employeeEmpStatus = $row['emp_status'];
$employeeUserType = $row['user_type'];
// Initialize the client entry if it doesn't exist
if (!isset($groupedData[$clientId])) {
$groupedData[$clientId] = [
'client_id' => $clientId,
'client_name' => $clientName,
'short_name' => $shortName,
'branches' => []
];
}
// Initialize the branch entry if it doesn't exist
if (!isset($groupedData[$clientId]['branches'][$branchId])) {
$groupedData[$clientId]['branches'][$branchId] = [
'client_branch_id' => $branchId,
'branch_name' => $branchName,
'branch_code' => $branchCode,
'emp_login' => 0,
'emp_enroll' => 0,
'employees' => []
];
}
if ($employeeId !== null && $employeeRelationship == 'Self') {
// Append employee info to the branch's employees list
$groupedData[$clientId]['branches'][$branchId]['employees'][] = [
'employee_id' => $employeeId,
'employee_name' => $employeeName,
'relationship' => $employeeRelationship,
'emp_code' => $employeeEmpCode,
'emp_status' => $employeeEmpStatus,
'user_type' => $employeeUserType
];
if (!empty($employeeUserType)) {
$groupedData[$clientId]['branches'][$branchId]['emp_login']++;
}
// Increment emp_enroll if emp_status is not 'draft'
if ($employeeEmpStatus !== 'draft') {
$groupedData[$clientId]['branches'][$branchId]['emp_enroll']++;
}
}
$employeeId = $row['employee_id'];
}
// Re-index the arrays to match the expected structure
foreach ($groupedData as &$client) {
$client['branches'] = array_values($client['branches']);
}
// echo "<pre>";
$data['client_branch_emp_list'] = $groupedData;
// print_r($data);die;
echo view('layout/header');
echo view('DashBoard');
echo view('DashBoard', $data);
echo view('layout/footer');
}

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,7 @@ use Psr\Log\LoggerInterface;
use App\Models\EmployeeModel;
use App\Models\EmployeePolicyModel;
use App\Models\ClientModel;
use App\Models\ClientBranchModel;
use App\Models\PolicesModel;
use App\Models\FileModel;
use App\Models\BatchListModel;
@ -18,6 +19,9 @@ use App\Models\BatchFileModel;
use App\Models\EmpEndorsementModel;
use App\Models\ClientPolicyModel;
use App\Models\TPAModel;
use App\Models\InsurerExcelExportTemplateModel;
use App\Models\InsurerModel;
use App\Controllers\Jobs;
use App\Controllers\JobWorker;
@ -44,6 +48,7 @@ class EmployeeController extends AdminController
protected $employeeModel;
protected $employeePolicyModel;
protected $clientModel;
protected $clientBranchModel;
protected $fileModel;
protected $batchListModel;
protected $batchFileModel;
@ -51,6 +56,8 @@ class EmployeeController extends AdminController
protected $clientPolicyModel;
protected $TPAModel;
protected $policiesModel;
protected $excelExportTemplateModel;
protected $insurerModel;
public function __construct()
{
@ -60,6 +67,7 @@ class EmployeeController extends AdminController
$this->employeeModel = new EmployeeModel();
$this->employeePolicyModel = new EmployeePolicyModel();
$this->clientModel = new ClientModel();
$this->clientBranchModel = new ClientBranchModel();
$this->fileModel = new FileModel();
$this->batchListModel = new BatchListModel();
$this->batchFileModel = new BatchFileModel();
@ -67,6 +75,7 @@ class EmployeeController extends AdminController
$this->clientPolicyModel = new ClientPolicyModel();
$this->TPAModel = new TPAModel();
$this->policiesModel = new PolicesModel();
$this->insurerModel = new InsurerModel();
}
public function list()
@ -259,7 +268,6 @@ class EmployeeController extends AdminController
'files.*',
'up.emp_code',
'up.first_name',
'pm.name as policy_name',
'c.short_name',
'cb.branch_name',
'cp.id as client_policy_id',
@ -277,8 +285,7 @@ class EmployeeController extends AdminController
->join('user_profiles up', 'files.created_by = up.id')
->join('client_policy cp', 'files.policy_id = cp.id', 'left')
->join('client_branch cb', 'files.client_branch_id = cb.id', 'left')
->join('policies pm', 'cp.policy_id = pm.id', 'left')
->join('policy_type', 'policy_type.id = pm.policy_type_id')
->join('policy_type', 'policy_type.id = cp.policy_type_id')
->join('clients c', 'files.client_id = c.id and files.client_id = cp.client_id', 'left')
->where('files.created_by', get_session_userid())
->orderBy('files.created_at', 'desc')
@ -287,7 +294,6 @@ class EmployeeController extends AdminController
$data['batch_list'] = $this->batchFileModel->select(
'batch_files.*,
policies.name as policy_name,
clients.short_name as client_short_name,
client_branch.branch_name,
client_policy.policy_no,
@ -295,8 +301,7 @@ class EmployeeController extends AdminController
')
->join('client_policy', 'client_policy.id = batch_files.client_policy_id')
->join('client_branch', 'client_branch.id = batch_files.client_branch_id')
->join('policies', 'policies.id = client_policy.policy_id')
->join('policy_type', 'policy_type.id = policies.policy_type_id')
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
->join('clients', 'clients.id = client_policy.client_id')
->orderBy('batch_files.id', 'desc')
->findAll();
@ -393,6 +398,15 @@ class EmployeeController extends AdminController
public function importExport()
{
$array = $this->request->getPost('event_type');
if (is_array($array)) {
$event_type = 'MultipleEvents';
} else {
$event_type = $this->request->getPost('event_type');
}
$this->myLogger->logme('error', 'Import Export -- Function called');
$empDataServiceController = new EmpDataServiceController();
@ -400,16 +414,12 @@ class EmployeeController extends AdminController
$client_policy_id = $this->request->getPost('client_policy_id');
$client_branch_id = $this->request->getPost('client_branch_id');
$insurer_or_tpa = $this->request->getPost('insurer_or_tpa');
$event_type = $this->request->getPost('event_type');
$actions = $this->request->getPost('action_type');
$client_data = $this->clientModel->where('id', $client_id)->first();
$policy_name_and_branch_name = $this->clientPolicyModel->select('policies.name, client_branch.branch_code')
->join('client_branch', 'client_branch.id = client_policy.client_branch_id')
->join('policies', 'policies.id = client_policy.policy_id')
->where('client_policy.id', $client_policy_id)
->first();
$file_name = generate_filename($client_data['short_name'], $event_type, $actions, $insurer_or_tpa, $policy_name_and_branch_name['name'], $policy_name_and_branch_name['branch_code']);
$client_data = $this->clientPolicyModel->getCliendDataForExcelFileName($client_policy_id);
$file_name = generate_filename($client_data['short_name'], $event_type, $actions, $insurer_or_tpa, $client_data['policy_type'], $client_data['branch_code']);
// dd($client_data, $file_name);
$batch_data = [
'client_id' => $client_id,
@ -421,7 +431,6 @@ class EmployeeController extends AdminController
'file_name' => $file_name,
];
if ($actions == 'export') {
if ($event_type == 'inception' || $event_type == 'addition' || $event_type == 'dependent_addition') {
@ -438,6 +447,11 @@ class EmployeeController extends AdminController
session()->setFlashdata('error', "The policy does not have a CD account number.");
return redirect()->to(base_url('employee/upload'));
}
else if($return === 6){
session()->setFlashdata('error', "The Insurer does not have an Excel export template format.");
return redirect()->to(base_url('employee/upload'));
}
if (!$return) {
@ -454,6 +468,12 @@ class EmployeeController extends AdminController
} else if ($event_type == 'correction') {
$return = $empDataServiceController->generateExcelForCorrection($batch_data);
if($return === 6){
session()->setFlashdata('error', "The Insurer does not have an Excel export template format.");
return redirect()->to(base_url('employee/upload'));
}
if (!$return) {
session()->setFlashdata('error', 'No data found about this action');
return redirect()->to(base_url('employee/upload'));
@ -472,6 +492,10 @@ class EmployeeController extends AdminController
session()->setFlashdata('error', "The policy does not have a CD account number.");
return redirect()->to(base_url('employee/upload'));
}else if($return === 6){
session()->setFlashdata('error', "The Insurer does not have an Excel export template format.");
return redirect()->to(base_url('employee/upload'));
}
if (!$return) {
@ -483,12 +507,38 @@ class EmployeeController extends AdminController
} else if ($event_type == 'deletion') {
$return = $empDataServiceController->generateExcelForDeletion($batch_data);
if($return === 6){
session()->setFlashdata('error', "The Insurer does not have an Excel export template format.");
return redirect()->to(base_url('employee/upload'));
}
if (!$return) {
session()->setFlashdata('error', 'No data found about this action');
return redirect()->to(base_url('employee/upload'));
} else {
$this->myLogger->logme('error', 'Successfully exported Excel file in Deletion.');
}
} else if($event_type == 'MultipleEvents'){
$batch_data['event_type'] = $array;
$return = $empDataServiceController->generateExcelForAllEventType($batch_data);
if($return === 6){
session()->setFlashdata('error', "The Insurer does not have an Excel export template format.");
return redirect()->to(base_url('employee/upload'));
}
if (!$return) {
session()->setFlashdata('error', 'No data found about this action');
return redirect()->to(base_url('employee/upload'));
} else {
$this->myLogger->logme('error', 'Excel exported successfully.');
}
}
} else if ($actions == 'import') {
@ -615,6 +665,71 @@ class EmployeeController extends AdminController
$this->loadLayout('endorsement_list', $data);
}
/**
* Below function displays the Enrollment list page.
*
* This method retrieves filter data from the request and fetches the Enrollment list
* based on the provided filters such as client , client_branch , employee - ( Log-in-or-not , ENrolled-or-not).
*/
public function enrollmentClientList()
{
$data = [];
$client_list = $this->clientModel->findAll();
$branch_list = $this->clientBranchModel->findAll();
$data['client_list'] = $client_list;
$data['branch_list'] = $branch_list;
$this->myLogger->logme('error', 'list called');
$this->loadLayout('enrollment_list', $data);
}
public function empby_client_clientbranch($client_id, $branch_id)
{
$results = $this->clientModel->select('employees.id as employee_id, employees.name as employee_name,
employees.relationship, employees.emp_code,
employees.emp_status, auth_history.user_type')
->join('employees', $client_id .'= employees.client_id AND ' . $branch_id . '= employees.client_branch_id', 'left')
->join('auth_history', 'employees.id = auth_history.user_id AND "employee" = auth_history.user_type', 'left')
->findAll();
$groupedData = [];
$employeeId = '';
foreach ($results as $row) {
if($employeeId != $row['employee_id']){
$employeeId = $row['employee_id'];
}else{
$employeeId = null;
}
$employeeName = $row['employee_name'] ;
$employeeRelationship = $row['relationship'] ;
$employeeEmpCode = $row['emp_code'] ;
$employeeEmpStatus = $row['emp_status'];
$employeeUserType = $row['user_type'];
if ($employeeId !== null && $employeeRelationship == 'Self') {
// Append employee info to the branch's employees list
$groupedData[] = [
'employee_id' => $employeeId,
'employee_name' => $employeeName,
'relationship' => $employeeRelationship,
'emp_code' => $employeeEmpCode,
'emp_status' => $employeeEmpStatus,
'user_type' => $employeeUserType
];
}
$employeeId = $row['employee_id'];
}
return json_encode($groupedData);
}
/**
* Beleo function retrieves employee endorsement (emp_endorsement table) data.
@ -914,15 +1029,16 @@ class EmployeeController extends AdminController
return $response;
}
public function generateIDCardForEmployee($rand_string, $people = 0)
{
// dd($rand_string, $people);
try {
$this->myLogger->logme('error', 'generateIDCardForEmployee function started.');
// Step 1: Attempt to fetch employee code and client policy ID
$this->myLogger->logme('error', 'Fetching employee code and client policy ID.');
$get_emp_code_and_client_policy_id = $this->employeePolicyModel
->select('employee_polices.client_policy_id, employees.emp_code, tpa.short_name')
->select('employee_polices.client_policy_id, employees.emp_code, tpa.short_name,employees.client_id')
->join('client_policy', 'client_policy.id = employee_polices.client_policy_id')
->join('employees', 'employees.id = employee_polices.employee_id')
->join('tpa', 'tpa.id = client_policy.tpa_id')
@ -931,53 +1047,52 @@ class EmployeeController extends AdminController
->where("employee_polices.tpa_id IS NOT NULL AND employee_polices.tpa_id <> ''")
->where('employee_polices.status', 'active')
->where('employee_polices.is_active', '1')
->where('employee_polices.rand_string', $rand_string)->first();
// dd($get_emp_code_and_client_policy_id);
->where('employee_polices.rand_string', $rand_string)
->first();
if ($get_emp_code_and_client_policy_id == null || $get_emp_code_and_client_policy_id == "") {
$this->myLogger->logme('error', 'Member not found in this rand_string: ' . $rand_string);
$data['message'] = 'Record Not Found';
return view('errors/404', $data);
}
$this->myLogger->logme('error', 'Member found. Client policy ID: ' . $get_emp_code_and_client_policy_id['client_policy_id']);
$client_policy_id = $get_emp_code_and_client_policy_id['client_policy_id'];
$emp_code = $get_emp_code_and_client_policy_id['emp_code'];
$data = $this->employeePolicyModel->getECardDataUsingMd5($client_policy_id, $emp_code);
if($people == 0){
$data = $this->employeePolicyModel->getECardSingleData($rand_string, $emp_code);
$client_id = $get_emp_code_and_client_policy_id['client_id'];
// Step 2: Fetch ECard data
$this->myLogger->logme('error', 'Fetching ECard data using client_policy_id: ' . $client_policy_id . ' and emp_code: ' . $emp_code);
$data = $this->employeePolicyModel->getECardDataUsingMd5($client_policy_id, $emp_code,$client_id);
if ($people == 0) {
$this->myLogger->logme('error', 'Fetching single ECard data using rand_string: ' . $rand_string . ' and emp_code: ' . $emp_code);
$data = $this->employeePolicyModel->getECardSingleData($rand_string, $emp_code,$client_id);
}
// dd($data);
$template_data_path = WRITEPATH . 'e_card_template/';
// Step 3: Prepare template path
$template_data_path = WRITEPATH . 'e_card_template/';
$tpa_short_name = strtolower(str_replace(' ', '_', $get_emp_code_and_client_policy_id['short_name'])) . '.html';
$final_path = $template_data_path . $tpa_short_name;
// dd($template_data_path, $tpa_short_name, $final_path);
$final_path = $template_data_path . $tpa_short_name;
$this->myLogger->logme('error', 'Checking if template file exists at: ' . $final_path);
if (!file_exists($final_path)) {
$data['message'] = 'Record Not Found';
$this->myLogger->logme('error', 'Template file not found: ' . $final_path);
$data['message'] = 'Template File Not Found';
return view('errors/404', $data);
}
}
$this->myLogger->logme('error', 'Template file found. Reading template data.');
$tmplt_data = file_get_contents($final_path);
// dd($tmplt_data);
$html = ""; // Initialize the HTML variable
// Step 4: Generate HTML content
$this->myLogger->logme('error', 'Generating HTML content from template.');
$html = "";
foreach ($data as $key => $value) {
// Get the HTML content from the template
// $htmlContent = view('ecard_template/md_tpa');
$htmlContent = $tmplt_data;
// Define the placeholders and their corresponding values
$placeholders = [
'{TPA_ID}' => $value['tpa_id'],
'{NAME}' => $value['name'],
@ -992,12 +1107,12 @@ class EmployeeController extends AdminController
'{INSURER_LOGO}' => base_url() . 'public/uploads/logo/' . $value['insurer_logo'],
'{FRONT_CARD}' => base_url() . 'public/uploads/template_bg/' . $value['front_card'],
'{BACK_CARD}' => base_url() . 'public/uploads/template_bg/' . $value['back_card'],
'{EMP_ID}' =>$value['emp_code'],
'{CORPORATE_NAME}' =>$value['client_name'],
'{AGE}' =>$value['emp_age'],
'{TPA_NAME}' =>$value['tpa_name'],
'{INSURER_BRANCH}' =>$value['insurer_branch_city'],
'{RELATION}' =>$value['relationship'],
'{EMP_ID}' => $value['emp_code'],
'{CORPORATE_NAME}' => $value['client_name'],
'{AGE}' => $value['emp_age'],
'{TPA_NAME}' => $value['tpa_name'],
'{INSURER_BRANCH}' => $value['insurer_branch_city'],
'{RELATION}' => $value['relationship'],
'{TPA_LOGO}' => base_url() . 'public/uploads/logo/' . $value['tpa_logo'],
'{MEDI_USER}' => base_url() . 'public/e_card_imgs/medi_uesr.jpg',
'{MEDI_INSURER}' => base_url() . 'public/e_card_imgs/Magma.png',
@ -1006,17 +1121,17 @@ class EmployeeController extends AdminController
'{QR_IOS}' => base_url() . 'public/e_card_imgs/ios.png',
'{QR_ANDROID_2}' => base_url() . 'public/e_card_imgs/play_store.png',
'{QR_IOS_2}' => base_url() . 'public/e_card_imgs/appstore.png',
];
// Replace placeholders with values in HTML content
foreach ($placeholders as $placeholder => $replaceValue) {
$htmlContent = str_replace($placeholder, $replaceValue, $htmlContent);
}
$html .= $htmlContent;
}
// Step 5: Output HTML and script for printing
$this->myLogger->logme('error', 'Generating HTML output with print button.');
echo '<button id="downloadBtn" style="display: block;margin: 30px;position: relative;left: 220px;">Print</button>' . $html . '</button>
<script>
document.getElementById("downloadBtn").addEventListener("click", function() {
@ -1025,63 +1140,17 @@ class EmployeeController extends AdminController
this.style.display = "block";
});
</script>';
// $file_name = $get_emp_code_and_client_policy_id['short_names'] ?? 'md_tpa';
// $file_name = strtolower(str_replace(' ', '_', $file_name));
// $file_path = ROOTPATH . 'app/Views/ecard_template/' . $file_name . '.php';
// if (is_file($file_path)) {
// $view_file = 'ecard_template/' . $file_name;
// } else {
// $view_file = 'ecard_template/default_ecard';
// }
// $dpi = 132;
// $html = view('ecard_template/md_tpa');
// // echo $html; die;
// $options = new Options();
// $options->set('isRemoteEnabled', true);
// $options->set('isPhpEnabled', true);
// $options->setDpi($dpi);
// $dompdf = new Dompdf($options);
// $dompdf->loadHtml($html);
// $dompdf->setPaper('A4', 'portrait');
// $dompdf->render();
// $filename = 'ECard.pdf'; // Default filename
// foreach ($data['data'] as $key => $value) {
// if ($value['relationship'] == "Self") {
// $filename = $value['tpa_id'] . '.pdf'; // Update filename if relationship is "Self"
// } elseif (!empty($value['tpa_id']) && $filename == 'ECard.pdf') {
// $filename = $value['tpa_id'] . '.pdf';
// }
// }
// $dompdf->stream($filename, array("Attachment" => false));
$this->myLogger->logme('error', 'generateIDCardForEmployee function completed successfully.');
} catch (\Exception $e) {
$data['message'] = 'Record Not Founds';
$this->myLogger->logme('error', 'Exception occurred: ' . $e->getMessage());
$data['message'] = 'Record Not Found';
return view('errors/404', $data);
}
}
public function viewECard()
{
@ -1090,7 +1159,7 @@ class EmployeeController extends AdminController
$empDataServiceController = new EmpDataServiceController();
$file_name = generate_filename("TCS", 'inception', 'export', 'insurer', 'policy', 'branch');
$batch_data = [
$export_data = [
'client_id' => 12,
'client_policy_id' => 12,
'client_branch_id' => 1,
@ -1100,24 +1169,88 @@ class EmployeeController extends AdminController
'file_name' => $file_name,
];
$return = $empDataServiceController->generateExcelForAdditionandInception($batch_data);
$template_json = $this->clientPolicyModel
->select('insurer_excel_export_template.jsoncolumns')
->join('insurer_excel_export_template', 'insurer_excel_export_template.insurer_id = client_policy.insurer_id and insurer_excel_export_template.policy_type_id = client_policy.policy_type_id')
->where('client_policy.id', $export_data['client_policy_id'])
->where('insurer_excel_export_template.event_name', $export_data['event_type'])
->where('insurer_excel_export_template.type_name', $export_data['actions'])
->first();
$template_array = json_decode($template_json['jsoncolumns'], true);
// dd($template_array);
$objects = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($export_data);
$totals = 0;
foreach ($objects as $item) {
$totals += $item->total;
}
dd($objects, $totals);
$excel_data_info = generate_insurer_based_excel($template_array, $objects);
// Generate Excel file
$tempFile = tmpfile();
$success = generate_excel($excel_data_info['header'], $excel_data_info['data'], $tempFile, 1);
// If Excel generation is successful
if ($success) {
$random_number_count = 4;
$export_data['batch_code'] = generate_random_string($random_number_count);
$export_data['created_by'] = get_session_userid();
$insert = $this->batchFileModel->insert($export_data);
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
$batch_code = $batch_file_batch_code['batch_code'];
// $this->insertBatchList(['batch_code' => $batch_code, 'batch_list_data' => $objects ]);
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'insertBatchList', 'payload' => ['batch_code' => $batch_code, 'user_id' => get_session_userid(), 'batch_list_data' => $objects]]);
// If batch operation is successful
if (true) {
// Clear the output buffer to avoid any unwanted output
if (ob_get_level()) {
ob_end_clean();
}
// Set headers for Excel file download
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment; filename="' . $export_data['file_name'] . '"');
header('Content-Transfer-Encoding: binary');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Expires: 0');
// Output file contents
rewind($tempFile);
fpassthru($tempFile);
// Close and remove temporary file
fclose($tempFile);
return true; // Excel file successfully generated and exported
} else {
return false; // Batch operation failed
}
}
if ($return == 0) {
dd('error', "Insufficient deposit amount.");
}else if($return == 1){
dd('error', "The policy does not have a CD account number.");
}
if (!$return) {
dd('error', "No data was found");
}
}
public function truncateFileData() //truncateFileDataIn DB (de activate rows)
{
$file_id = $this->request->uri->getSegment(3);
@ -1170,9 +1303,6 @@ class EmployeeController extends AdminController
}
}
public function previewTemplate($id = null)
{
@ -1255,7 +1385,6 @@ class EmployeeController extends AdminController
echo $htmlContent;
}
public function errorListExportImport($file_id)
{
@ -1346,6 +1475,7 @@ class EmployeeController extends AdminController
{
$client_policy_id = $this->request->uri->getSegment(3);
$policy_details = $this->clientPolicyModel->find($client_policy_id);
$insurer_details = $this->insurerModel->where('id', $policy_details['insurer_id'])->first();
$policy_terms = isset($policy_details['policy_terms']) ? true : false;
$si_enhancement_true_or_false = 1;
@ -1372,7 +1502,7 @@ class EmployeeController extends AdminController
}
$message = isset($message) ? ($message . ' not defined for choosed policy') : null;
return $this->respond(['dataStatus' => true, 'code' => 200, 'message' => $message, 'si_enhancement' => $si_enhancement_true_or_false], 200);
return $this->respond(['dataStatus' => true, 'code' => 200, 'message' => $message, 'si_enhancement' => $si_enhancement_true_or_false, 'insurer_multi_event' => $insurer_details['is_multi_event']], 200);
}

File diff suppressed because it is too large Load Diff

View File

@ -1800,10 +1800,10 @@ class EmployeeServiceController extends AdminController
public function getFileMetaDataByFileId($file_id, $status = 'success'){
$data = $this->fileModel
->select('files.*, clients.client_name, clients.short_name, policies.name as policy_name,client_branch.branch_code')
->select('files.*, clients.client_name, clients.short_name, policy_type.policy_type as policy_name,client_branch.branch_code')
->join('clients', 'clients.id = files.client_id')
->join('client_policy', 'client_policy.id = files.policy_id')
->join('policies', 'policies.id = client_policy.policy_id')
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
->join('client_branch', 'client_branch.id = files.client_branch_id','left')
->where('files.id', $file_id)
->first();

View File

@ -86,7 +86,7 @@ class PendingActionsController extends AdminController
$builder = $this->db->table('client_policy cp');
$builder->select('
clients.client_name,
policies.name as policy_name,
policy_type.policy_type as policy_name,
cp.id as client_policy_id,
cp.client_id,
cp.policy_id,
@ -102,7 +102,7 @@ class PendingActionsController extends AdminController
$builder->join('employee_polices ep', 'cp.id = ep.client_policy_id AND ep.is_active = 1', 'left');
$builder->join('clients', 'cp.client_id = clients.id');
$builder->join('client_branch cb', 'cb.id = cp.client_branch_id');
$builder->join('policies', 'cp.policy_id = policies.id');
$builder->join('policy_type', 'cp.policy_type_id = policy_type.id');
$builder->where('cp.is_active', 1);
$builder->where('cp.open_for_enrollment', 1);
$builder->where('cp.is_addon', 1);
@ -234,8 +234,7 @@ class PendingActionsController extends AdminController
client_branch.id as branch_id,
client_branch.branch_name,
client_policy.id as client_policy_id,
policies.name as policy_name,
policies.id as pid,
policy_type.policy_type as policy_name,
emp_endorsement.id,
emp_endorsement.pk,
emp_endorsement.endorsement_id,
@ -250,7 +249,7 @@ class PendingActionsController extends AdminController
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id AND client_policy.is_active = 1 AND client_policy.policy_status = 1')
->join('clients', 'client_policy.client_id = clients.id AND clients.is_active = 1')
->join('client_branch', 'client_branch.id = client_policy.client_branch_id')
->join('policies', 'client_policy.policy_id = policies.id AND policies.is_active = 1')
->join('policy_type', 'client_policy.policy_type_id = policy_type.id')
->where([
'emp_endorsement.actions' => 'si',
'emp_endorsement.is_active' => 1,
@ -322,8 +321,7 @@ class PendingActionsController extends AdminController
client_branch.id as branch_id,
client_branch.branch_name,
client_policy.id as client_policy_id,
policies.name as policy_name,
policies.id as pid,
policy_type.policy_type as policy_name,
emp_endorsement.pk,
emp_endorsement.id,
emp_endorsement.group_key,
@ -338,7 +336,7 @@ class PendingActionsController extends AdminController
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id AND client_policy.is_active = 1 AND client_policy.policy_status = 1', 'left')
->join('clients', 'client_policy.client_id = clients.id AND clients.is_active = 1', 'left')
->join('client_branch', 'client_branch.id = client_policy.client_branch_id', 'left')
->join('policies', 'client_policy.policy_id = policies.id AND policies.is_active = 1', 'left')
->join('policy_type', 'client_policy.policy_type_id = policy_type.id', 'left')
->where([
'emp_endorsement.actions' => 'd',
'emp_endorsement.is_active' => 1,
@ -346,7 +344,7 @@ class PendingActionsController extends AdminController
'emp_endorsement.endorsement_id' => null,
'emp_endorsement.table_name' => 'employee_polices'
])
->groupBy('emp_endorsement.pk, emp_endorsement.emp_code, emp_endorsement.actions, emp_endorsement.name');
->groupBy('emp_endorsement.pk, emp_endorsement.emp_code, emp_endorsement.actions, emp_endorsement.name');
// Build the main query
$builder = $this->db->table('clients');
@ -406,7 +404,7 @@ class PendingActionsController extends AdminController
->select('ep.client_policy_id')
->select('c.client_name')
->select('c.short_name')
->select('p.name as policy_name')
->select('policy_type.policy_type as policy_name')
->select('ep.uhid')
->select('cb.branch_name, cb.id as branch_id')
->select("($subQueryExport) AS batch_export_count", false)
@ -414,11 +412,11 @@ class PendingActionsController extends AdminController
->join('client_policy cp', 'ep.client_policy_id = cp.id AND cp.is_active = 1 AND cp.policy_status = 1')
->join('clients c', 'c.id = cp.client_id')
->join('client_branch cb', 'cb.id = cp.client_branch_id')
->join('policies p', 'p.id = cp.policy_id')
->join('policy_type', 'policy_type.id = cp.policy_type_id')
->where('ep.uhid IS NULL')
->where('ep.status', 'active')
->where('ep.is_active', 1)
->groupBy('ep.client_policy_id, ep.uhid, c.short_name, p.name')
->groupBy('ep.client_policy_id, ep.uhid, c.short_name, policy_type.policy_type')
->get();
// Fetch the results
@ -459,7 +457,7 @@ class PendingActionsController extends AdminController
employee_polices.tpa_id,
clients.short_name,
clients.client_name,
policies.name as policy_name,
policy_type.policy_type as policy_name,
clients.id as client_id,
client_branch.id as branch_id,
client_branch.branch_name
@ -470,7 +468,7 @@ class PendingActionsController extends AdminController
$builder->join('client_policy', 'employee_polices.client_policy_id = client_policy.id AND client_policy.is_active = 1 AND client_policy.policy_status = 1');
$builder->join('clients', 'clients.id = client_policy.client_id');
$builder->join('client_branch', 'client_branch.id = client_policy.client_branch_id');
$builder->join('policies', 'policies.id = client_policy.policy_id');
$builder->join('policy_type', 'policy_type.id = client_policy.policy_type_id');
$builder->where('employee_polices.tpa_id', null);
$builder->where('employee_polices.uhid IS NOT NULL');
$builder->where('employee_polices.status', 'active');

View File

@ -212,5 +212,123 @@ class RestAuthenticationController extends AdminController
}
public function saveMpin()
{
try {
$mobile_number = $this->request->getJSON()->mobile_number;
$mpin = $this->request->getJSON()->mpin;
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first();
if ($employeeData) {
$id= $employeeData["id"];
$updateMpin = $this->employeeModel->where('id', $id)->set('mpin', $mpin)->update();
if($updateMpin){
$result = ['user_verification' => true , 'message' => "Mpin Updated"];
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
}else{
$result = ['user_verification' => true , 'message' => "Mpin Not Updated"];
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
}
} else {
$result = ['user_verification' => false , 'message' => "User not found"];
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
}
} catch (\Throwable $th) {
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
}
}
public function updateMpin()
{
try {
$mobile_number = $this->request->getJSON()->mobile_number;
$old_mpin = $this->request->getJSON()->old_mpin;
$mpin = $this->request->getJSON()->new_mpin;
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('mpin', $old_mpin)->where('relationship', 'self')->first();
if ($employeeData) {
$id= $employeeData["id"];
$updateMpin = $this->employeeModel->where('id', $id)->set('mpin', $mpin)->update();
if($updateMpin){
$result = ['mpin_verification' => true , 'message' => "Mpin Updated"];
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
}else{
$result = ['mpin_verification' => true , 'message' => "Mpin Not Updated"];
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
}
} else {
$result = ['mpin_verification' => false , 'message' => "Wrong Mpin"];
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
}
} catch (\Throwable $th) {
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
}
}
public function verifyMpin()
{
try {
$mobile_number = $this->request->getJSON()->mobile_number;
$mpin = $this->request->getJSON()->mpin;
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first();
if ($employeeData && $mpin == $employeeData["mpin"]) {
$auth = HttpRequestHelper::getRequestInfo();
if ($auth) {
$data = [
'user_id' => $employeeData['id'],
'user_type' => 'employee',
'ip' => $auth['ip'],
'platform' => $auth['platform'],
'broswer' => $auth['browser'],
];
$authdata= $this->authHistoryModel->insert($data);
}
$result = JWTToken::encode($employeeData);
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
} else {
return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP"],200);
}
} catch (\Exception $e) {
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
}
}
public function checkMpin()
{
try {
$mobile_number = $this->request->getJSON()->mobile_number;
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first();
if ($employeeData && $employeeData["mpin"] != null) {
return $this->respond(['status' => 'success','code' => 200,'data' => "Mpin - exist" , 'Mpin' =>$employeeData["mpin"]],200);
} else {
return $this->respond(['status' => 'failed','code' => 404,'data' => "Mpin - not found", 'Mpin' =>null],200);
}
} catch (\Exception $e) {
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
}
}
}

View File

@ -665,7 +665,7 @@ if(!function_exists('generate_insurer_based_excel')){
$rowData = [];
foreach ($excel_header_array as $header) {
$fieldName = $header['header_name'];
$fieldName = $header['db_column_name'];
if ($fieldName === 'index') {
$value = $serialNumber;

View File

@ -12,6 +12,7 @@ class sendMailNotification
{
public static function sendMailNotification($action, $params)
{
print_r($params);die;
if ($action == 'member_welcome_mail') {
$dataToInsert = $params['dataToInsert'];
$notification = $params['notification'];
@ -37,7 +38,6 @@ class sendMailNotification
return $wholeData;
} else if($action == 'member_reminder_mail'){
// print_r($params);die;
$EmployeeModel = new EmployeeModel();
$emp_data = $params['emp_data'];
$notification_data = $params['notification_data'];
@ -100,11 +100,16 @@ class sendMailNotification
$mail_content = $notification['mail_content'];
$mail = $get_emp_email_and_other_details['email_corporate'];
$subject = $notification['subject'];
$link = generate_download_link($rand_string);
$app_link = $_ENV['App_Url'];
$name = $get_emp_email_and_other_details['name'];
$mail_content = $notification['mail_content'];
$nhance_logo = $_ENV['NHANCE_LOGO'];
// dd("3333333333333");
$post_enrollment_app_link = $_ENV['POST_ENROLLMENT_APP_LINK'];
$client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo'];
@ -119,7 +124,6 @@ class sendMailNotification
// $mail_content = str_replace("[[tpa_id]]", $tpa_id, $mail_content);
$mail_content = str_replace("[[ecard_download_link]]", "<a href='$link/1'>Download Insurance Card</a>", $mail_content);
$mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content);
$wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails']];
return $wholeData;
@ -153,21 +157,26 @@ class sendMailNotification
// Step 1: Replace the placeholder with an HTML table structure
$mail = '';
// print_r($array_list);die;
$table_content = '';
$addtional_premium = 0;
$gst = 0;
$Addon_list = [];
$name = '';
$emp_code = '';
foreach ($array_list as $item) {
$table_content .= '<div style="text-align: left;"><div style="text-align:left;"><h4>Policy Name : ';
if(count($item) != 0){
$table_content .= '<div style="text-align: left;"><div style="text-align:left;"><h4>Policy Name : ';
$temp_data ='';
$policy_name ='';
$is_addon ='';
foreach ($item as $inner_item) {
$policy_name = $inner_item['policy_name'];
$temp_data .= '<tr ><td style="width:20%">' . $inner_item['name'] . '</td><td style="width:20%">'.$inner_item['mobile'].'</td><td style="width:20%">₹'.number_format($inner_item['basic_cover_si'], 2, '.', ',').'</td><td style="width:20%">'.\DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y').'</tr>';
$temp_data .= '<tr ><td style="width:20%">' . $inner_item['name'] . '</td><td style="width:20%">'.$inner_item['relationship'].'</td><td>'. \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') .'</td><td style="width:20%">₹'.format_indian_number($inner_item['basic_cover_si']).'</td><td style="width:20%">₹'.format_indian_number($inner_item['premium']).'</td><td>₹'. format_indian_number($inner_item['gst']) .'</td></tr><tr>';
if($inner_item['relationship'] == 'Self' || $inner_item['relationship'] == 'self'){
$mail = $inner_item['email_corporate'];
$name = $inner_item['name'];
$emp_code = $inner_item['emp_code'];
}
// print_r($inner_item);die;
$is_addon = $inner_item['is_addon'];
if($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3){
@ -175,10 +184,10 @@ class sendMailNotification
$gst = $inner_item['gst'] + $gst;
}
}
$table_content .= $policy_name.'</h4></div><table style="width:60%"><thead style="background-color: #02a8b5;"><tr><th style="width:20%">Name</th><th>Mobile Number</th><th>Sum Insure</th><th style="width:15%">Date Of Birth</th></tr></thead><tbody>';
// echo $policy_name;die;
$table_content .= $policy_name.'</h4></div><table style="width:60%"><thead style="background-color: #02a8b5;"><tr><th style="width:20%">Name</th><th>Relation</th><th style="width:15%">Date Of Birth</th><th>Sum Insure</th><th>Premium</th><tj>GST</th></tr></thead><tbody>';
$table_content .= $temp_data;
$table_content .= '</tbody></table></div>';
if ($is_addon == 2 || $is_addon == 3) {
$addon_list_array = [
'policy_name'=>$policy_name,
@ -186,25 +195,30 @@ class sendMailNotification
'gst'=>$gst
];
$Addon_list[]= $addon_list_array;
}
$temp_data = '';
$addtional_premium = 0;
$gst = 0;
}
}
if(count($Addon_list) != 0 && count($Addon_list) > 0){
$table_content .='<br><div style="text-align: left;"><div style="text-align:left;"><table style="width:60%"><thead style="background-color: #e26828;"><tr><th>Policy Name</th><th> Additional Premium</th><th>GST</th><th>Total</th></tr></thead><tbody>';
$sum_tolal = 0;
foreach ($Addon_list as $key => $value) {
$sum_tolal = $value['gst'] + $value['addtional_premium'] + $sum_tolal;
$table_content .= '<tr><td>'.$value['policy_name'].'</td><td>₹'.$value['addtional_premium'].'</td><td>'.$value['gst'].'</td><td>'.$value['gst'] + $value['addtional_premium'] .'</td></tr>';
}
$sum_total_words = numberToWords($sum_tolal);
$table_content .= '<tr><td></td><td></td><td><h4>Total</h4></td><td>'.format_indian_number($sum_tolal).'</td></tr>';
$table_content .= '</tbody></table></div></div>';
$table_content .= '<div style="width:60%;text-align:right">'. $sum_total_words .'</div>';
$table_content .='<br><table style="width:60%"><thead style="background-color: #e26828;"><tr><th>Policy Name</th><th> Additional Premium</th><th>GST</th><th>Total</th></tr></thead><tbody>';
$sum_tolal = 0;
foreach ($Addon_list as $key => $value) {
$sum_tolal = $value['gst'] + $value['addtional_premium'] + $sum_tolal;
$table_content .= '<tr><td>'.$value['policy_name'].'</td><td>₹'.$value['addtional_premium'].'</td><td>'.$value['gst'].'</td><td>'.$value['gst'] + $value['addtional_premium'] .'</td></tr>';
}
$table_content .= '<tr><td></td><td></td><td><h4>Total</h4></td><td>'.$sum_tolal.'</td></tr>';
$table_content .= '</tbody></table>';
$mail_content = str_replace("[[member_name]]", $name, $mail_content);
$mail_content = str_replace("[[member_name]]", $name . ' (' . $emp_code . ')' , $mail_content);
$mail_content = str_replace("[[member_summary]]", $table_content , $mail_content);
// $mail = "aadhavanvalli@gmail.com";
// if (isset($mail) && !empty($mail)) {
@ -214,17 +228,16 @@ class sendMailNotification
return $wholeData;
}
// print_r($wholeData);die;
} else if($action == 'account_maneger_summary_mail'){
$client_id = $params['client_id'];
$clientModel = new ClientModel();
$notificationModel = new NotificationModel();
$clientRMModel =new ClientRMModel();
$client_data =$clientModel->where('id', $client_id)->first();
$notificationModel = new NotificationModel();
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
$clientRMModel =new ClientRMModel();
if ($notification_data['enabled'] == 1) {
$client_rm_data= $clientRMModel->where('client_id', $client_id)->where('is_active',1)->findAll();
@ -255,30 +268,37 @@ class sendMailNotification
// Step 1: Replace the placeholder with an HTML table structure
$mail = '';
// print_r($array_list);die;
$table_content = '';
$addtional_premium = 0;
$gst = 0;
$array_list = $params['array_list'];
$Addon_list = [];
foreach ($array_list as $item) {
$table_content .= '<div style="text-align: left;"><div style="text-align:left;"><h4>Policy Name : ';
if(count($item) != 0){
$table_content .= '<div style="text-align: left;"><div style="text-align:left;"><h4>Policy Name : ';
$temp_data ='';
$policy_name ='';
$is_addon ='';
foreach ($item as $inner_item) {
$policy_name = $inner_item['policy_name'];
$temp_data .= '<tr ><td style="width:20%">' . $inner_item['name'] . '</td><td style="width:20%">'.$inner_item['mobile'].'</td><td style="width:20%">₹'.number_format($inner_item['basic_cover_si'], 2, '.', ',').'</td><td style="width:20%">'.\DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y').'</tr>';
// print_r($inner_item);die;
if($inner_item['relationship'] == 'Self'){
$emp_code = ' ('. $inner_item['emp_code'] . ')';
}else{
$emp_code ='';
}
$temp_data .= '<tr ><td style="width:20%">' . $inner_item['name'] . $emp_code . '</td><td style="width:20%">'.$inner_item['relationship'].'</td><td>'. \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') .'</td><td style="width:20%">₹'.format_indian_number($inner_item['basic_cover_si']).'</td><td style="width:20%">₹'.format_indian_number($inner_item['premium']).'</td><td>₹'. format_indian_number($inner_item['gst']) .'</td></tr><tr>';
$is_addon = $inner_item['is_addon'];
if($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3){
$addtional_premium = $inner_item['rata_premimum'] + $addtional_premium;
$gst = $inner_item['gst'] + $gst;
}
}
$table_content .= $policy_name.'</h4></div><table style="width:60%"><thead style="background-color: #02a8b5;"><tr><th style="width:20%">Name</th><th>Mobile Number</th><th>Sum Insure</th><th style="width:15%">Date Of Birth</th></tr></thead><tbody>';
$table_content .= $policy_name.'</h4></div><table style="width:60%"><thead style="background-color: #02a8b5;"><tr><th style="width:20%">Name</th><th>Relation</th><th style="width:15%">Date Of Birth</th><th>Sum Insure</th><th>Premium</th><tj>GST</th></tr></thead><tbody>';
$table_content .= $temp_data;
$table_content .= '</tbody></table></div>';
if ($is_addon == 2 || $is_addon == 3) {
$addon_list_array = [
'policy_name'=>$policy_name,
@ -293,29 +313,37 @@ class sendMailNotification
$temp_data = '';
$addtional_premium = 0;
$gst = 0;
}
}
if(count($Addon_list) != 0 && count($Addon_list) > 0){
$table_content .='<br><div style="text-align: left;"><div style="text-align:left;"><table style="width:60%"><thead style="background-color: #e26828;"><tr><th>Policy Name</th><th> Additional Premium</th><th>GST</th><th>Total</th></tr></thead><tbody>';
$sum_tolal = 0;
foreach ($Addon_list as $key => $value) {
$sum_tolal = $value['gst'] + $value['addtional_premium'] + $sum_tolal;
$table_content .= '<tr><td>'.$value['policy_name'].'</td><td>₹'.$value['addtional_premium'].'</td><td>'.$value['gst'].'</td><td>'.$value['gst'] + $value['addtional_premium'] .'</td></tr>';
}
$sum_total_words = numberToWords($sum_tolal);
$table_content .= '<tr><td></td><td></td><td><h4>Total</h4></td><td>'.format_indian_number($sum_tolal).'</td></tr>';
$table_content .= '</tbody></table></div></div>';
$table_content .= '<div style="width:60%;text-align:right">'. $sum_total_words .'</div>';
$table_content .='<br><table style="width:60%"><thead style="background-color: #e26828;"><tr><th>Policy Name</th><th> Additional Premium</th><th>GST</th><th>Total</th></tr></thead><tbody>';
$sum_tolal = 0;
foreach ($Addon_list as $key => $value) {
$sum_tolal = $value['gst'] + $value['addtional_premium'] + $sum_tolal;
$table_content .= '<tr><td>'.$value['policy_name'].'</td><td>₹'.$value['addtional_premium'].'</td><td>'.$value['gst'].'</td><td>'.$value['gst'] + $value['addtional_premium'] .'</td></tr>';
}
$table_content .= '<tr><td></td><td></td><td><h4>Total</h4></td><td>'.$sum_tolal.'</td></tr>';
$table_content .= '</tbody></table>';
$mail_content = str_replace("[[member_summary]]", $table_content , $mail_content);
$account_manager_mail_list = [];
foreach ($user_list as $key => $value) {
$full_name = $value['first_name'] .' ' .$value['last_name'];
$mail_content = str_replace("[[member_name]]", $full_name , $mail_content);
if(isset($user_list)){
foreach ($user_list as $key => $value) {
$full_name = $value['first_name'] .' ' .$value['last_name'];
$mail_content = str_replace("[[member_name]]", $full_name , $mail_content);
$wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content];
// $wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']];
$wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content];
// $wholeData[] = ['mail' => $value['email'], 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']];
}
return $wholeData;
}
return $wholeData;
}
} else if($action == 'client_hr_summary_mail'){
@ -357,19 +385,23 @@ class sendMailNotification
// Step 1: Replace the placeholder with an HTML table structure
$mail = '';
// print_r($array_list);die;
$table_content = '';
$addtional_premium = 0;
$gst = 0;
$array_list = $params['array_list'];
$Addon_list = [];
foreach ($array_list as $item) {
$table_content .= '<div style="text-align: left;"><div style="text-align:left;"><h4>Policy Name : ';
$temp_data ='';
foreach ($item as $inner_item) {
$policy_name = $inner_item['policy_name'];
$temp_data .= '<tr ><td style="width:20%">' . $inner_item['name'] . '</td><td style="width:20%">'.$inner_item['mobile'].'</td><td style="width:20%">₹'.number_format($inner_item['basic_cover_si'], 2, '.', ',').'</td><td style="width:20%">'.\DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y').'</tr>';
// print_r($inner_item);die;
if($inner_item['relationship'] == 'Self'){
$emp_code = ' ('. $inner_item['emp_code'] . ')';
}else{
$emp_code ='';
}
$temp_data .= '<tr ><td style="width:20%">' . $inner_item['name'] . $emp_code . '</td><td style="width:20%">'.$inner_item['relationship'].'</td><td>'. \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') .'</td><td style="width:20%">₹'.format_indian_number($inner_item['basic_cover_si']).'</td><td style="width:20%">₹'.format_indian_number($inner_item['premium']).'</td><td>₹'. format_indian_number($inner_item['gst']) .'</td></tr><tr>';
$is_addon = $inner_item['is_addon'];
if($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3){
@ -377,7 +409,7 @@ class sendMailNotification
$gst = $inner_item['gst'] + $gst;
}
}
$table_content .= $policy_name.'</h4></div><table style="width:60%"><thead style="background-color: #02a8b5;"><tr><th style="width:20%">Name</th><th>Mobile Number</th><th>Sum Insure</th><th style="width:15%">Date Of Birth</th></tr></thead><tbody>';
$table_content .= $policy_name.'</h4></div><table style="width:60%"><thead style="background-color: #02a8b5;"><tr><th style="width:20%">Name</th><th>Relation</th><th style="width:15%">Date Of Birth</th><th>Sum Insure</th><th>Premium</th><tj>GST</th></tr></thead><tbody>';
$table_content .= $temp_data;
$table_content .= '</tbody></table></div>';
@ -397,23 +429,25 @@ class sendMailNotification
$gst = 0;
}
$table_content .='<br><table style="width:60%"><thead style="background-color: #e26828;"><tr><th>Policy Name</th><th> Additional Premium</th><th>GST</th><th>Total</th></tr></thead><tbody>';
$sum_tolal = 0;
foreach ($Addon_list as $key => $value) {
$sum_tolal = $value['gst'] + $value['addtional_premium'] + $sum_tolal;
$table_content .= '<tr><td>'.$value['policy_name'].'</td><td>₹'.$value['addtional_premium'].'</td><td>'.$value['gst'].'</td><td>'.$value['gst'] + $value['addtional_premium'] .'</td></tr>';
if(count($Addon_list) != 0 && count($Addon_list) > 0){
$table_content .='<br><div style="text-align: left;"><div style="text-align:left;"><table style="width:60%"><thead style="background-color: #e26828;"><tr><th>Policy Name</th><th> Additional Premium</th><th>GST</th><th>Total</th></tr></thead><tbody>';
$sum_tolal = 0;
foreach ($Addon_list as $key => $value) {
$sum_tolal = $value['gst'] + $value['addtional_premium'] + $sum_tolal;
$table_content .= '<tr><td>'.$value['policy_name'].'</td><td>₹'.$value['addtional_premium'].'</td><td>'.$value['gst'].'</td><td>'.$value['gst'] + $value['addtional_premium'] .'</td></tr>';
}
$sum_total_words = numberToWords($sum_tolal);
$table_content .= '<tr><td></td><td></td><td><h4>Total</h4></td><td>'.format_indian_number($sum_tolal).'</td></tr>';
$table_content .= '</tbody></table></div></div>';
$table_content .= '<div style="width:60%;text-align:right">'. $sum_total_words .'</div>';
}
$table_content .= '<tr><td></td><td></td><td><h4>Total</h4></td><td>'.$sum_tolal.'</td></tr>';
$table_content .= '</tbody></table>';
$mail_content = str_replace("[[member_summary]]", $table_content , $mail_content);
$hr_mails = $client_data['hr_mails'];
$mail_array = explode(',', $hr_mails);
$mail_array = array_map('trim', $mail_array);
$wholeData = [];
foreach ($mail_array as $key => $value) {
$wholeData[] = ['mail' => $value, 'subject' => $subject,'message'=> $mail_content];
// $wholeData[] = ['mail' => $value, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']];
@ -423,5 +457,5 @@ class sendMailNotification
}
}
}
}
}

View File

@ -139,3 +139,9 @@ if (!function_exists('get_session_context')) {
return $session->get('context');
}
}

View File

@ -248,3 +248,64 @@ if (!function_exists('get_role_id')) {
}
function numberToWords($number)
{
$words = array(
'0' => 'Zero',
'1' => 'One',
'2' => 'Two',
'3' => 'Three',
'4' => 'Four',
'5' => 'Five',
'6' => 'Six',
'7' => 'Seven',
'8' => 'Eight',
'9' => 'Nine',
'10' => 'Ten',
'11' => 'Eleven',
'12' => 'Twelve',
'13' => 'Thirteen',
'14' => 'Fourteen',
'15' => 'Fifteen',
'16' => 'Sixteen',
'17' => 'Seventeen',
'18' => 'Eighteen',
'19' => 'Nineteen',
'20' => 'Twenty',
'30' => 'Thirty',
'40' => 'Forty',
'50' => 'Fifty',
'60' => 'Sixty',
'70' => 'Seventy',
'80' => 'Eighty',
'90' => 'Ninety'
);
if ($number < 21) {
return $words[$number];
}
if ($number < 100) {
$tens = (int)($number / 10) * 10;
$units = $number % 10;
return $words[$tens] . ($units ? ' ' . $words[$units] : '');
}
if ($number < 1000) {
$hundreds = (int)($number / 100);
$remainder = $number % 100;
return $words[$hundreds] . ' Hundred' . ($remainder ? ' and ' . numberToWords($remainder) : '');
}
$levels = array('', ' Thousand', ' Million', ' Billion', ' Trillion', ' Quadrillion', ' Quintillion');
for ($i = 0, $unit = 1; $i < count($levels); $i++, $unit *= 1000) {
if ($number < $unit * 1000) {
$current = (int)($number / $unit);
$remainder = $number % $unit;
return numberToWords($current) . $levels[$i] . ($remainder ? ' ' . numberToWords($remainder) : '');
}
}
return $number; // Fallback for numbers beyond the supported range
}

View File

@ -24,6 +24,7 @@ class ClientBranchModel extends Model
"address2",
"gst",
"sez",
"units",
];
public function getBranchAndContactByBranchId($branch_id){

View File

@ -68,11 +68,11 @@ class ClientModel extends Model
'client_policy.id as client_policy_id',
'client_policy.policy_terms',
'client_policy.policy_no',
'p.name',
// 'p.name',
'pt.policy_type',
])
->join('client_branch', 'client_branch.id = client_policy.client_branch_id')
->join('policies p', 'p.id = client_policy.policy_id')
// ->join('policies p', 'p.id = client_policy.policy_id')
->join('policy_type pt','client_policy.policy_type_id = pt.id')
->where('client_policy.client_id',$client['id'])
->where('client_policy.is_active', 1)

View File

@ -45,6 +45,7 @@ class ClientPolicyModel extends Model
"client_branch_id",
"cd_ac_no",
"gst",
"enrolment_visibility",
];
public function getClientPolicyById($id){
@ -73,7 +74,6 @@ class ClientPolicyModel extends Model
->select('client_policy.*')
->select('insurers.name as insurer_name, insurers.short_name as insurer_short')
->select('tpa.name as tpa_name, tpa.short_name as tpa_short')
->select('policies.name as policy_name, policies.policy_type_id')
->select('policy_type.policy_type as policy_type_name')
->select('insurer_branch.branch_name as insurer_branch_name, insurer_branch.branch_code as insurer_branch_code')
->select('tpa_branch.branch_name as tpa_branch_name, tpa_branch.branch_code as tpa_branch_code')
@ -83,8 +83,7 @@ class ClientPolicyModel extends Model
->join('insurer_branch', 'client_policy.insurer_branch_id = insurer_branch.id')
->join('tpa', 'tpa.id = client_policy.tpa_id', 'left')
->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id', 'left')
->join('policies', 'policies.id = client_policy.policy_id')
->join('policy_type', 'policy_type.id = policies.policy_type_id')
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
->join('client_branch', 'client_branch.id = client_policy.client_branch_id')
->where('client_policy.client_id', $client_id)
->where('client_policy.policy_status', 1)
@ -186,7 +185,7 @@ class ClientPolicyModel extends Model
return $this->db->table('cash_deposit')
->select('cash_deposit.*')
->select('insurers.name as insurer_name, insurers.short_name as insurer_short')
->select('clients.client_name as clientname, clients.short_name as clientshort')
->select('clients.client_name as clientname, clients.short_name as clientshort, client_policy.policy_no')
// ->select('policies.name as policy_name')
->select('policy_type.policy_type')
->select('user_profiles.first_name as username')
@ -355,6 +354,34 @@ public function getClientPolicyByPolicyType($client_id, $type){
}
public function getPolicyTypeForPolicyBinding($client_id){
$result = $this->table('client_policy')
->select('policy_type.*, client_policy.id as client_policy_id, client_policy.policy_no')
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
->where('client_policy.client_id', $client_id)
->where('client_policy.is_active', 1)
->whereIn('policy_type.id', [2,3])
->findAll();
return $result;
}
public function getCliendDataForExcelFileName($client_policy_id){
return $this->table('client_policy')
->select('clients.short_name, policy_type.policy_type, client_branch.branch_code')
->join('clients', 'clients.id = client_policy.client_id')
->join('client_branch', 'client_branch.id = client_policy.client_branch_id')
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
->where('client_policy.id', $client_policy_id)
->where('client_policy.is_active', 1)
->first();
}
}

View File

@ -42,6 +42,7 @@ class EmployeeModel extends Model
"token_time_out",
"emp_type",
"unit"
"mpin"
];
// Callbacks

View File

@ -75,7 +75,7 @@ class EmployeePolicyModel extends Model
return $data;
}
// -----------------------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------------------------
public function getEmployeePolicy($client_id = 0, $policy_id=0, $status=0, $branch_id=0, $emp_code="", $emp_name="")
{
@ -101,6 +101,9 @@ class EmployeePolicyModel extends Model
'emp.emp_status',
'emp.is_active as emp_is_active',
'emp.mobile as mobile',
'emp.doj',
'emp.basic_pay',
'emp.band as grade',
'policy_type.policy_type',
'cp.policy_no',
])
@ -143,8 +146,6 @@ class EmployeePolicyModel extends Model
return $result->findAll();
}
//for emp onboard do not change
public function checkExistingEmpPolicy($arr)
{
@ -153,8 +154,7 @@ class EmployeePolicyModel extends Model
->where('is_active',1)
->find();
}
//------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
public function getInceptionEmployeeDataForExportExcel($ref_data)
@ -173,6 +173,21 @@ class EmployeePolicyModel extends Model
$id = 'uhid';
}
$datas = '';
if($event === 'inception'){
$datas = 'I';
}else if($event === 'dependent_addition'){
$datas = 'DA';
}else if($event === 'addition'){
$datas = 'A';
}
$sql = "
SELECT
employees.name AS emp_name,
@ -182,8 +197,19 @@ class EmployeePolicyModel extends Model
employees.change_event AS change_event,
employees.relationship AS emp_relationship,
employees.relationship_code AS emp_relationship_code,
'$datas' as event_type_data,
employees.doj AS emp_doj,
employees.mobile AS emp_mobile,
employees.email_corporate AS emp_email_c,
employees.email_personal AS emp_email_p,
employees.band AS emp_grade,
employees.designation AS emp_designation,
employees.basic_pay AS emp_basic_pay,
TIMESTAMPDIFF(YEAR, employees.dob, CURDATE()) AS emp_age,
employees.emp_type as emp_type,
employee_polices.id as primaryKey,
employee_polices.tpa_id,
@ -192,16 +218,23 @@ class EmployeePolicyModel extends Model
employee_polices.basic_cover_si,
employee_polices.date_coverage,
employee_polices.policy_end_date,
employee_polices.days,
employee_polices.days as no_of_days,
employee_polices.premium,
employee_polices.rata_premimum,
employee_polices.rata_premimum as pro_rata_premium,
employee_polices.gst,
(employee_polices.rata_premimum + employee_polices.gst) AS total,
batch_data.emp_policy_id,
batch_data.bl AS batch_list_batch_code,
batch_data.bf AS batch_files_batch_code
batch_data.bf AS batch_files_batch_code,
CASE
WHEN client_branch.sez = 0 THEN 'NON-SEZ'
WHEN client_branch.sez = 1 THEN 'SEZ'
END as sez
FROM employee_polices
LEFT JOIN employees ON employees.id = employee_polices.employee_id
LEFT JOIN client_branch ON client_branch.id = employees.client_branch_id
LEFT JOIN (
SELECT
batch_list.emp_policy_id,
@ -220,7 +253,6 @@ class EmployeePolicyModel extends Model
AND employee_polices.status = 'active'
AND employees.is_active = 1
AND employees.emp_status = 'active'
";
// Get the result set
@ -254,9 +286,20 @@ class EmployeePolicyModel extends Model
employees.dob AS emp_dob,
employees.gender AS emp_gender,
employees.client_id AS emp_client_id,
employees.emp_type as emp_type,
employees.emp_type as emp_temp_codeype,
employee_polices.uhid,
employees.relationship_code,
employees.relationship,
'C' as event_type_data,
employees.doj AS emp_doj,
employees.mobile AS emp_mobile,
employees.email_corporate AS emp_email_c,
employees.email_personal AS emp_email_p,
employees.band AS emp_grade,
employees.designation AS emp_designation,
employees.basic_pay AS emp_basic_pay,
batch_data.emp_policy_id,
batch_data.bl AS batch_list_batch_code,
batch_data.bf AS batch_files_batch_code
@ -321,7 +364,19 @@ class EmployeePolicyModel extends Model
employees.dob AS emp_dob,
employees.gender AS emp_gender,
employees.relationship_code AS emp_relationship_code,
employees.relationship AS emp_relationship,
employees.emp_type as emp_type,
'SI' as event_type_data,
employees.doj AS emp_doj,
employees.mobile AS emp_mobile,
employees.email_corporate AS emp_email_c,
employees.email_personal AS emp_email_p,
employees.band AS emp_grade,
employees.designation AS emp_designation,
employees.basic_pay AS emp_basic_pay,
employee_polices.uhid AS risk_id,
employee_polices.pre_existing_alignments,
employee_polices.policy_end_date,
@ -338,11 +393,18 @@ class EmployeePolicyModel extends Model
sidata.new_si_premium - employee_polices.rata_premimum AS difference_premium,
ROUND((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365, 2) AS pro_rata_premimum,
ROUND((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365, 2) AS pro_rata_premium,
ROUND(((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2) AS gst,
((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) + ROUND(((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2) AS total
ROUND(
((sidata.new_si_premium - employee_polices.rata_premimum) *
(DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) +
ROUND(
((sidata.new_si_premium - employee_polices.rata_premimum) *
(DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2
), 2
) AS total
FROM
emp_endorsement a
@ -438,12 +500,23 @@ class EmployeePolicyModel extends Model
employees.dob AS emp_dob,
employees.gender AS emp_gender,
employees.relationship AS emp_relationship,
employees.relationship_code AS emp_relationship_code,
employees.emp_type as emp_type,
'D' as event_type_data,
employees.doj AS emp_doj,
employees.mobile AS emp_mobile,
employees.email_corporate AS emp_email_c,
employees.email_personal AS emp_email_p,
employees.band AS emp_grade,
employees.designation AS emp_designation,
employees.basic_pay AS emp_basic_pay,
employee_polices.basic_cover_si,
employee_polices.uhid as risk_id,
employee_polices.uhid as uhid,
employee_polices.policy_end_date,
employee_polices.rata_premimum as premium,
employee_polices.premium,
employee_polices.rata_premimum as pro_rata_premium,
batch_data.emp_policy_id AS emp_policy_id,
batch_data.bl AS batch_list_batch_code,
@ -516,96 +589,6 @@ class EmployeePolicyModel extends Model
}
public function updateTPAIDorUHID($update_data)
{
$client_id = $update_data['client_id'];
$client_policy_id = $update_data['client_policy_id'];
$name = $update_data['name'];
$emp_code = $update_data['emp_code'];
$uhid = $update_data['uhid'];
$tpa_id = $update_data['tpa_id'];
$query = "
UPDATE employee_polices
JOIN employees ON employees.id = employee_polices.employee_id
SET employee_polices.tpa_id = '{$tpa_id}',
employee_polices.uhid = '{$uhid}'
WHERE employees.emp_code = '{$emp_code}'
AND employees.name = '{$name}'
AND employees.client_id = '{$client_id}'
AND employee_polices.client_policy_id = '{$client_policy_id}'
";
$this->query($query);
}
public function updateCorrectionData($update_data)
{
$emp_code = $update_data['emp_code'];
$uhid = $update_data['uhid'];
$endorsement_id = $update_data['tpa_id'];
$sql = "
UPDATE emp_endorsement
JOIN employees ON employees.id = emp_endorsement.pk
JOIN employee_polices ON employees.id = employee_polices.employee_id
SET emp_endorsement.endorsement_id = '$endorsement_id', emp_endorsement.status = 'complete'
WHERE employees.emp_code = '$emp_code'
AND employee_polices.uhid = '$uhid'
";
$query = $this->query($sql);
}
public function updateEndoresmentIdForSIEnhancement($update_data){
$client_id = $update_data['client_id'];
$client_policy_id = $update_data['client_policy_id'];
$emp_name = $update_data['emp_name'];
$emp_code = $update_data['emp_code'];
$endorsement_id = $update_data['endorsement_id'];
$sql = "
UPDATE emp_endorsement
JOIN employee_polices ON employee_polices.id = emp_endorsement.pk
JOIN employees ON employee_polices.employee_id = employees.id
SET emp_endorsement.endorsement_id = '$endorsement_id', emp_endorsement.status = 'complete'
WHERE emp_endorsement.emp_code = '$emp_code'
AND employees.client_id = '$client_id'
AND employee_polices.client_policy_id = '$client_policy_id'
AND emp_endorsement.actions = 'si'
AND emp_endorsement.name = '$emp_name'
";
$query = $this->query($sql);
}
public function updateEndoresmentIdForDeletion($update_data)
{
$client_id = $update_data['client_id'];
$client_policy_id = $update_data['client_policy_id'];
$emp_name = $update_data['emp_name'];
$emp_code = $update_data['emp_code'];
$endorsement_id = $update_data['endorsement_id'];
$sql = "
UPDATE emp_endorsement
JOIN employee_polices ON employee_polices.id = emp_endorsement.pk
JOIN employees ON employee_polices.employee_id = employees.id
SET emp_endorsement.endorsement_id = '$endorsement_id', emp_endorsement.status = 'complete'
WHERE employees.emp_code = '$emp_code'
AND employees.client_id = '$client_id'
AND employee_polices.client_policy_id = '$client_policy_id'
AND employees.name = '$emp_name'
";
$query = $this->query($sql);
}
public function fetchEmpEndorsementData($fetch_data)
{
@ -668,7 +651,8 @@ class EmployeePolicyModel extends Model
}
// //for emp onboard do not change
//for emp onboard do not change
// public function checkExistingEmpPolicy($arr)
// {
// return $this->where('employee_id',$arr['employee_id'])
@ -814,7 +798,7 @@ class EmployeePolicyModel extends Model
->get()->getResultArray();
}
public function getECardDataUsingMd5($client_policy_id, $emp_code){
public function getECardDataUsingMd5($client_policy_id, $emp_code,$client_id){
$result = $this->db->table('employees e')
->select('e.id,
@ -829,7 +813,7 @@ class EmployeePolicyModel extends Model
e.doj,
e.band,
TIMESTAMPDIFF(YEAR, e.dob, CURDATE()) AS emp_age,
(SELECT name FROM employees WHERE relationship = "Self" and emp_code = ' . $this->db->escape($emp_code) . ') AS self,
(SELECT name FROM employees WHERE relationship = "Self" and emp_code = ' . $this->db->escape($emp_code) . ' and client_id = '.$client_id.') AS self,
ep.tpa_id,
@ -881,7 +865,7 @@ class EmployeePolicyModel extends Model
}
public function getECardSingleData($rand_string, $emp_code){
public function getECardSingleData($rand_string, $emp_code,$client_id){
$result = $this->db->table('employees e')
->select('e.id,
@ -896,7 +880,7 @@ class EmployeePolicyModel extends Model
e.doj,
e.band,
TIMESTAMPDIFF(YEAR, e.dob, CURDATE()) AS emp_age,
(SELECT name FROM employees WHERE relationship = "Self" and emp_code = ' . $this->db->escape($emp_code) . ') AS self,
(SELECT name FROM employees WHERE relationship = "Self" and emp_code = ' . $this->db->escape($emp_code) . ' and client_id = '.$client_id.') AS self,
ep.tpa_id,

View File

@ -0,0 +1,23 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class InsurerExcelExportTemplateModel extends Model
{
protected $table = 'insurer_excel_export_template';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"insurer_id",
"policy_type_id",
"event_name",
"type_name",
"jsoncolumns",
"created_by",
"updated_by",
"updated_at",
"is_active",
];
}

View File

@ -18,7 +18,9 @@ class InsurerModel extends Model
"created_by",
"updated_by",
"is_active",
"addition_add_day"
"addition_add_day",
"is_multi_event",
];

View File

@ -22,6 +22,7 @@ class LevelContactModel extends Model
"updated_by",
"otp",
"is_active",
"token_time_out"
];
}

View File

@ -26,6 +26,9 @@ class PolicyPremium1Model extends Model
'is_active',
'grade',
'premium_type',
'rack_rate_name',
'unit',
'additional_relationship',
];

View File

@ -27,6 +27,8 @@ class PolicyPremium2Model extends Model
'relationship',
'additional_relationship',
'rack_rate_type',
'rack_rate_name',
'unit',
];

View File

@ -17,5 +17,6 @@ class PolicyTypeModel extends Model
"created_by",
"updated_by",
"is_active",
"long_name",
];
}

View File

@ -1 +1,80 @@
<h4 class="page-title">Welcome !</h4>
<style>
body {
.multiselect-native-select {
position: relative;
/* bottom: 32px; */
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;
}
}
.navtab-bg .nav-link {
margin: 0 5px 10px!important;
}
</style>
<div class="row" id="client_add">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
</div>
<div class="col-6" style="text-align: right;">
</div>
</div>
<br>
<ul class="nav nav-pills navtab-bg">
<li class="nav-item">
<a href="#endorsement-dash-tab" data-toggle="tab" aria-expanded="false"
class="nav-link px-3 py-2 active" id="endorsement_tab">
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
<span class="d-none d-sm-inline-block">Endorsement</span>
</a>
</li>
<li class="nav-item">
<a href="#enrollment-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="enrollemnt_tab">
<span class="mr-1"><i class="fa fa-file"></i></span>
<span class="d-none d-sm-inline-block">Enrollment</span>
</a>
</li>
</ul>
<div class="tab-content">
<?php include('enrollment_dash.php'); ?>
<?php include('endorsement_dash.php'); ?>
</div>
</div>
</div>
</div>
</div>

View File

@ -58,7 +58,8 @@
</td>
<td><?php echo $file['client_short_name'] ?></td>
<td><?php echo $file['branch_name'] ?></td>
<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_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>

View File

@ -1,3 +1,36 @@
<style>
/* Hide the dropdown list */
/* .select2-container--default .select2-dropdown {
display: none;
} */
.select2-hidden-accessible + .select2-container .select2-dropdown {
display: none !important;
}
.select2-container .select2-selection--multiple .select2-selection__choice {
color: #000000;
}
</style>
<style>
.cards {
display: inline-block;
margin: 5px;
padding: 10px;
background-color: #f8f9fa;
border: 1px solid #ced4da;
border-radius: 4px;
}
.cards button {
background: none;
border: none;
color: red;
font-size: 16px;
cursor: pointer;
}
</style>
<div class="tab-pane fade" id="branch-tab">
<input type="hidden" id="client_id_for_client_branch" value="<?= isset($client['id']) ? $client['id'] : '' ?>" />
<div class="row float-right" style="padding-bottom: 10px;position: relative;right: 13px;">
@ -46,7 +79,7 @@
<div class="form-group col-md-6">
<label for="branch_code">Branch Code<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_code" placeholder="Enter Branch Code"
name="branch_code" required>
name="branch_code" onchange="setDefaultUnitValue(this)" required>
</div>
</div>
@ -92,6 +125,11 @@
<label for="gst">GST<span class="text-danger">*</span></label>
<input type="text" name="gst" class="form-control" id="gst" placeholder="Enter GST Number" data-parsley-error-message="Invalid GST Number. Example: 12ABCDE1234F5Z6" 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="state">Units<span class="text-danger"></span></label>
<select id="selected" class="form-control" multiple="multiple" name="units[]" >
</select>
</div>
<div class="form-group col-md-4">
<label class="switch" style="position: relative;top: 43px;left: 20px;">
<input id="sez" type="checkbox" name="sez">
@ -103,8 +141,12 @@
</div>
<hr>
<h6 class="header-title">Contact 1</h6>
<br>
<div class="form-row">
<div class="form-group col-md-6">
<label>Contact 1</label>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
@ -210,7 +252,6 @@ $(document).ready(function() {
});
$('#btnBranchAdd').click(function() {
branch_form_action = '<?= base_url("client/branch/create"); ?>';
@ -286,9 +327,11 @@ $('.btnBack').click(function() {
})
$("#branch_form").submit(function(event) {
var selectedValues = $("#selected").val();
console.log(selectedValues, selectedValues);
event.preventDefault();
branch_PrimaryKey = $('#client_id_branch').val();
@ -311,6 +354,13 @@ $("#branch_form").submit(function(event) {
var formData = new FormData($('#branch_form')[0]);
const jsonString = JSON.stringify(selectedValues);
console.log('jsonString', jsonString);
// Append the JSON string to the FormData object
formData.append('units', jsonString);
$.ajax({
data: formData,
url: branch_form_action,
@ -390,7 +440,6 @@ $("#branch_form").submit(function(event) {
contactCount = 1
});
$('body').on('click', '.btnBranchEdit', function() {
var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
@ -451,6 +500,8 @@ $('body').on('click', '.btnBranchEdit', function() {
$('#sez').prop('checked', false);
}
appendOption(res.data.units)
$('#name').val(res.contact[0].name);
$('#email').val(res.contact[0].email);
$('#mobile').val(res.contact[0].mobile);
@ -480,7 +531,6 @@ $('body').on('click', '.btnBranchEdit', function() {
console.log(branch_form_action);
});
$("#remove_btn").click(function() {
$("#name").val('');
$("#email").val('');
@ -500,8 +550,11 @@ function appendContactHtml(contact = false, reset = false) {
var html = `
<div id="${uniqueId}">
<hr>
<h6 class="header-title">Contact ${contactCount}</h6>
<br>
<div class="form-row">
<div class="form-group col-md-6">
<label>Contact ${contactCount}</label>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label>
@ -565,7 +618,6 @@ function storeButtonId(id) {
localStorage.setItem('buttonIds', JSON.stringify(buttonIds));
}
function hideStoredAddButtons() {
var storedIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
storedIds.forEach(function(id) {
@ -666,8 +718,6 @@ function removeClientBranch(element) {
}
function checkMobileNumber(input) {
console.log('function called')
@ -693,5 +743,155 @@ function checkMobileNumber(input) {
console.error(status, error);
});
}
</script>
<script>
$(document).ready(function() {
$("#selected").select2({
tags: true,
tokenSeparators: [], // Disable default token separators
createTag: function (params) {
var term = $.trim(params.term);
if (term === '') {
return null;
}
return {
id: term,
text: term,
newTag: true
};
}
});
// Intercept keydown event
$("#selected").on('select2:select', function (e) {
var newTag = e.params.data.newTag;
// Remove the tag if it was not created by pressing Enter
if (!newTag) {
$(this).find('option[value="' + e.params.data.id + '"]').remove();
$(this).trigger('change');
}
});
// Listen for the Enter key
$("#selected").on('keydown', function (e) {
if (e.key === 'Enter') {
var $input = $(this).data('select2').dropdown.$search || $(this).data('select2').selection.$search;
var term = $.trim($input.val());
if (term !== '') {
var option = new Option(term, term, true, true); // Set selected to true
$(this).append(option).trigger('change');
$input.val('');
}
e.preventDefault(); // Prevent the default action of the Enter key
}
});
// Get the Select2 container element
var select2Container = $('#selected').next('.select2-container');
// Find the dropdown within the Select2 container
var select2Dropdown = select2Container.find('.select2-dropdown');
// Set the display style to none
select2Dropdown.css('display', 'none');
});
$(document).ready(function() {
// Wait for Select2 to be fully initialized and rendered
$('#selected').on('select2:open', function (e) {
// Get the Select2 dropdown element
var select2Dropdown = $('.select2-container--open').find('.select2-dropdown');
// Set the display style to none
select2Dropdown.css('display', 'none');
});
});
function appendOption(data){
data = JSON.parse(data);
$('#selected').empty();
$.each(data, function(index, item) {
const option = $('<option>', {
value: item,
text:item,
selected: true
});
$('#selected').append(option);
});
}
function setDefaultUnitValue()
{
var client_id = $('#client_id_branch').val();
var branch_code = $('#branch_code').val();
var units = $('#selected').val();
console.log('client_id', client_id)
console.log('branch_code', branch_code)
console.log('units', units)
var url_for_get_client_details = '<?php echo base_url('util/get_client_details/') ?>' + client_id;
if(units.length == 0 || units.length == 1){
$.get(url_for_get_client_details, function(response){
console.log(response)
console.log(response.data)
if (!response || !response.data || !response.data.short_name) {
if (!response) {
console.log('Response is null');
} else if (!response.data) {
console.log('Response data is null');
} else if (!response.data.short_name) {
toastr.warning('The client has no Short name');
}
} else {
$('#selected').empty();
var default_unit = response.data.short_name + '-' + branch_code;
if(units.length == 1){
if(units[0] != default_unit){
const option = $('<option>', {
value: default_unit,
text: default_unit,
selected: true
});
$('#selected').append(option);
}
}else{
const option = $('<option>', {
value: default_unit,
text: default_unit,
selected: true
});
$('#selected').append(option);
}
}
}).fail(function(xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
});
}
}
</script>

View File

@ -56,10 +56,10 @@
<div class="form-group col-md-4">
<label for="email"> Policy Type<span class="text-danger">*</span></label>
<select class="form-control" id="policy_type" name="is_addon" required>
<select class="form-control" id="policy_type" name="policy_type_id" required>
<option value="0">Select Policy Type</option>
<?php foreach ($policy_type as $key => $value) { ?>
<option value="<?= $key ?>"><?= $value ?></option>
<?php foreach ($policy_types as $value) { ?>
<option value="<?= $value['id']?>"><?= $value['policy_type'] ?></option>
<?php } ?>
</select>
</div>
@ -74,6 +74,7 @@
</div>
<div class="form-row" id="first" style="display: none;">
<div class="form-group col-md-4">
<label for="email">Insurer<span class="text-danger">*</span></label>
<select class="form-control" id="insurer" name="insurer" required>
@ -84,12 +85,7 @@
<?php } ?>
</select>
</div>
<div class="form-group col-md-4">
<label for="policy">Policies<span class="text-danger">*</span></label>
<select class="form-control" id="policy" name="policy_id" required>
<option value="" selected>Select Policy</option>
</select>
</div>
<div class="form-group col-md-4">
<label for="mobile">TPA<span id="tpa_danger" class="text-danger">*</span></label>
<select class="form-control" id="tpa" name="tpa" required>
@ -100,22 +96,23 @@
<?php } ?>
</select>
</div>
</div>
<div class="form-row" id="second" style="display: none;">
<div class="form-group col-md-3">
<div class="form-group col-md-4">
<label for="policy_no">Policy No<span class="text-danger">*</span></label>
<input value="" type="text" class="form-control" placeholder="Enter Policy Number " name="policy_no" id="policy_no" required>
</div>
<div class="form-group col-md-3">
</div>
<div class="form-row" id="second" style="display: none;">
<div class="form-group col-md-4">
<label for="policy_start_date">Policy Start Date<span class="text-danger">*</span></label>
<input value="" type="text" class="form-control" placeholder="Enter Start Date " name="policy_start_date" id="start_date" required>
</div>
<div class="form-group col-md-3">
<div class="form-group col-md-4">
<label for="policy_end_date">Policy End Date<span class="text-danger">*</span></label>
<input value="" type="text" class="form-control" placeholder="Enter End Date " name="policy_end_date" id="end_date" required>
</div>
<div class="form-group col-md-3" id="policy_status_field">
<div class="form-group col-md-4" id="policy_status_field">
<label for="policy_status">Policy Status</label>
<input value="" type="text" class="form-control" placeholder="Policy Status" id="policy_status" readonly>
</div>
@ -145,6 +142,15 @@
<label for="inception_type" style="position: relative;bottom: 5px;left: 85px;">Enable
Employee Enrolment Process</label>
</div>
<div class="form-group col-md-4">
<label class="switch" style="position: relative;top: 43px;left: 20px;">
<input id="policy_visibility" type="checkbox" name="enrolment_visibility" checked>
<span class="slider round" style="height: 27px;"></span>
</label>
<label for="inception_type" style="position: relative;bottom: 5px;left: 85px;">Policy Visibilty</label>
</div>
</div>
<div id="policy_fields"></div>
@ -266,7 +272,7 @@
tpaValue = item.tpa_short + '-' + item.tpa_branch_code;
}
var policy_name_data = `${item.policy_name ?? ''}` + ' - ' + `${item.policy_no ?? ''}` + ' - ' + `${item.policy_type_name ?? ''}`;
var policy_name_data = `${item.policy_type_name ?? ''}` + ' - ' + `${item.policy_no ?? ''}`;
policyTable += `
<tr>
@ -304,7 +310,6 @@
});
$('.btnAdd').click(function() {
fetchClientBranch()
@ -319,7 +324,7 @@
$('#policy_no').val('').change();
$('#start_date').val('').change();
$('#end_date').val('').change();
$('#policy').html('<option value="" selected>Select Policy</option>').change();
// $('#policy').html('<option value="" selected>Select Policy</option>').change();
$('#policy_form_action').val('<?= base_url("client/policy/create"); ?>');
$('#policy_status_field').hide()
$('#base_policy_id').hide();
@ -337,7 +342,6 @@
})
$('.btnBack').click(function() {
$('#policy_form')[0].reset();
@ -378,11 +382,11 @@
return;
}
if (basePolicyDataId == policyDataId) {
// if (basePolicyDataId == policyDataId) {
toastr.warning('The policy cannot be the same as the base policy.', 'Warning');
return;
}
// toastr.warning('The policy cannot be the same as the base policy.', 'Warning');
// return;
// }
if (basePolicyDataId == 3 || basePolicyDataId == 2) {
@ -415,7 +419,8 @@
contentType: false,
success: function(res) {
//console.log(res);
console.log(res);
$('#policy_form')[0].reset();
if (res.status === false) {
toastr.error('Policy Dose Not Create', 'Error');
@ -489,10 +494,12 @@
tpaValue = item.tpa_short + '-' + item.tpa_branch_code;
}
var policy_name_data = `${item.policy_type_name ?? ''}` + ' - ' + `${item.policy_no ?? ''}`;
policyTable += `
<tr>
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
<td>${item.policy_name} (${item.policy_type_name})</td>
<td>${policy_name_data}</td>
<td>${item.branch_name}</td>
<td>${tpaValue}</td>
<td>${rearrangeDateFormat(item.policy_start_date)} / ${rearrangeDateFormat(item.policy_end_date)}</td>
@ -512,7 +519,7 @@
`;
});
$('#policy_table').append(policyTable);
console.log(policyTable);
// console.log(policyTable);
$('#insurer').val('');
@ -554,78 +561,6 @@
var selectedOption = $('#base_policy').find(':selected');
var base_policy_data_id = selectedOption.data('id');
// //console.log('base_policy_data_id', base_policy_data_id);
$.get(url, function(res) {
// res = JSON.parse(res)//
//console.log('polices', res)
var OptionsHTML = '';
OptionsHTML += '<option value="" selected>Select Policy</option>';
$policy_type_value = $('#policy_type').val();
$.each(res.data, function(index, item) {
if ($policy_type_value == 3) {
if (base_policy_data_id == 3) {
if (item.policy_type_id == 5) {
OptionsHTML += '<option data-id="' + item.policy_type_id +
'" value="' +
item.id +
'">' + item.name + '( ' + item.policy_type +
' )</option>';
}
} else {
if (item.policy_type_id == 5 || item.policy_type_id == 3) {
OptionsHTML += '<option data-id="' + item.policy_type_id +
'" value="' +
item.id +
'">' + item.name + '( ' + item.policy_type +
' )</option>';
}
}
} else if ($policy_type_value == 2) {
if (item.policy_type_id == 4 || item.policy_type_id == 5) {
OptionsHTML += '<option data-id="' + item.policy_type_id +
'" value="' +
item.id +
'">' + item.name + '( ' + item.policy_type + ' )</option>';
}
} else if ($policy_type_value == 1) {
// const policyTypeId = Number(item.policy_type_id);
// if ([1, 2, 3, 6, 7,].includes(policyTypeId))
if (item.policy_type_id == 1 || item.policy_type_id == 2 || item
.policy_type_id == 3 || item.policy_type_id == 7 || item.policy_type_id == 6){
//console.log(item.policy_type_id)
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' + item.id + '">' + item.name + '( ' + item.policy_type + ' )</option>';
}
} else {
OptionsHTML += '<option data-id="' + item.policy_type_id +
'" value="' +
item.id +
'">' + item.name + '( ' + item.policy_type + ' )</option>';
}
});
$('#policy').html(OptionsHTML);
}).fail(function(xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
});
$.get(url_for_cd, function(response){
@ -670,29 +605,6 @@
var url = '<?php echo base_url('util/check_policy_type/') ?>' + dataId + '/' + branch_id + '/' + client_id;
// if (dataId && branch_id && client_id) {
// // Check if all parameters exist
// if ($('#policy_PrimaryKey').val() == "" || id != $('#insurer_policy_id').val()) {
// $.get(url, function(response) {
// console.log(response);
// console.log(response.count);
// if (response.count > 0) {
// console.log('Policy already exist in the branch');
// toastr.error('Policy already exist in the branch', 'Error');
// $('#policy').val('').change();
// }
// console.log('outer');
// }).fail(function(xhr, status, error) {
// console.error(xhr.responseText);
// console.error(status, error);
// });
// }
// } else {
// console.log('Missing parameter(s): dataId, branch_id, or client_id');
// }
if (dataId == 1) {
$('#tpa').prop('required', false);
@ -704,42 +616,41 @@
var base_policy_dataId = $('#base_policy').children('option:selected').attr('data-id');
if ($('#policy_type').val() == 1) {
if ($('#policy_type').val() == 1) {
// //console.log('step 1')
// //console.log('step 1')
if (dataId == 3) {
if (dataId == 3) {
// //console.log('step 2')
// //console.log('step 2')
var displayStatus = $('#base_policy_id').css('display');
$('#base_policy_id').show();
$('#base_danger').hide();
// $('#base_policy').prop('required', true);
var displayStatus = $('#base_policy_id').css('display');
$('#base_policy_id').show();
$('#base_danger').hide();
// $('#base_policy').prop('required', true);
if (displayStatus === 'none') {
// //console.log('step 2.1')
if (displayStatus === 'none') {
// //console.log('step 2.1')
$('#base_policy').val('').change();
}
// $('#base_policy').find('option[data-id="3"]').hide();
} else {
// //console.log('step 3')
var displayStatus = $('#base_policy_id').css('display');
$('#base_policy_id').hide();
$('#base_danger').show();
// $('#base_policy').prop('required', false);
if (displayStatus === 'none') {
// //console.log('step 3.1')
$('#base_policy').val('').change();
}
$('#base_policy').val('').change();
}
// $('#base_policy').find('option[data-id="3"]').hide();
} else {
// //console.log('step 3')
var displayStatus = $('#base_policy_id').css('display');
$('#base_policy_id').hide();
$('#base_danger').show();
// $('#base_policy').prop('required', false);
if (displayStatus === 'none') {
// //console.log('step 3.1')
$('#base_policy').val('').change();
}
}
}
});
@ -762,7 +673,7 @@
dataType: 'json',
success: function(res) {
console.log('client_policy_res', res)
console.log('client_policy_res', res);
var gst = (res.data.gst == 0.00) ? 18 : res.data.gst;
@ -791,7 +702,7 @@
}
$('#tpa').val(tpaValue).change();
$('#policy_type').val(res.data.is_addon).change();
$('#policy_type').val(res.data.policy_type_id).change();
$('#base_policy').val(res.data.base_policy);
$('#policy_type_id').val(res.data.policy_type_id);
@ -812,24 +723,68 @@
}
if (res.data.is_addon != '1' && res.data.is_addon != '0') {
if (res.data.enrolment_visibility == 1) {
$('#policy_visibility').prop('checked', true);
} else {
$('#policy_visibility').prop('checked', false);
}
// if (res.data.is_addon != '1' && res.data.is_addon != '0') {
// $('#base_policy_id').show();
// $('#base_policy').prop('required', true);
// $('#first').show();
// $('#second').show();
// $('#third').show();
// } else if (res.data.is_addon == '0') {
// $('#first').hide();
// $('#second').hide();
// $('#third').hide();
// $('#base_policy_id').hide();
// $('#base_policy').prop('required', false);
// } else if (res.data.is_addon == '1') {
// $('#first').show();
// $('#second').show();
// $('#third').show();
// $('#base_policy_id').hide();
// $('#base_policy').prop('required', false);
// }
if (res.data.policy_type_id == '4' || res.data.policy_type_id == '5') {
$('#base_policy_id').show();
$('#base_policy').prop('required', true);
$('#first').show();
$('#second').show();
$('#third').show();
} else if (res.data.is_addon == '0') {
} else if (res.data.policy_type_id == '0') {
$('#first').hide();
$('#second').hide();
$('#third').hide();
$('#base_policy_id').hide();
$('#base_policy').prop('required', false);
} else if (res.data.is_addon == '1') {
} else if (res.data.policy_type_id == '1' || res.data.policy_type_id == '2' || res.data.policy_type_id == '6' || res.data.policy_type_id == '7') {
$('#first').show();
$('#second').show();
$('#third').show();
$('#base_policy_id').hide();
$('#base_policy').prop('required', false);
}else if(res.data.policy_type_id == '3'){
$('#first').show();
$('#second').show();
$('#third').show();
$('#base_policy_id').show();
$('#base_policy').prop('required', false);
$('#base_danger').hide();
}
@ -870,7 +825,6 @@
setTimeout(function(){
appendCDACNO(res.cd_data, res.data.cd_ac_no) // append and select the current CD Account Number
appendPolicyList(res.policy, res.data.policy_id, ); // append and select the current policy
appendBasePolicyList(res.client_policy_list, res.data.base_policy, res.data.client_branch_id); // append and select the Base palicy
}, 2000)
@ -889,7 +843,6 @@
});
});
$('body').on('click', '.btnOpenEnroll', function() {
Swal.fire({
@ -990,7 +943,6 @@
});
//for date convert to indian formate like this 'yyyy-mm-dd' to this 'dd-mm-yyyy'
function rearrangeDateFormat(inputDate) {
@ -1230,11 +1182,6 @@
}
function removeClientPolicy(element) {
// //console.log(element);
}
$('#policy_type').change(function() {
$('#insurer').val('').change();
@ -1244,12 +1191,30 @@
$('#end_date').val('');
$('#base_policy').val('').change();
var client_id = $('#client_id_policy').val();
var client_branch_id = $('#client_branch').val();
if ($(this).val() == 2 || $(this).val() == 3) {
var url_for_get_policy_type_list = '<?php echo base_url('util/get_policy_type_for_base_policy/') ?>' + client_id + '/' + client_branch_id;
$.get(url_for_get_policy_type_list, function(response){
console.log(response)
console.log(response.data)
appendBasePolicyList(response.data);
}).fail(function(xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
});
if ($(this).val() == 4 || $(this).val() == 5) {
$("#insurer").next(".select2-container").css({
'pointer-events': 'none',
});
$('#select2-insurer-container').css({
'background-color': '#ebebe0',
});
@ -1257,6 +1222,7 @@
$("#tpa").next(".select2-container").css({
'pointer-events': 'none',
});
$('#select2-tpa-container').css({
'background-color': '#ebebe0',
});
@ -1283,17 +1249,18 @@
});
}
if ($(this).val() == 3) {
if ($(this).val() == 5) {
toastr.warning('Please Change the Policy Terms after Submit the Policy!', 'INFO');
}
if ($(this).val() != '1' && $(this).val() != '0') {
if ($(this).val() == '4' || $(this).val() == '5') {
$('#base_policy_id').show();
$('#base_policy').prop('required', true);
$('#first').show();
$('#second').show();
$('#third').show();
$('#base_danger').show();
} else if ($(this).val() == '0') {
@ -1302,15 +1269,25 @@
$('#third').hide();
$('#base_policy_id').hide();
$('#base_policy').prop('required', false);
$('#base_danger').show();
} else if ($(this).val() == '1') {
} else if ($(this).val() == '1' || $(this).val() == '2' || $(this).val() == '6' || $(this).val() == '7') {
$('#first').show();
$('#second').show();
$('#third').show();
$('#base_policy_id').hide();
$('#base_policy').prop('required', false);
$('#base_danger').show();
}else if($(this).val() == '3'){
$('#first').show();
$('#second').show();
$('#third').show();
$('#base_policy_id').show();
$('#base_policy').prop('required', false);
$('#base_danger').hide();
}
})
@ -1386,24 +1363,15 @@
var client_policy_id = $(this).val() ? $(this).val() : 0;
var policy_type = $('#policy_type').val()
// //console.log(client_policy_id);
console.log('client_policy_id', client_policy_id);
dataId = $('#policy').children('option:selected').attr('data-id');
// //console.log('dataId', dataId)
base_policy_data_id = $(this).children('option:selected').attr('data-id');
// //console.log('base_policy_data_id', base_policy_data_id);
console.log('base_policy_data_id', base_policy_data_id);
var queryParams = {
client_policy_id: client_policy_id,
policy_type: policy_type,
};
const queryString = objectToQueryString(queryParams);
// var uri = '<?= base_url('util/fetch-policy-for-policy-type') ?>?' + queryString
var uri = '<?= base_url('client/policy/list/') ?>' + client_policy_id
// //console.log('uri', uri)
// //console.log('queryString', queryString)
console.log('uri', uri)
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
@ -1430,35 +1398,6 @@
$('#policy_no').val(res.data.policy_no).change();
$('#start_date').val(rearrangeDateFormat(res.data.policy_start_date)).change();
$('#end_date').val(rearrangeDateFormat(res.data.policy_end_date)).change();
var policeOptionHTML = '';
$policy_type_value = $('#policy_type').val();
$.each(res.policy, function(index, item) {
policeOptionHTML += '<option data-id="' + item.policy_type_id +
'" value="' + item.id + '" ' + (res.data.policy_id === item
.id ?
'selected="selected"' : '') + '>' + item.name +
'</option>';
});
console.log('policeOptionHTML', policeOptionHTML)
$('#policy').html(policeOptionHTML);
if (dataId == 3 || policy_type == 1) {
setTimeout(function() {
var $option = $('#policy').find('option[data-id="3"]');
if ($option.length > 0) {
$option.prop('selected', true).change();
} else {
toastr.warning('The insurer does not have a GMC-Parents policy.', 'Warning');
}
}, 1500);
}
}
},
@ -1468,7 +1407,6 @@
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
//console.log('Something Wrong!', 'warning');
}, 500);
}
});
@ -1476,10 +1414,6 @@
});
})
function objectToQueryString(obj) {
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
}
// fetch the client branch list for the dropdown
function fetchClientBranch() {
@ -1547,15 +1481,6 @@
});
}
$(document).ready(function() {
$("#client_branch").on('change', function() {
fetchClientPolicyList();
});
})
//append the CD Account number for the dropdown
function appendCDACNO(data, select = null) {
@ -1584,36 +1509,8 @@
});
}
// append Policies list to the dropdown for edit only
function appendPolicyList(data, select = null, ) {
console.log('appendPolicyList', 'function called');
console.log('appendPolicyList data', data);
console.log('appendPolicyList selected value', select);
$('#policy').empty();
$('#policy').append($('<option>', {
value: '',
text: 'Select Policy'
}));
$.each(data, function(index, item) {
const option = $('<option>', {
value: item.id, //policy id primary key
text: item.name + ' - ' + item.policy_type, // policy name
'data-id': item.policy_type_id //policy type id like gpa and gmc
});
if (select === item.id) {
option.attr('selected', true);
}
$('#policy').append(option);
});
}
// append Base Policy to the dropdown for edit only
function appendBasePolicyList(data, select = null, client_branch_id = null) {
function appendBasePolicyList(data, select = null) {
console.log('appendBasePolicyList', 'function called');
console.log('appendBasePolicyList data', data);
@ -1627,20 +1524,16 @@
$.each(data, function(index, item) {
if (item.client_branch_id == client_branch_id) {
const option = $('<option>', {
value: item.client_policy_id,
text:`${item.policy_type ?? ''} - ${item.policy_no ?? ''}`,
'data-id': item.id
});
const option = $('<option>', {
value: item.id,
text: item.name + ' - ' + item.policy_type,
'data-id': item.policy_type_id
});
if (select === item.id) {
//console.log('selected');
option.attr('selected', true);
}
$('#base_policy').append(option);
if (select === item.client_policy_id) {
option.attr('selected', true);
}
$('#base_policy').append(option);
});
}

View File

@ -76,7 +76,8 @@
<tr>
<td><b><?php echo ($key + 1)?></b></td>
<td><?php echo $employee['name']?>( <?php echo $employee['emp_code']?> - <?php echo $employee['relationship']?> )</td>
<td><?php echo isset($employee['policy_name']) ? $employee['policy_name'] : '' ?> - <?php echo isset($employee['policy_no']) ? $employee['policy_no'] : '' ?> - <?php echo isset($employee['policy_type']) ? $employee['policy_type'] : '' ?></td>
<!-- <td><?php echo isset($employee['policy_name']) ? $employee['policy_name'] : '' ?> - <?php echo isset($employee['policy_no']) ? $employee['policy_no'] : '' ?> - <?php echo isset($employee['policy_type']) ? $employee['policy_type'] : '' ?></td> -->
<td><?php echo isset($employee['policy_type']) ? $employee['policy_type'] : '' ?> - <?php echo isset($employee['policy_no']) ? $employee['policy_no'] : '' ?></td>
<td><?php echo $employee['insurer_short_name']?></td>
<td><?php echo $employee['tpa_id']?></td>
<td><?php echo $employee['uhid']?></td>

View File

@ -253,7 +253,8 @@ function appendPolicies(data) {
$.each(data, function(index, item) {
var option = $('<option>', {
value: item.client_policy_id,
text: `${item.name ?? ''} - ${item.policy_no ?? ''} - ${item.policy_type ?? ''}`
// text: `${item.name ?? ''} - ${item.policy_no ?? ''} - ${item.policy_type ?? ''}`
text:`${item.policy_type ?? ''} - ${item.policy_no ?? ''}`
});
if (PolicyID == item.client_policy_id) {
option.attr('selected', true);

View File

@ -645,7 +645,8 @@ function appendPolicies(data) {
var option = $('<option>', {
value: item.client_policy_id,
text:`${item.name ?? ''} - ${item.policy_no ?? ''} - ${item.policy_type ?? ''}`
// text:`${item.name ?? ''} - ${item.policy_no ?? ''} - ${item.policy_type ?? ''}`
text:`${item.policy_type ?? ''} - ${item.policy_no ?? ''}`
});
if (client_policy_param == item.client_policy_id) {
option.attr('selected', true);
@ -989,6 +990,19 @@ function checkPolicyTermsAndRackRatesHasDefiend(event)
$('.si-enhancement-option').show();
}
var event = response.insurer_multi_event ;
$('#event_type_data').val(response.insurer_multi_event);
if(event == 1){
$("#event_type").attr("multiple", "multiple");
$("#event_type").attr("name", "event_type[]");
$("#event_type").select2();
}else{
$("#event_type").removeAttr("multiple");
$("#event_type").attr("name", "event_type");
$("#event_type").select2('destroy');
}
if (response.code === 200 && response.dataStatus === true && response.message !== null) {
toastr.error(response.message, 'Error');

View File

@ -0,0 +1,4 @@
<div class="tab-pane active show" id="endorsement-dash-tab">
<h1>Endorsement</h1>
</div>

View File

@ -110,7 +110,8 @@
<tr>
<td><b><?php echo ($key + 1) ?></b></td>
<td><?php echo $employee['name'] ?>( <?php echo $employee['emp_code'] ?> )</td>
<td><?php echo isset($employee['policy_name']) ? $employee['policy_name'] : '' ?> - <?php echo isset($employee['policy_no']) ? $employee['policy_no'] : '' ?> - <?php echo isset($employee['policy_type']) ? $employee['policy_type'] : '' ?></td>
<!-- <td><?php echo isset($employee['policy_name']) ? $employee['policy_name'] : '' ?> - <?php echo isset($employee['policy_no']) ? $employee['policy_no'] : '' ?> - <?php echo isset($employee['policy_type']) ? $employee['policy_type'] : '' ?></td> -->
<td><?php echo isset($employee['policy_type']) ? $employee['policy_type'] : '' ?> - <?php echo isset($employee['policy_no']) ? $employee['policy_no'] : '' ?></td>
<td><?php echo $employee['endorsement_id'] ?></td>
<td><?php echo isset($employee['insurer_short_name']) ? $employee['insurer_short_name'] : '' ?>
</td>
@ -326,7 +327,8 @@
$.each(data, function(index, item) {
var option = $('<option>', {
value: item.client_policy_id,
text: `${item.name ?? ''} - ${item.policy_no ?? ''} - ${item.policy_type ?? ''}`
// text: `${item.name ?? ''} - ${item.policy_no ?? ''} - ${item.policy_type ?? ''}`
text:`${item.policy_type ?? ''} - ${item.policy_no ?? ''}`
});
if (PolicyID == item.client_policy_id) {
option.attr('selected', true);

View File

@ -0,0 +1,115 @@
<style>
.status-option {
padding: 0.5rem !important;
background-color: darkgrey;
}
.emp-count-view-click {
cursor: pointer;
}
.emp-status .col-6 {
/* padding-bottom: 1rem; */
}
.emp-status label {
font-weight: bold;
}
.client-branch-label {
padding: 0.2rem;
border-radius: 0.2rem;
display: inline-block;
}
.scroll-container {
display: flex;
overflow-x: auto;
white-space: nowrap;
}
.scroll-item {
flex: 0 0 auto;
width: 25%; /* Adjust based on the number of items you want to show */
box-sizing: border-box;
padding: 0 10px;
}
.center_text{
text-align: center;
}
.card-body {
padding: 0rem ;
}
.number_css{
font-family: Roboto, sans-serif;
color: #343a40;
}
.label_bottom_reduce{
margin-bottom: .0rem;
}
</style>
<div class="tab-pane fade" id="enrollment-dash-tab">
<div class="row visa_status_count_view">
<div class="col-12">
<div class="card">
<div class="card-header"></div>
<div class="card-body status-option" id="statusContent" style="padding: 0.5rem !important;background-color: #edf1f5;">
<div class="scroll-container">
<?php foreach ($client_branch_emp_list as $clients) { ?>
<?php foreach ($clients['branches'] as $branches) { ?>
<div class="scroll-item">
<div class="card">
<div class="card-body emp-count-view-click">
<div class="d-flex justify-content-center">
<div class="col-12 center_text" style="background-color: #02a8b5;">
<label for="" class="client-branch-label">
<?php echo isset($clients['short_name']) ? $clients['short_name'] : 'N/A'; ?> -
<?php echo isset($branches['branch_name']) ? $branches['branch_name'] : 'N/A'; ?>
</label>
</div>
</div>
<div class="row emp-status">
<div class="col-12 center_text">
<span class="number_css" style="font-size: x-large;"><?php echo isset($branches['employees']) ? count($branches['employees']) : '0'; ?></span><br>
<i class="fa fa-users" aria-hidden="true"></i>
</div>
<div class="col-6 center_text">
<span style="font-size: x-large;" class="number_css"><?php echo isset($branches['emp_login']) ? $branches['emp_login'] : '0'; ?></span><br>
<label class="label_bottom_reduce" for="" style="color: gray;font-family: var(--bs-body-font-family);font-size: var(--bs-body-font-size);">Logged-In</label>
</div>
<div class="col-6 center_text">
<span style="font-size: x-large;" class="number_css"><?php echo isset($branches['emp_enroll']) ? count($branches['employees']) - $branches['emp_enroll'] : '0'; ?></span><br>
<label class="label_bottom_reduce" for="" style="color: gray;font-family: var(--bs-body-font-family);font-size: var(--bs-body-font-size);">Draft</label>
</div>
<div class="col-6 center_text">
<span style="font-size: x-large;" class="number_css"><?php echo isset($branches['emp_login']) ? count($branches['employees']) - $branches['emp_login'] : '0'; ?></span><br>
<label class="label_bottom_reduce" for="" style="color: gray;font-family: var(--bs-body-font-family);font-size: var(--bs-body-font-size);">Not Logged-In</label>
</div>
<div class="col-6 center_text">
<span style="font-size: x-large;" class="number_css"><?php echo isset($branches['emp_enroll']) ? $branches['emp_enroll'] : '0'; ?></span><br>
<label class="label_bottom_reduce" for="" style="color: gray;font-family: var(--bs-body-font-family);font-size: var(--bs-body-font-size);">Enrolled</label>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('.scroll-container').on('wheel', function(e) {
if (e.originalEvent.deltaY < 0) {
this.scrollLeft -= 100; // Adjust scroll speed
} else {
this.scrollLeft += 100; // Adjust scroll speed
}
e.preventDefault();
});
});
</script>

View File

@ -0,0 +1,422 @@
<style>
.table th,
.table td {
padding: 8px;
}
table.dataTable tbody td {
padding: 4px 4px !important;
}
.btn .btn-secondary .buttons-csv .buttons-html5 .my_class {
position: relative;
left: 79px;
}
.visa_status_count_view .card-header {
/* background-color: #eb7a76; */
background-color: darkgrey;
/* padding-bottom: 1px; */
padding-top: 10px;
}
#tickets-table_filter {
float: right;
}
.click_hover {
background: #1aa79c !important;
color: #fff !important;
border-radius: 5px;
box-shadow: 6px 5px 8px 0 #00000036;
cursor: pointer;
}
.click_hover .text-muted{
color: #fff !important;
}
.click_hover span{
color: #fff !important;
}
.card {
border-radius: 10px;
}
</style>
<div class="row visa_status_count_view">
<div class="col-12">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-3">
<div id="categoryFilter" style="display: flex;">
<select class="form-control" id="clients" onchange="populateBranches()">
<option value="0">Select Client</option>
<?php foreach ($client_list as $client) { ?>
<option value="<?= $client['id'] ?>"><?= $client['client_name'] ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-3">
<div id="categoryFilter_11">
<select name="branch_id" class="form-control" id="branch_id">
<option value="0">Select Branch</option>
</select>
</div>
</div>
<div class="col-3">
<div id="categoryFilter_11">
<a href="#" class="btn btn-primary waves-effect waves-light" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Search</a>
</div>
</div>
<div class="col-3 text-right view-status-btn">
<button type="button" class="btn btn-link visa_status_button" onclick="toggleContent()">
Status <i id="toggleIcon" class="fas fa-minus"></i>
</button>
</div>
</div>
</div>
<div class="card-body status-option" id="statusContent" style="padding: 0.5rem !important;background-color: darkgrey;">
<div class="text-center">
<div class="row" style="margin-right: -261px;margin-left: 5px;">
<div class="col-xl-2 col-md-3">
<div class="card">
<div class="card-body" id="emp_count_view_click">
<div class="d-flex justify-content-between" style="justify-content: center !important;">
<div>
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Emp Count">Emp Count</h5>
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_count_view">0</span></h3>
</div>
</div>
</div>
</div>
</div><!-- end col -->
<div class="col-xl-2 col-md-3">
<div class="card">
<div class="card-body" id="emp_enrolled_view_click">
<div class="d-flex justify-content-between" style="justify-content: center !important;">
<div>
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Enrolled">Enrolled</h5>
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_enrolled_view">0</span></h3>
</div>
</div>
</div>
</div>
</div><!-- end col -->
<div class="col-xl-2 col-md-3">
<div class="card">
<div class="card-body" id="emp_not_enrolled_view_click">
<div class="d-flex justify-content-between" style="justify-content: center !important;">
<div>
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Not Enrolled">Not Enrolled</h5>
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_not_enrolled_view">0</span></h3>
</div>
</div>
</div>
</div>
</div><!-- end col -->
<div class="col-xl-2 col-md-3">
<div class="card">
<div class="card-body" id="emp_logged_in_view_click">
<div class="d-flex justify-content-between" style="justify-content: center !important;">
<div>
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Logged-In">Logged-In</h5>
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_logged_in_view">0</span></h3>
</div>
</div>
</div>
</div>
</div><!-- end col -->
<div class="col-xl-2 col-md-3">
<div class="card">
<div class="card-body" id="emp_not_logged_in_view_click">
<div class="d-flex justify-content-between" style="justify-content: center !important;">
<div>
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Not Logged-In">Not Logged-In</h5>
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_not_logged_in_view">0</span></h3>
</div>
</div>
</div>
</div>
</div><!-- end col -->
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" id="client_list">
<div class="col-12">
<div class="card" style="">
<div class="card-body">
<table class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" id="tickets-table">
<thead class="bg-light">
<tr>
<th class="font-weight-medium">SNO</th>
<th class="font-weight-medium">Name</th>
<th class="font-weight-medium">Emp Code</th>
<th class="font-weight-medium">Enrolled</th>
<th class="font-weight-medium">Logged-In</th>
</tr>
</thead>
<tbody class="font-12">
<!-- Table body -->
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Center modal content omitted for brevity -->
<script>
function populateBranches() {
var clientId = document.getElementById('clients').value;
var branchDropdown = document.getElementById('branch_id');
branchDropdown.innerHTML = '<option value="0">Select Branch</option>';
if (clientId == 0) {
return;
}
var branches = <?= json_encode($branch_list) ?>;
branches.forEach(branch => {
if (branch.client_id == clientId) {
var option = document.createElement('option');
option.value = branch.id;
option.textContent = branch.branch_name;
branchDropdown.appendChild(option);
}
});
}
function filterTable(columnIndex, filterValue) {
var table = $('#tickets-table').DataTable();
// Reset the search filter for all columns
table.columns().search('').draw();
// Apply the filter to the specified column
table.column(columnIndex).search(filterValue).draw();
}
function fetchEmpolyeeList(event) {
event.preventDefault();
var client_id = $('#clients').val();
var branch_id = $('#branch_id').val();
if (client_id == '0' || branch_id == '0') {
alert('Please select values in both dropdowns.');
return;
}
$.ajax({
url: '<?php echo base_url(); ?>' + '/employee/empby_client_clientbranch/' + client_id + '/' + branch_id,
method: 'GET',
headers: {
"Content-Type": "application/json",
"X-Requested-With": "XMLHttpRequest"
},
success: function(response) {
var data = JSON.parse(response);
var table = $('#tickets-table').DataTable();
table.clear();
if (data.length === 0) {
table.row.add([
'',
'',
'No data available',
'',
'',
''
]).draw();
return;
}
var enrolled_count = 0;
var loggedIn_count = 0;
data.forEach(function(employee, index) {
if(employee.emp_status !== 'draft'){
var enrolled = 'Yes';
enrolled_count++;
}else{
var enrolled = 'No';
}
if(employee.user_type === 'employee'){
var loggedIn = 'Yes';
loggedIn_count++;
}else{
var loggedIn = 'No';
}
table.row.add([
index + 1,
employee.employee_name,
employee.emp_code,
enrolled,
loggedIn
]);
$('#emp_count_view').html(data.length);
$('#emp_enrolled_view').html(enrolled_count);
$('#emp_not_enrolled_view').html(data.length - enrolled_count);
$('#emp_logged_in_view').html(loggedIn_count);
$('#emp_not_logged_in_view').html(data.length - loggedIn_count);
});
table.draw();
},
error: function(xhr, status, error) {
console.error('Error fetching data from API:', error);
}
});
}
$(document).ready(function() {
$('#clients').select2();
$('#branch_id').select2();
var table = $('#tickets-table').DataTable({
dom: 'fBrtip',
buttons: [
{
extend: 'copy',
text: '<i class="fa fa-copy"></i>',
titleAttr: 'Copy',
filename: 'Enrollment List'
},
{
extend: 'print',
text: '<i class="fa fa-print"></i>',
titleAttr: 'Print',
filename: 'Enrollment List'
},
{
extend: 'pdf',
text: '<i class="fa fa-file-pdf"></i>',
titleAttr: 'PDF',
filename: 'Enrollment List'
},
{
extend: 'csv',
text: '<i class="fa fa-file-csv"></i>',
titleAttr: 'CSV',
filename: 'Enrollment List'
}
],
initComplete: function() {
// Add custom class to the print button
$('.buttons-print').addClass('buttons-html5');
}
});
$('#emp_enrolled_view_click').on('click', function() {
if ($(this).hasClass('click_hover')) {
// $(this).removeClass('click_hover');
$('.click_hover').each(function() {
$(this).removeClass('click_hover');
});
table.columns().search('').draw(); // Clear all filters and show all data
}else{
$('.click_hover').each(function() {
$(this).removeClass('click_hover');
});
$('#emp_enrolled_view_click').addClass('click_hover');
filterTable(3, 'Yes'); // Filter "Enrolled" column (4th column, index 3)
}
});
$('#emp_not_enrolled_view_click').on('click', function() {
if ($(this).hasClass('click_hover')) {
// $(this).removeClass('click_hover');
$('.click_hover').each(function() {
$(this).removeClass('click_hover');
});
table.columns().search('').draw(); // Clear all filters and show all data
}else{
$('.click_hover').each(function() {
$(this).removeClass('click_hover');
});
$('#emp_not_enrolled_view_click').addClass('click_hover');
filterTable(3, 'No'); // Filter "Enrolled" column (4th column, index 3)
}
});
$('#emp_logged_in_view_click').on('click', function() {
if ($(this).hasClass('click_hover')) {
// $(this).removeClass('click_hover');
$('.click_hover').each(function() {
$(this).removeClass('click_hover');
});
table.columns().search('').draw(); // Clear all filters and show all data
}else{
$('.click_hover').each(function() {
$(this).removeClass('click_hover');
});
$('#emp_logged_in_view_click').addClass('click_hover');
filterTable(4, 'Yes'); // Filter "Logged-In" column (5th column, index 4)
}
});
$('#emp_not_logged_in_view_click').on('click', function() {
if ($(this).hasClass('click_hover')) {
// $(this).removeClass('click_hover');
$('.click_hover').each(function() {
$(this).removeClass('click_hover');
});
table.columns().search('').draw(); // Clear all filters and show all data
}else{
$('.click_hover').each(function() {
$(this).removeClass('click_hover');
});
$('#emp_not_logged_in_view_click').addClass('click_hover');
filterTable(4, 'No'); // Filter "Logged-In" column (5th column, index 4)
}
});
$('#emp_count_view_click').on('click', function() {
if ($(this).hasClass('click_hover')) {
// $(this).removeClass('click_hover');
$('.click_hover').each(function() {
$(this).removeClass('click_hover');
});
table.columns().search('').draw(); // Clear all filters and show all data
}else{
$('.click_hover').each(function() {
$(this).removeClass('click_hover');
});
$('#emp_count_view_click').addClass('click_hover');
table.columns().search('').draw(); // Clear all filters and show all data
}
});
toggleContent();
});
function toggleContent() {
var content = document.getElementById("statusContent");
var toggleIcon = document.getElementById("toggleIcon");
if (content.style.display === "none") {
content.style.display = "block";
toggleIcon.classList.remove("fa-plus");
toggleIcon.classList.add("fa-minus");
} else {
content.style.display = "none";
toggleIcon.classList.remove("fa-minus");
toggleIcon.classList.add("fa-plus");
}
}
</script>

View File

@ -50,7 +50,8 @@
</td>
<td><?php echo $file['short_name'] ?></td>
<td><?php echo $file['branch_name'] ?></td>
<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_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['action'] ?></td>
<td><?php echo fancy_date_time_format($file['created_at']) . ' by <strong>' . $file['first_name'] . '</strong>' ?>
</td>

View File

@ -1,5 +1,11 @@
<div class="tab-pane fade" id="KYC-DOC-tab">
<style>
.select2-container .select2-selection--multiple .select2-selection__choice {
padding: 5px 7px 5px 0 !important;
color: #000000;
}
</style>
<div class="tab-pane fade" id="KYC-DOC-tab">
<div class="row">
<div class="col-xl-12">
<div id="accordion" class="mb-3">
@ -14,6 +20,7 @@
<!-- <div class="text-center"> -->
<form class="parsley-examples" id="import_export_excel_form" action="<?php echo base_url() . 'util/import-export' ?>" method="post" enctype="multipart/form-data">
<input type="hidden" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>" id="csrf_token">
<input type="hidden" id="event_type_data">
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-4">
@ -82,7 +89,6 @@
?>
</select>
</div>
</div>
<br>
@ -130,9 +136,9 @@
$("#client").select2();
$("#policy").select2();
$("#client_branch_id").select2();
});
// Declare a global variable to store API response data
var clientPolicies = [];
var clientPoliciesWithBranch2 = {
@ -224,8 +230,6 @@
});
$(window).on("load", function() {
fetchClientPolicies2();
@ -239,8 +243,6 @@
// Use URLSearchParams to get the query parameters
const params = new URLSearchParams(urlObject.search);
// Get the value of 'client_id' and 'client_policy_id'
client_id_param2 = params.get('client_id');
client_policy_param2 = params.get('client_policy_id');
@ -249,16 +251,12 @@
insurer_or_tpa = params.get('insurer_or_tpa');
event = params.get('event');
// console.log('client_id2:', client_id_param2);
// console.log('client_policy_id2:', client_policy_param2);
// console.log('actions:', actions);
// console.log('insurer_or_tpa:', insurer_or_tpa);
// console.log('event:', event);
if (inception_param != null) {
$('#action_type').val(actions).change()
@ -286,7 +284,6 @@
});
function fetchClientPolicies2() {
$('#loader').show();
@ -364,7 +361,6 @@
$('#loader').hide();
}
function appendClients2(data) {
// console.log('client_id_param2', client_id_param2)
@ -381,7 +377,6 @@
});
}
function appendBranch2(data) {
// console.log(data)
@ -403,7 +398,6 @@
});
}
function appendPolicies2(data) {
$('#policy').empty();
@ -415,7 +409,8 @@
$.each(data, function(index, item) {
var option = $('<option>', {
value: item.client_policy_id,
text: `${item.name ?? ''} - ${item.policy_no ?? ''} - ${item.policy_type ?? ''}`
// text: `${item.name ?? ''} - ${item.policy_no ?? ''} - ${item.policy_type ?? ''}`
text:`${item.policy_type ?? ''} - ${item.policy_no ?? ''}`
});
if (client_policy_param2 == item.client_policy_id) {
option.attr('selected', true);
@ -510,7 +505,6 @@
//--------------------------------------------------------------------------------------
$('#action_type').change(function() {
var selectedValue = $(this).val();
@ -532,14 +526,12 @@
}
});
document.getElementById('toggleIcon').addEventListener('click', function() {
var icon = document.getElementById('icon');
icon.classList.toggle('mdi-chevron-down');
icon.classList.toggle('mdi-chevron-up');
});
$(document).ready(function() {
$('#event_type').change(function() {
@ -556,6 +548,59 @@
});
});
//--------------------------------------------------------------------------------------
$('#insurer_or_tpa').change(function(){
var insurer_or_tpa = $(this).val()
var policy_value = $('#policy').val()
var event_type_data = $('#event_type_data').val();
console.log('policy_value', policy_value)
if(insurer_or_tpa == 'tpa' || event_type_data == 0){
$("#event_type").removeAttr("multiple");
$("#event_type").attr("name", "event_type");
$("#event_type").select2('destroy');
}else{
if(policy_value != 0){
$("#event_type").attr("multiple", "multiple");
$("#event_type").attr("name", "event_type[]");
$("#event_type").select2();
}
}
}) ;
$('#action_type').change(function(){
var insurer_or_tpa = $(this).val()
var policy_value = $('#policy').val()
var event_type_data = $('#event_type_data').val();
console.log('policy_value', policy_value)
if(insurer_or_tpa == 'import' || event_type_data == 0){
$("#event_type").removeAttr("multiple");
$("#event_type").attr("name", "event_type");
$("#event_type").select2('destroy');
}else{
if(policy_value != 0){
$("#event_type").attr("multiple", "multiple");
$("#event_type").attr("name", "event_type[]");
$("#event_type").select2();
}
}
})
$(document).ready(function(){
$('#policy').change(function(){
var policy_value = $(this).val()
if(policy_value == 0){
$("#event_type").removeAttr("multiple");
$("#event_type").attr("name", "event_type");
$("#event_type").select2('destroy');
}
})
})
</script>

View File

@ -175,6 +175,8 @@
pullNotificationCount = response.message.length
localStorage.setItem('pullNotificationCount', pullNotificationCount)
response.message.forEach(message => {
@ -241,6 +243,9 @@
let PNCount = parseInt(localStorage.getItem('pullNotificationCount'));
let PACount = parseInt(localStorage.getItem('pendingActionCount'));
console.log('PNCount', PNCount);
console.log('PACount', PACount);
totalcount = PNCount + PACount
$('#notification_count').html(totalcount);
@ -305,7 +310,7 @@
method: 'GET',
success: function(response) {
//console.log(response);
console.log(response);
if (response.length == 0) {
@ -319,257 +324,127 @@
let messagesList = $('#messages-list-2');
messagesList.empty();
console.log(response.inception)
console.log('correction', typeof response.inception)
response.inception.forEach(function(item, index) {
if (response.inception) {
if (Array.isArray(response.inception)) {
response.inception.forEach(function(item, index) {
var queryParams = {
client_id: item.client_id,
client_policy_id: item.client_policy_id,
client_branch_id: item.branch_id,
actions: 'inception'
};
var queryParams = {
client_id: item.client_id,
client_policy_id: item.client_policy_id,
client_branch_id: item.branch_id,
actions: 'inception'
};
const queryString = objectToQueryString(queryParams);
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString
////console.log(url)
var url = 'employee/upload?' + queryString
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info';
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info';
if (!item.branch_name.toLowerCase().includes('branch')) {
if (!item.branch_name.toLowerCase().includes('branch')) {
//console.log(item.branch_name)
item.branch_name += ' branch';
}
//console.log(item.branch_name)
item.branch_name += ' branch';
}
////console.log(item.branch_name);
////console.log(item.branch_name);
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
////console.log(toast_body_data);
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
<div class="toast-header " style="${toast_head_css}" >
<strong class="${toast_icon}"> ${toast_status_word}</strong>
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="toast-body" style="${toast_body_css}">
<strong>Inception Pending</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
</div>
</div>
</div>
</div>
</li>`
messagesList.append(html);
});
response.correction.forEach(function(item, index) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
var queryParams = {
client_id: item.client_id,
client_branch_id: item.branch_id,
event: 'correction',
actions: 'export',
insurer_or_tpa: 'tpa',
};
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info';
var title = 'Correction Pending';
if (!item.branch_name.toLowerCase().includes('branch')) {
//console.log(item.branch_name)
item.branch_name += ' branch';
}
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
// title = 'Correction Import Pending';
// }
var toast_body_data = item.client_name + ' - ' + item.branch_name;
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
<div class="toast-header " style="${toast_head_css}" >
<strong class="${toast_icon}"> ${toast_status_word}</strong>
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="toast-body" style="${toast_body_css}">
<strong>${title}</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
</div>
</div>
</div>
</div>
</li>`
messagesList.append(html);
}
});
response.deletion.forEach(function(item, index) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
var queryParams = {
client_id: item.client_id,
client_policy_id: item.client_policy_id,
client_branch_id: item.branch_id,
event: 'deletion',
actions: 'export',
insurer_or_tpa: 'tpa',
};
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info';
var title = 'Deletion Pending';
if (!item.branch_name.toLowerCase().includes('branch')) {
//console.log(item.branch_name)
item.branch_name += ' branch';
}
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
// title = 'Deletion Import Pending';
// }
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
<div class="toast-header " style="${toast_head_css}" >
<strong class="${toast_icon}"> ${toast_status_word}</strong>
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="toast-body" style="${toast_body_css}">
<strong>${title}</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
</div>
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
<div class="toast-header " style="${toast_head_css}" >
<strong class="${toast_icon}"> ${toast_status_word}</strong>
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="toast-body" style="${toast_body_css}">
<strong>Inception Pending</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
</div>
</div>
</div>
</div>
</div>
</li>`
</li>`
messagesList.append(html);
messagesList.append(html);
});
} else {
console.log('response.inception is not an array:', response.inception);
}
} else {
console.log('response.inception is undefined or null');
}
console.log(response.correction)
console.log('correction', typeof response.correction)
});
if (response.correction) {
if (Array.isArray(response.correction)) {
response.correction.forEach(function(item, index) {
response.si_enhancement.forEach(function(item, index) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
var queryParams = {
client_id: item.client_id,
client_policy_id: item.client_policy_id,
client_branch_id: item.branch_id,
event: 'si_enhancement',
actions: 'export',
insurer_or_tpa: 'tpa',
};
var queryParams = {
client_id: item.client_id,
client_branch_id: item.branch_id,
event: 'correction',
actions: 'export',
insurer_or_tpa: 'tpa',
};
const queryString = objectToQueryString(queryParams);
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
////console.log(url)
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info';
var title = 'SI Enhancement Pending';
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info';
var title = 'Correction Pending';
if (!item.branch_name.toLowerCase().includes('branch')) {
if (!item.branch_name.toLowerCase().includes('branch')) {
//console.log(item.branch_name)
item.branch_name += ' branch';
//console.log(item.branch_name)
item.branch_name += ' branch';
}
}
////console.log(item.branch_name);
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
// if (item.batch_export_count > 0) {
// title = 'SI Enhancement Import Pending';
// }
// title = 'Correction Import Pending';
// }
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
////console.log(toast_body_data);
var toast_body_data = item.client_name + ' - ' + item.branch_name;
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
<div class="toast-header " style="${toast_head_css}" >
@ -591,155 +466,327 @@
</li>`
messagesList.append(html);
messagesList.append(html);
}
});
}
}else{
console.log('response.correction is undefined or null');
});
}
response.tpa.forEach(function(item, index) {
if (response.deletion) {
if (Array.isArray(response.deletion)) {
response.deletion.forEach(function(item, index) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
var queryParams = {
client_id: item.client_id,
client_policy_id: item.client_policy_id,
client_branch_id: item.branch_id,
event: 'inception',
insurer_or_tpa: 'tpa',
actions: 'export',
};
var queryParams = {
const queryString = objectToQueryString(queryParams);
client_id: item.client_id,
client_policy_id: item.client_policy_id,
client_branch_id: item.branch_id,
event: 'deletion',
actions: 'export',
insurer_or_tpa: 'tpa',
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
////console.log(url)
};
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info';
var title = 'TPA Pending';
if (!item.branch_name.toLowerCase().includes('branch')) {
//console.log(item.branch_name)
item.branch_name += ' branch';
}
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
// title = 'TPA Import Pending';
// }
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
<div class="toast-header " style="${toast_head_css}" >
<strong class="${toast_icon}"> ${toast_status_word}</strong>
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="toast-body" style="${toast_body_css}">
<strong>${title}</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
</div>
</div>
</div>
</div>
</li>`
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info';
var title = 'Deletion Pending';
messagesList.append(html);
if (!item.branch_name.toLowerCase().includes('branch')) {
//console.log(item.branch_name)
item.branch_name += ' branch';
}
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
// title = 'Deletion Import Pending';
// }
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
<div class="toast-header " style="${toast_head_css}" >
<strong class="${toast_icon}"> ${toast_status_word}</strong>
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="toast-body" style="${toast_body_css}">
<strong>${title}</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
</div>
</div>
</div>
</div>
</li>`
messagesList.append(html);
}
});
}
}else{
console.log('response.deletion is undefined or null');
});
}
response.uhid.forEach(function(item, index) {
if (response.si_enhancement) {
if (Array.isArray(response.si_enhancement)) {
response.si_enhancement.forEach(function(item, index) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
var queryParams = {
client_id: item.client_id,
client_policy_id: item.client_policy_id,
client_branch_id: item.branch_id,
event: 'inception',
insurer_or_tpa: 'insurer',
actions: 'export',
};
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info';
var title = 'Insurer Pending';
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
if (!item.branch_name.toLowerCase().includes('branch')) {
var queryParams = {
client_id: item.client_id,
client_policy_id: item.client_policy_id,
client_branch_id: item.branch_id,
event: 'si_enhancement',
actions: 'export',
insurer_or_tpa: 'tpa',
};
//console.log(item.branch_name)
item.branch_name += ' branch';
const queryString = objectToQueryString(queryParams);
}
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
////console.log(url)
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info';
var title = 'SI Enhancement Pending';
// title = 'Insurer Import Pending';
// }
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
////console.log(toast_body_data);
if (!item.branch_name.toLowerCase().includes('branch')) {
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
<div class="toast-header " style="${toast_head_css}" >
<strong class="${toast_icon}"> ${toast_status_word}</strong>
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
//console.log(item.branch_name)
item.branch_name += ' branch';
}
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
// title = 'SI Enhancement Import Pending';
// }
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
<div class="toast-header " style="${toast_head_css}" >
<strong class="${toast_icon}"> ${toast_status_word}</strong>
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="toast-body" style="${toast_body_css}">
<strong>${title}</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
</div>
</div>
</div>
</div>
<div class="toast-body" style="${toast_body_css}">
<strong>${title}</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
</div>
</div>
</div>
</div>
</li>`
</li>`
messagesList.append(html);
messagesList.append(html);
}
});
}
}else{
console.log('response.si_enhancement is undefined or null');
});
}
if (response.tpa) {
if (Array.isArray(response.tpa)) {
response.tpa.forEach(function(item, index) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
var queryParams = {
client_id: item.client_id,
client_policy_id: item.client_policy_id,
client_branch_id: item.branch_id,
event: 'inception',
insurer_or_tpa: 'tpa',
actions: 'export',
};
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info';
var title = 'TPA Pending';
if (!item.branch_name.toLowerCase().includes('branch')) {
//console.log(item.branch_name)
item.branch_name += ' branch';
}
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
// title = 'TPA Import Pending';
// }
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
<div class="toast-header " style="${toast_head_css}" >
<strong class="${toast_icon}"> ${toast_status_word}</strong>
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="toast-body" style="${toast_body_css}">
<strong>${title}</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
</div>
</div>
</div>
</div>
</li>`
messagesList.append(html);
}
});
}
}else{
console.log('response.tpa is undefined or null');
}
if (response.uhid) {
if (Array.isArray(response.uhid)) {
response.uhid.forEach(function(item, index) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
var queryParams = {
client_id: item.client_id,
client_policy_id: item.client_policy_id,
client_branch_id: item.branch_id,
event: 'inception',
insurer_or_tpa: 'insurer',
actions: 'export',
};
const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
////console.log(url)
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info';
var title = 'Insurer Pending';
if (!item.branch_name.toLowerCase().includes('branch')) {
//console.log(item.branch_name)
item.branch_name += ' branch';
}
////console.log(item.branch_name);
// if (item.batch_export_count > 0) {
// title = 'Insurer Import Pending';
// }
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
////console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}">
<div class="p-3">
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
<div class="toast-header " style="${toast_head_css}" >
<strong class="${toast_icon}"> ${toast_status_word}</strong>
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="toast-body" style="${toast_body_css}">
<strong>${title}</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
</div>
</div>
</div>
</div>
</li>`
messagesList.append(html);
}
});
}
}else{
console.log('response.uhid is undefined or null');
}
localStorage.setItem('pendingActionCount', pendingActionCount)
},

View File

@ -55,6 +55,8 @@
<!-- select2 -->
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" type="text/css">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script>
<link rel="manifest" href="../manifest.json">
@ -69,6 +71,10 @@
});
}
</script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css"/>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script>
<style>
@ -564,6 +570,9 @@
<li>
<a href="<?= base_url('/employee/endorsement-list') ?>">Endorsement List</a>
</li>
<li>
<a href="<?= base_url('/employee/enrollment-list') ?>">Enrollment List</a>
</li>
</ul>
</div>
</li>

View File

@ -872,7 +872,7 @@
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
$('#nameOfThePolicyInGMC').html(' - ' + response.policy_name.name);
// $('#nameOfThePolicyInGMC').html(' - ' + response.policy_name.name);
$('gmc_emp_count').val(response.count);
// //console.log('count--1', response.count);

View File

@ -538,7 +538,7 @@
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
$('#nameOfThePolicyInGPA').html(' - ' + res.policy_name.name);
// $('#nameOfThePolicyInGPA').html(' - ' + res.policy_name.name);
$('#emp_count').val(res.count)

File diff suppressed because it is too large Load Diff

View File

@ -36,77 +36,91 @@ const excel_headers = {
1: {
1: {
"unit": "Units",
"sum_insured": "Sum Insured",
},
2: {
"unit": "Units",
"basic_pay": "Basic Pay",
},
3: {
"unit": "Units",
"band_or_grade": "Band or Grade",
"sum_insured": "Sum Insured",
}
},
2: {
"unit": "Units",
"sum_insured": "Sum Insured",
"premium": "Premium"
},
3: {
"unit": "Units",
"sum_insured": "Sum Insured",
"premium": "Premium"
},
4: {
"unit": "Units",
"sum_insured": "Sum Insured",
"from_age": "From Age",
"to_age": "To Age",
"premium": "Premium"
},
5: {
"unit": "Units",
"sum_insured": "Sum Insured",
"from_age": "From Age",
"to_age": "To Age",
"premium": "Premium"
},
6: {
"unit": "Units",
"sum_insured": "Sum Insured",
"from_age": "From Age",
"to_age": "To Age",
"premium": "Premium"
},
7: {
"unit": "Units",
"sum_insured": "Sum Insured",
"from_age": "From Age",
"to_age": "To Age",
"premium": "Premium"
},
8: {
"unit": "Units",
"sum_insured": "Sum Insured",
"grade": "Grade",
"premium": "Premium"
},
9: {
"unit": "Units",
"sum_insured": "Sum Insured",
"premium": "Premium"
},
10: {
"unit": "Units",
"sum_insured": "Sum Insured",
"from_age": "From Age",
"to_age": "To Age",
"premium": "Premium"
},
11: {
"unit": "Units",
"sum_insured": "Sum Insured",
"grade": "Grade",
"premium": "Premium",
"max_si": "Max Si"
},
12: {
"unit": "Units",
"sum_insured": "Sum Insured",
"relationship": "Relationship",
"premium": "Premium"
},
13: {
"unit": "Units",
"sum_insured": "Sum Insured",
"relationship": "Relationship",
"from_age": "From Age",
@ -121,27 +135,34 @@ function slugify(text) {
.replace(/^-+/, '').replace(/-+$/, '');
}
function copyHeaders(rack_rate_type) {
function copyHeaders(unique_id) {
var client_units = localStorage.getItem('client_units');
client_units = JSON.parse(client_units);
let formatType = $('#grid').val();
var secondKey = $('#si_or_bp').val();
var obj = $('#grid');
if (rack_rate_type == 1) {
formatType = $('#additional_grid').val();
obj = $('#additional_grid');
if (unique_id != 'na') {
formatType = $('#grid_'+unique_id).val();
obj = $('#grid_'+unique_id);
}
//console.log(obj)
//console.log(formatType)
//console.log(unique_id)
if (formatType == 1) {
if (secondKey == "") {
toastr.warning('Please select the Basic Pay, Sum Insured or Band/Grade', 'Warning');
toastr.warning('Please select the Basic Pay, Sum Insured and Band/Grade', 'Warning');
return;
}
}
// //console.log(obj)
// //console.log(formatType)
// //console.log(rack_rate_type)
//console.log(obj)
//console.log(formatType)
//console.log(unique_id)
if (!formatType && formatType == "") {
toastr.warning('Please select the Policy Premium Type', 'Warning');
@ -157,12 +178,21 @@ function copyHeaders(rack_rate_type) {
return;
}
var headerString = Object.values(excel_headers[formatType]).join(
"\t"); // Using specified format type for copying headers
if (formatType == 1) {
var headerString = Object.values(excel_headers[formatType][secondKey]).join(
"\t"); // Using specified format type for copying headers
if(client_units.length == 1){
delete excel_headers[formatType].unit;
}
var headerString = Object.values(excel_headers[formatType]).join("\t"); // Using specified format type for copying headers
if (formatType == 1) {
if(client_units.length = 1){
delete excel_headers[formatType][secondKey].unit;
}
var headerString = Object.values(excel_headers[formatType][secondKey]).join("\t"); // Using specified format type for copying headers
}
console.log('headerString', headerString);
//console.log('headerString', headerString);
navigator.clipboard.writeText(headerString).then(function() {
toastr.success('Headers copied to clipboard', 'success');
@ -171,24 +201,26 @@ function copyHeaders(rack_rate_type) {
});
}
function generateTable(rack_rate_type) {
function generateTable(unique_id) {
var client_units = localStorage.getItem('client_units');
client_units = JSON.parse(client_units);
var data = $('#copied_excel_data').val();
let formatType = $('#grid').val();
var obj = $('#grid');
var secondKey = $('#si_or_bp').val();
if (rack_rate_type == 1) {
data = $('#additional_copied_excel_data').val();
formatType = $('#additional_grid').val();
obj = $('#additional_grid');
if (unique_id != 'na') {
data = $('#copied_excel_data_'+unique_id).val();
formatType = $('#grid_'+unique_id).val();
obj = $('#grid_'+unique_id);
}
//console.log(obj);
//console.log(formatType);
//console.log(data);
console.log(secondKey);
// console.log('generateTable obj', obj);
// console.log('generateTable formatType', formatType);
// console.log('generateTable data', data);
// console.log('generateTable secondKey', secondKey);
if (!formatType || formatType == "") {
$('.excel_table_class').empty();
@ -249,32 +281,31 @@ function generateTable(rack_rate_type) {
expectedHeader = Object.keys(excel_headers[formatType][secondKey]);
}
//console.log('expectedHeader', expectedHeader);
//console.log('HEADERS' , JSON.stringify(header))
//console.log('Excepted HEADERS' , JSON.stringify(expectedHeader))
// console.log('expectedHeader', expectedHeader);
// console.log('HEADERS' , JSON.stringify(header))
// console.log('Excepted HEADERS' , JSON.stringify(expectedHeader))
if (secondKey != 2) {
if (secondKey != 2) {
if (JSON.stringify(header) !== JSON.stringify(expectedHeader)) {
const expectedHeaders = JSON.stringify(Object.values(excel_headers[formatType][secondKey]));
const receivedHeaders = JSON.stringify(columnsToKeep.map(i => rows[0].split("\t")[i]));
if (JSON.stringify(header) !== JSON.stringify(expectedHeader)) {
const expectedHeaders = JSON.stringify(Object.values(excel_headers[formatType][secondKey]));
const receivedHeaders = JSON.stringify(columnsToKeep.map(i => rows[0].split("\t")[i]));
Swal.fire({
title: "Header Mismatch",
html: `
<p>Header columns do not match expected format:</p>
<p><strong>Expected:</strong> ${expectedHeaders}</p>
<p><strong>Received:</strong> ${receivedHeaders}</p>
`,
icon: "error"
});
$('.excel_table_class').empty();
$('.excel_textarea').val('');
return;
}
Swal.fire({
title: "Header Mismatch",
html: `
<p>Header columns do not match expected format:</p>
<p><strong>Expected:</strong> ${expectedHeaders}</p>
<p><strong>Received:</strong> ${receivedHeaders}</p>
`,
icon: "error"
});
$('.excel_table_class').empty();
$('.excel_textarea').val('');
return;
}
}
var table = $('<table class="table table-striped compact-table" />');
var uniqueRows = new Set();
@ -299,62 +330,113 @@ function generateTable(rack_rate_type) {
var si_or_bp = $('#si_or_bp').val();
var key;
switch (formatType) {
case 1:
if (si_or_bp == 1) {
key = cells[0] // Sum Insured,
if (client_units.length == 1) {
key = cells[0]; //Sum Insured
}else{
key = cells[0] + "|" + cells[1]; //Units, Sum Insured
}
} else if (si_or_bp == 2) {
key = cells[0] //Basic Pay
if (client_units.length == 1) {
key = cells[0]; //Basic Pay
}else{
key = cells[0] + "|" + cells[1]; //Units, Basic Pay
}
} else if (si_or_bp == 3) {
key = cells[0] + "|" + cells[1] //Band or Grade, Sum Insured
if (client_units.length == 1) {
key = cells[0] + "|" + cells[1];//Band or Grade, Sum Insured
}else{
key = cells[0] + "|" + cells[1] + "|" + cells[2]; //Units, Band or Grade, Sum Insured
}
}
break;
case 2:
key = cells[0] + "|" + cells[1] // Sum Insured, Premium
if (client_units.length == 1) {
key = cells[0]+ "|" + cells[1]; // Sum Insured, Premium
} else {
key = cells[0] + "|" + cells[1] + "|" + cells[2]; // Units, Sum Insured, Premium
}
break;
case 3:
key = cells[0] + "|" + cells[1] // Sum Insured, Premium
if (client_units.length == 1) {
key = cells[0]+ "|" + cells[1]; // Sum Insured, Premium
} else {
key = cells[0] + "|" + cells[1]+ "|" + cells[2]; // Units, Sum Insured, Premium
}
break;
case 4:
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[
3]; // Sum Insured, From Age, To Age, Premium
if (client_units.length == 1) {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3]; // Sum Insured, From Age, To Age, Premium
} else {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3] + "|" + cells[4]; // Units, Sum Insured, From Age, To Age, Premium
}
break;
case 5:
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[
3]; // Sum Insured, From Age, To Age, Premium
if (client_units.length == 1) {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3]; // Sum Insured, From Age, To Age, Premium
} else {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3] + "|" + cells[4]; // Units Sum Insured, From Age, To Age, Premium
}
break;
case 6:
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[
3]; // Sum Insured, From Age, To Age, Premium
if (client_units.length == 1) {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3]; // Sum Insured, From Age, To Age, Premium
} else {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3] + "|" + cells[4]; //Units, Sum Insured, From Age, To Age, Premium
}
break;
case 7:
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[
3]; // Sum Insured, From Age, To Age, Premium
if (client_units.length == 1) {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3]; // Sum Insured, From Age, To Age, Premium
} else {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3] + "|" + cells[4]; // Units Sum Insured, From Age, To Age, Premium
}
break;
case 8:
key = cells[0] + "|" + cells[1] + "|" + cells[2]; // Sum Insured, Grade, Premium
if (client_units.length == 1) {
key = cells[0] + "|" + cells[1] + "|" + cells[2]; // Sum Insured, Grade, Premium
} else {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3]; // Units, Sum Insured, Grade, Premium
}
break;
case 9:
key = cells[0] + "|" + cells[1]; // Sum Insured, Premium
if (client_units.length == 1) {
key = cells[0] + "|" + cells[2]; // Sum Insured, Premium
} else {
key = cells[0] + "|" + cells[1] + "|" + cells[2]; //Units, Sum Insured, Premium+ "|" + cells[5]
}
break;
case 10:
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[
3]; // Sum Insured, From Age, To Age, Premium
if (client_units.length == 1) {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3]; // Sum Insured, From Age, To Age, Premium
} else {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3] + "|" + cells[4]; //Units, Sum Insured, From Age, To Age, Premium
}
break;
case 11:
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[
3]; // Sum Insured, Grade, Premium, Max SI
if (client_units.length == 1) {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3]; // Sum Insured, Grade, Premium, Max SI
} else {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3] + "|" + cells[4]; // Units, Sum Insured, Grade, Premium, Max SI
}
break;
case 12:
key = cells[0] + "|" + cells[1] + "|" + cells[2]; // Sum Insured, Relationship, Premium
if (client_units.length == 1) {
key = cells[0] + "|" + cells[1] + "|" + cells[2]; // Sum Insured, Relationship, Premium
} else {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3]; //Units Sum Insured, Relationship, Premium
}
break;
case 13:
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3] + "|" + cells[
4]; // Sum Insured, Relationship, From Age, To Age, Premium
if (client_units.length == 1) {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3] + "|" + cells[4] ; // Sum Insured, Relationship, From Age, To Age, Premium
} else {
key = cells[0] + "|" + cells[1] + "|" + cells[2] + "|" + cells[3] + "|" + cells[4] + "|" + cells[5]; // Units, Sum Insured, Relationship, From Age, To Age, Premium
}
break;
default:
key = cells.join("|");
}
if (y > 0 && uniqueRows.has(key)) {
@ -365,10 +447,11 @@ function generateTable(rack_rate_type) {
table.append(row);
});
if (rack_rate_type == 1) {
$('#additional_excel_table').empty();
$('#additional_excel_table').html(table);
} else if (rack_rate_type == 0) {
if (unique_id != 'na') {
$('#excel_table_'+unique_id).empty();
$('#excel_table_'+unique_id).html(table);
}else{
$('#excel_table').empty();
$('#excel_table').html(table);
}
@ -390,11 +473,12 @@ function generateTable(rack_rate_type) {
$('.excel_table_class').empty();
$('.excel_textarea').val('');
}
submitData(rack_rate_type);
submitData(unique_id);
$('.excel_textarea').val('');
}
function submitData(rack_rate_type) {
function submitData(unique_id)
{
let formatType = $('#grid').val();
var table = $('#excel_table table');
@ -409,11 +493,10 @@ function submitData(rack_rate_type) {
if (rack_rate_type == 1) {
formatType = $('#additional_grid').val();
table = $('#additional_excel_table table');
obj = $('#additional_grid');
if (unique_id != 'na') {
formatType = $('#grid_'+unique_id).val();
table = $('#excel_table_'+unique_id+' table');
obj = $('#grid_'+unique_id);
}
@ -493,18 +576,18 @@ function submitData(rack_rate_type) {
console.log(jsonData);
console.log('formatType', formatType);
if (rack_rate_type == 1) {
if (unique_id != 'na') {
$('#additional_grid_content_input').empty()
$('#grid_content_input_'+unique_id).empty()
if ($('#copyfromexcelforadditional').text() == "Manual entry") {
$('#copyfromexcelforadditional').text("Copy from excel")
if ($('#copyfromexcel_'+unique_id).text() == "Manual entry") {
$('#copyfromexcel_'+unique_id).text("Copy from excel")
} else {
$('#copyfromexcelforadditional').text("Copy from excel");
$('#copyfromexcel_'+unique_id).text("Copy from excel");
}
$('#additional_grid_content_input').toggle();
$('#additional_grid_content_from_excel').toggle();
$('#grid_content_input_'+unique_id).toggle();
$('#grid_content_from_excel_'+unique_id).toggle();
} else {
@ -521,17 +604,20 @@ function submitData(rack_rate_type) {
}
if(unique_id == 'na'){
unique_id = null;
}
if (formatType == 1 || formatType == 2 || formatType == 4 || formatType == 6) {
var FirstIndex = jsonData[0]
addGridHTML(false, FirstIndex, formatType, si_or_bp, 0)
addGridHTML(false, FirstIndex, formatType, si_or_bp, unique_id)
jsonData.shift();
}
$.each(jsonData, function(index, item) {
appendGridtHtml(formatType, rack_rate_type, item)
appendGridtHtml(formatType, unique_id, item)
});
$('input[name="11_max_si[]"]').each(function() {
$(this).trigger('keyup');
});

View File

@ -14,6 +14,12 @@
<input type="text" class="form-control" id="policy_type"
placeholder="Enter Policy Type Name" value="<?= isset($policytype['policy_type']) ? $policytype['policy_type'] : '' ?>" name="policy_type" required>
</div>
<div class="form-group col-md-4">
<label for="kyc_name">Policy Type Long Name<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="long_name"
placeholder="Enter Policy Type Long Name" value="<?= isset($policytype['long_name']) ? $policytype['long_name'] : '' ?>" name="long_name" required>
</div>
<div class="form-group col-md-4">
<label for="bap">BAP<span
class="text-danger">*</span></label>

View File

@ -15,6 +15,7 @@
<thead class="bg-light">
<tr>
<th class="font-weight-medium">Policy Type</th>
<th class="font-weight-medium">Policy Long Name</th>
<th class="font-weight-medium">BAP</th>
<th class="font-weight-medium">Category</th>
<th class="font-weight-medium">BAP Category</th>
@ -26,6 +27,7 @@
<?php if(is_array($policyList)) {foreach($policyList as $row){ ?>
<tr>
<td><?php echo $row['policy_type']; ?> </td>
<td><?php echo $row['long_name']; ?> </td>
<td><?php echo $row['bap']; ?></td>
<td><?php echo $row['allocg']; ?></td>
<td><?php echo $row['alloci']; ?></td>

View File

@ -50,12 +50,12 @@ body {
<span class="d-none d-sm-inline-block">General</span>
</a>
</li>
<li class="nav-item">
<!-- <li class="nav-item">
<a href="#branch-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="policy_id_type">
<span class="mr-1"><i class="mdi mdi-source-branch"></i></span>
<span class="d-none d-sm-inline-block">Policies</span>
</a>
</li>
</li> -->
</ul>
<div class="tab-content">
<?php include('policy_type_basic_info.php'); ?>

View File

@ -123,7 +123,18 @@
<tr id="<?php echo $row->id;?>">
<td><?php echo date('d-M-Y h:i A', strtotime($row->created_at)); ?></td>
<!-- <td><?php echo $row->policy_name ?? '<center> - </center>'; ?></td> -->
<td><?php echo $row->policy_type ?? '<center> - </center>'; ?></td>
<td>
<?php
$policyType = $row->policy_type ?? '';
$policyNo = $row->policy_no ?? '';
if ($policyType || $policyNo) {
echo trim($policyType . ' - ' . $policyNo, ' -');
} else {
echo '<center> - </center>';
}
?>
</td>
<td><?php echo $row->endorsement_no ?? '<center> - </center>'; ?></td>
<td><?php echo isset($subTypeOptions[$row->sub_type]) ? $subTypeOptions[$row->sub_type] : ''; ?>
</td>

View File

@ -23,7 +23,9 @@
"phpoffice/phpspreadsheet": "^2.1",
"psr/log": "^1.1",
"slim/slim": "^4.13",
"zircote/swagger-php": "^4.8"
"zircote/swagger-php": "^4.8",
"psr/http-message": "^1.0",
"kreait/firebase-php":"^7.0"
},
"require-dev": {
"codeigniter/coding-standard": "^1.7",

View File

@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>