diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 03c485f6..33f81ae8 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -28,6 +28,7 @@ $routes->group("/dashboard", ["filter" => "authMVC"], function($routes){ $routes->get("view", "DashboardController::dashboard"); }); + $routes->group("/client", ["filter" => "authMVC"], function($routes){ $routes->get("list", "ClientController::index"); @@ -60,8 +61,13 @@ $routes->group("/client", ["filter" => "authMVC"], function($routes){ $routes->get("list/(:any)", "ClientController::getKycDocsById/$1"); $routes->get("delete/(:any)", "ClientController::deleteClientKycDocs/$1"); }); + $routes->group("premimum", ["filter" => "authMVC"], function($routes){ + $routes->post("create", "ClientController::createClientPolicyPremium"); + $routes->post("edit", "ClientController::editClientPolicyPremium"); + }); }); + $routes->group("/employee", ["filter" => "authMVC"], function($routes){ $routes->get("list", "EmployeeController::list"); $routes->get("search", "EmployeeController::search"); @@ -70,10 +76,85 @@ $routes->group("/employee", ["filter" => "authMVC"], function($routes){ }); +$routes->group("/master", ["filter" => "authMVC"], function($routes){ + + + $routes->group("insurer", ["filter" => "authMVC"], function($routes){ + $routes->get("list", "MasterController::insurerList"); + $routes->get("create", "MasterController::insurerOnboarding"); + $routes->post("createpost", "MasterController::createInsurerGeneralInfo"); + $routes->post("edit", "MasterController::editInsurerGeneralInfo"); + $routes->get("list/(:any)", "MasterController::editInsurerOnboarding/$1"); + + $routes->group("branch", ["filter" => "authMVC"], function($routes){ + $routes->post("create", "MasterController::createInsurerBranch"); + $routes->post("edit", "MasterController::editInsurerBranch"); + $routes->get("editget/(:any)", "MasterController::editInsurerGet/$1"); + $routes->get("list/(:any)", "MasterController::insurerBranchList/$1"); + }); + + }); + + $routes->group("tpa", ["filter" => "authMVC"], function($routes){ + $routes->get("list", "MasterController::tpaList"); + $routes->get("create", "MasterController::tpaOnboarding"); + $routes->post("createpost", "MasterController::createTPAGeneralInfo"); + $routes->post("edit", "MasterController::editTPAGeneralInfo"); + $routes->get("list/(:any)", "MasterController::editTPAOnboarding/$1"); + + $routes->group("branch", ["filter" => "authMVC"], function($routes){ + $routes->post("create", "MasterController::createTPABranch"); + $routes->get("editget/(:any)", "MasterController::editTPAGet/$1"); + $routes->post("edit", "MasterController::editTPABranch"); + $routes->get("list/(:any)", "MasterController::tpaBranchList/$1"); + }); + }); + + $routes->group("kyc", ["filter" => "authMVC"], function($routes){ + $routes->get("list", "MasterController::kycList"); + $routes->get("create", "MasterController::kycOnboarding"); + $routes->post("createpost", "MasterController::createKYCInfo"); + $routes->post("edit", "MasterController::editKYCInfo"); + $routes->get("list/(:any)", "MasterController::editKYCOnboarding/$1"); + $routes->get("delete/(:any)", "MasterController::deleteClientKycDocs/$1"); + + + $routes->group("kycdocs", ["filter" => "authMVC"], function($routes){ + $routes->post("createpost", "MasterController::createKycDocs"); + $routes->get("editget/(:any)", "MasterController::editKYCGet/$1"); + $routes->post("edit", "MasterController::editKYCDocs"); + $routes->get("list", "MasterController::tpaBranchList"); + $routes->get("list/(:any)", "MasterController::kycDocsList/$1"); + + }); + }); + + $routes->group("policy", ["filter" => "authMVC"], function($routes){ + $routes->get("list", "MasterController::policyTypeList"); + $routes->get("create", "MasterController::policyTypeOnboarding"); + $routes->post("createpost", "MasterController::createPolicyType"); + $routes->post("edit", "MasterController::editPolicyType"); + $routes->get("list/(:any)", "MasterController::editPolicyTypeOnboarding/$1"); + + + $routes->group("policies", ["filter" => "authMVC"], function($routes){ + $routes->post("createpost", "MasterController::createPolicies"); + $routes->get("editget/(:any)", "MasterController::editPoliciesGet/$1"); + $routes->post("edit", "MasterController::editPolicies"); + $routes->get("list", "MasterController::tpaBranchList"); + $routes->get("list/(:any)", "MasterController::policesList/$1"); + }); + + }); +}); + + $routes->group("/util", ["filter" => "authMVC"], function($routes){ $routes->get("clients-with-policies", "EmployeeController::getClientWithPolicies"); $routes->get("police-by-insurer/(:any)", "ClientController::getPolicesByInsurerId/$1"); $routes->get("get-file-error/(:any)", "EmployeeController::getUploadedFileError/$1"); + $routes->get("kyc-other-docs-delete/(:any)", "ClientController::deleteClientKycOtherDocs/$1"); + $routes->get("policy-premium", "ClientController::getpolicyGridData/$1"); }); $routes->cli('processjob', 'JobWorker::processJob'); diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 0b321f69..554c8a2f 100644 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -23,6 +23,9 @@ use App\Models\PolicesModel; use App\Models\TPABranchModel; use App\Models\TPAModel; use App\Models\StateModel; +use App\Models\PolicyGridModel; +use App\Models\PolicyPremium1Model; +use App\Models\PolicyPremium2Model; class ClientController extends AdminController @@ -45,6 +48,9 @@ class ClientController extends AdminController protected $tpaBranchModel; protected $tpaModel; protected $stateModel; + protected $policyGridModel; + protected $policyPremium1Model; + protected $policyPremium2Model; public function __construct() @@ -67,6 +73,9 @@ class ClientController extends AdminController $this->tpaBranchModel = new TPABranchModel(); $this->tpaModel = new TPAModel(); $this->stateModel = new StateModel(); + $this->policyGridModel = new PolicyGridModel(); + $this->policyPremium1Model = new PolicyPremium1Model(); + $this->policyPremium2Model = new PolicyPremium2Model(); } public function index() @@ -97,6 +106,7 @@ class ClientController extends AdminController $data['tpa'] = $this->tpaBranchModel ->getTpaBranchesWithTpaNames(); $data['state'] = $this->stateModel->getAllStates(); $data['RM'] = $this->userModel->findAll(); + $data['policyGridData'] = $this->policyGridModel->findAll(); // echo "
";
// print_r($data); die;
@@ -113,23 +123,22 @@ class ClientController extends AdminController
$this->myLogger->logme('error','Edit Client Onboarding function called');
$headerData['page_name'] = 'Edit Client Onboarding';
- $editData['RM'] = $this->userModel->findAll();
- $editData['tpa'] = $this->tpaBranchModel ->getTpaBranchesWithTpaNames();
- $editData['state'] = $this->stateModel->getAllStates();
- $editData['police'] = $this->policesModel->findAll();
- $editData['entity'] = $this->kycEntityTypeModel->findAll();
- $editData['insurer'] = $this->insurerBranchModel ->getInsurerBranchesWithInsurerNames();
- $editData['kyc_docs'] = $this->kycDocsModel->findAll();
+ $editData['RM'] = $this->userModel->findAll();
+ $editData['tpa'] = $this->tpaBranchModel ->getTpaBranchesWithTpaNames();
+ $editData['state'] = $this->stateModel->getAllStates();
+ $editData['police'] = $this->policesModel->findAll();
+ $editData['entity'] = $this->kycEntityTypeModel->findAll();
+ $editData['insurer'] = $this->insurerBranchModel ->getInsurerBranchesWithInsurerNames();
+ $editData['kyc_docs'] = $this->kycDocsModel->findAll();
+ $editData['policyGridData'] = $this->policyGridModel->findAll();
$editData['client'] = $this->clientModel->where(['id' => $id, 'is_active' => 1])->first();
- $editData['client_kyc'] = $this->clientKYCDocsModel->getKycDocsName($id);
+ $editData['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $id)->findAll();
$editData['client_branch'] = $this->clientBranchModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
$editData['client_relation'] = $this->clientRMModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
$editData['client_policy'] = $this->clientPolicyModel->getClientPolicyByClientId($id);
-
-
// echo "";
// print_r($editData); die;
@@ -170,19 +179,20 @@ class ClientController extends AdminController
public function createClientKYCInfo()
{
- $this->myLogger->logme('error','create Client kyc function called');
+ $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'));
if(!empty($File)){
$data['file_name'] = $File;
}
- $data['client_id'] = $this->request->getPost('client_id');
- $data['kyc_doc_type_id'] = $this->request->getPost('kyc_doc_id');
$data['created_by'] = get_session_userid();
$insert = $this->clientKYCDocsModel->insert($data);
if($insert){
- $kycDocs = $this->clientKYCDocsModel->getKycDocsName($this->request->getPost('client_id'));
- echo json_encode(array("status" => true , 'data' => $kycDocs));
+
+ $kycDocs = $this->clientKYCDocsModel->where('client_id',$this->request->getPost('client_id'))->findAll();
+ echo json_encode(array("status" => true , 'data' => $kycDocs, 'file_name' => $File));
}else{
echo json_encode(array("status" => false));
}
@@ -210,11 +220,22 @@ class ClientController extends AdminController
}
public function deleteClientKycDocs($id=null)
+ {
+
+ $delete = $this->clientKYCDocsModel->where('kyc_doc_type_id', $id)->delete();
+ if($delete){
+ echo json_encode(array("status" => true, 'id' => $id ));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+ public function deleteClientKycOtherDocs($id=null)
{
$delete = $this->clientKYCDocsModel->where('id', $id)->delete();
if($delete){
- echo json_encode(array("status" => true ));
+ echo json_encode(array("status" => true, 'id' => $id ));
}else{
echo json_encode(array("status" => false));
}
@@ -382,26 +403,46 @@ class ClientController extends AdminController
$this->myLogger->logme('error','Client policy CREATE function called');
- $insurerValue = (string) $this->request->getPost('insurer');
+ $insurerValue = (string) $this->request->getPost('insurer');
list($insurerBranchId, $insurerId) = explode('-', $insurerValue);
$data['insurer_branch_id'] = $insurerBranchId;
- $data['insurer_id'] = $insurerId;
+ $data['insurer_id'] = $insurerId;
$tpaValue = (string) $this->request->getPost('tpa');
list($tpaBranchId, $tpaId) = explode('-', $tpaValue);
- $data['tpa_branch_id'] = $tpaBranchId;
- $data['tpa_id'] = $tpaId;
- $data['policy_id'] = $this->request->getPost('policy_id');
- $data['client_id'] = $this->request->getPost('client_id');
+ $data['tpa_branch_id'] = $tpaBranchId;
+ $data['tpa_id'] = $tpaId;
+ $data['policy_id'] = $this->request->getPost('policy_id');
+ $data['policy_type_id'] = $this->request->getPost('policy_type_id');
+ $data['client_id'] = $this->request->getPost('client_id');
- $data['created_by'] = get_session_userid();
+ $data['insured'] = $this->request->getPost('insured');
+ $data['no_of_lives'] = $this->request->getPost('no_of_lives');
+ $data['policy_status'] = $this->request->getPost('policy_status');
+ $data['no_of_employees'] = $this->request->getPost('no_of_employees');
+ $data['earned_premium_date'] = change_date_format($this->request->getPost('earned_premium_date'), 'd-m-Y', 'Y-m-d');
+ $data['claims_incurred_date'] = change_date_format($this->request->getPost('claims_incurred_date'), 'd-m-Y', 'Y-m-d'); $data['incurred_claims_ratio'] = $this->request->getPost('incurred_claims_ratio');
+ $data['no_lives_at_inception'] = $this->request->getPost('no_lives_at_inception');
+ $data['premium_paid_at_inception'] = $this->request->getPost('premium_paid_at_inception');
+ $data['claims_experience_for_last_3_years'] = $this->request->getPost('claims_experience_for_last_3_years');
+ $data['earned_premium_amount'] = $this->request->getPost('earned_premium_amount');
+ $data['claims_incurred_amount'] = $this->request->getPost('claims_incurred_amount');
+
+
+
+ $data['policy_start_date'] = change_date_format($this->request->getPost('policy_start_date'), 'd-m-Y', 'Y-m-d');
+ $data['policy_end_date'] = change_date_format($this->request->getPost('policy_end_date'), 'd-m-Y', 'Y-m-d');
+
+
+ $data['created_by'] = get_session_userid();
+
$insert = $this->clientPolicyModel->insert($data);
if($insert){
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($this->request->getPost('client_id'));
- echo json_encode(array("status" => true , 'data' => $clientPoliceData));
+ echo json_encode(array("status" => true , 'data' => $clientPoliceData, 'method' => 'CERATE'));
}else{
echo json_encode(array("status" => false));
}
@@ -412,34 +453,137 @@ class ClientController extends AdminController
$this->myLogger->logme('error','Client policy function called');
- $id = $this->request->getPost('PrimaryKey');
+ $id = $this->request->getPost('PrimaryKey');
$client_id = $this->request->getPost('client_id');
- $insurerValue = (string) $this->request->getPost('insurer');
+ $insurerValue = (string) $this->request->getPost('insurer');
list($insurerBranchId, $insurerId) = explode('-', $insurerValue);
$data['insurer_branch_id'] = $insurerBranchId;
- $data['insurer_id'] = $insurerId;
+ $data['insurer_id'] = $insurerId;
- $tpaValue = (string) $this->request->getPost('tpa');
+ $tpaValue = (string) $this->request->getPost('tpa');
list($tpaBranchId, $tpaId) = explode('-', $tpaValue);
- $data['tpa_branch_id'] = $tpaBranchId;
- $data['tpa_id'] = $tpaId;
- $data['policy_id'] = $this->request->getPost('policy_id');
+ $data['tpa_branch_id'] = $tpaBranchId;
+ $data['tpa_id'] = $tpaId;
+ $data['policy_id'] = $this->request->getPost('policy_id');
+ $data['policy_type_id'] = $this->request->getPost('policy_type_id');
+ $data['policy_start_date'] = change_date_format($this->request->getPost('policy_start_date'), 'd-m-Y', 'Y-m-d');
+ $data['policy_end_date'] = change_date_format($this->request->getPost('policy_end_date'), 'd-m-Y', 'Y-m-d');
+
+ $data['insured'] = $this->request->getPost('insured');
+ $data['no_of_lives'] = $this->request->getPost('no_of_lives');
+ $data['policy_status'] = $this->request->getPost('policy_status');
+ $data['no_of_employees'] = $this->request->getPost('no_of_employees');
+ $data['earned_premium_date'] = change_date_format($this->request->getPost('earned_premium_date'), 'd-m-Y', 'Y-m-d');
+ $data['claims_incurred_date'] = change_date_format($this->request->getPost('claims_incurred_date'), 'd-m-Y', 'Y-m-d');
+ $data['incurred_claims_ratio'] = $this->request->getPost('incurred_claims_ratio');
+ $data['no_lives_at_inception'] = $this->request->getPost('no_lives_at_inception');
+ $data['premium_paid_at_inception'] = $this->request->getPost('premium_paid_at_inception');
+ $data['claims_experience_for_last_3_years'] = $this->request->getPost('claims_experience_for_last_3_years');
+ $data['earned_premium_amount'] = $this->request->getPost('earned_premium_amount');
+ $data['claims_incurred_amount'] = $this->request->getPost('claims_incurred_amount');
$data['updated_by'] = get_session_userid();
$insert = $this->clientPolicyModel->update($id,$data);
$lastQuery = $this->clientPolicyModel->getLastQuery();
+
+ // echo '';
+ // print_r($lastQuery); die;
if($insert){
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($client_id);
- echo json_encode(array("status" => true , 'data' => $clientPoliceData));
+ echo json_encode(array("status" => true , 'data' => $clientPoliceData , 'method' => 'EDIT'));
}else{
echo json_encode(array("status" => false));
}
}
+
+ public function createClientPolicyPremium()
+ {
+ $policy_type = $this->request->getPost('policy_type');
+ $client_id = $this->request->getPost('client_id');
+ $client_policy_id = $this->request->getPost('client_policy_id');
+ $policy_grid_id = $this->request->getPost('policy_grid_id');
+
+ if($policy_type !== null && $policy_type !== ''){
+
+ $data = $this->request->getPost();
+ $data['created_by'] = get_session_userid();
+ $this->policyPremium1Model->where('client_id', $client_id)->where('client_policy_id', $client_policy_id)->set('is_active', 0)->update();
+ $insert = $this->policyPremium1Model->insert($data);
+
+ }else{
+
+ $this->policyPremium2Model->where('client_id', $client_id)->where('client_policy_id', $client_policy_id)->set('is_active', 0)->update();
+ $premiumData = $this->request->getPost('premium');
+ for ($i = 0; $i < count($premiumData); $i++) {
+
+ $data = [
+ 'client_id' => $client_id,
+ 'client_policy_id' => $client_policy_id,
+ 'policy_grid_id' => $policy_grid_id,
+ 'created_by' => get_session_userid(),
+
+ ];
+
+ if(is_array($this->request->getPost('si'))){
+ $si = isset($this->request->getPost('si')[$i]) ? $this->request->getPost('si')[$i] : null;
+ }else{
+ $si = $this->request->getPost('si');
+ }
+ $age_from = isset($this->request->getPost('age_from')[$i]) ? $this->request->getPost('age_from')[$i] : null;
+ $age_to = isset($this->request->getPost('age_to')[$i]) ? $this->request->getPost('age_to')[$i] : null;
+ $premium = isset($premiumData[$i]) ? $premiumData[$i] : null;
+ $grade = isset($this->request->getPost('grade')[$i]) ? $this->request->getPost('grade')[$i] : null;
+ $max_si = isset($this->request->getPost('max_si')[$i]) ? $this->request->getPost('max_si')[$i] : null;
+ $created_by = get_session_userid();
+
+ if ($si !== null) {
+ $data['si'] = $si;
+ }
+
+ if ($age_from !== null) {
+ $data['age_from'] = $age_from;
+ }
+
+ if ($age_to !== null) {
+ $data['age_to'] = $age_to;
+ }
+
+ if ($premium !== null) {
+ $data['premium'] = $premium;
+ }
+
+ if ($max_si !== null) {
+ $data['max_si'] = $max_si;
+ }
+
+ if ($grade !== null) {
+ $data['grade'] = $grade;
+ }
+
+ $this->policyPremium2Model->insert($data);
+ }
+ $data = $this->request->getPost();
+ $insert = true;
+ }
+
+ if($insert){
+ echo json_encode(array("status" => true , 'data' => $data));
+ }else{
+ echo json_encode(array("status" => false , 'data' => $data));
+ }
+
+ }
+
+
+
+
+
+
public function getKycDocsById($id=null)
{
@@ -493,4 +637,36 @@ class ClientController extends AdminController
}
+ public function getpolicyGridData()
+ {
+
+ $policy_id = $this->request->getGet('policy_id');
+ $client_id = $this->request->getGet('client_id');
+
+ $data = $this->policesModel->getPolicyPremium($policy_id);
+ $pattern = '/gmc/i';
+ $subject = $data[0]->policy_type;
+ if (preg_match($pattern, $subject)) {
+ $search_term = 'GMC';
+ } else {
+ $search_term = 'GPA';
+ }
+ $results = $this->policyGridModel->like('policy_type', $search_term)->findAll();
+
+ if($search_term === 'GPA'){
+
+ $premiumData = $this->policyPremium1Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
+ }else{
+ $premiumData = $this->policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
+
+ }
+
+
+ // echo '';
+ // print_r($results);
+ // print_r($data[0]->policy_type); die;
+ echo json_encode(array("status" => true , 'data' => $results, 'premiumData' => $premiumData));
+
+ }
+
}
\ No newline at end of file
diff --git a/app/Controllers/MasterController.php b/app/Controllers/MasterController.php
new file mode 100644
index 00000000..f0d5cc4b
--- /dev/null
+++ b/app/Controllers/MasterController.php
@@ -0,0 +1,877 @@
+myLogger = \Config\Services::mylogger();
+
+ $this->insurerModel = new ClientModel();
+ $this->userModel = new UserModel();
+ // $this->insurerBranchModel = new ClientBranchModel();
+ $this->insurerKYCDocsModel = new ClientKYCDocsModel();
+ $this->insurerPolicyModel = new ClientPolicyModel();
+ $this->insurerRMModel = new ClientRMModel();
+ $this->insurerBranchModel = new InsurerBranchModel();
+ $this->insurerModel = new InsurerModel();
+ $this->kycDocsModel = new KYCDocsModel();
+ $this->kycEntityTypeModel = new KYCEntityTypeModel();
+ $this->levelContactModel = new LevelContactModel();
+ $this->policesModel = new PolicesModel();
+ $this->tpaBranchModel = new TPABranchModel();
+ $this->tpaModel = new TPAModel();
+ $this->stateModel = new StateModel();
+ $this->policyTypeModel = new PolicyTypeModel();
+ }
+
+ public function insurerList()
+ {
+ $this->myLogger->logme('error','Insurer list function called');
+ $headerData['page_name'] = 'Insurer List';
+ $data['insurerList'] = $this->insurerModel->findAll();
+ $data['insurer_rm'] = $this->insurerRMModel->getAllClientRM();
+ // echo '';
+ // print_r($data['insurerList']); die;
+
+ echo view('layout/header', $headerData);
+ echo view('insurer_list', $data);
+ echo view('layout/footer');
+
+ // $this->loadLayout('insurer_onboarding', $data);
+ }
+
+
+ public function editInsurerOnboarding($id = null)
+ {
+
+ $this->myLogger->logme('error','Edit Insurer Onboarding function called');
+ $headerData['page_name'] = 'Edit Insurer Onboarding';
+
+ $types = array(
+ (object) array('id' => 'pvt', 'name' => 'PVT'),
+ (object) array('id' => 'psu', 'name' => 'PSU')
+ );
+
+ $editData['types'] = $types;
+ $editData['RM'] = $this->userModel->findAll();
+ $editData['tpa'] = $this->tpaBranchModel ->getTpaBranchesWithTpaNames();
+ $editData['state'] = $this->stateModel->getAllStates();
+ $editData['insurer'] = $this->insurerBranchModel ->getInsurerBranchesWithInsurerNames();
+
+
+ $editData['insurer'] = $this->insurerModel->where(['id' => $id, 'is_active' => 1])->first();
+ $editData['insuer_branch'] = $this->insurerBranchModel->where(['insurer_id' => $id, 'is_active' => 1])->findAll();
+
+
+ // echo "";
+ // print_r($editData); die;
+
+ echo view('layout/header', $headerData);
+ echo view('insurer_onboarding', $editData);
+ echo view('layout/footer');
+
+ }
+
+
+ public function insurerOnboarding()
+ {
+
+ $this->myLogger->logme('error','Insurer Onboarding function called');
+ $headerData['page_name'] = 'Insurer Onboarding';
+
+ $types = array(
+ (object) array('id' => 'pvt', 'name' => 'PVT'),
+ (object) array('id' => 'psu', 'name' => 'PSU')
+ );
+
+ $data['types'] = $types;
+ // print_r($data['types']);die();
+ $data['entity'] = $this->kycEntityTypeModel->findAll();
+ $data['kyc_docs'] = $this->kycDocsModel->findAll();
+ $data['police'] = $this->policesModel->findAll();
+ $data['insurer'] = $this->insurerBranchModel ->getInsurerBranchesWithInsurerNames();
+ $data['tpa'] = $this->tpaBranchModel ->getTpaBranchesWithTpaNames();
+ $data['state'] = $this->stateModel->getAllStates();
+ $data['RM'] = $this->userModel->findAll();
+
+ // echo "";
+ // print_r($data); die;
+
+ echo view('layout/header', $headerData);
+ echo view('insurer_onboarding', $data);
+ echo view('layout/footer');
+
+ }
+
+
+ public function createInsurerGeneralInfo()
+ {
+
+ $this->myLogger->logme('error','Insurer general info function called');
+ $data = $this->request->getPost();
+ $data['created_by'] = get_session_userid();
+
+ $insert = $this->insurerModel->insert($data);
+ if($insert){
+ $insurer_data = $this->insurerModel->where(['id' => $insert, 'is_active' => 1])->first();
+ echo json_encode(array("status" => true , 'data' => $insurer_data));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+ public function createInsurerBranch()
+ {
+
+ $this->myLogger->logme('error','Client branch CREATE function called');
+ $data = $this->request->getPost();
+ $data['created_by'] = get_session_userid();
+ $insert = $this->insurerBranchModel->insert($data);
+
+ if($insert){
+ for ($i = 0; $i < count($this->request->getPost('name')); $i++) {
+ // Prepare data to insert
+ $data = [
+ 'contact_type' => 'insurer',
+ 'ref_id' => $insert,
+ 'created_by' => get_session_userid(),
+ 'name' => $this->request->getPost('name')[$i],
+ 'email' => $this->request->getPost('email')[$i],
+ 'mobile' => $this->request->getPost('mobile')[$i],
+ 'designation' => $this->request->getPost('designation')[$i]
+ ];
+ $contacts = $this->levelContactModel->insert($data);
+ }
+ }
+
+ if($insert){
+ $branchData = $this->insurerBranchModel->where('insurer_id', $this->request->getPost('insurer_id'))->findAll();
+ echo json_encode(array("status" => true , 'data' => $branchData));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+ public function insurerBranchList($id = null)
+ {
+ $this->myLogger->logme('error','Edit Insurer Onboarding function called');
+
+ $editData['insuer_branch'] = $this->insurerBranchModel->where(['insurer_id' => $id, 'is_active' => 1])->findAll();
+
+ // Return JSON response
+ header('Content-Type: application/json');
+ echo json_encode($editData);
+ exit();
+ }
+
+
+
+
+ public function editInsurerGeneralInfo()
+ {
+ $this->myLogger->logme('error','edit Insurer general info function called');
+ $id = $this->request->getPost('PrimaryKey');
+ $data = $this->request->getPost();
+ $data['updated_by'] = get_session_userid();
+ $update = $this->insurerModel->update($id,$data);
+ if($update){
+ echo json_encode(array("status" => true , 'data' => $data));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+
+
+
+
+
+
+ public function editInsurerGet($id = null)
+ {
+ $this->myLogger->logme('error','Edit TPA Onboarding function called');
+
+
+ $editData['insurerbranch'] = $this->insurerBranchModel->where(['id' => $id, 'is_active' => 1])->first();
+ $editData['levelcontact'] = $this->levelContactModel->where(['ref_id' => $id, 'contact_type' => 'insurer' , 'is_active' => 1])->findAll();
+ // print_r($editData['tpa']);
+ // Return JSON response
+ header('Content-Type: application/json');
+ echo json_encode($editData);
+ exit();
+ }
+
+
+
+
+
+ public function editInsurerBranch()
+ {
+ $this->myLogger->logme('error','Insurer branch CREATE function called');
+ $id = $this->request->getPost('PrimaryKey');
+ $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) {
+ $this->levelContactModel->delete($contact->id);
+ }
+ for ($i = 0; $i < count($this->request->getPost('name')); $i++) {
+ // Prepare data to update
+ $data = [
+ 'contact_type' => 'insurer',
+ 'ref_id' => $id,
+ 'created_by' => get_session_userid(),
+ 'name' => $this->request->getPost('name')[$i],
+ 'email' => $this->request->getPost('email')[$i],
+ 'mobile' => $this->request->getPost('mobile')[$i],
+ 'designation' => $this->request->getPost('designation')[$i]
+ ];
+ $contacts = $this->levelContactModel->insert($data);
+ }
+ }
+
+ if($update){
+ $branchData = $this->tpaBranchModel->where('tpa_id', $this->request->getPost('tpa_id'))->findAll();
+ echo json_encode(array("status" => true , 'data' => $branchData));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+
+// Insurer Ends
+
+
+
+
+// TPA Start
+
+
+ public function tpaList()
+ {
+ $this->myLogger->logme('error','TPA list function called');
+ $headerData['page_name'] = 'TPA List';
+ $data['tpaList'] = $this->tpaModel->findAll();
+ // $data['insurer_rm'] = $this->insurerRMModel->getAllClientRM();
+ // echo '';
+ // print_r($data['insurerList']); die;
+
+ echo view('layout/header', $headerData);
+ echo view('tpa_list', $data);
+ echo view('layout/footer');
+
+ // $this->loadLayout('insurer_onboarding', $data);
+ }
+
+
+
+
+ public function tpaOnboarding()
+ {
+
+ $this->myLogger->logme('error','TPA Onboarding function called');
+ $headerData['page_name'] = 'TPA Onboarding';
+
+
+ // print_r($data['types']);die();
+ $data['entity'] = $this->kycEntityTypeModel->findAll();
+ $data['kyc_docs'] = $this->kycDocsModel->findAll();
+ $data['police'] = $this->policesModel->findAll();
+ $data['insurer'] = $this->insurerBranchModel ->getInsurerBranchesWithInsurerNames();
+ $data['tpa'] = $this->tpaBranchModel ->getTpaBranchesWithTpaNames();
+ $data['state'] = $this->stateModel->getAllStates();
+ $data['RM'] = $this->userModel->findAll();
+
+ // echo "";
+ // print_r($data); die;
+
+ echo view('layout/header', $headerData);
+ echo view('tpa_onboarding', $data);
+ echo view('layout/footer');
+
+ }
+
+
+
+ public function createTPAGeneralInfo()
+ {
+
+ $this->myLogger->logme('error','TPA general info function called');
+ $data = $this->request->getPost();
+ $data['created_by'] = get_session_userid();
+
+ $insert = $this->tpaModel->insert($data);
+ if($insert){
+ $tpa_data = $this->tpaModel->where(['id' => $insert, 'is_active' => 1])->first();
+ echo json_encode(array("status" => true , 'data' => $tpa_data));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+
+
+
+
+
+ public function createTPABranch()
+ {
+
+ $this->myLogger->logme('error','TPA branch CREATE function called');
+ $data = $this->request->getPost();
+ $data['created_by'] = get_session_userid();
+ $insert = $this->tpaBranchModel->insert($data);
+
+ if($insert){
+ for ($i = 0; $i < count($this->request->getPost('name')); $i++) {
+ // Prepare data to insert
+ $data = [
+ 'contact_type' => 'tpa',
+ 'ref_id' => $insert,
+ 'created_by' => get_session_userid(),
+ 'name' => $this->request->getPost('name')[$i],
+ 'email' => $this->request->getPost('email')[$i],
+ 'mobile' => $this->request->getPost('mobile')[$i],
+ 'designation' => $this->request->getPost('designation')[$i]
+ ];
+ $contacts = $this->levelContactModel->insert($data);
+ }
+ }
+
+ if($insert){
+ $branchData = $this->tpaBranchModel->where('tpa_id', $this->request->getPost('tpa_id'))->findAll();
+ echo json_encode(array("status" => true , 'data' => $branchData));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+
+ public function editTPAOnboarding($id = null)
+ {
+
+ $this->myLogger->logme('error','Edit TPA Onboarding function called');
+ $headerData['page_name'] = 'Edit TPA Onboarding';
+
+ $editData['tpa'] = $this->tpaModel->where(['id' => $id, 'is_active' => 1])->first();
+ $editData['tpa_branch'] = $this->tpaBranchModel->where(['tpa_id' => $id, 'is_active' => 1])->findAll();
+ $editData['state'] = $this->stateModel->getAllStates();
+
+
+ // echo "";
+ // print_r($editData); die;
+
+ echo view('layout/header', $headerData);
+ echo view('tpa_onboarding', $editData);
+ echo view('layout/footer');
+
+ }
+
+
+
+
+ public function editTPAGeneralInfo()
+ {
+ $this->myLogger->logme('error','edit TPA general info function called');
+ $id = $this->request->getPost('PrimaryKey');
+ $data = $this->request->getPost();
+ $data['updated_by'] = get_session_userid();
+ $update = $this->tpaModel->update($id,$data);
+ if($update){
+ echo json_encode(array("status" => true , 'data' => $data));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+ public function editTPAGet($id = null)
+ {
+ $this->myLogger->logme('error','Edit TPA Onboarding function called');
+
+
+ $editData['tpabranch'] = $this->tpaBranchModel->where(['id' => $id, 'is_active' => 1])->first();
+ $editData['levelcontact'] = $this->levelContactModel->where(['ref_id' => $id, 'contact_type' => 'tpa' , 'is_active' => 1])->findAll();
+ // print_r($editData['tpa']);
+ // Return JSON response
+ header('Content-Type: application/json');
+ echo json_encode($editData);
+ exit();
+ }
+
+
+
+
+
+ public function editTPABranch()
+ {
+ $this->myLogger->logme('error','TPA branch CREATE function called');
+ $id = $this->request->getPost('PrimaryKey');
+ $data = $this->request->getPost();
+ $update = $this->tpaBranchModel->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' => 'tpa', 'is_active' => 1])->get()->getResult();
+ foreach ($contactsToDelete as $contact) {
+ $this->levelContactModel->delete($contact->id);
+ }
+ for ($i = 0; $i < count($this->request->getPost('name')); $i++) {
+ // Prepare data to update
+ $data = [
+ 'contact_type' => 'tpa',
+ 'ref_id' => $id,
+ 'created_by' => get_session_userid(),
+ 'name' => $this->request->getPost('name')[$i],
+ 'email' => $this->request->getPost('email')[$i],
+ 'mobile' => $this->request->getPost('mobile')[$i],
+ 'designation' => $this->request->getPost('designation')[$i]
+ ];
+ $contacts = $this->levelContactModel->insert($data);
+ }
+ }
+
+ if($update){
+ $branchData = $this->tpaBranchModel->where('tpa_id', $this->request->getPost('tpa_id'))->findAll();
+ echo json_encode(array("status" => true , 'data' => $branchData));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+
+
+ public function tpaBranchList($id = null)
+ {
+ $this->myLogger->logme('error','TPA List function called');
+
+ $editData['tpa_branch'] = $this->tpaBranchModel->where(['tpa_id' => $id, 'is_active' => 1])->findAll();
+
+ // Return JSON response
+ header('Content-Type: application/json');
+ echo json_encode($editData);
+ exit();
+ }
+
+
+
+
+ //Ends TPA Models
+
+ //Start KYC
+
+
+ public function kycList()
+ {
+ $this->myLogger->logme('error','KYC list function called');
+ $headerData['page_name'] = 'KYC List';
+ $data['kycList'] = $this->kycEntityTypeModel->findAll();
+ // $data['insurer_rm'] = $this->insurerRMModel->getAllClientRM();
+ // echo '';
+ // print_r($data['insurerList']); die;
+
+ echo view('layout/header', $headerData);
+ echo view('kyc_list', $data);
+ echo view('layout/footer');
+
+ // $this->loadLayout('insurer_onboarding', $data);
+ }
+
+
+
+
+ public function kycOnboarding()
+ {
+
+ $this->myLogger->logme('error','KYC Onboarding function called');
+ $headerData['page_name'] = 'KYC Onboarding';
+
+
+ // print_r($data['types']);die();
+ $data['entity'] = $this->kycEntityTypeModel->findAll();
+ $data['kyc_docs'] = $this->kycDocsModel->findAll();
+ $data['police'] = $this->policesModel->findAll();
+ $data['insurer'] = $this->insurerBranchModel ->getInsurerBranchesWithInsurerNames();
+ $data['tpa'] = $this->tpaBranchModel ->getTpaBranchesWithTpaNames();
+ $data['state'] = $this->stateModel->getAllStates();
+ $data['RM'] = $this->userModel->findAll();
+
+ // echo "";
+ // print_r($data); die;
+
+ echo view('layout/header', $headerData);
+ echo view('kyc_onboarding', $data);
+ echo view('layout/footer');
+
+ }
+
+
+
+
+ public function createKYCInfo()
+ {
+
+ $this->myLogger->logme('error','KYC Entity Type general info function called');
+ $data = $this->request->getPost();
+ $data['created_by'] = get_session_userid();
+
+ $insert = $this->kycEntityTypeModel->insert($data);
+ if($insert){
+ $kyc_data = $this->kycEntityTypeModel->where(['id' => $insert, 'is_active' => 1])->first();
+ echo json_encode(array("status" => true , 'data' => $kyc_data));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+
+
+ public function createKycDocs()
+ {
+
+ $this->myLogger->logme('error','Kyc Docs CREATE function called');
+ $data = $this->request->getPost();
+ $data['created_by'] = get_session_userid();
+ $insert = $this->kycDocsModel->insert($data);
+
+ if($insert){
+ $kycDocsData = $this->kycDocsModel->where('kyc_type_id', $this->request->getPost('kyc_type_id'))->findAll();
+ echo json_encode(array("status" => true , 'data' => $kycDocsData));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+ public function editKYCOnboarding($id = null)
+ {
+
+ $this->myLogger->logme('error','Edit KYC Onboarding function called');
+ $headerData['page_name'] = 'Edit KYC Onboarding';
+
+ $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();
+
+
+ // echo "";
+ // print_r($editData); die;
+
+ echo view('layout/header', $headerData);
+ echo view('kyc_onboarding', $editData);
+ echo view('layout/footer');
+
+ }
+
+
+
+
+ public function kycDocsList($id = null)
+ {
+ $this->myLogger->logme('error','Edit KYC Docs Onboarding function called');
+
+ $editData['kyc_docs'] = $this->kycDocsModel->where(['kyc_type_id' => $id, 'is_active' => 1])->findAll();
+
+ // Return JSON response
+ header('Content-Type: application/json');
+ echo json_encode($editData);
+ exit();
+ }
+
+
+
+ public function editKYCInfo()
+ {
+ $this->myLogger->logme('error','edit KYC general info function called');
+ $id = $this->request->getPost('PrimaryKey');
+ $data = $this->request->getPost();
+ $data['updated_by'] = get_session_userid();
+ $update = $this->kycEntityTypeModel->update($id,$data);
+ if($update){
+ echo json_encode(array("status" => true , 'data' => $data));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+ public function editKYCGet($id = null)
+ {
+ $this->myLogger->logme('error','Edit KYC Onboarding function called');
+
+ $editData['policies'] = $this->kycDocsModel->where(['id' => $id, 'is_active' => 1])->first();
+
+ // Return JSON response
+ header('Content-Type: application/json');
+ echo json_encode($editData);
+ exit();
+ }
+
+
+
+ public function editKYCDocs()
+ {
+ $this->myLogger->logme('error','edit KYC Docs function called');
+ $id = $this->request->getPost('PrimaryKey');
+ $data['file_name'] = $this->request->getPost('file_name');
+ $data['updated_by'] = get_session_userid();
+ $update = $this->kycDocsModel->update($id,$data);
+ if($update){
+ echo json_encode(array("status" => true , 'data' => $data));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+
+
+
+ //Ends KYC
+
+ //Start Policy
+
+
+ public function policyTypeList()
+ {
+ $this->myLogger->logme('error','Policy Type list function called');
+ $headerData['page_name'] = 'Policy Type List';
+ $data['policyList'] = $this->policyTypeModel->findAll();
+ // $data['insurer_rm'] = $this->insurerRMModel->getAllClientRM();
+ // echo '';
+ // print_r($data['insurerList']); die;
+
+ echo view('layout/header', $headerData);
+ echo view('policy_type_list', $data);
+ echo view('layout/footer');
+
+ // $this->loadLayout('insurer_onboarding', $data);
+ }
+
+
+
+ public function policyTypeOnboarding()
+ {
+
+ $this->myLogger->logme('error','Policy Type Onboarding function called');
+ $headerData['page_name'] = 'Policy Type Onboarding';
+
+
+ // print_r($data['types']);die();
+ $data['entity'] = $this->kycEntityTypeModel->findAll();
+ $data['kyc_docs'] = $this->kycDocsModel->findAll();
+ $data['police'] = $this->policesModel->findAll();
+ // $data['insurer'] = $this->insurerBranchModel ->getInsurerBranchesWithInsurerNames();
+ $data['tpa'] = $this->tpaBranchModel ->getTpaBranchesWithTpaNames();
+ $data['state'] = $this->stateModel->getAllStates();
+ $data['RM'] = $this->userModel->findAll();
+ $data['policy_type'] = $this->policyTypeModel->findAll();
+ $data['insurer'] = $this->insurerModel ->findAll();
+ // echo "";
+
+ echo view('layout/header', $headerData);
+ echo view('policy_type_onboarding', $data);
+ echo view('layout/footer');
+
+ }
+
+
+
+
+ public function createPolicies()
+ {
+ $this->myLogger->logme('error','Policies CREATE function called');
+ $data = $this->request->getPost();
+ // print_r($data);
+ // die();
+ $data['created_by'] = get_session_userid();
+ $insert = $this->policesModel->insert($data);
+ if($insert){
+ $policiesData = $this->policesModel->where('policy_type_id', $this->request->getPost('policy_type_id'))->findAll();
+ echo json_encode(array("status" => true , 'data' => $policiesData));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+
+
+ public function createPolicyType()
+ {
+ $this->myLogger->logme('error','Policy Type CREATE function called');
+ $data = $this->request->getPost();
+
+ $data['created_by'] = get_session_userid();
+ $insert = $this->policyTypeModel->insert($data);
+
+ if($insert){
+ $policyTypeData = $this->policyTypeModel->where('id', $insert)->first();
+ echo json_encode(array("status" => true , 'data' => $policyTypeData));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+
+
+ public function editPolicyTypeOnboarding($id = null)
+ {
+
+ $this->myLogger->logme('error','Edit KYC Onboarding function called');
+ $headerData['page_name'] = 'Edit KYC Onboarding';
+
+ $editData['policytype'] = $this->policyTypeModel->where(['id' => $id, 'is_active' => 1])->first();
+ $editData['policies'] = $this->policesModel->where(['policy_type_id' => $id, 'is_active' => 1])->findAll();
+ $editData['insurer'] = $this->insurerModel-> findAll();
+ echo view('layout/header', $headerData);
+ echo view('policy_type_onboarding', $editData);
+ echo view('layout/footer');
+
+ }
+
+
+
+
+
+ public function editPolicyType()
+ {
+ $this->myLogger->logme('error','edit Policy general info function called');
+ $id = $this->request->getPost('PrimaryKey');
+ $data = $this->request->getPost();
+ $data['updated_by'] = get_session_userid();
+ $update = $this->policyTypeModel->update($id,$data);
+ if($update){
+ echo json_encode(array("status" => true , 'data' => $data));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+
+
+
+
+ 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) {
+ // Retrieve the insurer information
+ $insurer = $this->insurerModel->find($policy['insurer_id']);
+
+ // Add the insurer information to the editData array
+ if ($insurer) {
+ $editData['policies'][$policy['id']] = [
+ 'policy' => $policy,
+ 'insurer' => $insurer
+ ];
+ }
+ }
+
+
+ // Return JSON response
+ header('Content-Type: application/json');
+ echo json_encode($editData);
+ exit();
+ }
+
+
+
+ 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);
+ exit();
+ }
+
+
+
+
+ public function editPolicies()
+ {
+ $this->myLogger->logme('error','edit Policy general info function called');
+ $id = $this->request->getPost('PrimaryKey');
+ $data = $this->request->getPost();
+ $data['updated_by'] = get_session_userid();
+ $update = $this->policesModel->update($id,$data);
+ if($update){
+ echo json_encode(array("status" => true , 'data' => $data));
+ }else{
+ echo json_encode(array("status" => false));
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/app/Models/ClientKYCDocsModel.php b/app/Models/ClientKYCDocsModel.php
index 9a3f28b5..6c9f3c8a 100644
--- a/app/Models/ClientKYCDocsModel.php
+++ b/app/Models/ClientKYCDocsModel.php
@@ -13,6 +13,7 @@ class ClientKYCDocsModel extends Model
'client_id',
'kyc_doc_type_id',
'file_name',
+ 'other_docs_name',
'is_active',
"created_by",
"updated_by",
diff --git a/app/Models/ClientPolicyModel.php b/app/Models/ClientPolicyModel.php
index 5ef5e39d..2d1eff5d 100644
--- a/app/Models/ClientPolicyModel.php
+++ b/app/Models/ClientPolicyModel.php
@@ -16,6 +16,23 @@ class ClientPolicyModel extends Model
"insurer_branch_id",
"tpa_id",
"tpa_branch_id",
+
+ "policy_start_date",
+ "policy_end_date",
+
+ "insured",
+ "no_of_employees",
+ "no_of_lives",
+ "no_lives_at_inception",
+ "premium_paid_at_inception",
+ "earned_premium_date",
+ "claims_incurred_date",
+ "incurred_claims_ratio",
+ "claims_experience_for_last_3_years",
+ "policy_status",
+ "earned_premium_amount",
+ "claims_incurred_amount",
+
"created_by",
"updated_by",
"Is_active",
@@ -59,4 +76,24 @@ class ClientPolicyModel extends Model
->getResult();
}
+
+ public function getPolicyPremium($policy_id){
+
+ return $this->db->table('policies')
+ ->select('policy_type.*')
+ ->join('policy_type', 'policy_type.id = policies.policy_type_id')
+ ->where('policies.id', $policy_id)
+ ->get()
+ ->getResult();
+ }
+
+ public function getPolicyPremiumPolicyTypeId($policy_type_id){
+
+ return $this->db->table('policies')
+ ->select('policy_type.*')
+ ->join('policy_type', 'policy_type.id = policies.policy_type_id')
+ ->where('policies.id', $policy_type_id)
+ ->get()
+ ->getResult();
+ }
}
diff --git a/app/Models/InsurerModel.php b/app/Models/InsurerModel.php
index b2ffe3f5..6e6b7a1f 100644
--- a/app/Models/InsurerModel.php
+++ b/app/Models/InsurerModel.php
@@ -10,10 +10,24 @@ class InsurerModel extends Model
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
+ "type",
"name",
- "tpa_id",
+ "short_name",
"created_by",
"updated_by",
"is_active",
];
+
+
+
+ public function getCreatedByUserName(){
+
+ return $this->db->table('insurers')
+ ->select('insurers.*')
+ // ->select('user_profiles.first_name as user_name')
+ // ->join('user_profiles', 'user_profiles.id = clients.created_by')
+ ->get()
+ ->getResult();
+
+ }
}
diff --git a/app/Models/PolicesModel.php b/app/Models/PolicesModel.php
index b642590c..c9dc0015 100644
--- a/app/Models/PolicesModel.php
+++ b/app/Models/PolicesModel.php
@@ -11,9 +11,20 @@ class PolicesModel extends Model
protected $allowedFields = [
"id",
"insurer_id",
+ "policy_type_id",
"name",
"created_by",
"updated_by",
"is_active",
];
+
+ public function getPolicyPremium($policy_id){
+
+ return $this->db->table('policies')
+ ->select('policy_type.*')
+ ->join('policy_type', 'policy_type.id = policies.policy_type_id')
+ ->where('policies.id', $policy_id)
+ ->get()
+ ->getResult();
+ }
}
diff --git a/app/Models/PolicyGridModel.php b/app/Models/PolicyGridModel.php
new file mode 100644
index 00000000..6a3d35eb
--- /dev/null
+++ b/app/Models/PolicyGridModel.php
@@ -0,0 +1,22 @@
+
-
+
@@ -120,7 +120,7 @@ body {
-
+
@@ -128,7 +128,7 @@ body {
-
+
@@ -159,7 +159,7 @@ body {
-
+
@@ -196,7 +196,6 @@ $(document).ready(function () {
});
-
$('#team').multiselect({
nonSelectedText: 'Select Team',
enableFiltering: false,
@@ -205,6 +204,7 @@ $(document).ready(function () {
buttonWidth:'100%'
});
+
$('#btnAdd').click(function(){
$('#first_name').val('');
$('#last_name').val('');
@@ -224,6 +224,7 @@ $(document).ready(function () {
$('#role').val('')
})
+
$('body').on('click', '.btnEdit', function () {
var user_id = $(this).attr('data-id');
$.ajax({
@@ -232,6 +233,7 @@ $(document).ready(function () {
dataType: 'json',
success: function (res) {
console.log(res)
+ $('#updateModal').modal('show');
$('#role').val('')
$('#UserForm').attr('action', '');
$('#UserId').val(res.data.id);
@@ -256,6 +258,7 @@ $(document).ready(function () {
});
});
+
$('body').on('click', '.btnDelete', function () {
Swal.fire({
@@ -279,68 +282,14 @@ $(document).ready(function () {
});
});
-});
-
-
-const btnExport = document.querySelector("#btnExport");
-const tableElement = document.querySelector("#tickets-table");
-
-btnExport.addEventListener("click", () => {
- const obj = new csvExport(tableElement);
- const csvData = obj.exportCsv();
- const blob = new Blob([csvData], { type: "text/csv" });
- const url = URL.createObjectURL(blob);
- const a = document.createElement("a");
- a.href = url;
- a.download = "UserList.csv";
- a.click();
-
- setTimeout(() => {
- URL.revokeObjectURL(url);
- }, 500);
});
-class csvExport {
- constructor(table, header = true) {
- this.table = table;
- this.rows = Array.from(table.querySelectorAll("tr"));
- if (!header && this.rows[0].querySelectorAll("th").length) {
- this.rows.shift();
- }
- }
-
- exportCsv() {
- const lines = [];
- const ncols = this._longestRow();
- for (const row of this.rows) {
- let line = "";
- for (let i = 0; i < ncols - 1; i++) { // Adjusted loop to exclude the last column
- if (row.children[i] !== undefined) {
- line += csvExport.safeData(row.children[i]);
- line += ",";
- }
- }
- // Remove the trailing comma
- line = line.slice(0, -1);
- lines.push(line);
- }
- return lines.join("\n");
- }
-
- _longestRow() {
- return this.rows.reduce((length, row) => (row.childElementCount > length ? row.childElementCount : length), 0);
- }
-
- static safeData(td) {
- let data = td.textContent;
- //Replace all double quote to two double quotes
- data = data.replace(/"/g, `""`);
- //Replace , and \n to double quotes
- data = /[",\n"]/.test(data) ? `"${data}"` : data;
- return data;
- }
+function onlyNumbers(event){
+ var charcode;
+ charcode = event.which || event.keyCode;
+ if(charcode>= 48 && charcode <= 57)return true;
+ return false;
}
-
diff --git a/app/Views/client_basic_info.php b/app/Views/client_basic_info.php
index 35e981dd..9df58db2 100644
--- a/app/Views/client_basic_info.php
+++ b/app/Views/client_basic_info.php
@@ -44,12 +44,12 @@
+ placeholder="Enter PAN Number" value="= isset($client['pan']) ? $client['pan'] : '' ?>" name="pan" data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$" required>
+ placeholder="Enter GST Number" value="= isset($client['gst']) ? $client['gst'] : '' ?>" name="gst" data-parsley-trigger="change" data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required>
@@ -99,7 +99,7 @@
+ placeholder="Enter Pincode" onkeypress = "return onlyNumbers(event)" value="= isset($client['pincode']) ? $client['pincode'] : '' ?>" name="pincode" maxlength="6" required>
@@ -119,107 +119,100 @@
\ No newline at end of file
diff --git a/app/Views/client_branch.php b/app/Views/client_branch.php
index 5f9c6d44..23dc8c51 100644
--- a/app/Views/client_branch.php
+++ b/app/Views/client_branch.php
@@ -1,9 +1,7 @@
-
-
-
-
+
+
@@ -24,10 +22,8 @@
-
-
-
-
+
+
@@ -40,10 +36,8 @@
-
-
+
+
- Mobile*
-
+ Mobile*
+
- Designation*
-
+ Designation*
+
+
+
+
+
-
- Contact 2
-
-
-
-
- Name*
-
-
-
- Email
-
-
-
-
-
- Mobile
-
-
-
- Designation
-
-
-
-
-
- Contact 3
-
-
-
-
- Name
-
-
-
- Email
-
-
-
-
-
- Mobile
-
-
-
- Designation
-
-
-
+
@@ -185,15 +118,36 @@
\ No newline at end of file
diff --git a/app/Views/client_kyc.php b/app/Views/client_kyc.php
index af58cf7e..154e5d06 100644
--- a/app/Views/client_kyc.php
+++ b/app/Views/client_kyc.php
@@ -1,27 +1,57 @@
+
+
-
+
+
+
+
+
+
+
+
+ Document Name
+ Status
+ Action
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php
index cec7c530..01c386c9 100644
--- a/app/Views/client_policy.php
+++ b/app/Views/client_policy.php
@@ -1,11 +1,10 @@
+
-
-
-
-
+
+
@@ -28,10 +27,8 @@
-
-
-
-
+
+
@@ -41,13 +38,15 @@
-
+
+
+
Insurer*
-
+
+
+
+ Policy Start Date*
+
+
+
+ Policy End Date*
+
+
+
+
+
+
+
+