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

This commit is contained in:
bitbucket 2024-05-21 12:51:47 +05:30
commit b906d65654
43 changed files with 3578 additions and 1774 deletions

3
.gitignore vendored
View File

@ -22,6 +22,9 @@ writable/debugbar/*
writable/**/*.db
writable/**/*.sqlite
writable/e_card_template/*
!writable/e_card_template/.gitkeep
vendor/
build/

View File

@ -23,6 +23,11 @@ $routes->get('download-e-card/(:segment)', 'EmployeeController::generateIDCardFo
$routes->get('download-kyc-docs/(:segment)', 'ClientController::downloadKYCDocument/$1');
$routes->get('get-notification', 'DashboardController::getDashboardNotifications');
$routes->get('acknowledge-notification/(:segment)', 'DashboardController::acknowledgeMessage/$1');
$routes->get('get-pending-action', 'PendingActionsController::getPendingActions');
$routes->group("/user", ["filter" => "authMVC"], function ($routes) {
$routes->post("create", "UserController::create");
@ -228,6 +233,7 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
$routes->get("id-card", "EmployeeController::viewECard/$1");
$routes->get("preview-card/(:any)", "EmployeeController::previewTemplate/$1");
$routes->get("export-import-error-list/(:any)", "EmployeeController::errorListExportImport/$1");
$routes->get("has_policy_config_completed/(:any)", "EmployeeController::hasPolicyConfigCompleted/$1");
});
$routes->cli('cli/processjob', 'JobWorker::processJob');

View File

@ -653,6 +653,7 @@ class ClientController extends AdminController
}
$data['policy_no'] = $this->request->getPost('policy_no');
$data['policy_start_date'] = change_date_format($this->request->getPost('policy_start_date'), 'd-m-Y', 'Y-m-d');
$data['policy_end_date'] = change_date_format($this->request->getPost('policy_end_date'), 'd-m-Y', 'Y-m-d');
$data['created_by'] = get_session_userid();
@ -696,6 +697,7 @@ class ClientController extends AdminController
$data['tpa_id'] = $tpaId;
$data['policy_id'] = $this->request->getPost('policy_id');
$data['policy_type_id'] = $this->request->getPost('policy_type_id');
$data['policy_no'] = $this->request->getPost('policy_no');
$data['policy_start_date'] = change_date_format($this->request->getPost('policy_start_date'), 'd-m-Y', 'Y-m-d');
$data['policy_end_date'] = change_date_format($this->request->getPost('policy_end_date'), 'd-m-Y', 'Y-m-d');
@ -741,6 +743,7 @@ class ClientController extends AdminController
// dd($data);
$data['updated_by'] = get_session_userid();
// print_r($data);die;
$insert = $this->clientPolicyModel->update($id,$data);
$lastQuery = $this->clientPolicyModel->getLastQuery();
@ -767,18 +770,18 @@ class ClientController extends AdminController
$policy_type = $this->request->getPost('policy_type');
$client_id = $this->request->getPost('client_id');
$client_policy_id = $this->request->getPost('client_policy_id');
// $premium_type = $this->request->getPost('premium_type');
$premium_type = $this->request->getPost('premium_type');
if (!empty($client_id) && $client_id != null) {
$client_policy_data = $this->clientPolicyModel->where('id', $client_policy_id)->first();
$client_id = $client_policy_data['client_id'];
}
$policy_grid_id = $this->request->getPost('policy_grid_id');
if($policy_grid_id == 10 || $policy_grid_id == 11){
$premium_type = 1;
}else{
$premium_type = 2;
}
// if($policy_grid_id == 10 || $policy_grid_id == 11){
// $premium_type = 1;
// }else{
// $premium_type = 2;
// }
$si_or_bp = $this->request->getPost('si_or_bp');
$basic_multiplier = str_replace(',', '', $this->request->getPost('basic_multiplier'));
@ -1119,15 +1122,18 @@ class ClientController extends AdminController
->join('employee_polices ep', "cp.id = ep.client_policy_id AND employees.id = ep.employee_id")
->where("employees.client_id", $record['client_id'])
->where("employees.emp_status", 'active')
->where("ep.status", 'active')
->where("employees.is_active", 1)
->where("ep.is_active", 1)
->countAllResults();
$data = $this->employeePolicyModel->select('employee_polices.id')
->where('employee_polices.is_active', 1)
->where('employee_polices.client_policy_id', $client_policy_id)
->findAll();
// $data = $this->employeePolicyModel->select('employee_polices.id')
// ->where('employee_polices.is_active', 1)
// ->where('employee_polices.client_policy_id', $client_policy_id)
// ->findAll();
$emp_count = count($data);
// $emp_count = count($data);
// if($emp_count == 0){
// $emp_count = true;
@ -1173,24 +1179,25 @@ class ClientController extends AdminController
if ($search_term === 'GMC') {
$resultss = [];
// $resultss = [];
$resultss = $results;
try {
foreach ($results as $index => $record) {
// if ($self->self == 1 && $self->spouse == 0 && $self->childrens == 0 && $self->parents == 0 && $self->{'parents-in-law'} == 0 && $self->{'either-parents-pil'} == 0 && $family_floater == 0) {
if ($family_floater == 1) {
if ($index == '7' || $index == '8' || $index == '9' || $index == '10') {
$resultss[$index] = $record;
}
} else {
if ($index == '0' || $index == '1' || $index == '2' || $index == '3' || $index == '4' || $index == '5' || $index == '6') {
$resultss[$index] = $record;
}
}
}
} catch (\Exception $e) {
$resultss = $results; // Reset $resultss to an empty array if an exception occurs
}
// try {
// foreach ($results as $index => $record) {
// // if ($self->self == 1 && $self->spouse == 0 && $self->childrens == 0 && $self->parents == 0 && $self->{'parents-in-law'} == 0 && $self->{'either-parents-pil'} == 0 && $family_floater == 0) {
// if ($family_floater == 1) {
// if ($index == '7' || $index == '8' || $index == '9' || $index == '10') {
// $resultss[$index] = $record;
// }
// } else {
// if ($index == '0' || $index == '1' || $index == '2' || $index == '3' || $index == '4' || $index == '5' || $index == '6') {
// $resultss[$index] = $record;
// }
// }
// }
// } catch (\Exception $e) {
// $resultss = $results; // Reset $resultss to an empty array if an exception occurs
// }
@ -1247,7 +1254,6 @@ class ClientController extends AdminController
$data['corporatebuffer'] = $this->request->getPost("corporatebuffer") ? $this->request->getPost("corporatebuffer") : 0;
$data['family_floaters'] = $this->request->getPost("family_floaters") ?? [];
// print_r($this->request->getPost());die;
$data['age_ratio']['self']['min'] = $this->request->getPost("self_min_age") ? $this->request->getPost("self_min_age") :0;
$data['age_ratio']['self']['max'] = $this->request->getPost("self_max_age") ? $this->request->getPost("self_max_age") : 0;
$data['age_ratio']['spouse']['min'] = $this->request->getPost("spouse_min_age") ? $this->request->getPost("spouse_min_age") : 0;
@ -1255,7 +1261,7 @@ class ClientController extends AdminController
$data['age_ratio']['child']['min'] = $this->request->getPost("child_min_age") ? $this->request->getPost("child_min_age") : 0;
$data['age_ratio']['child']['max'] = $this->request->getPost("child_max_age") ? $this->request->getPost("child_max_age") : 0;
$data['age_ratio']['elders']['min'] = $this->request->getPost("other_member_min_age") ? $this->request->getPost("other_member_min_age") :0;
$data['age_ratio']['elders']['max'] = $this->request->getPost("other_member_min_age") ? $this->request->getPost("other_member_min_age") : 0;
$data['age_ratio']['elders']['max'] = $this->request->getPost("other_member_max_age") ? $this->request->getPost("other_member_max_age") : 0;
@ -1331,6 +1337,8 @@ class ClientController extends AdminController
$data['family_floaters']['elders_count'] =$this->request->getPost("member_count") ? $this->request->getPost("member_count") : 0;
// print_r($data);die;
$data['waiverofpreexistingdiseases'] =$this->request->getPost("waiverofpreexistingdiseases");
if ($data['waiverofpreexistingdiseases'] == 1) {
$data['maternitycoverage'] =str_replace(',', '',$this->request->getPost("maternitycoverage"));

View File

@ -7,12 +7,22 @@ use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use CodeIgniter\API\ResponseTrait;
use App\Models\MessageModel;
use App\Models\UserMessageModel;
class DashboardController extends AdminController
{
use ResponseTrait;
protected $messageModel;
protected $userMessageModel;
public function __construct()
{
$this->messageModel = new MessageModel();
$this->userMessageModel = new UserMessageModel();
}
public function dashboard()
@ -22,11 +32,26 @@ class DashboardController extends AdminController
echo view('layout/footer');
}
public function dashboardNotifications()
public function getDashboardNotifications()
{
//pull notofications to dashboard especially for file upload cases
$userId = get_session_userid();
$roleId = 5;
$teamId = 1;
$messages = $this->messageModel->getMessagesForUser($userId, $roleId, $teamId);
return $this->respond($messages);
}
public function acknowledgeMessage($messageId)
{
$userId = get_session_userid();
$this->userMessageModel->markAsRead($userId, $messageId);
return $this->respond(['status' => 'success']);
}
}

View File

@ -22,6 +22,8 @@ use App\Models\BatchFileModel;
use App\Models\EmpEndorsementModel;
use App\Models\ClientDepositModel;
use App\Models\NotificationModel;
use App\Models\MessageModel;
use App\Models\UserMessageModel;
use App\Controllers\Jobs;
use App\Controllers\JobWorker;
@ -48,6 +50,8 @@ class EmpDataServiceController extends BaseController
protected $empEndorsementModel;
protected $clientDepositModel;
protected $notificationModel;
protected $messageModel;
protected $userMessageModel;
public function __construct()
{
@ -64,6 +68,8 @@ class EmpDataServiceController extends BaseController
$this->empEndorsementModel = new EmpEndorsementModel();
$this->clientDepositModel = new ClientDepositModel();
$this->notificationModel = new NotificationModel();
$this->messageModel = new MessageModel();
$this->userMessageModel = new UserMessageModel();
}
@ -638,7 +644,10 @@ class EmpDataServiceController extends BaseController
$this->batchFileModel->where('id', $file_id)->set($data)->update();
$this->myLogger->logme('error', 'importInceptionFileValidation TPAID already updated');
return 3;
$file_data = $this->getDataByFileId($file_id, 'failure');
$this->setPullNotification($file_data);
return 'The list of employees provided has already been updated with the TPA ID, or this is not the correct file';
} else if ($insurer_or_tpa == 'insurer') {
@ -649,7 +658,10 @@ class EmpDataServiceController extends BaseController
$this->batchFileModel->where('id', $file_id)->set($data)->update();
$this->myLogger->logme('error', 'importInceptionFileValidation UHID already updated');
return 5;
$file_data = $this->getDataByFileId($file_id, 'failure');
$this->setPullNotification($file_data);
return 'The list of employees provided has already been updated with the UHID, or this is not the correct file';
}
$this->myLogger->logme('error', 'importInceptionFileValidation UHID or TPAID already updated or the uploadedfile is not correct');
@ -685,7 +697,10 @@ class EmpDataServiceController extends BaseController
$this->batchFileModel->where('id', $file_id)->set($data)->update();
$this->myLogger->logme('error', 'importInceptionFileValidation excel file count ( {excel} ) exceeds db count ( {db} )', ['db' => $emp_data_count, 'excel' => $excel_data_count]);
return 6;
$file_data = $this->getDataByFileId($file_id, 'failure');
$this->setPullNotification($file_data);
return 'The Excel record count exceeds the DB record count. excel file count : ' . $excel_data_count . 'db count : ' . $emp_data_count;
}
@ -877,11 +892,17 @@ class EmpDataServiceController extends BaseController
if ($insurer_or_tpa == 'tpa') {
return 2;
$file_data = $this->getDataByFileId($file_id, 'failure');
$this->setPullNotification($file_data);
return 'The TPA ID column is either partially or entirely empty.';
} else if ($insurer_or_tpa == 'insurer') {
return 4;
$file_data = $this->getDataByFileId($file_id, 'failure');
$this->setPullNotification($file_data);
return 'The UHID column is either partially or entirely empty.';
}
}
@ -923,6 +944,7 @@ class EmpDataServiceController extends BaseController
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'importInceptionUpdateTPAandUHID','payload' => ['file_id' => $file_id]]);
// $this->importInceptionUpdateTPAandUHID(['file_id' => $file_id]);
}
@ -938,6 +960,7 @@ class EmpDataServiceController extends BaseController
$file_id = $params['file_id'];
$file = $this->batchFileModel->find($file_id);
if (!$file) {
$data = [
'status' => 'failed-4',
];
@ -945,7 +968,10 @@ class EmpDataServiceController extends BaseController
$this->batchFileModel->where('id', $file_id)->set($data)->update();
$this->myLogger->logme('error', 'importInceptionUpdateTPAandUHID the Physical file not found - file id : {data}', ['data' => $file_id]);
return 0; // Return error code if file not found
$file_data = $this->getDataByFileId($file_id, 'failure');
$this->setPullNotification($file_data);
return 'importInceptionUpdateTPAandUHID the Physical file not found'; // Return error code if file not found
}
$client_id = $file['client_id'];
@ -955,6 +981,15 @@ class EmpDataServiceController extends BaseController
$batch_code = $file['batch_code'];
$user_id = $file['created_by'];
$get_policy_type = $this->clientPolicyModel
->select('policy_type.policy_type, policies.policy_type_id as policy_type_id')
->join('policies', 'policies.id = client_policy.policy_id')
->join('policy_type', 'policy_type.id = policies.policy_type_id')
->where('client_policy.id', $client_policy_id)
->first();
$status_val = 'success';
if ($status == 'in-progress-partially') {
@ -970,16 +1005,21 @@ class EmpDataServiceController extends BaseController
array_pop($excel_data); // Remove footer row
$totals = 0;
$empty_emp_tpa_uh_ids = [];
$emp_policy_ids = [];
$emp_details = [];
$tpa_id = [];
$uhid = [];
$emp_count = count($excel_data);
$db = \Config\Database::connect();
foreach ($excel_data as $key => $value) {
$name = $value[1];
$emp_code = $value[2];
$tpa_id = $value[15];
$uhid = $value[16];
$tpa_id[] = $value[15];
$uhid[] = $value[16];
$amount = $value[20];
$totals += $amount;
@ -1006,38 +1046,41 @@ class EmpDataServiceController extends BaseController
// Get the result
$result = $query->get()->getRowArray();
if (isset($result['id']) && $result['id'] !== null) {
$empty_emp_tpa_uh_ids[] = $result['id'];
$emp_policy_ids[] = $result['id'];
$emp_details[] = array('id' => $result['id'],'tpa_id' => $value[15], 'uhid' => $value[16]);
}
$sql = "
UPDATE employee_polices
JOIN employees ON employees.id = employee_polices.employee_id
SET tpa_id = ?
WHERE employees.name = ?
AND employees.emp_code = ?
AND employee_polices.client_policy_id = ?
AND (employee_polices.tpa_id IS NULL OR employee_polices.tpa_id = '')";
// $sql = "
// UPDATE employee_polices
// JOIN employees ON employees.id = employee_polices.employee_id
// SET tpa_id = ?
// WHERE employees.name = ?
// AND employees.emp_code = ?
// AND employee_polices.client_policy_id = ?
// AND (employee_polices.tpa_id IS NULL OR employee_polices.tpa_id = '')";
$params = [$tpa_id, $name, $emp_code, $client_policy_id];
$db->query($sql, $params);
// $params = [$tpa_id, $name, $emp_code, $client_policy_id];
// $db->query($sql, $params);
$sql = "
UPDATE employee_polices
JOIN employees ON employees.id = employee_polices.employee_id
SET employee_polices.uhid = ?
WHERE employees.name = ?
AND employees.emp_code = ?
AND employee_polices.client_policy_id = ?
AND (employee_polices.uhid IS NULL OR employee_polices.uhid = '')";
// $sql = "
// UPDATE employee_polices
// JOIN employees ON employees.id = employee_polices.employee_id
// SET employee_polices.uhid = ?
// WHERE employees.name = ?
// AND employees.emp_code = ?
// AND employee_polices.client_policy_id = ?
// AND (employee_polices.uhid IS NULL OR employee_polices.uhid = '')";
$params = [$uhid, $name, $emp_code, $client_policy_id];
$db->query($sql, $params);
// $params = [$uhid, $name, $emp_code, $client_policy_id];
// $db->query($sql, $params);
}
$return = $this->employeePolicyModel->bulkUpdate($emp_details);
// Update batch file status and amount
$this->batchFileModel->update($file_id, [
'count' => $emp_count,
@ -1057,7 +1100,7 @@ class EmpDataServiceController extends BaseController
$policy_name = $this->getPolicyNameUsingClientPolicyId($client_policy_id);
$depositeData = [
'employeeIds' => $empty_emp_tpa_uh_ids,
'employeeIds' => $emp_policy_ids,
'client_id' => $client_id,
'client_policy_id' => $client_policy_id,
'count' => $emp_count,
@ -1070,7 +1113,7 @@ class EmpDataServiceController extends BaseController
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'cashDepositCalculationForInception','payload' => [
'employeeIds' => $empty_emp_tpa_uh_ids,
'employeeIds' => $emp_policy_ids,
'client_id' => $client_id,
'client_policy_id' => $client_policy_id,
'count' => $emp_count,
@ -1079,17 +1122,23 @@ class EmpDataServiceController extends BaseController
'user_id' => $user_id,
]]);
if($get_policy_type['policy_type_id'] != 1){
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'sendMailForDownloadingECard','payload' => $empty_emp_tpa_uh_ids]);
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'sendMailForDownloadingECard','payload' => $emp_policy_ids]);
}
// $this->cashDepositCalculationForInception($depositeData);
// $this->sendMailForDownloadingECard($empty_emp_tpa_uh_ids);
// $this->sendMailForDownloadingECard($emp_policy_ids);
}
return 1;
$file_data = $this->getDataByFileId($file_id, 'success');
$this->setPullNotification($file_data);
return 'Import Inception Updated '. $status_val . '- Updated Count : ' . $emp_count;
}
@ -2063,10 +2112,12 @@ class EmpDataServiceController extends BaseController
$this->myLogger->logme('error', 'sendMailForDownloadingECard - inside try');
$count = 0;
$counts = 0;
foreach ($ids as $key => $id) {
$get_emp_email_and_other_details = $this->employeePolicyModel
->select('employee_polices.client_policy_id, employees.emp_code, employees.email_corporate,employees.client_id as client_id, employees.name, employee_polices.rand_string, employee_polices.tpa_id')
->select('employee_polices.client_policy_id, employees.relationship, employees.emp_code, employees.email_corporate,employees.client_id as client_id, employees.name, employee_polices.rand_string, employee_polices.tpa_id')
->join('employees', 'employees.id = employee_polices.employee_id')
->where('employees.emp_status', 'active')
->where('employees.is_active', '1')
@ -2091,19 +2142,28 @@ class EmpDataServiceController extends BaseController
$params['notification'] = $notification;
$params['notification'] = $notification;
$params['get_emp_email_and_other_details'] = $get_emp_email_and_other_details;
$wholeData[] = sendMailNotification::sendMailNotification('member_ecard_mail', $params);
// $this->myLogger->logme('error', 'sendMailForDownloadingECard - Send Bulk Mail function end ',);
$count++;
if (isset($get_emp_email_and_other_details['email_corporate']) && !empty($get_emp_email_and_other_details['email_corporate']) && $get_emp_email_and_other_details['relationship'] === 'Self') {
$wholeData[] = sendMailNotification::sendMailNotification('member_ecard_mail', $params);
$count++;
}
$counts++;
if ($count == 20 || $count == count($ids) - 1) {
if ($count == 20 || $counts == count($ids) - 1) {
if(count($wholeData) > 0){
$this->myLogger->logme('error', 'sendMailForDownloadingECard - create a job to bulk mail',);
$this->myLogger->logme('error', 'sendMailForDownloadingECard - create a job to bulk mail',);
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'bulk_mail', 'payload' => $wholeData]);
$wholeData = [];
$count = 0;
}
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'bulk_mail', 'payload' => $wholeData]);
$wholeData = [];
$count = 0;
}
$this->myLogger->logme('error', 'sendMailForDownloadingECard - Send Bulk Mail function end ',);
@ -2174,4 +2234,58 @@ class EmpDataServiceController extends BaseController
}
public function getDataByFileId($file_id, $status = 'success'){
$data = $this->batchFileModel
->select('batch_files.*, clients.client_name, clients.short_name, policies.name as policy_name')
->join('clients', 'clients.id = batch_files.client_id')
->join('client_policy', 'client_policy.id = batch_files.client_policy_id')
->join('policies', 'policies.id = client_policy.policy_id')
->where('batch_files.id', $file_id)
->first();
if($status == 'success'){
$msg_txt = $data['short_name'] . ' - ' . $data['policy_name'] . ' - ' . $data['event_type'] . ' - ' . $data['actions'] . ' - ' . $data['insurer_or_tpa'];
$msg_title = 'File Upload Success';
}else if ($status == 'failure'){
$msg_txt = $data['short_name'] . ' - ' . $data['policy_name'] . ' - ' . $data['event_type'] . ' - ' . $data['actions'] . ' - ' . $data['insurer_or_tpa'];
$msg_title = 'File Upload Failure';
}
$user_id = $data['created_by'];
$url = 'employee/upload#KYC-DOC-tab';
return ['msg_txt' => $msg_txt, 'user_id' => $user_id, 'url' => $url, 'status' => $status, 'title' => $msg_title];
}
public function setPullNotification($data){
$array = ['message_text' => $data['msg_txt'], 'action_url' => $data['url'], 'msg_status' => $data['status'], 'msg_title' => $data['title']];
$jsonEncodeData = json_encode($array);
$msg_data = [
'message_text' => $jsonEncodeData,
'user_id' => $data['user_id'],
'role_id' => NULL,
'team_id' => NULL,
'message_type' => '1to1',
];
$this->messageModel->insert($msg_data);
}
}

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\PolicesModel;
use App\Models\FileModel;
use App\Models\BatchListModel;
use App\Models\BatchFileModel;
@ -49,6 +50,7 @@ class EmployeeController extends AdminController
protected $empEndorsementModel;
protected $clientPolicyModel;
protected $TPAModel;
protected $policiesModel;
public function __construct()
{
@ -64,6 +66,7 @@ class EmployeeController extends AdminController
$this->empEndorsementModel = new EmpEndorsementModel();
$this->clientPolicyModel = new ClientPolicyModel();
$this->TPAModel = new TPAModel();
$this->policiesModel = new PolicesModel();
}
public function list()
@ -213,13 +216,40 @@ class EmployeeController extends AdminController
$data['import_or_export'] = ['import' => 'Import', 'export' => 'Export'];
$data['insurer_or_tpa'] = ['insurer' => 'Insurer', 'tpa' => 'TPA'];
// $data['fileList'] = $this->fileModel
// ->select(['files.*', 'up.emp_code', 'up.first_name', 'pm.name as policy_name', 'c.short_name', 'cp.id as client_policy_id'])
// ->join('user_profiles up', 'files.created_by = up.id')
// ->join('client_policy cp', 'files.policy_id = cp.id', 'left')
// ->join('policies pm', 'cp.policy_id = pm.id', 'left')
// ->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')->findAll();
// dd($this->fileModel->getLastQuery());
$data['fileList'] = $this->fileModel
->select(['files.*', 'up.emp_code', 'up.first_name', 'pm.name as policy_name', 'c.short_name', 'cp.id as client_policy_id'])
->join('user_profiles up', 'files.created_by = up.id')
->join('client_policy cp', 'files.policy_id = cp.id', 'left')
->join('policies pm', 'cp.policy_id = pm.id', 'left')
->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')->findAll();
->select([
'files.*',
'up.emp_code',
'up.first_name',
'pm.name as policy_name',
'c.short_name',
'cp.id as client_policy_id',
'(SELECT COUNT(*)
FROM employees e
JOIN employee_polices ep ON e.id = ep.employee_id
WHERE e.file_id = files.id AND ep.client_policy_id = files.policy_id) as employee_count',
'(SELECT SUM(ep.rata_premimum) + SUM(ep.gst)
FROM employees e
JOIN employee_polices ep ON e.id = ep.employee_id
WHERE e.file_id = files.id AND ep.client_policy_id = files.policy_id) as total'
])
->join('user_profiles up', 'files.created_by = up.id')
->join('client_policy cp', 'files.policy_id = cp.id', 'left')
->join('policies pm', 'cp.policy_id = pm.id', 'left')
->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')
->findAll();
// dd($data['fileList']);
$data['batch_list'] = $this->batchFileModel->select('batch_files.*, policies.name as policy_name, clients.short_name as client_short_name')
->join('client_policy', 'client_policy.id = batch_files.client_policy_id')
@ -890,14 +920,19 @@ class EmployeeController extends AdminController
'{DOB}' => date('d-M-Y', strtotime($value['dob'])),
'{SELF_NAME}' => $value['self'] ?? $value['name'],
'{POLICY_DATE}' => date('d-M-Y', strtotime($value['policy_end_date'])),
'{INSURER_NAME}' => $value['insurer_name'],
'{POLICY_START_DATE}' => date('d-M-Y', strtotime($value['policy_start_date'])),
'{POLICY_NO}' => date('d-M-Y', strtotime($value['policy_start_date'])),
'{INSURER_NAME}' => strtoupper($value['insurer_name']),
'{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/logo/' . $value['back_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['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'],
];
// Replace placeholders with values in HTML content
@ -1033,9 +1068,32 @@ class EmployeeController extends AdminController
}
public function previewTemplate($id = null){
public function previewTemplate($id = null)
{
$value = [
'tpa_id' => 'TPA12345',
'name' => 'John Doe',
'uhid' => 'UHID67890',
'gender' => 'Male',
'dob' => '1985-05-15',
'self' => 'John Doe',
'policy_end_date' => '2024-12-31',
'policy_start_date' => '2023-01-01',
'policy_no' => 'POL1234567890',
'insurer_name' => 'Example Insurance Company',
'emp_code' => 'EMP001122',
'client_name' => 'Corporate Client Inc.',
'emp_age' => 39,
'tpa_name' => 'Example TPA',
'insurer_branch_city' => 'New York',
'relationship' => 'Self'
];
$tpa_id = $this->TPAModel->where('id', $id)->first();
$template_data_path = WRITEPATH . 'e_card_template/';
@ -1046,28 +1104,44 @@ class EmployeeController extends AdminController
$data['message'] = 'Record Not Found';
return view('errors/404', $data);
}
}
$tmplt_data = file_get_contents($final_path);
$placeholders = [
'{TPA_ID}' => $value['tpa_id'],
'{NAME}' => $value['name'],
'{UHID}' => $value['uhid'],
'{GENDER}' => $value['gender'],
'{DOB}' => date('d-M-Y', strtotime($value['dob'])),
'{SELF_NAME}' => $value['self'] ?? $value['name'],
'{POLICY_DATE}' => date('d-M-Y', strtotime($value['policy_end_date'])),
'{POLICY_START_DATE}' => date('d-M-Y', strtotime($value['policy_start_date'])),
'{POLICY_NO}' => $value['policy_no'],
'{INSURER_NAME}' => strtoupper($value['insurer_name']),
'{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'],
'{FRONT_CARD}' => base_url() . 'public/uploads/template_bg/' . $tpa_id['front_card'],
'{BACK_CARD}' => base_url() . 'public/uploads/logo/' . $tpa_id['back_card'],
'{BACK_CARD}' => base_url() . 'public/uploads/template_bg/' . $tpa_id['back_card'],
'{TPA_LOGO}' => base_url() . 'public/uploads/logo/' . $tpa_id['tpa_logo'],
'{INSURER_LOGO}' => base_url() . 'public/assets/images/sample_logo_3.png',
];
// Get the values to replace the placeholders
$replaceValues = array_values($placeholders);
// Get the placeholders to search for
$searchPlaceholders = array_keys($placeholders);
// Replace placeholders with values in HTML content
$htmlContent = str_replace($searchPlaceholders, $replaceValues, $tmplt_data);
echo $htmlContent;
echo $htmlContent;
}
@ -1147,4 +1221,29 @@ class EmployeeController extends AdminController
echo view('export_import_error_list', $excelErrorData);
}
public function hasPolicyConfigCompleted()
{
$client_policy_id = $this->request->uri->getSegment(3);
$policy_details = $this->clientPolicyModel->find($client_policy_id);
// print_r($policy_details);die();
$policy_terms = isset($policy_details['policy_terms']) ? true : false;
$slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($client_policy_id,$policy_details['client_id']);
$message = null;
if (!isset($policy_terms)) {
$message .= 'Policy terms';
}
if($slab_details['slab_rates'] == null && $slab_details['grid_master'] == null)
{
$message = isset($message) ? ($message . ' and rack rates ') : ($message . ' Rack rates');
}
$message = isset($message) ? ($message . ' not defined for choosed policy') : null;
return $this->respond(['dataStatus' => true, 'code' => 200, 'message' => $message], 200);
}
}

View File

@ -877,7 +877,7 @@ class EmployeeRestController extends AdminController
if (isset($notification) && $notification['enabled'] == 1) {
//trigger
if ($dataToInsert[$a]['relationship'] == 'Self') {
if ($dataToInsert[$a]['relationship'] == 'Self' && isset($dataToInsert[$a]['email_corporate']) && !empty($dataToInsert[$a]['email_corporate'])) {
$params['dataToInsert'] = $dataToInsert[$a];
$params['notification'] = $notification;
@ -887,13 +887,12 @@ class EmployeeRestController extends AdminController
$count++;
}
if($count == 20 || $a == count($dataToInsert)-1){
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'bulk_mail','payload' => $wholeData]);
// $wholeData[]= $r;
// Mailhelper::bulk_mail($wholeData);
$wholeData = [];
$count = 0;
if (count($wholeData) > 0) {
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'bulk_mail','payload' => $wholeData]);
$wholeData = [];
$count = 0;
}
}

View File

@ -15,6 +15,7 @@ use App\Models\ClientPolicyModel;
use App\Models\PolicesModel;
use App\Models\FileModel;
use App\Models\EmpEndorsementModel;
use App\Models\MessageModel;
use App\Controllers\Jobs ;
use App\Controllers\JobWorker ;
@ -33,6 +34,7 @@ class EmployeeServiceController extends AdminController
protected $clientPolicyModel;
protected $policiesModel;
protected $empEndorsementModel;
protected $messageModel;
protected $general_relationships = ['self' => ['name' => 'Self', 'gender' => 'M','age_min' => 18,'age_max' => null], 'spouse' => ['name' => 'Spouse', 'gender' => 'F','age_min' => 18,'age_max' => null], 'son' => ['name' => 'Son', 'gender' => 'M','age_min' => null,'age_max' => 25], 'daughter' => ['name' => 'Daughter', 'gender' => 'F','age_min' => null,'age_max' => 25], 'father' => ['name' => 'Father', 'gender' => 'M','age_min' => 18,'age_max' => null], 'mother' => ['name' => 'Mother', 'gender' => 'F','age_min' => 18,'age_max' => null], 'father-in-law' => ['name' => 'Father in Law', 'gender' => 'M','age_min' => 18,'age_max' => null], 'mother-in-law' => ['name' => 'Mother in Law', 'gender' => 'F','age_min' => 18,'age_max' => null]];
protected $inception_excel_columns = ['sno'=>['col_idx'=>0,'col_cell_name'=>'A','col_name'=>'S.No','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'emp_id'=>['col_idx'=>1,'col_cell_name'=>'B','col_name'=>'EMP ID','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'name_of_emp_dep'=>['col_idx'=>2,'col_cell_name'=>'C','col_name'=>'NAME OF EMP/DEP','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'dob'=>['col_idx'=>3,'col_cell_name'=>'D','col_name'=>'DOB','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'custom'=>'check_dob_diff','params'=>['row','relationship','default_age_ratio']],'gender'=>['col_idx'=>4,'col_cell_name'=>'E','col_name'=>'Gender','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>['M','F']],'relationship'=>['col_idx'=>5,'col_cell_name'=>'F','col_name'=>'RELATIONSHIP','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_relationship','params'=>['row','relationship','policy_terms']],'basic_cover_si'=>['col_idx'=>6,'col_cell_name'=>'G','col_name'=>'BASIC COVER SI','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom' => 'check_si','params' => ['row','policy_terms','slab_details']],'doc'=>['col_idx'=>7,'col_cell_name'=>'H','col_name'=>'Date of Coverage','is_mandatory'=>['A','DA'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'params'=>['row']],'doj'=>['col_idx'=>8,'col_cell_name'=>'I','col_name'=>'DOJ','is_mandatory'=>false,'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'custom'=>'check_doj','params'=>['row']],'basic_pay'=>['col_idx'=>9,'col_cell_name'=>'J','col_name'=>'Basic Pay','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_basic_pay','params'=>['row','policy_terms','slab_details']],'band_grade'=>['col_idx'=>10,'col_cell_name'=>'K','col_name'=>'Band/Grade','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_employee_band','params'=>['row','policy_terms','slab_details']],'designation'=>['col_idx'=>11,'col_cell_name'=>'L','col_name'=>'Designation','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'phone'=>['col_idx'=>12,'col_cell_name'=>'M','col_name'=>'Phone','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom' => 'check_dup_mobileno','params' => ['row','existing_mobilenos']],'email'=>['col_idx'=>13,'col_cell_name'=>'N','col_name'=>'Email','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'pre_existing_ailments'=>['col_idx'=>14,'col_cell_name'=>'O','col_name'=>'PRE EXISTING AILMENTS','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>['0','1']],'change_event'=>['col_idx'=>15,'col_cell_name'=>'P','col_name'=>'Change event','is_mandatory'=>['A','DA','D'],'data_type'=>'str','format'=>null,'allowed_values'=>null],'date_of_exit'=>['col_idx'=>16,'col_cell_name'=>'Q','col_name'=>'Date of exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null],'reason_for_exit'=>['col_idx'=>17,'col_cell_name'=>'R','col_name'=>'Reason for exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>null,'allowed_values'=>null]];
@ -54,6 +56,7 @@ class EmployeeServiceController extends AdminController
$this->clientPolicyModel = new ClientPolicyModel();
$this->policiesModel = new PolicesModel();
$this->empEndorsementModel = new EmpEndorsementModel();
$this->messageModel = new MessageModel();
}
public function excelFileFormatValidation($params)
@ -143,7 +146,7 @@ class EmployeeServiceController extends AdminController
$policy_details = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']);
$policy_terms = json_decode($policy_details[0]->policy_terms);
$policy_terms = (array) $policy_terms;// convert obj to array
$default_age_ratio = isset($policy_details[0]->age_ratio) ? json_decode($policy_details[0]->age_ratio) : [];
$default_age_ratio = isset($policy_terms['age_ratio']) ? json_decode(json_encode($policy_terms['age_ratio']),true) : [];
//
// dd($default_age_ratio);
@ -271,6 +274,9 @@ class EmployeeServiceController extends AdminController
$failure_reason = ((json_encode($result)));
$this->fileModel->where('id', $file_id)->set(['status' => $status,'reason' => $failure_reason])->update();
$this->myLogger->logme("error",'{file_id} uploaded failed',['file_id' => $file_id]);
//set failure msg to pull notifications
$this->setPullNotification($this->getFileMetaDataByFileId($file_id,'failure'));
}
else //trigger next data validation via job queue server
{
@ -376,26 +382,28 @@ class EmployeeServiceController extends AdminController
}
}
if(($file['action'] == 'inception' || $file['action'] == 'addition' || $file['action'] == 'dependent_addition') && ($policy_details['policy_type_id'] != 3)) // 3 is GMC parents (base policy or dep addon)
//check self availbale in uploaded file
if(($file['action'] == 'inception' || $file['action'] == 'addition') && ($policy_details['policy_type_id'] == 3 && $policy_details['base_policy'] == null)) // 3 is GMC parents dep addon)
{
// dd('file check');
$res = check_self_available_in_family($family,$file['action']);
// dd($res);
if(!$res['is_self_found'])
{
array_push($result['error_summary'],14); // Self not found
$result['error_data'][ $res['row_id'] ]['sno']['error'][] = "Self not found ";
$result['error_data'][ $res['row_id'] ]['sno']['error'][] = "Self not found in uploaded file";
}
}
//check self avaialbe where self data is not available either in excel or same policy (i.e.) gMC parents
if($policy_details['policy_type_id'] == 3) // 3 is GMC parents (base policy or dep addon)
//check self avaialbe where self data is not available either same policy (i.e.) gMC parents
if($file['action'] == 'dependent_addition' || ($policy_details['policy_type_id'] == 3 && $policy_details['base_policy'] == null)) // 3 is GMC parents as base policy not as dep addon)
{
$self_details = $this->employeeModel->getEmpFamilybyEmpCode(emp_code: $emp_id,client_id: $file['client_id'],emp_status: ['active'],policy_status:['active']);
// dd($self_details);
if(!count($self_details))
{
array_push($result['error_summary'],14); // Self not found
$result['error_data'][ $family[0][0] ]['sno']['error'][] = "Self not found ";
$result['error_data'][ $family[0][0] ]['sno']['error'][] = "Self not found in System";
}
}
@ -446,8 +454,8 @@ class EmployeeServiceController extends AdminController
$failure_reason = ((json_encode($result)));
$this->fileModel->where('id', $file_id)->set(['status' => $status,'reason' => $failure_reason])->update();
$this->myLogger->logme("error",'{file_id} uploaded failed',['file_id' => $file_id]);
//return $this->respond(['dataStatus' => true,'code' => 404,'data' => 'file upload failed with errors'], 200);
// dd($failure_reason);
//set failure msg to pull notifications
$this->setPullNotification($this->getFileMetaDataByFileId($file_id,'failure'));
}
else if($file['action'] == 'deletion')
{
@ -571,6 +579,8 @@ class EmployeeServiceController extends AdminController
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]);
$this->setPullNotification($this->getFileMetaDataByFileId($file_id,'success'));
}
else if(isset($params['client_policy_id']))//handle data from enrollment to inception
@ -708,6 +718,9 @@ class EmployeeServiceController extends AdminController
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]);
//set success msg to pull notifications
$this->setPullNotification($this->getFileMetaDataByFileId($file_id,'success'));
return $endorsement_data;
}
@ -768,6 +781,8 @@ class EmployeeServiceController extends AdminController
}
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]);
//set success msg to pull notifications
$this->setPullNotification($this->getFileMetaDataByFileId($file_id,'success'));
return true;
}
@ -838,6 +853,8 @@ class EmployeeServiceController extends AdminController
}
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]);
//set success msg to pull notifications
$this->setPullNotification($this->getFileMetaDataByFileId($file_id,'success'));
return true;
}
@ -1088,6 +1105,54 @@ 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')
->join('clients', 'clients.id = files.client_id')
->join('client_policy', 'client_policy.id = files.policy_id')
->join('policies', 'policies.id = client_policy.policy_id')
->where('files.id', $file_id)
->first();
if($status == 'success')
{
$msg_title = 'File Upload Success';
}
else if ($status == 'failure')
{
$msg_title = 'File Upload Failure';
}
$msg_txt = $data['client_name'] . ' - ' . $data['policy_name'] . ' - ' . ucfirst($data['action']);
$user_id = $data['created_by'];
$url = 'employee/upload';
return ['msg_txt' => $msg_txt, 'user_id' => $user_id, 'url' => $url, 'status' => $status, 'title' => $msg_title];
}
public function setPullNotification($data){
$array = ['message_text' => $data['msg_txt'], 'action_url' => $data['url'], 'msg_status' => $data['status'], 'msg_title' => $data['title']];
$jsonEncodeData = json_encode($array);
$msg_data = [
'message_text' => $jsonEncodeData,
'user_id' => $data['user_id'],
'role_id' => NULL,
'team_id' => NULL,
'message_type' => '1to1',
];
$this->messageModel->insert($msg_data);
}
}

View File

@ -185,7 +185,7 @@ class JobWorker extends AdminController
//die();
$job_status = self::STATUS_FAILED;
$runtime = $runtime === null ? microtime(true) - $start : $runtime;
$response = $e->getMessage();
$response = ['file_name' => $e->getFile(),'error' => $e->getMessage(),'line_no' => $e->getLine(),'info' => $e->getTraceAsString()];
}
$db->query("UPDATE jobs SET status=?, run_time=?, response=? WHERE id=? AND uuid=?", [

View File

@ -6,8 +6,17 @@ use App\Controllers\PublicController;
class SubJob extends PublicController
{
protected $myLogger;
public function __construct()
{
$this->myLogger = \Config\Services::mylogger();
}
public function handle($payload)
{
$log = \Config\Services::mylogger();
$log->logme('error', 'insdie handle called');
$this->myLogger->logme('error', 'common handle called');
return $payload['a'] - $payload['b'];
}

View File

@ -427,6 +427,7 @@ class MasterController extends AdminController
$data['tpa_logo'] = $file_name;
$data['front_card'] = $front_card_file_name;
$data['back_card'] = $back_card_file_name;
$data['network_hospitals'] = $this->request->getPost('network_hospitals');
$insert = $this->tpaModel->insert($data);
@ -566,6 +567,7 @@ class MasterController extends AdminController
$data['back_card'] = $back_card_file_name;
}
$data['network_hospitals'] = $this->request->getPost('network_hospitals');
$update = $this->tpaModel->update($id,$data);

View File

@ -147,11 +147,14 @@ class NotificationController extends AdminController
$count++;
$temp_whole_data[] = $value;
if($count == 20 || $whole_index == count($wholeData)-1 && $index == count($values)-1){
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'bulk_mail','payload' => $temp_whole_data]);
if (count($temp_whole_data) > 0) {
$job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'bulk_mail','payload' => $temp_whole_data]);
$temp_whole_data = [];
$count = 0;
$temp_whole_data = [];
$count = 0;
}
}
}
}

View File

@ -7,20 +7,458 @@ use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Helpers\DepositHelper;
use App\Helpers\MailHelper;
use App\Helpers\sendMailNotification;
use App\Models\EmployeeModel;
use App\Models\EmployeePolicyModel;
use App\Models\ClientModel;
use App\Models\ClientPolicyModel;
use App\Models\BatchListModel;
use App\Models\BatchFileModel;
use App\Models\EmpEndorsementModel;
use App\Controllers\Jobs;
use App\Controllers\JobWorker;
use CodeIgniter\API\ResponseTrait;
class PendingActionsController extends AdminController
{
use ResponseTrait;
protected $myLogger;
protected $employeeModel;
protected $employeePolicyModel;
protected $clientModel;
protected $clientPolicyModel;
protected $batchListModel;
protected $batchFileModel;
protected $empEndorsementModel;
protected $db;
public function __construct()
{
//section
set_session_context('PendingActionsController Called');
//services
$this->myLogger = \Config\Services::mylogger();
$this->db = \Config\Database::connect();
//models
$this->employeeModel = new EmployeeModel();
$this->employeePolicyModel = new EmployeePolicyModel();
$this->clientModel = new ClientModel();
$this->clientPolicyModel = new ClientPolicyModel();
$this->batchListModel = new BatchListModel();
$this->batchFileModel = new BatchFileModel();
$this->empEndorsementModel = new EmpEndorsementModel();
}
public function getPendingActions()
{
//get pending actions like inception, corrections,deletions,SI enhanccnement to users
$inception = $this->getPendingActionForInception();
$correction = $this->getPendingActionForCorrection();
$si_enhancement = $this->getPendingActionForSIEnhancement();
$deletion = $this->getPendingActionForDeletion();
$tpa = $this->getPendingActionForTPAIDEmpty();
$uhid = $this->getPendingActionForUHIDEmpty();
// dd($inception, $si_enhancement, $correction, $deletion, $tpa, $uhid);
$data = ['inception' => $inception, 'correction' => $correction, 'si_enhancement' => $si_enhancement, 'deletion' => $deletion, 'tpa' => $tpa, 'uhid' => $uhid];
return $this->respond($data);
}
public function getPendingActionForInception()
{
// Build the query
$builder = $this->db->table('client_policy cp');
$builder->select('
clients.client_name,
policies.name as policy_name,
cp.id as client_policy_id,
cp.client_id,
cp.policy_id,
cp.policy_type_id,
cp.is_addon,
cp.policy_status,
cp.open_for_enrollment,
cp.inception_type,
COUNT(ep.id) AS employee_policy_count
');
$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('policies', 'cp.policy_id = policies.id');
$builder->where('cp.is_active', 1);
$builder->where('cp.open_for_enrollment', 1);
$builder->where('cp.is_addon', 1);
$builder->where('cp.policy_status', 1);
$builder->where('cp.inception_type', 1);
$builder->whereIn('cp.policy_type_id', [1, 2, 30]);
$builder->groupBy('cp.id, cp.client_id, cp.policy_id, cp.policy_type_id, cp.is_addon, cp.policy_status, cp.open_for_enrollment');
$builder->having('employee_policy_count = 0 OR employee_policy_count IS NULL');
// Execute the query
$query = $builder->get();
// Fetch the results
$results = $query->getResultArray();
return $results;
}
public function getPendingActionForCorrection()
{
// Subquery for batch_export_count
$subQueryExport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_id = clients.id')
->where('bl.actions', 'export')
->where('bl.event_type', 'correction')
->where('bl.insurer_or_tpa', 'tpa')
->getCompiledSelect();
// Subquery for batch_import_count
$subQueryImport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_id = clients.id')
->where('bl.actions', 'import')
->where('bl.event_type', 'correction')
->where('bl.insurer_or_tpa', 'tpa')
->where('bl.status', 'success')
->getCompiledSelect();
// Subquery builder
$subqueryBuilder = $this->db->table('emp_endorsement')
->select('
clients.client_name as client_name,
clients.id as client_id,
emp_endorsement.id,
emp_endorsement.pk,
emp_endorsement.endorsement_id,
emp_endorsement.group_key,
emp_endorsement.emp_code,
emp_endorsement.table_name,
emp_endorsement.actions,
emp_endorsement.name,
emp_endorsement.status,
employees.name as ename
')
->join('employees', 'emp_endorsement.pk = employees.id AND employees.is_active = 1 AND employees.emp_status = \'active\'')
->join('clients', 'employees.client_id = clients.id AND clients.is_active = 1', 'left')
->where([
'emp_endorsement.actions' => 'c',
'emp_endorsement.is_active' => 1,
'emp_endorsement.status' => 'pending',
'emp_endorsement.endorsement_id' => null
])
->groupBy('emp_endorsement.pk, emp_endorsement.emp_code, emp_endorsement.table_name, emp_endorsement.actions, emp_endorsement.name');
// Main query builder
$builder = $this->db->table('clients');
$builder->select("
subquery.client_name,
subquery.client_id,
COUNT(subquery.id) AS subquery_count,
($subQueryExport) AS batch_export_count,
($subQueryImport) AS batch_import_count
");
$builder->join('(' . $subqueryBuilder->getCompiledSelect() . ') AS subquery', 'clients.id = subquery.client_id', 'left');
$builder->groupBy('clients.id');
// Execute the query
$query = $builder->get();
// Fetch the results
$results = $query->getResultArray();
$filteredResults = array_filter($results, function ($value) {
return $value['subquery_count'] != 0;
});
return $filteredResults;
}
public function getPendingActionForSIEnhancement()
{
// Subquery for batch_export_count
$subQueryExport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_id = clients.id')
->where('bl.actions', 'export')
->where('bl.event_type', 'si_enhancement')
->where('bl.insurer_or_tpa', 'tpa')
->getCompiledSelect();
// Subquery for batch_import_count
$subQueryImport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_id = clients.id')
->where('bl.actions', 'import')
->where('bl.event_type', 'si_enhancement')
->where('bl.insurer_or_tpa', 'tpa')
->where('bl.status', 'success')
->getCompiledSelect();
// Build the subquery
$subqueryBuilder = $this->db->table('emp_endorsement')
->select('
clients.client_name as client_name,
clients.id as client_id,
client_policy.id as client_policy_id,
policies.name as policy_name,
policies.id as pid,
emp_endorsement.id,
emp_endorsement.pk,
emp_endorsement.endorsement_id,
emp_endorsement.group_key,
emp_endorsement.emp_code,
emp_endorsement.table_name,
emp_endorsement.actions,
emp_endorsement.name,
emp_endorsement.status
')
->join('employee_polices', 'emp_endorsement.pk = employee_polices.id AND employee_polices.is_active = 1 AND employee_polices.status = \'active\'')
->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('policies', 'client_policy.policy_id = policies.id AND policies.is_active = 1')
->where([
'emp_endorsement.actions' => 'si',
'emp_endorsement.is_active' => 1,
'emp_endorsement.status' => 'pending',
'emp_endorsement.endorsement_id' => null
])
->groupBy('emp_endorsement.pk, emp_endorsement.emp_code, emp_endorsement.table_name, emp_endorsement.actions, emp_endorsement.name');
// Build the main query
$builder = $this->db->table('clients');
$builder->select("
clients.id,
subquery.client_name,
subquery.client_id,
subquery.client_policy_id,
subquery.policy_name,
COUNT(subquery.id) AS subquery_count,
($subQueryExport) AS batch_export_count,
($subQueryImport) AS batch_import_count
");
$builder->join('(' . $subqueryBuilder->getCompiledSelect() . ') AS subquery', 'clients.id = subquery.client_id', 'left');
$builder->groupBy('clients.id');
// Execute the query
$query = $builder->get();
// Fetch the results
$results = $query->getResultArray();
$filteredResults = array_filter($results, function ($value) {
return $value['subquery_count'] != 0;
});
return $filteredResults;
}
public function getPendingActionForDeletion()
{
// Subquery for batch_export_count
$subQueryExport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_id = clients.id')
->where('bl.actions', 'export')
->where('bl.event_type', 'deletion')
->where('bl.insurer_or_tpa', 'insurer')
->getCompiledSelect();
// Subquery for batch_import_count
$subQueryImport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_id = clients.id')
->where('bl.actions', 'import')
->where('bl.event_type', 'deletion')
->where('bl.insurer_or_tpa', 'insurer')
->where('bl.status', 'success')
->getCompiledSelect();
// Build the subquery
$subqueryBuilder = $this->db->table('emp_endorsement')
->select('
clients.client_name as client_name,
clients.id as client_id,
client_policy.id as client_policy_id,
policies.name as policy_name,
policies.id as pid,
emp_endorsement.pk,
emp_endorsement.id,
emp_endorsement.group_key,
emp_endorsement.emp_code,
emp_endorsement.table_name,
emp_endorsement.actions,
emp_endorsement.name,
emp_endorsement.status
')
->join('employee_polices', 'emp_endorsement.pk = employee_polices.id AND employee_polices.is_active = 1 AND employee_polices.status = \'active\' AND emp_endorsement.table_name = \'employee_polices\'', 'left')
->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('policies', 'client_policy.policy_id = policies.id AND policies.is_active = 1', 'left')
->where([
'emp_endorsement.actions' => 'd',
'emp_endorsement.is_active' => 1,
'emp_endorsement.status' => 'pending',
'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');
// Build the main query
$builder = $this->db->table('clients');
$builder->select("
clients.id,
subquery.client_name,
subquery.client_id,
subquery.client_policy_id,
subquery.policy_name,
COUNT(subquery.id) AS subquery_count,
($subQueryExport) AS batch_export_count,
($subQueryImport) AS batch_import_count
");
$builder->join('(' . $subqueryBuilder->getCompiledSelect() . ') AS subquery', 'clients.id = subquery.client_id', 'left');
$builder->groupBy('clients.id');
// Execute the query
$query = $builder->get();
// Fetch the results
$results = $query->getResultArray();
$filteredResults = array_filter($results, function ($value) {
return $value['subquery_count'] != 0;
});
return $filteredResults;
}
public function getPendingActionForUHIDEmpty()
{
// Subquery for batch_export_count
$subQueryExport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_policy_id = cp.id')
->where('bl.actions', 'export')
->where('bl.event_type', 'inception')
->where('bl.insurer_or_tpa', 'insurer')
->getCompiledSelect();
// Subquery for batch_import_count
$subQueryImport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_policy_id = cp.id')
->where('bl.actions', 'import')
->where('bl.event_type', 'inception')
->where('bl.insurer_or_tpa', 'insurer')
->where('bl.status', 'success')
->getCompiledSelect();
// Main query
$query = $this->db->table('employee_polices ep')
->select('c.id as client_id')
->select('ep.client_policy_id')
->select('c.client_name')
->select('c.short_name')
->select('p.name as policy_name')
->select('ep.uhid')
->select("($subQueryExport) AS batch_export_count", false)
->select("($subQueryImport) AS batch_import_count", false)
->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('policies p', 'p.id = cp.policy_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')
->get();
// Fetch the results
$results = $query->getResultArray();
return $results;
}
public function getPendingActionForTPAIDEmpty()
{
// Subquery for batch_export_count
$subQueryExport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_policy_id = client_policy.id')
->where('bl.actions', 'export')
->where('bl.event_type', 'inception')
->where('bl.insurer_or_tpa', 'tpa')
->getCompiledSelect();
// Subquery for batch_import_count
$subQueryImport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_policy_id = client_policy.id')
->where('bl.actions', 'import')
->where('bl.event_type', 'inception')
->where('bl.insurer_or_tpa', 'tpa')
->where('bl.status', 'success')
->getCompiledSelect();
// Build the query
$builder = $this->db->table('employee_polices');
$builder->select('
employee_polices.client_policy_id,
employee_polices.uhid,
employee_polices.tpa_id,
clients.short_name,
clients.client_name,
policies.name as policy_name,
clients.id as client_id
');
$builder->select("($subQueryExport) AS batch_export_count", false);
$builder->select("($subQueryImport) AS batch_import_count", false);
$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('policies', 'policies.id = client_policy.policy_id');
$builder->where('employee_polices.tpa_id', null);
$builder->where('employee_polices.uhid IS NOT NULL');
$builder->where('employee_polices.status', 'active');
$builder->where('employee_polices.is_active', 1);
$builder->groupBy('employee_polices.client_policy_id');
// Execute the query
$query = $builder->get();
// Fetch the results
$results = $query->getResultArray();
return $results;
}
}

View File

@ -57,21 +57,32 @@ class sendMailNotification
if ($value['relationship'] != 'Self') {
$emp_data = $EmployeeModel->where('client_id', $client_data['id'])->where('emp_code', $value['emp_code'])->where('is_active',1)->findAll();
foreach ($emp_data as $key => $value) {
if ($value['relationship'] == 'Self') {
$employee_name =$value['name'];
$mail_content = str_replace("[[member_name]]", $employee_name, $mail_content);
$mail = $value['email_corporate'];
if(count($emp_data) > 1){
$mail ='';
foreach ($emp_data as $key => $values) {
if ($value['relationship'] == 'Self') {
$employee_name =$values['name'];
$mail_content = str_replace("[[member_name]]", $employee_name, $mail_content);
$mail = $values['email_corporate'];
}
}
}else{
$mail ='';
}
}else{
$employee_name =$value['name'];
$mail_content = str_replace("[[member_name]]", $employee_name, $mail_content);
$mail = $value['email_corporate'];
}
if (isset($mail) && !empty($mail)) {
$wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']];
}
}
if (count($wholeData) < 1) {
$wholeData = [];
}
return $wholeData;
}else{
@ -194,8 +205,9 @@ class sendMailNotification
$mail_content = str_replace("[[member_summary]]", $table_content , $mail_content);
// $mail = "aadhavanvalli@gmail.com";
$wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']];
// if (isset($mail) && !empty($mail)) {
$wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']];
// }
return $wholeData;

View File

@ -185,6 +185,56 @@ if (!function_exists('get_base64_image')) {
}
if (!function_exists('format_indian_number')) {
function format_indian_number($number) {
// Round the number to two decimal places
$number = round($number, 2);
// Split the number into integer and decimal parts
$numberParts = explode('.', number_format($number, 2, '.', ''));
$integerPart = $numberParts[0];
$decimalPart = isset($numberParts[1]) ? $numberParts[1] : '00';
// Format the integer part with commas
$length = strlen($integerPart);
$formattedStr = '';
$counter = 0;
for ($i = $length - 1; $i >= 0; $i--) {
$formattedStr = $integerPart[$i] . $formattedStr;
$counter++;
if ($counter == 3 && $i != 0) {
$formattedStr = ',' . $formattedStr;
$counter = 0;
} elseif ($counter == 2 && $i != 0 && $length - $i > 3) {
$formattedStr = ',' . $formattedStr;
$counter = 0;
}
}
// Combine the integer and decimal parts
return $formattedStr . '.' . $decimalPart;
}
}
if (!function_exists('get_username')) {
function get_username($user_id) {
// Connect to the database
$db = \Config\Database::connect();
// Query the database
$query = $db->table('user_profiles')
->select('first_name')
->where('id', $user_id)
->get();
// Get the result
$result = $query->getRow();
// Return the username if found, otherwise return null
return $result ? $result->first_name : null;
}
}

View File

@ -41,8 +41,9 @@ class ClientModel extends Model
foreach ($clients as &$client) {
$clientPolicyModel = new ClientPolicyModel();
$clientPolicies = $clientPolicyModel->select(['client_policy.id','p.name'])
$clientPolicies = $clientPolicyModel->select(['client_policy.id','p.name','pt.policy_type'])
->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)
->where('client_policy.policy_status', 1)

View File

@ -40,7 +40,8 @@ class ClientPolicyModel extends Model
"updated_by",
"Is_active",
"date_of_exit",
"reason_for_exit"
"reason_for_exit",
"policy_no"
];
public function getClientPolicyById($id){

View File

@ -731,6 +731,7 @@ class EmployeePolicyModel extends Model
clients.short_name AS client_short_name,
cp.policy_start_date,
cp.policy_no,
policies.name AS policy_name,
@ -789,4 +790,69 @@ class EmployeePolicyModel extends Model
}
public function bulkUpdate($emp_details)
{
// Extract IDs, tpa_ids, and uhids
$ids = array_column($emp_details, 'id');
$tpa_ids = array_column($emp_details, 'tpa_id');
$uhids = array_column($emp_details, 'uhid');
// Escape values for SQL
$escapedIds = array_map([$this->db, 'escape'], $ids);
$escapedTpaIds = array_map([$this->db, 'escape'], $tpa_ids);
$escapedUhids = array_map([$this->db, 'escape'], $uhids);
// Construct the CASE statements
$caseTpaId = array_map(function($id, $tpa_id) {
return "WHEN id = $id THEN $tpa_id";
}, $escapedIds, $escapedTpaIds);
$caseUhid = array_map(function($id, $uhid) {
return "WHEN id = $id THEN $uhid";
}, $escapedIds, $escapedUhids);
// Convert cases to a string
$caseTpaIdString = implode(' ', $caseTpaId);
$caseUhidString = implode(' ', $caseUhid);
// Convert ids to a string
$idsString = implode(', ', $escapedIds);
// Construct the SQL query
$sql = "
UPDATE {$this->table}
SET
tpa_id = CASE {$caseTpaIdString} END,
uhid = CASE {$caseUhidString} END
WHERE id IN ({$idsString})
";
// Begin a transaction
$this->db->transBegin();
try {
// Execute the query
$this->db->query($sql);
// Commit the transaction
if ($this->db->transStatus() === FALSE) {
// If something went wrong, rollback
$this->db->transRollback();
throw new \Exception('Bulk update failed.');
} else {
// Otherwise, commit
$this->db->transCommit();
}
return $this->db->getLastQuery();
} catch (\Exception $e) {
// Rollback the transaction on error
$this->db->transRollback();
throw $e;
}
}
}

View File

@ -0,0 +1,77 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class MessageModel extends Model
{
protected $table = 'messages';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = [
'id',
'message_text',
'user_id',
'role_id',
'team_id',
'message_type',
'created_at',
'action_url',
'msg_status',
];
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
// Validation
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = [];
protected $afterInsert = [];
protected $beforeUpdate = [];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function getMessagesForUser($userId, $roleId, $teamId)
{
$builder = $this->db->table($this->table);
$builder->select('messages.*');
$builder->join('user_messages', 'user_messages.message_id = messages.id AND user_messages.user_id = ' . $this->db->escape($userId), 'left');
$builder->groupStart();
$builder->where('user_messages.is_read', null);
$builder->orWhere('user_messages.is_read', 0);
$builder->groupEnd();
$builder->groupStart();
$builder->orwhere('messages.message_type', 'broadcast');
$builder->orWhere('messages.user_id', $userId);
$builder->orWhere('messages.role_id', $roleId);
$builder->orWhere('messages.team_id', $teamId);
$builder->groupEnd();
$query = $builder->get();
return $query->getResult();
dd($this->db->getLastQuery());
}
}

View File

@ -39,6 +39,7 @@ class PolicesModel extends Model
{
$premium_slab_data = null;
$grid_type = null;
$policyPremium1Model = new PolicyPremium1Model();
$premium_slab_data = $policyPremium1Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
@ -50,9 +51,13 @@ class PolicesModel extends Model
$premium_slab_data = $policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
}
$grid_id = $premium_slab_data[0]['policy_grid_id'];
$policyGridModel = new PolicyGridModel();
$results = $policyGridModel->find($grid_id);
return ['slab_rates' => $premium_slab_data,'grid_master' => $results];
if(isset($premium_slab_data[0]['policy_grid_id']))
{
$grid_id = $premium_slab_data[0]['policy_grid_id'];
$policyGridModel = new PolicyGridModel();
$grid_type = $policyGridModel->find($grid_id);
}
return ['slab_rates' => $premium_slab_data,'grid_master' => $grid_type];
}
}

View File

@ -15,6 +15,7 @@ class TPAModel extends Model
"front_card",
"back_card",
"tpa_logo",
"network_hospitals",
"created_by",
"updated_by",
"is_active",

View File

@ -0,0 +1,69 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class UserMessageModel extends Model
{
protected $table = 'user_messages';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = [
'id',
'message_id',
'user_id',
'is_read',
'read_at',
];
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
// Validation
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = [];
protected $afterInsert = [];
protected $beforeUpdate = [];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function markAsRead($userId, $messageId)
{
$data = [
'is_read' => 1,
'read_at' => date('Y-m-d H:i:s')
];
$existingEntry = $this->where('user_id', $userId)
->where('message_id', $messageId)
->first();
if ($existingEntry) {
return $this->update($existingEntry['id'], $data);
} else {
$data['user_id'] = $userId;
$data['message_id'] = $messageId;
return $this->insert($data);
}
}
}

View File

@ -1,7 +1,11 @@
<style>
.table-responsive {
overflow-x: auto;
}
.table-responsive {
overflow-x: auto;
}
.reload:hover {
cursor: pointer;
}
</style>
<div class="col-12">
@ -18,16 +22,17 @@
<thead class="bg-light">
<tr>
<th class="font-weight-medium">SNO</th>
<th class="font-weight-medium">Batch Code</th>
<th class="font-weight-medium">Batch <br> Code</th>
<th class="font-weight-medium">File Name</th>
<th class="font-weight-medium">Client</th>
<th class="font-weight-medium">Client Policy</th>
<th class="font-weight-medium">Event Type</th>
<th class="font-weight-medium">Insurer/TPA</th>
<th class="font-weight-medium">Event <br> Type</th>
<th class="font-weight-medium">Insurer/ <br> TPA</th>
<th class="font-weight-medium">Action</th>
<th class="font-weight-medium">Count</th>
<th class="font-weight-medium">Amount</th>
<th class="font-weight-medium">status</th>
<th class="font-weight-medium">()Amount</th>
<th class="font-weight-medium">User/Time</th>
<th class="font-weight-medium">Status</th>
</tr>
</thead>
@ -37,39 +42,59 @@
foreach ($batch_list as $key => $file) {
?>
<tr>
<td><b><?php echo ($key + 1) ?></b></td>
<td><?php echo $file['batch_code'] ?></td>
<td data-toggle="tooltip" data-placement="top" title="<?php echo $file['file_name'] ?>"><?php echo strlen($file['file_name']) > 5 ? substr($file['file_name'], 0, 10) . "..." : $file['file_name'] ?></td>
<td><?php echo $file['client_short_name'] ?></td>
<td><?php echo $file['policy_name'] ?></td>
<td><?php echo $file['event_type'] ?></td>
<td><?php echo $file['insurer_or_tpa'] ?></td>
<td><?php echo $file['actions'] ?></td>
<td><?php echo $file['count'] ?></td>
<td><?php echo intval($file['amount']) ?></td>
<td>
<?php if ($file['status'] == 'failed') { ?>
<?php echo $file['status']; ?> <a href="<?= base_url('/util/export-import-error-list/') . $file['id'] ?>" class="fe-alert-circle" style="color: #000;" aria-hidden="true" target="_blank" data-toggle="tooltip" data-placement="top" title="Click to show the error"></a>
<?php } else if ($file['status'] == 'partially success') { ?>
<?php echo $file['status']; ?>
<?php if ($file['error_data'] != 0) { ?>
<a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip" data-placement="top" title="<?= $file['error_data'] ?>"></a>
<?php } ?>
<?php } else if ($file['status'] == 'failed-1') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip" data-placement="top" title="The list of employees provided has already been updated with the TPA ID."></a>
<?php } else if ($file['status'] == 'failed-2') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip" data-placement="top" title="The list of employees provided has already been updated with the UHID."></a>
<?php } else if ($file['status'] == 'failed-3') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip" data-placement="top" title="The Excel record count exceeds the DB record count."></a>
<?php } else if ($file['status'] == 'failed-4') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip" data-placement="top" title="Physical File Not Found."></a>
<?php } else { ?>
<?php echo $file['status']; ?>
<?php } ?>
</td>
<tr>
<td><b><?php echo ($key + 1) ?></b></td>
<td><?php echo $file['batch_code'] ?></td>
<td class="reload" data-toggle="tooltip" data-placement="top"
title="<?php echo $file['file_name'] ?>">
<?php echo strlen($file['file_name']) > 5 ? substr($file['file_name'], 0, 10) . "..." : $file['file_name'] ?>
</td>
<td><?php echo $file['client_short_name'] ?></td>
<td><?php echo $file['policy_name'] ?></td>
<td><?php echo $file['event_type'] ?></td>
<td><?php echo $file['insurer_or_tpa'] ?></td>
<td><?php echo $file['actions'] ?></td>
<td><?php echo $file['count'] ?></td>
</tr>
<td class="indian-number"><?php echo intval($file['amount']) ?></td>
<td class="reload" data-toggle="tooltip" data-placement="top" title="<?php echo date('d-M-Y H:i:a', strtotime($file['created_at'])) ?> by <?php echo get_username($file['created_by']) ?>">
<?php echo strlen($file['created_at']) > 5 ? substr(date('d-M-Y H:i:a', strtotime($file['created_at'])), 0, 6) . "..." : $file['created_at'] ?>
</td>
<td>
<?php if ($file['status'] == 'failed') { ?>
<?php echo $file['status']; ?> <a
href="<?= base_url('/util/export-import-error-list/') . $file['id'] ?>"
class="fe-alert-circle" style="color: #000;" aria-hidden="true" target="_blank"
data-toggle="tooltip" data-placement="top" title="Click to show the error"></a>
<?php } else if ($file['status'] == 'partially success') { ?>
<?php echo $file['status']; ?>
<?php if ($file['error_data'] != 0) { ?>
<a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top" title="<?= $file['error_data'] ?>"></a>
<?php } ?>
<?php } else if ($file['status'] == 'failed-1') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top"
title="The list of employees provided has already been updated with the TPA ID."></a>
<?php } else if ($file['status'] == 'failed-2') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top"
title="The list of employees provided has already been updated with the UHID."></a>
<?php } else if ($file['status'] == 'failed-3') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top"
title="The Excel record count exceeds the DB record count."></a>
<?php } else if ($file['status'] == 'failed-4') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top" title="Physical File Not Found."></a>
<?php } else { ?>
<?php echo $file['status']; ?>
<?php } ?>
</td>
</tr>
<?php }
} ?>
@ -81,31 +106,72 @@
</div><!-- end col -->
<script>
$(document).ready(function() {
$('#datatable-buttons').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [{
extend: 'csv',
text: 'CSV',
title: 'Batch List',
className: 'my_class',
}],
initComplete: function(settings, json) {
$('.my_class').css({
position: "relative",
left: "50px"
});
},
language: {
search: "_INPUT_",
searchPlaceholder: "Search..."
},
paging: true
});
$(document).ready(function() {
$('#datatable-buttons').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [{
extend: 'csv',
text: 'CSV',
title: 'Batch List',
className: 'my_class',
}],
initComplete: function(settings, json) {
$('.my_class').css({
position: "relative",
left: "50px"
});
},
language: {
search: "_INPUT_",
searchPlaceholder: "Search..."
},
paging: true
});
});
</script>
<script>
// Function to format a number in Indian Rupees format
function formatNumberInIndianRupees(number) {
const maxLength = 16;
let value = number.toString().replace(/\D/g, ''); // Remove non-numeric characters
// Limit the number of digits
value = value.slice(0, maxLength);
// Format the number with commas using Indian numbering system
const formattedNumber = Number(value).toLocaleString('en-IN');
return formattedNumber;
}
// Function to format numbers based on a class
function formatNumbersByClass(className) {
const elements = document.querySelectorAll(`.${className}`);
console.log('element', elements)
elements.forEach(element => {
const number = parseFloat(element.innerText.replace(/,/g, ''));
console.log('number', number)
if (!isNaN(number)) {
console.log(formatNumberInIndianRupees(number))
element.innerText = formatNumberInIndianRupees(number);
}
});
}
// Format numbers when the DOM content is loaded
document.addEventListener("DOMContentLoaded", function() {
setTimeout(() => {
formatNumbersByClass('indian-number');
}, 500);
});
</script>

View File

@ -54,7 +54,7 @@
</div>
<div class="form-group col-md-4" id="base_policy_id" style="display: none;">
<label for="addon_policy">Base Policy<span class="text-danger">*</span></label>
<label for="addon_policy">Base Policy<span id="base_danger" class="text-danger">*</span></label>
<select class="form-control" id="base_policy" name="base_policy">
<option value="" selected>Select Base Policy</option>
</select>
@ -92,15 +92,19 @@
</div>
<div class="form-row" id="second" style="display: none;">
<div class="form-group col-md-4">
<div class="form-group col-md-3">
<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">
<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-4">
<div class="form-group col-md-3">
<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-4" id="policy_status_field">
<div class="form-group col-md-3" 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>
@ -196,6 +200,7 @@
$('.btnAdd').hide();
$('#insurer').val('').change();
$('#tpa').val('').change();
$('#policy_no').val('').change();
$('#start_date').val('').change();
$('#end_date').val('').change();
$('#policy').html('<option value="" selected>Select Policy</option>').change();
@ -222,6 +227,7 @@
$('.btnAdd').show();
$('#insurer').val('').change();
$('#tpa').val('').change();
$('#policy_no').val('').change();
$('#start_date').val('').change();
$('#end_date').val('').change();
$('#policy').html('<option value="" selected>Select Policy</option>');
@ -250,30 +256,30 @@
// console.log('search_term :', search_term)
var enrollmentStatus = '';
if(item.inception_type == 1){
if (item.inception_type == 1) {
enrollmentStatus = 'N/A'
enrollmentStatus = 'N/A'
}else if(item.inception_type == 2){
} else if (item.inception_type == 2) {
if(item.open_for_enrollment == 1){
if (item.open_for_enrollment == 1) {
enrollmentStatus = '<a href="#" data-id="'+ item.id +'" id="' + item.policy_id + '" class="btnOpenEnroll" data-toggle="tooltip" data-placement="left" title="Click To Close Enrollment">Open</a>'
enrollmentStatus = '<a href="#" data-id="' + item.id + '" id="' + item.policy_id + '" class="btnOpenEnroll" data-toggle="tooltip" data-placement="left" title="Click To Close Enrollment">Open</a>'
}else if(item.open_for_enrollment == 0){
} else if (item.open_for_enrollment == 0) {
enrollmentStatus = '<a href="#" data-toggle="tooltip" data-placement="top" title="Click To Open Enrollment" data-id="'+ item.id +'" id="' + item.policy_id + '" class="btnOpenEnroll">Closed</a>'
}
enrollmentStatus = '<a href="#" data-toggle="tooltip" data-placement="top" title="Click To Open Enrollment" data-id="' + item.id + '" id="' + item.policy_id + '" class="btnOpenEnroll">Closed</a>'
}
var tpaValue = 'TPA Unavailable';
}
if (item.tpa_short && item.tpa_branch_code) {
tpaValue = item.tpa_short + '-' + item.tpa_branch_code;
}
var tpaValue = 'TPA Unavailable';
if (item.tpa_short && item.tpa_branch_code) {
tpaValue = item.tpa_short + '-' + item.tpa_branch_code;
}
policyTable += `
@ -411,20 +417,20 @@
// console.log('search_term :', search_term)
var enrollmentStatus = '';
if(item.inception_type == 1){
if (item.inception_type == 1) {
enrollmentStatus = 'N/A'
}else if(item.inception_type == 2){
} else if (item.inception_type == 2) {
if(item.open_for_enrollment == 1){
if (item.open_for_enrollment == 1) {
enrollmentStatus = '<a data-toggle="tooltip" data-placement="top" title="Click To Close Enrollment" href="#" data-id="'+ item.id +'" id="' + item.policy_id + '" class="btnOpenEnroll">Open</a>'
enrollmentStatus = '<a data-toggle="tooltip" data-placement="top" title="Click To Close Enrollment" href="#" data-id="' + item.id + '" id="' + item.policy_id + '" class="btnOpenEnroll">Open</a>'
}else if(item.open_for_enrollment == 0){
} else if (item.open_for_enrollment == 0) {
enrollmentStatus = '<a data-toggle="tooltip" data-placement="top" title="Click To Open Enrollment" href="#" data-id="'+ item.id +'" id="' + item.policy_id + '" class="btnOpenEnroll">Closed</a>'
enrollmentStatus = '<a data-toggle="tooltip" data-placement="top" title="Click To Open Enrollment" href="#" data-id="' + item.id + '" id="' + item.policy_id + '" class="btnOpenEnroll">Closed</a>'
}
@ -461,6 +467,7 @@
$('#insurer').val('');
$('#tpa').val('');
$('#policy_no').val('');
$('#start_date').val('');
$('#end_date').val('');
$('#policy').html('<option value="" selected>Select Policy</option>');
@ -595,9 +602,9 @@
// appendPolicyFormFields(2);
// }
if($('#policy_type').val() == 1){
if ($('#policy_type').val() == 1) {
console.log('step 1')
console.log('step 1')
if (dataId == 3) {
@ -605,7 +612,8 @@
var displayStatus = $('#base_policy_id').css('display');
$('#base_policy_id').show();
$('#base_policy').prop('required', true);
$('#base_danger').hide();
// $('#base_policy').prop('required', true);
if (displayStatus === 'none') {
console.log('step 2.1')
@ -621,7 +629,8 @@
var displayStatus = $('#base_policy_id').css('display');
$('#base_policy_id').hide();
$('#base_policy').prop('required', false);
$('#base_danger').show();
// $('#base_policy').prop('required', false);
if (displayStatus === 'none') {
console.log('step 3.1')
@ -648,7 +657,7 @@
dataType: 'json',
success: function(res) {
console.log(res)
console.log('client_policy_res', res)
setTimeout(function() {
$('.loader').fadeOut();
@ -681,6 +690,7 @@
$('#policy_type_id').val(res.data.policy_type_id);
$('#policy_PrimaryKey').val(res.data.id);
$('#policy_no').val(res.data.policy_no);
$('#start_date').val(rearrangeDateFormat(res.data.policy_start_date));
$('#end_date').val(rearrangeDateFormat(res.data.policy_end_date));
$('#policy_status').val(checkDateStatus(res.data.policy_end_date));
@ -714,7 +724,7 @@
}
if(res.data.is_addon == 1 && res.data.base_policy > 0){
if (res.data.is_addon == 1 && res.data.base_policy > 0) {
// $("#insurer").next(".select2-container").css({
// 'pointer-events': 'none',
@ -807,23 +817,23 @@
Swal.fire({
title: "Are you sure?",
text: "You need to approve this!",
icon: "info",
showCancelButton: true,
confirmButtonColor: "#3085d6",
confirmButtonText: "Yes",
text: "You need to approve this!",
icon: "info",
showCancelButton: true,
confirmButtonColor: "#3085d6",
confirmButtonText: "Yes",
}).then((result) => {
if (result.isConfirmed) {
var client_policy_id = $(this).attr('data-id');
var policy_id = $(this).attr('id');
var client_id = $('#client_id_policy').val()
var client_policy_id = $(this).attr('data-id');
var policy_id = $(this).attr('id');
var client_id = $('#client_id_policy').val()
console.log('client_policy_id', client_policy_id)
console.log('policy_id', policy_id)
console.log('client_id', client_id)
console.log('client_policy_id', client_policy_id)
console.log('policy_id', policy_id)
console.log('client_id', client_id)
if (client_policy_id) {
$('.loader').fadeIn();
@ -1194,7 +1204,7 @@
}
if (input.id == 'gpa_sum_si2') {
gpaSumInsureMultiplier(input);
gpaSumInsureMultiplier(input);
}
// if(input.id == 'basic_pay'){
@ -1254,10 +1264,12 @@
$('#insurer').val('').change();
$('#tpa').val('').change();
$('#policy_no').val('');
$('#start_date').val('');
$('#end_date').val('');
$('#base_policy').val('').change();
if ($(this).val() == 2 || $(this).val() == 3) {
$("#insurer").next(".select2-container").css({
@ -1273,6 +1285,12 @@
$('#select2-tpa-container').css({
'background-color': '#ebebe0',
});
var baseDanger = $('#base_danger');
if (baseDanger.css('display') === 'none') {
baseDanger.show();
}
} else {
$("#insurer").next(".select2-container").css({
@ -1426,6 +1444,7 @@
$('#insurer').val(res.data.insurer_branch_id + '-' + res.data.insurer_id).change();
$('#tpa').val(res.data.tpa_branch_id + '-' + res.data.tpa_id).change();
$('#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();

View File

@ -1,5 +1,4 @@
<style>
.badge2 {
box-shadow: none;
}
@ -21,7 +20,6 @@
border-radius: .25rem;
transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
</style>
<div class="row" id="client_list">
@ -42,13 +40,17 @@
<!-- <th class="font-weight-medium">Employee code</th> -->
<th class="font-weight-medium">Name/code</th>
<th class="font-weight-medium">Policy name</th>
<th class="font-weight-medium">Insurer name</th>
<th class="font-weight-medium">Insurer <br> name</th>
<th class="font-weight-medium">TPA ID</th>
<th class="font-weight-medium">UHID</th>
<th class="font-weight-medium">Policy status</th>
<th class="font-weight-medium">Sum Insured</th>
<th class="font-weight-medium">Premium</th>
<th class="font-weight-medium">Action</th>
<th class="font-weight-medium">Policy <br> status</th>
<th class="font-weight-medium">()Sum Insured</th>
<th class="font-weight-medium">()Premium</th>
<th class="font-weight-medium" id="rata_premium" data-toggle="tooltip" data-placement="top">
()Pro Rata <br> Premium</th>
<th class="font-weight-medium" id="gst" data-toggle="tooltip" data-placement="top">()GST
</th>
<!-- <th class="font-weight-medium">Action</th> -->
</tr>
</thead>
@ -60,8 +62,8 @@
<tr>
<td><b><?php echo ($key + 1)?></b></td>
<!-- <td><?php echo $employee['emp_code']?></td> -->
<td><?php echo $employee['name']?>( <?php echo $employee['emp_code']?> )</td>
<td><?php echo $employee['name']?>( <?php echo $employee['emp_code']?> -
<?php echo $employee['relationship']?> )</td>
<td><?php echo $employee['policy_name']?></td>
<td><?php echo $employee['insurer_short_name']?></td>
<td><?php echo $employee['tpa_id']?></td>
@ -83,9 +85,11 @@
}
?>
</td>
<td> <?php echo $employee['basic_cover_si']?> </td>
<td><?php echo $employee['premium']?></td>
<td>
<td class="indian-number"> <?php echo $employee['basic_cover_si']?> </td>
<td class="indian-number"><?php echo $employee['premium']?></td>
<td class="indian-number"><?php echo $employee['rata_premimum']?></td>
<td class="indian-number"><?php echo $employee['gst']?></td>
<!-- <td>
<div class="btn-group dropdown">
<a href="javascript: void(0);"
class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"
@ -103,49 +107,130 @@
Unread</a>
</div>
</div>
</td>
</td> -->
</tr>
<?php }}?>
</tbody>
<tfoot>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th>Total</th>
<th class="indian-number"></th>
<th class="indian-number"></th>
<th></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div><!-- end col -->
</div>
<link rel="stylesheet" href="https://unpkg.com/tippy.js@6/dist/tippy.css">
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<script>
$(document).ready(function(){
$(document).ready(function() {
$('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
"buttons": [{
"extend": 'csv',
"text": 'CSV',
"title": 'Employee-List',
"className": 'my_class',
"exportOptions": {
"columns": ':not(:last-child)'
"extend": 'csv',
"text": 'CSV',
"title": 'Employee-List',
"className": 'my_class',
"exportOptions": {
"columns": ':not(:last-child)'
},
}],
"initComplete": function(settings, json) {
$('.my_class').css({
"position": "relative",
"left": "82px"
});
},
}],
"initComplete": function(settings, json) {
$('.my_class').css({
"position": "relative",
"left": "82px"
language: {
search: "_INPUT_",
searchPlaceholder: "Search..."
},
paging: true,
// pagingType: 'full_numbers'
});
});
</script>
<script>
// Function to format a number in Indian Rupees format
function formatNumberInIndianRupees(number) {
const maxLength = 16;
let value = number.toString().replace(/\D/g, ''); // Remove non-numeric characters
// Limit the number of digits
value = value.slice(0, maxLength);
// Format the number with commas using Indian numbering system
const formattedNumber = Number(value).toLocaleString('en-IN');
return formattedNumber;
}
// Function to format numbers based on a class
function formatNumbersByClass(className) {
const elements = document.querySelectorAll(`.${className}`);
elements.forEach(element => {
const number = parseFloat(element.innerText.replace(/,/g, ''));
if (!isNaN(number)) {
element.innerText = formatNumberInIndianRupees(number);
}
});
}
// Format numbers when the DOM content is loaded
document.addEventListener("DOMContentLoaded", function() {
setTimeout(() => {
formatNumbersByClass('indian-number');
}, 500);
});
</script>
<script>
$(document).ready(function() {
var table = $('#tickets-table').DataTable({
"footer": true
});
},
language: {
search: "_INPUT_",
searchPlaceholder: "Search..."
},
paging: true ,
// pagingType: 'full_numbers'
});
});
var sumColumn9 = table.column(9).data().reduce(function(a, b) {
return parseFloat(a) + parseFloat(b);
}, 0);
console.log(sumColumn9)
var sumColumn10 = table.column(10).data().reduce(function(a, b) {
return parseFloat(a) + parseFloat(b);
}, 0);
console.log(sumColumn10)
$('#tickets-table tfoot th:eq(9)').html(sumColumn9);
$('#tickets-table tfoot th:eq(10)').html(sumColumn10);
});
</script>

View File

@ -183,7 +183,7 @@ function appendPolicies(data) {
$.each(data, function(index, item) {
var option = $('<option>', {
value: item.id,
text: item.name
text: item.name + ' - ' + item.policy_type
});
if (PolicyID == item.id) {
option.attr('selected', true);
@ -193,6 +193,7 @@ function appendPolicies(data) {
}
$(document).ready(function() {
$('#clients').on('change', function() {
var selectedClient = $(this).val();
console.log('selectedClient', selectedClient);
@ -264,6 +265,4 @@ document.getElementById('toggleIcon').addEventListener('click', function() {
icon.classList.toggle('mdi-chevron-up');
});
</script>
</script>

View File

@ -38,7 +38,7 @@ option:disabled {
<div class="form-group col-md-4">
<label>Policy</label> <br />
<select name="policy_id" class="form-control" id="policy_id">
<select name="policy_id" class="form-control" id="policy_id" onchange="checkPolicyTermsAndRackRatesHasDefiend(event)">
<option value="0">Select</option>
</select>
</div>
@ -166,11 +166,15 @@ $(document).ready(function() {
// Initialize select2
$("#client_id").select2();
$("#policy_id").select2();
});
// Declare a global variable to store API response data
var clientPolicies = [];
var client_id_param = 0;
var client_policy_param = 0;
$(document).ready(function() {
console.log("document loaded");
@ -278,8 +282,42 @@ $(document).ready(function() {
});
$(window).on("load", function() {
console.log("window loaded");
fetchClientPolicies();
// Get the current page URL
const url = window.location.href;
// Create a new URL object
const urlObject = new URL(url);
// 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_param = params.get('client_id');
client_policy_param = params.get('client_policy_id');
inception_param = params.get('actions');
console.log('client_id:', client_id_param);
console.log('client_policy_id:', client_policy_param);
console.log('inception_param:', inception_param);
if(inception_param != null){
$('#upload-action-type').val('inception').change()
var selectedValue = inception_param;
if (selectedValue !== '') {
$('#file_upload').show();
var fullURL = '<?= base_url("util/download-excel/"); ?>' + selectedValue;
$('#excel_download').attr('href', fullURL);
} else {
$('#file_upload').hide();
$('#excel_download').removeAttr('href');
}
}
});
@ -304,6 +342,20 @@ function fetchClientPolicies() {
clientPolicies = (response.data);
// console.log(clientPolicies);
appendClients(clientPolicies);
//this function for reselect the policy
setTimeout(function() {
if (client_id_param != null ) {
var foundPolicies = clientPolicies.find(function(item) {
console.log(typeof item.id)
return item.id == client_id_param;
});
appendPolicies(foundPolicies.policies);
}
}, 500);
//end
} catch (error) {
console.error('Error parsing API response data:', error);
}
@ -462,26 +514,38 @@ function fetchFileError(file_id) {
function appendClients(data) {
console.log('client_id_param', client_id_param)
$.each(data, function(index, item) {
$('#client_id').append($('<option>', {
var option = $('<option>', {
value: item.id,
text: item.client_name
}));
});
if (client_id_param == item.id) {
option.attr('selected', true);
}
$('#client_id').append(option);
});
}
function appendPolicies(data) {
$('#policy_id').empty();
$('#policy_id').append($('<option>', {
value: '',
value: '0',
text: 'Select'
}));
$.each(data, function(index, item) {
$('#policy_id').append($('<option>', {
var option = $('<option>', {
value: item.id,
text: item.name
}));
text: item.name + ' - ' + item.policy_type
});
if (client_policy_param == item.id) {
option.attr('selected', true);
}
$('#policy_id').append(option);
});
}
@ -510,6 +574,7 @@ function objectToQueryString(obj) {
}
function fetchEmpolyeeList(event) {
event.preventDefault(); // Prevent default action
var client_id = $('#client_id').val();
@ -727,10 +792,70 @@ $(document).ready(function() {
}
}
});
})
})
function checkPolicyTermsAndRackRatesHasDefiend(event)
{
console.log(event.target.id);
var policy_id = (event.target.value);
console.log('checkPolicyTermsAndRackRatesHasDefiend called ' + policy_id);
var apiURL = '<?php echo base_url();?>' + 'util/has_policy_config_completed/' + policy_id;
console.log(apiURL);
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
$.ajax({
url: apiURL,
method: 'GET',
headers: {
"Content-Type": "application/json",
"X-Requested-With": "XMLHttpRequest"
},
success: function(response) {
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
console.log('check policy responce', response);
if (response.code === 200 && response.dataStatus === true && response.message !== null) {
toastr.error(response.message, 'Error');
$('#emp_form_submit_button').prop('disabled', true);
return false;
}
else if(response.code === 200 && response.dataStatus === true && response.message == null)
{
// toastr.error('Policy Terms or rack rate not defined!', 'Error');
$('#emp_form_submit_button').prop('disabled', false);
return true;
}
else
{
toastr.error('Policy Terms or rack rate not defined!', 'Error');
return false;
}
},
error: function(xhr, status, error) {
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
toastr.error('Something went wrong! Try Later', 'Error');
console.error('Error fetching data from checkPolicyTermsAndRackRatesHasDefiend API:', error);
return false;
}
});
}
//---------------------------------------------------------------------------------------------------------
</script>

View File

@ -59,10 +59,15 @@
}else if( $file['status'] == 'inprogress'){
echo '<a data-toggle="tooltip" data-placement="top" data-id="' . $file['status'] . '" class="reload" title="Click to reload" href="#">' . $file['status'] . '</a>';
$tool_tip_text = "Live(s) : {$file['employee_count']}" . " | Total premium : ₹ " . format_indian_number($file['total'],2,',') ." | Click to reload";
echo '<a data-toggle="tooltip" data-placement="top" data-id="' . $file['status'] . '" class="reload" title="'.$tool_tip_text.'" href="#">' . $file['status'] . '</a>';
}else{
echo $file['status'];
$tool_tip_text = "Live(s) : {$file['employee_count']}" . " | Total premium : ₹ " . format_indian_number($file['total'],2,',') ;
// $tool_tip_text = "dssd";
// Total Amount : $file['total']";
echo '<span data-toggle="tooltip" data-placement="top" data-id="' . $file['status'] . '" title=" '. $tool_tip_text.' ">' . $file['status'] . '</span>';
}
?>
</td>

View File

@ -1,42 +1,52 @@
<style>
.table th, .table td {
.table th,
.table td {
padding: 8px;
}
table.dataTable tbody td {
padding: 4px 4px !important;
}
</style>
<div class="row" id="client_add" style="position: relative; bottom: 25px;">
<div class="col-12">
<div class="card-body">
<ul class="nav nav-pills navtab-bg">
<li class="nav-item">
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
class="nav-link px-3 py-2 active" id="general_tab">
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
<span class="d-none d-sm-inline-block">Data From Client</span>
</a>
</li>
<li class="nav-item">
<a href="#KYC-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="kyc_tab">
<span class="mr-1"><i class="fa fa-file"></i></span>
<span class="d-none d-sm-inline-block">Insurer or TPA Data</span>
</a>
</li>
</ul>
<div class="tab-content">
<?php include('employee_upload.php'); ?>
<?php include('insurer_or_tpa_data.php'); ?>
</div>
<div class="card-body">
<ul class="nav nav-pills navtab-bg">
<li class="nav-item">
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2 active" id="general_tab">
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
<span class="d-none d-sm-inline-block">Data From Client</span>
</a>
</li>
<li class="nav-item">
<a href="#KYC-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="kyc_tab">
<span class="mr-1"><i class="fa fa-file"></i></span>
<span class="d-none d-sm-inline-block">Insurer or TPA Data</span>
</a>
</li>
</ul>
<div class="tab-content">
<?php include('employee_upload.php'); ?>
<?php include('insurer_or_tpa_data.php'); ?>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
if (window.location.hash === '#KYC-DOC-tab') {
console.log('url hash :', window.location.hash)
$('#kyc_tab').click();
}
})
</script>

View File

@ -4,19 +4,16 @@
<div class="col-xl-12">
<div id="accordion" class="mb-3">
<div class="card mb-1">
<h5 class="m-1">
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a>
</h5>
<h5 class="m-1">
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a>
</h5>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body">
<!-- <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">
<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">
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-4">
@ -27,7 +24,7 @@
</div>
<div class="form-group col-md-4">
<label>Policy<span class="text-danger">*</span></label> <br />
<label>Policy<span class="text-danger" id="policy_danger">*</span></label> <br />
<select name="client_policy_id" class="form-control" id="policy" required>
<option value="">Select</option>
</select>
@ -35,18 +32,15 @@
<div class="form-group col-md-4">
<label>Insurer/TPA Data<span class="text-danger">*</span></label> <br />
<select name="insurer_or_tpa" class="form-control" id="insurer_or_tpa"
required>
<select name="insurer_or_tpa" class="form-control" id="insurer_or_tpa" required>
<option value="">Select</option>
<?php
if(isset($insurer_or_tpa) && count($insurer_or_tpa))
{
foreach($insurer_or_tpa as $key => $action)
{
echo "<option value=".$key.">".$action."</option>";
}
}
?>
if (isset($insurer_or_tpa) && count($insurer_or_tpa)) {
foreach ($insurer_or_tpa as $key => $action) {
echo "<option value=" . $key . ">" . $action . "</option>";
}
}
?>
</select>
</div>
</div>
@ -58,30 +52,25 @@
<select name="action_type" class="form-control" id="action_type" required>
<option value="">Select</option>
<?php
if(isset($import_or_export) && count($import_or_export))
{
foreach($import_or_export as $key => $action)
{
echo "<option value=".$key.">".$action."</option>";
}
}
?>
if (isset($import_or_export) && count($import_or_export)) {
foreach ($import_or_export as $key => $action) {
echo "<option value=" . $key . ">" . $action . "</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-4">
<label>Event<span class="text-danger">*</span></label> <br />
<select name="event_type" class="form-control" id="upload-action-type"
required>
<select name="event_type" class="form-control" id="event_type" required>
<option value="">Select</option>
<?php
if(isset($events) && count($events))
{
foreach($events as $key => $action)
{
echo "<option value=".$key.">".$action."</option>";
}
if (isset($events) && count($events)) {
foreach ($events as $key => $action) {
echo "<option value=" . $key . ">" . $action . "</option>";
}
}
?>
</select>
</div>
@ -93,25 +82,19 @@
<div class="form-row" id="import_excel_btn">
<div class="form-group col-md-3">
<label>Upload file</label>
<input type="file" name="import_file_data" id="import_file"
accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet"
required>
<input type="file" name="import_file_data" id="import_file" accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet" required>
</div>
<div class="d-flex align-items-center justify-content-start"
style="margin-top: 18px;">
<div class="d-flex align-items-center justify-content-start" style="margin-top: 18px;">
<div class="form-group col-md-3">
<button id="emp_form_submit_button" type="submit"
class="btn btn-primary waves-effect waves-light justify-content-end">Upload</button>
<button id="emp_form_submit_button" type="submit" class="btn btn-primary waves-effect waves-light justify-content-end">Upload</button>
</div>
</div>
</div>
<div class="form-row" id="export_excel_btn">
<div class="d-flex align-items-center justify-content-start"
style="margin-top: 18px;">
<div class="d-flex align-items-center justify-content-start" style="margin-top: 18px;">
<div class="form-group col-md-3">
<button id="emp_form_submit_button_2" type="submit"
class="btn btn-primary waves-effect waves-light justify-content-end">Download</button>
<button id="emp_form_submit_button_2" type="submit" class="btn btn-primary waves-effect waves-light justify-content-end">Download</button>
</div>
</div>
</div>
@ -125,253 +108,354 @@
</div>
</div>
<!-- end page title -->
<div class="row" id="file_list">
<?php include('batch_list.php');?>
<!-- end page title -->
<div class="row" id="file_list">
<?php include('batch_list.php'); ?>
</div>
<!-- end row -->
</div>
<script>
$(document).ready(function() {
// Initialize select2
$("#client").select2();
$("#policy").select2();
});
$(document).ready(function() {
// Initialize select2
$("#client").select2();
$("#policy").select2();
});
// Declare a global variable to store API response data
var clientPolicies = [];
// Declare a global variable to store API response data
var clientPolicies = [];
$(document).ready(function() {
var client_id_param2 = 0;
var client_policy_param2 = 0;
<?php if (session()->has('error')): ?>
toastr.error('<?= session()->getFlashdata('error') ?>', 'Failed');
<?php endif; ?>
$(document).ready(function() {
<?php if (session()->has('success')): ?>
toastr.success('<?= session()->getFlashdata('success') ?>', 'success');
<?php endif; ?>
<?php if (session()->has('error')) : ?>
toastr.error('<?= session()->getFlashdata('error') ?>', 'Failed');
<?php endif; ?>
$('#import_excel_btn').hide();
$('#export_excel_btn').hide();
<?php if (session()->has('success')) : ?>
toastr.success('<?= session()->getFlashdata('success') ?>', 'success');
<?php endif; ?>
// for form submit
$("#import_export_excel_forms").submit(function(event) {
$('#import_excel_btn').hide();
$('#export_excel_btn').hide();
var action = "<?php echo base_url().'util/import-export'?>"
// var action = $(this).attr("action");
event.preventDefault(); // Prevent default form submission
console.log('submit called');
// for form submit
$("#import_export_excel_forms").submit(function(event) {
var isValid = $('#import_export_excel_form').parsley().validate();
var action = "<?php echo base_url() . 'util/import-export' ?>"
// var action = $(this).attr("action");
event.preventDefault(); // Prevent default form submission
console.log('submit called');
if (!isValid) {
console.log('Form is Empty', 'Warning');
return;
}
var isValid = $('#import_export_excel_form').parsley().validate();
// Create FormData object
var formData = new FormData($(this)[0]);
for (var pair of formData.entries()) {
console.log(pair[0] + ', ' + pair[1]);
}
if (!isValid) {
console.log('Form is Empty', 'Warning');
return;
}
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
// Create FormData object
var formData = new FormData($(this)[0]);
for (var pair of formData.entries()) {
console.log(pair[0] + ', ' + pair[1]);
}
$.ajax({
url: action,
type: "POST",
data: formData,
processData: false, // Prevent jQuery from automatically processing the data
contentType: false, // Let jQuery handle the content type
success: function(response) {
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
console.log(response);
if (response.code === 200 && response.status === true) {
$.ajax({
url: action,
type: "POST",
data: formData,
processData: false, // Prevent jQuery from automatically processing the data
contentType: false, // Let jQuery handle the content type
success: function(response) {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
$$("#import_export_excel_form")[0].reset()
toastr.success('File Download successs', 'success');
console.log(response);
if (response.code === 200 && response.status === true) {
} else if (response.code === 404 && response.status === false) {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
$$("#import_export_excel_form")[0].reset()
toastr.success('File Download successs', 'success');
console.error('no data found', response);
} else if (response.code === 404 && response.status === false) {
console.error('no data found', response);
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
$("#import_export_excel_form")[0].reset()
toastr.error(response.message, 'Failed');
} else {
console.error('Something went wrong!');
toastr.error('Something went wrong! Try later', 'Error');
// window.location.reload(true);
}
},
error: function(xhr, status, error) {
// Request failed, handle error
console.error("Request failed:", status, error);
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
$("#import_export_excel_form")[0].reset()
toastr.error(response.message, 'Failed');
} else {
console.error('Something went wrong!');
toastr.error('Something went wrong! Try later', 'Error');
// window.location.reload(true);
}
});
}); //end
});
$(window).on("load", function() {
fetchClientPolicies2();
// Get the current page URL
const url = window.location.href;
// Create a new URL object
const urlObject = new URL(url);
// 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');
actions = params.get('actions');
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()
$('#event_type').val(event).change()
$('#insurer_or_tpa').val(insurer_or_tpa).change()
var selectedValue = actions;
console.log(selectedValue);
if (selectedValue == '') {
$('#import_excel_btn').hide();
$('#export_excel_btn').hide();
} else if (selectedValue == 'import') {
$('#import_file').prop('required', true);
$('#import_file').attr('name', 'import_file_data');
$('#import_excel_btn').show();
$('#export_excel_btn').hide();
} else if (selectedValue == 'export') {
$('#import_file').removeAttr('name');
$('#import_file').prop('required', false);
$('#import_excel_btn').hide();
$('#export_excel_btn').show();
}
}
});
function fetchClientPolicies2() {
$('#loader').show();
var apiURL = '<?php echo base_url(); ?>' + 'util/clients-with-policies';
$.ajax({
url: apiURL,
method: 'GET',
headers: {
"Content-Type": "application/json",
"X-Requested-With": "XMLHttpRequest"
},
success: function(response) {
// console.log(response.code);
// console.log(response.dataStatus);
// console.log(response.data);
if (response.code === 200 && response.dataStatus === true && response.data !== "") {
try {
clientPolicies = (response.data);
console.log(clientPolicies);
appendClients2(clientPolicies);
//this function for reselect the policy
setTimeout(function() {
if (client_id_param2 != null) {
var foundPolicies = clientPolicies.find(function(item) {
console.log(typeof item.id)
return item.id == client_id_param2;
});
appendPolicies2(foundPolicies.policies);
}
}, 500);
//end
} catch (error) {
console.error('Error parsing API response data:', error);
}
} else if (response.code === 404 && response.dataStatus === false) {
console.error('no data found', response);
} else {
console.error('Something went wrong!');
}
},
error: function(xhr, status, error) {
// Request failed, handle error
console.error("Request failed:", status, error);
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
$("#import_export_excel_form")[0].reset()
toastr.error('Something went wrong! Try later', 'Error');
// window.location.reload(true);
console.error('Error fetching data from API:', error);
}
});
}); //end
});
$('#loader').hide();
}
function appendClients2(data) {
$(window).on("load", function() {
fetchClientPolicies2();
});
console.log('client_id_param2', client_id_param2)
function fetchClientPolicies2() {
$('#loader').show();
var apiURL = '<?php echo base_url();?>' + 'util/clients-with-policies';
$.ajax({
url: apiURL,
method: 'GET',
headers: {
"Content-Type": "application/json",
"X-Requested-With": "XMLHttpRequest"
},
success: function(response) {
// console.log(response.code);
// console.log(response.dataStatus);
// console.log(response.data);
if (response.code === 200 && response.dataStatus === true && response.data !== "") {
try {
clientPolicies = (response.data);
console.log(clientPolicies);
appendClients2(clientPolicies);
} catch (error) {
console.error('Error parsing API response data:', error);
}
} else if (response.code === 404 && response.dataStatus === false) {
console.error('no data found', response);
} else {
console.error('Something went wrong!');
$.each(data, function(index, item) {
var option = $('<option>', {
value: item.id,
text: item.client_name
});
if (client_id_param2 == item.id) {
option.attr('selected', true);
}
},
error: function(xhr, status, error) {
console.error('Error fetching data from API:', error);
$('#client').append(option);
});
}
function appendPolicies2(data) {
$('#policy').empty();
$('#policy').append($('<option>', {
value: '0',
text: 'Select'
}));
$.each(data, function(index, item) {
var option = $('<option>', {
value: item.id,
text: item.name + ' - ' + item.policy_type
});
if (client_policy_param2 == item.id) {
option.attr('selected', true);
}
$('#policy').append(option);
});
}
$(document).ready(function() {
$('#client').on('change', function() {
var selectedClient = $(this).val();
console.log(selectedClient);
// $('#selectedOptionInfo').text('Selected option: ' + selectedOption);
// Check if the selected option exists in apiData
var foundPolicies = clientPolicies.find(function(item) {
return item.id === selectedClient;
});
console.log(foundPolicies.policies);
appendPolicies2(foundPolicies.policies);
});
});
// Function to convert object to query parameters
function objectToQueryString2(obj) {
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
}
function fetchEmpolyeeList2(event) {
event.preventDefault(); // Prevent default action
var client_id = $('#client').val();
var policy_id = $('#policy').val();
console.log(client_id + '-' + policy_id);
if (client_id == '0' || policy_id == '0') {
alert('Please select values in both dropdowns.');
return;
}
var queryParams = {
client_id: client_id,
policy_id: policy_id
};
const queryString = objectToQueryString2(queryParams);
const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
console.log(apiURL);
window.location.href = apiURL;
}
//--------------------------------------------------------------------------------------
$('#action_type').change(function() {
var selectedValue = $(this).val();
console.log(selectedValue);
if (selectedValue == '') {
$('#import_excel_btn').hide();
$('#export_excel_btn').hide();
} else if (selectedValue == 'import') {
$('#import_file').prop('required', true);
$('#import_file').attr('name', 'import_file_data');
$('#import_excel_btn').show();
$('#export_excel_btn').hide();
} else if (selectedValue == 'export') {
$('#import_file').removeAttr('name');
$('#import_file').prop('required', false);
$('#import_excel_btn').hide();
$('#export_excel_btn').show();
}
});
$('#loader').hide();
}
function appendClients2(data) {
$.each(data, function(index, item) {
$('#client').append($('<option>', {
value: item.id,
text: item.client_name
}));
document.getElementById('toggleIcon').addEventListener('click', function() {
var icon = document.getElementById('icon');
icon.classList.toggle('mdi-chevron-down');
icon.classList.toggle('mdi-chevron-up');
});
}
function appendPolicies2(data) {
$('#policy').empty();
$('#policy').append($('<option>', {
value: '',
text: 'Select'
}));
$.each(data, function(index, item) {
$('#policy').append($('<option>', {
value: item.id,
text: item.name
}));
$(document).ready(function() {
$('#event_type').change(function() {
var selectedVal = $(this).val();
console.log(selectedVal);
if (selectedVal === 'correction') {
$('#policy').prop('required', false);
$('#policy_danger').hide();
} else {
$('#policy').prop('required', true);
$('#policy_danger').show();
}
});
});
}
$(document).ready(function() {
$('#client').on('change', function() {
var selectedClient = $(this).val();
console.log(selectedClient);
// $('#selectedOptionInfo').text('Selected option: ' + selectedOption);
// Check if the selected option exists in apiData
var foundPolicies = clientPolicies.find(function(item) {
return item.id === selectedClient;
});
console.log(foundPolicies.policies);
appendPolicies2(foundPolicies.policies);
});
});
// Function to convert object to query parameters
function objectToQueryString2(obj) {
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
}
function fetchEmpolyeeList2(event) {
event.preventDefault(); // Prevent default action
var client_id = $('#client').val();
var policy_id = $('#policy').val();
console.log(client_id + '-' + policy_id);
if (client_id == '0' || policy_id == '0') {
alert('Please select values in both dropdowns.');
return;
}
var queryParams = {
client_id: client_id,
policy_id: policy_id
};
const queryString = objectToQueryString2(queryParams);
const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
console.log(apiURL);
window.location.href = apiURL;
}
//--------------------------------------------------------------------------------------
$('#action_type').change(function() {
var selectedValue = $(this).val();
console.log(selectedValue);
if (selectedValue == '') {
$('#import_excel_btn').hide();
$('#export_excel_btn').hide();
} else if (selectedValue == 'import') {
$('#import_file').prop('required', true);
$('#import_file').attr('name', 'import_file_data');
$('#import_excel_btn').show();
$('#export_excel_btn').hide();
} else if (selectedValue == 'export') {
$('#import_file').removeAttr('name');
$('#import_file').prop('required', false);
$('#import_excel_btn').hide();
$('#export_excel_btn').show();
}
});
document.getElementById('toggleIcon').addEventListener('click', function() {
var icon = document.getElementById('icon');
icon.classList.toggle('mdi-chevron-down');
icon.classList.toggle('mdi-chevron-up');
});
//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------
</script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -136,14 +136,14 @@
<tr>
<td style="width: 11%;"><span style="margin-right: 20px;">Self:</span></td>
<td style="width: 11%;"><input type="checkbox" style="margin-right: 70px;" name="family_floaters[]" value="self" id="self" checked> </td>
<td style="width: 28%;" ><div class="self-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo (isset($self_min_age) && $self_min_age > 0) ? $self_min_age : '18'; ?>" style="width: 25%;;" type="number" name="self_min_age" id="self_min_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
<td style="width: 28%;" ><div class="self-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo (isset($self_min_age) && $self_min_age > 0) ? $self_min_age : '18'; ?>" style="width: 25%;;" type="number" name="self_min_age" id="self_min_age" oninput="lowerIsEighteen(this)"></div></td>
<td style="width: 28%;" ><div class="self-age"><span style="margin-right: 20px;">Max Age:</span><input class="underline-input max_age" value="<?php echo isset($self_max_age) ? $self_max_age : '60'; ?>" style="width: 25%;;" type="number" name="self_max_age" id="self_max_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
</tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
<tr>
<td style="width: 11%;"><span style="margin-right: 20px;">Spouse:</span></td>
<td style="width: 11%;"><input type="checkbox" style="margin-right: 70px;"name="family_floaters[]" value="spouse" id="spouse"></td>
<td style="width: 28%;" ><div class="spouse-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo (isset($spouse_min_age) && $spouse_min_age > 0) ? $spouse_min_age : '18'; ?>" style="width: 25%;;" type="number" name="spouse_min_age" id="spouse_min_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
<td style="width: 28%;" ><div class="spouse-age"><span style="margin-right: 20px;">Max Age:</span><input class="underline-input max_age" value="<?php echo isset($spouse_max_age) ? $spouse_max_age : '60'; ?>" style="width: 25%;;" type="number" name="spouse_max_age" id="spouse_max_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
<td style="width: 28%;" ><div class="spouse-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo isset($spouse_min_age) ? $spouse_min_age : '18'; ?>" style="width: 25%;;" type="number" name="spouse_min_age" id="spouse_min_age" oninput="lowerIsEighteen(this)"></div></td>
<td style="width: 28%;" ><div class="spouse-age"><span style="margin-right: 20px;">Max Age:</span><input class="underline-input max_age" value="<?php echo isset($spouse_max_age) ? $spouse_max_age : '60'; ?>" style="width: 25%;;" type="number" name="spouse_max_age" id="spouse_max_age" ></div></td>
</tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
<tr>
<td style="width: 11%;"><span for="children">Children:</span></td>
@ -177,7 +177,7 @@
<option value="2PIL">Only two parents in law (FIL + MIL)</option>
<option value="2EPORPIL">Parents or PIL (Any two of Father, Mother, MIl, FIL)</option>
<option value="EPORPIL">Either Parents or PIL (Parents or Parents In Law)</option>
<option valueCONFLICT="4EPORPIL">Parents + PIL (Father + Mother + MIL + FIL)</option>
<option value="4EPORPIL">Parents + PIL (Father + Mother + MIL + FIL)</option>
</select>
</div>
<div style="margin-top:10px">
@ -185,8 +185,8 @@
<tbody>
<tr>
<td style="width: 22%;" ><div class="other-member-age"><span style="margin-right: 20px;">Elders Count:</span><input class="underline-input" id="member_count" style="width: 25%;;" type="number" name="member_count" disabled id="member_count"></div></td>
<td style="width: 28%;" ><div class="other-member-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo isset($other_member_min_age) ? $other_member_min_age : '18'; ?>" style="width: 25%;;" type="number" class="underline-input min_age" name="other_member_min_age" id="other_member_min_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
<td style="width: 28%;" ><div class="other-member-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input max_age" value="<?php echo isset($other_member_max_age) ? $other_member_max_age : '60'; ?>" style="width: 25%;;" type="number" class="underline-input max_age" name="other_member_max_age" id="other_member_max_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td>
<td style="width: 28%;" ><div class="other-member-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo isset($other_member_min_age) ? $other_member_min_age : '18'; ?>" style="width: 25%;;" type="number" class="underline-input min_age" name="other_member_min_age" id="other_member_min_age" oninput="lowerIsEighteen(this)"></div></td>
<td style="width: 28%;" ><div class="other-member-age"><span style="margin-right: 20px;">Max Age:</span><input class="underline-input max_age" value="<?php echo isset($other_member_max_age) ? $other_member_max_age : '60'; ?>" style="width: 25%;;" type="number" class="underline-input max_age" name="other_member_max_age" id="other_member_max_age" ></div></td>
</tr>
</tbody>
@ -1040,8 +1040,8 @@
if ($('#spouse').prop('checked')) {
$('.spouse-age').css('display','');
$('#spouse_min_age').val(18);
$('#spouse_max_age').val(60);
// $('#spouse_min_age').val(18);
// $('#spouse_max_age').val(60);
} else {
$('.spouse-age').css('display','none');
@ -1256,10 +1256,10 @@
$('#spouse').change(function () {
if ($(this).prop('checked')) {
$('.spouse-age').css('display','');
if($('#spouse_min_age').val() < 0 || $('#spouse_min_age').val() == '' ){
if($('#spouse_min_age').val() < 17 || $('#spouse_min_age').val() == '' ){
$('#spouse_min_age').val(18);
}
if($('#spouse_max_age').val() < 0 || $('#spouse_max_age').val() == '' ){
if($('#spouse_max_age').val() < 17 || $('#spouse_max_age').val() == '' ){
$('#spouse_max_age').val(60);
}
}else{
@ -1275,7 +1275,7 @@
if($('#child_min_age').val() < 0 || $('#child_min_age').val() == '' ){
$('#child_min_age').val(0);
}
if($('#child_max_age').val() < 0 || $('#child_max_age').val() == '' ){
if($('#child_max_age').val() < 24 || $('#child_max_age').val() == '' ){
$('#child_max_age').val(25);
}
}else{
@ -1289,6 +1289,13 @@
var family_floaters = $(this).val();
if($('#family_floaters').val() != 0){
$('.other-member-age').css('display','');
if($('#other_member_min_age').val() < 17 || $('#other_member_min_age').val() == '' ){
$('#other_member_min_age').val(18);
}
if($('#other_member_max_age').val() < 79 || $('#other_member_max_age').val() == '' ){
$('#other_member_max_age').val(60);
}
}else{
$('.other-member-age').css('display','none');
}
@ -1310,4 +1317,14 @@
}
})
function lowerIsEighteen(params) {
if($(params).val() < 18){
$(params).val(18);
}
}
</script>

View File

@ -1,6 +1,6 @@
<!-- Modal content for the Large example -->
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
aria-hidden="true" aria-modal="true" data-backdrop="static">
aria-hidden="true" aria-modal="true" data-backdrop="static" style="padding-right: 15px">
<div class="modal-dialog modal-full-width">
<div class="modal-content">
<div class="modal-header">
@ -27,7 +27,7 @@
</select>
</div>
<!-- <div class="form-group col-md-4" style="position: relative; left: 45px;display:none" id="premium_type">
<div class="form-group col-md-4" style="position: relative; left: 45px; display:none" id="premium_type">
<label for="css"> Premium Calculation </label>
<div style="display: flex; align-items: center;">
<input type="radio" id="individual" name="premium_type" value="2">
@ -35,7 +35,7 @@
<input type="radio" id="single" name="premium_type" value="1">
<label for="single" style="position: relative;top: 5px;left: 5px;"> Single Insurance </label>
</div>
</div> -->
</div>
</div>
@ -46,7 +46,7 @@
</div>
<div class="form-group text-right m-b-0">
<div class="form-group text-right m-b-0" id="hide_smbt_btn">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
id="btnGridSubmit_2">Submit</button>
</div>
@ -710,10 +710,10 @@ $('body').on('click', '.btnPolicyModel', function() {
var client_policy_id = $(this).data('id');
$('#client_policy_id').val(client_policy_id);
console.log('client_policy_id', client_policy_id)
// console.log('client_policy_id', client_policy_id)
var policy_type_string = $(this).attr('id');
console.log('policy_type_string', policy_type_string)
// console.log('policy_type_string', policy_type_string)
if (policy_type_string == 'GPA' || policy_type_string == 'GMC') {
@ -733,15 +733,17 @@ $('body').on('click', '.btnPolicyModel', function() {
dataType: 'json',
success: function(res) {
$('#GridForm')[0].reset();
// if(res.family_floater == 1){
// $('#premium_type').show();
// $('#individual').prop('checked', true)
// }else{
// $('#premium_type').hide();
// $('#individual').prop('checked', false)
// }
if(policy_type_string == 'GMC'){
$('#premium_type').show();
$('#individual').prop('checked', true)
}else{
$('#premium_type').hide();
$('#individual').prop('checked', true)
}
setTimeout(function() {
$('.loader').fadeOut();
@ -758,12 +760,13 @@ $('body').on('click', '.btnPolicyModel', function() {
$('#nameOfThePolicy').html(' - ' + res.policy_name);
$('#grid_emp_count').val(res.count);
if (res.count > 0) {
console.log('count -- 2', res.count);
$("#btnGridSubmit_2").hide();
console.log(' hide submit btn count ', res.count);
$("#hide_smbt_btn").hide();
} else {
$("#btnGridSubmit_2").show();
console.log('count -- ', res.count);
$("#hide_smbt_btn").show();
console.log('show submit btn count ', res.count);
}
if (res.status === false) {
@ -787,25 +790,26 @@ $('body').on('click', '.btnPolicyModel', function() {
'</option>';
});
$('#grid').html(policeGridOptionHTML);
// if (res.premiumData[0].hasOwnProperty('premium_type')) {
if (res.premiumData[0].hasOwnProperty('premium_type')) {
// if (res.premiumData[0].premium_type == '2') {
if (res.premiumData[0].premium_type == '2') {
// $('#individual').prop('checked', true)
// $('#single').prop('checked', false)
$('#individual').prop('checked', true)
$('#single').prop('checked', false)
// } else if (res.premiumData[0].premium_type == '1') {
} else if (res.premiumData[0].premium_type == '1') {
// $('#single').prop('checked', true)
// $('#individual').prop('checked', false)
$('#single').prop('checked', true)
$('#individual').prop('checked', false)
// } else {
// $('#single').prop('checked', false)
// $('#individual').prop('checked', false)
// }
} else {
$('#single').prop('checked', false)
$('#individual').prop('checked', true)
}
// }
}
var si_or_bp_value = '';
@ -858,12 +862,12 @@ $('body').on('click', '.btnPolicyModel', function() {
var id_for_trigger = temp_for_premiumData[0].policy_grid_id;
$(`input[name="${id_for_trigger}_si[]"]`).each(function() {
console.log($(this));
// console.log($(this));
$(this).trigger('keyup');
});
$(`input[name="${id_for_trigger}_premium[]"]`).each(function() {
console.log($(this));
// console.log($(this));
$(this).trigger('keyup');
});
@ -915,17 +919,26 @@ $('#grid').change(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
if (res.count > 0) {
// console.log(' hide submit btn count ', res.count);
$("#hide_smbt_btn").hide();
} else {
$("#hide_smbt_btn").show();
// console.log('show submit btn count ', res.count);
}
if (res.premiumData.length > 0 && res.premiumData[0].policy_grid_id === grid_id) {
$('#nameOfThePolicy').html(' - ' + res.policy_name);
$('#grid_emp_count').val(res.count);
if (res.count == false) {
console.log('count -- 2', res.count);
$("#btnGridSubmit_2").hide();
if (res.count > 0) {
// console.log(' hide submit btn count ', res.count);
$("#hide_smbt_btn").hide();
} else {
$("#btnGridSubmit_2").show();
console.log('count -- ', res.count);
$("#hide_smbt_btn").show();
// console.log('show submit btn count ', res.count);
}
if (res.status === false) {
@ -996,9 +1009,9 @@ var Count = 1
function appendGridtHtml(ui_type = false, data = false, ) {
console.log('appendGridtHtml function called')
console.log(ui_type)
console.log(data)
// console.log('appendGridtHtml function called')
// console.log(ui_type)
// console.log(data)
var html = '';
// console.log('Grid Content',data)
@ -1007,13 +1020,13 @@ function appendGridtHtml(ui_type = false, data = false, ) {
if (ui_type == '1') {
console.log('step 1')
// console.log('step 1')
var currentTime = getCurrentTime();
console.log(currentTime);
// console.log(currentTime);
if($("#si_or_bp").val() == 1 || data.si_or_bp == '1'){
console.log('step 2')
// console.log('step 2')
html = `<div class="form-row gpa_sum_insure_remove" style="width:101%" id="removeChild_${Count}">
<div class="form-group col-md-4" id="">
@ -1035,7 +1048,7 @@ function appendGridtHtml(ui_type = false, data = false, ) {
}else if($("#si_or_bp").val() == 3 || data.si_or_bp == '3'){
console.log('step 3')
// console.log('step 3')
html = `<div class="form-row gpa_band_remove" style="width:101%" id="removeChild_${Count}">
@ -1064,7 +1077,7 @@ function appendGridtHtml(ui_type = false, data = false, ) {
}
console.log('step 4')
// console.log('step 4')
} else if (ui_type == '3') {
@ -1775,10 +1788,10 @@ function checkDuplicate() {
}
}
console.log('siValues', siValues);
console.log('premiumValues', premiumValues);
console.log('siDuplicates', siDuplicates);
console.log('premiumDuplicates', premiumDuplicates);
// console.log('siValues', siValues);
// console.log('premiumValues', premiumValues);
// console.log('siDuplicates', siDuplicates);
// console.log('premiumDuplicates', premiumDuplicates);
if (siDuplicates || premiumDuplicates) {
toastr.warning('Duplicates found!', 'warning');
@ -1829,12 +1842,12 @@ function checkDuplicate() {
}
}
console.log('siValues', siValues);
console.log('premiumValues', premiumValues);
console.log('bandValues', bandValues);
console.log('siDuplicates', siDuplicates);
console.log('premiumDuplicates', premiumDuplicates);
console.log('bandDuplicates', bandDuplicates);
// console.log('siValues', siValues);
// console.log('premiumValues', premiumValues);
// console.log('bandValues', bandValues);
// console.log('siDuplicates', siDuplicates);
// console.log('premiumDuplicates', premiumDuplicates);
// console.log('bandDuplicates', bandDuplicates);
if (siDuplicates || bandDuplicates || premiumDuplicates) {
toastr.warning('Duplicates found!', 'warning');
@ -1883,7 +1896,7 @@ function basicPayMultiple(input) {
function gpaSumInsureMultiplier(element) {
console.log(element);
// console.log(element);
var element = $('#gpa_sum_multiplier')[0];
var sumInsured = $('input[name="gpa_sum_si[]"]');
@ -1990,7 +2003,7 @@ function si_orbp_change_function() {
$('#gmc_add_more').hide();
}
console.log('gmcBandInput', count)
// console.log('gmcBandInput', count)
var gpaBandRemoveElements = $("#grid_1").nextAll("div").find(".gpa_band_remove").length;
@ -2049,7 +2062,7 @@ function si_orbp_change_function() {
$('#gmc_add_more2').hide();
}
console.log('gmcBandInput', count)
// console.log('gmcBandInput', count)
$('#si_or_bp_full_div').css({
'display': '',

View File

@ -13,29 +13,33 @@
<input type="text" class="form-control" id="tpa_name" placeholder="Enter TPA Name" value="<?= isset($tpa['name']) ? $tpa['name'] : '' ?>" name="name" required>
</div>
<div class="form-group col-md-4">
<label for="short_name">TPA Short Name<span class="text-danger">*</span></label>
<label for="tpa_short_name">TPA Short Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="short_name" placeholder="Enter Short Name" value="<?= isset($tpa['short_name']) ? $tpa['short_name'] : '' ?>" name="short_name" required>
</div>
<div class="form-group col-md-4">
<label for="short_name">TPA Logo<span class="text-danger"></span></label>
<label for="tpa_logo">TPA Logo<span class="text-danger"></span></label>
<input type="file" class="form-control" onchange="PreviewImage();" id="tpa_logo" name="tpa_logo" accept="image/jpeg, image/jpg, image/png">
</div>
<div class="form-group col-md-4">
<label for="tpa_network_hospitals">Network Hospitals<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="tpa_network_hospitals" name="network_hospitals" placeholder="Enter Network Hospitals" value="<?= isset($tpa['network_hospitals']) ? $tpa['network_hospitals'] : '' ?>" required>
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-md-10">
<label for="tpa_name">E-Card Template<span class="text-danger"></span></label>
<label for="tpa_ecard_template">E-Card Template<span class="text-danger"></span></label>
<textarea style="height: 100px;" class="form-control" id="ecard_content" placeholder="Enter E-card Content" name="ecard_content"><?= isset($template_data) ? $template_data : '' ?></textarea>
</div>
<div class="form-group col-md-2 float-right" style="position: relative;top: 0px;left: 40px;">
<label for="short_name">Logo Preview<span class="text-danger"></span></label>
<label for="tpa_logo_preview">Logo Preview<span class="text-danger"></span></label>
<img src="<?= isset($tpa['tpa_logo']) && !empty($tpa['tpa_logo']) ? base_url() . "public/uploads/logo/" . $tpa['tpa_logo'] : base_url() . "public/assets/images/avatar_2x.png" ?>" width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar" />
</div>
</div>
<div class="form-row">
<div class="form-row" id="view_pre_btn" style="display :none">
<div class="form-group col-md-4">
<a href="<?= isset($tpa['id']) ? base_url('/util/preview-card/') . $tpa['id'] : '' ?>" class="btn btn-primary" id="preview" target="_blank">Preview</a>
</div>
@ -43,22 +47,22 @@
<div class="form-row">
<div class="form-group col-md-4">
<label for="short_name">Front card Image<span class="text-danger"></span></label>
<label for="tpa_front_card_image">Front card Image<span class="text-danger"></span></label>
<input type="file" class="form-control" onchange="PreviewImage2();" id="fc" name="fc" accept="image/jpeg, image/jpg, image/png">
</div>
<div class="form-group col-md-4">
<label for="short_name">Back card Image<span class="text-danger"></span></label>
<label for="tpa_back_card_image">Back card Image<span class="text-danger"></span></label>
<input type="file" class="form-control" onchange="PreviewImage3();" id="bc" name="bc" accept="image/jpeg, image/jpg, image/png">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="short_name">Front card Preview<span class="text-danger"></span></label>
<label for="tpa_front_card_preview">Front card Preview<span class="text-danger"></span></label>
<img src="<?= isset($tpa['front_card']) && !empty($tpa['front_card']) ? base_url() . "public/uploads/template_bg/" . $tpa['front_card'] : base_url() . "public/assets/images/avatar_2x.png" ?>" width="100" height="100" id="uploadPreview2" class="avatar img-circle img-thumbnail" alt="avatar" />
</div>
<div class="form-group col-md-4">
<label for="short_name">Back card Preview<span class="text-danger"></span></label>
<label for="tpa_back_card_preview">Back card Preview<span class="text-danger"></span></label>
<img src="<?= isset($tpa['back_card']) && !empty($tpa['back_card']) ? base_url() . "public/uploads/template_bg/" . $tpa['back_card'] : base_url() . "public/assets/images/avatar_2x.png" ?>" width="100" height="100" id="uploadPreview3" class="avatar img-circle img-thumbnail" alt="avatar" />
</div>
</div>
@ -99,6 +103,11 @@
<script>
$(document).ready(function() {
if($('#tpa_General_PrimaryKey').val() != ""){
$('#view_pre_btn').show()
}
$("#tpa_general_form").submit(function(events) {
events.preventDefault();
@ -106,6 +115,7 @@
var PrimaryKey = $('#tpa_General_PrimaryKey').val();
var form_action = '';
if (isValid) {
if (PrimaryKey === '') {
@ -126,6 +136,12 @@
processData: false,
contentType: false,
success: function(res) {
if($('#tpa_General_PrimaryKey').val() == ""){
window.location.href = '<?= base_url("master/tpa/list/"); ?>' + res.data.id;
}
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

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

View File

@ -1,119 +1,65 @@
<body>
<div style="display: flex;gap: 5px;width: 810px;justify-content: center;margin: 0 auto;">
<div class="card" style="border: 1px solid #50505059;width: 420px;min-height: 280px; padding:10px 10px 0px 10px;background-image: url('<?php ?>');background-position: center;background-size: cover;">
<div style="display: flex;justify-content: center;gap: 10px; width:840px;margin:0 auto 15px; page-break-after: auto;">
<div style="position: absolute;left: 590px;" ><img src="{INSURER_LOGO}" alt="" width="70px" height="70px"></div>
<h6 style="margin-top: 20px;margin-bottom: 26px;font-weight: 700;font-size: 14px;">{INSURER_NAME}</h6>
<div style="border: 1px solid black;width: 400px;max-height: 300px;background: url('{FRONT_CARD}');background-size: 100% 100%;padding: 10px;">
<table style="font-size: 14px;margin-top:9px ;margin-left: 20px;">
<tbody>
<tr>
<td>POLICY NO</td>
<td>:</td>
<td>{POLICY_NO}</td>
</tr>
<tr>
<td>Name</td>
<td>:</td>
<td>{NAME}</td>
</tr>
<tr>
<td>TPA ID</td>
<td>:</td>
<td>{TPA_ID}</td>
</tr>
<tr>
<td>age</td>
<td>:</td>
<td>{AGE}</td>
</tr>
<tr>
<td>Employee code</td>
<td>:</td>
<td>{EMP_ID}</td>
</tr>
<tr>
<td>Corporate name</td>
<td>:</td>
<td>{CORPORATE_NAME}</td>
</tr>
<tr>
<td>Valid form</td>
<td>:</td>
<td>{POLICY_DATE}</td>
</tr>
</tbody>
</table>
<div style="display: flex;">
<div><img src="{INSURER_LOGO}" alt="" width="60px"
width="60px" style="object-fit: fill;;"></div>
<div style="text-align: center;font-family: sans-serif;font-weight: 600;margin-top: 10px;"><span>THE NEW
INDIA ASSURANCE CO.LTD.</span> <br><span style="font-size: 15px;">GOOD HEALTH MEDICLAIM
POLICY</span></div>
</div>
<div style="position: relative;left: 204px;top: 30px;"><img src="{TPA_LOGO}" alt="" width="170px" height="30px" style="object-fit: fill;"></div>
</div>
<table
style="font-family: sans-serif;font-size: 14px;width: 100%;margin-top: 20px;margin-left: 20px;line-height: 20px;">
<tbody>
<tr>
<td>MDID : {TPA_ID}</td>
</tr>
<tr>
<td colspan="2"><b>{NAME}</b></td>
</tr>
<tr>
<td>Certificate No : {UHID}</td>
</tr>
<tr>
<td><span>Sex : {GENDER} </span> <span style="margin-left: 30px;"> Date of Birth : {DOB}</span>
</td>
</tr>
<tr>
<td colspan="2"><b>{SELF_NAME}</b></td>
</tr>
<tr>
<td>Valid form :{POLICY_DATE}</td>
</tr>
</tbody>
</table>
</div>
<div style="border: 1px solid black;width: 400px;max-height: 300px;padding: 5px;">
<div style="font-size: 11px;text-align: center;">The card is for identification purpose only</div>
<table style="width: 100%;text-align: center;font-size: 11px;">
<tbody>
<tr>
<td>General & Claim Enquiry Helpline</td>
<td>Cashless Enquiry helpline</td>
</tr>
</tbody>
</table>
<table style="font-size: 11px;width: 100%;text-align: center;">
<tbody>
<tr>
<td style="border: 1px solid black;">Toll Free : 1800-209-7777 <br>Email :
citibank_chennai@mdindia.com</td>
<td style="border: 1px solid black;">Toll Free : 1800-209-7800 <br>Email:
authorisation@mdindia.com</td>
</tr>
</tbody>
</table>
<div style="font-size: 14px;text-align: center;">CITI MDIndia branch contact</div>
<div>
<table style="text-align: center;width: 100%;font-size: 12px;">
<thead>
<tr>
<th style="border: 1px solid black;">Center</th>
<th style="border: 1px solid black;">Ph.No/Fax.No.</th>
<th style="border: 1px solid black;">Center</th>
<th style="border: 1px solid black;">Ph.No/Fax.No.</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: 1px solid black;">Chennai</td>
<td style="border: 1px solid black;">9381819401</td>
<td style="border: 1px solid black;">Delhi</td>
<td style="border: 1px solid black;">9310596976</td>
</tr>
<tr>
<td style="border: 1px solid black;">Chennai</td>
<td style="border: 1px solid black;">9381819501</td>
<td style="border: 1px solid black;">Mumbai</td>
<td style="border: 1px solid black;">9320373542</td>
</tr>
<tr>
<td style="border: 1px solid black;">Hyderabad</td>
<td style="border: 1px solid black;">9390838023</td>
<td style="border: 1px solid black;">Pune</td>
<td style="border: 1px solid black;">9371644536</td>
</tr>
<tr>
<td style="border: 1px solid black;">Bangalore</td>
<td style="border: 1px solid black;">9341555665</td>
<td style="border: 1px solid black;">Kolkata</td>
<td style="border: 1px solid black;">9333441389</td>
</tr>
</tbody>
</table>
</div>
<div>
<h6 style="margin: 5px;">TERMS AND CONDITIONS</h6>
<ol style="font-size: 11px;padding-left: 15px;margin-top: 0px;">
<li>Pre authorisation is compulsary from tpa prior to planned admission within 24hours for
emergencies.</li>
<li>Admission for Investigation/Evaluation Not covered.</li>
<li>All terms and conditions of the policy would be applicable</li>
<li>cashless hospitalisation in network hospitals can be obtained in conjunction with this card.an
authorisation letter issued by tpa and photo identification and such as Voters ID,Driver
Licence,Passport,etc.</li>
</ol>
</div>
</div>
<div class="card" style="border: 1px solid #50505059;width:420px;min-height: 280px; padding: 0px 20px 5px 0px;">
<h6 style="text-align: center;font-weight: 700;margin: 0px;font-size: 14px;"><u>Terms&conditions</u></h6>
<ul style="font-size: 11px;text-align: justify;font-weight: bolder;font-weight: 600;line-height: 13px;margin-bottom: 5px;">
<li>Submit this card & photo ID for availing cashless insurrer empanelled hospitals</li>
<li>Cashless facility is subject to approved by {TPA_NAME} as per policy terms and conditions</li>
<li>Validdity of this card is subject to valid policy renewal of policy</li>
</ul>
</div>
</div>
</body>
</body>

View File

@ -0,0 +1,89 @@
<body>
<div style="display: flex;justify-content: center;gap: 10px;width: 840px;margin: 0 auto;">
<div style="width: 420px;min-height: 320px; background-image:url({FRONT_CARD});background-size: 100% 100%;border: 1px solid black;line-height: 15px;font-size: 14px;position: relative;">
<h3 style="font-family: sans-serif;padding-left: 89px;margin-top: 35px;">{INSURER_NAME}</h3>
<table style="margin-top: 35px;width: 86%;font-family: sans-serif;padding-left: 20px;">
<tbody>
<tr>
<td>UHID No</td>
<td>:</td>
<td>{UHID}</td>
</tr>
<tr>
<td><b>{NAME}</b></td>
</tr>
<tr>
<td>Age</td>
<td>:</td>
<td>{AGE} years</td>
</tr>
<tr>
<td>Relationship</td>
<td>:</td>
<td>{RELATION}</td>
</tr>
<tr>
<td>Plan Period</td>
<td>:</td>
<td >{POLICY_START_DATE} To {POLICY_DATE}</td>
</tr>
<tr>
<td>Policy No</td>
<td>:</td>
<td>{POLICY_NO}</td>
</tr>
<td>Insurer</td>
<td>:</td>
<td>LCO : {TPA_ID} : {INSURER_BRANCH}</td>
</tbody>
</table>
<div>
<img src="{INSURER_LOGO}" alt="" width="70px" height="70px" style="object-fit: fill;position: absolute;top: 6px;left: 15px;">
</div>
</div>
<div style="width: 420px;min-height: 320px; background-image: url('{BACK_CARD}');background-size: 100% 100%;border: 1px solid black;padding-top: 10px;padding-right: 10px;">
<h4 style="font-family: sans-serif;padding-left: 20px;margin:0px;">Instructions</h4>
<ul style="font-family: sans-serif;font-size: 11px;line-height: 15px;padding-left: 30px;">
<li>Card has to be presented to our network hospitals at the time of the admission while availing cashless</li>
<li>Free authorizationfrom FHPL it must should be taken before 48 hrs for all planed admissions & emergency admissions within 24 hrs of getting admitted to any network hospitals FHPL</li>
<li>The issuance of this card doesnot guarantee cashless benefits /hospitalisation</li>
<li>The card is for the identification purpose.in case of without photograph card.Alternative identification proof such as Voter ID/driving license etc...should be produced</li>
<li>All insurance claim will be processed as per policy terms & conditions</li>
<li>For more details kindly referbook kindly provided</li>
</ul>
</div>
</div>
<div style="margin-left: 20%;margin-top: 50px;">
<h4 style="font-family: sans-serif;margin: 0px;margin-left: 30px;">TERMS AND CONDITIONS:</h4>
<div style="width: 70%;line-height: 30px;">
<ol type="number" style="font-family: sans-serif;">
<li>This card is generated as per the details given by your employer/HR. Incase of any errors in the
details you may confirm the same through your employer for making required corrections.</li>
<li>No physical card will be provided to you. For all requirements you may use this card printed in black
and white or colour.</li>
<li>You can access our network hospitals list from our website https://www.fhpl.net for any information
regarding hospitals available within your location or as required.</li>
<li>For the convenience of the members the guide book is made available on our website
https://www.fhpl.net for understanding protocols in the event of any hospitalization assistance required
for availing cashless service and also to forward any claim where the member has spent on his/her own.</li>
<li>All our network hospitals will accept the printed card and seek the preauthorization from FHPL in the
event of any in-patient hospitalization.</li>
<li>Incase there is no photograph on the ID card, the member has to identify himself/herself with any other
photo-card like: credit card, ration card, electoral card, Company ID card etc in conjunction with this card.</li>
<li>This card is not transferable and cannot be forwarded further to any other person by email/fax.</li>
<li> The card will be visible to any member as long the policy is valid after which this service will be
withdrawn or till such time the member is employed with the current employer.</li>
<li>Usage of this card after the validity/policy expiry will not be entertained.</li>
<li>A fresh card will be generated subjected to the renewal of the policy.</li>
<li>For Any further queries, Please feel free to contact us on Toll—Free Helpline :1800 - 103 - 7519</li>
</ol>
</div>
</div>
</body>

View File

@ -0,0 +1,68 @@
<body>
<div style="display: flex;gap: 5px;width: 840px;justify-content: center;margin: 0 auto;">
<div class="card" style="border: 1px solid #50505059;width: 420px;min-height: 280px; padding:10px 10px 0px 10px;background-image: url(../image/vidal\ background\ image.jpg);background-position: center;background-size: cover;">
<div style="position: absolute;left: 590px;" ><img src="{INSURER_LOGO}" alt="" width="70px" height="70px"></div>
<h6 style="margin-top: 20px;margin-bottom: 26px;font-weight: 700;font-size: 14px;">{INSURER_NAME}</h6>
<table style="font-size: 14px;margin-top:9px ;margin-left: 20px;">
<tbody>
<tr>
<td>POLICY NO</td>
<td>:</td>
<td>{TPA_ID}</td>
</tr>
<tr>
<td>Name</td>
<td>:</td>
<td>{NAME}</td>
</tr>
<tr>
<td>Gender</td>
<td>:</td>
<td>{NAME}</td>
</tr>
<tr>
<td>age</td>
<td>:</td>
<td>{AGE}</td>
</tr>
<tr>
<td>Employee code</td>
<td>:</td>
<td>{EMP_ID}</td>
</tr>
<tr>
<td>Corporate name</td>
<td>:</td>
<td>{CORPORATE_NAME}</td>
</tr>
<tr>
<td>Valid form</td>
<td>:</td>
<td>{POLICY_DATE}</td>
</tr>
</tbody>
</table>
<div style="position: relative;left: 225px;top: 30px;"><img src="{TPA_LOGO}" alt="" width="170px" height="30px" style="object-fit: fill;"></div>
</div>
<div class="card" style="border: 1px solid #50505059;width:420px;min-height: 280px; padding: 0px 20px 5px 0px;">
<h6 style="text-align: center;font-weight: 700;margin: 0px;font-size: 14px;"><u>Terms&conditions</u></h6>
<ul style="font-size: 11px;text-align: justify;font-weight: bolder;font-weight: 600;line-height: 13px;margin-bottom: 5px;">
<li>Submit this card & photo ID for availing cashless insurrer empanelled hospitals</li>
<li>Cashless facility is subject to approved by TPA as per policy terms and conditions</li>
<li>Validdity of this card is subject to valid policy renewal of policy</li>
</ul>
</div>
</div>
</body>

View File

@ -1,119 +1,105 @@
<body>
<div style="display: flex;justify-content: center;gap: 10px; width:840px;margin:0 auto 15px; page-break-after: auto;">
<div style="display: flex;gap: 5px;width: 810px;justify-content: center;margin: 0 auto;">
<div class="card" style="border: 1px solid #50505059;width: 420px;min-height: 280px; padding:10px 10px 0px 10px;background-image: url('{FRONT_CARD}');background-position: center;background-size: cover;">
<div style="border: 1px solid black;width: 400px;max-height: 300px;background: url('{FRONT_CARD}');background-size: 100% 100%;padding: 10px;">
<div style="position: absolute;left: 590px;" ><img src="{INSURER_LOGO}" alt="" width="70px" height="70px"></div>
<h6 style="margin-top: 20px;margin-bottom: 26px;font-weight: 700;font-size: 14px;">{INSURER_NAME}</h6>
<div style="display: flex;">
<div><img src="{INSURER_LOGO}" alt="" width="60px"
width="60px" style="object-fit: fill;;"></div>
<div style="text-align: center;font-family: sans-serif;font-weight: 600;margin-top: 10px;"><span>THE NEW
INDIA ASSURANCE CO.LTD.</span> <br><span style="font-size: 15px;">GOOD HEALTH MEDICLAIM
POLICY</span></div>
</div>
<table
style="font-family: sans-serif;font-size: 14px;width: 100%;margin-top: 20px;margin-left: 20px;line-height: 20px;">
<table style="font-size: 14px;margin-top:9px ;margin-left: 20px;">
<tbody>
<tr>
<td>MDID : {TPA_ID}</td>
<td>Card No</td>
<td>:</td>
<td>{POLICY_NO}</td>
</tr>
<tr>
<td colspan="2"><b>{NAME}</b></td>
<td>Name</td>
<td>:</td>
<td>{NAME}</td>
</tr>
<tr>
<td>Certificate No : {UHID}</td>
<td>Gender</td>
<td>:</td>
<td>{GENDER}</td>
</tr>
<tr>
<td><span>Sex : {GENDER} </span> <span style="margin-left: 30px;"> Date of Birth : {DOB}</span>
</td>
<td>age</td>
<td>:</td>
<td>{AGE} years</td>
</tr>
<tr>
<td colspan="2"><b>{SELF_NAME}</b></td>
<td>Employee code</td>
<td>:</td>
<td>{EMP_ID}</td>
</tr>
<tr>
<td>Valid form :{POLICY_DATE}</td>
<td>Corporate name</td>
<td>:</td>
<td>{CORPORATE_NAME}</td>
</tr>
<tr>
<td>Valid form</td>
<td>:</td>
<td>{POLICY_DATE}</td>
</tr>
</tbody>
</table>
</div>
</table>
<div style="border: 1px solid black;width: 400px;max-height: 300px;padding: 5px;">
<div style="font-size: 11px;text-align: center;">The card is for identification purpose only</div>
<table style="width: 100%;text-align: center;font-size: 11px;">
<tbody>
<tr>
<td>General & Claim Enquiry Helpline</td>
<td>Cashless Enquiry helpline</td>
</tr>
</tbody>
</table>
<div style="position: relative;left: 204px;top: 30px;"><img src="{TPA_LOGO}" alt="" width="170px" height="30px" style="object-fit: fill;"></div>
<table style="font-size: 11px;width: 100%;text-align: center;">
<tbody>
<tr>
<td style="border: 1px solid black;">Toll Free : 1800-209-7777 <br>Email :
citibank_chennai@mdindia.com</td>
<td style="border: 1px solid black;">Toll Free : 1800-209-7800 <br>Email:
authorisation@mdindia.com</td>
</tr>
</tbody>
</table>
<div style="font-size: 14px;text-align: center;">CITI MDIndia branch contact</div>
<div>
<table style="text-align: center;width: 100%;font-size: 12px;">
<thead>
<tr>
<th style="border: 1px solid black;">Center</th>
<th style="border: 1px solid black;">Ph.No/Fax.No.</th>
<th style="border: 1px solid black;">Center</th>
<th style="border: 1px solid black;">Ph.No/Fax.No.</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: 1px solid black;">Chennai</td>
<td style="border: 1px solid black;">9381819401</td>
<td style="border: 1px solid black;">Delhi</td>
<td style="border: 1px solid black;">9310596976</td>
</tr>
<tr>
<td style="border: 1px solid black;">Chennai</td>
<td style="border: 1px solid black;">9381819501</td>
<td style="border: 1px solid black;">Mumbai</td>
<td style="border: 1px solid black;">9320373542</td>
</tr>
<tr>
<td style="border: 1px solid black;">Hyderabad</td>
<td style="border: 1px solid black;">9390838023</td>
<td style="border: 1px solid black;">Pune</td>
<td style="border: 1px solid black;">9371644536</td>
</tr>
<tr>
<td style="border: 1px solid black;">Bangalore</td>
<td style="border: 1px solid black;">9341555665</td>
<td style="border: 1px solid black;">Kolkata</td>
<td style="border: 1px solid black;">9333441389</td>
</tr>
</tbody>
</table>
</div>
<div>
<h6 style="margin: 5px;">TERMS AND CONDITIONS</h6>
<ol style="font-size: 11px;padding-left: 15px;margin-top: 0px;">
<li>Pre authorisation is compulsary from tpa prior to planned admission within 24hours for
emergencies.</li>
<li>Admission for Investigation/Evaluation Not covered.</li>
<li>All terms and conditions of the policy would be applicable</li>
<li>cashless hospitalisation in network hospitals can be obtained in conjunction with this card.an
authorisation letter issued by tpa and photo identification and such as Voters ID,Driver
Licence,Passport,etc.</li>
</ol>
<div class="card" style="border: 1px solid #50505059;width:420px;min-height: 280px; padding: 0px 20px 5px 0px;">
<h6 style="text-align: center;font-weight: 700;margin: 0px;font-size: 14px;"><u>Terms&conditions</u></h6>
<ul style="font-size: 11px;text-align: justify;font-weight: bolder;font-weight: 600;line-height: 13px;margin-bottom: 5px;">
<li>Submit this card & photo ID for availing cashless insurrer empanelled hospitals</li>
<li>Cashless facility is subject to approved by vidal health as per policy terms and conditions</li>
<li>Validdity of this card is subject to valid policy renewal of policy</li>
<li>imidiate intimation to vidal health is must incase of any hospitalisation</li>
<li>Download the vidal health mobile app from android iOS to get an E-Card check your policy claim status, Hospital list and more, Give a missed call to 022-4892-6099 from your registered mobile number, or visit www.vidalhealthpa.com,or scan << Qr code on corner >></li>
</ul>
<div >
<img src="../image/logo.png" alt="" width="100px" height="25px" style="object-fit: fill; rotate: -90deg; position: absolute;left: -34px;bottom: 77px;">
</div>
<div style="font-size: 10px;font-weight: bold; line-height: 10px;margin-left: 40px;width: 70%;">
<div><u>24x7 help line no</u> </div>
<div>
<div>
<span>karnataka/andrapradesh/telangana</span><span style="padding: 0px 5px 0px 5px ;">:</span><span style="font-weight: 400;">080-46267018/1860425051</span>
</div>
<div>
<span>North and east region/gujarat</span><span style="padding: 0px 5px 0px 5px ;">:</span><span style="font-weight: 400;">080-46267021/18604250261</span>
</div>
<div>
<span>Maharastra</span><span style="padding: 0px 5px 0px 5px ;">:</span><span style="font-weight: 400;">080-46267020/18604250254</span>
</div>
<div>
<span>Tamil Nadu</span style="padding: 0px 5px 0px 5px ;">:<span></span><span style="font-weight: 400;">080-46267020/18604250254</span>
</div>
<div>
<span>Kerala</span><span style="padding: 0px 5px 0px 5px ;">:</span><span style="font-weight: 400;">080-46267019/18604250253</span>
</div>
<div>
<span>S.R citizen</span><span style="padding: 0px 5px 0px 5px ;">:</span><span style="font-weight: 400;">080-4626-7070</span>
</div>
<div>
<span style="font-weight: 400;">vidal health insurance <b>TPA</b> pvt limited,tower no 2,</span>
<br>
<span style="font-weight: 400;">First Floor,<b>SJR </b>ipark,<b>EPIP </b>zone ,whitefield,bangalore,</span>
<br>
</div>
<div>
<span style="font-weight: 400;"><b>email:</b>helpvidalhealthpa@gmail.com</span><span style="padding: 0px 5px 0px 5px ;">/</span><span style="font-weight: 400;"><b>website:</b>WWW.vidalhealthp.com</span>
</div>
</div>
</div>
</div>
</div>
</body>
<div><img src="../image/2-play store.png" alt="" width="80px" height="80px" style="position: absolute;top: 158px; right: 90px;"></div>
<div><img src="../image/2-appstore.png" alt="" width="76px" height="80px" style="position: absolute;right: 10px;top:158px;"></div>
</div>
</div>
</body>