FIX_MASTER_BRANCH_ISSUE_RESOLVED : RV
This commit is contained in:
parent
2e79864c40
commit
934823b6de
@ -230,7 +230,8 @@ class ClientController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','Client general info function called');
|
||||
$file_name = file_Upload($this->request->getFile('client_logo'));
|
||||
$uploadFilePath = ROOTPATH . 'public/uploads/logo/';
|
||||
$file_name = file_Upload($this->request->getFile('client_logo'), $uploadFilePath);
|
||||
$data = $this->request->getPost();
|
||||
$data['created_by'] = get_session_userid();
|
||||
$data['client_logo'] = $file_name;
|
||||
@ -248,7 +249,8 @@ class ClientController extends AdminController
|
||||
public function editClientGeneralInfo()
|
||||
{
|
||||
$this->myLogger->logme('error','edit client general info function called');
|
||||
$file_name = file_Upload($this->request->getFile('client_logo'));
|
||||
$uploadFilePath = ROOTPATH . 'public/uploads/logo/';
|
||||
$file_name = file_Upload($this->request->getFile('client_logo'), $uploadFilePath);
|
||||
$id = $this->request->getPost('PrimaryKey');
|
||||
$data = $this->request->getPost();
|
||||
$data['updated_by'] = get_session_userid();
|
||||
@ -268,7 +270,8 @@ class ClientController extends AdminController
|
||||
$this->myLogger->logme('error','create Client kyc function called');
|
||||
$data = $this->request->getPost();
|
||||
unset($data['file_name']);
|
||||
$File = file_Upload($this->request->getFile('file_name'));
|
||||
$uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents';
|
||||
$File = file_Upload($this->request->getFile('file_name'), $uploadFilePath);
|
||||
if(!empty($File)){
|
||||
$data['file_name'] = $File;
|
||||
}
|
||||
@ -288,7 +291,8 @@ class ClientController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','edit client kyc function called');
|
||||
$File = file_Upload($this->request->getFile('file_name'));
|
||||
$uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents';
|
||||
$File = file_Upload($this->request->getFile('file_name'), $uploadFilePath);
|
||||
if(!empty($File)){
|
||||
$data['file_name'] = $File;
|
||||
}
|
||||
@ -452,7 +456,7 @@ class ClientController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','Client branch EDIT function called');
|
||||
$id = $this->request->getPost('PrimaryKey');
|
||||
$id = $this->request->getPost('branch_id_primarykey');
|
||||
$client_id = $this->request->getPost('client_id');
|
||||
$data = $this->request->getPost();
|
||||
$data['updated_by'] = get_session_userid();
|
||||
|
||||
@ -7,6 +7,8 @@ use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
use App\Helpers\DepositHelper;
|
||||
|
||||
|
||||
use App\Models\EmployeeModel;
|
||||
use App\Models\EmployeePolicyModel;
|
||||
@ -52,12 +54,22 @@ class EmpDataServiceController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
public function batchFilesAndBatchListEntry($data, $objects){
|
||||
/**
|
||||
* The below function are Inserts batch files and corresponding batch list entries into the database.
|
||||
*
|
||||
* @param array $data An array containing data for batch file insertion.
|
||||
* @param array $objects An array of objects containing information for batch list entries.
|
||||
* @return bool Returns true on successful insertion.
|
||||
*/
|
||||
|
||||
|
||||
public function batchFilesAndBatchListEntry($data, $objects)
|
||||
{
|
||||
|
||||
$random_number_count = 4;
|
||||
$data['batch_code'] = generate_random_string($random_number_count);
|
||||
$data['created_by'] = get_session_userid();
|
||||
// $data['file_name'] = $filename;
|
||||
|
||||
$insert = $this->batchFileModel->insert($data);
|
||||
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
|
||||
|
||||
@ -69,6 +81,7 @@ class EmpDataServiceController extends BaseController
|
||||
$this->batchListModel->insert($batch_list_data);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
@ -89,7 +102,7 @@ class EmpDataServiceController extends BaseController
|
||||
public function generateExcelForAdditionandInception($export_data)
|
||||
{
|
||||
// Fetch employee data for export from the database
|
||||
$objects = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($export_data['client_policy_id'], $export_data['insurer_or_tpa'], $export_data['event_type'], $export_data['actions']);
|
||||
$objects = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($export_data);
|
||||
|
||||
// Log the count of exported data
|
||||
$count = count($objects);
|
||||
@ -150,7 +163,7 @@ class EmpDataServiceController extends BaseController
|
||||
public function generateExcelForCorrection($export_data)
|
||||
{
|
||||
|
||||
$objects = $this->employeePolicyModel->getCorrectionEmployeesDataForExportExcel($export_data['client_id'], $export_data['client_policy_id'], $export_data['insurer_or_tpa']);
|
||||
$objects = $this->employeePolicyModel->getCorrectionEmployeesDataForExportExcel($export_data);
|
||||
// dd($objects);
|
||||
$count = count($objects);
|
||||
$export_data['count'] = $count;
|
||||
@ -178,7 +191,6 @@ class EmpDataServiceController extends BaseController
|
||||
'Endorsement_Id'
|
||||
];
|
||||
|
||||
|
||||
// Create a temporary file in memory
|
||||
$tempFile = tmpfile();
|
||||
|
||||
@ -217,7 +229,7 @@ class EmpDataServiceController extends BaseController
|
||||
public function generateExcelForSIEnhancement($export_data)
|
||||
{
|
||||
|
||||
$objects = $this->employeePolicyModel->getSIEnhancementEmployeesDataForExportExcel($export_data['client_id'], $export_data['client_policy_id'], $export_data['insurer_or_tpa']);
|
||||
$objects = $this->employeePolicyModel->getSIEnhancementEmployeesDataForExportExcel($export_data);
|
||||
|
||||
// dd($objects);
|
||||
|
||||
@ -289,14 +301,13 @@ class EmpDataServiceController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function generateExcelForDeletion($export_data)
|
||||
{
|
||||
|
||||
$objects = $this->employeePolicyModel->getDeletionEmployeeDataForExportExcel($export_data['client_id'], $$export_data['client_policy_id'], $$export_data['insurer_or_tpa']);
|
||||
// dd($export_data['client_id']);
|
||||
$objects = $this->employeePolicyModel->getDeletionEmployeeDataForExportExcel($export_data);
|
||||
$count = count($objects);
|
||||
$export_data['count'] = $count;
|
||||
|
||||
@ -309,9 +320,7 @@ class EmpDataServiceController extends BaseController
|
||||
$this->myLogger->logme('error','Deletion export file name : {data}', ['data'=> $export_data['file_name'] ]);
|
||||
|
||||
$si_data = transform_objects_to_array_for_deletion($objects);
|
||||
|
||||
// dd($si_data);
|
||||
|
||||
$headers = [
|
||||
'S.No',
|
||||
'EMP ID',
|
||||
@ -367,24 +376,540 @@ class EmpDataServiceController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
public function cashDepositCalculationForInception($arrayData = [])
|
||||
|
||||
/**
|
||||
* The below functions are Imports data from an Excel file for :
|
||||
* - Inception
|
||||
* - Deletion
|
||||
* - Correction
|
||||
* - SI_Enhancement
|
||||
*
|
||||
* This functions are processes the uploaded Excel file, extracts relevant information,
|
||||
* and updates employee policies and employees table accordingly.
|
||||
*
|
||||
* @param array $import_data An associative array containing :
|
||||
* - client_id,
|
||||
* - client_policy_id,
|
||||
* - the uploaded file.
|
||||
* @return int Returns:
|
||||
* - 1 if data import is successful.
|
||||
* - 2 if the file does not exist.
|
||||
* - 0 if the provided data is incomplete or incorrect.
|
||||
*/
|
||||
|
||||
public function importExcelDataForInception($import_data)
|
||||
{
|
||||
|
||||
$client_id = $import_data['client_id'];
|
||||
$client_policy_id = $import_data['client_policy_id'];
|
||||
$file = $import_data['file'];
|
||||
|
||||
$is_moved = $file->move(WRITEPATH . 'uploads/import_excel');
|
||||
$filename = $file->getName();
|
||||
|
||||
$this->myLogger->logme('error','Inception Import file name : {data}', ['data'=> $filename ]);
|
||||
$random_number_count = 4;
|
||||
$batch_code = generate_random_string($random_number_count);
|
||||
|
||||
$this->myLogger->logme('error','Inception Import BATCH CODE : {data}', ['data'=> $batch_code ]);
|
||||
|
||||
$import_data['batch_code'] = $batch_code;
|
||||
$import_data['created_by'] = get_session_userid();
|
||||
$import_data['file_name'] = $filename;
|
||||
$insert = $this->batchFileModel->insert($import_data);
|
||||
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
|
||||
|
||||
$batch_code_for_batch_list['batch_code'] = $batch_file_batch_code['batch_code'];
|
||||
$batch_code_for_batch_list['created_by'] = get_session_userid();
|
||||
|
||||
$file_name_with_path = WRITEPATH."/uploads/import_excel/".$batch_file_batch_code['file_name'];
|
||||
|
||||
//check the file exist or not
|
||||
if(!file_exists($file_name_with_path))
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
$data = read_excel_file_to_array($file_name_with_path);
|
||||
unset($data[0]);
|
||||
array_pop($data);
|
||||
$count = count($data);
|
||||
$this->batchFileModel->where('id', $insert)->set('count', $count)->update();
|
||||
// dd($data );
|
||||
$employeeIds = [];
|
||||
foreach ($data as $key => $value) {
|
||||
// Check if the array is not empty and has the necessary data
|
||||
if (!empty($value) && (isset($value[15]) || isset($value[16]))) {
|
||||
|
||||
// Extract the client_policy_id and tpa_id from the array
|
||||
$tpa_id = $value[15] != null ? $value[15] : '';
|
||||
$uhid = $value[16] != null ? $value[16] : '';
|
||||
$emp_code = $value[2];
|
||||
$name = $value[1];
|
||||
|
||||
$val = $this->employeePolicyModel
|
||||
->select('employee_polices.id')
|
||||
->join('employees', 'employees.id = employee_polices.employee_id')
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employees.name', $name)
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employee_polices.is_active', 1)
|
||||
->first();
|
||||
|
||||
if ($val !== null) {
|
||||
$id = $val['id'];
|
||||
$batch_code_for_batch_list['emp_policy_id'] = $id;
|
||||
$this->batchListModel->insert($batch_code_for_batch_list);
|
||||
array_push($employeeIds, $id);
|
||||
}
|
||||
|
||||
$updateData = [
|
||||
'client_policy_id' => $client_policy_id,
|
||||
'client_id' => $client_id,
|
||||
'name' => $name,
|
||||
'emp_code' => $emp_code,
|
||||
'uhid' => $uhid,
|
||||
'tpa_id' => $tpa_id
|
||||
];
|
||||
|
||||
$this->employeePolicyModel->updateTPAIDorUHID($updateData);
|
||||
// $query = $this->employeePolicyModel->getLastQuery();
|
||||
// echo $query . "<br>";
|
||||
|
||||
}else{
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$policy_name = $this->getPolicyNameUsingClientPolicyId($client_policy_id);
|
||||
$depositeData = [
|
||||
'employeeIds'=>$employeeIds,
|
||||
'client_id'=>$client_id,
|
||||
'client_policy_id'=>$client_policy_id,
|
||||
'count'=>$count,
|
||||
'event'=>$import_data['event_type'],
|
||||
'policy_name'=>$policy_name['policy_name'],
|
||||
];
|
||||
|
||||
$this->cashDepositCalculationForInception($depositeData);
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function importExcelDataForCorrection($import_data)
|
||||
{
|
||||
|
||||
$client_id = $import_data['client_id'];
|
||||
$client_policy_id = $import_data['client_policy_id'];
|
||||
$file = $import_data['file'];
|
||||
|
||||
$is_moved = $file->move(WRITEPATH . 'uploads/import_excel');
|
||||
$filename = $file->getName();
|
||||
|
||||
$this->myLogger->logme('error','Correction Import file name : {data}', ['data'=> $filename ]);
|
||||
$random_number_count = 4;
|
||||
$batch_code = generate_random_string($random_number_count);
|
||||
$this->myLogger->logme('error','Correction Import BATCH CODE : {data}', ['data'=> $batch_code ]);
|
||||
|
||||
|
||||
$import_data['batch_code'] = $batch_code;
|
||||
$import_data['created_by'] = get_session_userid();
|
||||
$import_data['file_name'] = $filename;
|
||||
$insert = $this->batchFileModel->insert($import_data);
|
||||
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
|
||||
|
||||
$batch_code_for_batch_list['batch_code'] = $batch_file_batch_code['batch_code'];
|
||||
$batch_code_for_batch_list['created_by'] = get_session_userid();
|
||||
|
||||
$file_name_with_path = WRITEPATH."/uploads/import_excel/".$batch_file_batch_code['file_name'];
|
||||
|
||||
if(!file_exists($file_name_with_path))
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
$data = read_excel_file_to_array($file_name_with_path);
|
||||
unset($data[0]);
|
||||
$count = count($data);
|
||||
$this->batchFileModel->where('id', $insert)->set('count', $count)->update();
|
||||
// dd($data);
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
if (!empty($value) && isset($value[10])) {
|
||||
|
||||
$emp_code = $value[0];
|
||||
$uhid = $value[1];
|
||||
$endorsement_id = $value[10] != null ? $value[10] : '';
|
||||
|
||||
$val = $this->employeePolicyModel
|
||||
->select('employees.id')
|
||||
->join('employees', 'employees.id = employee_polices.employee_id')
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employee_polices.uhid', $uhid)
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employees.is_active', 1)
|
||||
->first();
|
||||
$batch_code_for_batch_list['emp_policy_id'] = $val['id'];
|
||||
$this->batchListModel->insert($batch_code_for_batch_list);
|
||||
|
||||
// $this->employeePolicyModel->updateCorrectionData($emp_code, $uhid, $endorsement_id);
|
||||
|
||||
$queryData = $this->empEndorsementModel->select('emp_endorsement.*')
|
||||
->join('employees', 'employees.id = emp_endorsement.pk')
|
||||
->join('employee_polices', 'employee_polices.employee_id = employees.id')
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employee_polices.uhid', $uhid)
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
// dd($queryData);
|
||||
|
||||
foreach ($queryData as $endorsementData) {
|
||||
|
||||
$emp_endoresment_id = $endorsementData['id'];
|
||||
$emp_id = $endorsementData['emp_id'];
|
||||
$field_name = $endorsementData['field_name'];
|
||||
$new_value = $endorsementData['new_value'];
|
||||
$this->empEndorsementModel->where('id', $emp_endoresment_id)->set('endorsement_id', $endorsement_id)->update();
|
||||
$this->employeeModel->where('id', $emp_id)->set($field_name, $new_value)->update();
|
||||
}
|
||||
|
||||
// $query = $this->employeePolicyModel->getLastQuery();
|
||||
// echo $query . "<br>";
|
||||
}else{
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function importExcelDataForSIEnhancement($import_data)
|
||||
{
|
||||
|
||||
$client_id = $import_data['client_id'];
|
||||
$client_policy_id = $import_data['client_policy_id'];
|
||||
$file = $import_data['file'];
|
||||
|
||||
$is_moved = $file->move(WRITEPATH . 'uploads/import_excel');
|
||||
$filename = $file->getName();
|
||||
|
||||
$this->myLogger->logme('error','SI_Enhancement Import file name : {data}', ['data'=> $filename ]);
|
||||
$random_number_count = 4;
|
||||
$batch_code = generate_random_string($random_number_count);
|
||||
$this->myLogger->logme('error','SI_Enhancement Import BATCH CODE : {data}', ['data'=> $batch_code ]);
|
||||
|
||||
|
||||
$import_data['batch_code'] = $batch_code;
|
||||
$import_data['created_by'] = get_session_userid();
|
||||
$import_data['file_name'] = $filename;
|
||||
$insert = $this->batchFileModel->insert($import_data);
|
||||
$batch_file_batch_code = $this->batchFileModel->where('id', 2)->first();
|
||||
|
||||
$batch_code_for_batch_list['batch_code'] = $batch_file_batch_code['batch_code'];
|
||||
$batch_code_for_batch_list['created_by'] = get_session_userid();
|
||||
|
||||
$file_name_with_path = WRITEPATH."/uploads/import_excel/".$batch_file_batch_code['file_name'];
|
||||
|
||||
if(!file_exists($file_name_with_path))
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
$data = read_excel_file_to_array($file_name_with_path);
|
||||
unset($data[0]);
|
||||
$count = count($data);
|
||||
$this->batchFileModel->where('id', $insert)->set('count', $count)->update();
|
||||
// dd($data);
|
||||
$employeeIds = [];
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
if (!empty($value) && isset($value[19])) {
|
||||
|
||||
$emp_name = $value[1];
|
||||
$emp_code = $value[2];
|
||||
// echo $emp_name .'-'. $emp_code; die;
|
||||
$endorsement_id = $value[19] != null ? $value[19] : '';
|
||||
|
||||
$updateData = [
|
||||
'emp_code' =>$emp_code,
|
||||
'client_id' =>$client_id,
|
||||
'client_policy_id' =>$client_policy_id,
|
||||
'emp_name' =>$emp_name,
|
||||
'endorsement_id' =>$endorsement_id,
|
||||
];
|
||||
|
||||
$this->employeePolicyModel->updateEndoresmentIdForSIEnhancement($updateData);
|
||||
|
||||
$queryData = $this->employeePolicyModel
|
||||
->select('employee_polices.*')
|
||||
->join('employees', 'employee_polices.employee_id = employees.id')
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employees.name', $emp_name)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employee_polices.is_active', 1)
|
||||
->first();
|
||||
|
||||
$queryData['is_active'] = 0;
|
||||
$this->employeePolicyModel->save($queryData);
|
||||
|
||||
unset($queryData['id']);
|
||||
unset($queryData['created_by']);
|
||||
unset($queryData['created_at']);
|
||||
unset($queryData['updated_by']);
|
||||
unset($queryData['updated_at']);
|
||||
unset($queryData['is_active']);
|
||||
|
||||
$queryData['basic_cover_si'] = $value[8];
|
||||
$queryData['premium'] = $value[14];
|
||||
$queryData['si_enhancement_date'] = $value[10];
|
||||
$queryData['rata_premimum'] = $value[16];
|
||||
$queryData['gst'] = $value[17];
|
||||
$queryData['created_by'] = get_session_userid();
|
||||
|
||||
//new insert
|
||||
$this->employeePolicyModel->save($queryData);
|
||||
|
||||
$val = $this->employeePolicyModel
|
||||
->select('employee_polices.id')
|
||||
->join('employees', 'employees.id = employee_polices.employee_id')
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employees.name', $emp_name)
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employee_polices.is_active', 1)
|
||||
->first();
|
||||
|
||||
if ($val !== null) {
|
||||
$id = $val['id'];
|
||||
$batch_code_for_batch_list['emp_policy_id'] = $id;
|
||||
$this->batchListModel->insert($batch_code_for_batch_list);
|
||||
array_push($employeeIds, $id);
|
||||
}
|
||||
|
||||
|
||||
// $query = $this->employeePolicyModel->getLastQuery();
|
||||
// echo $query . "<br>";
|
||||
}else{
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$policy_name = $this->getPolicyNameUsingClientPolicyId($client_policy_id);
|
||||
$depositeData = [
|
||||
'employeeIds'=>$employeeIds,
|
||||
'client_id'=>$client_id,
|
||||
'client_policy_id'=>$client_policy_id,
|
||||
'count'=>$count,
|
||||
'event'=>$import_data['event_type'],
|
||||
'policy_name'=>$policy_name['policy_name'],
|
||||
];
|
||||
|
||||
// dd($depositeData);
|
||||
$this->cashDepositCalculationForSIEnhancement($depositeData);
|
||||
|
||||
return 1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function importExcelDataForDeletion($import_data)
|
||||
{
|
||||
|
||||
$client_id = $import_data['client_id'];
|
||||
$client_policy_id = $import_data['client_policy_id'];
|
||||
$file = $import_data['file'];
|
||||
|
||||
|
||||
$is_moved = $file->move(WRITEPATH . 'uploads/import_excel');
|
||||
$filename = $file->getName();
|
||||
|
||||
$this->myLogger->logme('error','Deletion Import file name : {data}', ['data'=> $filename ]);
|
||||
$random_number_count = 4;
|
||||
$batch_code = generate_random_string($random_number_count);
|
||||
$this->myLogger->logme('error','Deletion Import BATCH CODE : {data}', ['data'=> $batch_code ]);
|
||||
|
||||
|
||||
$import_data['batch_code'] = $batch_code;
|
||||
$import_data['created_by'] = get_session_userid();
|
||||
$import_data['file_name'] = $filename;
|
||||
$insert = $this->batchFileModel->insert($import_data);
|
||||
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
|
||||
|
||||
$batch_code_for_batch_list['batch_code'] = $batch_file_batch_code['batch_code'];
|
||||
$batch_code_for_batch_list['created_by'] = get_session_userid();
|
||||
|
||||
$file_name_with_path = WRITEPATH."/uploads/import_excel/".$batch_file_batch_code['file_name'];
|
||||
|
||||
if(!file_exists($file_name_with_path))
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
$data = read_excel_file_to_array($file_name_with_path);
|
||||
unset($data[0]);
|
||||
array_pop($data);
|
||||
|
||||
$count = count($data);
|
||||
$this->batchFileModel->where('id', $insert)->set('count', $count)->update();
|
||||
|
||||
$employeeIds = [];
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
if (!empty($value) && isset($value[15])) {
|
||||
|
||||
$emp_name = $value[2]; //employee name
|
||||
$emp_code = $value[1]; //employee code
|
||||
$date_of_exit = $value[7]; // date of releving
|
||||
|
||||
// echo $emp_name .'-'. $emp_code .'-'. $date_of_exit; die;
|
||||
$endorsement_id = $value[15] != null ? $value[15] : ''; //endorsement id
|
||||
|
||||
$val = $this->employeePolicyModel
|
||||
->select('employee_polices.id')
|
||||
->join('employees', 'employees.id = employee_polices.employee_id')
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employees.name', $emp_name)
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employee_polices.is_active', 1)
|
||||
->first();
|
||||
|
||||
|
||||
if ($val !== null) {
|
||||
|
||||
$id = $val['id'];
|
||||
$batch_code_for_batch_list['emp_policy_id'] = $id;
|
||||
$this->batchListModel->insert($batch_code_for_batch_list);
|
||||
array_push($employeeIds, $id);
|
||||
}
|
||||
|
||||
$updateData = [
|
||||
'emp_code' =>$emp_code,
|
||||
'client_id' =>$client_id,
|
||||
'client_policy_id' =>$client_policy_id,
|
||||
'emp_name' =>$emp_name,
|
||||
'endorsement_id' =>$endorsement_id,
|
||||
];
|
||||
|
||||
$this->employeePolicyModel->updateEndoresmentIdForDeletion($updateData);
|
||||
|
||||
$deletionDataForEmployee = $this->empEndorsementModel
|
||||
->select('emp_endorsement.new_value, employees.id')
|
||||
->join('employees', 'emp_endorsement.emp_code = employees.emp_code')
|
||||
->join('employee_polices', 'employee_polices.employee_id = employees.id')
|
||||
->where('emp_endorsement.emp_code', $emp_code)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('emp_endorsement.name', $emp_name)
|
||||
->where('emp_endorsement.field_name', 'emp_status')
|
||||
->first();
|
||||
|
||||
$deletionDataForEmployee['updated_by'] = get_session_userid();
|
||||
$this->employeeModel->save($deletionDataForEmployee);
|
||||
|
||||
$fetchData = [
|
||||
'emp_code'=> $emp_code,
|
||||
'client_policy_id'=> $client_policy_id,
|
||||
'emp_name'=> $emp_name,
|
||||
];
|
||||
|
||||
$deletionDataForEmployeePolicy = $this->employeePolicyModel->fetchEmpEndorsementData($fetchData);
|
||||
$deletionDataForEmployeePolicy['updated_by'] = get_session_userid();
|
||||
$this->employeePolicyModel->save($deletionDataForEmployeePolicy);
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($deletionDataForEmployeePolicy); die;
|
||||
|
||||
$this->employeePolicyModel->save($deletionDataForEmployeePolicy);
|
||||
|
||||
// $query = $this->employeePolicyModel->getLastQuery();
|
||||
// echo $query . "<br>";
|
||||
|
||||
}else{
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$policy_name = $this->getPolicyNameUsingClientPolicyId($client_policy_id);
|
||||
$depositeData = [
|
||||
'employeeIds'=>$employeeIds,
|
||||
'client_id'=>$client_id,
|
||||
'client_policy_id'=>$client_policy_id,
|
||||
'count'=>$count,
|
||||
'event'=>$import_data['event_type'],
|
||||
'policy_name'=>$policy_name['policy_name'],
|
||||
];
|
||||
|
||||
$this->cashDepositCalculationForDeletion($depositeData);
|
||||
return 1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The below functions are Calculates and records cash deposits for employee policies at inception.
|
||||
*
|
||||
* @param array $arrayData An array containing necessary data including :
|
||||
* - employee IDs,
|
||||
* - client policy ID,
|
||||
* - client ID,
|
||||
* - count of employees,
|
||||
* - policy_name, and
|
||||
* - event type.
|
||||
*
|
||||
* @return bool Returns true if the operation is successful, otherwise returns 0.
|
||||
*/
|
||||
|
||||
public function cashDepositCalculationForInception($arrayData)
|
||||
{
|
||||
if (!empty($arrayData)) {
|
||||
$query = $this->employeePolicyModel->query("
|
||||
|
||||
$amount = $this->employeePolicyModel->query("
|
||||
SELECT SUM(rata_premimum + gst) AS total_sum
|
||||
FROM employee_polices
|
||||
WHERE id IN (" . implode(',', $arrayData) . ")
|
||||
");
|
||||
$row = $query->getRow();
|
||||
$
|
||||
$insert = $this->clientDepositModel->insert();
|
||||
$query = $this->clientDepositModel->orderBy('id', 'DESC')->limit(1)->get();
|
||||
$cashDepositLastEntry = $query->getRow();
|
||||
WHERE id IN (" . implode(',', $arrayData['employeeIds']) . ")
|
||||
")->getRow();
|
||||
|
||||
print_r($cashDepositLastEntry); die;
|
||||
$insurer_id = $this->clientPolicyModel->where('id', $arrayData['client_policy_id'])->first();
|
||||
$description = 'The following amount of Rs. ' . $amount->total_sum . '/- has been debited for the ' . $arrayData['count'] . ' employees at ' . remove_underscore_capitalize_first_letter($arrayData['event']) . ' to ' . remove_underscore_capitalize_first_letter($arrayData['policy_name']) . '.';
|
||||
|
||||
|
||||
return $row ? $row->total_sum : 0;
|
||||
$data = [
|
||||
'amount' => $amount->total_sum,
|
||||
'sub_type_id' => 1,
|
||||
'client_id' => $arrayData['client_id'],
|
||||
'insurer_id' => $insurer_id['insurer_id'],
|
||||
'description' => $description,
|
||||
'transaction_type' => 'Debit',
|
||||
'updated_by' => get_session_userid(),
|
||||
'is_active' => 1,
|
||||
];
|
||||
$response = DepositHelper::saveDeposit($data, get_session_userid());
|
||||
return true;
|
||||
// print_r($response);
|
||||
// $query = $this->employeePolicyModel->getLastQuery();
|
||||
// echo $query . "<br>";
|
||||
|
||||
} else {
|
||||
return 0;
|
||||
@ -393,15 +918,89 @@ class EmpDataServiceController extends BaseController
|
||||
|
||||
}
|
||||
|
||||
public function cashDepositCalculationForSIEnhancement($arrayData = [])
|
||||
public function cashDepositCalculationForSIEnhancement($arrayData)
|
||||
{
|
||||
if (!empty($arrayData)) {
|
||||
|
||||
$amount = $this->employeePolicyModel->query("
|
||||
SELECT
|
||||
SUM(ROUND((employee_polices.premium * DATEDIFF(employee_polices.policy_end_date, employee_polices.si_enhancement_date)) / 365, 2) +
|
||||
ROUND(((employee_polices.premium * DATEDIFF(employee_polices.policy_end_date, employee_polices.si_enhancement_date)) / 365) * 0.18, 2)) AS total_sum
|
||||
FROM employee_polices
|
||||
WHERE id IN (" . implode(',', $arrayData['employeeIds']) . ")
|
||||
")->getRow();
|
||||
$insurer_id = $this->clientPolicyModel->where('id', $arrayData['client_policy_id'])->first();
|
||||
$description = 'The following amount of ' . $amount->total_sum . ' has been credited for the ' . $arrayData['count'] . ' employees at ' . remove_underscore_capitalize_first_letter($arrayData['event']) . ' to ' . remove_underscore_capitalize_first_letter($arrayData['policy_name']) . '.';
|
||||
|
||||
$data = [
|
||||
|
||||
'amount' => $amount->total_sum,
|
||||
'sub_type_id' => 1,
|
||||
'client_id' => $arrayData['client_id'],
|
||||
'insurer_id' => $insurer_id['insurer_id'],
|
||||
'description' => $description,
|
||||
'transaction_type' => 'Debit',
|
||||
'updated_by' => get_session_userid(),
|
||||
'is_active' => 1,
|
||||
];
|
||||
$response = DepositHelper::saveDeposit($data, get_session_userid());
|
||||
return true;
|
||||
// print_r($response);
|
||||
// $query = $this->employeePolicyModel->getLastQuery();
|
||||
// echo $query . "<br>";
|
||||
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public function cashDepositCalculationForDeletion($arrayData)
|
||||
{
|
||||
// print_r($arrayData);
|
||||
if (!empty($arrayData)) {
|
||||
|
||||
echo '<pre>';
|
||||
print_r($arrayData); die;
|
||||
$amount = $this->employeePolicyModel->query("
|
||||
SELECT
|
||||
SUM(ROUND((employee_polices.premium * DATEDIFF(employee_polices.policy_end_date, employee_polices.date_of_exit)) / 365, 2) +
|
||||
ROUND(((employee_polices.premium * DATEDIFF(employee_polices.policy_end_date, employee_polices.date_of_exit)) / 365) * 0.18, 2)) AS total_sum
|
||||
FROM employee_polices
|
||||
WHERE id IN (" . implode(',', $arrayData['employeeIds']) . ")
|
||||
")->getRow();
|
||||
print_r($amount);die;
|
||||
$insurer_id = $this->clientPolicyModel->where('id', $arrayData['client_policy_id'])->first();
|
||||
$description = 'The following amount of ' . $amount->total_sum . ' has been credited for the ' . $arrayData['count'] . ' employees at ' . remove_underscore_capitalize_first_letter($arrayData['event']) . ' to ' . remove_underscore_capitalize_first_letter($arrayData['policy_name']) . '.';
|
||||
|
||||
$data = [
|
||||
|
||||
'amount' => $amount->total_sum,
|
||||
'sub_type_id' => 1,
|
||||
'client_id' => $arrayData['client_id'],
|
||||
'insurer_id' => $insurer_id['insurer_id'],
|
||||
'description' => $description,
|
||||
'transaction_type' => 'Credit',
|
||||
'updated_by' => get_session_userid(),
|
||||
'is_active' => 1,
|
||||
];
|
||||
$response = DepositHelper::saveDeposit($data, get_session_userid());
|
||||
return true;
|
||||
// print_r($response);
|
||||
// $query = $this->employeePolicyModel->getLastQuery();
|
||||
// echo $query . "<br>";
|
||||
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getPolicyNameUsingClientPolicyId($client_policy_id){
|
||||
return $this->clientPolicyModel->select('policies.name as policy_name')
|
||||
->join('policies', 'policies.id = client_policy.policy_id')
|
||||
->where('client_policy.id', $client_policy_id)
|
||||
->first();
|
||||
}
|
||||
// -----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ class EmployeeController extends AdminController
|
||||
}
|
||||
|
||||
$data['actions'] = ['inception' => 'Inception + Addition + Deletion','correction' =>'Correction','si_enhancement' =>'SI Enhancement'];
|
||||
$data['events'] = ['inception' => 'Inception + Addition','correction' =>'Correction', 'deletion'=>'Deletion' ,'si_enhancement' =>'SI Enhancement'];
|
||||
$data['events'] = ['inception' => 'Inception (Employee + Dependents)','addition' => 'Addition (Employee + Dependents)','dependent_addition' => 'Dependent Addition (Only Dependents)','deletion' => 'Deletion','correction' =>'Correction','si_enhancement' =>'SI Enhancement'];
|
||||
$data['import_or_export'] = ['import' => 'Import','export' =>'Export'];
|
||||
$data['insurer_or_tpa'] = ['insurer' => 'Insurer','tpa' =>'TPA'];
|
||||
$data['fileList'] = $this->fileModel
|
||||
@ -200,6 +200,14 @@ class EmployeeController extends AdminController
|
||||
->join('policies pm','files.policy_id = pm.id')
|
||||
->join('clients c','files.client_id = c.id')
|
||||
->where('files.created_by',8)->orderBy('files.created_at','desc')->findAll();
|
||||
|
||||
$data['batch_list'] = $this->batchFileModel->select('batch_files.*, policies.name as policy_name, clients.short_name as client_short_name')
|
||||
->join('client_policy', 'client_policy.id = batch_files.client_policy_id')
|
||||
->join('policies', 'policies.id = client_policy.policy_id')
|
||||
->join('clients', 'clients.id = client_policy.client_id')
|
||||
->orderBy('batch_files.id','desc')
|
||||
->findAll();
|
||||
|
||||
// dd($data['fileList']);die();
|
||||
if($this->request->getMethod() == "get")
|
||||
{
|
||||
@ -222,8 +230,18 @@ class EmployeeController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
/**This downloadSampleExcelFile() function facilitates downloading various sample Excel files
|
||||
** based on user-selected actions, handling file retrieval and download processes. **/
|
||||
/**
|
||||
* The below function Downloads a sample Excel file based on the provided action type.
|
||||
*
|
||||
* @param string|null $actionType The type of action :
|
||||
*
|
||||
* - inception
|
||||
* - correction
|
||||
* - si_enhancement for selecting the appropriate sample Excel file.
|
||||
*
|
||||
* @return redirect back with an error message if the file is not found, otherwise sends the file to the user for download.
|
||||
*/
|
||||
|
||||
public function downloadSampleExcelFile($actionType = null)
|
||||
{
|
||||
// $actionType = $this->request->getGet();
|
||||
@ -254,6 +272,16 @@ class EmployeeController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The below function are Handles import and export operations based on the provided parameters.
|
||||
*
|
||||
* This function logs the call, retrieves necessary data, generates a filename,
|
||||
* and then either exports data to an Excel file or imports data from an Excel file
|
||||
* depending on the provided action type and event type.
|
||||
*
|
||||
* @return void Redirects the user to the appropriate page with flash messages indicating success or failure.
|
||||
*/
|
||||
|
||||
public function importExport()
|
||||
{
|
||||
|
||||
@ -279,16 +307,18 @@ class EmployeeController extends AdminController
|
||||
'file_name' => $file_name,
|
||||
];
|
||||
|
||||
// $event_type = 'si_enhancement';
|
||||
|
||||
if($actions == 'export'){
|
||||
|
||||
if($event_type == 'inception'){
|
||||
if($event_type == 'inception' || $event_type == 'addition' || $event_type == 'dependent_addition' ){
|
||||
|
||||
$return = $empDataServiceController->generateExcelForAdditionandInception($batch_data);
|
||||
if(!$return){
|
||||
session()->setFlashdata('error', 'No data found about this action');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
} else{
|
||||
$this->myLogger->logme('error','Successfully exported Excel file in Inception/Addition/DependentAddition.');
|
||||
$this->myLogger->logme('error','Successfully exported Excel file in {data}.', ['data' => $event_type]);
|
||||
}
|
||||
|
||||
} else if($event_type == 'correction'){
|
||||
@ -325,381 +355,74 @@ class EmployeeController extends AdminController
|
||||
|
||||
}else if($actions == 'import'){
|
||||
|
||||
if($event_type == 'inception'){
|
||||
$batch_data['file'] = $this->request->getFile('import_file_data');
|
||||
|
||||
$file = $this->request->getFile('import_file_data');
|
||||
$is_moved = $file->move(WRITEPATH . 'uploads/import_excel');
|
||||
$filename = $file->getName();
|
||||
if($event_type == 'inception' || $event_type == 'addition' || $event_type == 'dependent_addition'){
|
||||
|
||||
$this->myLogger->logme('error','Inception Import file name : {data}', ['data'=> $filename ]);
|
||||
$random_number_count = 4;
|
||||
$batch_code = generate_random_string($random_number_count);
|
||||
$return = $empDataServiceController->importExcelDataForInception($batch_data);
|
||||
if($return == 1){
|
||||
session()->setFlashdata('success', 'Data updated successfully');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
|
||||
$this->myLogger->logme('error','Inception Import BATCH CODE : {data}', ['data'=> $batch_code ]);
|
||||
}else if($return == 2){
|
||||
session()->setFlashdata('error', 'File not found');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
|
||||
$batch_data['batch_code'] = $batch_code;
|
||||
$batch_data['created_by'] = get_session_userid();
|
||||
$batch_data['file_name'] = $filename;
|
||||
// $insert = $this->batchFileModel->insert($batch_data);
|
||||
$batch_file_batch_code = $this->batchFileModel->where('id', 2)->first();
|
||||
|
||||
$batch_code_for_batch_list['batch_code'] = $batch_file_batch_code['batch_code'];
|
||||
$batch_code_for_batch_list['created_by'] = get_session_userid();
|
||||
|
||||
$file_name_with_path = WRITEPATH."/uploads/import_excel/".$batch_file_batch_code['file_name'];
|
||||
|
||||
//check the file exist or not
|
||||
if(!file_exists($file_name_with_path))
|
||||
{
|
||||
// session()->setFlashdata('error', 'File not found');
|
||||
// return redirect()->to(base_url('employee/upload'));
|
||||
}else if($return == 0){
|
||||
session()->setFlashdata('error', 'Something went wrong');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
}
|
||||
|
||||
$data = read_excel_file_to_array($file_name_with_path);
|
||||
unset($data[0]);
|
||||
array_pop($data);
|
||||
$count = count($data);
|
||||
// $this->batchFileModel->where('id', $insert)->set('count', $count)->update();
|
||||
// dd($data );
|
||||
$employeeIds = [];
|
||||
foreach ($data as $key => $value) {
|
||||
// Check if the array is not empty and has the necessary data
|
||||
if (!empty($value) && (isset($value[15]) || isset($value[16]))) {
|
||||
|
||||
// Extract the client_policy_id and tpa_id from the array
|
||||
$tpa_id = $value[15] != null ? $value[15] : '';
|
||||
$uhid = $value[16] != null ? $value[16] : '';
|
||||
$emp_code = $value[2];
|
||||
$name = $value[1];
|
||||
|
||||
$val = $this->employeePolicyModel
|
||||
->select('employee_polices.id')
|
||||
->join('employees', 'employees.id = employee_polices.employee_id')
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employees.name', $name)
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employee_polices.is_active', 1)
|
||||
->first();
|
||||
$batch_code_for_batch_list['emp_policy_id'] = $val['id'];
|
||||
$this->batchListModel->insert($batch_code_for_batch_list);
|
||||
array_push($employeeIds, $val['id']);
|
||||
|
||||
$this->employeePolicyModel->updateTPAIDorUHID( $client_policy_id, $client_id, $name, $emp_code, $uhid, $tpa_id);
|
||||
|
||||
// $query = $this->employeePolicyModel->getLastQuery();
|
||||
// echo $query . "<br>";
|
||||
|
||||
}else{
|
||||
|
||||
// session()->setFlashdata('error', 'Something went wrong');
|
||||
// return redirect()->to(base_url('employee/upload'));
|
||||
}
|
||||
|
||||
}
|
||||
$action = ['action' => 'inception'];
|
||||
|
||||
// $depositeData = [
|
||||
// $employeeIds,
|
||||
// ];
|
||||
// print_r($employeeIds); die;
|
||||
$empDataServiceController->cashDepositCalculationForInception($employeeIds);
|
||||
// echo '<pre>';
|
||||
// print_r($depositeData); die;
|
||||
|
||||
// session()->setFlashdata('success', 'Data updated successfully');
|
||||
// return redirect()->to(base_url('employee/upload'));
|
||||
|
||||
}else if($event_type == 'correction'){
|
||||
|
||||
$file = $this->request->getFile('import_file_data');
|
||||
$is_moved = $file->move(WRITEPATH . 'uploads/import_excel');
|
||||
$filename = $file->getName();
|
||||
$return = $empDataServiceController->importExcelDataForCorrection($batch_data);
|
||||
if($return == 1){
|
||||
session()->setFlashdata('success', 'Data updated successfully');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
|
||||
$this->myLogger->logme('error','Correction Import file name : {data}', ['data'=> $filename ]);
|
||||
$random_number_count = 4;
|
||||
$batch_code = generate_random_string($random_number_count);
|
||||
$this->myLogger->logme('error','Correction Import BATCH CODE : {data}', ['data'=> $batch_code ]);
|
||||
|
||||
|
||||
$batch_data['batch_code'] = $batch_code;
|
||||
$batch_data['created_by'] = get_session_userid();
|
||||
$batch_data['file_name'] = $filename;
|
||||
$insert = $this->batchFileModel->insert($batch_data);
|
||||
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
|
||||
|
||||
$batch_code_for_batch_list['batch_code'] = $batch_file_batch_code['batch_code'];
|
||||
$batch_code_for_batch_list['created_by'] = get_session_userid();
|
||||
|
||||
$file_name_with_path = WRITEPATH."/uploads/import_excel/".$batch_file_batch_code['file_name'];
|
||||
|
||||
if(!file_exists($file_name_with_path))
|
||||
{
|
||||
}else if($return == 2){
|
||||
session()->setFlashdata('error', 'File not found');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
}
|
||||
|
||||
$data = read_excel_file_to_array($file_name_with_path);
|
||||
unset($data[0]);
|
||||
$count = count($data);
|
||||
$this->batchFileModel->where('id', $insert)->set('count', $count)->update();
|
||||
// dd($data);
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
if (!empty($value) && isset($value[10])) {
|
||||
|
||||
$emp_code = $value[0];
|
||||
$uhid = $value[1];
|
||||
$endorsement_id = $value[10] != null ? $value[10] : '';
|
||||
|
||||
$val = $this->employeePolicyModel
|
||||
->select('employees.id')
|
||||
->join('employees', 'employees.id = employee_polices.employee_id')
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employee_polices.uhid', $uhid)
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employees.is_active', 1)
|
||||
->first();
|
||||
$batch_code_for_batch_list['emp_policy_id'] = $val['id'];
|
||||
$this->batchListModel->insert($batch_code_for_batch_list);
|
||||
|
||||
// $this->employeePolicyModel->updateCorrectionData($emp_code, $uhid, $endorsement_id);
|
||||
|
||||
$queryData = $this->empEndorsementModel->select('emp_endorsement.*')
|
||||
->join('employees', 'employees.id = emp_endorsement.pk')
|
||||
->join('employee_polices', 'employee_polices.employee_id = employees.id')
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employee_polices.uhid', $uhid)
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
// dd($queryData);
|
||||
|
||||
foreach ($queryData as $endorsementData) {
|
||||
|
||||
$emp_endoresment_id = $endorsementData['id'];
|
||||
$emp_id = $endorsementData['emp_id'];
|
||||
$field_name = $endorsementData['field_name'];
|
||||
$new_value = $endorsementData['new_value'];
|
||||
$this->empEndorsementModel->where('id', $emp_endoresment_id)->set('endorsement_id', $endorsement_id)->update();
|
||||
$this->employeeModel->where('id', $emp_id)->set($field_name, $new_value)->update();
|
||||
}
|
||||
|
||||
// $query = $this->employeePolicyModel->getLastQuery();
|
||||
// echo $query . "<br>";
|
||||
}else{
|
||||
}else if($return == 0){
|
||||
session()->setFlashdata('error', 'Something went wrong');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
session()->setFlashdata('success', 'Data updated successfully');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
|
||||
}else if($event_type == 'si_enhancement'){
|
||||
|
||||
$file = $this->request->getFile('import_file_data');
|
||||
$is_moved = $file->move(WRITEPATH . 'uploads/import_excel');
|
||||
$filename = $file->getName();
|
||||
$return = $empDataServiceController->importExcelDataForSIEnhancement($batch_data);
|
||||
if($return == 1){
|
||||
session()->setFlashdata('success', 'Data updated successfully');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
|
||||
$this->myLogger->logme('error','SI_Enhancement Import file name : {data}', ['data'=> $filename ]);
|
||||
$random_number_count = 4;
|
||||
$batch_code = generate_random_string($random_number_count);
|
||||
$this->myLogger->logme('error','SI_Enhancement Import BATCH CODE : {data}', ['data'=> $batch_code ]);
|
||||
|
||||
|
||||
$batch_data['batch_code'] = $batch_code;
|
||||
$batch_data['created_by'] = get_session_userid();
|
||||
$batch_data['file_name'] = $filename;
|
||||
$insert = $this->batchFileModel->insert($batch_data);
|
||||
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
|
||||
|
||||
$batch_code_for_batch_list['batch_code'] = $batch_file_batch_code['batch_code'];
|
||||
$batch_code_for_batch_list['created_by'] = get_session_userid();
|
||||
|
||||
$file_name_with_path = WRITEPATH."/uploads/import_excel/".$batch_file_batch_code['file_name'];
|
||||
|
||||
if(!file_exists($file_name_with_path))
|
||||
{
|
||||
}else if($return == 2){
|
||||
session()->setFlashdata('error', 'File not found');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
}
|
||||
|
||||
$data = read_excel_file_to_array($file_name_with_path);
|
||||
unset($data[0]);
|
||||
$count = count($data);
|
||||
$this->batchFileModel->where('id', $insert)->set('count', $count)->update();
|
||||
// dd($data);
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
if (!empty($value) && isset($value[19])) {
|
||||
|
||||
$emp_name = $value[1];
|
||||
$emp_code = $value[2];
|
||||
// echo $emp_name .'-'. $emp_code; die;
|
||||
$endorsement_id = $value[19] != null ? $value[19] : '';
|
||||
|
||||
$val = $this->employeePolicyModel
|
||||
->select('employee_polices.id')
|
||||
->join('employees', 'employees.id = employee_polices.employee_id')
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employees.name', $emp_name)
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employee_polices.is_active', 1)
|
||||
->first();
|
||||
$batch_code_for_batch_list['emp_policy_id'] = $val['id'];
|
||||
$this->batchListModel->insert($batch_code_for_batch_list);
|
||||
|
||||
|
||||
$this->employeePolicyModel->updateEndoresmentIdForSIEnhancement($emp_code, $client_id, $client_policy_id, $emp_name, $endorsement_id);
|
||||
|
||||
$queryData = $this->employeePolicyModel
|
||||
->select('employee_polices.*')
|
||||
->join('employees', 'employee_polices.employee_id = employees.id')
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employees.name', $emp_name)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employee_polices.is_active', 1)
|
||||
->first();
|
||||
|
||||
$queryData['is_active'] = 0;
|
||||
$this->employeePolicyModel->save($queryData);
|
||||
|
||||
unset($queryData['id']);
|
||||
unset($queryData['created_by']);
|
||||
unset($queryData['created_at']);
|
||||
unset($queryData['updated_by']);
|
||||
unset($queryData['updated_at']);
|
||||
unset($queryData['is_active']);
|
||||
|
||||
$queryData['basic_cover_si'] = $value[8];
|
||||
$queryData['premium'] = $value[14];
|
||||
$queryData['si_enhancement_date'] = $value[10];
|
||||
$queryData['rata_premimum'] = $value[16];
|
||||
$queryData['gst'] = $value[17];
|
||||
$queryData['created_by'] = get_session_userid();
|
||||
|
||||
//new insert
|
||||
$this->employeePolicyModel->save($queryData);
|
||||
|
||||
|
||||
// $query = $this->employeePolicyModel->getLastQuery();
|
||||
// echo $query . "<br>";
|
||||
}else{
|
||||
}else if($return == 0){
|
||||
session()->setFlashdata('error', 'Something went wrong');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
session()->setFlashdata('success', 'Data updated successfully');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
|
||||
}else if($event_type == 'deletion'){
|
||||
|
||||
$file = $this->request->getFile('import_file_data');
|
||||
$is_moved = $file->move(WRITEPATH . 'uploads/import_excel');
|
||||
$filename = $file->getName();
|
||||
$return = $empDataServiceController->importExcelDataForDeletion($batch_data);
|
||||
if($return == 1){
|
||||
session()->setFlashdata('success', 'Data updated successfully');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
|
||||
$this->myLogger->logme('error','Deletion Import file name : {data}', ['data'=> $filename ]);
|
||||
$random_number_count = 4;
|
||||
$batch_code = generate_random_string($random_number_count);
|
||||
$this->myLogger->logme('error','Deletion Import BATCH CODE : {data}', ['data'=> $batch_code ]);
|
||||
|
||||
|
||||
$batch_data['batch_code'] = $batch_code;
|
||||
$batch_data['created_by'] = get_session_userid();
|
||||
$batch_data['file_name'] = $filename;
|
||||
$insert = $this->batchFileModel->insert($batch_data);
|
||||
$batch_file_batch_code = $this->batchFileModel->where('id', $insert)->first();
|
||||
|
||||
$batch_code_for_batch_list['batch_code'] = $batch_file_batch_code['batch_code'];
|
||||
$batch_code_for_batch_list['created_by'] = get_session_userid();
|
||||
|
||||
$file_name_with_path = WRITEPATH."/uploads/import_excel/".$batch_file_batch_code['file_name'];
|
||||
|
||||
if(!file_exists($file_name_with_path))
|
||||
{
|
||||
}else if($return == 2){
|
||||
session()->setFlashdata('error', 'File not found');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
}
|
||||
|
||||
$data = read_excel_file_to_array($file_name_with_path);
|
||||
unset($data[0]);
|
||||
array_pop($data);
|
||||
|
||||
$count = count($data);
|
||||
$this->batchFileModel->where('id', $insert)->set('count', $count)->update();
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
if (!empty($value) && isset($value[15])) {
|
||||
|
||||
$emp_name = $value[2]; //employee name
|
||||
$emp_code = $value[1]; //employee code
|
||||
$date_of_exit = $value[7]; // date of releving
|
||||
|
||||
// echo $emp_name .'-'. $emp_code .'-'. $date_of_exit; die;
|
||||
$endorsement_id = $value[15] != null ? $value[15] : ''; //endorsement id
|
||||
|
||||
$val = $this->employeePolicyModel
|
||||
->select('employee_polices.id')
|
||||
->join('employees', 'employees.id = employee_polices.employee_id')
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employees.name', $emp_name)
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->where('employee_polices.is_active', 1)
|
||||
->first();
|
||||
$batch_code_for_batch_list['emp_policy_id'] = $val['id'];
|
||||
$this->batchListModel->insert($batch_code_for_batch_list);
|
||||
|
||||
$this->employeePolicyModel->updateEndoresmentIdForDeletion($emp_code, $client_id, $client_policy_id, $emp_name, $endorsement_id);
|
||||
|
||||
$deletionDataForEmployee = $this->empEndorsementModel
|
||||
->select('emp_endorsement.new_value, employees.id')
|
||||
->join('employees', 'emp_endorsement.emp_code = employees.emp_code')
|
||||
->join('employee_polices', 'employee_polices.employee_id = employees.id')
|
||||
->where('emp_endorsement.emp_code', $emp_code)
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('emp_endorsement.name', $emp_name)
|
||||
->where('emp_endorsement.field_name', 'emp_status')
|
||||
->first();
|
||||
|
||||
$deletionDataForEmployee['updated_by'] = get_session_userid();
|
||||
$this->employeeModel->save($deletionDataForEmployee);
|
||||
|
||||
|
||||
$deletionDataForEmployeePolicy = $this->employeePolicyModel->fetchEmpEndorsementData($emp_code, $client_policy_id, $emp_name);
|
||||
$deletionDataForEmployeePolicy['updated_by'] = get_session_userid();
|
||||
$this->employeePolicyModel->save($deletionDataForEmployeePolicy);
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($deletionDataForEmployeePolicy); die;
|
||||
|
||||
$this->employeePolicyModel->save($deletionDataForEmployeePolicy);
|
||||
|
||||
// $query = $this->employeePolicyModel->getLastQuery();
|
||||
// echo $query . "<br>";
|
||||
}else{
|
||||
}else if($return == 0){
|
||||
session()->setFlashdata('error', 'Something went wrong');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
session()->setFlashdata('success', 'Data updated successfully');
|
||||
return redirect()->to(base_url('employee/upload'));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','Edit Insurer Onboarding function called');
|
||||
$headerData['page_name'] = 'Edit Insurer Onboarding';
|
||||
$headerData['page_name'] = 'Edit Insurer Master';
|
||||
|
||||
$types = array(
|
||||
(object) array('id' => 'pvt', 'name' => 'PVT'),
|
||||
@ -122,7 +122,7 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','Insurer Onboarding function called');
|
||||
$headerData['page_name'] = 'Insurer Onboarding';
|
||||
$headerData['page_name'] = 'Insurer Master';
|
||||
|
||||
$types = array(
|
||||
(object) array('id' => 'pvt', 'name' => 'PVT'),
|
||||
@ -228,12 +228,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function editInsurerGet($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit TPA Onboarding function called');
|
||||
@ -248,10 +242,6 @@ class MasterController extends AdminController
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function editInsurerBranch()
|
||||
{
|
||||
$this->myLogger->logme('error','Insurer branch CREATE function called');
|
||||
@ -259,11 +249,6 @@ class MasterController extends AdminController
|
||||
$data = $this->request->getPost();
|
||||
$update = $this->insurerBranchModel->update($id, $data);
|
||||
|
||||
// print_r($this->request->getPost('name[]'));
|
||||
// print_r($this->request->getPost('email[]'));
|
||||
// print_r($this->request->getPost('mobile[]'));
|
||||
// print_r($this->request->getPost('designation[]'));
|
||||
|
||||
if($update){
|
||||
$contactsToDelete = $this->levelContactModel->where(['ref_id' => $id,'contact_type' => 'insurer', 'is_active' => 1])->get()->getResult();
|
||||
foreach ($contactsToDelete as $contact) {
|
||||
@ -285,10 +270,10 @@ class MasterController extends AdminController
|
||||
}
|
||||
|
||||
if($update){
|
||||
$branchData = $this->tpaBranchModel->where('tpa_id', $this->request->getPost('tpa_id'))->findAll();
|
||||
echo json_encode(array("status" => true , 'data' => $branchData));
|
||||
$branchData = $this->insurerBranchModel->where('insurer_id', $this->request->getPost('insurer_id'))->findAll();
|
||||
echo json_encode(array("status" => true , 'data' => $branchData, 'edit'));
|
||||
}else{
|
||||
echo json_encode(array("status" => false));
|
||||
echo json_encode(array("status" => false, 'edit'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -325,7 +310,7 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','TPA Onboarding function called');
|
||||
$headerData['page_name'] = 'TPA Onboarding';
|
||||
$headerData['page_name'] = 'TPA Master';
|
||||
|
||||
|
||||
// print_r($data['types']);die();
|
||||
@ -408,7 +393,7 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','Edit TPA Onboarding function called');
|
||||
$headerData['page_name'] = 'Edit TPA Onboarding';
|
||||
$headerData['page_name'] = 'Edit TPA Master';
|
||||
|
||||
$editData['tpa'] = $this->tpaModel->where(['id' => $id, 'is_active' => 1])->first();
|
||||
$editData['tpa_branch'] = $this->tpaBranchModel->where(['tpa_id' => $id, 'is_active' => 1])->findAll();
|
||||
@ -546,7 +531,7 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','KYC Onboarding function called');
|
||||
$headerData['page_name'] = 'KYC Onboarding';
|
||||
$headerData['page_name'] = 'KYC Master';
|
||||
|
||||
|
||||
// print_r($data['types']);die();
|
||||
@ -610,7 +595,7 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','Edit KYC Onboarding function called');
|
||||
$headerData['page_name'] = 'Edit KYC Onboarding';
|
||||
$headerData['page_name'] = 'Edit KYC Master';
|
||||
|
||||
$editData['kyc'] = $this->kycEntityTypeModel->where(['id' => $id, 'is_active' => 1])->first();
|
||||
$editData['kyc_docs'] = $this->kycDocsModel->where(['kyc_type_id' => $id, 'is_active' => 1])->findAll();
|
||||
@ -716,7 +701,7 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','Policy Type Onboarding function called');
|
||||
$headerData['page_name'] = 'Policy Type Onboarding';
|
||||
$headerData['page_name'] = 'Policy Type Master';
|
||||
|
||||
|
||||
// print_r($data['types']);die();
|
||||
@ -776,13 +761,11 @@ class MasterController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function editPolicyTypeOnboarding($id = null)
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','Edit KYC Onboarding function called');
|
||||
$headerData['page_name'] = 'Edit KYC Onboarding';
|
||||
$headerData['page_name'] = 'Edit KYC Master';
|
||||
|
||||
$editData['policytype'] = $this->policyTypeModel->where(['id' => $id, 'is_active' => 1])->first();
|
||||
$editData['policies'] = $this->policesModel->where(['policy_type_id' => $id, 'is_active' => 1])->findAll();
|
||||
@ -794,9 +777,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function editPolicyType()
|
||||
{
|
||||
$this->myLogger->logme('error','edit Policy general info function called');
|
||||
@ -812,15 +792,13 @@ class MasterController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function policesList($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit Policies Onboarding function called');
|
||||
|
||||
// $editData['policies'] = $this->policesModel->where(['policy_type_id' => $id, 'is_active' => 1])->findAll();
|
||||
|
||||
|
||||
$policies = $this->policesModel->where(['policy_type_id' => $id, 'is_active' => 1])->findAll();
|
||||
|
||||
foreach ($policies as $policy) {
|
||||
@ -848,9 +826,7 @@ class MasterController extends AdminController
|
||||
public function editPoliciesGet($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit Policies Onboarding function called');
|
||||
|
||||
$editData['policies'] = $this->policesModel->where(['id' => $id, 'is_active' => 1])->first();
|
||||
|
||||
// Return JSON response
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($editData);
|
||||
@ -858,8 +834,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function editPolicies()
|
||||
{
|
||||
$this->myLogger->logme('error','edit Policy general info function called');
|
||||
@ -868,7 +842,8 @@ class MasterController extends AdminController
|
||||
$data['updated_by'] = get_session_userid();
|
||||
$update = $this->policesModel->update($id,$data);
|
||||
if($update){
|
||||
echo json_encode(array("status" => true , 'data' => $data));
|
||||
$policyData = $this->policesModel->where(['id' => $id, 'is_active' => 1])->findAll();
|
||||
echo json_encode(array("status" => true , 'data' => $policyData));
|
||||
}else{
|
||||
echo json_encode(array("status" => false));
|
||||
}
|
||||
|
||||
@ -87,7 +87,9 @@ if (!function_exists('generate_excel')) {
|
||||
|
||||
try {
|
||||
// Save Excel file to the specified path
|
||||
$writer->save($filename);
|
||||
// $writer->save($filename);
|
||||
$filePath = WRITEPATH."/uploads/import_excel/" . $filename;
|
||||
$writer->save($filePath);
|
||||
return true; // Return true if file was successfully saved
|
||||
} catch (\Exception $e) {
|
||||
// Log or handle the exception
|
||||
@ -352,8 +354,6 @@ if (!function_exists('read_excel_file_to_array')) {
|
||||
}
|
||||
|
||||
|
||||
// app/Helpers/filename_helper.php
|
||||
|
||||
if (! function_exists('generate_filename')) {
|
||||
function generate_filename($client_short_name, $event_type, $actions, $insurer_or_tpa, $policy_name) {
|
||||
|
||||
@ -366,6 +366,10 @@ if (! function_exists('generate_filename')) {
|
||||
$evenTypeLabel = 'C';
|
||||
}else if($event_type == 'si_enhancement'){
|
||||
$evenTypeLabel = 'SI';
|
||||
}else if($event_type == 'addition'){
|
||||
$evenTypeLabel = 'A';
|
||||
}else if($event_type == 'dependent_addition'){
|
||||
$evenTypeLabel = 'DA';
|
||||
}
|
||||
|
||||
$insurer_or_tpa_lable = "";
|
||||
@ -385,3 +389,12 @@ if (! function_exists('generate_filename')) {
|
||||
return $file_name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('remove_underscore_capitalize_first_letter')) {
|
||||
function remove_underscore_capitalize_first_letter($word) {
|
||||
// Remove underscore and capitalize first letter of each word
|
||||
$formattedEvent = ucwords(str_replace('_', ' ', $word));
|
||||
return $formattedEvent;
|
||||
}
|
||||
}
|
||||
@ -44,36 +44,28 @@ if (!function_exists('change_date_format')) {
|
||||
}
|
||||
|
||||
if (!function_exists('file_Upload')) {
|
||||
function file_Upload($fileToUpload, $imageDetails = null)
|
||||
function file_Upload($fileToUpload, $filepath)
|
||||
{
|
||||
// Retrieve the name of the file
|
||||
if ($fileToUpload !== null && $fileToUpload->isValid() && !$fileToUpload->hasMoved()) {
|
||||
$fileName = $fileToUpload->getName();
|
||||
|
||||
// Check if the file is not null and has a name
|
||||
if ($fileToUpload !== null && $fileName !== "") {
|
||||
// Check if the file is valid and has not been moved already
|
||||
if ($fileToUpload->isValid() && !$fileToUpload->hasMoved()) {
|
||||
// Construct the path where the image should exist
|
||||
$existingImagePath = ROOTPATH . 'public/uploads/logo/' . $imageDetails;
|
||||
|
||||
// Check if imageDetails is not null and if the image exists in the upload folder
|
||||
if ($imageDetails !== null && file_exists($existingImagePath)) {
|
||||
// If the image exists, delete it
|
||||
unlink($existingImagePath);
|
||||
}
|
||||
|
||||
// Move the new image to the upload folder
|
||||
$fileToUpload->move(ROOTPATH . 'public/uploads/logo', $fileName);
|
||||
}
|
||||
} else {
|
||||
// Set fileName to empty string if file is null or doesn't have a name
|
||||
$fileName = "";
|
||||
}
|
||||
|
||||
// Return the file name
|
||||
$fileToUpload->move($filepath, $fileName);
|
||||
return $fileName;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('file_unlink')) {
|
||||
function file_unlink($filepath)
|
||||
{
|
||||
if (is_file($filepath) && file_exists($filepath)) {
|
||||
unlink($filepath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!function_exists('compressImage')) {
|
||||
function compressImage($file, $destinationPath, $newWidth = 100, $newHeight = 100)
|
||||
|
||||
@ -22,4 +22,38 @@ class BatchFileModel extends Model
|
||||
"updated_by",
|
||||
"is_active",
|
||||
];
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = ["checkAndADDCreatedByValue"];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = ["checkAndUpdateUpdatedByValue"];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
protected function checkAndADDCreatedByValue(array $data)
|
||||
{
|
||||
// Check if 'updated_by' value is null or empty
|
||||
if (empty($data['data']['created_by'])) {
|
||||
// Set 'updated_by' value to the current session user ID
|
||||
$data['data']['created_by'] = get_session_userid();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function checkAndUpdateUpdatedByValue(array $data)
|
||||
{
|
||||
// Check if 'updated_by' value is null or empty
|
||||
if (empty($data['data']['updated_by'])) {
|
||||
// Set 'updated_by' value to the current session user ID
|
||||
$data['data']['updated_by'] = get_session_userid();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -33,9 +33,41 @@ class EmployeeModel extends Model
|
||||
"is_active",
|
||||
];
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = ["checkAndADDCreatedByValue"];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = ["checkAndUpdateUpdatedByValue"];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
protected function checkAndADDCreatedByValue(array $data)
|
||||
{
|
||||
// Check if 'updated_by' value is null or empty
|
||||
if (empty($data['data']['created_by'])) {
|
||||
// Set 'updated_by' value to the current session user ID
|
||||
$data['data']['created_by'] = get_session_userid();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function checkAndUpdateUpdatedByValue(array $data)
|
||||
{
|
||||
// Check if 'updated_by' value is null or empty
|
||||
if (empty($data['data']['updated_by'])) {
|
||||
// Set 'updated_by' value to the current session user ID
|
||||
$data['data']['updated_by'] = get_session_userid();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
public function getEmployeePolicy($id)
|
||||
{
|
||||
|
||||
|
||||
@ -33,7 +33,40 @@ class EmployeePolicyModel extends Model
|
||||
"is_active",
|
||||
];
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = ["checkAndADDCreatedByValue"];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = ["checkAndUpdateUpdatedByValue"];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
protected function checkAndADDCreatedByValue(array $data)
|
||||
{
|
||||
// Check if 'updated_by' value is null or empty
|
||||
if (empty($data['data']['created_by'])) {
|
||||
// Set 'updated_by' value to the current session user ID
|
||||
$data['data']['created_by'] = get_session_userid();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function checkAndUpdateUpdatedByValue(array $data)
|
||||
{
|
||||
// Check if 'updated_by' value is null or empty
|
||||
if (empty($data['data']['updated_by'])) {
|
||||
// Set 'updated_by' value to the current session user ID
|
||||
$data['data']['updated_by'] = get_session_userid();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
public function getEmployeePolicy($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'])
|
||||
@ -53,10 +86,14 @@ class EmployeePolicyModel extends Model
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
public function getInceptionEmployeeDataForExportExcel($client_policy_id, $insurer_or_tpa, $event_type)
|
||||
public function getInceptionEmployeeDataForExportExcel($ref_data)
|
||||
{
|
||||
return $this->db->table('employee_polices')
|
||||
->select('employees.name AS emp_name,
|
||||
$client_policy_id = $ref_data['client_policy_id'];
|
||||
$insurer_or_tpa = $ref_data['insurer_or_tpa'];
|
||||
|
||||
$sql = "
|
||||
SELECT
|
||||
employees.name AS emp_name,
|
||||
employees.emp_code AS emp_code,
|
||||
employees.dob AS emp_dob,
|
||||
employees.gender AS emp_gender,
|
||||
@ -64,7 +101,7 @@ class EmployeePolicyModel extends Model
|
||||
employees.relationship AS emp_relationship,
|
||||
employees.relationship_code AS emp_relationship_code,
|
||||
TIMESTAMPDIFF(YEAR, employees.dob, CURDATE()) AS emp_age,
|
||||
"Has Define" as emp_type,
|
||||
'Has Define' as emp_type,
|
||||
|
||||
employee_polices.id as primaryKey,
|
||||
employee_polices.pre_existing_alignments,
|
||||
@ -78,9 +115,10 @@ class EmployeePolicyModel extends Model
|
||||
(employee_polices.rata_premimum + employee_polices.gst) AS total,
|
||||
batch_data.emp_policy_id,
|
||||
batch_data.bl AS batch_list_batch_code,
|
||||
batch_data.bf AS batch_files_batch_code')
|
||||
->join('employees', 'employees.id = employee_polices.employee_id', 'left')
|
||||
->join("(
|
||||
batch_data.bf AS batch_files_batch_code
|
||||
FROM employee_polices
|
||||
LEFT JOIN employees ON employees.id = employee_polices.employee_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
batch_list.emp_policy_id,
|
||||
batch_list.batch_code as bl,
|
||||
@ -89,19 +127,29 @@ class EmployeePolicyModel extends Model
|
||||
LEFT JOIN batch_list ON batch_files.batch_code = batch_list.batch_code
|
||||
WHERE batch_files.event_type = 'inception'
|
||||
AND batch_files.actions = 'export'
|
||||
AND batch_files.insurer_or_tpa = '{$insurer_or_tpa}') as batch_data", 'employee_polices.id = batch_data.emp_policy_id', 'left')
|
||||
->where('batch_data.bf', null)
|
||||
->where('batch_data.bl', null)
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->where('employee_polices.is_active', 1)
|
||||
->get()
|
||||
->getResult();
|
||||
AND batch_files.insurer_or_tpa = '{$insurer_or_tpa}'
|
||||
) as batch_data ON employee_polices.id = batch_data.emp_policy_id
|
||||
WHERE batch_data.bf IS NULL
|
||||
AND batch_data.bl IS NULL
|
||||
AND employee_polices.client_policy_id = '{$client_policy_id}'
|
||||
AND (employee_polices.tpa_id IS NULL OR employee_polices.tpa_id = '')
|
||||
AND (employee_polices.uhid IS NULL OR employee_polices.uhid = '')
|
||||
AND employee_polices.is_active = 1";
|
||||
|
||||
// Get the result set
|
||||
$query = $this->db->query($sql);
|
||||
$results = $query->getResult();
|
||||
return $results;
|
||||
}
|
||||
|
||||
|
||||
public function getCorrectionEmployeesDataForExportExcel($client_id, $client_policy_id, $insurer_or_tpa)
|
||||
public function getCorrectionEmployeesDataForExportExcel($ref_data)
|
||||
{
|
||||
|
||||
$client_id = $ref_data['client_id'];
|
||||
$client_policy_id = $ref_data['client_policy_id'];
|
||||
$insurer_or_tpa = $ref_data['insurer_or_tpa'];
|
||||
|
||||
$sql = "
|
||||
SELECT DISTINCT
|
||||
emp_endorsement.id,
|
||||
@ -162,7 +210,12 @@ class EmployeePolicyModel extends Model
|
||||
}
|
||||
|
||||
|
||||
public function getSIEnhancementEmployeesDataForExportExcel($client_id, $client_policy_id, $insurer_or_tpa){
|
||||
public function getSIEnhancementEmployeesDataForExportExcel($ref_data)
|
||||
{
|
||||
|
||||
$client_id = $ref_data['client_id'];
|
||||
$client_policy_id = $ref_data['client_policy_id'];
|
||||
$insurer_or_tpa = $ref_data['insurer_or_tpa'];
|
||||
|
||||
$query = $this->db->query("
|
||||
SELECT
|
||||
@ -177,7 +230,7 @@ class EmployeePolicyModel extends Model
|
||||
employee_polices.pre_existing_alignments,
|
||||
employee_polices.policy_end_date,
|
||||
employee_polices.basic_cover_si as old_basic_cover_si,
|
||||
employee_polices.premium as old_si_premium,
|
||||
employee_polices.rata_premimum as old_si_premium,
|
||||
batch_data.emp_policy_id,
|
||||
batch_data.bl AS batch_list_batch_code,
|
||||
batch_data.bf AS batch_files_batch_code,
|
||||
@ -185,10 +238,10 @@ class EmployeePolicyModel extends Model
|
||||
sidata.new_si_premium,
|
||||
sidata.date_of_coverage,
|
||||
DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1 AS no_of_days,
|
||||
sidata.new_si_premium - employee_polices.premium AS difference_premium,
|
||||
ROUND((sidata.new_si_premium - employee_polices.premium) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365, 2) AS pro_rata_premimum,
|
||||
ROUND(((sidata.new_si_premium - employee_polices.premium) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2) AS gst,
|
||||
((sidata.new_si_premium - employee_polices.premium) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) + ROUND(((sidata.new_si_premium - employee_polices.premium) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2) AS total
|
||||
sidata.new_si_premium - employee_polices.rata_premimum AS difference_premium,
|
||||
ROUND((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365, 2) AS pro_rata_premimum,
|
||||
ROUND(((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2) AS gst,
|
||||
((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) + ROUND(((sidata.new_si_premium - employee_polices.rata_premimum) * (DATEDIFF(employee_polices.policy_end_date, sidata.date_of_coverage) + 1) / 365) * 0.18, 2) AS total
|
||||
|
||||
FROM
|
||||
emp_endorsement a
|
||||
@ -263,7 +316,12 @@ class EmployeePolicyModel extends Model
|
||||
}
|
||||
|
||||
|
||||
public function getDeletionEmployeeDataForExportExcel($client_id, $client_policy_id, $insurer_or_tpa){
|
||||
public function getDeletionEmployeeDataForExportExcel($ref_data)
|
||||
{
|
||||
|
||||
$client_id = $ref_data['client_id'];
|
||||
$client_policy_id = $ref_data['client_policy_id'];
|
||||
$insurer_or_tpa = $ref_data['insurer_or_tpa'];
|
||||
|
||||
$query = $this->db->query("
|
||||
SELECT
|
||||
@ -278,7 +336,7 @@ class EmployeePolicyModel extends Model
|
||||
employee_polices.basic_cover_si,
|
||||
employee_polices.uhid as risk_id,
|
||||
employee_polices.policy_end_date,
|
||||
employee_polices.premium,
|
||||
employee_polices.rata_premimum as premium,
|
||||
|
||||
batch_data.emp_policy_id AS emp_policy_id,
|
||||
batch_data.bl AS batch_list_batch_code,
|
||||
@ -291,9 +349,9 @@ class EmployeePolicyModel extends Model
|
||||
deletiondata.status,
|
||||
|
||||
DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit) AS no_of_days,
|
||||
ROUND((employee_polices.premium * DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit)) / 365, 2) AS pro_rata_premium,
|
||||
ROUND(((employee_polices.premium * DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit)) / 365) * 0.18, 2) AS gst,
|
||||
ROUND(((employee_polices.premium * DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit)) / 365) + (((employee_polices.premium * DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit)) / 365) * 0.18), 2) AS total
|
||||
ROUND((employee_polices.rata_premimum * DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit)) / 365, 2) AS pro_rata_premium,
|
||||
ROUND(((employee_polices.rata_premimum * DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit)) / 365) * 0.18, 2) AS gst,
|
||||
ROUND(((employee_polices.rata_premimum * DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit)) / 365) + (((employee_polices.rata_premimum * DATEDIFF(employee_polices.policy_end_date, deletiondata.dateofexit)) / 365) * 0.18), 2) AS total
|
||||
FROM
|
||||
emp_endorsement a
|
||||
LEFT JOIN
|
||||
@ -330,12 +388,12 @@ class EmployeePolicyModel extends Model
|
||||
WHERE
|
||||
batch_files.event_type = 'deletion'
|
||||
AND batch_files.actions = 'export'
|
||||
AND batch_files.insurer_or_tpa = 'insurer'
|
||||
AND batch_files.insurer_or_tpa = '{$insurer_or_tpa}'
|
||||
) AS batch_data ON employee_polices.id = batch_data.emp_policy_id
|
||||
WHERE
|
||||
batch_data.bf IS NULL
|
||||
AND batch_data.bl IS NULL
|
||||
AND employee_polices.client_policy_id = 12
|
||||
AND employee_polices.client_policy_id = {$client_policy_id}
|
||||
AND employee_polices.is_active = 1
|
||||
AND (a.endorsement_id IS NULL OR a.endorsement_id = '') AND a.field_name = 'status'
|
||||
");
|
||||
@ -346,35 +404,37 @@ class EmployeePolicyModel extends Model
|
||||
}
|
||||
|
||||
|
||||
public function updateTPAIDorUHID( $client_policy_id, $client_id, $name, $emp_code, $uhid, $tpa_id)
|
||||
public function updateTPAIDorUHID($update_data)
|
||||
{
|
||||
$client_id = $update_data['client_id'];
|
||||
$client_policy_id = $update_data['client_policy_id'];
|
||||
$name = $update_data['name'];
|
||||
$emp_code = $update_data['emp_code'];
|
||||
$uhid = $update_data['uhid'];
|
||||
$tpa_id = $update_data['tpa_id'];
|
||||
|
||||
// $this->table('employee_polices')
|
||||
// ->join('employees', 'employees.id = employee_polices.employee_id')
|
||||
// ->set('employee_polices.tpa_id', $tpa_id)
|
||||
// ->set('employee_polices.uhid', $uhid)
|
||||
// ->where('employees.emp_code', $emp_code)
|
||||
// ->where('employees.name', $name)
|
||||
// ->where('employees.client_id', $client_id)
|
||||
// ->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
// ->update();
|
||||
|
||||
$query = "UPDATE employee_polices
|
||||
$query = "
|
||||
UPDATE employee_polices
|
||||
JOIN employees ON employees.id = employee_polices.employee_id
|
||||
SET employee_polices.tpa_id = '{$tpa_id}',
|
||||
employee_polices.uhid = '{$uhid}'
|
||||
WHERE employees.emp_code = '{$emp_code}'
|
||||
AND employees.name = '{$name}'
|
||||
AND employees.client_id = '{$client_id}'
|
||||
AND employee_polices.client_policy_id = '{$client_policy_id}'";
|
||||
AND employee_polices.client_policy_id = '{$client_policy_id}'
|
||||
";
|
||||
|
||||
$this->query($query);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function updateCorrectionData($emp_code, $uhid, $endorsement_id){
|
||||
public function updateCorrectionData($update_data)
|
||||
{
|
||||
|
||||
$emp_code = $update_data['emp_code'];
|
||||
$uhid = $update_data['uhid'];
|
||||
$endorsement_id = $update_data['tpa_id'];
|
||||
|
||||
$sql = "
|
||||
UPDATE emp_endorsement
|
||||
@ -388,7 +448,37 @@ class EmployeePolicyModel extends Model
|
||||
}
|
||||
|
||||
|
||||
public function updateEndoresmentIdForSIEnhancement($emp_code, $client_id, $client_policy_id, $emp_name, $endorsement_id){
|
||||
public function updateEndoresmentIdForSIEnhancement($update_data){
|
||||
|
||||
$client_id = $update_data['client_id'];
|
||||
$client_policy_id = $update_data['client_policy_id'];
|
||||
$emp_name = $update_data['name'];
|
||||
$emp_code = $update_data['emp_code'];
|
||||
$endorsement_id = $update_data['uhid'];
|
||||
|
||||
$sql = "
|
||||
UPDATE emp_endorsement
|
||||
JOIN employee_polices ON employee_polices.id = emp_endorsement.pk
|
||||
JOIN employees ON employee_polices.employee_id = employees.id
|
||||
SET emp_endorsement.endorsement_id = '$endorsement_id'
|
||||
WHERE emp_endorsement.emp_code = '$emp_code'
|
||||
AND employees.client_id = '$client_id'
|
||||
AND employee_polices.client_policy_id = '$client_policy_id'
|
||||
AND emp_endorsement.actions = 'si'
|
||||
AND emp_endorsement.name = '$emp_name'
|
||||
";
|
||||
$query = $this->query($sql);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function updateEndoresmentIdForDeletion($update_data){
|
||||
|
||||
$client_id = $update_data['client_id'];
|
||||
$client_policy_id = $update_data['client_policy_id'];
|
||||
$emp_name = $update_data['name'];
|
||||
$emp_code = $update_data['emp_code'];
|
||||
$endorsement_id = $update_data['uhid'];
|
||||
|
||||
$sql = "
|
||||
UPDATE emp_endorsement
|
||||
@ -404,24 +494,12 @@ class EmployeePolicyModel extends Model
|
||||
}
|
||||
|
||||
|
||||
public function updateEndoresmentIdForDeletion($emp_code, $client_id, $client_policy_id, $emp_name, $endorsement_id){
|
||||
|
||||
$sql = "
|
||||
UPDATE emp_endorsement
|
||||
JOIN employee_polices ON employee_polices.id = emp_endorsement.pk
|
||||
JOIN employees ON employee_polices.employee_id = employees.id
|
||||
SET emp_endorsement.endorsement_id = '$endorsement_id'
|
||||
WHERE employees.emp_code = '$emp_code'
|
||||
AND employees.client_id = '$client_id'
|
||||
AND employee_polices.client_policy_id = '$client_policy_id'
|
||||
AND employees.name = '$emp_name'
|
||||
";
|
||||
$query = $this->query($sql);
|
||||
}
|
||||
|
||||
|
||||
public function fetchEmpEndorsementData($emp_code, $client_policy_id, $emp_name)
|
||||
public function fetchEmpEndorsementData($fetch_data)
|
||||
{
|
||||
$client_policy_id = $fetch_data['client_policy_id'];
|
||||
$emp_name = $fetch_data['name'];
|
||||
$emp_code = $fetch_data['emp_code'];
|
||||
|
||||
// Your raw SQL query
|
||||
$sql = "
|
||||
SELECT
|
||||
|
||||
47
app/Views/batch_list.php
Normal file
47
app/Views/batch_list.php
Normal file
@ -0,0 +1,47 @@
|
||||
<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;">Batch List</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">Batch Code</th>
|
||||
<th class="font-weight-medium">Client</th>
|
||||
<th class="font-weight-medium">Client Policy</th>
|
||||
<th class="font-weight-medium">Event Type</th>
|
||||
<th class="font-weight-medium">Insurer/TPA</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
<th class="font-weight-medium">Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="font-12">
|
||||
<?php
|
||||
if(isset($batch_list))
|
||||
{
|
||||
foreach ($batch_list as $key => $file) {
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1)?></b></td>
|
||||
<td><?php echo $file['batch_code']?></td>
|
||||
<td><?php echo $file['client_short_name']?></td>
|
||||
<td><?php echo $file['policy_name']?></td>
|
||||
<td><?php echo $file['event_type']?></td>
|
||||
<td><?php echo $file['insurer_or_tpa']?></td>
|
||||
<td><?php echo $file['actions']?></td>
|
||||
<td><?php echo $file['count']?></td>
|
||||
</tr>
|
||||
<?php }}?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
@ -107,7 +107,7 @@
|
||||
<div class="form-group col-md-6">
|
||||
<label for="gst">Logo</label>
|
||||
<input type="file" name="client_logo" id="client_logo" onchange="PreviewImage();"><br>
|
||||
<span class="text-danger"> Image dimensions 100 x 100 pixels and size of 200KB. </span>
|
||||
<i class="text">( Image dimensions 100 x 100 pixels and size of 200KB. )</i>
|
||||
</div>
|
||||
<div class="form-group col-md-6 float-right" style="position: relative;top: 20px;">
|
||||
<img src="<?= isset($client['client_logo']) && !empty($client['client_logo']) ? base_url() . "public/uploads/logo/" . $client['client_logo'] : 'http://ssl.gstatic.com/accounts/ui/avatar_2x.png' ?>" width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar"/>
|
||||
@ -198,7 +198,7 @@ $(document).ready(function () {
|
||||
$('#client_id_relation').val(res.data.id);
|
||||
$('#relation_PrimaryKey').val(res.data.id);
|
||||
$('#client_id_branch').val(res.data.id);
|
||||
$('#branch_PrimaryKey').val(res.data.id);
|
||||
$('#client_id_for_client_branch').val(res.data.id);
|
||||
$('#client_id_policy').val(res.data.id);
|
||||
$('#policy_PrimaryKey').val(res.data.id);
|
||||
$('#client_id_kyc').val(res.data.id);
|
||||
@ -229,7 +229,7 @@ $(document).ready(function () {
|
||||
<td id="form_${item.id}" style=""><form class="ajax" ><input class="file-input__input" type="file" name="file_name">
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" class="form-control" value="${item.id}" name="kyc_doc_type_id" />
|
||||
<input type="hidden" name="client_id" value="${client_id_for_file}"/>
|
||||
<input type="hidden" name="client_id" id="id_for_kyc_file" value="${client_id_for_file}"/>
|
||||
<button class="btn btn-sm btn-primary submit" style="position: relative;right: 80px;">Submit</button></form></td>
|
||||
<td id="name_${item.id}" style="display:none;"></td>
|
||||
<td><i data-id="${item.id}" class="mdi mdi-delete btnKycDelete" style="font-size:18px;"></i></td>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<div class="tab-pane fade" id="branch-tab">
|
||||
|
||||
<input type="hidden" id="client_id_for_client_branch" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
||||
<div class="row float-right" style="padding-bottom: 10px;position: relative;right: 13px;">
|
||||
<button type="button" id="btnBranchAdd" class="btn btn-primary waves-effect waves-light btn-sm"><span class="fa fa-plus-square" aria-hidden="true" style="padding: 5px 10px;"></span>Add Branch</button>
|
||||
</div>
|
||||
@ -31,8 +31,8 @@
|
||||
<form role="form" class="parsley-examples" method="post" id="branch_form"
|
||||
enctype="multipart/form-data">
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="branch_PrimaryKey" />
|
||||
<input type="hidden" name="client_id" id="client_id_branch" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
||||
<input type="hidden" name="branch_id_primarykey" id="branch_id_primarykey"/>
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
@ -65,7 +65,8 @@
|
||||
placeholder="Enter District" name="district" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="city">City</label>
|
||||
<label for="city">City<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_city"
|
||||
placeholder="Enter City" name="city" required>
|
||||
</div>
|
||||
@ -116,17 +117,16 @@
|
||||
</div>
|
||||
<!-- end -->
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
var branch_form_action = '';
|
||||
var contactCount = 1;
|
||||
var branch_PrimaryKey = $('#client_id_branch').val();
|
||||
var branch_PrimaryKey_2 = $('#branch_PrimaryKey').val();
|
||||
var branch_PrimaryKey = $('#client_id_for_client_branch').val();
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
branch_PrimaryKey = $('#client_id_branch').val();
|
||||
branch_PrimaryKey_2 = $('#branch_PrimaryKey').val();
|
||||
|
||||
$('#add_branch').hide();
|
||||
$('.btnBack').hide();
|
||||
@ -200,6 +200,7 @@ $(document).ready(function () {
|
||||
$('#branch_city').val('');
|
||||
$('#branch_form')[0].reset();
|
||||
$('.ac').css('display', 'block');
|
||||
contactCount = 1
|
||||
|
||||
var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
for (var i = 0; i < buttonIds.length; i++) {
|
||||
@ -220,12 +221,13 @@ $(document).ready(function () {
|
||||
|
||||
|
||||
$("#branch_form").submit(function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
branch_PrimaryKey = $('#client_id_for_client_branch').val();
|
||||
|
||||
branch_PrimaryKey = $('#client_id_branch').val();
|
||||
branch_PrimaryKey_2 = $('#branch_PrimaryKey').val();
|
||||
console.log('branch_PrimaryKey', branch_PrimaryKey)
|
||||
|
||||
if (branch_PrimaryKey === '' || branch_PrimaryKey_2 === '') {
|
||||
if (branch_PrimaryKey === '') {
|
||||
toastr.error('Client is required', 'Error');
|
||||
$('#insurer').val('');
|
||||
$('#tpa').val('');
|
||||
@ -277,7 +279,6 @@ $(document).ready(function () {
|
||||
`;
|
||||
});
|
||||
$('#branch_list').append(branchTableInsert);
|
||||
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
@ -290,17 +291,19 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
}
|
||||
contactCount = 1
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '.btnBranchEdit', function () {
|
||||
|
||||
console.log(branch_form_action);
|
||||
|
||||
contactCount = 1
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
var branch_id = $(this).attr('data-id');
|
||||
$('#branch_id_primarykey').val(branch_id);
|
||||
|
||||
branch_form_action = '<?= base_url("client/branch/edit"); ?>';
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('client/branch/list/');?>'+branch_id,
|
||||
@ -311,8 +314,10 @@ $(document).ready(function () {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res)
|
||||
}, 500);
|
||||
|
||||
console.log('branch contact : ',res.contact)
|
||||
|
||||
$('#add_branch').show();
|
||||
$('#branch_table').hide();
|
||||
$('.btnBack').show();
|
||||
@ -330,11 +335,14 @@ $(document).ready(function () {
|
||||
$('#designation').val(res.contact[0].designation);
|
||||
|
||||
res.contact.shift();
|
||||
$.each(res.contact, function(index, contact) {
|
||||
console.log(res.contact.length)
|
||||
for (let index = 0; index < res.contact.length; index++) {
|
||||
const contact = res.contact[index];
|
||||
if (contact !== undefined) {
|
||||
appendContactHtml(contact);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
|
||||
@ -105,9 +105,7 @@
|
||||
$(document).on('click', '.submit', function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
// kycPrimaryKey = $('#kyc_PrimaryKey').val();
|
||||
kycPrimaryKey = $('#client_id_kyc').val();
|
||||
|
||||
kycPrimaryKey = $('#id_for_kyc_file').val();
|
||||
|
||||
var form = $(this).closest('form');
|
||||
var formData = new FormData(form[0]);
|
||||
|
||||
@ -8,12 +8,21 @@
|
||||
|
||||
<div class="tab-pane fade active show" id="general-q-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="col-xl-6">
|
||||
<div id="accordion1" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<a id="toggleIcon1" class="text-dark float-right" data-toggle="collapse" href="#collapseTwo"
|
||||
aria-expanded="true">
|
||||
<i id="icon1" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
<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">
|
||||
<input type="hidden" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>" id="csrf_token">
|
||||
<input type="hidden" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>"
|
||||
id="csrf_token">
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
@ -35,7 +44,8 @@
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Event</label> <br />
|
||||
<select name="upload-action-type" class="form-control" id="upload-action-type" required>
|
||||
<select name="upload-action-type" class="form-control"
|
||||
id="upload-action-type" required>
|
||||
<option value="">Select</option>
|
||||
<?php
|
||||
if(isset($actions) && count($actions))
|
||||
@ -55,15 +65,21 @@
|
||||
<div class="form-row" id="file_upload">
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Upload file</label> [ <a id="excel_download" data-toggle="tooltip" data-placement="top" title="Download Sample Excel">Sample Excel</a> ]
|
||||
<input type="file" name="emplist" id="emplist" accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet"
|
||||
<label>Upload file</label> [ <a id="excel_download"
|
||||
data-toggle="tooltip" data-placement="top"
|
||||
title="Download Sample Excel">Sample Excel</a> ]
|
||||
<input type="file" name="emplist" id="emplist"
|
||||
accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-start" style="margin-top: 18px;">
|
||||
<div class="form-group col-md-11"> <!-- Adjusted the width to 11 columns -->
|
||||
<div class="d-flex align-items-center justify-content-start"
|
||||
style="margin-top: 18px;">
|
||||
<div class="form-group col-md-11">
|
||||
<!-- Adjusted the width to 11 columns -->
|
||||
<div class="col-md-3">
|
||||
<button id="emp_form_submit_button" type="submit" class="btn btn-primary waves-effect waves-light justify-content-end">Upload</button>
|
||||
<button id="emp_form_submit_button" type="submit"
|
||||
class="btn btn-primary waves-effect waves-light justify-content-end">Upload</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -79,6 +95,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- end page title -->
|
||||
<div class="row" id="file_list">
|
||||
@ -107,7 +125,6 @@
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$('#file_upload').hide();
|
||||
|
||||
// Declare a global variable to store API response data
|
||||
@ -180,7 +197,8 @@ $(document).ready(function() {
|
||||
console.log(response);
|
||||
if (response.code === 200 && response.dataStatus === true && response
|
||||
.data !== "") {
|
||||
toastr.success('File upload successs, Data validation is in-progress',
|
||||
toastr.success(
|
||||
'File upload successs, Data validation is in-progress',
|
||||
'success');
|
||||
window.location.reload(true);
|
||||
} else if (response.code === 404 && response.dataStatus === false) {
|
||||
@ -295,7 +313,8 @@ function fetchFileError(file_id) {
|
||||
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 ?
|
||||
file_error_data['error_data'] + "</strong>" : (err_id ==
|
||||
6 ?
|
||||
"<strong>" + file_error_data['error_data'] +
|
||||
"</strong>" : ""))))));
|
||||
file_error_html += '<br/>';
|
||||
@ -303,7 +322,8 @@ function fetchFileError(file_id) {
|
||||
|
||||
}
|
||||
if (err_id != 5 && err_id != 6) {
|
||||
file_error_html += (file_error_html != "" ? "<a href ='<?php echo base_url()?>" +
|
||||
file_error_html += (file_error_html != "" ?
|
||||
"<a href ='<?php echo base_url()?>" +
|
||||
"employee/excel_error/" + file_id +
|
||||
"' target=_blank>click here to more details...</a>" : "");
|
||||
}
|
||||
@ -440,6 +460,11 @@ function fetchEmpolyeeList(event) {
|
||||
console.log('Download action triggered.');
|
||||
}
|
||||
});
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
document.getElementById('toggleIcon1').addEventListener('click', function() {
|
||||
var icon = document.getElementById('icon1');
|
||||
icon.classList.toggle('mdi-chevron-down');
|
||||
icon.classList.toggle('mdi-chevron-up');
|
||||
});
|
||||
//--------------------------------------------------------------------------------------
|
||||
</script>
|
||||
@ -22,7 +22,7 @@
|
||||
<div class="form-group col-md-4">
|
||||
<label for="insurer_name">Insurer Name<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="name"
|
||||
<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">
|
||||
|
||||
@ -67,7 +67,8 @@
|
||||
placeholder="Enter District" name="district" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="city">City</label>
|
||||
<label for="city">City<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_city"
|
||||
placeholder="Enter City" name="city" required>
|
||||
</div>
|
||||
@ -123,17 +124,16 @@
|
||||
<script>
|
||||
|
||||
var contactCount = 1;
|
||||
var insurer_branch_form_action = '';
|
||||
var insurer_Branch_PrimaryKey = $('#insurer_id_branch').val();
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
var insurer_Branch_PrimaryKey = $('#insurer_id_branch').val();
|
||||
var insurer_branch_form_action = '';
|
||||
insurer_Branch_PrimaryKey = $('#insurer_id_branch').val();
|
||||
|
||||
$('#add_branch').hide();
|
||||
$('.btnBack').hide();
|
||||
|
||||
loadBranchList();
|
||||
|
||||
|
||||
$('#btnBranchAdd').click(function(){
|
||||
|
||||
@ -201,7 +201,7 @@ $(document).ready(function () {
|
||||
if(insurer_Branch_PrimaryKey !== ''){
|
||||
|
||||
var branchTable = '';
|
||||
var data = <?= isset($insurer_branch) ? json_encode($insurer_branch) : '[]' ?>;
|
||||
var data = <?= isset($insuer_branch) ? json_encode($insuer_branch) : '[]' ?>;
|
||||
$.each(data, function(index, item) {
|
||||
branchTable += `
|
||||
<tr>
|
||||
@ -214,8 +214,11 @@ $(document).ready(function () {
|
||||
$('#insurer_branch_list').append(branchTable);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
$("#insurer_branch_form").submit(function(events) {
|
||||
console.log(1, insurer_branch_form_action);
|
||||
events.preventDefault();
|
||||
var isValid = $('#insurer_branch_form').parsley().validate();
|
||||
if (isValid) {
|
||||
@ -237,7 +240,7 @@ $(document).ready(function () {
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
// $('#insurer_branch_list tr').remove();
|
||||
$('#insurer_branch_list tr').remove();
|
||||
var insurerBranchTableInsert = ''
|
||||
$.each(res.data, function(index, item) {
|
||||
insurerBranchTableInsert += `
|
||||
@ -270,17 +273,22 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '.btnBranchEdit', function () {
|
||||
$('#container').html("");
|
||||
contactCount =1;
|
||||
var branch_id = $(this).attr('data-id');
|
||||
$('#insurer_Branch_PrimaryKey').val(branch_id);
|
||||
|
||||
insurer_branch_form_action = '<?= base_url("master/insurer/branch/edit"); ?>';
|
||||
|
||||
console.log(insurer_branch_form_action)
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('master/insurer/branch/editget/');?>'+branch_id,
|
||||
type: "GET",
|
||||
@ -300,7 +308,6 @@ $(document).ready(function () {
|
||||
$('#state option[value="' + res.insurerbranch.state + '"]').prop('selected', true);
|
||||
$('#district').val(res.insurerbranch.district);
|
||||
$('#branch_city').val(res.insurerbranch.city);
|
||||
$('#insurer_Branch_PrimaryKey').val(res.insurerbranch.id);
|
||||
|
||||
$('#contact_id_1').val(res.levelcontact[0].id);
|
||||
$('.form-row').find('#name').val(res.levelcontact[0].name);
|
||||
@ -330,59 +337,6 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '#btnSubmit', function(){
|
||||
|
||||
$('#insurer_branch_list').html(" ");
|
||||
loadBranchList();
|
||||
})
|
||||
|
||||
function loadBranchList()
|
||||
{
|
||||
var base_url = '<?= base_url("master/insurer/branch/list/"); ?>';
|
||||
|
||||
var insurer_branch_action = base_url + insurer_Branch_PrimaryKey;
|
||||
if ($('#insurer_id_branch').val() != '') {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: insurer_branch_action,
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
var branchTable = '';
|
||||
$.each(response.insuer_branch, function(index, item) {
|
||||
branchTable += `
|
||||
<tr>
|
||||
<td>${item.branch_name}</td>
|
||||
<td>${item.branch_code}</td>
|
||||
<td><a class="mdi mdi-lead-pencil btnBranchEdit" href="#" data-id="${item.id}" style="font-size:18px;"></a></td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
$('#insurer_branch_list').html(branchTable);
|
||||
},
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -438,9 +392,6 @@ if(reset == false){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function removeContact(button) {
|
||||
var uniqueId = button.id.split("_")[0];
|
||||
var contactSection = document.getElementById(uniqueId);
|
||||
|
||||
@ -1,13 +1,22 @@
|
||||
<div class="tab-pane fade" id="KYC-DOC-tab">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="col-xl-6">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
<form class="parsley-examples" id="import_export_excel_form" action = "<?php echo base_url().'util/import-export'?>" method="post"
|
||||
<form class="parsley-examples" id="import_export_excel_form"
|
||||
action="<?php echo base_url().'util/import-export'?>" method="post"
|
||||
enctype="multipart/form-data">
|
||||
<input type="hidden" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>" id="csrf_token">
|
||||
<input type="hidden" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>"
|
||||
id="csrf_token">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
@ -26,7 +35,8 @@
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Insurer/TPA Data</label> <br />
|
||||
<select name="insurer_or_tpa" class="form-control" id="insurer_or_tpa" required>
|
||||
<select name="insurer_or_tpa" class="form-control" id="insurer_or_tpa"
|
||||
required>
|
||||
<option value="">Select</option>
|
||||
<?php
|
||||
if(isset($insurer_or_tpa) && count($insurer_or_tpa))
|
||||
@ -61,7 +71,8 @@
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Event</label> <br />
|
||||
<select name="event_type" class="form-control" id="upload-action-type" required>
|
||||
<select name="event_type" class="form-control" id="upload-action-type"
|
||||
required>
|
||||
<option value="">Select</option>
|
||||
<?php
|
||||
if(isset($events) && count($events))
|
||||
@ -82,9 +93,12 @@
|
||||
<div class="form-row" id="import_excel_btn">
|
||||
<div class="form-group col-md-3">
|
||||
<label>Upload file</label>
|
||||
<input type="file" name="import_file_data" id="import_file" accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet" required>
|
||||
<input type="file" name="import_file_data" id="import_file"
|
||||
accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet"
|
||||
required>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-start" style="margin-top: 18px;">
|
||||
<div class="d-flex align-items-center justify-content-start"
|
||||
style="margin-top: 18px;">
|
||||
<div class="form-group col-md-3">
|
||||
<button id="emp_form_submit_button" type="submit"
|
||||
class="btn btn-primary waves-effect waves-light justify-content-end">Upload</button>
|
||||
@ -93,7 +107,8 @@
|
||||
</div>
|
||||
|
||||
<div class="form-row" id="export_excel_btn">
|
||||
<div class="d-flex align-items-center justify-content-start" style="margin-top: 18px;">
|
||||
<div class="d-flex align-items-center justify-content-start"
|
||||
style="margin-top: 18px;">
|
||||
<div class="form-group col-md-3">
|
||||
<button id="emp_form_submit_button_2" type="submit"
|
||||
class="btn btn-primary waves-effect waves-light justify-content-end">Download</button>
|
||||
@ -105,8 +120,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- end page title -->
|
||||
<div class="row" id="file_list">
|
||||
<?php include('batch_list.php');?>
|
||||
</div>
|
||||
<!-- end row -->
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
@ -330,5 +354,12 @@ $('#action_type').change(function() {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
document.getElementById('toggleIcon').addEventListener('click', function() {
|
||||
var icon = document.getElementById('icon');
|
||||
icon.classList.toggle('mdi-chevron-down');
|
||||
icon.classList.toggle('mdi-chevron-up');
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
</script>
|
||||
@ -37,7 +37,7 @@
|
||||
<div class="form-group col-md-6">
|
||||
<label for="insurer_id">Insurer<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="insurer_id" name="insurer_id" required>
|
||||
<option value="0">Select Insurer</option>
|
||||
<option value="">Select Insurer</option>
|
||||
<?php if (!empty($insurer)) { foreach ($insurer as $insurer) : ?>
|
||||
<option value="<?= $insurer['id'] ?>"><?= $insurer['name'] ?></option>
|
||||
<?php endforeach; } ?>
|
||||
@ -181,7 +181,7 @@ $(document).ready(function () {
|
||||
if(policy_type_PrimaryKey !== ''){
|
||||
|
||||
var branchTable = '';
|
||||
var data = <?= isset($tpa_branch) ? json_encode($tpa_branch) : '[]' ?>;
|
||||
var data = <?= isset($policies) ? json_encode($policies) : '[]' ?>;
|
||||
$.each(data, function(index, item) {
|
||||
branchTable += `
|
||||
<tr>
|
||||
@ -200,7 +200,6 @@ $(document).ready(function () {
|
||||
|
||||
var isValid = $('#tpa_branch_form').parsley().validate();
|
||||
|
||||
|
||||
if (isValid) {
|
||||
|
||||
var formData = new FormData($('#tpa_branch_form')[0]);
|
||||
@ -219,7 +218,7 @@ $(document).ready(function () {
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
// console.log(res);
|
||||
// $('#policies_list tr').remove();s
|
||||
// $('#policies_list tr').remove();
|
||||
var tpaBranchTableInsert = ''
|
||||
$.each(res.data, function(index, item) {
|
||||
tpaBranchTableInsert += `
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<label for="kyc_name">Policy Type Name<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="policy_type"
|
||||
placeholder="Enter Kyc Entity Type Name" value="<?= isset($policytype['policy_type']) ? $policytype['policy_type'] : '' ?>" name="policy_type" required>
|
||||
placeholder="Enter Policy Type Name" value="<?= isset($policytype['policy_type']) ? $policytype['policy_type'] : '' ?>" name="policy_type" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="bap">Bap<span
|
||||
@ -24,7 +24,7 @@
|
||||
<label for="allocg">Allocg<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="allocg"
|
||||
placeholder="Enter Short Name" value="<?= isset($policytype['allocg']) ? $policytype['allocg'] : '' ?>" name="allocg" required>
|
||||
placeholder="Enter Allocg" value="<?= isset($policytype['allocg']) ? $policytype['allocg'] : '' ?>" name="allocg" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="alloci">Alloci<span
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<th class="font-weight-medium">Policy Type</th>
|
||||
<th class="font-weight-medium">Bap</th>
|
||||
<th class="font-weight-medium">Allocg</th>
|
||||
<th class="font-weight-medium">alloci</th>
|
||||
<th class="font-weight-medium">Alloci</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user