diff --git a/app/Config/Filters.php b/app/Config/Filters.php index 1fba3353..7add9fb4 100644 --- a/app/Config/Filters.php +++ b/app/Config/Filters.php @@ -41,8 +41,8 @@ class Filters extends BaseConfig */ public array $globals = [ 'before' => [ - 'HttpRequestLog', - 'csrf', + 'HttpRequestLog' => ['except' => 'processjob'], + // 'csrf', // 'invalidchars', ], 'after' => [ diff --git a/app/Config/Routes.php b/app/Config/Routes.php index b51b653c..0432432b 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"); @@ -66,9 +67,94 @@ $routes->group("/client", ["filter" => "authMVC"], function($routes){ }); }); + +$routes->group("/employee", ["filter" => "authMVC"], function($routes){ + $routes->get("list", "EmployeeController::list"); + $routes->get("search", "EmployeeController::search"); + $routes->get("bulk-event-uplod", "EmployeeController::employeesUplodWithEvents"); + $routes->post("bulk-event-uplod", "EmployeeController::employeesUplodWithEvents"); +}); + + +$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("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/BaseController.php b/app/Controllers/BaseController.php index f8e87392..4f0ae0e1 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -59,7 +59,7 @@ abstract class BaseController extends Controller } - public function loadLayout($view_name,$data) + public function loadLayout($view_name,$data = []) { echo view('layout/header',$data); echo view($view_name, $data); diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php new file mode 100644 index 00000000..c2b0d73e --- /dev/null +++ b/app/Controllers/EmployeeController.php @@ -0,0 +1,140 @@ +myLogger = \Config\Services::mylogger(); + $this->employeeModel = new EmployeeModel(); + $this->employeePolicyModel = new EmployeePolicyModel(); + $this->clientModel = new ClientModel(); + $this->fileModel = new FileModel(); + } + + public function list() + { + // $model = new UserModel(); + $data = []; + if(count($this->request->getGet())) + { + $filterData = $this->request->getGet(); + $data['employees'] = $this->employeePolicyModel->getEmployeePolicy(client_id: $filterData['client_id'],policy_id: $filterData['policy_id']); + } + + $this->myLogger->logme('error','list called'); + $this->loadLayout('employee_list',$data); + } + + public function getClientWithPolicies() + { + //echo $this->request->isAJAX();die(); + $result = $this->clientModel->clientsWithPolicies(); + // print_r($result);die(); + if(!count($result)) + { + return $this->respond(['dataStatus' => false,'code' => 404,'message' => 'no data found'], 200); + } + else + { + + return $this->respond(['dataStatus' => true,'code' => 200,'data' => $result], 200); + } + } + + //handles employee & dependent bulk upload with events like inception,addition,deletion, correction and SI enhancements + public function employeesUplodWithEvents() + { + + // $job_details = new Jobs(); + // $r = Jobs::addJob(['job_name' => 'add','payload' => ['a' => 10, 'b' => 35]]); + // print_r($r);//die(); + // // $jobWorker = new JobWorker(); + // JobWorker::processJob($r); + // die(); + // echo $this->request->getMethod();die(); + // print_r($this->request->getFiles('emplist'));print_r($this->request->getPost('emplist')); + // print_r($this->request->getPost('clients')); + // print_r($this->request->getPost('policies')); + // print_r($this->request->getPost('upload-action-type')); + // die(); + if($this->request->getMethod() == 'post') + { + $filename = ''; + $validated = $this->validate([ + 'emplist' => [ + 'uploaded[emplist]', + 'mime_in[emplist,application/vnd.ms-excel,application/vnd,application/pdf]', + 'max_size[emplist,8192]', + ], + ]); + + if ($validated) { + $avatar = $this->request->getFile('emplist'); + $is_moved = $avatar->move(WRITEPATH . 'uploads/excel/'); + $filename = $avatar->getName(); + + } + else + { + return $this->respond(['dataStatus' => false,'code' => 404,'message' => 'invalid file'], 200); + } + + //process post variable entry in file table + $loggedInUserID = get_session_userid(); + + $client_id = $this->request->getPost('client_id'); + $policy_id = $this->request->getPost('policy_id'); + $action = $this->request->getPost('upload-action-type'); + $status = 'inprogress'; + + $file_id = $this->fileModel->insert(['file_name' => $filename,'client_id' => $client_id,'policy_id' => $policy_id,'created_by' => $loggedInUserID,'status' => $status,'action' => $action]); + //die(); + $this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]); + return $this->respond(['dataStatus' => true,'code' => 200,'data' => 'file upload success'], 200); + + } + + $data['actions'] = ['inception' => 'Inception','addition' => 'Addition','deletion' => 'Deletion','si_enhancement' =>'SI Enhancement']; + $data['fileList'] = $this->fileModel + ->select(['files.*','up.emp_code','up.first_name']) + ->join('user_profiles up','files.created_by = up.id') + ->where('files.created_by',8)->orderBy('files.created_at','desc')->findAll(); + // print_r($data['fileList']);die(); + if($this->request->getMethod() == "get") + { + $this->loadLayout('employee_upload',$data); + } + + } + + + +} diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index 056d4170..9280fa95 100644 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -22,4 +22,10 @@ class Home extends PublicController return 'from test service'; } + public function addTwoNumbers($payload) + { + //echo $payload['a'] + $payload['b']; + return $payload['a'] + $payload['b']; + } + } diff --git a/app/Controllers/JobWorker.php b/app/Controllers/JobWorker.php new file mode 100644 index 00000000..98e851dc --- /dev/null +++ b/app/Controllers/JobWorker.php @@ -0,0 +1,154 @@ + ['type' => 'HC','handler' => 'App\\Helpers\\HttpRequestHelper'], 'sub' => ['type' => 'CC','handler' => 'App\\Controllers\\Jobs\SubJob'],'fancy_date_time_format' => [ 'type' => 'HF','handler' => 'fancy_date_time_format'],'addNumber' => ['type' => 'HC','handler' => 'App\\Model\\HttpRequestHelper']]; + public function __construct() + { + // echo 'HiC';//die(); + // parent::__construct(); + // $this->load->model('JobModel'); + // $this->dbm = $this->users_model; + // if (php_sapi_name() !== 'cli') + // { + // die('Invalid context'); + // } + } + + /** + * process jobs + */ + public static function processJob(array $jobdata = []) + { + // echo 'listen';//die(); + $query = " + SELECT id, name, payload, uuid + FROM jobs + WHERE status=? + ORDER BY created_dt ASC + LIMIT 1 FOR UPDATE"; + $where_condition = [self::STATUS_QUEUED]; + + if(isset($jobdata) && count($jobdata)) + { + $query = " + SELECT id, name, payload, uuid + FROM jobs + WHERE status=? AND id=? AND uuid=? + ORDER BY created_dt ASC + LIMIT 1 FOR UPDATE"; + $where_condition = [self::STATUS_QUEUED,$jobdata['id'],$jobdata['uuid']]; + } + + $db = \Config\Database::connect(); + $job = $db->query($query, $where_condition)->getResult(); + // print_r($job);die(); + if ($job !== []) + { + $job = $job[0]; + + echo "\nProcessing job id - " . $job->id . "\n"; + echo "Job name - " . $job->name . "\n"; + + try + { + $start = microtime(true); + $runtime = null; + $job_status = self::STATUS_RUNNING; + $db->query("UPDATE jobs SET status=? WHERE id=? AND uuid=?", [$job_status, $job->id,$job->uuid]); + + if (!array_key_exists($job->name,SeLf::$event_class_mapping)) + { + throw new \RuntimeException('Job ' . $job->name . ' handler not registered'); + } + + $handler = SELF::$event_class_mapping[$job->name]; + $handleInstance = null; + + if($handler['type'] == 'CC' || $handler['type'] == 'HC') + { + // echo 'CLASS - ' . $handler['type'].' - ' . $handler['handler']; + $handlerClass = $handler['handler']; + if(class_exists($handlerClass)) + { + $handleInstance = new $handlerClass(); + } + else + { + throw new \RuntimeException('Job ' . $job->name . ' or handler class not found'); + // echo $e->getMessage(); + } + + if (method_exists($handleInstance, $job->name)) + { + $jobHandler = [$handleInstance, $job->name]; + //throw new \RuntimeException('Job ' . $job->name . ' not found'); + } + else if(method_exists($handleInstance, 'handle')) + { + $jobHandler = [$handleInstance, 'handle']; + } + else + { + throw new \RuntimeException('Job ' . $job->name . ' or handler not found'); + } + } + else if($handler['type'] == 'HF') + { + // echo 'HF - ' . $handler['type']; + $jobHandler = $handleInstance = $handler['handler']; + // echo $jobHandler; + + } + else{ + throw new \RuntimeException('Job ' . $job->name . ' Invalid job type'); + } + + $payload = json_decode($job->payload, true); + if (!is_array($payload)) + { + throw new \InvalidArgumentException('Invalid payload format here'); + } + + $payload = is_array($payload) ? $payload : []; + $response = $jobHandler($payload,$job->id); + + $runtime = microtime(true) - $start; + $job_status = self::STATUS_DONE; + } + catch (\Exception $e) + { + //die(); + $job_status = self::STATUS_FAILED; + $runtime = $runtime === null ? microtime(true) - $start : $runtime; + $response = $e->getMessage(); + } + + $db->query("UPDATE jobs SET status=?, run_time=?, response=? WHERE id=? AND uuid=?", [ + $job_status, + $runtime, + json_encode($response), + $job->id,$job->uuid + ]); + + echo "Job $job->id $job_status. Response - $response \n"; + } + else + { + echo 'no job found in queue'; + } + } + +} diff --git a/app/Controllers/Jobs.php b/app/Controllers/Jobs.php new file mode 100644 index 00000000..33eee1fb --- /dev/null +++ b/app/Controllers/Jobs.php @@ -0,0 +1,64 @@ + 'check','payload' => ['a' => 10]]) + public function __construct() + { + // $this->job_payload = $payload; + // $this->myLogger = \Config\Services::mylogger(); + } + + /** + * add jobs to queue + */ + public static function addJob(array $payload) + { + $jobModel = new JobModel(); + $myLogger = \Config\Services::mylogger(); + + try + { + if(!is_array($payload)) + { + throw new \InvalidArgumentException('Invalid payload format while add job'); + } + + if(!isset($payload['job_name'])) + { + throw new \InvalidArgumentException('Job name not found while add job'); + } + + if(!isset($payload['payload'])) + { + throw new \InvalidArgumentException('Job payload not found while add job'); + } + + $uuid = generate_uuid(); + $jobid = $jobModel->insert(['name' => $payload['job_name'],'uuid' => $uuid,'payload' => json_encode($payload['payload'])]); + // echo $jobid; + $myLogger->logme('error','new job {jobid} added to queue',['jobid' => $jobid]); + return ['id' => $jobid,'uuid' => $uuid,'job_name' => $payload['job_name']]; + } + catch(\Exception $e) + { + $message = $e->getMessage(); + $myLogger->logme('error','{messgae}',['messgae' => $message]); + } + } + +} diff --git a/app/Controllers/Jobs/AddJob.php b/app/Controllers/Jobs/AddJob.php new file mode 100644 index 00000000..6b60cca7 --- /dev/null +++ b/app/Controllers/Jobs/AddJob.php @@ -0,0 +1,15 @@ +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/Helpers/HttpRequestHelper.php b/app/Helpers/HttpRequestHelper.php
index 9850d42b..a3a3da64 100644
--- a/app/Helpers/HttpRequestHelper.php
+++ b/app/Helpers/HttpRequestHelper.php
@@ -22,4 +22,6 @@ class HttpRequestHelper
         $data['postparams'] = is_array($data['postparams']) ? json_encode($data['postparams']) : $data['postparams'];
         return $data;
     }
+     public static function add($payload)
+    {return $payload['a'] + $payload['b'];}
 }
