FIX_CLIENT_LIST_HIDE_DELETED_CLIENT_AND_CLIENT_POLICY_FILTERS : RV
This commit is contained in:
parent
36dd429b57
commit
bc3642e404
@ -7,12 +7,12 @@ use CodeIgniter\Router\RouteCollection;
|
|||||||
* @var RouteCollection $routes
|
* @var RouteCollection $routes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$routes->get('/swagger', 'SwaggerController::index', ['filter' => 'authMVC']);
|
$routes->get('/swagger', 'SwaggerController::index', ['filter' => 'authMVC']);
|
||||||
|
|
||||||
|
|
||||||
// $routes->get('/', 'LoginController::index');
|
// $routes->get('/', 'LoginController::index');
|
||||||
$routes->get('/test', 'Home::index');
|
$routes->get('/test', 'Home::index');
|
||||||
$routes->get('/login', 'LoginController::index');///auth/google
|
$routes->get('/login', 'LoginController::index'); ///auth/google
|
||||||
$routes->get('/logout', 'LoginController::logout');
|
$routes->get('/logout', 'LoginController::logout');
|
||||||
$routes->get('/oauth2callback', 'LoginController::receiveGoogleOAuthResponse');
|
$routes->get('/oauth2callback', 'LoginController::receiveGoogleOAuthResponse');
|
||||||
$routes->get('/auth/google', 'LoginController::initiateGoogleOAuth');
|
$routes->get('/auth/google', 'LoginController::initiateGoogleOAuth');
|
||||||
@ -21,7 +21,7 @@ $routes->get('download-e-card/(:segment)', 'EmployeeController::generateIDCardFo
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$routes->group("/user", ["filter" => "authMVC"], function($routes){
|
$routes->group("/user", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->post("create", "UserController::create");
|
$routes->post("create", "UserController::create");
|
||||||
$routes->get("create", "UserController::create");
|
$routes->get("create", "UserController::create");
|
||||||
$routes->post("edit", "UserController::edit");
|
$routes->post("edit", "UserController::edit");
|
||||||
@ -32,12 +32,12 @@ $routes->group("/user", ["filter" => "authMVC"], function($routes){
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$routes->group("/dashboard", ["filter" => "authMVC"], function($routes){
|
$routes->group("/dashboard", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->get("view", "DashboardController::dashboard");
|
$routes->get("view", "DashboardController::dashboard");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$routes->group("/client", ["filter" => "authMVC"], function($routes){
|
$routes->group("/client", ["filter" => "authMVC"], function ($routes) {
|
||||||
|
|
||||||
$routes->get("list", "ClientController::index");
|
$routes->get("list", "ClientController::index");
|
||||||
$routes->get("create", "ClientController::clientOnboarding");
|
$routes->get("create", "ClientController::clientOnboarding");
|
||||||
@ -45,11 +45,11 @@ $routes->group("/client", ["filter" => "authMVC"], function($routes){
|
|||||||
$routes->get('remove/(:num)', 'ClientController::removeClient/$1');
|
$routes->get('remove/(:num)', 'ClientController::removeClient/$1');
|
||||||
// application/config/routes.php
|
// application/config/routes.php
|
||||||
|
|
||||||
// Add a route for the view_Deposit method
|
// Add a route for the view_Deposit method
|
||||||
$routes->get('view_deposit/(:num)', 'ClientController::view_Deposit/$1');
|
$routes->get('view_deposit/(:num)', 'ClientController::view_Deposit/$1');
|
||||||
$routes->get('createtransaction', 'ClientController::createtransaction');
|
$routes->get('createtransaction', 'ClientController::createtransaction');
|
||||||
|
|
||||||
$routes->post('save_deposit', 'ClientController::saveDeposit');
|
$routes->post('save_deposit', 'ClientController::saveDeposit');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -64,24 +64,24 @@ $routes->post('save_deposit', 'ClientController::saveDeposit');
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$routes->group("general", ["filter" => "authMVC"], function($routes){
|
$routes->group("general", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->post("create", "ClientController::createClientGeneralInfo");
|
$routes->post("create", "ClientController::createClientGeneralInfo");
|
||||||
$routes->post("edit", "ClientController::editClientGeneralInfo");
|
$routes->post("edit", "ClientController::editClientGeneralInfo");
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->group("branch", ["filter" => "authMVC"], function($routes){
|
$routes->group("branch", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->post("create", "ClientController::createClientBranch");
|
$routes->post("create", "ClientController::createClientBranch");
|
||||||
$routes->post("edit", "ClientController::editClientBranch");
|
$routes->post("edit", "ClientController::editClientBranch");
|
||||||
$routes->get("list/(:any)", "ClientController::getSingleBranchDataById/$1");
|
$routes->get("list/(:any)", "ClientController::getSingleBranchDataById/$1");
|
||||||
$routes->get("remove/(:any)", "ClientController::removeClientBranch/$1");
|
$routes->get("remove/(:any)", "ClientController::removeClientBranch/$1");
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->group("relation", ["filter" => "authMVC"], function($routes){
|
$routes->group("relation", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->post("create", "ClientController::createClientRelation");
|
$routes->post("create", "ClientController::createClientRelation");
|
||||||
$routes->post("edit", "ClientController::editClientRelation");
|
$routes->post("edit", "ClientController::editClientRelation");
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->group("policy", ["filter" => "authMVC"], function($routes){
|
$routes->group("policy", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->post("create", "ClientController::createClientPolicy");
|
$routes->post("create", "ClientController::createClientPolicy");
|
||||||
$routes->post("edit", "ClientController::editClientPolicy");
|
$routes->post("edit", "ClientController::editClientPolicy");
|
||||||
$routes->get("list/(:any)", "ClientController::getClientPolicyById/$1");
|
$routes->get("list/(:any)", "ClientController::getClientPolicyById/$1");
|
||||||
@ -89,27 +89,26 @@ $routes->post('save_deposit', 'ClientController::saveDeposit');
|
|||||||
$routes->get("getterms", "ClientController::getterms");
|
$routes->get("getterms", "ClientController::getterms");
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->group("kyc", ["filter" => "authMVC"], function($routes){
|
$routes->group("kyc", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->post("create", "ClientController::createClientKYCInfo");
|
$routes->post("create", "ClientController::createClientKYCInfo");
|
||||||
$routes->post("edit", "ClientController::editClientKYCInfo");
|
$routes->post("edit", "ClientController::editClientKYCInfo");
|
||||||
$routes->get("list/(:any)", "ClientController::getKycDocsById/$1");
|
$routes->get("list/(:any)", "ClientController::getKycDocsById/$1");
|
||||||
$routes->get("delete/(:any)", "ClientController::deleteClientKycDocs/$1");
|
$routes->get("delete/(:any)", "ClientController::deleteClientKycDocs/$1");
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->group("premimum", ["filter" => "authMVC"], function($routes){
|
$routes->group("premimum", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->post("create", "ClientController::createClientPolicyPremium");
|
$routes->post("create", "ClientController::createClientPolicyPremium");
|
||||||
$routes->post("edit", "ClientController::editClientPolicyPremium");
|
$routes->post("edit", "ClientController::editClientPolicyPremium");
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->group("terms", ["filter" => "authMVC"], function($routes){
|
$routes->group("terms", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->post("gpa_create", "ClientController::policyGPATerms");
|
$routes->post("gpa_create", "ClientController::policyGPATerms");
|
||||||
$routes->post("edit", "ClientController::editClientPolicyPremium");
|
$routes->post("edit", "ClientController::editClientPolicyPremium");
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$routes->group("/employee", ["filter" => "authMVC"], function($routes){
|
$routes->group("/employee", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->get("list", "EmployeeController::list");
|
$routes->get("list", "EmployeeController::list");
|
||||||
$routes->get("search", "EmployeeController::search");
|
$routes->get("search", "EmployeeController::search");
|
||||||
$routes->get("upload", "EmployeeController::employeesUplodWithEvents");
|
$routes->get("upload", "EmployeeController::employeesUplodWithEvents");
|
||||||
@ -120,10 +119,10 @@ $routes->group("/employee", ["filter" => "authMVC"], function($routes){
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$routes->group("/master", ["filter" => "authMVC"], function($routes){
|
$routes->group("/master", ["filter" => "authMVC"], function ($routes) {
|
||||||
|
|
||||||
|
|
||||||
$routes->group("insurer", ["filter" => "authMVC"], function($routes){
|
$routes->group("insurer", ["filter" => "authMVC"], function ($routes) {
|
||||||
|
|
||||||
|
|
||||||
$routes->get("list", "MasterController::insurerList");
|
$routes->get("list", "MasterController::insurerList");
|
||||||
@ -133,17 +132,16 @@ $routes->group("/master", ["filter" => "authMVC"], function($routes){
|
|||||||
$routes->post("edit", "MasterController::editInsurerGeneralInfo");
|
$routes->post("edit", "MasterController::editInsurerGeneralInfo");
|
||||||
$routes->get("list/(:any)", "MasterController::editInsurerOnboarding/$1");
|
$routes->get("list/(:any)", "MasterController::editInsurerOnboarding/$1");
|
||||||
|
|
||||||
$routes->group("branch", ["filter" => "authMVC"], function($routes){
|
$routes->group("branch", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->post("create", "MasterController::createInsurerBranch");
|
$routes->post("create", "MasterController::createInsurerBranch");
|
||||||
$routes->post("edit", "MasterController::editInsurerBranch");
|
$routes->post("edit", "MasterController::editInsurerBranch");
|
||||||
$routes->get("editget/(:any)", "MasterController::editInsurerGet/$1");
|
$routes->get("editget/(:any)", "MasterController::editInsurerGet/$1");
|
||||||
$routes->get("list/(:any)", "MasterController::insurerBranchList/$1");
|
$routes->get("list/(:any)", "MasterController::insurerBranchList/$1");
|
||||||
$routes->get("remove/(:any)", "MasterController::removeInsurerBranch/$1");
|
$routes->get("remove/(:any)", "MasterController::removeInsurerBranch/$1");
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->group("tpa", ["filter" => "authMVC"], function($routes){
|
$routes->group("tpa", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->get("list", "MasterController::tpaList");
|
$routes->get("list", "MasterController::tpaList");
|
||||||
$routes->get("create", "MasterController::tpaOnboarding");
|
$routes->get("create", "MasterController::tpaOnboarding");
|
||||||
$routes->post("createpost", "MasterController::createTPAGeneralInfo");
|
$routes->post("createpost", "MasterController::createTPAGeneralInfo");
|
||||||
@ -151,7 +149,7 @@ $routes->group("/master", ["filter" => "authMVC"], function($routes){
|
|||||||
$routes->get("list/(:any)", "MasterController::editTPAOnboarding/$1");
|
$routes->get("list/(:any)", "MasterController::editTPAOnboarding/$1");
|
||||||
$routes->get("remove/(:any)", "MasterController::tpaRemove/$1");
|
$routes->get("remove/(:any)", "MasterController::tpaRemove/$1");
|
||||||
|
|
||||||
$routes->group("branch", ["filter" => "authMVC"], function($routes){
|
$routes->group("branch", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->post("create", "MasterController::createTPABranch");
|
$routes->post("create", "MasterController::createTPABranch");
|
||||||
$routes->get("editget/(:any)", "MasterController::editTPAGet/$1");
|
$routes->get("editget/(:any)", "MasterController::editTPAGet/$1");
|
||||||
$routes->post("edit", "MasterController::editTPABranch");
|
$routes->post("edit", "MasterController::editTPABranch");
|
||||||
@ -160,7 +158,7 @@ $routes->group("/master", ["filter" => "authMVC"], function($routes){
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->group("kyc", ["filter" => "authMVC"], function($routes){
|
$routes->group("kyc", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->get("list", "MasterController::kycList");
|
$routes->get("list", "MasterController::kycList");
|
||||||
$routes->get("create", "MasterController::kycOnboarding");
|
$routes->get("create", "MasterController::kycOnboarding");
|
||||||
$routes->post("createpost", "MasterController::createKYCInfo");
|
$routes->post("createpost", "MasterController::createKYCInfo");
|
||||||
@ -170,18 +168,17 @@ $routes->group("/master", ["filter" => "authMVC"], function($routes){
|
|||||||
$routes->get("delete/(:any)", "MasterController::deleteClientKycDocs/$1");
|
$routes->get("delete/(:any)", "MasterController::deleteClientKycDocs/$1");
|
||||||
|
|
||||||
|
|
||||||
$routes->group("kycdocs", ["filter" => "authMVC"], function($routes){
|
$routes->group("kycdocs", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->post("createpost", "MasterController::createKycDocs");
|
$routes->post("createpost", "MasterController::createKycDocs");
|
||||||
$routes->get("editget/(:any)", "MasterController::editKYCGet/$1");
|
$routes->get("editget/(:any)", "MasterController::editKYCGet/$1");
|
||||||
$routes->post("edit", "MasterController::editKYCDocs");
|
$routes->post("edit", "MasterController::editKYCDocs");
|
||||||
// $routes->get("list", "MasterController::tpaBranchList");
|
// $routes->get("list", "MasterController::tpaBranchList");
|
||||||
$routes->get("list/(:any)", "MasterController::kycDocsList/$1");
|
$routes->get("list/(:any)", "MasterController::kycDocsList/$1");
|
||||||
$routes->get("remove/(:any)", "MasterController::removeKYCDocs/$1");
|
$routes->get("remove/(:any)", "MasterController::removeKYCDocs/$1");
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->group("policy", ["filter" => "authMVC"], function($routes){
|
$routes->group("policy", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->get("list", "MasterController::policyTypeList");
|
$routes->get("list", "MasterController::policyTypeList");
|
||||||
$routes->get("create", "MasterController::policyTypeOnboarding");
|
$routes->get("create", "MasterController::policyTypeOnboarding");
|
||||||
$routes->post("createpost", "MasterController::createPolicyType");
|
$routes->post("createpost", "MasterController::createPolicyType");
|
||||||
@ -190,7 +187,7 @@ $routes->group("/master", ["filter" => "authMVC"], function($routes){
|
|||||||
$routes->get("remove/(:any)", "MasterController::policyTypeRemove/$1");
|
$routes->get("remove/(:any)", "MasterController::policyTypeRemove/$1");
|
||||||
|
|
||||||
|
|
||||||
$routes->group("policies", ["filter" => "authMVC"], function($routes){
|
$routes->group("policies", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->post("createpost", "MasterController::createPolicies");
|
$routes->post("createpost", "MasterController::createPolicies");
|
||||||
$routes->get("editget/(:any)", "MasterController::editPoliciesGet/$1");
|
$routes->get("editget/(:any)", "MasterController::editPoliciesGet/$1");
|
||||||
$routes->post("edit", "MasterController::editPolicies");
|
$routes->post("edit", "MasterController::editPolicies");
|
||||||
@ -198,12 +195,11 @@ $routes->group("/master", ["filter" => "authMVC"], function($routes){
|
|||||||
$routes->get("list/(:any)", "MasterController::policesList/$1");
|
$routes->get("list/(:any)", "MasterController::policesList/$1");
|
||||||
$routes->get("remove/(:any)", "MasterController::removePolicyPolicies/$1");
|
$routes->get("remove/(:any)", "MasterController::removePolicyPolicies/$1");
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$routes->group("/util", ["filter" => "authMVC"], function($routes){
|
$routes->group("/util", ["filter" => "authMVC"], function ($routes) {
|
||||||
$routes->get("clients-with-policies", "EmployeeController::getClientWithPolicies");
|
$routes->get("clients-with-policies", "EmployeeController::getClientWithPolicies");
|
||||||
$routes->get("police-by-insurer/(:any)", "ClientController::getPolicesByInsurerId/$1");
|
$routes->get("police-by-insurer/(:any)", "ClientController::getPolicesByInsurerId/$1");
|
||||||
$routes->get("get-file-error/(:any)", "EmployeeController::getUploadedFileError/$1");
|
$routes->get("get-file-error/(:any)", "EmployeeController::getUploadedFileError/$1");
|
||||||
@ -236,7 +232,7 @@ $routes->post("/employeeRest/getVerifiedUserData", "RestAuthenticationController
|
|||||||
$routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber");
|
$routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber");
|
||||||
$routes->post("/employeeRest/getVerifiedHrData", "RestAuthenticationController::getVerifiedHrData");
|
$routes->post("/employeeRest/getVerifiedHrData", "RestAuthenticationController::getVerifiedHrData");
|
||||||
|
|
||||||
$routes->group("/api", ["filter" => "authJWT"], function($routes){
|
$routes->group("/api", ["filter" => "authJWT"], function ($routes) {
|
||||||
$routes->post("logined", "RestAuthenticationController::logined");
|
$routes->post("logined", "RestAuthenticationController::logined");
|
||||||
$routes->post("getId", "RestAuthenticationController::getUserIdFromToken");
|
$routes->post("getId", "RestAuthenticationController::getUserIdFromToken");
|
||||||
});
|
});
|
||||||
@ -250,7 +246,7 @@ $routes->post("/calculatePremium", "EmployeeRestController::calculatePremium");
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$routes->group("employeeRest", ["filter" => "authJWT"], function($routes){
|
$routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
|
||||||
|
|
||||||
$routes->get("getEmployeeProfile", "EmployeeRestController::getEmployeeProfile");
|
$routes->get("getEmployeeProfile", "EmployeeRestController::getEmployeeProfile");
|
||||||
$routes->post("employeeUpload", "EmployeeRestController::employeeUpload");
|
$routes->post("employeeUpload", "EmployeeRestController::employeeUpload");
|
||||||
@ -273,8 +269,6 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function($routes){
|
|||||||
$routes->get("exportCashDepositData", "EmployeeRestController::exportCashDepositData");
|
$routes->get("exportCashDepositData", "EmployeeRestController::exportCashDepositData");
|
||||||
|
|
||||||
$routes->get("removeEmpAndEmpPolicyData", "EmployeeRestController::removeEmpAndEmpPolicyData");
|
$routes->get("removeEmpAndEmpPolicyData", "EmployeeRestController::removeEmpAndEmpPolicyData");
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->post("sendEmail", "EmployeeRestController::send_email");
|
$routes->post("sendEmail", "EmployeeRestController::send_email");
|
||||||
|
|||||||
@ -573,6 +573,9 @@ class ClientController extends AdminController
|
|||||||
public function createClientPolicy()
|
public function createClientPolicy()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// print_r($this->request->getPost()); die;
|
||||||
|
|
||||||
|
|
||||||
$this->myLogger->logme('error','Client policy CREATE function called');
|
$this->myLogger->logme('error','Client policy CREATE function called');
|
||||||
|
|
||||||
$insurerValue = (string) $this->request->getPost('insurer');
|
$insurerValue = (string) $this->request->getPost('insurer');
|
||||||
@ -607,6 +610,8 @@ class ClientController extends AdminController
|
|||||||
$data['base_policy'] = $this->request->getPost('base_policy');
|
$data['base_policy'] = $this->request->getPost('base_policy');
|
||||||
$data['policy_status'] = 1;
|
$data['policy_status'] = 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$policy_terms = $this->clientPolicyModel->where('id', $this->request->getPost('base_policy'))->first();
|
$policy_terms = $this->clientPolicyModel->where('id', $this->request->getPost('base_policy'))->first();
|
||||||
|
|
||||||
if ( $this->request->getPost('is_addon') == 2 || $this->request->getPost('is_addon') == 3) {
|
if ( $this->request->getPost('is_addon') == 2 || $this->request->getPost('is_addon') == 3) {
|
||||||
@ -992,7 +997,10 @@ class ClientController extends AdminController
|
|||||||
{
|
{
|
||||||
$this->myLogger->logme('error','getPolicesByInsurerId function called');
|
$this->myLogger->logme('error','getPolicesByInsurerId function called');
|
||||||
if($id){
|
if($id){
|
||||||
$police_data = $this->policesModel->where(['insurer_id' => $id, 'is_active' => 1])->findAll();
|
$police_data = $this->policesModel
|
||||||
|
->select('policies.*, policy_type.policy_type')
|
||||||
|
->join('policy_type', 'policy_type.id = policies.policy_type_id')
|
||||||
|
->where(['insurer_id' => $id, 'policies.is_active' => 1])->findAll();
|
||||||
return $this->respond(['status' => true,'code' => 200,'data' => $police_data], 200);
|
return $this->respond(['status' => true,'code' => 200,'data' => $police_data], 200);
|
||||||
}else{
|
}else{
|
||||||
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
||||||
|
|||||||
@ -56,10 +56,10 @@ class ClientModel extends Model
|
|||||||
|
|
||||||
return $this->db->table('clients')
|
return $this->db->table('clients')
|
||||||
->select('clients.*')
|
->select('clients.*')
|
||||||
|
->where('is_active', 1)
|
||||||
->get()
|
->get()
|
||||||
->getResult();
|
->getResult();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -276,17 +276,18 @@ public function updateStatus(){
|
|||||||
|
|
||||||
public function getpolicyWithPattern($client_id){
|
public function getpolicyWithPattern($client_id){
|
||||||
|
|
||||||
$query = "
|
$query = $this->db->table('client_policy')
|
||||||
SELECT client_policy.*, policies.name, policies.policy_type_id
|
->select('client_policy.*, policies.name, policies.policy_type_id, policy_type.policy_type')
|
||||||
FROM client_policy
|
->join('policies', 'policies.id = client_policy.policy_id')
|
||||||
JOIN policies ON policies.id = client_policy.policy_id
|
->join('policy_type', 'policy_type.id = policies.policy_type_id')
|
||||||
JOIN policy_type ON policy_type.id = policies.policy_type_id
|
// ->where('policy_type.policy_type', 'GMC')
|
||||||
WHERE policy_type.policy_type = 'GMC'
|
->whereIn('policy_type.id', [2, 3])
|
||||||
AND client_policy.client_id = {$client_id}";
|
->where('client_policy.client_id', $client_id)
|
||||||
|
->get()
|
||||||
|
->getResult();
|
||||||
|
|
||||||
$result = $this->db->query($query)->getResult();
|
|
||||||
|
|
||||||
return $result;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTopUpPolicy($client_id, $type){
|
public function getTopUpPolicy($client_id, $type){
|
||||||
|
|||||||
@ -399,11 +399,11 @@
|
|||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
if (xhr.status === 404) {
|
if (xhr.status === 404) {
|
||||||
toastr.warning('Resource not found', 'Warning');
|
console.log('Resource not found', 'Warning');
|
||||||
} else if (xhr.status === 500) {
|
} else if (xhr.status === 500) {
|
||||||
toastr.warning('Internal server error', 'Warning');
|
console.log('Internal server error', 'Warning');
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Unknown error occurred', 'Warning');
|
console.log('Unknown error occurred', 'Warning');
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
@ -418,6 +418,11 @@
|
|||||||
var secondPart = parts[1];
|
var secondPart = parts[1];
|
||||||
var url = "<?= base_url("util/police-by-insurer/") ?>" + secondPart;
|
var url = "<?= base_url("util/police-by-insurer/") ?>" + secondPart;
|
||||||
|
|
||||||
|
var selectedOption = $('#base_policy').find(':selected');
|
||||||
|
var base_policy_data_id = selectedOption.data('id');
|
||||||
|
console.log('base_policy_data_id', base_policy_data_id);
|
||||||
|
|
||||||
|
|
||||||
$.get(url, function(res) {
|
$.get(url, function(res) {
|
||||||
// res = JSON.parse(res)//
|
// res = JSON.parse(res)//
|
||||||
// console.log(res)
|
// console.log(res)
|
||||||
@ -427,29 +432,46 @@
|
|||||||
$.each(res.data, function(index, item) {
|
$.each(res.data, function(index, item) {
|
||||||
|
|
||||||
if ($policy_type_value == 3) {
|
if ($policy_type_value == 3) {
|
||||||
if (item.policy_type_id == 5 || item.policy_type_id == 3) {
|
|
||||||
|
if (base_policy_data_id == 3) {
|
||||||
|
|
||||||
|
if (item.policy_type_id == 5) {
|
||||||
|
|
||||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
||||||
item.id +
|
item.id +
|
||||||
'">' + item.name + '</option>';
|
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||||
}
|
}
|
||||||
} else if ($policy_type_value == 2) {
|
|
||||||
if (item.policy_type_id == 4) {
|
} else {
|
||||||
|
|
||||||
|
if (item.policy_type_id == 5 || item.policy_type_id == 3) {
|
||||||
|
|
||||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
||||||
item.id +
|
item.id +
|
||||||
'">' + item.name + '</option>';
|
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else if ($policy_type_value == 2) {
|
||||||
|
if (item.policy_type_id == 4 || item.policy_type_id == 5) {
|
||||||
|
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
||||||
|
item.id +
|
||||||
|
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||||
}
|
}
|
||||||
} else if ($policy_type_value == 1) {
|
} else if ($policy_type_value == 1) {
|
||||||
if (item.policy_type_id == 1 || item.policy_type_id == 2) {
|
if (item.policy_type_id == 1 || item.policy_type_id == 2) {
|
||||||
|
|
||||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
||||||
item.id +
|
item.id +
|
||||||
'">' + item.name + '</option>';
|
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
||||||
item.id +
|
item.id +
|
||||||
'">' + item.name + '</option>';
|
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -553,11 +575,35 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
|
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
|
||||||
$('#insurer').prop('disabled', true);
|
$("#insurer").next(".select2-container").css({
|
||||||
$('#tpa').prop('disabled', true);
|
'pointer-events': 'none',
|
||||||
|
});
|
||||||
|
$('#select2-insurer-container').css({
|
||||||
|
'background-color': '#ebebe0',
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#tpa").next(".select2-container").css({
|
||||||
|
'pointer-events': 'none',
|
||||||
|
});
|
||||||
|
$('#select2-tpa-container').css({
|
||||||
|
'background-color': '#ebebe0',
|
||||||
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$('#insurer').prop('disabled', false);
|
|
||||||
$('#tpa').prop('disabled', false);
|
$("#insurer").next(".select2-container").css({
|
||||||
|
'pointer-events': 'auto',
|
||||||
|
});
|
||||||
|
$('#select2-insurer-container').css({
|
||||||
|
'background-color': 'transparent',
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#tpa").next(".select2-container").css({
|
||||||
|
'pointer-events': 'auto',
|
||||||
|
});
|
||||||
|
$('#select2-tpa-container').css({
|
||||||
|
'background-color': 'transparent',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var policeOptionHTML = '';
|
var policeOptionHTML = '';
|
||||||
@ -672,11 +718,11 @@
|
|||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
if (xhr.status === 404) {
|
if (xhr.status === 404) {
|
||||||
toastr.warning('Resource not found', 'Warning');
|
console.log('Resource not found', 'Warning');
|
||||||
} else if (xhr.status === 500) {
|
} else if (xhr.status === 500) {
|
||||||
toastr.warning('Internal server error', 'Warning');
|
console.log('Internal server error', 'Warning');
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Unknown error occurred', 'Warning');
|
console.log('Unknown error occurred', 'Warning');
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
@ -1044,11 +1090,35 @@
|
|||||||
$('#base_policy').val('').change();
|
$('#base_policy').val('').change();
|
||||||
|
|
||||||
if ($(this).val() == 2 || $(this).val() == 3) {
|
if ($(this).val() == 2 || $(this).val() == 3) {
|
||||||
$('#insurer').prop('disabled', true);
|
|
||||||
$('#tpa').prop('disabled', true);
|
$("#insurer").next(".select2-container").css({
|
||||||
|
'pointer-events': 'none',
|
||||||
|
});
|
||||||
|
$('#select2-insurer-container').css({
|
||||||
|
'background-color': '#ebebe0',
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#tpa").next(".select2-container").css({
|
||||||
|
'pointer-events': 'none',
|
||||||
|
});
|
||||||
|
$('#select2-tpa-container').css({
|
||||||
|
'background-color': '#ebebe0',
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
$('#insurer').prop('disabled', false);
|
|
||||||
$('#tpa').prop('disabled', false);
|
$("#insurer").next(".select2-container").css({
|
||||||
|
'pointer-events': 'auto',
|
||||||
|
});
|
||||||
|
$('#select2-insurer-container').css({
|
||||||
|
'background-color': 'transparent',
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#tpa").next(".select2-container").css({
|
||||||
|
'pointer-events': 'auto',
|
||||||
|
});
|
||||||
|
$('#select2-tpa-container').css({
|
||||||
|
'background-color': 'transparent',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1107,7 +1177,8 @@
|
|||||||
OptionsHTML += '<option value="" selected>Select Base Policy</option>';
|
OptionsHTML += '<option value="" selected>Select Base Policy</option>';
|
||||||
$.each(res.data, function(index, item) {
|
$.each(res.data, function(index, item) {
|
||||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' + item.id +
|
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' + item.id +
|
||||||
'">' + item.name + '</option>';
|
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||||
|
|
||||||
});
|
});
|
||||||
$('#base_policy').html(OptionsHTML);
|
$('#base_policy').html(OptionsHTML);
|
||||||
},
|
},
|
||||||
@ -1176,6 +1247,8 @@
|
|||||||
// if (item.policy_type_id == 5) {
|
// if (item.policy_type_id == 5) {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
policeOptionHTML += '<option data-id="' + item.policy_type_id +
|
policeOptionHTML += '<option data-id="' + item.policy_type_id +
|
||||||
'" value="' + item.id + '" ' + (res.data.policy_id === item.id ?
|
'" value="' + item.id + '" ' + (res.data.policy_id === item.id ?
|
||||||
'selected="selected"' : '') + '>' + item.name + '</option>';
|
'selected="selected"' : '') + '>' + item.name + '</option>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user