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/**/*.db
writable/**/*.sqlite writable/**/*.sqlite
writable/e_card_template/*
!writable/e_card_template/.gitkeep
vendor/ vendor/
build/ 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('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->group("/user", ["filter" => "authMVC"], function ($routes) {
$routes->post("create", "UserController::create"); $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("id-card", "EmployeeController::viewECard/$1");
$routes->get("preview-card/(:any)", "EmployeeController::previewTemplate/$1"); $routes->get("preview-card/(:any)", "EmployeeController::previewTemplate/$1");
$routes->get("export-import-error-list/(:any)", "EmployeeController::errorListExportImport/$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'); $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_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['policy_end_date'] = change_date_format($this->request->getPost('policy_end_date'), 'd-m-Y', 'Y-m-d');
$data['created_by'] = get_session_userid(); $data['created_by'] = get_session_userid();
@ -696,6 +697,7 @@ class ClientController extends AdminController
$data['tpa_id'] = $tpaId; $data['tpa_id'] = $tpaId;
$data['policy_id'] = $this->request->getPost('policy_id'); $data['policy_id'] = $this->request->getPost('policy_id');
$data['policy_type_id'] = $this->request->getPost('policy_type_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_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['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); // dd($data);
$data['updated_by'] = get_session_userid(); $data['updated_by'] = get_session_userid();
// print_r($data);die;
$insert = $this->clientPolicyModel->update($id,$data); $insert = $this->clientPolicyModel->update($id,$data);
$lastQuery = $this->clientPolicyModel->getLastQuery(); $lastQuery = $this->clientPolicyModel->getLastQuery();
@ -767,18 +770,18 @@ class ClientController extends AdminController
$policy_type = $this->request->getPost('policy_type'); $policy_type = $this->request->getPost('policy_type');
$client_id = $this->request->getPost('client_id'); $client_id = $this->request->getPost('client_id');
$client_policy_id = $this->request->getPost('client_policy_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) { if (!empty($client_id) && $client_id != null) {
$client_policy_data = $this->clientPolicyModel->where('id', $client_policy_id)->first(); $client_policy_data = $this->clientPolicyModel->where('id', $client_policy_id)->first();
$client_id = $client_policy_data['client_id']; $client_id = $client_policy_data['client_id'];
} }
$policy_grid_id = $this->request->getPost('policy_grid_id'); $policy_grid_id = $this->request->getPost('policy_grid_id');
if($policy_grid_id == 10 || $policy_grid_id == 11){ // if($policy_grid_id == 10 || $policy_grid_id == 11){
$premium_type = 1; // $premium_type = 1;
}else{ // }else{
$premium_type = 2; // $premium_type = 2;
} // }
$si_or_bp = $this->request->getPost('si_or_bp'); $si_or_bp = $this->request->getPost('si_or_bp');
$basic_multiplier = str_replace(',', '', $this->request->getPost('basic_multiplier')); $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") ->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.client_id", $record['client_id'])
->where("employees.emp_status", 'active') ->where("employees.emp_status", 'active')
->where("ep.status", 'active')
->where("employees.is_active", 1)
->where("ep.is_active", 1)
->countAllResults(); ->countAllResults();
$data = $this->employeePolicyModel->select('employee_polices.id') // $data = $this->employeePolicyModel->select('employee_polices.id')
->where('employee_polices.is_active', 1) // ->where('employee_polices.is_active', 1)
->where('employee_polices.client_policy_id', $client_policy_id) // ->where('employee_polices.client_policy_id', $client_policy_id)
->findAll(); // ->findAll();
$emp_count = count($data); // $emp_count = count($data);
// if($emp_count == 0){ // if($emp_count == 0){
// $emp_count = true; // $emp_count = true;
@ -1173,24 +1179,25 @@ class ClientController extends AdminController
if ($search_term === 'GMC') { if ($search_term === 'GMC') {
$resultss = []; // $resultss = [];
$resultss = $results;
try { // try {
foreach ($results as $index => $record) { // 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 ($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 ($family_floater == 1) {
if ($index == '7' || $index == '8' || $index == '9' || $index == '10') { // if ($index == '7' || $index == '8' || $index == '9' || $index == '10') {
$resultss[$index] = $record; // $resultss[$index] = $record;
} // }
} else { // } else {
if ($index == '0' || $index == '1' || $index == '2' || $index == '3' || $index == '4' || $index == '5' || $index == '6') { // if ($index == '0' || $index == '1' || $index == '2' || $index == '3' || $index == '4' || $index == '5' || $index == '6') {
$resultss[$index] = $record; // $resultss[$index] = $record;
} // }
} // }
} // }
} catch (\Exception $e) { // } catch (\Exception $e) {
$resultss = $results; // Reset $resultss to an empty array if an exception occurs // $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['corporatebuffer'] = $this->request->getPost("corporatebuffer") ? $this->request->getPost("corporatebuffer") : 0;
$data['family_floaters'] = $this->request->getPost("family_floaters") ?? []; $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']['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']['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; $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']['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']['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']['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; $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"); $data['waiverofpreexistingdiseases'] =$this->request->getPost("waiverofpreexistingdiseases");
if ($data['waiverofpreexistingdiseases'] == 1) { if ($data['waiverofpreexistingdiseases'] == 1) {
$data['maternitycoverage'] =str_replace(',', '',$this->request->getPost("maternitycoverage")); $data['maternitycoverage'] =str_replace(',', '',$this->request->getPost("maternitycoverage"));

View File

@ -7,12 +7,22 @@ use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface; use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use CodeIgniter\API\ResponseTrait;
use App\Models\MessageModel;
use App\Models\UserMessageModel;
class DashboardController extends AdminController class DashboardController extends AdminController
{ {
use ResponseTrait;
protected $messageModel;
protected $userMessageModel;
public function __construct() public function __construct()
{ {
$this->messageModel = new MessageModel();
$this->userMessageModel = new UserMessageModel();
} }
public function dashboard() public function dashboard()
@ -22,11 +32,26 @@ class DashboardController extends AdminController
echo view('layout/footer'); echo view('layout/footer');
} }
public function dashboardNotifications() public function getDashboardNotifications()
{ {
//pull notofications to dashboard especially for file upload cases //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\EmpEndorsementModel;
use App\Models\ClientDepositModel; use App\Models\ClientDepositModel;
use App\Models\NotificationModel; use App\Models\NotificationModel;
use App\Models\MessageModel;
use App\Models\UserMessageModel;
use App\Controllers\Jobs; use App\Controllers\Jobs;
use App\Controllers\JobWorker; use App\Controllers\JobWorker;
@ -48,6 +50,8 @@ class EmpDataServiceController extends BaseController
protected $empEndorsementModel; protected $empEndorsementModel;
protected $clientDepositModel; protected $clientDepositModel;
protected $notificationModel; protected $notificationModel;
protected $messageModel;
protected $userMessageModel;
public function __construct() public function __construct()
{ {
@ -64,6 +68,8 @@ class EmpDataServiceController extends BaseController
$this->empEndorsementModel = new EmpEndorsementModel(); $this->empEndorsementModel = new EmpEndorsementModel();
$this->clientDepositModel = new ClientDepositModel(); $this->clientDepositModel = new ClientDepositModel();
$this->notificationModel = new NotificationModel(); $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->batchFileModel->where('id', $file_id)->set($data)->update();
$this->myLogger->logme('error', 'importInceptionFileValidation TPAID already updated'); $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') { } else if ($insurer_or_tpa == 'insurer') {
@ -649,7 +658,10 @@ class EmpDataServiceController extends BaseController
$this->batchFileModel->where('id', $file_id)->set($data)->update(); $this->batchFileModel->where('id', $file_id)->set($data)->update();
$this->myLogger->logme('error', 'importInceptionFileValidation UHID already updated'); $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'); $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->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]); $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') { 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') { } 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(); $job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'importInceptionUpdateTPAandUHID','payload' => ['file_id' => $file_id]]); $r = Jobs::addJob(['job_name' => 'importInceptionUpdateTPAandUHID','payload' => ['file_id' => $file_id]]);
// $this->importInceptionUpdateTPAandUHID(['file_id' => $file_id]); // $this->importInceptionUpdateTPAandUHID(['file_id' => $file_id]);
} }
@ -938,6 +960,7 @@ class EmpDataServiceController extends BaseController
$file_id = $params['file_id']; $file_id = $params['file_id'];
$file = $this->batchFileModel->find($file_id); $file = $this->batchFileModel->find($file_id);
if (!$file) { if (!$file) {
$data = [ $data = [
'status' => 'failed-4', 'status' => 'failed-4',
]; ];
@ -945,7 +968,10 @@ class EmpDataServiceController extends BaseController
$this->batchFileModel->where('id', $file_id)->set($data)->update(); $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]); $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']; $client_id = $file['client_id'];
@ -955,6 +981,15 @@ class EmpDataServiceController extends BaseController
$batch_code = $file['batch_code']; $batch_code = $file['batch_code'];
$user_id = $file['created_by']; $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'; $status_val = 'success';
if ($status == 'in-progress-partially') { if ($status == 'in-progress-partially') {
@ -970,16 +1005,21 @@ class EmpDataServiceController extends BaseController
array_pop($excel_data); // Remove footer row array_pop($excel_data); // Remove footer row
$totals = 0; $totals = 0;
$empty_emp_tpa_uh_ids = []; $emp_policy_ids = [];
$emp_details = [];
$tpa_id = [];
$uhid = [];
$emp_count = count($excel_data); $emp_count = count($excel_data);
$db = \Config\Database::connect(); $db = \Config\Database::connect();
foreach ($excel_data as $key => $value) { foreach ($excel_data as $key => $value) {
$name = $value[1]; $name = $value[1];
$emp_code = $value[2]; $emp_code = $value[2];
$tpa_id = $value[15]; $tpa_id[] = $value[15];
$uhid = $value[16]; $uhid[] = $value[16];
$amount = $value[20]; $amount = $value[20];
$totals += $amount; $totals += $amount;
@ -1006,38 +1046,41 @@ class EmpDataServiceController extends BaseController
// Get the result // Get the result
$result = $query->get()->getRowArray(); $result = $query->get()->getRowArray();
if (isset($result['id']) && $result['id'] !== null) { 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 = " // $sql = "
UPDATE employee_polices // UPDATE employee_polices
JOIN employees ON employees.id = employee_polices.employee_id // JOIN employees ON employees.id = employee_polices.employee_id
SET tpa_id = ? // SET tpa_id = ?
WHERE employees.name = ? // WHERE employees.name = ?
AND employees.emp_code = ? // AND employees.emp_code = ?
AND employee_polices.client_policy_id = ? // AND employee_polices.client_policy_id = ?
AND (employee_polices.tpa_id IS NULL OR employee_polices.tpa_id = '')"; // AND (employee_polices.tpa_id IS NULL OR employee_polices.tpa_id = '')";
$params = [$tpa_id, $name, $emp_code, $client_policy_id]; // $params = [$tpa_id, $name, $emp_code, $client_policy_id];
$db->query($sql, $params); // $db->query($sql, $params);
$sql = " // $sql = "
UPDATE employee_polices // UPDATE employee_polices
JOIN employees ON employees.id = employee_polices.employee_id // JOIN employees ON employees.id = employee_polices.employee_id
SET employee_polices.uhid = ? // SET employee_polices.uhid = ?
WHERE employees.name = ? // WHERE employees.name = ?
AND employees.emp_code = ? // AND employees.emp_code = ?
AND employee_polices.client_policy_id = ? // AND employee_polices.client_policy_id = ?
AND (employee_polices.uhid IS NULL OR employee_polices.uhid = '')"; // AND (employee_polices.uhid IS NULL OR employee_polices.uhid = '')";
$params = [$uhid, $name, $emp_code, $client_policy_id]; // $params = [$uhid, $name, $emp_code, $client_policy_id];
$db->query($sql, $params); // $db->query($sql, $params);
} }
$return = $this->employeePolicyModel->bulkUpdate($emp_details);
// Update batch file status and amount // Update batch file status and amount
$this->batchFileModel->update($file_id, [ $this->batchFileModel->update($file_id, [
'count' => $emp_count, 'count' => $emp_count,
@ -1057,7 +1100,7 @@ class EmpDataServiceController extends BaseController
$policy_name = $this->getPolicyNameUsingClientPolicyId($client_policy_id); $policy_name = $this->getPolicyNameUsingClientPolicyId($client_policy_id);
$depositeData = [ $depositeData = [
'employeeIds' => $empty_emp_tpa_uh_ids, 'employeeIds' => $emp_policy_ids,
'client_id' => $client_id, 'client_id' => $client_id,
'client_policy_id' => $client_policy_id, 'client_policy_id' => $client_policy_id,
'count' => $emp_count, 'count' => $emp_count,
@ -1070,7 +1113,7 @@ class EmpDataServiceController extends BaseController
$job_details = new Jobs(); $job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'cashDepositCalculationForInception','payload' => [ $r = Jobs::addJob(['job_name' => 'cashDepositCalculationForInception','payload' => [
'employeeIds' => $empty_emp_tpa_uh_ids, 'employeeIds' => $emp_policy_ids,
'client_id' => $client_id, 'client_id' => $client_id,
'client_policy_id' => $client_policy_id, 'client_policy_id' => $client_policy_id,
'count' => $emp_count, 'count' => $emp_count,
@ -1079,17 +1122,23 @@ class EmpDataServiceController extends BaseController
'user_id' => $user_id, 'user_id' => $user_id,
]]); ]]);
if($get_policy_type['policy_type_id'] != 1){
$job_details = new Jobs(); $job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'sendMailForDownloadingECard','payload' => $empty_emp_tpa_uh_ids]); $r = Jobs::addJob(['job_name' => 'sendMailForDownloadingECard','payload' => $emp_policy_ids]);
// $this->cashDepositCalculationForInception($depositeData);
// $this->sendMailForDownloadingECard($empty_emp_tpa_uh_ids);
} }
return 1; // $this->cashDepositCalculationForInception($depositeData);
// $this->sendMailForDownloadingECard($emp_policy_ids);
}
$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'); $this->myLogger->logme('error', 'sendMailForDownloadingECard - inside try');
$count = 0; $count = 0;
$counts = 0;
foreach ($ids as $key => $id) { foreach ($ids as $key => $id) {
$get_emp_email_and_other_details = $this->employeePolicyModel $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') ->join('employees', 'employees.id = employee_polices.employee_id')
->where('employees.emp_status', 'active') ->where('employees.emp_status', 'active')
->where('employees.is_active', '1') ->where('employees.is_active', '1')
@ -2091,12 +2142,18 @@ class EmpDataServiceController extends BaseController
$params['notification'] = $notification; $params['notification'] = $notification;
$params['notification'] = $notification; $params['notification'] = $notification;
$params['get_emp_email_and_other_details'] = $get_emp_email_and_other_details; $params['get_emp_email_and_other_details'] = $get_emp_email_and_other_details;
// $this->myLogger->logme('error', 'sendMailForDownloadingECard - Send Bulk Mail function end ',);
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); $wholeData[] = sendMailNotification::sendMailNotification('member_ecard_mail', $params);
$count++; $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',);
@ -2104,6 +2161,9 @@ class EmpDataServiceController extends BaseController
$r = Jobs::addJob(['job_name' => 'bulk_mail', 'payload' => $wholeData]); $r = Jobs::addJob(['job_name' => 'bulk_mail', 'payload' => $wholeData]);
$wholeData = []; $wholeData = [];
$count = 0; $count = 0;
}
} }
$this->myLogger->logme('error', 'sendMailForDownloadingECard - Send Bulk Mail function end ',); $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\EmployeeModel;
use App\Models\EmployeePolicyModel; use App\Models\EmployeePolicyModel;
use App\Models\ClientModel; use App\Models\ClientModel;
use App\Models\PolicesModel;
use App\Models\FileModel; use App\Models\FileModel;
use App\Models\BatchListModel; use App\Models\BatchListModel;
use App\Models\BatchFileModel; use App\Models\BatchFileModel;
@ -49,6 +50,7 @@ class EmployeeController extends AdminController
protected $empEndorsementModel; protected $empEndorsementModel;
protected $clientPolicyModel; protected $clientPolicyModel;
protected $TPAModel; protected $TPAModel;
protected $policiesModel;
public function __construct() public function __construct()
{ {
@ -64,6 +66,7 @@ class EmployeeController extends AdminController
$this->empEndorsementModel = new EmpEndorsementModel(); $this->empEndorsementModel = new EmpEndorsementModel();
$this->clientPolicyModel = new ClientPolicyModel(); $this->clientPolicyModel = new ClientPolicyModel();
$this->TPAModel = new TPAModel(); $this->TPAModel = new TPAModel();
$this->policiesModel = new PolicesModel();
} }
public function list() public function list()
@ -213,13 +216,40 @@ class EmployeeController extends AdminController
$data['import_or_export'] = ['import' => 'Import', 'export' => 'Export']; $data['import_or_export'] = ['import' => 'Import', 'export' => 'Export'];
$data['insurer_or_tpa'] = ['insurer' => 'Insurer', 'tpa' => 'TPA']; $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 $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']) ->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('user_profiles up', 'files.created_by = up.id')
->join('client_policy cp', 'files.policy_id = cp.id', 'left') ->join('client_policy cp', 'files.policy_id = cp.id', 'left')
->join('policies pm', 'cp.policy_id = pm.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') ->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(); ->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') $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') ->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'])), '{DOB}' => date('d-M-Y', strtotime($value['dob'])),
'{SELF_NAME}' => $value['self'] ?? $value['name'], '{SELF_NAME}' => $value['self'] ?? $value['name'],
'{POLICY_DATE}' => date('d-M-Y', strtotime($value['policy_end_date'])), '{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'], '{INSURER_LOGO}' => base_url() . 'public/uploads/logo/' . $value['insurer_logo'],
'{FRONT_CARD}' => base_url() . 'public/uploads/template_bg/' . $value['front_card'], '{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'], '{EMP_ID}' =>$value['emp_code'],
'{CORPORATE_NAME}' =>$value['client_name'], '{CORPORATE_NAME}' =>$value['client_name'],
'{AGE}' =>$value['emp_age'], '{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 // Replace placeholders with values in HTML content
@ -1033,7 +1068,30 @@ 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(); $tpa_id = $this->TPAModel->where('id', $id)->first();
@ -1051,8 +1109,26 @@ class EmployeeController extends AdminController
$tmplt_data = file_get_contents($final_path); $tmplt_data = file_get_contents($final_path);
$placeholders = [ $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'], '{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 // Get the values to replace the placeholders
@ -1066,8 +1142,6 @@ class EmployeeController extends AdminController
echo $htmlContent; echo $htmlContent;
} }
@ -1147,4 +1221,29 @@ class EmployeeController extends AdminController
echo view('export_import_error_list', $excelErrorData); 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) { if (isset($notification) && $notification['enabled'] == 1) {
//trigger //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['dataToInsert'] = $dataToInsert[$a];
$params['notification'] = $notification; $params['notification'] = $notification;
@ -887,14 +887,13 @@ class EmployeeRestController extends AdminController
$count++; $count++;
} }
if($count == 20 || $a == count($dataToInsert)-1){ if($count == 20 || $a == count($dataToInsert)-1){
if (count($wholeData) > 0) {
$job_details = new Jobs(); $job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'bulk_mail','payload' => $wholeData]); $r = Jobs::addJob(['job_name' => 'bulk_mail','payload' => $wholeData]);
// $wholeData[]= $r;
// Mailhelper::bulk_mail($wholeData);
$wholeData = []; $wholeData = [];
$count = 0; $count = 0;
} }
}
// if ($dataToInsert[$a]['email_corporate'] != null || $dataToInsert[$a]['email_corporate'] != '' && $dataToInsert[$a]['relationship'] == 'Self') { // if ($dataToInsert[$a]['email_corporate'] != null || $dataToInsert[$a]['email_corporate'] != '' && $dataToInsert[$a]['relationship'] == 'Self') {

View File

@ -15,6 +15,7 @@ use App\Models\ClientPolicyModel;
use App\Models\PolicesModel; use App\Models\PolicesModel;
use App\Models\FileModel; use App\Models\FileModel;
use App\Models\EmpEndorsementModel; use App\Models\EmpEndorsementModel;
use App\Models\MessageModel;
use App\Controllers\Jobs ; use App\Controllers\Jobs ;
use App\Controllers\JobWorker ; use App\Controllers\JobWorker ;
@ -33,6 +34,7 @@ class EmployeeServiceController extends AdminController
protected $clientPolicyModel; protected $clientPolicyModel;
protected $policiesModel; protected $policiesModel;
protected $empEndorsementModel; 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 $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]]; 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->clientPolicyModel = new ClientPolicyModel();
$this->policiesModel = new PolicesModel(); $this->policiesModel = new PolicesModel();
$this->empEndorsementModel = new EmpEndorsementModel(); $this->empEndorsementModel = new EmpEndorsementModel();
$this->messageModel = new MessageModel();
} }
public function excelFileFormatValidation($params) public function excelFileFormatValidation($params)
@ -143,7 +146,7 @@ class EmployeeServiceController extends AdminController
$policy_details = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']); $policy_details = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']);
$policy_terms = json_decode($policy_details[0]->policy_terms); $policy_terms = json_decode($policy_details[0]->policy_terms);
$policy_terms = (array) $policy_terms;// convert obj to array $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); // dd($default_age_ratio);
@ -271,6 +274,9 @@ class EmployeeServiceController extends AdminController
$failure_reason = ((json_encode($result))); $failure_reason = ((json_encode($result)));
$this->fileModel->where('id', $file_id)->set(['status' => $status,'reason' => $failure_reason])->update(); $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]); $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 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']); $res = check_self_available_in_family($family,$file['action']);
// dd($res); // dd($res);
if(!$res['is_self_found']) if(!$res['is_self_found'])
{ {
array_push($result['error_summary'],14); // Self not 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 //check self avaialbe where self data is not available either same policy (i.e.) gMC parents
if($policy_details['policy_type_id'] == 3) // 3 is GMC parents (base policy or dep addon) 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']); $self_details = $this->employeeModel->getEmpFamilybyEmpCode(emp_code: $emp_id,client_id: $file['client_id'],emp_status: ['active'],policy_status:['active']);
// dd($self_details); // dd($self_details);
if(!count($self_details)) if(!count($self_details))
{ {
array_push($result['error_summary'],14); // Self not found 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))); $failure_reason = ((json_encode($result)));
$this->fileModel->where('id', $file_id)->set(['status' => $status,'reason' => $failure_reason])->update(); $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]); $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); //set failure msg to pull notifications
// dd($failure_reason); $this->setPullNotification($this->getFileMetaDataByFileId($file_id,'failure'));
} }
else if($file['action'] == 'deletion') 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->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]); $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 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->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]); $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; return $endorsement_data;
} }
@ -768,6 +781,8 @@ class EmployeeServiceController extends AdminController
} }
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update(); $this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]); $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; return true;
} }
@ -838,6 +853,8 @@ class EmployeeServiceController extends AdminController
} }
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update(); $this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]); $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; 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(); //die();
$job_status = self::STATUS_FAILED; $job_status = self::STATUS_FAILED;
$runtime = $runtime === null ? microtime(true) - $start : $runtime; $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=?", [ $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 class SubJob extends PublicController
{ {
protected $myLogger;
public function __construct()
{
$this->myLogger = \Config\Services::mylogger();
}
public function handle($payload) 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']; return $payload['a'] - $payload['b'];
} }

View File

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

View File

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

View File

@ -7,20 +7,458 @@ use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface; use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface; 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 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() 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() public function getPendingActions()
{ {
//get pending actions like inception, corrections,deletions,SI enhanccnement to users //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

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

View File

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

View File

@ -731,6 +731,7 @@ class EmployeePolicyModel extends Model
clients.short_name AS client_short_name, clients.short_name AS client_short_name,
cp.policy_start_date, cp.policy_start_date,
cp.policy_no,
policies.name AS policy_name, 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; $premium_slab_data = null;
$grid_type = null;
$policyPremium1Model = new PolicyPremium1Model(); $policyPremium1Model = new PolicyPremium1Model();
$premium_slab_data = $policyPremium1Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll(); $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(); $premium_slab_data = $policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
} }
if(isset($premium_slab_data[0]['policy_grid_id']))
{
$grid_id = $premium_slab_data[0]['policy_grid_id']; $grid_id = $premium_slab_data[0]['policy_grid_id'];
$policyGridModel = new PolicyGridModel(); $policyGridModel = new PolicyGridModel();
$results = $policyGridModel->find($grid_id); $grid_type = $policyGridModel->find($grid_id);
return ['slab_rates' => $premium_slab_data,'grid_master' => $results]; }
return ['slab_rates' => $premium_slab_data,'grid_master' => $grid_type];
} }
} }

View File

@ -15,6 +15,7 @@ class TPAModel extends Model
"front_card", "front_card",
"back_card", "back_card",
"tpa_logo", "tpa_logo",
"network_hospitals",
"created_by", "created_by",
"updated_by", "updated_by",
"is_active", "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

@ -2,6 +2,10 @@
.table-responsive { .table-responsive {
overflow-x: auto; overflow-x: auto;
} }
.reload:hover {
cursor: pointer;
}
</style> </style>
<div class="col-12"> <div class="col-12">
@ -18,16 +22,17 @@
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">SNO</th> <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">File Name</th>
<th class="font-weight-medium">Client</th> <th class="font-weight-medium">Client</th>
<th class="font-weight-medium">Client Policy</th> <th class="font-weight-medium">Client Policy</th>
<th class="font-weight-medium">Event Type</th> <th class="font-weight-medium">Event <br> Type</th>
<th class="font-weight-medium">Insurer/TPA</th> <th class="font-weight-medium">Insurer/ <br> TPA</th>
<th class="font-weight-medium">Action</th> <th class="font-weight-medium">Action</th>
<th class="font-weight-medium">Count</th> <th class="font-weight-medium">Count</th>
<th class="font-weight-medium">Amount</th> <th class="font-weight-medium">()Amount</th>
<th class="font-weight-medium">status</th> <th class="font-weight-medium">User/Time</th>
<th class="font-weight-medium">Status</th>
</tr> </tr>
</thead> </thead>
@ -40,30 +45,50 @@
<tr> <tr>
<td><b><?php echo ($key + 1) ?></b></td> <td><b><?php echo ($key + 1) ?></b></td>
<td><?php echo $file['batch_code'] ?></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 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['client_short_name'] ?></td>
<td><?php echo $file['policy_name'] ?></td> <td><?php echo $file['policy_name'] ?></td>
<td><?php echo $file['event_type'] ?></td> <td><?php echo $file['event_type'] ?></td>
<td><?php echo $file['insurer_or_tpa'] ?></td> <td><?php echo $file['insurer_or_tpa'] ?></td>
<td><?php echo $file['actions'] ?></td> <td><?php echo $file['actions'] ?></td>
<td><?php echo $file['count'] ?></td> <td><?php echo $file['count'] ?></td>
<td><?php echo intval($file['amount']) ?></td>
<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> <td>
<?php if ($file['status'] == 'failed') { ?> <?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 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 } else if ($file['status'] == 'partially success') { ?>
<?php echo $file['status']; ?> <?php echo $file['status']; ?>
<?php if ($file['error_data'] != 0) { ?> <?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> <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top" title="<?= $file['error_data'] ?>"></a>
<?php } ?> <?php } ?>
<?php } else if ($file['status'] == 'failed-1') { ?> <?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> 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') { ?> <?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> 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') { ?> <?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> 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') { ?> <?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> failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top" title="Physical File Not Found."></a>
<?php } else { ?> <?php } else { ?>
<?php echo $file['status']; ?> <?php echo $file['status']; ?>
<?php } ?> <?php } ?>
@ -109,3 +134,44 @@
}); });
</script> </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>
<div class="form-group col-md-4" id="base_policy_id" style="display: none;"> <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"> <select class="form-control" id="base_policy" name="base_policy">
<option value="" selected>Select Base Policy</option> <option value="" selected>Select Base Policy</option>
</select> </select>
@ -92,15 +92,19 @@
</div> </div>
<div class="form-row" id="second" style="display: none;"> <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> <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> <input value="" type="text" class="form-control" placeholder="Enter Start Date " name="policy_start_date" id="start_date" required>
</div> </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> <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> <input value="" type="text" class="form-control" placeholder="Enter End Date " name="policy_end_date" id="end_date" required>
</div> </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> <label for="policy_status">Policy Status</label>
<input value="" type="text" class="form-control" placeholder="Policy Status" id="policy_status" readonly> <input value="" type="text" class="form-control" placeholder="Policy Status" id="policy_status" readonly>
</div> </div>
@ -196,6 +200,7 @@
$('.btnAdd').hide(); $('.btnAdd').hide();
$('#insurer').val('').change(); $('#insurer').val('').change();
$('#tpa').val('').change(); $('#tpa').val('').change();
$('#policy_no').val('').change();
$('#start_date').val('').change(); $('#start_date').val('').change();
$('#end_date').val('').change(); $('#end_date').val('').change();
$('#policy').html('<option value="" selected>Select Policy</option>').change(); $('#policy').html('<option value="" selected>Select Policy</option>').change();
@ -222,6 +227,7 @@
$('.btnAdd').show(); $('.btnAdd').show();
$('#insurer').val('').change(); $('#insurer').val('').change();
$('#tpa').val('').change(); $('#tpa').val('').change();
$('#policy_no').val('').change();
$('#start_date').val('').change(); $('#start_date').val('').change();
$('#end_date').val('').change(); $('#end_date').val('').change();
$('#policy').html('<option value="" selected>Select Policy</option>'); $('#policy').html('<option value="" selected>Select Policy</option>');
@ -461,6 +467,7 @@
$('#insurer').val(''); $('#insurer').val('');
$('#tpa').val(''); $('#tpa').val('');
$('#policy_no').val('');
$('#start_date').val(''); $('#start_date').val('');
$('#end_date').val(''); $('#end_date').val('');
$('#policy').html('<option value="" selected>Select Policy</option>'); $('#policy').html('<option value="" selected>Select Policy</option>');
@ -605,7 +612,8 @@
var displayStatus = $('#base_policy_id').css('display'); var displayStatus = $('#base_policy_id').css('display');
$('#base_policy_id').show(); $('#base_policy_id').show();
$('#base_policy').prop('required', true); $('#base_danger').hide();
// $('#base_policy').prop('required', true);
if (displayStatus === 'none') { if (displayStatus === 'none') {
console.log('step 2.1') console.log('step 2.1')
@ -621,7 +629,8 @@
var displayStatus = $('#base_policy_id').css('display'); var displayStatus = $('#base_policy_id').css('display');
$('#base_policy_id').hide(); $('#base_policy_id').hide();
$('#base_policy').prop('required', false); $('#base_danger').show();
// $('#base_policy').prop('required', false);
if (displayStatus === 'none') { if (displayStatus === 'none') {
console.log('step 3.1') console.log('step 3.1')
@ -648,7 +657,7 @@
dataType: 'json', dataType: 'json',
success: function(res) { success: function(res) {
console.log(res) console.log('client_policy_res', res)
setTimeout(function() { setTimeout(function() {
$('.loader').fadeOut(); $('.loader').fadeOut();
@ -681,6 +690,7 @@
$('#policy_type_id').val(res.data.policy_type_id); $('#policy_type_id').val(res.data.policy_type_id);
$('#policy_PrimaryKey').val(res.data.id); $('#policy_PrimaryKey').val(res.data.id);
$('#policy_no').val(res.data.policy_no);
$('#start_date').val(rearrangeDateFormat(res.data.policy_start_date)); $('#start_date').val(rearrangeDateFormat(res.data.policy_start_date));
$('#end_date').val(rearrangeDateFormat(res.data.policy_end_date)); $('#end_date').val(rearrangeDateFormat(res.data.policy_end_date));
$('#policy_status').val(checkDateStatus(res.data.policy_end_date)); $('#policy_status').val(checkDateStatus(res.data.policy_end_date));
@ -1254,10 +1264,12 @@
$('#insurer').val('').change(); $('#insurer').val('').change();
$('#tpa').val('').change(); $('#tpa').val('').change();
$('#policy_no').val('');
$('#start_date').val(''); $('#start_date').val('');
$('#end_date').val(''); $('#end_date').val('');
$('#base_policy').val('').change(); $('#base_policy').val('').change();
if ($(this).val() == 2 || $(this).val() == 3) { if ($(this).val() == 2 || $(this).val() == 3) {
$("#insurer").next(".select2-container").css({ $("#insurer").next(".select2-container").css({
@ -1273,6 +1285,12 @@
$('#select2-tpa-container').css({ $('#select2-tpa-container').css({
'background-color': '#ebebe0', 'background-color': '#ebebe0',
}); });
var baseDanger = $('#base_danger');
if (baseDanger.css('display') === 'none') {
baseDanger.show();
}
} else { } else {
$("#insurer").next(".select2-container").css({ $("#insurer").next(".select2-container").css({
@ -1426,6 +1444,7 @@
$('#insurer').val(res.data.insurer_branch_id + '-' + res.data.insurer_id).change(); $('#insurer').val(res.data.insurer_branch_id + '-' + res.data.insurer_id).change();
$('#tpa').val(res.data.tpa_branch_id + '-' + res.data.tpa_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(); $('#start_date').val(rearrangeDateFormat(res.data.policy_start_date)).change();
$('#end_date').val(rearrangeDateFormat(res.data.policy_end_date)).change(); $('#end_date').val(rearrangeDateFormat(res.data.policy_end_date)).change();

View File

@ -1,5 +1,4 @@
<style> <style>
.badge2 { .badge2 {
box-shadow: none; box-shadow: none;
} }
@ -21,7 +20,6 @@
border-radius: .25rem; 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; 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> </style>
<div class="row" id="client_list"> <div class="row" id="client_list">
@ -42,13 +40,17 @@
<!-- <th class="font-weight-medium">Employee code</th> --> <!-- <th class="font-weight-medium">Employee code</th> -->
<th class="font-weight-medium">Name/code</th> <th class="font-weight-medium">Name/code</th>
<th class="font-weight-medium">Policy name</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">TPA ID</th>
<th class="font-weight-medium">UHID</th> <th class="font-weight-medium">UHID</th>
<th class="font-weight-medium">Policy status</th> <th class="font-weight-medium">Policy <br> status</th>
<th class="font-weight-medium">Sum Insured</th> <th class="font-weight-medium">()Sum Insured</th>
<th class="font-weight-medium">Premium</th> <th class="font-weight-medium">()Premium</th>
<th class="font-weight-medium">Action</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> </tr>
</thead> </thead>
@ -60,8 +62,8 @@
<tr> <tr>
<td><b><?php echo ($key + 1)?></b></td> <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><?php echo $employee['name']?>( <?php echo $employee['emp_code']?> )</td> <?php echo $employee['relationship']?> )</td>
<td><?php echo $employee['policy_name']?></td> <td><?php echo $employee['policy_name']?></td>
<td><?php echo $employee['insurer_short_name']?></td> <td><?php echo $employee['insurer_short_name']?></td>
<td><?php echo $employee['tpa_id']?></td> <td><?php echo $employee['tpa_id']?></td>
@ -83,9 +85,11 @@
} }
?> ?>
</td> </td>
<td> <?php echo $employee['basic_cover_si']?> </td> <td class="indian-number"> <?php echo $employee['basic_cover_si']?> </td>
<td><?php echo $employee['premium']?></td> <td class="indian-number"><?php echo $employee['premium']?></td>
<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"> <div class="btn-group dropdown">
<a href="javascript: void(0);" <a href="javascript: void(0);"
class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"
@ -103,20 +107,39 @@
Unread</a> Unread</a>
</div> </div>
</div> </div>
</td> </td> -->
</tr> </tr>
<?php }}?> <?php }}?>
</tbody> </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> </table>
</div> </div>
</div> </div>
</div><!-- end col --> </div><!-- end col -->
</div> </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> <script>
$(document).ready(function() { $(document).ready(function() {
$('#tickets-table').DataTable({ $('#tickets-table').DataTable({
@ -147,5 +170,67 @@ $(document).ready(function(){
}); });
}); });
</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
});
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> </script>

View File

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

View File

@ -38,7 +38,7 @@ option:disabled {
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label>Policy</label> <br /> <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> <option value="0">Select</option>
</select> </select>
</div> </div>
@ -166,11 +166,15 @@ $(document).ready(function() {
// Initialize select2 // Initialize select2
$("#client_id").select2(); $("#client_id").select2();
$("#policy_id").select2(); $("#policy_id").select2();
}); });
// Declare a global variable to store API response data // Declare a global variable to store API response data
var clientPolicies = []; var clientPolicies = [];
var client_id_param = 0;
var client_policy_param = 0;
$(document).ready(function() { $(document).ready(function() {
console.log("document loaded"); console.log("document loaded");
@ -278,8 +282,42 @@ $(document).ready(function() {
}); });
$(window).on("load", function() { $(window).on("load", function() {
console.log("window loaded"); console.log("window loaded");
fetchClientPolicies(); 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); clientPolicies = (response.data);
// console.log(clientPolicies); // console.log(clientPolicies);
appendClients(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) { } catch (error) {
console.error('Error parsing API response data:', error); console.error('Error parsing API response data:', error);
} }
@ -462,26 +514,38 @@ function fetchFileError(file_id) {
function appendClients(data) { function appendClients(data) {
console.log('client_id_param', client_id_param)
$.each(data, function(index, item) { $.each(data, function(index, item) {
$('#client_id').append($('<option>', { var option = $('<option>', {
value: item.id, value: item.id,
text: item.client_name text: item.client_name
})); });
if (client_id_param == item.id) {
option.attr('selected', true);
}
$('#client_id').append(option);
}); });
} }
function appendPolicies(data) { function appendPolicies(data) {
$('#policy_id').empty(); $('#policy_id').empty();
$('#policy_id').append($('<option>', { $('#policy_id').append($('<option>', {
value: '', value: '0',
text: 'Select' text: 'Select'
})); }));
$.each(data, function(index, item) { $.each(data, function(index, item) {
$('#policy_id').append($('<option>', { var option = $('<option>', {
value: item.id, 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) { function fetchEmpolyeeList(event) {
event.preventDefault(); // Prevent default action event.preventDefault(); // Prevent default action
var client_id = $('#client_id').val(); 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> </script>

View File

@ -59,10 +59,15 @@
}else if( $file['status'] == 'inprogress'){ }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{ }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> </td>

View File

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

View File

@ -12,11 +12,8 @@
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body">
<!-- <div class="text-center"> --> <!-- <div class="text-center"> -->
<form class="parsley-examples" id="import_export_excel_form" <form class="parsley-examples" id="import_export_excel_form" action="<?php echo base_url() . 'util/import-export' ?>" method="post" enctype="multipart/form-data">
action="<?php echo base_url().'util/import-export'?>" method="post" <input type="hidden" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>" id="csrf_token">
enctype="multipart/form-data">
<input type="hidden" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>"
id="csrf_token">
<div class="form-group"> <div class="form-group">
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
@ -27,7 +24,7 @@
</div> </div>
<div class="form-group col-md-4"> <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> <select name="client_policy_id" class="form-control" id="policy" required>
<option value="">Select</option> <option value="">Select</option>
</select> </select>
@ -35,14 +32,11 @@
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label>Insurer/TPA Data<span class="text-danger">*</span></label> <br /> <label>Insurer/TPA Data<span class="text-danger">*</span></label> <br />
<select name="insurer_or_tpa" class="form-control" id="insurer_or_tpa" <select name="insurer_or_tpa" class="form-control" id="insurer_or_tpa" required>
required>
<option value="">Select</option> <option value="">Select</option>
<?php <?php
if(isset($insurer_or_tpa) && count($insurer_or_tpa)) if (isset($insurer_or_tpa) && count($insurer_or_tpa)) {
{ foreach ($insurer_or_tpa as $key => $action) {
foreach($insurer_or_tpa as $key => $action)
{
echo "<option value=" . $key . ">" . $action . "</option>"; echo "<option value=" . $key . ">" . $action . "</option>";
} }
} }
@ -58,10 +52,8 @@
<select name="action_type" class="form-control" id="action_type" required> <select name="action_type" class="form-control" id="action_type" required>
<option value="">Select</option> <option value="">Select</option>
<?php <?php
if(isset($import_or_export) && count($import_or_export)) if (isset($import_or_export) && count($import_or_export)) {
{ foreach ($import_or_export as $key => $action) {
foreach($import_or_export as $key => $action)
{
echo "<option value=" . $key . ">" . $action . "</option>"; echo "<option value=" . $key . ">" . $action . "</option>";
} }
} }
@ -71,14 +63,11 @@
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label>Event<span class="text-danger">*</span></label> <br /> <label>Event<span class="text-danger">*</span></label> <br />
<select name="event_type" class="form-control" id="upload-action-type" <select name="event_type" class="form-control" id="event_type" required>
required>
<option value="">Select</option> <option value="">Select</option>
<?php <?php
if(isset($events) && count($events)) if (isset($events) && count($events)) {
{ foreach ($events as $key => $action) {
foreach($events as $key => $action)
{
echo "<option value=" . $key . ">" . $action . "</option>"; echo "<option value=" . $key . ">" . $action . "</option>";
} }
} }
@ -93,25 +82,19 @@
<div class="form-row" id="import_excel_btn"> <div class="form-row" id="import_excel_btn">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label>Upload file</label> <label>Upload file</label>
<input type="file" name="import_file_data" id="import_file" <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>
accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet"
required>
</div> </div>
<div class="d-flex align-items-center justify-content-start" <div class="d-flex align-items-center justify-content-start" style="margin-top: 18px;">
style="margin-top: 18px;">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<button id="emp_form_submit_button" type="submit" <button id="emp_form_submit_button" type="submit" class="btn btn-primary waves-effect waves-light justify-content-end">Upload</button>
class="btn btn-primary waves-effect waves-light justify-content-end">Upload</button>
</div> </div>
</div> </div>
</div> </div>
<div class="form-row" id="export_excel_btn"> <div class="form-row" id="export_excel_btn">
<div class="d-flex align-items-center justify-content-start" <div class="d-flex align-items-center justify-content-start" style="margin-top: 18px;">
style="margin-top: 18px;">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<button id="emp_form_submit_button_2" type="submit" <button id="emp_form_submit_button_2" type="submit" class="btn btn-primary waves-effect waves-light justify-content-end">Download</button>
class="btn btn-primary waves-effect waves-light justify-content-end">Download</button>
</div> </div>
</div> </div>
</div> </div>
@ -134,7 +117,6 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
// Initialize select2 // Initialize select2
$("#client").select2(); $("#client").select2();
@ -145,6 +127,9 @@ $(document).ready(function() {
// Declare a global variable to store API response data // Declare a global variable to store API response data
var clientPolicies = []; var clientPolicies = [];
var client_id_param2 = 0;
var client_policy_param2 = 0;
$(document).ready(function() { $(document).ready(function() {
<?php if (session()->has('error')) : ?> <?php if (session()->has('error')) : ?>
@ -229,7 +214,62 @@ $(document).ready(function() {
$(window).on("load", function() { $(window).on("load", function() {
fetchClientPolicies2(); 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();
}
}
}); });
@ -254,6 +294,19 @@ function fetchClientPolicies2() {
clientPolicies = (response.data); clientPolicies = (response.data);
console.log(clientPolicies); console.log(clientPolicies);
appendClients2(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) { } catch (error) {
console.error('Error parsing API response data:', error); console.error('Error parsing API response data:', error);
} }
@ -273,26 +326,39 @@ function fetchClientPolicies2() {
function appendClients2(data) { function appendClients2(data) {
console.log('client_id_param2', client_id_param2)
$.each(data, function(index, item) { $.each(data, function(index, item) {
$('#client').append($('<option>', { var option = $('<option>', {
value: item.id, value: item.id,
text: item.client_name text: item.client_name
})); });
if (client_id_param2 == item.id) {
option.attr('selected', true);
}
$('#client').append(option);
}); });
} }
function appendPolicies2(data) { function appendPolicies2(data) {
$('#policy').empty(); $('#policy').empty();
$('#policy').append($('<option>', { $('#policy').append($('<option>', {
value: '', value: '0',
text: 'Select' text: 'Select'
})); }));
$.each(data, function(index, item) { $.each(data, function(index, item) {
$('#policy').append($('<option>', { var option = $('<option>', {
value: item.id, value: item.id,
text: item.name text: item.name + ' - ' + item.policy_type
})); });
if (client_policy_param2 == item.id) {
option.attr('selected', true);
}
$('#policy').append(option);
}); });
} }
@ -373,5 +439,23 @@ document.getElementById('toggleIcon').addEventListener('click', function() {
icon.classList.toggle('mdi-chevron-up'); icon.classList.toggle('mdi-chevron-up');
}); });
$(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();
}
});
});
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
</script> </script>

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
@ -44,10 +45,6 @@
<link href="<?= base_url() . "public"; ?>/assets/css/jodit.css" rel="stylesheet" type="text/css" /> <link href="<?= base_url() . "public"; ?>/assets/css/jodit.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url()."public"; ?>/assets/libs/quill/quill.snow.css" rel="stylesheet" type="text/css" />
<!-- JQuery CDN --> <!-- JQuery CDN -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
@ -75,22 +72,28 @@
body[data-sidebar-size=condensed]:not([data-layout=compact]):not(.auth-fluid-pages) { body[data-sidebar-size=condensed]:not([data-layout=compact]):not(.auth-fluid-pages) {
min-height: 0; min-height: 0;
} }
.navbar-custom { .navbar-custom {
top: -10px !important; top: -10px !important;
height: 61px !important; height: 61px !important;
} }
.logo-box { .logo-box {
top: -10px !important; top: -10px !important;
height: 61px !important; height: 61px !important;
} }
.content-page { .content-page {
padding: 80px 15px 65px 15px !important; padding: 80px 15px 65px 15px !important;
} }
/* Media query for small screens */ /* Media query for small screens */
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
/* Styles for screens with a minimum width of 768px (e.g., tablets and larger devices) */ /* Styles for screens with a minimum width of 768px (e.g., tablets and larger devices) */
.navbar-custom .button-menu-mobile { .navbar-custom .button-menu-mobile {
display: none; /* Hide the button on larger screens */ display: none;
/* Hide the button on larger screens */
} }
} }
@ -120,9 +123,11 @@
-ms-transform: translateZ(0); -ms-transform: translateZ(0);
transform: translateZ(0); transform: translateZ(0);
} }
.lead { .lead {
font-size: 13px; font-size: 13px;
} }
.loader div { .loader div {
background-color: #6ad9cf; background-color: #6ad9cf;
display: inline-block; display: inline-block;
@ -144,11 +149,13 @@
} }
@-webkit-keyframes ballPulseDouble { @-webkit-keyframes ballPulseDouble {
0%, 0%,
100% { 100% {
-webkit-transform: scale(0); -webkit-transform: scale(0);
transform: scale(0); transform: scale(0);
} }
50% { 50% {
-webkit-transform: scale(1); -webkit-transform: scale(1);
transform: scale(1); transform: scale(1);
@ -156,11 +163,13 @@
} }
@keyframes ballPulseDouble { @keyframes ballPulseDouble {
0%, 0%,
100% { 100% {
-webkit-transform: scale(0); -webkit-transform: scale(0);
transform: scale(0); transform: scale(0);
} }
50% { 50% {
-webkit-transform: scale(1); -webkit-transform: scale(1);
transform: scale(1); transform: scale(1);
@ -201,9 +210,6 @@
flex: 1 1 auto; */ flex: 1 1 auto; */
padding: 2rem !important; padding: 2rem !important;
} }
</style> </style>
<style> <style>
@ -213,13 +219,13 @@
/* color: #02a8b5 !important; */ /* color: #02a8b5 !important; */
font-size: 12px; font-size: 12px;
} }
/* .form-group { /* .form-group {
margin-bottom: -0.2rem !important; margin-bottom: -0.2rem !important;
} }
.form-row{ .form-row{
width: 84%; width: 84%;
} */ } */
</style> </style>
<style> <style>
@ -236,6 +242,54 @@
} }
</style> </style>
<style>
.toast-body {
padding: .75rem;
background: aliceblue !important;
}
#messages-list li {
margin-top: 0;
margin-bottom: -25px;
/* Adjust this value to reduce the space */
}
.toast-footer {
text-align: right;
color: #000;
border-top: 1px solid aliceblue;
margin-top: 11px;
margin-bottom: -6px;
}
.right-bar {
width: 300px;
/* Adjust as needed */
overflow: hidden;
}
.fixed-header {
position: relative;
top: 0;
z-index: 1000;
background-color: #f8f9fa !important;
}
.scrollable-content {
max-height: 42vh;
overflow-y: auto;
padding-top: 0px;
}
/* Additional styles to enhance appearance */
.header-title {
position: relative;
bottom: 5px;
left: 60px;
}
</style>
<script> <script>
$(window).on('load', function() { $(window).on('load', function() {
setTimeout(function() { setTimeout(function() {
@ -247,7 +301,6 @@
</head> </head>
<body class="loading" data-layout-mode="" data-layout='{"mode": "light", "width": "fluid", "menuPosition": "fixed", "sidebar": { "color": "light", "size": "condensed", "showuser": false}, "topbar": {"color": "dark"}, "showRightSidebarOnPageLoad": false}'></body> <body class="loading" data-layout-mode="" data-layout='{"mode": "light", "width": "fluid", "menuPosition": "fixed", "sidebar": { "color": "light", "size": "condensed", "showuser": false}, "topbar": {"color": "dark"}, "showRightSidebarOnPageLoad": false}'></body>
@ -330,88 +383,12 @@
</form> </form>
</li> </li>
<!-- <li class="dropdown notification-list topbar-dropdown"> <li class="dropdown notification-list topbar-dropdown">
<a class="nav-link dropdown-toggle waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false"> <a class="nav-link dropdown-toggle right-bar-toggle waves-effect waves-light">
<i class="fe-bell noti-icon"></i> <i class="fe-bell noti-icon"></i>
<span class="badge badge-danger rounded-circle noti-icon-badge">1</span> <span class="badge badge-danger rounded-circle noti-icon-badge" id="notification_count">0</span>
</a> </a>
<div class="dropdown-menu dropdown-menu-right dropdown-lg"> </li>
<div class="dropdown-item noti-title">
<h5 class="m-0">
<span class="float-right">
<a href="" class="text-dark">
<small>Clear All</small>
</a>
</span>Notification
</h5>
</div>
<div class="noti-scroll" data-simplebar>
<a href="javascript:void(0);" class="dropdown-item notify-item active">
<div class="notify-icon bg-soft-primary text-primary">
<i class="mdi mdi-comment-account-outline"></i>
</div>
<p class="notify-details">Doug Dukes commented on Admin Dashboard
<small class="text-muted">1 min ago</small>
</p>
</a>
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon">
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-2.jpg" class="img-fluid rounded-circle" alt="" /> </div>
<p class="notify-details">Mario Drummond</p>
<p class="text-muted mb-0 user-msg">
<small>Hi, How are you? What about our next meeting</small>
</p>
</a>
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon">
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-4.jpg" class="img-fluid rounded-circle" alt="" /> </div>
<p class="notify-details">Karen Robinson</p>
<p class="text-muted mb-0 user-msg">
<small>Wow ! this admin looks good and awesome design</small>
</p>
</a>
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon bg-soft-warning text-warning">
<i class="mdi mdi-account-plus"></i>
</div>
<p class="notify-details">New user registered.
<small class="text-muted">5 hours ago</small>
</p>
</a>
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon bg-info">
<i class="mdi mdi-comment-account-outline"></i>
</div>
<p class="notify-details">Caleb Flakelar commented on Admin
<small class="text-muted">4 days ago</small>
</p>
</a>
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon bg-secondary">
<i class="mdi mdi-heart"></i>
</div>composer create-project laravel/laravel:^11.0 example-app
<p class="notify-details">Carlos Crouch liked
<b>Admin</b>
<small class="text-muted">13 days ago</small>
</p>
</a>
</div>
<a href="javascript:void(0);" class="dropdown-item text-center text-primary notify-item notify-all">
View all
<i class="fe-arrow-right"></i>
</a>
</div>
</li> -->
<li class="dropdown notification-list topbar-dropdown"> <li class="dropdown notification-list topbar-dropdown">
<a class="nav-link dropdown-toggle nav-user mr-0 waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false"> <a class="nav-link dropdown-toggle nav-user mr-0 waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
@ -645,5 +622,3 @@
<!-- Start Content--> <!-- Start Content-->
<div class="container-fluid"> <div class="container-fluid">

View File

@ -136,14 +136,14 @@
<tr> <tr>
<td style="width: 11%;"><span style="margin-right: 20px;">Self:</span></td> <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: 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> <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><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
<tr> <tr>
<td style="width: 11%;"><span style="margin-right: 20px;">Spouse:</span></td> <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: 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;">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" 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" ></div></td>
</tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr> </tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
<tr> <tr>
<td style="width: 11%;"><span for="children">Children:</span></td> <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="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="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 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> </select>
</div> </div>
<div style="margin-top:10px"> <div style="margin-top:10px">
@ -185,8 +185,8 @@
<tbody> <tbody>
<tr> <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: 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 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;">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;">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> </tr>
</tbody> </tbody>
@ -1040,8 +1040,8 @@
if ($('#spouse').prop('checked')) { if ($('#spouse').prop('checked')) {
$('.spouse-age').css('display',''); $('.spouse-age').css('display','');
$('#spouse_min_age').val(18); // $('#spouse_min_age').val(18);
$('#spouse_max_age').val(60); // $('#spouse_max_age').val(60);
} else { } else {
$('.spouse-age').css('display','none'); $('.spouse-age').css('display','none');
@ -1256,10 +1256,10 @@
$('#spouse').change(function () { $('#spouse').change(function () {
if ($(this).prop('checked')) { if ($(this).prop('checked')) {
$('.spouse-age').css('display',''); $('.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); $('#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); $('#spouse_max_age').val(60);
} }
}else{ }else{
@ -1275,7 +1275,7 @@
if($('#child_min_age').val() < 0 || $('#child_min_age').val() == '' ){ if($('#child_min_age').val() < 0 || $('#child_min_age').val() == '' ){
$('#child_min_age').val(0); $('#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); $('#child_max_age').val(25);
} }
}else{ }else{
@ -1289,6 +1289,13 @@
var family_floaters = $(this).val(); var family_floaters = $(this).val();
if($('#family_floaters').val() != 0){ if($('#family_floaters').val() != 0){
$('.other-member-age').css('display',''); $('.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{ }else{
$('.other-member-age').css('display','none'); $('.other-member-age').css('display','none');
} }
@ -1310,4 +1317,14 @@
} }
}) })
function lowerIsEighteen(params) {
if($(params).val() < 18){
$(params).val(18);
}
}
</script> </script>

View File

@ -1,6 +1,6 @@
<!-- Modal content for the Large example --> <!-- Modal content for the Large example -->
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" <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-dialog modal-full-width">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -27,7 +27,7 @@
</select> </select>
</div> </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> <label for="css"> Premium Calculation </label>
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<input type="radio" id="individual" name="premium_type" value="2"> <input type="radio" id="individual" name="premium_type" value="2">
@ -35,7 +35,7 @@
<input type="radio" id="single" name="premium_type" value="1"> <input type="radio" id="single" name="premium_type" value="1">
<label for="single" style="position: relative;top: 5px;left: 5px;"> Single Insurance </label> <label for="single" style="position: relative;top: 5px;left: 5px;"> Single Insurance </label>
</div> </div>
</div> --> </div>
</div> </div>
@ -46,7 +46,7 @@
</div> </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" <button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
id="btnGridSubmit_2">Submit</button> id="btnGridSubmit_2">Submit</button>
</div> </div>
@ -710,10 +710,10 @@ $('body').on('click', '.btnPolicyModel', function() {
var client_policy_id = $(this).data('id'); var client_policy_id = $(this).data('id');
$('#client_policy_id').val(client_policy_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'); 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') { if (policy_type_string == 'GPA' || policy_type_string == 'GMC') {
@ -733,15 +733,17 @@ $('body').on('click', '.btnPolicyModel', function() {
dataType: 'json', dataType: 'json',
success: function(res) { success: function(res) {
$('#GridForm')[0].reset(); $('#GridForm')[0].reset();
// if(res.family_floater == 1){ if(policy_type_string == 'GMC'){
// $('#premium_type').show(); $('#premium_type').show();
// $('#individual').prop('checked', true) $('#individual').prop('checked', true)
// }else{ }else{
// $('#premium_type').hide(); $('#premium_type').hide();
// $('#individual').prop('checked', false) $('#individual').prop('checked', true)
// } }
setTimeout(function() { setTimeout(function() {
$('.loader').fadeOut(); $('.loader').fadeOut();
@ -758,12 +760,13 @@ $('body').on('click', '.btnPolicyModel', function() {
$('#nameOfThePolicy').html(' - ' + res.policy_name); $('#nameOfThePolicy').html(' - ' + res.policy_name);
$('#grid_emp_count').val(res.count); $('#grid_emp_count').val(res.count);
if (res.count > 0) { if (res.count > 0) {
console.log('count -- 2', res.count); console.log(' hide submit btn count ', res.count);
$("#btnGridSubmit_2").hide(); $("#hide_smbt_btn").hide();
} else { } else {
$("#btnGridSubmit_2").show(); $("#hide_smbt_btn").show();
console.log('count -- ', res.count); console.log('show submit btn count ', res.count);
} }
if (res.status === false) { if (res.status === false) {
@ -788,24 +791,25 @@ $('body').on('click', '.btnPolicyModel', function() {
}); });
$('#grid').html(policeGridOptionHTML); $('#grid').html(policeGridOptionHTML);
// if (res.premiumData[0].hasOwnProperty('premium_type')) {
// if (res.premiumData[0].premium_type == '2') { if (res.premiumData[0].hasOwnProperty('premium_type')) {
// $('#individual').prop('checked', true) if (res.premiumData[0].premium_type == '2') {
// $('#single').prop('checked', false)
// } else if (res.premiumData[0].premium_type == '1') { $('#individual').prop('checked', true)
$('#single').prop('checked', false)
// $('#single').prop('checked', true) } else if (res.premiumData[0].premium_type == '1') {
// $('#individual').prop('checked', false)
// } else { $('#single').prop('checked', true)
// $('#single').prop('checked', false) $('#individual').prop('checked', false)
// $('#individual').prop('checked', false)
// }
// } } else {
$('#single').prop('checked', false)
$('#individual').prop('checked', true)
}
}
var si_or_bp_value = ''; 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; var id_for_trigger = temp_for_premiumData[0].policy_grid_id;
$(`input[name="${id_for_trigger}_si[]"]`).each(function() { $(`input[name="${id_for_trigger}_si[]"]`).each(function() {
console.log($(this)); // console.log($(this));
$(this).trigger('keyup'); $(this).trigger('keyup');
}); });
$(`input[name="${id_for_trigger}_premium[]"]`).each(function() { $(`input[name="${id_for_trigger}_premium[]"]`).each(function() {
console.log($(this)); // console.log($(this));
$(this).trigger('keyup'); $(this).trigger('keyup');
}); });
@ -915,17 +919,26 @@ $('#grid').change(function() {
$('.loader').fadeOut(); $('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow'); $('.loader-mask').delay(350).fadeOut('slow');
}, 1000); }, 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) { if (res.premiumData.length > 0 && res.premiumData[0].policy_grid_id === grid_id) {
$('#nameOfThePolicy').html(' - ' + res.policy_name); $('#nameOfThePolicy').html(' - ' + res.policy_name);
$('#grid_emp_count').val(res.count); $('#grid_emp_count').val(res.count);
if (res.count == false) { if (res.count > 0) {
console.log('count -- 2', res.count); // console.log(' hide submit btn count ', res.count);
$("#btnGridSubmit_2").hide(); $("#hide_smbt_btn").hide();
} else { } else {
$("#btnGridSubmit_2").show(); $("#hide_smbt_btn").show();
console.log('count -- ', res.count); // console.log('show submit btn count ', res.count);
} }
if (res.status === false) { if (res.status === false) {
@ -996,9 +1009,9 @@ var Count = 1
function appendGridtHtml(ui_type = false, data = false, ) { function appendGridtHtml(ui_type = false, data = false, ) {
console.log('appendGridtHtml function called') // console.log('appendGridtHtml function called')
console.log(ui_type) // console.log(ui_type)
console.log(data) // console.log(data)
var html = ''; var html = '';
// console.log('Grid Content',data) // console.log('Grid Content',data)
@ -1007,13 +1020,13 @@ function appendGridtHtml(ui_type = false, data = false, ) {
if (ui_type == '1') { if (ui_type == '1') {
console.log('step 1') // console.log('step 1')
var currentTime = getCurrentTime(); var currentTime = getCurrentTime();
console.log(currentTime); // console.log(currentTime);
if($("#si_or_bp").val() == 1 || data.si_or_bp == '1'){ 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}"> html = `<div class="form-row gpa_sum_insure_remove" style="width:101%" id="removeChild_${Count}">
<div class="form-group col-md-4" id=""> <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'){ }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}"> 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') { } else if (ui_type == '3') {
@ -1775,10 +1788,10 @@ function checkDuplicate() {
} }
} }
console.log('siValues', siValues); // console.log('siValues', siValues);
console.log('premiumValues', premiumValues); // console.log('premiumValues', premiumValues);
console.log('siDuplicates', siDuplicates); // console.log('siDuplicates', siDuplicates);
console.log('premiumDuplicates', premiumDuplicates); // console.log('premiumDuplicates', premiumDuplicates);
if (siDuplicates || premiumDuplicates) { if (siDuplicates || premiumDuplicates) {
toastr.warning('Duplicates found!', 'warning'); toastr.warning('Duplicates found!', 'warning');
@ -1829,12 +1842,12 @@ function checkDuplicate() {
} }
} }
console.log('siValues', siValues); // console.log('siValues', siValues);
console.log('premiumValues', premiumValues); // console.log('premiumValues', premiumValues);
console.log('bandValues', bandValues); // console.log('bandValues', bandValues);
console.log('siDuplicates', siDuplicates); // console.log('siDuplicates', siDuplicates);
console.log('premiumDuplicates', premiumDuplicates); // console.log('premiumDuplicates', premiumDuplicates);
console.log('bandDuplicates', bandDuplicates); // console.log('bandDuplicates', bandDuplicates);
if (siDuplicates || bandDuplicates || premiumDuplicates) { if (siDuplicates || bandDuplicates || premiumDuplicates) {
toastr.warning('Duplicates found!', 'warning'); toastr.warning('Duplicates found!', 'warning');
@ -1883,7 +1896,7 @@ function basicPayMultiple(input) {
function gpaSumInsureMultiplier(element) { function gpaSumInsureMultiplier(element) {
console.log(element); // console.log(element);
var element = $('#gpa_sum_multiplier')[0]; var element = $('#gpa_sum_multiplier')[0];
var sumInsured = $('input[name="gpa_sum_si[]"]'); var sumInsured = $('input[name="gpa_sum_si[]"]');
@ -1990,7 +2003,7 @@ function si_orbp_change_function() {
$('#gmc_add_more').hide(); $('#gmc_add_more').hide();
} }
console.log('gmcBandInput', count) // console.log('gmcBandInput', count)
var gpaBandRemoveElements = $("#grid_1").nextAll("div").find(".gpa_band_remove").length; var gpaBandRemoveElements = $("#grid_1").nextAll("div").find(".gpa_band_remove").length;
@ -2049,7 +2062,7 @@ function si_orbp_change_function() {
$('#gmc_add_more2').hide(); $('#gmc_add_more2').hide();
} }
console.log('gmcBandInput', count) // console.log('gmcBandInput', count)
$('#si_or_bp_full_div').css({ $('#si_or_bp_full_div').css({
'display': '', '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> <input type="text" class="form-control" id="tpa_name" placeholder="Enter TPA Name" value="<?= isset($tpa['name']) ? $tpa['name'] : '' ?>" name="name" required>
</div> </div>
<div class="form-group col-md-4"> <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> <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>
<div class="form-group col-md-4"> <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"> <input type="file" class="form-control" onchange="PreviewImage();" id="tpa_logo" name="tpa_logo" accept="image/jpeg, image/jpg, image/png">
</div> </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> </div>
<hr> <hr>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-10"> <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> <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>
<div class="form-group col-md-2 float-right" style="position: relative;top: 0px;left: 40px;"> <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" /> <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> </div>
<div class="form-row"> <div class="form-row" id="view_pre_btn" style="display :none">
<div class="form-group col-md-4"> <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> <a href="<?= isset($tpa['id']) ? base_url('/util/preview-card/') . $tpa['id'] : '' ?>" class="btn btn-primary" id="preview" target="_blank">Preview</a>
</div> </div>
@ -43,22 +47,22 @@
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <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"> <input type="file" class="form-control" onchange="PreviewImage2();" id="fc" name="fc" accept="image/jpeg, image/jpg, image/png">
</div> </div>
<div class="form-group col-md-4"> <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"> <input type="file" class="form-control" onchange="PreviewImage3();" id="bc" name="bc" accept="image/jpeg, image/jpg, image/png">
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <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" /> <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>
<div class="form-group col-md-4"> <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" /> <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>
</div> </div>
@ -99,6 +103,11 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
if($('#tpa_General_PrimaryKey').val() != ""){
$('#view_pre_btn').show()
}
$("#tpa_general_form").submit(function(events) { $("#tpa_general_form").submit(function(events) {
events.preventDefault(); events.preventDefault();
@ -106,6 +115,7 @@
var PrimaryKey = $('#tpa_General_PrimaryKey').val(); var PrimaryKey = $('#tpa_General_PrimaryKey').val();
var form_action = ''; var form_action = '';
if (isValid) { if (isValid) {
if (PrimaryKey === '') { if (PrimaryKey === '') {
@ -126,6 +136,12 @@
processData: false, processData: false,
contentType: false, contentType: false,
success: function(res) { success: function(res) {
if($('#tpa_General_PrimaryKey').val() == ""){
window.location.href = '<?= base_url("master/tpa/list/"); ?>' + res.data.id;
}
setTimeout(function() { setTimeout(function() {
$('.loader').fadeOut(); $('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow'); $('.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> <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('<?php ?>');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;"> <table style="font-size: 14px;margin-top:9px ;margin-left: 20px;">
<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;">
<tbody> <tbody>
<tr> <tr>
<td>MDID : {TPA_ID}</td> <td>POLICY NO</td>
<td>:</td>
<td>{POLICY_NO}</td>
</tr> </tr>
<tr> <tr>
<td colspan="2"><b>{NAME}</b></td> <td>Name</td>
<td>:</td>
<td>{NAME}</td>
</tr> </tr>
<tr> <tr>
<td>Certificate No : {UHID}</td> <td>TPA ID</td>
<td>:</td>
<td>{TPA_ID}</td>
</tr> </tr>
<tr> <tr>
<td><span>Sex : {GENDER} </span> <span style="margin-left: 30px;"> Date of Birth : {DOB}</span> <td>age</td>
</td> <td>:</td>
<td>{AGE}</td>
</tr> </tr>
<tr> <tr>
<td colspan="2"><b>{SELF_NAME}</b></td> <td>Employee code</td>
<td>:</td>
<td>{EMP_ID}</td>
</tr> </tr>
<tr> <tr>
<td>Valid form :{POLICY_DATE}</td> <td>Corporate name</td>
<td>:</td>
<td>{CORPORATE_NAME}</td>
</tr> </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> <tr>
<td>General & Claim Enquiry Helpline</td> <td>Valid form</td>
<td>Cashless Enquiry helpline</td> <td>:</td>
<td>{POLICY_DATE}</td>
</tr> </tr>
</tbody> </tbody>
</table> </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;"> </div>
<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> <div class="card" style="border: 1px solid #50505059;width:420px;min-height: 280px; padding: 0px 20px 5px 0px;">
<table style="text-align: center;width: 100%;font-size: 12px;"> <h6 style="text-align: center;font-weight: 700;margin: 0px;font-size: 14px;"><u>Terms&conditions</u></h6>
<thead> <ul style="font-size: 11px;text-align: justify;font-weight: bolder;font-weight: 600;line-height: 13px;margin-bottom: 5px;">
<tr> <li>Submit this card & photo ID for availing cashless insurrer empanelled hospitals</li>
<th style="border: 1px solid black;">Center</th> <li>Cashless facility is subject to approved by {TPA_NAME} as per policy terms and conditions</li>
<th style="border: 1px solid black;">Ph.No/Fax.No.</th> <li>Validdity of this card is subject to valid policy renewal of policy</li>
<th style="border: 1px solid black;">Center</th> </ul>
<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>
</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> <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="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>Card No</td>
<td>:</td>
<td>{POLICY_NO}</td>
</tr>
<tr>
<td>Name</td>
<td>:</td>
<td>{NAME}</td>
</tr>
<tr>
<td>Gender</td>
<td>:</td>
<td>{GENDER}</td>
</tr>
<tr>
<td>age</td>
<td>:</td>
<td>{AGE} years</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: 204px;top: 30px;"><img src="{TPA_LOGO}" alt="" width="170px" height="30px" style="object-fit: fill;"></div>
<div style="border: 1px solid black;width: 400px;max-height: 300px;background: url('{FRONT_CARD}');background-size: 100% 100%;padding: 10px;">
<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>
<table <div class="card" style="border: 1px solid #50505059;width:420px;min-height: 280px; padding: 0px 20px 5px 0px;">
style="font-family: sans-serif;font-size: 14px;width: 100%;margin-top: 20px;margin-left: 20px;line-height: 20px;"> <h6 style="text-align: center;font-weight: 700;margin: 0px;font-size: 14px;"><u>Terms&conditions</u></h6>
<tbody> <ul style="font-size: 11px;text-align: justify;font-weight: bolder;font-weight: 600;line-height: 13px;margin-bottom: 5px;">
<tr> <li>Submit this card & photo ID for availing cashless insurrer empanelled hospitals</li>
<td>MDID : {TPA_ID}</td> <li>Cashless facility is subject to approved by vidal health as per policy terms and conditions</li>
</tr> <li>Validdity of this card is subject to valid policy renewal of policy</li>
<tr> <li>imidiate intimation to vidal health is must incase of any hospitalisation</li>
<td colspan="2"><b>{NAME}</b></td> <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>
</tr> </ul>
<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 > <div >
<table style="text-align: center;width: 100%;font-size: 12px;"> <img src="../image/logo.png" alt="" width="100px" height="25px" style="object-fit: fill; rotate: -90deg; position: absolute;left: -34px;bottom: 77px;">
<thead> </div>
<tr> <div style="font-size: 10px;font-weight: bold; line-height: 10px;margin-left: 40px;width: 70%;">
<th style="border: 1px solid black;">Center</th> <div><u>24x7 help line no</u> </div>
<th style="border: 1px solid black;">Ph.No/Fax.No.</th> <div>
<th style="border: 1px solid black;">Center</th> <div>
<th style="border: 1px solid black;">Ph.No/Fax.No.</th> <span>karnataka/andrapradesh/telangana</span><span style="padding: 0px 5px 0px 5px ;">:</span><span style="font-weight: 400;">080-46267018/1860425051</span>
</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>
<div> <div>
<h6 style="margin: 5px;">TERMS AND CONDITIONS</h6> <span>North and east region/gujarat</span><span style="padding: 0px 5px 0px 5px ;">:</span><span style="font-weight: 400;">080-46267021/18604250261</span>
<ol style="font-size: 11px;padding-left: 15px;margin-top: 0px;"> </div>
<li>Pre authorisation is compulsary from tpa prior to planned admission within 24hours for <div>
emergencies.</li> <span>Maharastra</span><span style="padding: 0px 5px 0px 5px ;">:</span><span style="font-weight: 400;">080-46267020/18604250254</span>
<li>Admission for Investigation/Evaluation Not covered.</li> </div>
<li>All terms and conditions of the policy would be applicable</li> <div>
<li>cashless hospitalisation in network hospitals can be obtained in conjunction with this card.an <span>Tamil Nadu</span style="padding: 0px 5px 0px 5px ;">:<span></span><span style="font-weight: 400;">080-46267020/18604250254</span>
authorisation letter issued by tpa and photo identification and such as Voters ID,Driver </div>
Licence,Passport,etc.</li> <div>
</ol> <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> </div>
<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> </body>