diff --git a/app/Helpers/utility_helper.php b/app/Helpers/utility_helper.php
index a41bcf7d..34ede33e 100644
--- a/app/Helpers/utility_helper.php
+++ b/app/Helpers/utility_helper.php
@@ -70,3 +70,49 @@ if (!function_exists('file_Upload')) {
     }
 }
 
+if (!function_exists('fancy_date_time_format')) 
+{
+    function fancy_date_time_format($datetime,$return_type = 'fancy') {
+        $currentDateTime = new DateTime();
+        $passedDateTime = new DateTime($datetime);
+
+
+            // Calculate the interval between the current time and the passed datetime
+            $interval = $currentDateTime->diff($passedDateTime);
+            // return change_date_format($datetime,'Y-m-d H:i:s','d M Y h:i a');
+                // If the interval is more than 1 month, return the original datetime
+            if ($interval->m > 1 || $interval->y > 0) {
+                if($return_type = 'fancy'){ return change_date_format($datetime,'Y-m-d H:i:s','d M Y h:i a'); }
+                return $datetime;
+            } elseif ($interval->m == 1 && $interval->y == 0) {
+                return "1 month ago";
+            } elseif ($interval->d >= 7) {
+                $weeks = floor($interval->d / 7);
+                return $weeks == 1 ? "1 week ago" : "$weeks weeks ago";
+            } elseif ($interval->d >= 1) {
+                return $interval->d == 1 ? "1 day ago" : $interval->d . " days ago";
+            } elseif ($interval->h >= 1) {
+                return $interval->h == 1 ? "1 hour ago" : $interval->h . " hours ago";
+            } elseif ($interval->i >= 1) {
+                return $interval->i == 1 ? "1 minute ago" : $interval->i . " minutes ago";
+            } else {
+                return "Just now";
+            }
+    }
+
+}
+
+
+if(!function_exists('check_string_date'))
+{
+    function check_string_date($str)
+    {
+        if (DateTime::createFromFormat('Y-m-d H:i:s', $str) !== false) {
+            return true;
+        }
+        return false;
+    }
+}
+
+
+
diff --git a/app/Models/ClientModel.php b/app/Models/ClientModel.php
index 9e601b2a..3ccf26a1 100644
--- a/app/Models/ClientModel.php
+++ b/app/Models/ClientModel.php
@@ -3,6 +3,7 @@
 namespace App\Models;
 
 use CodeIgniter\Model;
