Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
@ -16,6 +16,7 @@ $routes->get('/login', 'LoginController::index');///auth/google
|
||||
$routes->get('/logout', 'LoginController::logout');
|
||||
$routes->get('/oauth2callback', 'LoginController::receiveGoogleOAuthResponse');
|
||||
$routes->get('/auth/google', 'LoginController::initiateGoogleOAuth');
|
||||
$routes->get('/update-emp-policy-status', 'ClientController::updateEmpAndPolicyStatus');
|
||||
|
||||
|
||||
$routes->group("/user", ["filter" => "authMVC"], function($routes){
|
||||
@ -209,6 +210,11 @@ $routes->group("/util", ["filter" => "authMVC"], function($routes){
|
||||
$routes->get("download-excel/(:any)", "EmployeeController::downloadSampleExcelFile/$1");
|
||||
$routes->get("get-emp-endorsement/(:any)", "EmployeeController::getEmpEndoresmentEntry/$1");
|
||||
$routes->post("import-export", "EmployeeController::importExport");
|
||||
$routes->get("featch-client-policy-list/(:any)", "ClientController::getClientPolicyList/$1");
|
||||
$routes->get("download-file-list/(:any)", "EmployeeController::downloadFileList/$1");
|
||||
$routes->get("featch-emp-list", "EmployeeController::featchEmpList/$1");
|
||||
$routes->get("view-success-emp-list", "EmployeeController::viewUploadedEmployeeList/$1");
|
||||
|
||||
});
|
||||
|
||||
$routes->cli('cli/processjob', 'JobWorker::processJob');
|
||||
|
||||
@ -40,7 +40,8 @@ class Session extends BaseConfig
|
||||
* The number of SECONDS you want the session to last.
|
||||
* Setting to 0 (zero) means expire when the browser is closed.
|
||||
*/
|
||||
public int $expiration = 7200;
|
||||
// public int $expiration = 7200;
|
||||
public int $expiration = 86400; //24 Hours
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
|
||||
@ -29,6 +29,8 @@ use App\Models\PolicyGridModel;
|
||||
use App\Models\PolicyPremium1Model;
|
||||
use App\Models\PolicyPremium2Model;
|
||||
use App\Models\EmployeeModel;
|
||||
use App\Models\EmployeePolicyModel;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -57,6 +59,7 @@ class ClientController extends AdminController
|
||||
protected $policyPremium2Model;
|
||||
protected $clientDepositModel;
|
||||
protected $employeeModel;
|
||||
protected $employeePolicyModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -83,6 +86,9 @@ class ClientController extends AdminController
|
||||
$this->policyPremium1Model = new PolicyPremium1Model();
|
||||
$this->policyPremium2Model = new PolicyPremium2Model();
|
||||
$this->employeeModel = new EmployeeModel();
|
||||
$this->employeePolicyModel = new EmployeePolicyModel();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -103,6 +109,14 @@ class ClientController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
public function updateEmpAndPolicyStatus(){
|
||||
|
||||
$return = $this->clientPolicyModel->updateStatus();
|
||||
$this->myLogger->logme('error', 'Client Policy Status Update Count: {data}', ['data' => $return['client']]);
|
||||
$this->myLogger->logme('error', 'Employee Policy Status Update Count: {data}', ['data' => $return['emp']]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function removeClient($id = null)
|
||||
{
|
||||
@ -248,10 +262,21 @@ class ClientController extends AdminController
|
||||
$editData['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $id)->findAll();
|
||||
$editData['client_branch'] = $this->clientBranchModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
||||
$editData['client_relation'] = $this->clientRMModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
||||
$editData['client_policy'] = $this->clientPolicyModel->getClientPolicyByClientId($id);
|
||||
|
||||
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($id);
|
||||
|
||||
foreach ($clientPoliceData as $key => $value) {
|
||||
|
||||
$clientPoliceData[$key]->policy_start_date = date('d-M-Y', strtotime($value->policy_start_date));
|
||||
$clientPoliceData[$key]->policy_end_date = date('d-M-Y', strtotime($value->policy_end_date));
|
||||
}
|
||||
|
||||
$editData['client_policy'] = $clientPoliceData;
|
||||
|
||||
|
||||
|
||||
// echo "<pre>";
|
||||
// print_r($editData); die;
|
||||
// print_r($clientPoliceData); die;
|
||||
|
||||
echo view('layout/header', $headerData);
|
||||
echo view('client_onboarding', $editData);
|
||||
@ -577,6 +602,7 @@ class ClientController extends AdminController
|
||||
$data['earned_premium_amount'] = $this->request->getPost('earned_premium_amount');
|
||||
$data['claims_incurred_amount'] = $this->request->getPost('claims_incurred_amount');
|
||||
$data['is_addon'] = $this->request->getPost('is_addon');
|
||||
$data['base_policy'] = $this->request->getPost('base_policy');
|
||||
|
||||
if (!isset($data['is_addon'])) {
|
||||
$data['is_addon'] = 0;
|
||||
@ -594,6 +620,11 @@ class ClientController extends AdminController
|
||||
$insert = $this->clientPolicyModel->insert($data);
|
||||
if($insert){
|
||||
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($this->request->getPost('client_id'));
|
||||
foreach ($clientPoliceData as $key => $value) {
|
||||
|
||||
$clientPoliceData[$key]->policy_start_date = date('d-M-Y', strtotime($value->policy_start_date));
|
||||
$clientPoliceData[$key]->policy_end_date = date('d-M-Y', strtotime($value->policy_end_date));
|
||||
}
|
||||
return $this->respond(['status' => true,'code' => 200,'data' => $clientPoliceData, 'method' => 'CERATE'], 200);
|
||||
}else{
|
||||
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
||||
@ -637,6 +668,8 @@ class ClientController extends AdminController
|
||||
$data['earned_premium_amount'] = $this->request->getPost('earned_premium_amount');
|
||||
$data['claims_incurred_amount'] = $this->request->getPost('claims_incurred_amount');
|
||||
$data['is_addon'] = $this->request->getPost('is_addon');
|
||||
$data['base_policy'] = $this->request->getPost('base_policy');
|
||||
|
||||
|
||||
|
||||
if (!isset($data['is_addon'])) {
|
||||
@ -654,6 +687,11 @@ class ClientController extends AdminController
|
||||
|
||||
if($insert){
|
||||
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($client_id);
|
||||
foreach ($clientPoliceData as $key => $value) {
|
||||
|
||||
$clientPoliceData[$key]->policy_start_date = date('d-M-Y', strtotime($value->policy_start_date));
|
||||
$clientPoliceData[$key]->policy_end_date = date('d-M-Y', strtotime($value->policy_end_date));
|
||||
}
|
||||
return $this->respond(['status' => true,'code' => 200,'data' => $clientPoliceData, 'method' => 'EDIT'], 200);
|
||||
}else{
|
||||
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
||||
@ -903,8 +941,13 @@ class ClientController extends AdminController
|
||||
if($id){
|
||||
$client_policy_data = $this->clientPolicyModel->where(['id' => $id, 'is_active' => 1])->first();
|
||||
$insurer_id = $client_policy_data['insurer_id'];
|
||||
$client_id = $client_policy_data['client_id'];
|
||||
$polices = $this->policesModel->where(['insurer_id' => $insurer_id, 'is_active' => 1])->findAll();
|
||||
return $this->respond(['status' => true,'code' => 200,'data' => $client_policy_data, "insurer_id" => $client_policy_data['insurer_id'], 'policy' => $polices], 200);
|
||||
$client_policy_list = $this->clientPolicyModel->select('policies.*')
|
||||
->join('policies', 'policies.id = client_policy.policy_id')
|
||||
->where('client_id', $client_id)
|
||||
->findAll();
|
||||
return $this->respond(['status' => true,'code' => 200, 'client_policy_list' => $client_policy_list, 'data' => $client_policy_data, "insurer_id" => $client_policy_data['insurer_id'], 'policy' => $polices], 200);
|
||||
}else{
|
||||
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
||||
}
|
||||
@ -1393,4 +1436,19 @@ class ClientController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getClientPolicyList($client_id = null){
|
||||
|
||||
$record = $this->clientPolicyModel->select('policies.*')
|
||||
->join('policies', 'policies.id = client_policy.policy_id')
|
||||
->where('client_id', $client_id)
|
||||
->findAll();
|
||||
|
||||
if ($record) {
|
||||
return $this->respond(['Status' => true,'code' => 200,'data' => $record], 200);
|
||||
} else {
|
||||
return $this->respond(['Status' => false,'code' => 200,'message' => 'Record not found.'], 200);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -217,7 +217,7 @@ class EmployeeController extends AdminController
|
||||
$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'])
|
||||
->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')
|
||||
@ -250,7 +250,11 @@ class EmployeeController extends AdminController
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($result); die;
|
||||
echo view('excel_errors', $result);
|
||||
if($result){
|
||||
echo view('excel_errors', $result);
|
||||
}else{
|
||||
echo view('errors/html/production');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -272,13 +276,17 @@ class EmployeeController extends AdminController
|
||||
$filePath = '';
|
||||
// Path to your file
|
||||
if($actionType == 'inception'){
|
||||
$filePath = ROOTPATH . 'public/sample_excel/inception.xls';
|
||||
|
||||
$filePath = ROOTPATH . 'public/sample_excel/sample_inception.xls';
|
||||
}else if($actionType == 'correction'){
|
||||
$filePath = ROOTPATH . 'public/sample_excel/inception_1.xls';
|
||||
|
||||
$filePath = ROOTPATH . 'public/sample_excel/sample_correction .xls';
|
||||
}else if($actionType == 'si_enhancement'){
|
||||
$filePath = ROOTPATH . 'public/sample_excel/inception_2.xls';
|
||||
$filePath = ROOTPATH . 'public/sample_excel/sample_si_enhancement.xls';
|
||||
}else if($actionType == 'dependent_addtion'){
|
||||
$filePath = ROOTPATH . 'public/sample_excel/sample_dependent_addition.xls';
|
||||
}else if($actionType == 'addition'){
|
||||
$filePath = ROOTPATH . 'public/sample_excel/sample_addition.xls';
|
||||
}else if($actionType == 'deletion'){
|
||||
$filePath = ROOTPATH . 'public/sample_excel/sample_deletion.xls';
|
||||
}
|
||||
|
||||
// Check if the file exists
|
||||
@ -291,7 +299,7 @@ class EmployeeController extends AdminController
|
||||
return $this->response->download($filePath, null, $mimeType);
|
||||
} else {
|
||||
// File not found, show an error message or redirect
|
||||
return redirect()->back()->with('error', 'File not found.');
|
||||
echo view('errors/html/production');
|
||||
}
|
||||
}
|
||||
|
||||
@ -540,5 +548,90 @@ class EmployeeController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function downloadFileList($fileName = null)
|
||||
{
|
||||
// $actionType = $this->request->getGet();
|
||||
try {
|
||||
$filePath = WRITEPATH . '/uploads/excel/' . $fileName;
|
||||
|
||||
// Check if the file exists
|
||||
if (file_exists($filePath)) {
|
||||
// Set the appropriate MIME type
|
||||
$mimeType = mime_content_type($filePath);
|
||||
|
||||
// Send the file to the client for download
|
||||
return $this->response->download($filePath, null, $mimeType);
|
||||
} else {
|
||||
|
||||
throw new \CodeIgniter\Exceptions\PageNotFoundException();
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Handle any exceptions
|
||||
$errorMessage = $e->getMessage();
|
||||
$this->myLogger->logme('error', $errorMessage);
|
||||
// You can return an error response here
|
||||
echo $errorMessage;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function featchEmpList()
|
||||
{
|
||||
$client_id = $this->request->getGet('client_id');
|
||||
$policy_id = $this->request->getGet('policy_id');
|
||||
|
||||
$emp_data['employees'] = $this->employeePolicyModel->getEmployeePolicyForFileList($client_id, $policy_id);
|
||||
$html = view('employee_data_list', $emp_data);
|
||||
|
||||
return $this->respond(['dataStatus' => true,'code' => 200,'data' => $html], 200);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function viewUploadedEmployeeList()
|
||||
{
|
||||
$file_id = $this->request->getGet('file_id');
|
||||
// $emp_data['employees'] = $this->employeePolicyModel->getViewEmpSuccessList($file_id);
|
||||
// $html = view('view_file_upload_emp_list', $emp_data);
|
||||
$file_name = $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.id', $file_id)->first();
|
||||
|
||||
try {
|
||||
|
||||
$filePath = WRITEPATH . '/uploads/excel/' . $file_name['file_name'];
|
||||
|
||||
if (file_exists($filePath)) {
|
||||
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filePath);
|
||||
$sheet = $spreadsheet->getActiveSheet();
|
||||
|
||||
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
||||
$excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
||||
$emp_data['thead'] = $excel_data[0];
|
||||
unset($excel_data[0]);
|
||||
$emp_data['tbody'] = $excel_data;
|
||||
|
||||
$html = view('view_file_upload_emp_list', $emp_data);
|
||||
} else {
|
||||
|
||||
$html = '<div class="text-center">No Data Found</div>';
|
||||
}
|
||||
|
||||
return $this->respond(['dataStatus' => true, 'code' => 200, 'data' => $html, 'file_data' => $file_name], 200);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
// Handle exception
|
||||
$errorMessage = 'Error occurred: ' . $e->getMessage();
|
||||
$this->myLogger->logme('error', $errorMessage);
|
||||
$html = '<div class="text-center">No Data Found</div>';
|
||||
return $this->respond(['dataStatus' => false, 'code' => 500, 'data' => $html, 'file_data' => $file_name], 500);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -35,7 +35,7 @@ class EmployeeServiceController extends AdminController
|
||||
protected $empEndorsementModel;
|
||||
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']],'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']],'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],'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']],'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],'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 $deletion_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],'change_event'=>['col_idx'=>3,'col_cell_name'=>'D','col_name'=>'Change event','is_mandatory'=>['D'],'data_type'=>'str','format'=>null,'allowed_values'=>null],'date_of_exit'=>['col_idx'=>4,'col_cell_name'=>'E','col_name'=>'Date of exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null],'reason_for_exit'=>['col_idx'=>5,'col_cell_name'=>'F','col_name'=>'Reason for exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>null,'allowed_values'=>null]];
|
||||
|
||||
@ -142,7 +142,10 @@ class EmployeeServiceController extends AdminController
|
||||
|
||||
// get policy and rack details
|
||||
$policy_terms = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']);
|
||||
$policy_terms = (array) $policy_terms[0];// convert obj to array
|
||||
$policy_terms = json_decode($policy_terms[0]->policy_terms);
|
||||
$policy_terms = (array) $policy_terms;// convert obj to array
|
||||
//
|
||||
// dd($policy_terms);
|
||||
|
||||
//get policy slab rates
|
||||
$slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($file['policy_id'],$file['client_id']);
|
||||
@ -318,7 +321,7 @@ class EmployeeServiceController extends AdminController
|
||||
|
||||
// get policy and rack details
|
||||
$policy_terms = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']);
|
||||
// dd($policy_terms);
|
||||
// dd($this->clientPolicyModel->getLastQuery());
|
||||
$policy_terms = json_decode($policy_terms[0]->policy_terms);
|
||||
$policy_terms = (array) $policy_terms;// convert obj to array
|
||||
// dd($policy_terms);
|
||||
@ -369,6 +372,17 @@ class EmployeeServiceController extends AdminController
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($file['action'] == 'inception')
|
||||
{
|
||||
$res = check_self_available_in_family($family,$file['action']);
|
||||
// dd($res);
|
||||
if(!$res['is_self_found'])
|
||||
{
|
||||
array_push($result['error_summary'],14); // Self not found
|
||||
$result['error_data'][ $res['emp_code'] ]['name_of_emp_dep']['error'][] = "Self not found ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($file['action'] == 'dependent_addition' || $file['action'] == 'addition' || $file['action'] == 'inception')
|
||||
@ -387,7 +401,7 @@ class EmployeeServiceController extends AdminController
|
||||
|
||||
//check dup with empid and name with db
|
||||
$res = name_and_empid_check_in_db($family,$file);
|
||||
// dd($file);
|
||||
// dd($res);
|
||||
// echo '<br/>';
|
||||
// print_r($res);
|
||||
if(count($res['del']))
|
||||
@ -447,8 +461,8 @@ class EmployeeServiceController extends AdminController
|
||||
$job_details = new Jobs();
|
||||
|
||||
$r = Jobs::addJob(['job_name' => 'employeesOnboardPreprocess','payload' => ['file_id' => $file_id]]);
|
||||
$jobWorker = new JobWorker();
|
||||
JobWorker::processJob($r);
|
||||
// $jobWorker = new JobWorker();
|
||||
// JobWorker::processJob($r);
|
||||
}
|
||||
return $result;
|
||||
|
||||
@ -530,8 +544,13 @@ class EmployeeServiceController extends AdminController
|
||||
$data = calculate_premimum($family,$policy_terms,$slab_details,$file);
|
||||
// dd($data);
|
||||
$employee_data_group_by_family[$emp_id] = $data;
|
||||
//$this->employeesOnboardProcess(['familiy_data' => $data,'file' => $file]);
|
||||
$this->employeesOnboardProcess(['familiy_data' => $data,'file' => $file]);
|
||||
}
|
||||
|
||||
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
|
||||
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]);
|
||||
|
||||
|
||||
}
|
||||
else if(isset($params['client_policy_id']))//handle data from enrollment to inception
|
||||
{
|
||||
@ -547,7 +566,7 @@ class EmployeeServiceController extends AdminController
|
||||
//get policy slab rates
|
||||
$slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($client_policy_id,$client_id);
|
||||
|
||||
$existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(client_id: $client_id,client_policy_id: $client_policy_id,emp_status: 'draft');
|
||||
$existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(client_id: $client_id,client_policy_id: $client_policy_id,emp_status: 'enrolled');
|
||||
|
||||
$file = ['id' => null,'client_id' => $client_id,'policy_id' => $client_policy_id,'action' => 'inception'];
|
||||
// dd($this->employeeModel->getLastQuery());
|
||||
@ -663,6 +682,9 @@ class EmployeeServiceController extends AdminController
|
||||
// print_r($endorsement_data);
|
||||
|
||||
}
|
||||
|
||||
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
|
||||
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]);
|
||||
return $endorsement_data;
|
||||
|
||||
}
|
||||
@ -721,6 +743,8 @@ class EmployeeServiceController extends AdminController
|
||||
|
||||
|
||||
}
|
||||
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
|
||||
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -789,6 +813,8 @@ class EmployeeServiceController extends AdminController
|
||||
|
||||
|
||||
}
|
||||
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
|
||||
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -917,9 +943,10 @@ class EmployeeServiceController extends AdminController
|
||||
|
||||
public function getExcelErrorData($file_id){
|
||||
|
||||
try {
|
||||
$file = $this->fileModel->find($file_id);
|
||||
$error_data = json_decode($file['reason']);
|
||||
|
||||
// dd($error_data);
|
||||
// return $error_data;
|
||||
|
||||
$file_name_with_path = WRITEPATH."/uploads/excel/".$file['file_name'];
|
||||
@ -939,7 +966,7 @@ class EmployeeServiceController extends AdminController
|
||||
$excelErrorData['excel_header'] = $excel_data[0];
|
||||
unset($excel_data[0]);
|
||||
// echo '<pre>';
|
||||
|
||||
// Kint::dump($excel_data);
|
||||
if($error_data->error_type == 1){
|
||||
|
||||
$finalArray = [];
|
||||
@ -982,13 +1009,24 @@ class EmployeeServiceController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// dd(array_keys($allErrors));
|
||||
foreach ($allErrors as $key => $value){
|
||||
$data = ['value' => $excel_data[$key][1], 'error'=>$value,];
|
||||
$excel_data[$key][1] = $data;
|
||||
array_push($typeTowArray, $excel_data[$key]);
|
||||
// echo $key;
|
||||
// print_r($value);
|
||||
foreach($excel_data as $excel_data_index => $excel_data_value)
|
||||
{
|
||||
if($excel_data_value[0] == $key)
|
||||
{
|
||||
$data = ['value' => $excel_data[$excel_data_index][1], 'error'=>$value,];
|
||||
$excel_data[$excel_data_index][1] = $data;
|
||||
array_push($typeTowArray, $excel_data[$excel_data_index]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dd($data);
|
||||
foreach ($typeTowArray as $fkey => $value){
|
||||
foreach ($value as $vkey => $arrayData){
|
||||
if(!is_array($arrayData)){
|
||||
@ -1003,6 +1041,13 @@ class EmployeeServiceController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
}catch (\Exception $e) {
|
||||
// Handle any exceptions
|
||||
$errorMessage = $e->getMessage();//die();
|
||||
$this->myLogger->logme('error', $errorMessage);
|
||||
return false; // You can return an error response here
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ class JobWorker extends AdminController
|
||||
* Constructs the class
|
||||
*/
|
||||
|
||||
private static $event_class_mapping = ['add' => ['type' => 'HC','handler' => 'App\\Helpers\\HttpRequestHelper'], 'sub' => ['type' => 'CC','handler' => 'App\\Controllers\\Jobs\SubJob'],'fancy_date_time_format' => [ 'type' => 'HF','handler' => 'fancy_date_time_format'],'addNumber' => ['type' => 'HC','handler' => 'App\\Model\\HttpRequestHelper'],'excelFileFormatValidation' => ['type' => 'CC','handler' => 'App\\Controllers\\EmployeeServiceController'],'excelFileDataValidation' => ['type' => 'CC','handler' => 'App\\Controllers\\EmployeeServiceController'],'employeeOnboard' => ['type' => 'CC','handler' => 'App\\Controllers\\EmployeeServiceController'],'send_email' => ['type' => 'HC','handler' => 'App\\Helpers\\MailHelper'],'bulk_mail' => ['type' => 'HC','handler' => 'App\\Helpers\\MailHelper']];
|
||||
private static $event_class_mapping = ['add' => ['type' => 'HC','handler' => 'App\\Helpers\\HttpRequestHelper'], 'sub' => ['type' => 'CC','handler' => 'App\\Controllers\\Jobs\SubJob'],'fancy_date_time_format' => [ 'type' => 'HF','handler' => 'fancy_date_time_format'],'addNumber' => ['type' => 'HC','handler' => 'App\\Model\\HttpRequestHelper'],'excelFileFormatValidation' => ['type' => 'CC','handler' => 'App\\Controllers\\EmployeeServiceController'],'excelFileDataValidation' => ['type' => 'CC','handler' => 'App\\Controllers\\EmployeeServiceController'],'employeesOnboardPreprocess' => ['type' => 'CC','handler' => 'App\\Controllers\\EmployeeServiceController'],'employeeDisembark' => ['type' => 'CC','handler' => 'App\\Controllers\\EmployeeServiceController'],'employeesSIEnhanceProcess' => ['type' => 'CC','handler' => 'App\\Controllers\\EmployeeServiceController'],'employeesCorrectionProcess' => ['type' => 'CC','handler' => 'App\\Controllers\\EmployeeServiceController'],'send_email' => ['type' => 'HC','handler' => 'App\\Helpers\\MailHelper'],'bulk_mail' => ['type' => 'HC','handler' => 'App\\Helpers\\MailHelper']];
|
||||
public function __construct()
|
||||
{
|
||||
// echo 'HiC';//die();
|
||||
|
||||
@ -77,7 +77,7 @@ if (!function_exists('generate_excel')) {
|
||||
|
||||
if($totals == 1){
|
||||
// Call the helper function for Calculate GST, Pro Rata Premium, and Total sums for inception
|
||||
add_totals_row($spreadsheet, $data);
|
||||
add_totals_row($spreadsheet, $data, $headers);
|
||||
}else if($totals == 2){
|
||||
add_totals_for_deletion($spreadsheet, $data);
|
||||
}
|
||||
@ -268,25 +268,39 @@ if (! function_exists('transform_objects_to_array_for_deletion')) {
|
||||
|
||||
|
||||
if (!function_exists('add_totals_row')) {
|
||||
function add_totals_row(Spreadsheet $spreadsheet, array $data)
|
||||
{
|
||||
function add_totals_row(Spreadsheet $spreadsheet, array $data, array $headers)
|
||||
{
|
||||
|
||||
//find the index value
|
||||
$rata = array_search('PRO RATA PREMIUM', $headers);
|
||||
$gst = array_search('GST', $headers);
|
||||
$total = array_search('TOTAL', $headers);
|
||||
|
||||
|
||||
// Calculate GST, Pro Rata Premium, and Total sums
|
||||
$gstSum = 0;
|
||||
$proRataPremiumSum = 0;
|
||||
$totalSum = 0;
|
||||
|
||||
foreach ($data as $row) {
|
||||
$gstSum += $row[18];
|
||||
$proRataPremiumSum += $row[19];
|
||||
$totalSum += $row[20];
|
||||
$gstSum += $row[$gst];
|
||||
$proRataPremiumSum += $row[$rata];
|
||||
$totalSum += $row[$total];
|
||||
}
|
||||
|
||||
$cellValue = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
|
||||
$prev_index = $rata - 1;
|
||||
$cellValueTotal = $cellValue[$prev_index];
|
||||
$cellValueRata = $cellValue[$rata];
|
||||
$cellValueGST = $cellValue[$gst];
|
||||
$cellValueTotalSum = $cellValue[$total];
|
||||
|
||||
// Add a new row with sums
|
||||
$lastRow = count($data) + 1; // To get the last row number
|
||||
$spreadsheet->getActiveSheet()->setCellValue('R' . ($lastRow + 1), 'TOTALS');
|
||||
$spreadsheet->getActiveSheet()->setCellValue('S' . ($lastRow + 1), $gstSum);
|
||||
$spreadsheet->getActiveSheet()->setCellValue('T' . ($lastRow + 1), $proRataPremiumSum);
|
||||
$spreadsheet->getActiveSheet()->setCellValue('U' . ($lastRow + 1), $totalSum);
|
||||
$spreadsheet->getActiveSheet()->setCellValue($cellValueTotal . ($lastRow + 1), 'TOTALS');
|
||||
$spreadsheet->getActiveSheet()->setCellValue($cellValueRata . ($lastRow + 1), $proRataPremiumSum);
|
||||
$spreadsheet->getActiveSheet()->setCellValue($cellValueGST . ($lastRow + 1), $gstSum);
|
||||
$spreadsheet->getActiveSheet()->setCellValue($cellValueTotalSum . ($lastRow + 1), $totalSum);
|
||||
}
|
||||
}
|
||||
|
||||
@ -405,6 +419,19 @@ if (!function_exists('remove_underscore_capitalize_first_letter')) {
|
||||
}
|
||||
|
||||
if (!function_exists('formatDateOrReturn')) {
|
||||
|
||||
/**
|
||||
* Formats a given value as a date or returns the original value if it's not a valid date.
|
||||
*
|
||||
* This function checks if the provided value is a valid date. If it is, it formats
|
||||
* the date as 'd-M-Y' (day-month-year) format and returns it. If the value is not
|
||||
* a valid date, it returns the original value unchanged.
|
||||
*
|
||||
* @param mixed $value The value to be formatted as a date or returned unchanged.
|
||||
* @return string|mixed The formatted date if the value is a valid date, otherwise the original value.
|
||||
*/
|
||||
|
||||
|
||||
function formatDateOrReturn($value)
|
||||
{
|
||||
// Check if the value is a valid date
|
||||
|
||||
@ -67,7 +67,7 @@ if (!function_exists('check_excel_date_format')) {
|
||||
|
||||
if(!function_exists('check_relationship'))
|
||||
{
|
||||
function check_relationship($row,$relationship)
|
||||
function check_relationship($row,$relationship,$policy_terms)
|
||||
{
|
||||
// print_r($relationship);
|
||||
// echo '<br>';
|
||||
@ -78,21 +78,33 @@ if(!function_exists('check_relationship'))
|
||||
$slug = \Config\Services::slug();
|
||||
$col = $slug->slugify($row[5]);
|
||||
// echo $col;//die();
|
||||
if($col != 'self' && $col != 'spouse')
|
||||
{
|
||||
// if($col != 'self' && $col != 'spouse')
|
||||
// {
|
||||
if(!isset($relationship[ $col ]))
|
||||
{
|
||||
return array('status' => false,'error' => 'Rule Conflict: Unknown Relationship');
|
||||
}
|
||||
|
||||
if(isset($relationship[ $col ]) && $relationship[ $col ]['gender'] != $row[4])
|
||||
$family_floaters = isset($policy_terms['family_floaters']);
|
||||
if($family_floaters)
|
||||
{
|
||||
$error = "Gender relationship conflict: Expected ".$relationship[ $col ]['gender'].", received $row[4]";
|
||||
return array('status' => false,'error' => $error);
|
||||
if(isset($relationship[ $col ]) && $relationship[ $col ]['gender'] != $row[4])
|
||||
{
|
||||
$error = "Gender relationship conflict: Expected ".$relationship[ $col ]['gender'].", received $row[4]";
|
||||
return array('status' => false,'error' => $error);
|
||||
}
|
||||
}
|
||||
else // if family_floaters not set the its GPA, reject all other dependents
|
||||
{
|
||||
if($col != 'self')
|
||||
{
|
||||
$error = "Dependent(s) are not allowed";
|
||||
return array('status' => false,'error' => $error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// }
|
||||
return array('status' => true);
|
||||
}
|
||||
else
|
||||
@ -278,6 +290,26 @@ if (!function_exists('name_dup_check_within_family'))
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('check_self_available_in_family'))
|
||||
{
|
||||
function check_self_available_in_family($family_data)
|
||||
{
|
||||
|
||||
$is_self_found = false;
|
||||
foreach ($family_data as $rkey => $row)
|
||||
{
|
||||
if($row[5] != null && strtolower($row[5]) == 'self')//$row[5] = relationship $row[4] = Gender
|
||||
{
|
||||
$is_self_found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ['is_self_found' => $is_self_found,'emp_code' => $family_data[0][1]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!function_exists('name_and_empid_check_in_db'))
|
||||
@ -295,13 +327,13 @@ if (!function_exists('name_and_empid_check_in_db'))
|
||||
$res = $employeeModel
|
||||
->join('client_policy cp',"employees.client_id = cp.client_id")
|
||||
->join('employee_polices ep',"cp.id = ep.client_policy_id AND employees.id = ep.employee_id")
|
||||
->where("cp.policy_id",$policy_id)
|
||||
// ->where("cp.id",$policy_id)
|
||||
->where("employees.client_id",$client_id)
|
||||
// ->where("ep.client_id",$client_id)
|
||||
->where('name',$row[2])->where('emp_code',$row[1])
|
||||
->findAll();
|
||||
|
||||
// dd($employeeModel);
|
||||
// dd($employeeModel->getLastQuery());
|
||||
|
||||
|
||||
if(($current_action == 'deletion' || $current_action == 'correction' || $current_action == 'si_enhancement') && !count($res))
|
||||
@ -338,7 +370,7 @@ if (!function_exists('check_dependent_conflict'))
|
||||
$allowed_parent_in_laws_count = 0;
|
||||
$received_parent_in_laws_count = 0;
|
||||
$overall_famility_relationships = [];
|
||||
$self_emp_row_id = 0;
|
||||
$self_emp_row_id = null;
|
||||
$temp_counts = [2,3,4,5,6,7,8,9,10]; //temp variable for check relation repetaed count
|
||||
$slug = \Config\Services::slug();
|
||||
|
||||
@ -356,6 +388,7 @@ if (!function_exists('check_dependent_conflict'))
|
||||
// dd($allowed_adults == 0);
|
||||
foreach ($family_data as $key => $row)
|
||||
{
|
||||
// dd($family_data[0][0]);
|
||||
$relationship = $slug->slugify($row[5]);
|
||||
|
||||
if($actionArr != 'deletion' && $relationship != 'son' && $relationship != 'daughter')
|
||||
@ -411,7 +444,7 @@ if (!function_exists('check_dependent_conflict'))
|
||||
// print_r(array_values(array_count_values($overall_famility_relationships)));
|
||||
// print_r(in_array(2,array_values(array_count_values($overall_famility_relationships))));
|
||||
|
||||
if($self_gender == $spouse_gender)
|
||||
if($self_gender && $spouse_gender && $self_gender == $spouse_gender)
|
||||
{
|
||||
$result['status'] = false;
|
||||
$result['error_data'][] = ['code' => 4,'col_name' => 'gender','msg' => 'Rule conflict: Self and Spouse cannot be same gender','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];
|
||||
@ -793,7 +826,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
|
||||
if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $max_age && $slab_value['age_to'] >= $max_age))
|
||||
{
|
||||
|
||||
$emp_data['policy_details']['basic_cover_si'] = (strtolower($emp_data['relationship']) == 'self' ? $employee_received_si : null);
|
||||
$emp_data['policy_details']['date_coverage'] = (strtolower($emp_data['relationship']) == 'self' ? (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']) : "");
|
||||
$emp_data['policy_details']['policy_end_date'] = (strtolower($emp_data['relationship']) == 'self' ? $policy_terms['policy_end_date'] : "");
|
||||
$emp_data['policy_details']['days'] = (strtolower($emp_data['relationship']) == 'self' ? calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days : 0);
|
||||
@ -807,7 +840,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
break;
|
||||
case "11":
|
||||
//GMC - Maximum count per Family
|
||||
$max_count = $emp_data['temp']['maxage'];
|
||||
$max_count = $emp_data['temp']['maxcount'];
|
||||
$employee_received_band = $emp_data['temp']['band'];
|
||||
$employee_received_si = $emp_data['policy_details']['basic_cover_si'];
|
||||
$emp_data['policy_details']['basic_cover_si'] = null;
|
||||
@ -817,10 +850,10 @@ if (!function_exists('premium_calculation_manager'))
|
||||
if($slab_value['si'] == $employee_received_si && ($slab_value['grade'] == $employee_received_band))
|
||||
{
|
||||
//calculate premium based on count
|
||||
$famility_si_covered = $employee_received_si * $max_count;
|
||||
$famility_si_covered = ($famility_si_covered >= $slab_value['max_si'] ? $slab_value['max_si'] : $famility_si_covered);
|
||||
$familiy_si_covered = $employee_received_si * $max_count;
|
||||
$familiy_si_covered = ($familiy_si_covered >= $slab_value['max_si'] ? $slab_value['max_si'] : $familiy_si_covered);
|
||||
|
||||
$emp_data['policy_details']['basic_cover_si'] = (strtolower($emp_data['relationship']) == 'self' ? $famility_si_covered : 0);
|
||||
$emp_data['policy_details']['basic_cover_si'] = (strtolower($emp_data['relationship']) == 'self' ? $familiy_si_covered : null);
|
||||
$emp_data['policy_details']['date_coverage'] = (strtolower($emp_data['relationship']) == 'self' ? (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']) : "");
|
||||
$emp_data['policy_details']['policy_end_date'] = (strtolower($emp_data['relationship']) == 'self' ? $policy_terms['policy_end_date'] : "");
|
||||
$emp_data['policy_details']['days'] = (strtolower($emp_data['relationship']) == 'self' ? calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days : 0);
|
||||
|
||||
@ -34,6 +34,7 @@ class ClientPolicyModel extends Model
|
||||
"policy_terms",
|
||||
"open_for_enrollment",
|
||||
"is_addon",
|
||||
"base_policy",
|
||||
"created_by",
|
||||
"updated_by",
|
||||
"Is_active",
|
||||
@ -249,4 +250,21 @@ public function getDepositlistsummary($id)
|
||||
->getResult();
|
||||
}
|
||||
|
||||
|
||||
public function updateStatus(){
|
||||
|
||||
// Update client_policy table
|
||||
$client = $this->db->query("UPDATE client_policy SET policy_status = 0 WHERE policy_end_date < CURDATE()");
|
||||
$client_count = $this->db->affectedRows();
|
||||
// Update employee_polices table
|
||||
$employee = $this->db->query("UPDATE employee_polices SET status = 'expired' WHERE policy_end_date < CURDATE()");
|
||||
$emp_count = $this->db->affectedRows();
|
||||
|
||||
return ['client'=>$client_count, 'emp' => $emp_count];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -643,4 +643,40 @@ class EmployeePolicyModel extends Model
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
public function getEmployeePolicyForFileList($client_id, $policy_id)
|
||||
{
|
||||
$result = $this->select(['employee_polices.*','pm.name as policy_name','im.short_name as insurer_short_name','ib.branch_name as insurer_branch_name','ib.branch_code as insurer_branch_code','tpam.name as tpa_name','tpam.short_name as tpa_short_name','tpab.branch_code as tpa_branch_code','cm.client_name','cm.short_name as client_short_name','emp.relationship','emp.relationship_code','emp.change_event','emp.emp_code','emp.name','emp.email_corporate','emp.dob','emp.gender','emp.emp_status','emp.is_active as emp_is_active','emp.mobile as mobile'])
|
||||
->join('employees emp', 'employee_polices.employee_id = emp.id')
|
||||
->join('client_policy cp', 'employee_polices.client_policy_id = cp.id') //cp - client policy
|
||||
->join('policies pm', 'cp.policy_id = pm.id') //pm - policy master
|
||||
->join('insurers im', 'cp.insurer_id = im.id') //im - insurar master
|
||||
->join('insurer_branch ib', 'cp.insurer_branch_id = ib.id') //ib - insurar branch
|
||||
->join('tpa tpam', 'cp.tpa_id = tpam.id') //tpam - tpa master
|
||||
->join('tpa_branch tpab', 'cp.tpa_branch_id = tpab.id') //tpab - tpa brach
|
||||
->join('clients cm', 'cp.client_id = cm.id') //cm - client master
|
||||
->where('emp.client_id',$client_id)
|
||||
->where('employee_polices.client_policy_id',$policy_id);
|
||||
|
||||
$result->whereIn('employee_polices.status', ['draft', 'enrolled']);
|
||||
$result = $result->findAll();
|
||||
return ($result);
|
||||
}
|
||||
|
||||
|
||||
public function getViewEmpSuccessList($file_id){
|
||||
return $this->db->table('employees emp')
|
||||
->select(['employee_polices.*','pm.name as policy_name','im.short_name as insurer_short_name','ib.branch_name as insurer_branch_name','ib.branch_code as insurer_branch_code','tpam.name as tpa_name','tpam.short_name as tpa_short_name','tpab.branch_code as tpa_branch_code','cm.client_name','cm.short_name as client_short_name','emp.relationship','emp.relationship_code','emp.change_event','emp.emp_code','emp.name','emp.email_corporate','emp.dob','emp.gender','emp.emp_status','emp.is_active as emp_is_active','emp.mobile as mobile'])
|
||||
->join('employee_polices', 'employee_polices.employee_id = emp.id')
|
||||
->join('client_policy cp', 'employee_polices.client_policy_id = cp.id') //cp - client policy
|
||||
->join('policies pm', 'cp.policy_id = pm.id') //pm - policy master
|
||||
->join('insurers im', 'cp.insurer_id = im.id') //im - insurar master
|
||||
->join('insurer_branch ib', 'cp.insurer_branch_id = ib.id') //ib - insurar branch
|
||||
->join('tpa tpam', 'cp.tpa_id = tpam.id') //tpam - tpa master
|
||||
->join('tpa_branch tpab', 'cp.tpa_branch_id = tpab.id') //tpab - tpa brach
|
||||
->join('clients cm', 'cp.client_id = cm.id') //cm - client master
|
||||
->where('emp.file_id',$file_id)
|
||||
->whereIn('employee_polices.status', ['draft', 'enrolled'])
|
||||
->get()->getResultArray();
|
||||
}
|
||||
}
|
||||
@ -11,6 +11,7 @@ class InsurerModel extends Model
|
||||
protected $allowedFields = [
|
||||
"id",
|
||||
"type",
|
||||
"category",
|
||||
"name",
|
||||
"short_name",
|
||||
"created_by",
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<th class="font-weight-medium">Batch Code</th>
|
||||
<th class="font-weight-medium">File Name</th>
|
||||
<th class="font-weight-medium">Client</th>
|
||||
<th class="font-weight-medium">Client Policy</th>
|
||||
<th class="font-weight-medium">Event Type</th>
|
||||
@ -31,6 +32,7 @@
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1)?></b></td>
|
||||
<td><?php echo $file['batch_code']?></td>
|
||||
<td><?php echo $file['file_name']?></td>
|
||||
<td><?php echo $file['client_short_name']?></td>
|
||||
<td><?php echo $file['policy_name']?></td>
|
||||
<td><?php echo $file['event_type']?></td>
|
||||
|
||||
@ -75,12 +75,21 @@ $(document).ready(function() {
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Client_Deposit',
|
||||
title: 'Client Deposit Details - ' + ' <?php echo $clientName[0]['client_name'];?>',
|
||||
className: 'my_class',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
}],
|
||||
},
|
||||
{
|
||||
extend: 'pdf',
|
||||
text: 'PDF',
|
||||
title: 'Client Deposit Details - ' + ' <?php echo $clientName[0]['client_name'];?>',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
language: {
|
||||
|
||||
@ -28,6 +28,10 @@ body {
|
||||
|
||||
}
|
||||
|
||||
.navtab-bg .nav-link {
|
||||
margin: 0 5px 10px!important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="row" id="client_add">
|
||||
|
||||
85
app/Views/employee_data_list.php
Normal file
@ -0,0 +1,85 @@
|
||||
<div class="row" id="client_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 class="header-title" style="position: relative;">Employees</h4>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<table class="table table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<!-- <th class="font-weight-medium">Employee code</th> -->
|
||||
<th class="font-weight-medium">Name/code</th>
|
||||
<th class="font-weight-medium">Policy name</th>
|
||||
<th class="font-weight-medium">Insurer name</th>
|
||||
<th class="font-weight-medium">TPA ID</th>
|
||||
<th class="font-weight-medium">UHID ID</th>
|
||||
<th class="font-weight-medium">Policy status</th>
|
||||
<th class="font-weight-medium">Premium</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="font-12">
|
||||
<?php
|
||||
if(isset($employees))
|
||||
{
|
||||
foreach ($employees as $key => $employee) { ?>
|
||||
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1)?></b></td>
|
||||
<!-- <td><?php echo $employee['emp_code']?></td> -->
|
||||
<td><?php echo $employee['name']?>( <?php echo $employee['emp_code']?> )</td>
|
||||
<td><?php echo $employee['policy_name']?></td>
|
||||
<td><?php echo $employee['insurer_short_name']?></td>
|
||||
<td><?php echo $employee['tpa_id']?></td>
|
||||
<td><?php echo $employee['uhid']?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ($employee['status'] == 'draft') {
|
||||
echo '<span class="badge badge-secondary">' . $employee['status'] . '</span>';
|
||||
} elseif ($employee['status'] == 'active') {
|
||||
echo '<span class="badge badge-success">' . $employee['status'] . '</span>';
|
||||
} elseif ($employee['status'] == 'inactive') {
|
||||
echo '<span class="badge badge-warning">' . $employee['status'] . '</span>';
|
||||
}elseif ($employee['status'] == 'expired') {
|
||||
echo '<span class="badge badge-danger">' . $employee['status'] . '</span>';
|
||||
}else{
|
||||
echo $employee['status'];
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo $employee['premium']?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);"
|
||||
class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"
|
||||
aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="#"><i
|
||||
class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit
|
||||
Ticket</a>
|
||||
<a class="dropdown-item" href="#"><i
|
||||
class="mdi mdi-check-all mr-2 text-muted font-18 vertical-middle"></i>Close</a>
|
||||
<a class="dropdown-item" href="#"><i
|
||||
class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Remove</a>
|
||||
<a class="dropdown-item" href="#"><i
|
||||
class="mdi mdi-star mr-2 font-18 text-muted vertical-middle"></i>Mark as
|
||||
Unread</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }}?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
@ -68,89 +68,9 @@ table.dataTable tbody td {
|
||||
|
||||
|
||||
|
||||
<div class="row" id="client_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 class="header-title" style="position: relative;">Employees</h4>
|
||||
</div>
|
||||
<?php include('employee_data_list.php');?>
|
||||
|
||||
</div>
|
||||
<table class="table table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<!-- <th class="font-weight-medium">Employee code</th> -->
|
||||
<th class="font-weight-medium">Name/code</th>
|
||||
<th class="font-weight-medium">Policy name</th>
|
||||
<th class="font-weight-medium">Insurer name</th>
|
||||
<th class="font-weight-medium">TPA ID</th>
|
||||
<th class="font-weight-medium">UHID ID</th>
|
||||
<th class="font-weight-medium">Policy status</th>
|
||||
<th class="font-weight-medium">Premium</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="font-12">
|
||||
<?php
|
||||
if(isset($employees))
|
||||
{
|
||||
foreach ($employees as $key => $employee) { ?>
|
||||
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1)?></b></td>
|
||||
<!-- <td><?php echo $employee['emp_code']?></td> -->
|
||||
<td><?php echo $employee['name']?>( <?php echo $employee['emp_code']?> )</td>
|
||||
<td><?php echo $employee['policy_name']?></td>
|
||||
<td><?php echo $employee['insurer_short_name']?></td>
|
||||
<td><?php echo $employee['tpa_id']?></td>
|
||||
<td><?php echo $employee['uhid']?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ($employee['status'] == 'draft') {
|
||||
echo '<span class="badge badge-secondary">' . $employee['status'] . '</span>';
|
||||
} elseif ($employee['status'] == 'active') {
|
||||
echo '<span class="badge badge-success">' . $employee['status'] . '</span>';
|
||||
} elseif ($employee['status'] == 'inactive') {
|
||||
echo '<span class="badge badge-warning">' . $employee['status'] . '</span>';
|
||||
}elseif ($employee['status'] == 'expired') {
|
||||
echo '<span class="badge badge-danger">' . $employee['status'] . '</span>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo $employee['premium']?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);"
|
||||
class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"
|
||||
aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="#"><i
|
||||
class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit
|
||||
Ticket</a>
|
||||
<a class="dropdown-item" href="#"><i
|
||||
class="mdi mdi-check-all mr-2 text-muted font-18 vertical-middle"></i>Close</a>
|
||||
<a class="dropdown-item" href="#"><i
|
||||
class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Remove</a>
|
||||
<a class="dropdown-item" href="#"><i
|
||||
class="mdi mdi-star mr-2 font-18 text-muted vertical-middle"></i>Mark as
|
||||
Unread</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }}?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
<div id="loader" class="loader" style="display:none;">SPINNER</div>
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion1">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
<form id="emp-upload-form" action="<?php echo base_url().'employee/upload'?>" method="post">
|
||||
<form class="parsley-examples" id="emp-upload-form" action="<?php echo base_url().'employee/upload'?>" method="post">
|
||||
<input type="hidden" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>"
|
||||
id="csrf_token">
|
||||
|
||||
@ -31,14 +31,14 @@
|
||||
<div class="form-group col-md-4">
|
||||
<label>Client</label> <br />
|
||||
<select name="client_id" class="form-control" id="client_id" required>
|
||||
<option value="">Select</option>
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Policy</label> <br />
|
||||
<select name="policy_id" class="form-control" id="policy_id">
|
||||
<option value="">Select</option>
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -85,6 +85,15 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-2" style="margin-top: 26px;position: relative;left: 65px;"> OR </div>
|
||||
|
||||
<div class="form-group col-md-4" style="margin-top: 18px;">
|
||||
<a class="btn btn-primary waves-effect waves-light justify-content-end"
|
||||
id="fetch_enrolled_data" data-toggle="modal" data-target="#full-width-modal"
|
||||
title="Download Sample Excel">Featch Enrolled Data</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -107,6 +116,25 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div id="full-width-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="fullWidthModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-full-width">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="fullWidthModalLabel">Enrolled Employee List</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body" id="emp_data">
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
|
||||
|
||||
<!-- Center modal content -->
|
||||
<div class="modal fade" id="file-err-modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
@ -153,6 +181,13 @@ $(document).ready(function() {
|
||||
event.preventDefault(); // Prevent default form submission
|
||||
console.log('submit called');
|
||||
|
||||
|
||||
var isValid = $('#emp-upload-form').parsley().validate();
|
||||
if (!isValid) {
|
||||
console.log('Form is Empty', 'Warning');
|
||||
return;
|
||||
}
|
||||
|
||||
var action_item = $('#upload-action-type').val();
|
||||
var policy_id = $('#policy_id').val();
|
||||
console.log('action_item - ' + action_item);
|
||||
@ -161,8 +196,10 @@ $(document).ready(function() {
|
||||
// $('#policy_id').prop('title', 'plz choose policy');
|
||||
// $('#policy_id').mouseover();
|
||||
console.log('required');
|
||||
alert('please choose policy for this uploaing event ');
|
||||
// alert('please choose policy for this uploaing event ');
|
||||
toastr.warning('please choose policy for this uploaing event', 'warning')
|
||||
return false;
|
||||
|
||||
} else {
|
||||
|
||||
$('#policy_id').attr('required', false);
|
||||
@ -230,9 +267,6 @@ $(document).ready(function() {
|
||||
$(window).on("load", function() {
|
||||
console.log("window loaded");
|
||||
fetchClientPolicies();
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -281,85 +315,109 @@ function fetchFileError(file_id) {
|
||||
console.log('fetchFileError');
|
||||
console.log(apiURL);
|
||||
$.ajax({
|
||||
url: apiURL,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
},
|
||||
success: function(response) {
|
||||
|
||||
$(this).find(".modal-body").html("");
|
||||
if (response.code === 200 && response.dataStatus === true && response.data !== "")
|
||||
{
|
||||
try {
|
||||
console.log((JSON.parse(response.data)));
|
||||
var file_error_data = (JSON.parse(response.data));
|
||||
var file_error_html = "";
|
||||
|
||||
for (var key in file_error_data['error_summary']) {
|
||||
console.log(key);
|
||||
var err_id = key;
|
||||
var err_count = file_error_data['error_summary'][key];
|
||||
switch (err_id) {
|
||||
case 1:
|
||||
file_error_html += "<strong>Mandatory values missing</strong> <span class='badge badge-danger float-right'>" + err_count + "</span>";
|
||||
break;
|
||||
case 2:
|
||||
file_error_html += "<strong>Values not in expected format</strong> <span class='badge badge-danger float-right'>" + err_count + "</span>";
|
||||
break;
|
||||
case 3:
|
||||
file_error_html += "<strong>Field contains not allowed values</strong> <span class='badge badge-danger float-right'>" + err_count + "</span>";
|
||||
break;
|
||||
case 4:
|
||||
file_error_html += "<strong>Rule Conflict</strong> <span class='badge badge-danger float-right'>" + err_count + "</span>";
|
||||
break;
|
||||
case 5:
|
||||
file_error_html += "<strong>" + file_error_data['error_data'] + "</strong>";
|
||||
break;
|
||||
case 6:
|
||||
file_error_html += "<strong>" + file_error_data['error_data'] + "</strong>";
|
||||
break;
|
||||
case 7:
|
||||
file_error_html += "<strong>Duplicate entry in file</strong> <span class='badge badge-danger float-right'>" + err_count + "</span>";
|
||||
break;
|
||||
case 8:
|
||||
file_error_html += "to be config";
|
||||
break;
|
||||
case 9:
|
||||
file_error_html += "<strong>Duplicate entry</strong> <span class='badge badge-danger float-right'>" + err_count + "</span>";
|
||||
break;
|
||||
case 10:
|
||||
file_error_html += "<strong>Duplicate entry in file</strong> <span class='badge badge-danger float-right'>" + err_count + "</span>";
|
||||
break;
|
||||
case 11:
|
||||
file_error_html += "<strong>Rule conflict: Dependents not allowed</strong> <span class='badge badge-danger float-right'>" + err_count + "</span>";
|
||||
break;
|
||||
case 12:
|
||||
file_error_html += "<strong>Rule conflict: Dependent count greater than allowed dependent count</strong> <span class='badge badge-danger float-right'>" + err_count + "</span>";
|
||||
break;
|
||||
case 13:
|
||||
file_error_html += "<strong>Rule conflict: Twofold relationship found within family</strong> <span class='badge badge-danger float-right'>" + err_count + "</span>";
|
||||
break;
|
||||
url: apiURL,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
},
|
||||
success: function(response) {
|
||||
|
||||
default:
|
||||
file_error_html += "";
|
||||
break;
|
||||
}
|
||||
file_error_html += (err_id == 1 ?
|
||||
"<strong>Mandatory values missing</strong> <span class='badge badge-danger float-right'>" +
|
||||
err_count + "</span>" : (err_id == 2 ?
|
||||
"<strong>Values not in expected format</strong> <span class='badge badge-danger float-right'>" +
|
||||
err_count + "</span>" : (err_id == 3 ?
|
||||
$(this).find(".modal-body").html("");
|
||||
if (response.code === 200 && response.dataStatus === true && response.data !== "") {
|
||||
try {
|
||||
console.log((JSON.parse(response.data)));
|
||||
var file_error_data = (JSON.parse(response.data));
|
||||
var file_error_html = "";
|
||||
|
||||
for (var key in file_error_data['error_summary']) {
|
||||
// console.log(key);
|
||||
var err_id = parseInt(key);
|
||||
var err_count = file_error_data['error_summary'][key];
|
||||
switch (err_id) {
|
||||
case 1:
|
||||
file_error_html +=
|
||||
"<strong>Mandatory values missing</strong> <span class='badge badge-danger float-right'>" +
|
||||
err_count + "</span>";
|
||||
break;
|
||||
case 2:
|
||||
file_error_html +=
|
||||
"<strong>Values not in expected format</strong> <span class='badge badge-danger float-right'>" +
|
||||
err_count + "</span>";
|
||||
break;
|
||||
case 3:
|
||||
file_error_html +=
|
||||
"<strong>Field contains not allowed values</strong> <span class='badge badge-danger float-right'>" +
|
||||
err_count + "</span>" : (err_id == 4 ?
|
||||
"<strong>Rule Conflict</strong> <span class='badge badge-danger float-right'>" +
|
||||
err_count + "</span>" : (err_id == 5 ? "<strong>" +
|
||||
file_error_data['error_data'] + "</strong>" : (err_id ==
|
||||
6 ?
|
||||
"<strong>" + file_error_data['error_data'] +
|
||||
"</strong>" : ""))))));
|
||||
err_count + "</span>";
|
||||
break;
|
||||
case 4:
|
||||
file_error_html +=
|
||||
"<strong>Rule Conflict</strong> <span class='badge badge-danger float-right'>" +
|
||||
err_count + "</span>";
|
||||
break;
|
||||
case 5:
|
||||
file_error_html += "<strong>" + file_error_data['error_data'] + "</strong>";
|
||||
break;
|
||||
case 6:
|
||||
file_error_html += "<strong>" + file_error_data['error_data'] + "</strong>";
|
||||
break;
|
||||
case 7:
|
||||
file_error_html +=
|
||||
"<strong>Duplicate entry in file</strong> <span class='badge badge-danger float-right'>" +
|
||||
err_count + "</span>";
|
||||
break;
|
||||
case 8:
|
||||
file_error_html += "to be config";
|
||||
break;
|
||||
case 9:
|
||||
file_error_html +=
|
||||
"<strong>Duplicate entry</strong> <span class='badge badge-danger float-right'>" +
|
||||
err_count + "</span>";
|
||||
break;
|
||||
case 10:
|
||||
file_error_html +=
|
||||
"<strong>Duplicate entry in file</strong> <span class='badge badge-danger float-right'>" +
|
||||
err_count + "</span>";
|
||||
break;
|
||||
case 11:
|
||||
file_error_html +=
|
||||
"<strong>Rule conflict: Dependents not allowed</strong> <span class='badge badge-danger float-right'>" +
|
||||
err_count + "</span>";
|
||||
break;
|
||||
case 12:
|
||||
file_error_html +=
|
||||
"<strong>Rule conflict: Dependent count greater than allowed dependent count</strong> <span class='badge badge-danger float-right'>" +
|
||||
err_count + "</span>";
|
||||
break;
|
||||
case 13:
|
||||
file_error_html +=
|
||||
"<strong>Rule conflict: Twofold relationship found within family</strong> <span class='badge badge-danger float-right'>" +
|
||||
err_count + "</span>";
|
||||
break;
|
||||
|
||||
default:
|
||||
file_error_html += "";
|
||||
break;
|
||||
}
|
||||
|
||||
// console.log('file_error_html_1', file_error_html)
|
||||
|
||||
// file_error_html += (err_id == 1 ?
|
||||
// "<strong>Mandatory values missing</strong> <span class='badge badge-danger float-right'>" +
|
||||
// err_count + "</span>" : (err_id == 2 ?
|
||||
// "<strong>Values not in expected format</strong> <span class='badge badge-danger float-right'>" +
|
||||
// err_count + "</span>" : (err_id == 3 ?
|
||||
// "<strong>Field contains not allowed values</strong> <span class='badge badge-danger float-right'>" +
|
||||
// err_count + "</span>" : (err_id == 4 ?
|
||||
// "<strong>Rule Conflict</strong> <span class='badge badge-danger float-right'>" +
|
||||
// err_count + "</span>" : (err_id == 5 ? "<strong>" +
|
||||
// file_error_data['error_data'] + "</strong>" : (err_id ==
|
||||
// 6 ?
|
||||
// "<strong>" + file_error_data['error_data'] +
|
||||
// "</strong>" : ""))))));
|
||||
file_error_html += '<br/>';
|
||||
// }
|
||||
// // }
|
||||
|
||||
// console.log('file_error_html_2', file_error_html)
|
||||
|
||||
}
|
||||
if (err_id != 5 && err_id != 6) {
|
||||
@ -369,7 +427,7 @@ function fetchFileError(file_id) {
|
||||
"' target=_blank>click here to more details...</a>" : "");
|
||||
}
|
||||
|
||||
console.log(file_error_html);
|
||||
// console.log(file_error_html);
|
||||
$('#file-err-modal').find(".modal-body").html(file_error_html);
|
||||
return file_error_html;
|
||||
} catch (error) {
|
||||
@ -439,7 +497,7 @@ function fetchEmpolyeeList(event) {
|
||||
var policy_id = $('#policy_id').val();
|
||||
console.log(client_id + '-' + policy_id);
|
||||
if (client_id == '0' || policy_id == '0') {
|
||||
alert('Please select values in both dropdowns.');
|
||||
toastr.warning('Please select values in both dropdowns.');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -508,5 +566,70 @@ document.getElementById('toggleIcon1').addEventListener('click', function() {
|
||||
icon.classList.toggle('mdi-chevron-down');
|
||||
icon.classList.toggle('mdi-chevron-up');
|
||||
});
|
||||
|
||||
$('#fetch_enrolled_data').click(function(){
|
||||
|
||||
$('#emp_data').empty();
|
||||
var client_id = $('#client_id').val();
|
||||
var policy_id = $('#policy_id').val();
|
||||
var action = $('#upload-action-type').val();
|
||||
console.log(client_id + '-' + policy_id);
|
||||
if (client_id == '0' || policy_id == '0') {
|
||||
toastr.warning('please select the client and policy for this uploaing event', 'warning')
|
||||
$('#full-width-modal').modal('hide');
|
||||
return;
|
||||
}
|
||||
|
||||
var queryParams = {
|
||||
client_id: client_id,
|
||||
policy_id: policy_id,
|
||||
action: action
|
||||
};
|
||||
|
||||
console.log('queryParams', queryParams)
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
console.log('queryString', queryString)
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
var uri = '<?= base_url('util/featch-emp-list')?>?'+queryString
|
||||
console.log(uri)
|
||||
|
||||
$.ajax({
|
||||
url:uri,
|
||||
data: {
|
||||
client_id: client_id,
|
||||
policy_id: policy_id
|
||||
},
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
console.log(res);
|
||||
|
||||
if (res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
$('#emp_data').html(res.data);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something went wrong', 'Warning');
|
||||
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
//--------------------------------------------------------------------------------------
|
||||
</script>
|
||||
@ -1,3 +1,5 @@
|
||||
<link rel="shortcut icon" href="<?= base_url()."public"; ?>/assets/images/Nhance_Favi.svg">
|
||||
<title>Excel Error Report</title>
|
||||
<!-- Include DataTables CSS -->
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.5/css/jquery.dataTables.min.css">
|
||||
<!-- Include DataTables Buttons CSS -->
|
||||
|
||||
@ -1,14 +1,26 @@
|
||||
<style>
|
||||
.modal-full-width {
|
||||
width: 95% !important;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.reload:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 class="header-title" style="position: relative;">Files</h4>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 class="header-title" style="position: relative;">Files</h4>
|
||||
</div>
|
||||
<table class="table table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
|
||||
</div>
|
||||
<table class="table table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<th class="font-weight-medium">File name</th>
|
||||
@ -17,11 +29,12 @@
|
||||
<th class="font-weight-medium">Event</th>
|
||||
<th class="font-weight-medium">User/Time</th>
|
||||
<th class="font-weight-medium">Status</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</thead>
|
||||
|
||||
<tbody class="font-12">
|
||||
<?php
|
||||
<tbody class="font-12">
|
||||
<?php
|
||||
if(isset($fileList))
|
||||
{
|
||||
foreach ($fileList as $key => $file) { //print_r((json_decode($file['reason'])));
|
||||
@ -29,23 +42,258 @@
|
||||
// $reason = "{'date':'value data kbckl kcn/aksl'}";
|
||||
// echo $reason;
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1)?></b></td>
|
||||
<td><?php echo $file['file_name']?></td>
|
||||
<td><?php echo $file['short_name']?></td>
|
||||
<td><?php echo $file['policy_name']?></td>
|
||||
<td><?php echo $file['action']?></td>
|
||||
<td><?php echo fancy_date_time_format($file['created_at']).' by <strong>'.$file['first_name'].'</strong>'?></td>
|
||||
<td><?php echo $file['status']; if($file['status'] == 'failed')
|
||||
{
|
||||
echo "<span class='col-xl-3 col-lg-4 col-sm-6'> <i class='fe-alert-circle' data-toggle='modal' data-target='#file-err-modal' data-err=".$file['id']."></i></span>";
|
||||
}?></td>
|
||||
</tr>
|
||||
<?php }}?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1)?></b></td>
|
||||
<td><?php echo $file['file_name']?></td>
|
||||
<td><?php echo $file['short_name']?></td>
|
||||
<td><?php echo $file['policy_name']?></td>
|
||||
<td><?php echo $file['action']?></td>
|
||||
<td><?php echo fancy_date_time_format($file['created_at']).' by <strong>'.$file['first_name'].'</strong>'?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if($file['status'] == 'failed')
|
||||
{
|
||||
echo $file['status'] . " <span class='col-xl-3 col-lg-4 col-sm-6'> <i class='fe-alert-circle' data-toggle='modal' data-target='#file-err-modal' data-err=".$file['id']."></i></span>";
|
||||
|
||||
}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>';
|
||||
|
||||
}else{
|
||||
echo $file['status'];
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm"
|
||||
data-toggle="dropdown" aria-expanded="false"><i
|
||||
class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<?php if($file['status'] == 'failed') { ?>
|
||||
<a data-id="<?= htmlspecialchars(json_encode($file)) ?>" data-toggle="modal"
|
||||
data-target="#file-upload-modal" class="dropdown-item upload_button" href="#"><i
|
||||
class="mdi mdi-upload mr-2 text-muted font-18 vertical-middle"></i>Re-Upload</a>
|
||||
<?php } ?>
|
||||
<a class="dropdown-item"
|
||||
href="<?= base_url("util/download-file-list/").$file['file_name']; ?>"><i
|
||||
class="mdi mdi-download mr-2 text-muted font-18 vertical-middle"></i>Download</a>
|
||||
|
||||
<a data-id="<?php echo $file['id']?>" data-toggle="modal"
|
||||
data-target="#full-width-modal-emp-list" class="dropdown-item view_emp_list"
|
||||
href="#"><i
|
||||
class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>View</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }}?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
|
||||
|
||||
<div id="full-width-modal-emp-list" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="fullWidthModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-full-width">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="fullWidthModalLabel">Upload Employee List <span id="title_header_name"></span></h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body" id="emp_data_success">
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
|
||||
<!-- Center modal content for reupload file-->
|
||||
<div class="modal fade" id="file-upload-modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myCenterModalLabel">Reupload the file</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="parsley-examples" id="uploadForm" action="<?php echo base_url().'employee/upload'?>"
|
||||
enctype="multipart/form-data">
|
||||
<input type="hidden" id="file_client_id" name="client_id">
|
||||
<input type="hidden" id="file_policy_id" name="policy_id">
|
||||
<input type="hidden" id="file_upload_actions" name="upload-action-type">
|
||||
<input type="file" id="fileInput" name="emplist" required
|
||||
accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet">
|
||||
<button type="submit" class="btn btn-primary">Upload</button>
|
||||
</form>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
|
||||
<script>
|
||||
$('body').on('click', '.view_emp_list', function() {
|
||||
|
||||
console.log('file_id');
|
||||
$('#emp_data_success').empty();
|
||||
$('#title').html(' ');
|
||||
var file_id = $(this).attr('data-id');
|
||||
console.log(file_id);
|
||||
|
||||
var queryParams = {
|
||||
file_id: file_id,
|
||||
};
|
||||
|
||||
console.log('queryParams', queryParams)
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
console.log('queryString', queryString)
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
var uri = '<?= base_url('util/view-success-emp-list')?>?' + queryString
|
||||
console.log(uri)
|
||||
|
||||
$.ajax({
|
||||
url: uri,
|
||||
data: {
|
||||
file_id: file_id,
|
||||
},
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
console.log(res);
|
||||
|
||||
if (res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
var title = " - ";
|
||||
|
||||
if (res.file_data) {
|
||||
title += (res.file_data.file_name || "") + " - ";
|
||||
title += (res.file_data.short_name || "") + " - ";
|
||||
title += (res.file_data.policy_name || "") + " - ";
|
||||
title += (res.file_data.action || "") + " - ";
|
||||
title += (res.file_data.status || "");
|
||||
}
|
||||
|
||||
$('#title_header_name').html(title);
|
||||
$('#emp_data_success').html(res.data);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something went wrong', 'Warning');
|
||||
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
$('body').on('click', '.upload_button', function() {
|
||||
|
||||
$('#uploadForm')[0].reset();
|
||||
console.log('file_id');
|
||||
var fileId = JSON.parse(this.getAttribute('data-id'));
|
||||
console.log(fileId); // Use fileId as needed
|
||||
$('#file_client_id').val(fileId.client_id)
|
||||
$('#file_policy_id').val(fileId.client_policy_id)
|
||||
$('#file_upload_actions').val(fileId.action)
|
||||
})
|
||||
|
||||
|
||||
$('#uploadForm').submit(function() {
|
||||
|
||||
var isValid = $('#uploadForm').parsley().validate();
|
||||
if (!isValid) {
|
||||
console.log('Form is Empty', 'Warning');
|
||||
return;
|
||||
}
|
||||
|
||||
// Create FormData object
|
||||
var formData = new FormData($(this)[0]);
|
||||
for (var pair of formData.entries()) {
|
||||
console.log(pair[0] + ', ' + pair[1]);
|
||||
}
|
||||
|
||||
// return false;
|
||||
$.ajax({
|
||||
url: $(this).attr("action"),
|
||||
type: "POST",
|
||||
data: formData,
|
||||
processData: false, // Prevent jQuery from automatically processing the data
|
||||
contentType: false, // Let jQuery handle the content type
|
||||
headers: {
|
||||
// "Content-Type":"multipart/form-data",
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
},
|
||||
success: function(response) {
|
||||
|
||||
console.log(response);
|
||||
$('#uploadForm')[0].reset();
|
||||
|
||||
if (response.code === 200 && response.dataStatus === true && response
|
||||
.data !== "") {
|
||||
toastr.success(
|
||||
'File upload successs, Data validation is in-progress',
|
||||
'success');
|
||||
|
||||
window.location.reload(true);
|
||||
} else if (response.code === 404 && response.dataStatus === false) {
|
||||
console.error('no data found', response);
|
||||
// alert(response.message);
|
||||
toastr.error(response.message, 'Failed');
|
||||
window.location.reload(true);
|
||||
} else {
|
||||
console.error('Something went wrong!');
|
||||
// alert('Something went wrong! Try later');
|
||||
toastr.error('Something went wrong! Try later', 'Error');
|
||||
window.location.reload(true);
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Request failed, handle error
|
||||
console.error("Request failed:", status, error);
|
||||
toastr.error('Something went wrong! Try later', 'Error');
|
||||
$('#uploadForm')[0].reset();
|
||||
window.location.reload(true);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
$('body').on('click', '.reload', function() {
|
||||
|
||||
console.log('status');
|
||||
status = this.getAttribute('data-id')
|
||||
console.log(status);
|
||||
if (status == 'inprogress') {
|
||||
window.location.reload(true);
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@ -2,38 +2,56 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<form role="form" class="parsley-examples" method="post" id="insurer_general_form" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="insurer_General_PrimaryKey" value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>"/>
|
||||
<form role="form" class="parsley-examples" method="post" id="insurer_general_form"
|
||||
enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="insurer_General_PrimaryKey"
|
||||
value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>" />
|
||||
<input type="hidden" name="insurer_id" id="insurer_id" />
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="entity_type_id">Insurer Type <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="type" name="type" required>
|
||||
<option value="">Select Type</option>
|
||||
<?php foreach ($types as $type): ?>
|
||||
<option value="<?= $type->id; ?>" <?= isset($insurer['type']) && $insurer['type'] == $type->id ? 'selected' : ''; ?>>
|
||||
<?= $type->name; ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="insurer_name">Insurer Name<span
|
||||
class="text-danger">*</span></label>
|
||||
<label for="insurer_name">Insurer Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="insurer_name"
|
||||
placeholder="Enter Insurer Name" value="<?= isset($insurer['name']) ? $insurer['name'] : '' ?>" name="name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="short_name">Insurer Short Name<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="short_name"
|
||||
placeholder="Enter Short Name" value="<?= isset($insurer['short_name']) ? $insurer['short_name'] : '' ?>" name="short_name" required>
|
||||
placeholder="Enter Insurer Name"
|
||||
value="<?= isset($insurer['name']) ? $insurer['name'] : '' ?>" name="name" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-2">
|
||||
<label for="short_name">Insurer Short Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="short_name" placeholder="Enter Short Name"
|
||||
value="<?= isset($insurer['short_name']) ? $insurer['short_name'] : '' ?>"
|
||||
name="short_name" required minlength="3" maxlength="8">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="html">Insurer Type</label><br>
|
||||
<div style="margin-top: 10px;">
|
||||
<input type="radio" id="html" name="type" value="pvt" <?= isset($insurer['type']) && $insurer['type'] == 'pvt' ? 'checked' : '' ?>>
|
||||
<label for="html">PVT</label>
|
||||
<input type="radio" id="css" name="type" value="psu" <?= isset($insurer['type']) && $insurer['type'] == 'psu' ? 'checked' : '' ?>>
|
||||
<label for="css">PSU</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4" style="position: relative;right: 0px;">
|
||||
<label for="html">Insurer Category</label><br>
|
||||
<div style="margin-top: 10px;">
|
||||
<input type="radio" id="html" name="category" value="life" <?= isset($insurer['category']) && $insurer['category'] == 'life' ? 'checked' : '' ?>>
|
||||
<label for="html">Life</label>
|
||||
<input type="radio" id="css" name="category" value="general" <?= isset($insurer['category']) && $insurer['category'] == 'general' ? 'checked' : '' ?>>
|
||||
<label for="css" style="position: absolute;left: 70px;">General(Non Life)</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
@ -50,30 +68,29 @@
|
||||
<!-- end -->
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function () {
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#insurer_general_form").submit(function(events) {
|
||||
|
||||
events.preventDefault();
|
||||
events.preventDefault();
|
||||
// var isValid = validateForm();
|
||||
|
||||
|
||||
var isValid = true;
|
||||
jQuery.each(events.target, function(index, event) {
|
||||
if (event.validity.valid) {
|
||||
jQuery.each(events.target, function(index, event) {
|
||||
if (event.validity.valid) {
|
||||
|
||||
}else{
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
|
||||
var PrimaryKey = $('#insurer_General_PrimaryKey').val();
|
||||
var PrimaryKey = $('#insurer_General_PrimaryKey').val();
|
||||
var form_action = '';
|
||||
if (isValid) {
|
||||
|
||||
if(PrimaryKey === ''){
|
||||
if (PrimaryKey === '') {
|
||||
form_action = '<?= base_url("master/insurer/createpost"); ?>';
|
||||
}else{
|
||||
} else {
|
||||
form_action = '<?= base_url("master/insurer/edit"); ?>';
|
||||
}
|
||||
|
||||
@ -82,7 +99,7 @@ $(document).ready(function () {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: form_action,
|
||||
@ -114,49 +131,48 @@ $(document).ready(function () {
|
||||
// });
|
||||
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function validateForm() {
|
||||
var isValid = true;
|
||||
|
||||
// Perform validation for each field
|
||||
$('#insurer_general_form input, #insurer_general_form select').each(function() {
|
||||
// Check for empty text inputs and selects
|
||||
if ($(this).is('input[type="text"]') || $(this).is('select')) {
|
||||
if ($.trim($(this).val()) == '') {
|
||||
alert('Please fill in all fields');
|
||||
isValid = false;
|
||||
return false; // Exit the loop early
|
||||
}
|
||||
}
|
||||
|
||||
// Check for file inputs (assuming image files)
|
||||
if ($(this).is('input[type="file"]')) {
|
||||
var fileInput = $(this)[0];
|
||||
if (fileInput.files.length === 0) {
|
||||
alert('Please select an image file');
|
||||
isValid = false;
|
||||
return false; // Exit the loop early
|
||||
}
|
||||
}
|
||||
});
|
||||
function validateForm() {
|
||||
var isValid = true;
|
||||
|
||||
return isValid;
|
||||
}
|
||||
// Perform validation for each field
|
||||
$('#insurer_general_form input, #insurer_general_form select').each(function() {
|
||||
// Check for empty text inputs and selects
|
||||
if ($(this).is('input[type="text"]') || $(this).is('select')) {
|
||||
if ($.trim($(this).val()) == '') {
|
||||
alert('Please fill in all fields');
|
||||
isValid = false;
|
||||
return false; // Exit the loop early
|
||||
}
|
||||
}
|
||||
|
||||
// Check for file inputs (assuming image files)
|
||||
if ($(this).is('input[type="file"]')) {
|
||||
var fileInput = $(this)[0];
|
||||
if (fileInput.files.length === 0) {
|
||||
alert('Please select an image file');
|
||||
isValid = false;
|
||||
return false; // Exit the loop early
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@ -6,12 +6,12 @@
|
||||
<title><?= isset($page_name) ? $page_name : 'NHance'; ?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta content="" name="description" />
|
||||
<meta content="nHANCE" name="nHANCE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta content="NHANCE" name="NHANCE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
|
||||
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="<?= base_url()."public"; ?>/assets/images/favicon.ico">
|
||||
<link rel="shortcut icon" href="<?= base_url()."public"; ?>/assets/images/Nhance_Favi.svg">
|
||||
|
||||
<!-- plugin css -->
|
||||
<link href="<?= base_url()."public"; ?>/assets/libs/admin-resources/jquery.vectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />
|
||||
@ -238,6 +238,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <img src="<?= base_url()."public" ?>/assets/images/nhance-loader-fast.gif" height="40" width="40" alt="Loading..."> -->
|
||||
<!-- Begin page -->
|
||||
<div id="wrapper">
|
||||
|
||||
@ -451,18 +452,18 @@
|
||||
<div class="logo-box">
|
||||
<a href="https://localhost/nhance/dashboard/view" class="logo logo-dark text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url()."public"; ?>/assets/images/n.png" alt="" height="24">
|
||||
<img src="<?= base_url()."public"; ?>/assets/images/Nhance_Favi.svg" alt="" height="24">
|
||||
<!-- <span class="logo-lg-text-light">NHANCE</span> -->
|
||||
</span>
|
||||
<span class="logo-lg">
|
||||
<img src="<?= base_url()."public"; ?>/assets/images/logo-dark.png" alt="" height="20">
|
||||
<img src="<?= base_url()."public"; ?>/assets/images/Nhance_Favi.svg" alt="" height="20">
|
||||
<!-- <span class="logo-lg-text-light">M</span> -->
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="https://localhost/nhance/dashboard/view" class="logo logo-light text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url()."public"; ?>/assets/images/n.png" alt="" height="24">
|
||||
<img src="<?= base_url()."public"; ?>/assets/images/Nhance_Favi.svg" alt="" height="24">
|
||||
</span>
|
||||
<!-- <span class="logo-lg">
|
||||
<img src="<?= base_url()."public"; ?>/assets/images/logo-light.png" alt="" height="20">
|
||||
@ -515,14 +516,13 @@
|
||||
|
||||
<a href="<?= base_url('/dashboard/view')?>" class="logo logo-light text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url()."public"; ?>/assets/images/n.png" alt="" height="24">
|
||||
<img src="<?= base_url()."public"; ?>/assets/images/Nhance_Favi_white_2.png" alt="" width="30" height="30">
|
||||
</span>
|
||||
<!-- <span class="logo-lg">
|
||||
<img src="<?= base_url()."public"; ?>./assets/images/logo-light.png" alt="" height="20">
|
||||
</span> -->
|
||||
</a>
|
||||
</div>
|
||||
<!-- >>>>>>> 47b829183b576482986f721bd598c48341c0bbec -->
|
||||
|
||||
<div class="h-100" data-simplebar>
|
||||
|
||||
|
||||
@ -3,13 +3,14 @@
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>nHANCE</title>
|
||||
<title>NHANCE</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta content="A fully featured CRM" name="description" />
|
||||
<meta content="Venba info tech" name="author" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="<?= base_url()."public"; ?>/assets/images/favicon.ico">
|
||||
<link rel="shortcut icon" href="<?= base_url()."public"; ?>/assets/images/Nhance_Favi.svg">
|
||||
|
||||
<!-- App css -->
|
||||
<link href="<?= base_url()."public"; ?>/assets/css/bootstrap-material.min.css" rel="stylesheet" type="text/css"
|
||||
|
||||
@ -111,11 +111,10 @@
|
||||
<tbody>
|
||||
<?php foreach($depositdata as $row) { ?>
|
||||
<tr id="<?php echo $row->id;?>">
|
||||
<td class=""><?php echo date('d-m-y h:i A', strtotime($row->created_at)); ?></td>
|
||||
<td><?php echo date('d-M-Y h:i A', strtotime($row->created_at)); ?></td>
|
||||
<td><?php echo $row->username; ?></td>
|
||||
<td><?php echo $row->description; ?></td>
|
||||
<td><?php echo isset($subTypeOptions[$row->sub_type]) ? $subTypeOptions[$row->sub_type] : ''; ?>
|
||||
</td>
|
||||
<td><?php echo isset($subTypeOptions[$row->sub_type]) ? $subTypeOptions[$row->sub_type] : ''; ?></td>
|
||||
<td><?php echo ($row->transaction_type == 'Credit') ? $row->amount : ''; ?></td>
|
||||
<td><?php echo ($row->transaction_type == 'Debit') ? $row->amount : ''; ?></td>
|
||||
<td><?php echo $row->balance; ?></td>
|
||||
@ -229,7 +228,16 @@ $(document).ready(function() {
|
||||
exportOptions: {
|
||||
columns: ''
|
||||
}
|
||||
}],
|
||||
},
|
||||
{
|
||||
extend: 'pdf',
|
||||
text: 'PDF',
|
||||
title: 'TransactionDetails',
|
||||
exportOptions: {
|
||||
columns: ''
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
language: {
|
||||
|
||||
38
app/Views/view_file_upload_emp_list.php
Normal file
@ -0,0 +1,38 @@
|
||||
<style>
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="responsive-table-plugin">
|
||||
<div class="table-rep-plugin">
|
||||
<div class="table-responsive" data-pattern="priority-columns">
|
||||
<table id="tech-companies-1" class="table table-striped">
|
||||
<thead class="bg-light">
|
||||
<?php foreach ($thead as $header): ?>
|
||||
<th><?php echo $header; ?></th>
|
||||
<?php endforeach; ?>
|
||||
</thead>
|
||||
|
||||
<tbody class="font-12">
|
||||
<?php for ($i = 1; $i < count($tbody); $i++): ?>
|
||||
<tr>
|
||||
<?php foreach ($tbody[$i] as $data): ?>
|
||||
<td>
|
||||
<?php echo $data;?>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endfor; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- end .table-responsive -->
|
||||
|
||||
</div> <!-- end .table-rep-plugin-->
|
||||
</div> <!-- end .responsive-table-plugin-->
|
||||
BIN
public/assets/images/Nhance_Favi.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
5
public/assets/images/Nhance_Favi.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M428.357 3.03152C399.835 2.7241 385.421 4.56862 377.14 12.869C365.486 24.551 366.1 42.3814 366.713 50.0669C366.713 72.816 366.713 95.5652 366.713 118.314C366.713 157.972 366.713 197.629 366.713 237.286C366.713 237.901 366.713 243.127 366.713 243.742C366.713 244.049 366.713 244.049 366.713 244.357C366.713 244.664 366.713 244.972 366.713 244.972C366.713 245.587 367.02 245.894 367.02 246.509C368.553 252.042 371.927 256.039 374.993 258.806C412.716 294.466 442.771 321.827 459.638 337.198C465.159 342.117 473.132 348.572 479.879 346.113C487.24 343.346 489.08 331.049 489.693 327.053C489.693 270.488 489.693 213.922 489.693 157.357C489.693 118.007 489.693 83.5758 490 48.2224C490 34.6959 490 19.3248 479.573 9.48735C470.679 2.10925 456.571 3.33894 428.357 3.03152Z" fill="#E26828"/>
|
||||
<path d="M83.6435 509.968C112.165 510.276 126.579 508.431 134.86 500.438C146.514 489.064 145.9 471.848 145.287 464.163C145.287 442.028 145.287 419.894 145.287 397.76C145.287 359.332 145.287 320.597 145.287 281.862C145.287 281.247 145.287 276.329 145.287 275.406C145.287 275.099 145.287 275.099 145.287 274.791C145.287 274.484 145.287 274.177 145.287 274.177C145.287 273.869 144.98 273.254 144.98 272.947C143.447 267.721 140.073 263.724 137.007 260.958C58.1887 192.71 52.055 184.41 52.055 184.41C46.8414 179.184 38.5609 170.268 31.5072 172.42C26.2936 173.957 23.5334 180.721 22.3067 185.332C22.3067 243.435 22.3067 301.537 22.3067 359.64C22 390.074 22 424.813 22 466.007C22 479.841 22.3067 494.597 32.4273 503.513C41.0144 510.891 55.1219 509.661 83.6435 509.968Z" fill="#E26828"/>
|
||||
<path d="M274.401 203.47L100.818 14.4061C91.924 4.56862 81.19 3.64636 68.9227 3.64636C43.7746 3.95378 19.2398 -5.57626 22.3067 52.5263L24.4535 91.5687C24.7602 97.4097 27.2136 103.558 31.5072 108.169L294.642 387.922L398.301 501.668C401.675 505.972 406.582 508.431 412.102 508.431C424.983 508.739 442.157 508.431 451.664 508.431C476.813 508.124 489.693 507.509 489.693 477.997L487.24 438.339C486.933 432.498 484.48 426.35 480.186 422.046L274.401 203.47Z" fill="#00999E"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
BIN
public/assets/images/Nhance_Favi_white.png
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
public/assets/images/Nhance_Favi_white_2.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
public/assets/images/nhance-loader-fast.gif
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
public/assets/images/nhance-loader.gif
Normal file
|
After Width: | Height: | Size: 493 KiB |
11
public/assets/images/nhance_white_logo.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<svg width="132" height="28" viewBox="0 0 132 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M54.7983 14.7392C55.1303 14.6604 55.4782 14.8496 55.5888 15.1806C55.8734 15.9846 56.1738 16.7413 56.49 17.5295C56.6956 18.0182 56.3794 18.1285 56.0473 18.3177C54.7193 19.0586 54.2924 20.0675 54.6877 21.3917C54.9406 22.2272 55.5256 22.7001 56.3477 22.842C59.0829 23.378 61.3754 21.5809 61.4703 18.7906C61.5177 16.6625 61.4703 14.5028 61.4386 12.3746C61.4228 11.6022 61.075 11.0189 60.3003 10.814C58.4505 10.3095 56.6798 10.2622 55.1462 11.7283C54.7509 12.1066 54.1027 12.4219 53.5493 12.4534C52.49 12.548 51.4307 12.5007 50.2924 12.485C49.913 12.485 49.6284 12.1224 49.739 11.7598C50.7193 8.68581 52.7746 6.80987 56.0157 6.4473C58.245 6.19507 60.4742 6.25813 62.6402 6.98328C64.7746 7.6769 66.245 9.07991 66.3556 11.3657C66.4821 14.219 66.5137 17.0881 66.324 19.9257C66.0394 24.0559 63.4149 26.0106 59.7469 26.7358C57.6126 27.1614 55.4307 27.2718 53.328 26.4678C51.1462 25.648 49.7549 23.7721 49.6442 21.4705C49.4386 17.7187 51.0671 15.5432 54.7983 14.7392Z" fill="white"/>
|
||||
<path d="M55.5579 12.611C57.2971 13.1785 58.8307 13.6672 60.3643 14.219C60.6172 14.3135 60.7279 14.5815 60.6172 14.818C60.0164 16.1737 58.7832 18.5699 58.2615 19.5C58.1666 19.6576 57.9295 19.6418 57.8662 19.4684C57.0441 17.356 56.2062 15.2279 55.2892 12.9105C55.2101 12.7214 55.384 12.5637 55.5579 12.611Z" fill="white"/>
|
||||
<path d="M84.2058 26.9726C82.3085 26.9726 80.7591 25.4277 80.7591 23.536V14.6765C80.7591 13.1474 80.1741 12.2173 78.9884 11.8863C76.9805 11.3345 75.0042 12.9424 75.0042 15.0233V26.6573C75.0042 26.8149 74.8619 26.9726 74.688 26.9726H69.8816C69.2018 26.9726 68.6643 26.4208 68.6643 25.7587V15.7012C68.5694 9.53739 71.6208 6.46338 77.85 6.46338C84.0793 6.46338 87.1781 9.53739 87.1781 15.7012V25.9636C87.1781 26.5154 86.7354 26.9726 86.1662 26.9726H84.2058Z" fill="white"/>
|
||||
<path d="M108.174 19.8628C108.522 19.8628 108.759 20.1939 108.648 20.5249C107.162 24.8443 104.016 27.0355 99.1303 27.0671C96.0789 27.0671 93.7232 26.137 92.0473 24.2768C90.3714 22.2748 89.5019 19.7367 89.4702 16.6942C89.3754 13.6518 90.1975 11.1768 91.9683 9.26932C93.5967 7.36186 95.9525 6.38448 99.0513 6.38448C102.15 6.28989 104.585 7.21998 106.356 9.17473C107.399 10.2467 108.111 11.5236 108.49 13.0054L108.506 13.0527C108.585 13.368 108.348 13.6675 108.016 13.6675H102.719C102.514 13.6675 102.34 13.5414 102.261 13.3522C101.771 12.1857 100.743 11.6024 99.2094 11.6024C97.0592 11.6024 95.9366 13.2892 95.8892 16.6785C95.8892 19.9889 97.0434 21.7388 99.32 21.9122C99.3359 21.9122 99.3675 21.9122 99.3991 21.9122C100.506 21.8649 101.36 21.5496 101.945 20.9663C102.53 20.2412 103.352 19.8628 104.379 19.8628H108.174Z" fill="white"/>
|
||||
<path d="M37.9604 6.41589C39.5256 6.21095 41.0592 6.33707 42.577 6.79423C46.1026 7.85043 47.9366 10.7037 48.0157 15.3857V25.8058C48.0157 26.4206 47.5098 26.9408 46.8774 26.9408H42.7193C42.0394 26.9408 41.5019 26.3891 41.5019 25.727V16.2843C41.5019 13.4309 40.237 11.9806 37.7232 11.9806C35.2094 11.9806 33.9604 13.4152 34.0078 16.2843V25.5693C34.0078 26.3103 33.407 26.9251 32.6481 26.9251H28.7746C28.0789 26.9251 27.5098 26.3576 27.5098 25.6639V1.68664C27.5098 1.13489 27.9683 0.677734 28.5216 0.677734H30.8457C32.6007 0.677734 34.0236 2.09651 34.0236 3.84633V7.88196C34.0236 8.02383 34.1817 8.10265 34.2924 8.00807C35.2884 7.21986 36.5058 6.68388 37.9604 6.41589Z" fill="white"/>
|
||||
<path d="M124.048 12.0597C124.601 11.6341 123.352 10.972 123.083 10.8144C121.36 9.9158 119.241 10.4203 117.708 11.4449C114.308 13.7623 114.53 20.0837 118.451 21.7232C121.391 22.9685 125.281 21.6916 126.356 18.5388C126.451 18.2866 126.546 18.0343 126.609 17.7506C126.688 17.4984 126.925 17.3092 127.194 17.3092H128.348C128.364 17.3092 128.38 17.3092 128.427 17.3092L131.605 17.5299C131.81 17.5457 132 17.6402 132 17.9082V17.924C132 17.9555 131.399 21.4236 129.929 23.268C128.949 24.6395 127.478 25.7115 125.929 26.3105C124.158 27.0041 122.182 26.9411 120.316 26.9411C118.878 26.9411 117.518 26.7204 116.3 26.2632C115.083 25.8061 113.961 25.1124 112.98 24.1981C111.968 23.2523 111.21 22.1803 110.719 20.998C110.229 19.8157 109.992 18.5073 109.992 17.0412C109.992 15.5121 110.198 14.1564 110.609 12.9898C111.004 11.8233 111.636 10.7986 112.459 9.96309C113.281 9.12759 114.134 8.4182 115.051 7.86646C115.953 7.31471 116.901 6.92061 117.882 6.68415C117.992 6.66838 118.103 6.63685 118.198 6.63685C118.245 6.63685 118.324 6.62109 118.387 6.60533C118.466 6.58956 118.53 6.58956 118.625 6.5738C118.704 6.5738 118.751 6.5738 118.83 6.55803C118.878 6.55803 118.957 6.54227 119.036 6.5265C119.115 6.51074 119.178 6.49498 119.257 6.49498C119.447 6.47921 119.605 6.46345 119.795 6.44768C120 6.43192 120.19 6.43192 120.395 6.43192L122.04 6.40039C123.146 6.43192 124.221 6.60532 125.186 6.90484C126.15 7.22013 127.051 7.69305 127.874 8.30785C128.664 8.92266 129.391 9.63204 130.024 10.4045C130.182 10.6094 130.356 10.7986 130.514 11.0193C131.225 11.9494 130.957 13.2736 129.913 13.8411L120.269 19.0275C120 19.1694 118.34 19.7526 117.439 18.5861C116.474 17.3407 116.933 16.1584 117.818 15.654C117.723 15.654 124.048 12.0597 124.048 12.0597Z" fill="white"/>
|
||||
<path d="M21.7703 0.583382C19.7782 0.567617 18.4976 0.567617 18.5608 3.02683V13.0844C18.5608 13.2105 18.6083 13.3366 18.7506 13.4469L23.7624 17.7663C24.2051 18.1447 25.043 17.9082 25.043 17.4037V2.96377C24.9956 0.23657 23.794 0.61491 21.7703 0.583382Z" fill="white"/>
|
||||
<path d="M13.8334 11.0667L4.77415 1.24558C4.31565 0.741129 3.74648 0.693837 3.11407 0.693837C1.80182 0.709601 0.521187 0.220912 0.679289 3.23187L0.789961 5.24968C0.805772 5.56496 0.932254 5.86448 1.1536 6.10094L14.8927 20.6197L20.2998 26.5155C20.4896 26.7362 20.7425 26.8623 21.0113 26.8623C21.6911 26.8781 22.5765 26.8623 23.0825 26.8623C24.3947 26.8466 25.0745 26.8151 25.0745 25.2702L24.9481 23.2051C24.9323 22.8898 24.8058 22.5903 24.5844 22.3696L13.8334 11.0667Z" fill="white"/>
|
||||
<path d="M1.05859 25.5854C1.05859 26.6258 1.64357 27.1302 4.36294 27.0199C7.01907 26.9096 7.57243 26.6416 7.57243 25.6642V15.7012C7.57243 15.4648 7.46176 15.2441 7.25622 15.0864L3.35108 11.7444C2.56057 11.0666 1.09021 11.4922 1.09021 12.3592V25.5854H1.05859Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.0 KiB |
BIN
public/sample_excel/sample_addition.xls
Normal file
BIN
public/sample_excel/sample_correction .xls
Normal file
BIN
public/sample_excel/sample_deletion.xls
Normal file
BIN
public/sample_excel/sample_dependent_addition.xls
Normal file
BIN
public/sample_excel/sample_inception.xls
Normal file
BIN
public/sample_excel/sample_si_enhancement.xls
Normal file
40
tests/unit/CheckFormateDataTest.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Tests;
|
||||
|
||||
use CodeIgniter\Test\CIUnitTestCase;
|
||||
|
||||
use App\Controllers\EmpDataServiceController;
|
||||
use App\Models\EmployeePolicyModel;
|
||||
|
||||
use App\Models\EmployeeModel;
|
||||
use App\Models\ClientModel;
|
||||
use App\Models\ClientPolicyModel;
|
||||
use App\Models\FileModel;
|
||||
use App\Models\BatchListModel;
|
||||
use App\Models\BatchFileModel;
|
||||
use App\Models\EmpEndorsementModel;
|
||||
use App\Models\ClientDepositModel;
|
||||
|
||||
|
||||
|
||||
class CheckFormateDataTest extends CIUnitTestCase
|
||||
{
|
||||
public function testGenerateExcelForAdditionAndInception()
|
||||
{
|
||||
$batch_data = [
|
||||
'client_id' => 12,
|
||||
'client_policy_id' => 12,
|
||||
'insurer_or_tpa' => 'insurer',
|
||||
'event_type' => 'inception',
|
||||
'actions' => 'export',
|
||||
'file_name' => 'TCS_HealthFlex_Advantage_Policy_IEI_06-04-2024_17-42-31.xlsx',
|
||||
];
|
||||
|
||||
$empServiceController = new EmpDataServiceController();
|
||||
$result = $empServiceController->generateExcelForAdditionAndInception($batch_data);
|
||||
|
||||
// You can add assertions here to verify the result if needed
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
}
|
||||