CHANGE_CLIENT_MODULE_POLICY_PREMIUM_AND_RAC_RATE : AADHAVAN
This commit is contained in:
parent
536eaa4c6d
commit
9aeff5d360
@ -194,11 +194,28 @@ $routes->cli('processjob', 'JobWorker::processJob');
|
||||
|
||||
|
||||
// $routes->get("/api", "RestAuthenticationController::index");
|
||||
$routes->post("/api/verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber");
|
||||
$routes->post("/api/getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData");
|
||||
$routes->post("/employeeRest/verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber");
|
||||
$routes->post("/employeeRest/getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData");
|
||||
|
||||
$routes->group("/api", ["filter" => "authJWT"], function($routes){
|
||||
$routes->post("logined", "RestAuthenticationController::logined");
|
||||
$routes->post("getId", "RestAuthenticationController::getUserIdFromToken");
|
||||
});
|
||||
|
||||
|
||||
$routes->get("/getEmployeeProfile", "EmployeeRestController::getEmployeeProfile/$1");
|
||||
$routes->post("/editEmployeeProfile", "EmployeeRestController::editEmployeeProfile");
|
||||
|
||||
$routes->get("/getEmployeePolicy", "EmployeeRestController::getEmployeePolicy");
|
||||
$routes->post("/employeeUpload", "EmployeeRestController::employeeUpload");
|
||||
|
||||
|
||||
$routes->group("employeeRest", ["filter" => "authJWT"], function($routes){
|
||||
$routes->get("getEmployeeAndDependence", "EmployeeRestController::getEmployeeAndDependence");
|
||||
$routes->post("editEmployeeAndDependence", "EmployeeRestController::editEmployeeAndDependence");
|
||||
$routes->post("addEmployeeAndDependence", "EmployeeRestController::addEmployeeAndDependence");
|
||||
$routes->get("/relationshipList", "EmployeeRestController::relationshipList");
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
@ -592,18 +592,85 @@ class ClientController extends AdminController
|
||||
|
||||
public function createClientPolicyPremium()
|
||||
{
|
||||
// print_r($this->request->getPost());die();
|
||||
$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');
|
||||
$multiplier = $this->request->getPost('multiplier');
|
||||
$si_or_bp = $this->request->getPost('si_or_bp');
|
||||
$basic_multiplier = $this->request->getPost('basic_multiplier');
|
||||
$premium_multiplier =$this->request->getPost('premium_multiplier');
|
||||
$basic_pay = $this->request->getPost('basic_pay');
|
||||
|
||||
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);
|
||||
|
||||
$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');
|
||||
}
|
||||
|
||||
if(is_array($this->request->getPost('premium'))){
|
||||
$premium = isset($this->request->getPost('premium')[$i]) ? $this->request->getPost('premium')[$i] : null;
|
||||
}else{
|
||||
$premium = $this->request->getPost('premium');
|
||||
}
|
||||
// $basic_gpa_premium = isset($basic_gpa_premium[$i]) ? $basic_gpa_premium[$i] : null;
|
||||
if ($si !== null) {
|
||||
$data['si'] = $si;
|
||||
}
|
||||
if ($premium !== null) {
|
||||
$data['premium'] = $premium;
|
||||
}
|
||||
|
||||
if ($multiplier !== null) {
|
||||
$data['multiplier'] = $multiplier;
|
||||
}
|
||||
|
||||
if ($si_or_bp !== null) {
|
||||
$data['si_or_bp'] = $si_or_bp;
|
||||
}
|
||||
|
||||
if ($premium_multiplier !== null) {
|
||||
$data['multiplier'] = $premium_multiplier;
|
||||
}
|
||||
|
||||
if ($basic_multiplier !== null) {
|
||||
$data['basic_multiplier'] = $basic_multiplier;
|
||||
}
|
||||
|
||||
if ($basic_pay !== null) {
|
||||
$data['basic_pay'] = $basic_pay;
|
||||
}
|
||||
|
||||
$this->policyPremium1Model->insert($data);
|
||||
}
|
||||
$data = $this->request->getPost();
|
||||
$insert = true;
|
||||
|
||||
if($insert){
|
||||
return $this->respond(['status' => true,'code' => 200,'data' => $data], 200);
|
||||
}else{
|
||||
return $this->respond(['status' => false,'code' => 404, 'data' => $data,'message' => 'no data found'], 200);
|
||||
|
||||
}
|
||||
// print_r($data);
|
||||
// die();
|
||||
// $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();
|
||||
@ -752,9 +819,9 @@ class ClientController extends AdminController
|
||||
$search_term = 'GPA';
|
||||
}
|
||||
$results = $this->policyGridModel->like('policy_type', $search_term)->findAll();
|
||||
|
||||
if($search_term === 'GPA'){
|
||||
$premiumData = $this->policyPremium1Model->where(['client_id' => $record['client_id'], 'client_policy_id' => $client_policy_id, 'is_active' => 1])->findAll();
|
||||
|
||||
}else{
|
||||
$premiumData = $this->policyPremium2Model->where(['client_id' => $record['client_id'], 'client_policy_id' => $client_policy_id, 'is_active' => 1])->findAll();
|
||||
}
|
||||
@ -763,6 +830,8 @@ class ClientController extends AdminController
|
||||
// echo '<pre>';
|
||||
// print_r($results);
|
||||
// print_r($data[0]->policy_type); die;
|
||||
// echo "hello";
|
||||
// print_r($premiumData);
|
||||
return $this->respond(['status' => true,'code' => 200,'data' => $results, 'premiumData' => $premiumData, 'count' => $emp_count, 'policy_name' => $policy_name], 200);
|
||||
|
||||
}
|
||||
@ -887,8 +956,7 @@ class ClientController extends AdminController
|
||||
}
|
||||
|
||||
public function policyGPATerms()
|
||||
{
|
||||
|
||||
{
|
||||
try {
|
||||
$this->myLogger->logme('error','Policy GPA Terms CREATE function called');
|
||||
|
||||
|
||||
284
app/Controllers/EmployeeRestController.php
Normal file
284
app/Controllers/EmployeeRestController.php
Normal file
@ -0,0 +1,284 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use CodeIgniter\HTTP\IncomingRequest;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
|
||||
use App\Models\EmployeeModel;
|
||||
use App\Models\EmployeePolicyModel;
|
||||
use App\Models\ClientModel;
|
||||
use App\Models\PolicesModel;
|
||||
use App\Models\RelationshipModel;
|
||||
|
||||
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
|
||||
class EmployeeRestController extends AdminController
|
||||
{
|
||||
|
||||
use ResponseTrait;
|
||||
|
||||
protected $myLogger;
|
||||
protected $employeeModel;
|
||||
protected $employeePolicyModel;
|
||||
protected $clientModel;
|
||||
protected $fileModel;
|
||||
protected $policesModel;
|
||||
protected $relationshipModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
// helper('utility');
|
||||
set_session_context('Employee');
|
||||
$this->myLogger = \Config\Services::mylogger();
|
||||
$this->employeeModel = new EmployeeModel();
|
||||
$this->employeePolicyModel = new EmployeePolicyModel();
|
||||
$this->clientModel = new ClientModel();
|
||||
$this->policesModel = new PolicesModel();
|
||||
$this->relationshipModel = new RelationshipModel();
|
||||
}
|
||||
|
||||
|
||||
public function getEmployeeProfile()
|
||||
{
|
||||
try {
|
||||
$emp_code = $this->request->getGet('emp_code');
|
||||
if ($emp_code) {
|
||||
$relationship = 'self';
|
||||
$employee = $this->employeeModel->where('emp_code', $emp_code)
|
||||
->where('relationship', $relationship)
|
||||
->first();
|
||||
$result = $employee;
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
} else {
|
||||
$result = "No Match's";
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editEmployeeProfile()
|
||||
{
|
||||
try {
|
||||
$data = $this->request->getJSON();
|
||||
if ($data) {
|
||||
$id = $data->id;
|
||||
$employee = $this->employeeModel->update($id, $data);
|
||||
|
||||
if ($employee) {
|
||||
$result = [];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
} else {
|
||||
$result = "No Match's";
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getEmployeeAndDependence()
|
||||
{
|
||||
try {
|
||||
$emp_code = $this->request->getGet('emp_code');
|
||||
if ($emp_code) {
|
||||
$employee = $this->employeeModel->where('emp_code', $emp_code)
|
||||
->findAll();
|
||||
|
||||
$result = $employee;
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
} else {
|
||||
$result = "No Match's";
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function editEmployeeAndDependence()
|
||||
{
|
||||
try {
|
||||
$data = $this->request->getJSON();
|
||||
if ($data) {
|
||||
$updatedCount = 0;
|
||||
foreach ($data as $item) {
|
||||
$id = $item->id;
|
||||
$employee = $this->employeeModel->update($id, (array)$item);
|
||||
if ($employee) {
|
||||
$updatedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($updatedCount > 0) {
|
||||
$result = [];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result], 200);
|
||||
} else {
|
||||
$result = "No Matches";
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result], 404);
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $th], 500);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function addEmployeeAndDependence()
|
||||
{
|
||||
try {
|
||||
$data = $this->request->getJSON();
|
||||
|
||||
|
||||
if ($data) {
|
||||
$updatedCount = 0;
|
||||
foreach ($data as $item) {
|
||||
$extractData['name'] = $item->name;
|
||||
$extractData['emp_code']= $item->emp_code;
|
||||
$extractData['email_corporate']=$item->email_corporate;
|
||||
$extractData['relationship_code']=$item->relationship_code;
|
||||
$extractData['mobile']=$item->mobile;
|
||||
$extractData['gender']=$item->gender;
|
||||
$extractData['dob']=$item->dob;
|
||||
$extractData['client_id']=$item->client_id;
|
||||
// print_r($extractData);die();
|
||||
$employee = $this->employeeModel->insert($extractData);
|
||||
if ($employee) {
|
||||
$updatedCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($updatedCount > 0) {
|
||||
$result = [];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result], 200);
|
||||
} else {
|
||||
$result = "No Matches";
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result], 404);
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getEmployeePolicy()
|
||||
{
|
||||
$id= 1;
|
||||
try {
|
||||
$keysToRemove = ["sum_insured","family_floater","corporatebuffer","family_floaters"];
|
||||
|
||||
$empPolicy = $this->employeeModel->getEmployeePolicy($id);
|
||||
if ($empPolicy) {
|
||||
|
||||
$result = [];
|
||||
foreach ($empPolicy as $array) {
|
||||
$decodedArray = json_decode($array->Policy_Terms);
|
||||
$refusingData = (object) array_diff_key((array) $decodedArray, array_flip($keysToRemove));
|
||||
|
||||
// $client_id =$array->ClientId;
|
||||
// $policy_id =$array->PolicyId;
|
||||
|
||||
// $rackRate = $this->policesModel->getPolicySlabRatesForEmpOnboard($policy_id, $client_id);
|
||||
|
||||
// $array->Policy_Terms = json_encode($refusingData);
|
||||
$array->Policy_Terms = $refusingData;
|
||||
|
||||
$result[] = $array;
|
||||
}
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result], 200);
|
||||
}else{
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => []], 404);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function relationshipList()
|
||||
{
|
||||
try {
|
||||
|
||||
$relation_ships= $this->relationshipModel->findAll();
|
||||
|
||||
if(count($relation_ships) > 0){
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $relation_ships], 200);
|
||||
}else{
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => "No Data..!"], 200);
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function employeeUpload()
|
||||
{
|
||||
if ($this->request->getFile('file')) {
|
||||
// Load PHPExcel library
|
||||
require_once APPPATH . 'third_party/PHPExcel/PHPExcel.php';
|
||||
|
||||
// Load the uploaded file
|
||||
$file = $this->request->getFile('file');
|
||||
|
||||
// Load file into PHPExcel
|
||||
$inputFileType = PHPExcel_IOFactory::identify($file->getPathname());
|
||||
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
|
||||
$objPHPExcel = $objReader->load($file->getPathname());
|
||||
|
||||
// Get the active sheet
|
||||
$sheet = $objPHPExcel->getActiveSheet();
|
||||
|
||||
// Get the highest row number
|
||||
$highestRow = $sheet->getHighestRow();
|
||||
|
||||
// Assuming your data starts from the second row (after headers)
|
||||
for ($row = 2; $row <= $highestRow; $row++) {
|
||||
// Get cell values
|
||||
$name = $sheet->getCellByColumnAndRow(0, $row)->getValue();
|
||||
$email = $sheet->getCellByColumnAndRow(1, $row)->getValue();
|
||||
// Assuming you have more columns, adjust indexes accordingly
|
||||
|
||||
// Store data into database (Example using CodeIgniter's database methods)
|
||||
$data = array(
|
||||
'name' => $name,
|
||||
'email' => $email,
|
||||
// Add more fields as necessary
|
||||
);
|
||||
// Insert data into the database table
|
||||
$this->db->insert('employees', $data);
|
||||
}
|
||||
|
||||
// Optionally, you can delete the uploaded file after processing
|
||||
unlink($file->getPathname());
|
||||
|
||||
// Optionally, you can redirect the user to a success page
|
||||
redirect('employee/success');
|
||||
} else {
|
||||
// Handle case when no file was uploaded
|
||||
echo 'No file uploaded!';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -46,7 +46,8 @@ class LoginController extends BaseController
|
||||
set_session_data($session_data);
|
||||
log_message('error', 'Set The UserId : `'. $user->id .'` in Session');
|
||||
log_message('error', 'Is User Login Sucessfully');
|
||||
$this->getUserDeviceInfo($user->id);
|
||||
|
||||
// $this->getUserDeviceInfo($user->id);
|
||||
return redirect()->to(base_url('/dashboard/view'));
|
||||
|
||||
}else{
|
||||
@ -79,7 +80,7 @@ class LoginController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
public function getUserDeviceInfo($userId){
|
||||
public function getUserDeviceInfo($userId, $type_of_user){
|
||||
|
||||
// Load the UserAgent library
|
||||
$userAgent = $this->request->getUserAgent();
|
||||
@ -93,16 +94,19 @@ class LoginController extends BaseController
|
||||
// Get the user's IP address
|
||||
$ipAddress = $this->request->getIPAddress();
|
||||
|
||||
|
||||
$datd = [
|
||||
'user_id' => $userId,
|
||||
'user_id' => $userId,
|
||||
'user_type' => $type_of_user,
|
||||
'ip' => $ipAddress,
|
||||
'platform' => $platform,
|
||||
'broswer' => $browser,
|
||||
];
|
||||
|
||||
// print_r($datd);
|
||||
// die();
|
||||
$AuthHistoryModel = new AuthHistoryModel;
|
||||
$insertAuthHistory = $AuthHistoryModel->insert($datd);
|
||||
|
||||
return $datd;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -4,8 +4,12 @@
|
||||
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Controllers\LoginController;
|
||||
use App\Helpers\DepositHelper;
|
||||
use App\Helpers\JWTToken;
|
||||
use App\Helpers\HttpRequestHelper;
|
||||
|
||||
use CodeIgniter\HTTP\IncomingRequest;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
@ -15,7 +19,7 @@ use CodeIgniter\API\ResponseTrait;
|
||||
|
||||
|
||||
use App\Models\EmployeeModel;
|
||||
|
||||
use App\Models\AuthHistoryModel;
|
||||
|
||||
use Firebase\JWT\JWT;
|
||||
// require_once('../vendor/autoload.php');
|
||||
@ -28,6 +32,7 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
protected $myLogger;
|
||||
protected $employeeModel;
|
||||
protected $authHistoryModel;
|
||||
|
||||
|
||||
public function __construct()
|
||||
@ -36,6 +41,7 @@ class RestAuthenticationController extends AdminController
|
||||
$this->myLogger = \Config\Services::mylogger();
|
||||
|
||||
$this->employeeModel = new EmployeeModel();
|
||||
$this->authHistoryModel = new AuthHistoryModel();
|
||||
|
||||
}
|
||||
|
||||
@ -60,17 +66,22 @@ class RestAuthenticationController extends AdminController
|
||||
{
|
||||
try {
|
||||
$mobile_number = $this->request->getJSON()->mobile_number;
|
||||
|
||||
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->first();
|
||||
$randomNumber = rand(100000, 999999);
|
||||
|
||||
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first();
|
||||
|
||||
if ($employeeData) {
|
||||
$result = ['user_verification' => true];
|
||||
return ['status' => 'success','code' => 200,'data' => $result];
|
||||
$id= $employeeData["id"];
|
||||
$otp = $this->employeeModel->where('id', $id)->set('otp', $randomNumber)->update();
|
||||
$result = ['user_verification' => true , 'otp'=>$randomNumber];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
} else {
|
||||
$result = ['user_verification' => false];
|
||||
return ['status' => 'failed','code' => 404,'data' => $result];
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
return ['status' => 'failed','code' => 505,'data' => $th];
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,16 +90,34 @@ class RestAuthenticationController extends AdminController
|
||||
{
|
||||
try {
|
||||
$mobile_number = $this->request->getJSON()->mobile_number;
|
||||
$otp = $this->request->getJSON()->otp;
|
||||
|
||||
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->first();
|
||||
if ($employeeData) {
|
||||
if ($employeeData && $otp == $employeeData["otp"]) {
|
||||
$auth = HttpRequestHelper::getRequestInfo();
|
||||
if ($auth) {
|
||||
$data = [
|
||||
'user_id' => $employeeData['id'],
|
||||
'user_type' => 'employee',
|
||||
'ip' => $auth['ip'],
|
||||
'platform' => $auth['platform'],
|
||||
'broswer' => $auth['browser'],
|
||||
];
|
||||
|
||||
$authdata= $this->authHistoryModel->insert($data);
|
||||
|
||||
}
|
||||
$otp_null = $this->employeeModel->where('id', $employeeData["id"])->set('otp', null)->update();
|
||||
|
||||
|
||||
|
||||
$result = JWTToken::encode($employeeData);
|
||||
return ['status' => 'success','code' => 200,'data' => $result];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
} else {
|
||||
return ['status' => 'failed','code' => 404,'data' => "No data"];
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => "No data"],404);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
return ['status' => 'failed','code' => 500,'data' => $th];
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ class AuthHistoryModel extends Model
|
||||
protected $allowedFields = [
|
||||
"id",
|
||||
"user_id",
|
||||
"user_type",
|
||||
"ip",
|
||||
"platform",
|
||||
"broswer",
|
||||
|
||||
@ -32,6 +32,7 @@ class ClientPolicyModel extends Model
|
||||
"earned_premium_amount",
|
||||
"claims_incurred_amount",
|
||||
"policy_terms",
|
||||
"open_for_enrollment",
|
||||
"created_by",
|
||||
"updated_by",
|
||||
"Is_active",
|
||||
@ -226,5 +227,4 @@ public function getDepositlistsummary($id)
|
||||
->getResult();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -10,9 +10,11 @@ class EmployeeModel extends Model
|
||||
protected $primaryKey = 'id';
|
||||
protected $allowedFields = [
|
||||
"id",
|
||||
"client_id",
|
||||
"employee_id",
|
||||
"change_event",
|
||||
"relationship_id",
|
||||
"relationship",
|
||||
"batch_id",
|
||||
"emp_code",
|
||||
"name",
|
||||
@ -21,9 +23,24 @@ class EmployeeModel extends Model
|
||||
"mobile",
|
||||
"gender",
|
||||
"dob",
|
||||
"otp",
|
||||
"emp_status",
|
||||
"created_by",
|
||||
"updated_by",
|
||||
"is_active",
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getEmployeePolicy($id)
|
||||
{
|
||||
|
||||
return $this->db->table('employee_polices')
|
||||
->select(' policies.name as Policy_Name , client_policy.policy_terms as Policy_Terms, client_policy.client_id as ClientId, client_policy.policy_id as PolicyId, client_policy.open_for_enrollment as OpenForEnrollment') // Select all columns from both tables
|
||||
->join('client_policy', 'client_policy.id = employee_polices.client_policy_id')
|
||||
->join('policies', 'policies.id = client_policy.policy_id')
|
||||
->where('employee_polices.employee_id', $id)
|
||||
->get()
|
||||
->getResult();
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,4 +28,24 @@ class PolicesModel extends Model
|
||||
->get()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getPolicySlabRatesForEmpOnboard($policy_id,$client_id)
|
||||
{
|
||||
|
||||
$premium_slab_data = null;
|
||||
$policyPremium1Model = new policyPremium1Model();
|
||||
|
||||
$premium_slab_data = $policyPremium1Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
|
||||
if((isset($premium_slab_data)))
|
||||
{
|
||||
$policyPremium2Model = new policyPremium2Model();
|
||||
$premium_slab_data = $policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
|
||||
}
|
||||
$grid_id = $premium_slab_data[0]['policy_grid_id'];
|
||||
$policyGridModel = new policyGridModel();
|
||||
$results = $policyGridModel->find($grid_id);
|
||||
return ['slab_rates' => $premium_slab_data,'grid_master' => $results];
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,10 @@ class PolicyPremium1Model extends Model
|
||||
'client_policy_id',
|
||||
'policy_grid_id',
|
||||
'si',
|
||||
'si_or_bp',
|
||||
'basic_multiplier',
|
||||
'premium_multiplier',
|
||||
'basic_pay',
|
||||
'premium',
|
||||
'multiplier',
|
||||
"created_by",
|
||||
|
||||
23
app/Models/RelationshipModel.php
Normal file
23
app/Models/RelationshipModel.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class RelationshipModel extends Model
|
||||
{
|
||||
protected $table = 'relationships';
|
||||
protected $primaryKey = 'id';
|
||||
protected $allowedFields = [
|
||||
"id",
|
||||
"insurer_id",
|
||||
"relationship_name",
|
||||
"dependent",
|
||||
"is_multiple",
|
||||
"created_by",
|
||||
"created_at",
|
||||
"updated_by",
|
||||
"updated_at",
|
||||
"is_active",];
|
||||
|
||||
}
|
||||
@ -282,6 +282,11 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -293,6 +298,9 @@ $(document).ready(function () {
|
||||
|
||||
console.log(branch_form_action);
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
var branch_id = $(this).attr('data-id');
|
||||
branch_form_action = '<?= base_url("client/branch/edit"); ?>';
|
||||
$.ajax({
|
||||
@ -301,6 +309,10 @@ $(document).ready(function () {
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res)
|
||||
$('#add_branch').show();
|
||||
$('#branch_table').hide();
|
||||
@ -329,6 +341,11 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
console.log(branch_form_action);
|
||||
|
||||
@ -144,6 +144,9 @@
|
||||
return;
|
||||
}
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
$.ajax({
|
||||
url: '<?= base_url("client/kyc/create"); ?>',
|
||||
type: 'POST',
|
||||
@ -151,6 +154,10 @@
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
// res = JSON.parse(res)
|
||||
// console.log(res);
|
||||
form.trigger('reset')
|
||||
@ -166,12 +173,20 @@
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if(kycPrimaryKey !== ''){
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: '<?= base_url("client/kyc/list/"); ?>' + '<?= isset($client['entity_type_id']) ? $client['entity_type_id'] : '' ?>',
|
||||
type: "GET",
|
||||
@ -179,6 +194,10 @@
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
var tbody = $('#tbody');
|
||||
tbody.empty();
|
||||
@ -200,6 +219,12 @@
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
@ -263,6 +288,9 @@
|
||||
}
|
||||
var formData = new FormData($('#kyc_form')[0]);
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: '<?= base_url("client/kyc/create"); ?>',
|
||||
@ -272,6 +300,10 @@
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
$('#kyc_form').trigger('reset')
|
||||
var message = (kycPrimaryKey === '') ? 'KYC Docs Uploaded successfully' : 'KYC Docs Uploaded successfully';
|
||||
@ -296,6 +328,12 @@
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -330,7 +330,7 @@
|
||||
|
||||
$.get(url, function(res) {
|
||||
// res = JSON.parse(res)//
|
||||
console.log(res)
|
||||
// console.log(res)
|
||||
var OptionsHTML = '';
|
||||
OptionsHTML += '<option value="" selected>Select Policy</option>';
|
||||
$.each(res.data, function(index, item) {
|
||||
@ -348,7 +348,7 @@
|
||||
$('#policy').change(function(){
|
||||
|
||||
var dataId = $(this).children('option:selected').attr('data-id');
|
||||
console.log('dataId', dataId)
|
||||
// console.log('dataId', dataId)
|
||||
$('#policy_type_id').val(dataId);
|
||||
|
||||
// if(dataId == 1){
|
||||
@ -366,15 +366,20 @@
|
||||
// var policy_id = $(this).data('id');
|
||||
// console.log('1', policy_id)
|
||||
var policy_id = $(this).attr('data-id');
|
||||
console.log('2', policy_id)
|
||||
// console.log('2', policy_id)
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: '<?= base_url("client/policy/list/") ?>' + policy_id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
|
||||
console.log('clientPolicy : ', res);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
// console.log('clientPolicy : ', res);
|
||||
$('#policy_form_action').val('<?= base_url("client/policy/edit"); ?>');
|
||||
|
||||
if (res.status === false) {
|
||||
@ -409,7 +414,7 @@
|
||||
|
||||
var policeOptionHTML = '';
|
||||
$.each(res.policy, function(index, item) {
|
||||
console.log(item)
|
||||
// console.log(item)
|
||||
policeOptionHTML += '<option data-id="' + item.policy_type_id + '" value="' + item.id + '" ' + (res.data.policy_id === item.id ? 'selected="selected"' : '') + '>' + item.name + '</option>';
|
||||
});
|
||||
$('#policy').html(policeOptionHTML);
|
||||
@ -417,6 +422,11 @@
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -428,7 +438,7 @@
|
||||
var client_id = $('#client_id_policy').val()
|
||||
|
||||
|
||||
console.log('client_policy_id', client_policy_id);
|
||||
// console.log('client_policy_id', client_policy_id);
|
||||
|
||||
if(client_policy_id){
|
||||
$('.loader').fadeIn();
|
||||
@ -442,7 +452,7 @@
|
||||
client_policy_id : client_policy_id,
|
||||
},
|
||||
success: function(res) {
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
if(res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
@ -694,6 +704,7 @@
|
||||
}
|
||||
|
||||
function convertCommaNumberToWords(input) {
|
||||
// console.log(input);
|
||||
const number = parseInt(input.replace(/,/g, ''), 10);
|
||||
return convertNumberToWords(number);
|
||||
}
|
||||
@ -706,11 +717,23 @@
|
||||
}
|
||||
|
||||
|
||||
function formatNumber(input) {
|
||||
var value = input.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
input.value = value;
|
||||
}
|
||||
function formatNumber(input, maxLength) {
|
||||
maxLength=16;
|
||||
let value = input.value.replace(/\D/g, ''); // Remove non-numeric characters
|
||||
|
||||
// Limit the number of digits
|
||||
value = value.slice(0, maxLength);
|
||||
|
||||
// Format the number with commas using Indian numbering system
|
||||
value = Number(value).toLocaleString('en-IN');
|
||||
input.value = value;
|
||||
|
||||
basicPayMultiple(input)
|
||||
if (input.id == 'gpa_si') {
|
||||
gpaSumInsureMultiplier();
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -151,6 +151,11 @@ $(document).ready(function(){
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -79,6 +79,10 @@ $(document).ready(function () {
|
||||
|
||||
var formData = new FormData($('#insurer_general_form')[0]);
|
||||
var OptionsHTML1 = ''
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: form_action,
|
||||
@ -87,7 +91,10 @@ $(document).ready(function () {
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
$('#insurer_id').val(res.data.id);
|
||||
$('#insurer_id_branch').val(res.data.id);
|
||||
@ -108,6 +115,12 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -222,6 +222,8 @@ $(document).ready(function () {
|
||||
|
||||
var formData = new FormData($('#insurer_branch_form')[0]);
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: insurer_branch_form_action,
|
||||
@ -230,6 +232,10 @@ $(document).ready(function () {
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
// $('#insurer_branch_list tr').remove();
|
||||
var insurerBranchTableInsert = ''
|
||||
@ -254,6 +260,12 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
@ -266,12 +278,19 @@ $(document).ready(function () {
|
||||
contactCount =1;
|
||||
var branch_id = $(this).attr('data-id');
|
||||
insurer_branch_form_action = '<?= base_url("master/insurer/branch/edit"); ?>';
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('master/insurer/branch/editget/');?>'+branch_id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
$('#add_branch').show();
|
||||
$('#branch_table').hide();
|
||||
$('.btnBack').show();
|
||||
@ -300,6 +319,12 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -317,10 +342,17 @@ $(document).ready(function () {
|
||||
|
||||
var insurer_branch_action = base_url + insurer_Branch_PrimaryKey;
|
||||
if ($('#insurer_id_branch').val() != '') {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: insurer_branch_action,
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
var branchTable = '';
|
||||
$.each(response.insuer_branch, function(index, item) {
|
||||
branchTable += `
|
||||
@ -336,6 +368,12 @@ $(document).ready(function () {
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -155,6 +155,8 @@ $(document).ready(function () {
|
||||
|
||||
var formData = new FormData($('#kyc_docs_form')[0]);
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: kyc_docs_form_action,
|
||||
@ -163,6 +165,10 @@ $(document).ready(function () {
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
$('#insurer_branch_list tr').remove();
|
||||
var insurerBranchTableInsert = ''
|
||||
@ -183,6 +189,12 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -191,11 +203,17 @@ $(document).ready(function () {
|
||||
$('body').on('click', '.btnBranchEdit', function () {
|
||||
var branch_id = $(this).attr('data-id');
|
||||
kyc_docs_form_action = '<?= base_url("master/kyc/kycdocs/edit"); ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('master/kyc/kycdocs/editget/');?>'+branch_id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log("right.........");
|
||||
$('#add_branch').show();
|
||||
$('#branch_table').hide();
|
||||
@ -211,6 +229,12 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -228,6 +252,8 @@ $(document).ready(function () {
|
||||
var kyc_docs_action = base_url + kyc_Docs_PrimaryKey;
|
||||
console.log(kyc_docs_action);
|
||||
if (kyc_Docs_PrimaryKey != '') {
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: kyc_docs_action,
|
||||
type: "GET",
|
||||
@ -235,6 +261,10 @@ $(document).ready(function () {
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
var insurerBranchTableInsert = '';
|
||||
$.each(res.kyc_docs, function(index, item) {
|
||||
insurerBranchTableInsert += `
|
||||
@ -249,6 +279,12 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -54,7 +54,9 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
var formData = new FormData($('#kyc_general_form')[0]);
|
||||
var OptionsHTML1 = ''
|
||||
var OptionsHTML1 = '';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: form_action,
|
||||
@ -63,6 +65,10 @@ $(document).ready(function () {
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
$('#kyc_type_id').val(res.data.PrimaryKey);
|
||||
$('#kyc_id_docs').val(res.data.PrimaryKey);
|
||||
@ -73,6 +79,12 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -200,6 +200,22 @@
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.text-danger-2 {
|
||||
font-style: italic;
|
||||
color: black !important;
|
||||
/* color: #02a8b5 !important; */
|
||||
font-size: 12px;
|
||||
}
|
||||
.form-group {
|
||||
/* margin-bottom: -0.2rem !important; */
|
||||
}
|
||||
.form-row{
|
||||
/* width: 84%; */
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
||||
@ -204,6 +204,8 @@ $(document).ready(function () {
|
||||
if (isValid) {
|
||||
|
||||
var formData = new FormData($('#tpa_branch_form')[0]);
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: tpa_branch_form_action,
|
||||
@ -212,6 +214,10 @@ $(document).ready(function () {
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
// console.log(res);
|
||||
// $('#policies_list tr').remove();s
|
||||
var tpaBranchTableInsert = ''
|
||||
@ -235,6 +241,12 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -243,11 +255,19 @@ $(document).ready(function () {
|
||||
$('body').on('click', '.btnBranchEdit', function () {
|
||||
var branch_id = $(this).attr('data-id');
|
||||
tpa_branch_form_action = '<?= base_url("master/policy/policies/edit"); ?>';
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('master/policy/policies/editget/');?>'+branch_id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
$('#add_branch').show();
|
||||
$('#branch_table').hide();
|
||||
$('.btnBack').show();
|
||||
@ -271,6 +291,11 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -303,10 +328,16 @@ $(document).ready(function () {
|
||||
|
||||
if ($('#policy_type_id').val() != '') {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: insurer_branch_action,
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
var branchTable = '';
|
||||
$.each(response.policies, function(index, item) {
|
||||
console.log(item);
|
||||
@ -323,6 +354,12 @@ $(document).ready(function () {
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -90,12 +90,12 @@
|
||||
<label for="sumInsured">Sum Insured</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="sum_insured" id="sum_insured" class="form-control" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)">
|
||||
<input type="text" name="sum_insured" id="sum_insured" class="form-control" onkeypress = "return onlyNumbers(event)" onkeyup=" formatNumber(this)">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div id='numberToWordGMC' class="text-danger" ></div>
|
||||
<div id='numberToWordGMC' class="text-danger-2" ></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -597,6 +597,12 @@ var grid_html = '';
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
@ -631,13 +637,18 @@ var grid_html = '';
|
||||
$('.nav.nav-pills.navtab-bg').css('display','none');
|
||||
$('.nav.nav-pills.navtab-bg').prev().css('display','none');
|
||||
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: '<?= base_url("client/policy/getterms") ?>',
|
||||
method: 'GET',
|
||||
data: {client_policy_id: client_policy_id},
|
||||
success: function(response) {
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(response);
|
||||
$('#nameOfThePolicyInGMC').html(' - ' + response.policy_name.name);
|
||||
$('gmc_emp_count').val(response.count);
|
||||
|
||||
@ -732,16 +743,21 @@ var grid_html = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#sum_insured").trigger("keyup");
|
||||
|
||||
$('.jodit-wysiwyg').each(function() {
|
||||
$(this).click();
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Error:', status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
@ -753,6 +769,7 @@ var grid_html = '';
|
||||
var inputNumber = $(this).val();
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
|
||||
$("#numberToWordGMC").text(result);
|
||||
} else {
|
||||
$("#numberToWordGMC").text("");
|
||||
|
||||
@ -96,7 +96,7 @@
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div id='numberToWordSumInsured' class="text-danger" ></div>
|
||||
<div id='numberToWordSumInsured' class="text-danger-2" ></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -110,7 +110,7 @@
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div id='numberToWordTotalSumInsured' class="text-danger" ></div>
|
||||
<div id='numberToWordTotalSumInsured' class="text-danger-2" ></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
@ -433,7 +433,7 @@
|
||||
$('.nav.nav-pills.navtab-bg').css('display','');
|
||||
$('.nav.nav-pills.navtab-bg').prev().css('display','');
|
||||
var message = 'Policy Terms Updated successfully';
|
||||
toastr.success(message, 'Success');
|
||||
toastr.success('message', 'Success');
|
||||
}, 1000);
|
||||
|
||||
});
|
||||
@ -457,6 +457,9 @@
|
||||
$('.nav.nav-pills.navtab-bg').prev().css('display','none');
|
||||
$('.removeDom').remove()
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
$.ajax({
|
||||
url: '<?= base_url("client/policy/getterms") ?>',
|
||||
method: 'GET',
|
||||
@ -527,11 +530,23 @@
|
||||
});
|
||||
|
||||
}
|
||||
$("#sumInsured2").trigger("keyup");
|
||||
$("#totalSumInsured").trigger("keyup");
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -71,7 +71,9 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
var formData = new FormData($('#policytype_general_form')[0]);
|
||||
var OptionsHTML1 = ''
|
||||
var OptionsHTML1 = '';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: form_action,
|
||||
@ -80,6 +82,10 @@ $(document).ready(function () {
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
|
||||
$('#policy_type_id').val(res.data.PrimaryKey);
|
||||
$('#policy_id_type').click();
|
||||
@ -90,6 +96,12 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -56,7 +56,9 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
var formData = new FormData($('#tpa_general_form')[0]);
|
||||
var OptionsHTML1 = ''
|
||||
var OptionsHTML1 = '';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: form_action,
|
||||
@ -65,6 +67,10 @@ $(document).ready(function () {
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
|
||||
console.log(res);
|
||||
$('#tpa_id').val(res.data.id);
|
||||
@ -86,6 +92,11 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -231,6 +231,10 @@ $(document).ready(function () {
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
$('#tpa_branch_list tr').remove();
|
||||
var tpaBranchTableInsert = ''
|
||||
@ -253,6 +257,11 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -263,11 +272,17 @@ $(document).ready(function () {
|
||||
contactCount =1;
|
||||
var branch_id = $(this).attr('data-id');
|
||||
tpa_branch_form_action = '<?= base_url("master/tpa/branch/edit"); ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('master/tpa/branch/editget/');?>'+branch_id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log("tpa.............");
|
||||
console.log(res)
|
||||
$('#add_branch').show();
|
||||
@ -297,6 +312,12 @@ $(document).ready(function () {
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -310,10 +331,16 @@ $(document).ready(function () {
|
||||
|
||||
var tpa_branch_action = base_url + tpa_Branch_PrimaryKey;
|
||||
if ($('#tpa_id_branch').val() != '') {
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: tpa_branch_action,
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
var branchTable = '';
|
||||
$.each(response.tpa_branch, function(index, item) {
|
||||
branchTable += `
|
||||
@ -329,6 +356,11 @@ $(document).ready(function () {
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user