+use App\Models\ClientPolicyModel;
 
 class ClientModel extends Model
 {
@@ -25,6 +26,30 @@ class ClientModel extends Model
         "is_active",
     ];
 
+
+
+        //get client and its associated policies in same array
+    public function clientsWithPolicies()
+    {
+       
+            $columns = ['id', 'client_name','short_name'];
+            $clients = $this->select($columns)->where('is_active',1)->findAll(); 
+
+            foreach ($clients as &$client) {
+                $clientPolicyModel = new ClientPolicyModel();
+                $clientPolicies = $clientPolicyModel->select(['client_policy.id','p.name'])
+                                  ->join('policies p', 'p.id = client_policy.policy_id') 
+                                  ->where('client_policy.client_id',$client['id'])
+                                  ->where('client_policy.is_active', 1)
+                                  ->findAll();
+
+                $client['policies'] = $clientPolicies; 
+            }
+            //print_r(($clients));die();
+            return $clients;
+    }
+            
+
     public function getCreatedByUserName(){
 
         return $this->db->table('clients')
@@ -37,3 +62,4 @@ class ClientModel extends Model
     }
 
 }
+
diff --git a/app/Models/EmployeeModel.php b/app/Models/EmployeeModel.php
new file mode 100644
index 00000000..78cd79f4
--- /dev/null
+++ b/app/Models/EmployeeModel.php
@@ -0,0 +1,29 @@
+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'])
+                        ->join('employees emp', 'employee_polices.employee_id = emp.id') 
+                        ->join('client_policy cp', 'employee_polices.client_policy_id = cp.id') //cp - client policy
+                        ->join('policies pm', 'cp.policy_id = pm.id') //pm - policy master
+                        ->join('insurers im', 'cp.insurer_id = im.id') //im - insurar master
+                        ->join('insurer_branch ib', 'cp.insurer_branch_id = ib.id') //ib - insurar branch
+                        ->join('tpa tpam', 'cp.tpa_id = tpam.id') //tpam - tpa master
+                        ->join('tpa_branch tpab', 'cp.tpa_branch_id = tpab.id') //tpab - tpa brach
+                        ->join('clients cm', 'cp.client_id = cm.id') //cm - client master
+                        ->where('emp.client_id',$client_id)
+                        ->where('employee_polices.client_policy_id',$policy_id)
+                        ->findAll();
+        return ($result);
+   }
+}
diff --git a/app/Models/FileModel.php b/app/Models/FileModel.php
new file mode 100644
index 00000000..3c25e1ef
--- /dev/null
+++ b/app/Models/FileModel.php
@@ -0,0 +1,25 @@
+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/JobModel.php b/app/Models/JobModel.php
new file mode 100644
index 00000000..7f39ad0b
--- /dev/null
+++ b/app/Models/JobModel.php
@@ -0,0 +1,20 @@
+';
@@ -164,7 +168,6 @@ $(document).ready(function () {
         $('.ac').css('display', 'block');
         contactCount = 1
 
-
         var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
         for (var i = 0; i < buttonIds.length; i++) {
             var firstElement = buttonIds[i].split('_')[0];
@@ -224,11 +227,14 @@ $(document).ready(function () {
         
         if (branch_PrimaryKey === '' || branch_PrimaryKey_2 === '') {
             toastr.error('Client is required', 'Error');
+            $('#insurer').val('');
+            $('#tpa').val('');
+            $('#policy').html('');
             return; 
         }
 
         var isValid = $('#branch_form').parsley().validate();
-        
+
         if (isValid) {
 
             var formData = new FormData($('#branch_form')[0]);
@@ -270,6 +276,7 @@ $(document).ready(function () {
     });
 
 
+
     $('body').on('click', '.btnBranchEdit', function () {
 
         console.log(branch_form_action);
@@ -316,8 +323,6 @@ $(document).ready(function () {
     });
 
 
-
-
     // Initialize the contact count
     function appendContactHtml(contact = false, reset = false) {
 
diff --git a/app/Views/employee_list.php b/app/Views/employee_list.php
new file mode 100644
index 00000000..5463d12c
--- /dev/null
+++ b/app/Views/employee_list.php
@@ -0,0 +1,255 @@
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+ + + + +
+
+
+

+
+
+
+
+
+ +
+
+
+
+
+
+

Employees

+
+ +
+ + + + + + + + + + + + + + + + + + $employee) { ?> + + + + + + + + + + + + + + + + +
SNOEmployee codeNamePolicy nameInsurar nameTPA IDUHID IDPolicy statusPremiumAction
active + +
+
+
+
+
+ + + + diff --git a/app/Views/employee_upload.php b/app/Views/employee_upload.php new file mode 100644 index 00000000..4a2bcf00 --- /dev/null +++ b/app/Views/employee_upload.php @@ -0,0 +1,305 @@ +';?> +';?> + + + + +
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+ +
+ +
+ +
+
+
+ +
+
+
+
+ + + + +
+
+
+

+
+
+
+
+
+ +
+ +
+ + + + + + + + diff --git a/app/Views/file_list.php b/app/Views/file_list.php new file mode 100644 index 00000000..14046c26 --- /dev/null +++ b/app/Views/file_list.php @@ -0,0 +1,41 @@ +
+
+
+
+
+

Files

+
+ +
+ + + + + + + + + + + + $file) { ?> + + + + + + + + + + +
SNOFile nameUser/TimeStatus
'.$file['first_name'].''?> '; + }?>
+
+
+
\ No newline at end of file diff --git a/app/Views/insurer_basic_info.php b/app/Views/insurer_basic_info.php new file mode 100644 index 00000000..9acef300 --- /dev/null +++ b/app/Views/insurer_basic_info.php @@ -0,0 +1,147 @@ +
+
+
+
+
+ + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ +
+ + +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/app/Views/insurer_branch.php b/app/Views/insurer_branch.php new file mode 100644 index 00000000..44c276f0 --- /dev/null +++ b/app/Views/insurer_branch.php @@ -0,0 +1,476 @@ +
+ +
+ +
+ +
+ + + + + + + + + + + +
Branch NameBranch CodeAction
+
+ +
+
+
+
+ +
+ +
+ +
+ + + +
+
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
Contact 1
+
+ +
+ +
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+ + +
+ +
+ +
+
+ + +
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/app/Views/insurer_list.php b/app/Views/insurer_list.php new file mode 100644 index 00000000..d50eafb8 --- /dev/null +++ b/app/Views/insurer_list.php @@ -0,0 +1,134 @@ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + +
NameTypeAction
( ) + +
+
+
+
+
+ + + \ No newline at end of file diff --git a/app/Views/insurer_onboarding.php b/app/Views/insurer_onboarding.php new file mode 100644 index 00000000..ba10daa4 --- /dev/null +++ b/app/Views/insurer_onboarding.php @@ -0,0 +1,69 @@ + + +
+
+
+
+
+
+

Insurer Onboarding

+
+ +
+ +
+ + +
+
+
+
+
+ + diff --git a/app/Views/kyc_docs.php b/app/Views/kyc_docs.php new file mode 100644 index 00000000..4e4be6f3 --- /dev/null +++ b/app/Views/kyc_docs.php @@ -0,0 +1,258 @@ +
+ +
+ +
+ +
+ + + + + + + + + + +
File NameAction
+
+ +
+
+
+
+ +
+ +
+ +
+ + + +
+
+
+ + +
+
+ + +
+ + +
+ +
+
+
+
+ + + \ No newline at end of file diff --git a/app/Views/kyc_entity_type_basic_info.php b/app/Views/kyc_entity_type_basic_info.php new file mode 100644 index 00000000..18cff9f4 --- /dev/null +++ b/app/Views/kyc_entity_type_basic_info.php @@ -0,0 +1,112 @@ +
+
+
+
+
+ + + +
+
+
+ + +
+
+ +
+
+ +
+ + +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/app/Views/kyc_list.php b/app/Views/kyc_list.php new file mode 100644 index 00000000..af6668a2 --- /dev/null +++ b/app/Views/kyc_list.php @@ -0,0 +1,132 @@ + + + + \ No newline at end of file diff --git a/app/Views/kyc_onboarding.php b/app/Views/kyc_onboarding.php new file mode 100644 index 00000000..778d7d4e --- /dev/null +++ b/app/Views/kyc_onboarding.php @@ -0,0 +1,69 @@ + + +
+
+
+
+
+
+

KYC Entity Type Onboarding

+
+ +
+ +
+ + +
+
+
+
+
+ + diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index 3ecb6fe4..1d3eb192 100644 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -471,6 +471,7 @@
+ +
@@ -511,6 +513,24 @@ Clients +
  • + + + 2 + Employees + +
    + +
    +
  • +
  • @@ -520,10 +540,16 @@ diff --git a/app/Views/policies.php b/app/Views/policies.php new file mode 100644 index 00000000..85f4304b --- /dev/null +++ b/app/Views/policies.php @@ -0,0 +1,333 @@ +
    + +
    + +
    + +
    + + + + + + + + + + + +
    InsurerNameAction
    +
    + +
    +
    +
    +
    + +
    + +
    + +
    + + + +
    +
    +
    + + +
    + + +
    + + +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/app/Views/policy_type_basic_info.php b/app/Views/policy_type_basic_info.php new file mode 100644 index 00000000..2ce5ae8c --- /dev/null +++ b/app/Views/policy_type_basic_info.php @@ -0,0 +1,129 @@ +
    +
    +
    +
    +
    + + + +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
    +
    + +
    + + +
    +
    +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/app/Views/policy_type_list.php b/app/Views/policy_type_list.php new file mode 100644 index 00000000..a791143b --- /dev/null +++ b/app/Views/policy_type_list.php @@ -0,0 +1,138 @@ +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    Policy TypeBapAllocgallociAction
    + +
    +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/app/Views/policy_type_onboarding.php b/app/Views/policy_type_onboarding.php new file mode 100644 index 00000000..da32edc4 --- /dev/null +++ b/app/Views/policy_type_onboarding.php @@ -0,0 +1,69 @@ + + +
    +
    +
    +
    +
    +
    +

    Policy Type Onboarding

    +
    + +
    + +
    + + +
    +
    +
    +
    +
    + + diff --git a/app/Views/tpa_basic_info.php b/app/Views/tpa_basic_info.php new file mode 100644 index 00000000..7ebe2c1c --- /dev/null +++ b/app/Views/tpa_basic_info.php @@ -0,0 +1,125 @@ +
    +
    +
    +
    +
    + + + +
    +
    +
    + + +
    +
    + + +
    +
    + +
    +
    + +
    + + +
    +
    +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/app/Views/tpa_branch.php b/app/Views/tpa_branch.php new file mode 100644 index 00000000..d1eb9977 --- /dev/null +++ b/app/Views/tpa_branch.php @@ -0,0 +1,467 @@ +
    + +
    + +
    + +
    + + + + + + + + + + + +
    Branch NameBranch CodeAction
    +
    + +
    +
    +
    +
    + +
    + +
    + +
    + + + +
    +
    +
    + + +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
    +
    Contact 1
    +
    + +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/app/Views/tpa_list.php b/app/Views/tpa_list.php new file mode 100644 index 00000000..1ad72245 --- /dev/null +++ b/app/Views/tpa_list.php @@ -0,0 +1,132 @@ +
    + +
    + + + \ No newline at end of file diff --git a/app/Views/tpa_onboarding.php b/app/Views/tpa_onboarding.php new file mode 100644 index 00000000..01d55afa --- /dev/null +++ b/app/Views/tpa_onboarding.php @@ -0,0 +1,69 @@ + + +
    +
    +
    +
    +
    +
    +

    TPA Onboarding

    +
    + +
    + +
    + + +
    +
    +
    +
    +
    + + diff --git a/composer.json b/composer.json index ead70015..53779a29 100644 --- a/composer.json +++ b/composer.json @@ -60,7 +60,9 @@ "config": { "optimize-autoloader": true, "preferred-install": "dist", - "sort-packages": true + "sort-packages": true, + "process-timeout": 900 + }, "scripts": { "test": "phpunit"