MERGE_UAT_CDMAS2CDTRAN_DATE_ISSUE
This commit is contained in:
commit
ec995dc0aa
@ -10,7 +10,17 @@ use CodeIgniter\Router\RouteCollection;
|
||||
$routes->get('/swagger', 'SwaggerController::index', ['filter' => 'authMVC']);
|
||||
|
||||
// Reminder Mail Notification
|
||||
|
||||
$routes->get("reminder_mail", "NotificationController::reminder_mail");
|
||||
$routes->get("testing", "ClientController::Testing");
|
||||
$routes->get("update-policy-terms-for-corrections", "ClientController::updatePolicyTermsForCorrections");
|
||||
|
||||
|
||||
$routes->post("add_advertise_image", "AppContentManagementController::add_advertise_image");
|
||||
$routes->get("add_image_index", "AppContentManagementController::add_image_index");
|
||||
$routes->get("getAdvertiseImage/(:any)", "AppContentManagementController::getAdvertiseImage/$1");
|
||||
$routes->get("frontend_content", "AppContentManagementController::frontend_content");
|
||||
|
||||
|
||||
// $routes->get('/', 'LoginController::index');
|
||||
$routes->get('/test', 'Home::index');
|
||||
@ -249,6 +259,7 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->get("getPolicyTerms/(:any)", "ClientController::getPolicyTerms/$1");
|
||||
$routes->get("getPolicyTermsFormJson/(:any)", "ClientController::getPolicyTermsFormJson/$1");
|
||||
$routes->get("checkHRNumber/(:any)", "ClientController::checkHRNumber/$1");
|
||||
$routes->get("check_addition_premium_JSON/(:any)", "ClientController::checkAdditionPremiumJSON/$1");
|
||||
});
|
||||
|
||||
$routes->cli('cli/processjob', 'JobWorker::processJob');
|
||||
@ -271,7 +282,8 @@ $routes->group("/api", ["filter" => "authJWT"], function ($routes) {
|
||||
|
||||
|
||||
|
||||
|
||||
$routes->get("getEmployeePolicy", "EmployeeRestController::getEmployeePolicy");
|
||||
$routes->get("getAddOnPolicy", "EmployeeRestController::getAddOnPolicy");
|
||||
$routes->get("getChatResponse", "ChatBotController::getChatResponse");
|
||||
$routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
|
||||
$routes->get("getChatResponse", "ChatBotController::getChatResponse");
|
||||
|
||||
96
app/Controllers/AppContentManagementController.php
Normal file
96
app/Controllers/AppContentManagementController.php
Normal file
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
// declare(strict_types=1);
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
|
||||
use App\Models\AddImgModel;
|
||||
use App\Models\FEContentModel;
|
||||
|
||||
class AppContentManagementController extends AdminController
|
||||
{
|
||||
use ResponseTrait;
|
||||
protected $myLogger;
|
||||
protected $addImgModel;
|
||||
protected $feContentModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->myLogger = \Config\Services::mylogger();
|
||||
$this->addImgModel = new AddImgModel();
|
||||
$this->feContentModel = new FEContentModel();
|
||||
}
|
||||
public function add_image_index()
|
||||
{
|
||||
$this->myLogger->logme('error','Addvertisement Image list function called');
|
||||
$headerData['page_name'] = 'Addvertisement Image List';
|
||||
$data['addImageList'] = $this->addImgModel->findAll();
|
||||
|
||||
// dd($data);
|
||||
|
||||
echo view('layout/header', $headerData);
|
||||
echo view('add_image_list', $data);
|
||||
echo view('layout/footer');
|
||||
|
||||
// $this->loadLayout('client_onboarding', $data);
|
||||
}
|
||||
|
||||
public function add_advertise_image(){
|
||||
|
||||
// print_r($this->request->getPost());die;
|
||||
$uploadFilePath = ROOTPATH . 'public/uploads/advertiseImage/';
|
||||
$file_name = file_Upload($this->request->getFile('advertise_image'), $uploadFilePath);
|
||||
$data['id'] = $this->request->getPost('add_image_id');
|
||||
// $data['created_by'] = get_session_userid();
|
||||
$data['name'] = $file_name;
|
||||
|
||||
if($data['id'] == 0){
|
||||
$insert = $this->addImgModel->insert($data);
|
||||
if($insert){
|
||||
return $this->respond(['status' => true,'code' => 200,'data' => "success"], 200);
|
||||
|
||||
}else{
|
||||
return $this->respond(['status' => false,'code' => 404,'message' => 'no data found'], 200);
|
||||
|
||||
}
|
||||
}else{
|
||||
$id = $data['id'];
|
||||
$update = $this->addImgModel->update($id,$data);
|
||||
if($update){
|
||||
return $this->respond(['status' => true,'code' => 200,'data' => "success"], 200);
|
||||
|
||||
}else{
|
||||
return $this->respond(['status' => false,'code' => 404,'message' => 'no data found'], 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getAdvertiseImage($image_id){
|
||||
|
||||
$image_data = $this->addImgModel->select('name')->where(['id' => $image_id])->first();
|
||||
|
||||
if($image_data){
|
||||
return $image_data['name'];
|
||||
}else{
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Front End Content Area
|
||||
public function frontend_content(){
|
||||
|
||||
$data['test'] = $this->feContentModel->findAll();
|
||||
$headerData['page_name'] = 'Front-End Content';
|
||||
|
||||
echo view('layout/header', $headerData);
|
||||
echo view('frontend_content_list', $data);
|
||||
echo view('layout/footer');
|
||||
}
|
||||
|
||||
}
|
||||
@ -76,28 +76,115 @@ class ChatBotController extends AdminController
|
||||
// try {
|
||||
$request_for = $this->request->getGet('request_for');
|
||||
$option = $this->request->getGet('option');
|
||||
$is_option = $this->request->getGet('is_option');
|
||||
|
||||
$requestData = $this->ChatBotModel->where('request', $request_for)
|
||||
$responseData = $this->ChatBotModel->where('request', $request_for)
|
||||
->where('is_active', 1 )
|
||||
->first();
|
||||
|
||||
if ($requestData) {
|
||||
|
||||
if ($responseData) {
|
||||
|
||||
|
||||
|
||||
if($option != 0){
|
||||
if(isset($option) && $option != 0){
|
||||
|
||||
$decodedData = json_decode($requestData['options'],true);
|
||||
|
||||
$requestFor = $decodedData[$request_for][$option];
|
||||
$decodedData = json_decode($responseData['options'],true);
|
||||
|
||||
|
||||
if (isset($decodedData[$option]) && $decodedData[$option] !== null) {
|
||||
|
||||
$requestData = $this->ChatBotModel->where('request', $requestFor)
|
||||
$requestFor = $decodedData[$option];
|
||||
$responseData = $this->ChatBotModel->where('request', $requestFor)
|
||||
->where('is_active', 1 )
|
||||
->first();
|
||||
|
||||
}else{
|
||||
|
||||
if( $request_for == 'Create claim'){
|
||||
$result = [
|
||||
'request_for' => $request_for,
|
||||
'options' => json_decode($responseData['options'], true),
|
||||
'text' => "Enter Message",
|
||||
'is_option' => "0",
|
||||
'policy_id' => $option,
|
||||
'mobile_no' => $this->request->getGet('mobile_no')
|
||||
];
|
||||
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result ],200);
|
||||
}else{
|
||||
|
||||
$result = $this->sendDefaultMessage();
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result ],200);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(isset($is_option) && $is_option == 0){
|
||||
|
||||
$text = $this->request->getGet('text');
|
||||
$value = $this->request->getGet('value');
|
||||
$Data = $this->ChatBotModel->where('options', $text)->where('is_active', 1 )->first();
|
||||
if($Data){
|
||||
|
||||
if($Data['options'] == 'Please Enter Your Mobile Number To View Your Policies')
|
||||
{
|
||||
$result = $this->getAllPolicyByMobileNumber($value,'text');
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result ],200);
|
||||
}else if($Data['options'] == 'Please Enter Your Mobile Number To Raise Ticket'){
|
||||
$result = $this->getAllPolicyByMobileNumber($value,'options');
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result ],200);
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
if( $request_for == 'Create claim' && $text == 'Enter Message'){
|
||||
|
||||
|
||||
$ticket = $this->claimTicket();
|
||||
|
||||
$ticket = json_decode($ticket,true);
|
||||
|
||||
if (isset($ticket['success']) && $ticket['success'] == 1) {
|
||||
|
||||
$result = [
|
||||
'request_for' => $request_for,
|
||||
'options' => null,
|
||||
'text' => $ticket['message'].', Your Ticket id is '.$ticket['ticket_id'],
|
||||
'is_option' => "0"
|
||||
];
|
||||
}else{
|
||||
|
||||
$result = [
|
||||
'request_for' => $request_for,
|
||||
'options' => null,
|
||||
'text' => $ticket['message'],
|
||||
'is_option' => "0"
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result ],200);
|
||||
}else{
|
||||
|
||||
$result = $this->sendDefaultMessage();
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result ],200);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$result = ['request_for'=>$requestData['request'],'options'=>json_decode($requestData['options'],true)];
|
||||
|
||||
$result = [
|
||||
'request_for' => $responseData['request'],
|
||||
'options' => json_decode($responseData['options'], true),
|
||||
'text' => $responseData['is_option'] != 1 ? $responseData['options'] : null,
|
||||
'is_option' => $responseData['is_option']
|
||||
];
|
||||
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result ],200);
|
||||
|
||||
|
||||
@ -112,7 +199,177 @@ class ChatBotController extends AdminController
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function sendDefaultMessage()
|
||||
{
|
||||
$responseData = $this->ChatBotModel->where('id', 1)->where('is_active', 1 )->first();
|
||||
return [
|
||||
'request_for' => $responseData['request'],
|
||||
'options' => json_decode($responseData['options'], true),
|
||||
'text' => $responseData['is_option'] != 1 ? $responseData['options'] : null,
|
||||
'is_option' => $responseData['is_option']
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function getAllPolicyByMobileNumber($mobileNo,$action)
|
||||
{
|
||||
$employee = $this->employeeModel->where('mobile', $mobileNo)->where('is_active', 1 )->first();
|
||||
if($employee){
|
||||
|
||||
$employeeData = $this->employeeModel->where('emp_code', $employee['emp_code'])
|
||||
->where('client_id',$employee['client_id'])
|
||||
->where('client_branch_id',$employee['client_branch_id'])
|
||||
->where('is_active', 1 )->findAll();
|
||||
$whereArrayForId = [];
|
||||
foreach ( $employeeData as $key => $value) { array_push($whereArrayForId, $value['id']); }
|
||||
|
||||
$ClientPolicyData = $this->clientPolicyModel->select('client_policy.* , policies.name as policy_name , policy_type.policy_type as policy_type')
|
||||
->join('policies', 'client_policy.policy_id = policies.id', 'left')
|
||||
->join('policy_type', 'client_policy.policy_type_id = policy_type.id', 'left')
|
||||
->where('client_policy.client_id', $employee['client_id'] )
|
||||
->where('client_policy.client_branch_id', $employee['client_branch_id'] )
|
||||
->where('client_policy.is_active', 1 )
|
||||
->where('client_policy.policy_status', 1)
|
||||
->orderby('client_policy.id' , 'ASC')
|
||||
->findAll();
|
||||
$options = [];
|
||||
$text = '';
|
||||
if(count($ClientPolicyData) > 0 && count($employeeData) > 0)
|
||||
{
|
||||
|
||||
foreach ($ClientPolicyData as $key => $ClientPolicyValue) {
|
||||
|
||||
$data['policy_name'] = $ClientPolicyValue['policy_name'];
|
||||
$data['policy_type'] = $ClientPolicyValue['policy_type'];
|
||||
$data['policy_no'] = $ClientPolicyValue['policy_no'];
|
||||
|
||||
|
||||
|
||||
$employee_policy = $this->employeePolicyModel->select('employees.*,employee_polices.employee_id , employee_polices.basic_cover_si , employee_polices.premium , employee_polices.gst , employee_polices.tpa_id , employee_polices.rand_string , employee_polices.uhid as uhid')
|
||||
->join('employees', 'employee_polices.employee_id = employees.id', 'left')
|
||||
->whereIn('employee_polices.employee_id',$whereArrayForId)
|
||||
->where('employee_polices.client_policy_id',$ClientPolicyValue['id'])
|
||||
->where('employee_polices.is_active', 1 )->findAll();
|
||||
if(count($employee_policy) > 0)
|
||||
{
|
||||
$policy[$ClientPolicyValue['id']] = $ClientPolicyValue['policy_name']."(".$ClientPolicyValue['policy_type'].")";
|
||||
array_push($options, $policy);
|
||||
$text .= $ClientPolicyValue['policy_name']."(".$ClientPolicyValue['policy_type'].") % ";
|
||||
}else{
|
||||
$text .= "There is no any active policies ";
|
||||
}
|
||||
|
||||
}
|
||||
if($action == 'options'){
|
||||
return [
|
||||
'request_for' => $this->request->getGet('request_for'),
|
||||
'options' => $options[count($options) - 1],
|
||||
'text' => null,
|
||||
'is_option' => "1",
|
||||
'mobile_no' => $mobileNo,
|
||||
];
|
||||
}else{
|
||||
return [
|
||||
'request_for' => $this->request->getGet('request_for'),
|
||||
'options' => null,
|
||||
'text' => $text,
|
||||
'is_option' => "0",
|
||||
'mobile_no' => $mobileNo,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
return [
|
||||
'request_for' => $this->request->getGet('request_for'),
|
||||
'options' => null,
|
||||
'text' => "Dear ".$employee['name'].", % Policy not yet bound for you.",
|
||||
'is_option' => "0"
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
return [
|
||||
'request_for' => $this->request->getGet('request_for'),
|
||||
'options' => null,
|
||||
'text' => "Invalid Mobile Number",
|
||||
'is_option' => "0"
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function claimTicket()
|
||||
{
|
||||
|
||||
|
||||
$employee = $this->employeeModel->where('mobile', $this->request->getGet('mobile_no'))->where('is_active', 1 )->first();
|
||||
if($employee){
|
||||
|
||||
$url = 'https://venbait.in/nhance/helpdesk/dev/api/tickets/create';
|
||||
|
||||
|
||||
$token = 'uncp8FvG310bEyYdV9MmStlo7KDRZ65fLWTeXCI2JzwPrNHjBqQhUiAgxsaO';
|
||||
$headers = [
|
||||
'Token: ' . $token,
|
||||
];
|
||||
|
||||
// Form data
|
||||
$data = [
|
||||
'opener' => 'user',
|
||||
'department_id' => 2,
|
||||
'subject' => 'Claim Raised by Chat Bot',
|
||||
'body' => $this->request->getGet('value'),
|
||||
'policy_id' => $this->request->getGet('policy_id'),
|
||||
'emp_code' => $employee['emp_code'],
|
||||
'mobile_number' => $this->request->getGet('mobile_no'),
|
||||
'email' => 'adhavanvalli@gmail.com',
|
||||
'fullname' => $employee['name'],
|
||||
];
|
||||
|
||||
// Initialize cURL session
|
||||
$ch = curl_init();
|
||||
|
||||
// Set cURL options
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
return $response;
|
||||
// Check for errors
|
||||
// if (curl_errno($ch)) {
|
||||
// $error = curl_error($ch);
|
||||
// curl_close($ch);
|
||||
// return ['status' => 'failed', 'response' => $error];
|
||||
// } else {
|
||||
// // Close cURL session
|
||||
// curl_close($ch);
|
||||
// return ['status' => 'success', 'response' => $response];
|
||||
// }
|
||||
|
||||
|
||||
}else{
|
||||
return ['status' => 'failed', 'response' => 'Employee Not Found'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -106,7 +106,47 @@ class ClientController extends AdminController
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function Testing() //this function for only tsesting some logics not use for business logic
|
||||
{
|
||||
$results = $this->clientPolicyModel
|
||||
->select('id, policy_terms')
|
||||
->where('policy_terms IS NOT NULL')
|
||||
->where('policy_terms <>', '')
|
||||
->whereNotIn('policy_type_id', [1, 6, 7])
|
||||
->orderBy('id', 'desc')
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
foreach ($results as $key => $result) {
|
||||
$client_policy_id = $result['id'];
|
||||
$policy_terms = json_decode($result['policy_terms'], true); // true to get associative array
|
||||
|
||||
if (isset($policy_terms['family_floaters'])) {
|
||||
$family_floaters = $policy_terms['family_floaters'];
|
||||
$parents = $family_floaters['parents'] ?? 0;
|
||||
$parents_in_law = $family_floaters['parents-in-law'] ?? 0;
|
||||
|
||||
if ($parents == 1 && $parents_in_law == 1) {
|
||||
$policy_terms['family_floaters']['parents'] = 0;
|
||||
$policy_terms['family_floaters']['parents-in-law'] = 0;
|
||||
$policy_terms['family_floaters']['either-parents-pil'] = 2;
|
||||
|
||||
|
||||
$results[$key]['policy_terms'] = json_encode($policy_terms);
|
||||
|
||||
// Update the policy_terms in the database
|
||||
$this->clientPolicyModel
|
||||
->where('id', $client_policy_id)
|
||||
->set('policy_terms', $results[$key]['policy_terms'])
|
||||
->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dd($results);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->myLogger->logme('error','Client list function called');
|
||||
@ -123,8 +163,8 @@ class ClientController extends AdminController
|
||||
// $this->loadLayout('client_onboarding', $data);
|
||||
}
|
||||
|
||||
|
||||
public function updateEmpAndPolicyStatus(){
|
||||
public function updateEmpAndPolicyStatus()
|
||||
{
|
||||
|
||||
$return = $this->clientPolicyModel->updateStatus();
|
||||
$this->myLogger->logme('error', 'Client Policy Status Update Count: {data}', ['data' => $return['client']]);
|
||||
@ -133,6 +173,59 @@ class ClientController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
public function updatePolicyTermsForCorrections(){
|
||||
|
||||
$results = $this->clientPolicyModel
|
||||
->select('id, policy_terms')
|
||||
->where('policy_terms IS NOT NULL')
|
||||
->where('policy_terms <>', '')
|
||||
->whereNotIn('policy_type_id', [1, 6, 7])
|
||||
->orderBy('id', 'desc')
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
|
||||
$client_policy_ids = [];
|
||||
foreach ($results as $key => $result) {
|
||||
$client_policy_id = $result['id'];
|
||||
$policy_terms = json_decode($result['policy_terms'], true); // true to get associative array
|
||||
|
||||
if (isset($policy_terms['family_floaters'])) {
|
||||
$family_floaters = $policy_terms['family_floaters'];
|
||||
$parents = $family_floaters['parents'] ?? 0;
|
||||
$parents_in_law = $family_floaters['parents-in-law'] ?? 0;
|
||||
|
||||
if ($parents == 1 && $parents_in_law == 1) {
|
||||
|
||||
$client_policy_ids[] = $client_policy_id;
|
||||
|
||||
$policy_terms['family_floaters']['parents'] = 0;
|
||||
$policy_terms['family_floaters']['parents-in-law'] = 0;
|
||||
$policy_terms['family_floaters']['either-parents-pil'] = 2;
|
||||
|
||||
|
||||
$results[$key]['policy_terms'] = json_encode($policy_terms);
|
||||
|
||||
// Update the policy_terms in the database
|
||||
$this->clientPolicyModel
|
||||
->where('id', $client_policy_id)
|
||||
->set('policy_terms', $results[$key]['policy_terms'])
|
||||
->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(count($client_policy_ids) > 0){
|
||||
echo 'There are ' . count($client_policy_ids) . ' records to be updated.';
|
||||
echo '<br>';
|
||||
dd($client_policy_ids);
|
||||
}else{
|
||||
echo 'There is no records to be update.';
|
||||
}
|
||||
// dd($results);
|
||||
|
||||
}
|
||||
|
||||
public function removeClient($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Client Remove function called');
|
||||
@ -219,11 +312,13 @@ class ClientController extends AdminController
|
||||
// ];
|
||||
|
||||
$subTypeOptions = [
|
||||
1 => 'Replenishment',
|
||||
1 => 'Replenishment By Client',
|
||||
2 => 'Adjustment',
|
||||
3 => 'Refund From Deletion',
|
||||
4 => 'Debit',
|
||||
5 => 'Asset Policy',
|
||||
5 => 'Non EB',
|
||||
6 => 'Refund By Insurer',
|
||||
7 => 'Opening Amount',
|
||||
];
|
||||
|
||||
$data['subTypeOptions'] = $subTypeOptions;
|
||||
@ -236,6 +331,7 @@ class ClientController extends AdminController
|
||||
$data['clientData'] = $this->clientPolicyModel->getClientById($clientId);
|
||||
$data['deposiamount'] = $this->clientPolicyModel->getDepositSummary($clientId, $insurerId);
|
||||
|
||||
// dd($data['depositdata']);
|
||||
|
||||
// print_r($data['depositdata'] );die;
|
||||
// Load the view for the new list page
|
||||
@ -355,7 +451,6 @@ class ClientController extends AdminController
|
||||
{
|
||||
$this->myLogger->logme('error','edit client general info function called');
|
||||
$uploadFilePath = ROOTPATH . 'public/uploads/logo/';
|
||||
// print_r($this->request->getFile('client_logo'));die;
|
||||
$file_name = file_Upload($this->request->getFile('client_logo'), $uploadFilePath);
|
||||
$id = $this->request->getPost('PrimaryKey');
|
||||
|
||||
@ -544,6 +639,11 @@ class ClientController extends AdminController
|
||||
|
||||
$this->myLogger->logme('error','Client branch CREATE function called');
|
||||
$data = $this->request->getPost();
|
||||
if (!isset($data['sez'])) {
|
||||
$data['sez'] = 0;
|
||||
} elseif ($data['sez']) {
|
||||
$data['sez'] = 1;
|
||||
}
|
||||
$data['created_by'] = get_session_userid();
|
||||
$insert = $this->clientBranchModel->insert($data);
|
||||
|
||||
@ -579,6 +679,11 @@ class ClientController extends AdminController
|
||||
$id = $this->request->getPost('branch_id_primarykey');
|
||||
$client_id = $this->request->getPost('client_id');
|
||||
$data = $this->request->getPost();
|
||||
if (!isset($data['sez'])) {
|
||||
$data['sez'] = 0;
|
||||
} elseif ($data['sez']) {
|
||||
$data['sez'] = 1;
|
||||
}
|
||||
$data['updated_by'] = get_session_userid();
|
||||
$insert = $this->clientBranchModel->update($id, $data);
|
||||
$this->myLogger->logme('error','Client branch EDITED by {data}', ['data' => get_session_userid()]);
|
||||
@ -669,28 +774,28 @@ class ClientController extends AdminController
|
||||
|
||||
$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) {
|
||||
|
||||
if ($this->request->getPost('is_addon') == 3) {
|
||||
$policyTerm = $policy_terms['policy_terms'];
|
||||
$decoded_policyTerm = json_decode($policyTerm, true);
|
||||
$decoded_policyTerm['family_floater'] = 0;
|
||||
$decoded_policyTerm['family_floaters']['self'] = 0;
|
||||
$decoded_policyTerm['family_floaters']['spouse'] = 0;
|
||||
$decoded_policyTerm['family_floaters']['childrens'] = 0;
|
||||
$decoded_policyTerm['family_floaters']['parents'] = 0;
|
||||
$decoded_policyTerm['family_floaters']['parents-in-law'] = 0;
|
||||
$decoded_policyTerm['family_floaters']['either-parents-pil'] = 0;
|
||||
// if ($this->request->getPost('is_addon') == 3) {
|
||||
// $policyTerm = $policy_terms['policy_terms'];
|
||||
// $decoded_policyTerm = json_decode($policyTerm, true);
|
||||
// $decoded_policyTerm['family_floater'] = 0;
|
||||
// $decoded_policyTerm['family_floaters']['self'] = 0;
|
||||
// $decoded_policyTerm['family_floaters']['spouse'] = 0;
|
||||
// $decoded_policyTerm['family_floaters']['childrens'] = 0;
|
||||
// $decoded_policyTerm['family_floaters']['parents'] = 0;
|
||||
// $decoded_policyTerm['family_floaters']['parents-in-law'] = 0;
|
||||
// $decoded_policyTerm['family_floaters']['either-parents-pil'] = 0;
|
||||
|
||||
$data['policy_terms'] = json_encode($decoded_policyTerm);
|
||||
} else {
|
||||
// $data['policy_terms'] = json_encode($decoded_policyTerm);
|
||||
// } else {
|
||||
|
||||
if ($this->request->getPost('policy_type_id') != 3) {
|
||||
// if ($this->request->getPost('policy_type_id') != 3) {
|
||||
|
||||
$data['policy_terms'] = $policy_terms['policy_terms'];
|
||||
}
|
||||
}
|
||||
}
|
||||
// $data['policy_terms'] = $policy_terms['policy_terms'];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
$data['policy_no'] = $this->request->getPost('policy_no');
|
||||
@ -764,25 +869,25 @@ class ClientController extends AdminController
|
||||
|
||||
$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') == 3) {
|
||||
$policyTerm = $policy_terms['policy_terms'];
|
||||
$decoded_policyTerm = json_decode($policyTerm, true);
|
||||
$decoded_policyTerm['family_floater'] =0;
|
||||
$decoded_policyTerm['family_floaters']['self'] =0;
|
||||
$decoded_policyTerm['family_floaters']['spouse'] =0;
|
||||
$decoded_policyTerm['family_floaters']['childrens'] =0;
|
||||
$decoded_policyTerm['family_floaters']['parents'] =0;
|
||||
$decoded_policyTerm['family_floaters']['parents-in-law'] =0;
|
||||
$decoded_policyTerm['family_floaters']['either-parents-pil'] =0;
|
||||
// if ( $this->request->getPost('is_addon') == 2 || $this->request->getPost('is_addon') == 3) {
|
||||
// if ($this->request->getPost('is_addon') == 3) {
|
||||
// $policyTerm = $policy_terms['policy_terms'];
|
||||
// $decoded_policyTerm = json_decode($policyTerm, true);
|
||||
// $decoded_policyTerm['family_floater'] =0;
|
||||
// $decoded_policyTerm['family_floaters']['self'] =0;
|
||||
// $decoded_policyTerm['family_floaters']['spouse'] =0;
|
||||
// $decoded_policyTerm['family_floaters']['childrens'] =0;
|
||||
// $decoded_policyTerm['family_floaters']['parents'] =0;
|
||||
// $decoded_policyTerm['family_floaters']['parents-in-law'] =0;
|
||||
// $decoded_policyTerm['family_floaters']['either-parents-pil'] =0;
|
||||
|
||||
$data['policy_terms'] = json_encode($decoded_policyTerm);
|
||||
} else {
|
||||
$data['policy_terms'] = $policy_terms['policy_terms'];
|
||||
}
|
||||
// $data['policy_terms'] = json_encode($decoded_policyTerm);
|
||||
// } else {
|
||||
// $data['policy_terms'] = $policy_terms['policy_terms'];
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
// dd($data);
|
||||
$data['updated_by'] = get_session_userid();
|
||||
@ -1177,16 +1282,26 @@ class ClientController extends AdminController
|
||||
public function getClientPolicyById($id=null)
|
||||
{
|
||||
$this->myLogger->logme('error','getClientPolicyById function called');
|
||||
|
||||
if($id){
|
||||
$client_policy_data = $this->clientPolicyModel->where(['id' => $id, 'is_active' => 1])->first();
|
||||
$insurer_id = $client_policy_data['insurer_id'];
|
||||
$client_id = $client_policy_data['client_id'];
|
||||
$polices = $this->policesModel->where(['insurer_id' => $insurer_id, 'is_active' => 1])->findAll();
|
||||
|
||||
$base_policy_policy_type_id = 0;
|
||||
if($client_policy_data['base_policy'] != null){
|
||||
$base_policy_policy_type_id = $this->clientPolicyModel->select('policy_type_id')->where(['id' => $client_policy_data['base_policy'], 'is_active' => 1])->first();
|
||||
}
|
||||
|
||||
$polices = $this->policesModel
|
||||
->select('policies.*, policy_type.policy_type')
|
||||
->join('policy_type', 'policy_type.id = policies.policy_type_id')
|
||||
->where(['policies.insurer_id' => $insurer_id, 'policies.is_active' => 1])
|
||||
->findAll();
|
||||
$client_policy_list = $this->clientPolicyModel->getpolicyWithPattern( $client_id );
|
||||
$cd_data = $this->CDMasterModel->where('client_id', $client_id)->where('insurer_id', $insurer_id)->findAll();
|
||||
|
||||
|
||||
return $this->respond(['status' => true,'code' => 200, 'client_policy_list' => $client_policy_list, 'data' => $client_policy_data, 'cd_data' => $cd_data, "insurer_id" => $client_policy_data['insurer_id'], 'policy' => $polices], 200);
|
||||
return $this->respond(['status' => true,'code' => 200, 'client_policy_list' => $client_policy_list, 'data' => $client_policy_data, 'cd_data' => $cd_data, "insurer_id" => $client_policy_data['insurer_id'], 'policy' => $polices, 'base_policy_type_id' => $base_policy_policy_type_id['policy_type_id']], 200);
|
||||
}else{
|
||||
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
||||
}
|
||||
@ -1416,9 +1531,9 @@ class ClientController extends AdminController
|
||||
$data['family_floaters']['parents-in-law'] =2;
|
||||
$data['family_floaters']['either-parents-pil'] =0;
|
||||
}else if($temp_family_floaters[$value] == '2EPORPIL'){
|
||||
$data['family_floaters']['parents'] =1;
|
||||
$data['family_floaters']['parents-in-law'] =1;
|
||||
$data['family_floaters']['either-parents-pil'] =0;
|
||||
$data['family_floaters']['parents'] =0;
|
||||
$data['family_floaters']['parents-in-law'] =0;
|
||||
$data['family_floaters']['either-parents-pil'] =2;
|
||||
}else if($temp_family_floaters[$value] == 'EPORPIL'){
|
||||
$data['family_floaters']['parents'] =0;
|
||||
$data['family_floaters']['parents-in-law'] =0;
|
||||
@ -1514,6 +1629,7 @@ class ClientController extends AdminController
|
||||
|
||||
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
|
||||
|
||||
|
||||
// print_r($data);die;
|
||||
if ($record) {
|
||||
$update = $this->clientPolicyModel->update($client_policy_id, $dataa);
|
||||
@ -2172,9 +2288,14 @@ class ClientController extends AdminController
|
||||
|
||||
|
||||
|
||||
public function get_cd_ac($client_id, $insurer_id){
|
||||
public function get_cd_ac($client_id, $insurer_id)
|
||||
{
|
||||
|
||||
$cd_data = $this->CDMasterModel->where('client_id', $client_id)->where('insurer_id', $insurer_id)->findAll();
|
||||
$cd_data = $this->CDMasterModel
|
||||
->where('client_id', $client_id)
|
||||
->where('insurer_id', $insurer_id)
|
||||
->where('is_active', 1)
|
||||
->findAll();
|
||||
|
||||
if($cd_data){
|
||||
return $this->respond(['status' => true, 'code' => 200, 'data' => $cd_data], 200);
|
||||
@ -2209,7 +2330,8 @@ class ClientController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
public function checkPolicyType($policy_type_id, $client_branch_id, $client_id){
|
||||
public function checkPolicyType($policy_type_id, $client_branch_id, $client_id)
|
||||
{
|
||||
|
||||
$policyCount = $this->clientPolicyModel
|
||||
->where('policy_type_id', $policy_type_id)
|
||||
@ -2274,7 +2396,8 @@ class ClientController extends AdminController
|
||||
|
||||
|
||||
|
||||
public function getPolicyTermsFormJson($policy_type_id){
|
||||
public function getPolicyTermsFormJson($policy_type_id)
|
||||
{
|
||||
|
||||
$JSON = $this->policyTypeModel->where('id', $policy_type_id)->first();
|
||||
return $this->respond(['status' => true, 'data' => $JSON], 200);
|
||||
@ -2303,6 +2426,19 @@ class ClientController extends AdminController
|
||||
return $this->respond(['status' => false, 'data' => 0, 'message' => 'An error occurred while checking the mobile number. Please try again later.'], 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function checkAdditionPremiumJSON($client_id, $client_policy_id)
|
||||
{
|
||||
|
||||
$get_additional_rack_rate_relationship_json = $this->policyPremium2Model
|
||||
->where('client_id', $client_id)
|
||||
->where('client_policy_id', $client_policy_id)
|
||||
->where('is_active', 1)
|
||||
->where('additional_relationship IS NOT NULL', null, false)
|
||||
->countAllResults();
|
||||
|
||||
return $this->respond(['status' => true, 'data' => $get_additional_rack_rate_relationship_json, 'message' => "try"], 200);
|
||||
}
|
||||
|
||||
}
|
||||
@ -27,7 +27,6 @@ use App\Models\NotificationModel;
|
||||
use App\Models\UserModel;
|
||||
use App\Models\FEContentModel;
|
||||
use App\Models\AddImgModel;
|
||||
use App\Models\FileModel;
|
||||
|
||||
|
||||
use App\Controllers\Jobs ;
|
||||
@ -435,7 +434,7 @@ class EmployeeRestController extends AdminController
|
||||
->findAll();
|
||||
|
||||
|
||||
// dd($checkIfExist);
|
||||
|
||||
if ($checkIfExist) {
|
||||
|
||||
$empPolicy = $this->employeePolicyModel->updateSiAndPremium($value->client_policy_id, $value->employee_id, $value->basic_cover_si);
|
||||
@ -626,13 +625,7 @@ class EmployeeRestController extends AdminController
|
||||
// Upload the Employee Detail in DB by Sheet Data
|
||||
public function employeeUpload()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
try {
|
||||
// echo $this->request->getPost('client_id');
|
||||
// die;
|
||||
$file = $this->request->getFile('file');
|
||||
$client_id = $this->request->getPost('client_id');
|
||||
$client_branch_id = $this->request->getPost('client_branch_id');
|
||||
@ -643,17 +636,12 @@ class EmployeeRestController extends AdminController
|
||||
|
||||
$jwt = $this->request->getHeader('Authorization');
|
||||
$jwtParts = explode(' ', $jwt);
|
||||
// print_r($jwtParts);die;
|
||||
$token = $jwtParts[2];
|
||||
// return "hello";
|
||||
|
||||
|
||||
$token = $jwtParts[2];
|
||||
|
||||
$decodedPayload = json_decode(base64_decode(explode('.', $token)[1]), true);
|
||||
// get the employee id from token
|
||||
$employee_id = $decodedPayload['id'];
|
||||
|
||||
|
||||
|
||||
$client_policy = $this->clientPolicyModel->where('id', $policy_id)->where('client_id', $client_id)->where('client_branch_id', $client_branch_id)->first();
|
||||
if ($client_policy) {
|
||||
$policy = $this->policesModel->where('id', $client_policy['policy_id'])->first();
|
||||
@ -668,12 +656,12 @@ class EmployeeRestController extends AdminController
|
||||
$file_name_with_path = WRITEPATH."/uploads/excel/".$filename;
|
||||
|
||||
//make an entry in DB
|
||||
$file_id = $this->fileModel->insert(['file_name' => $filename, 'client_id' => $client_id, 'policy_id' => $policy_id, 'created_by' => $loggedInUserID, 'status' => $status, 'action' => 'enrollment', 'client_branch_id' => $client_branch_id]); //here field policy_id have client_policy_id and not policy id from policy master
|
||||
$file_id = $this->fileModel->insert(['file_name' => $filename, 'client_id' => $client_id, 'policy_id' => $policy_id, 'created_by' => $employee_id, 'status' => 'draft', 'action' => 'enrollment', 'client_branch_id' => $client_branch_id]); //here field policy_id have client_policy_id and not policy id from policy master
|
||||
$this->myLogger->logme("error", '{file_id} - client uploaded success', ['file_id' => $file_id]);
|
||||
|
||||
$empServiceController = new EmployeeServiceController();
|
||||
$result = $empServiceController->excelFileFormatValidation(['file_id' => $file_id]);
|
||||
// dd($result);
|
||||
|
||||
if(isset($result['error_summary']) && count($result['error_summary']))
|
||||
{
|
||||
$result = $empServiceController->getExcelErrorData($file_id);
|
||||
@ -701,34 +689,34 @@ class EmployeeRestController extends AdminController
|
||||
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
||||
$data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
||||
|
||||
$extractData['file_name']= $filename;
|
||||
$extractData['client_id']= $client_id;
|
||||
$extractData['client_branch_id']= $client_branch_id;
|
||||
$extractData['status']= 'success';
|
||||
$extractData['policy_id']= $policy_id;
|
||||
$extractData['action']= 'enrollment';
|
||||
$extractData['created_by']=$employee_id;
|
||||
// $extractData['file_name']= $filename;
|
||||
// $extractData['client_id']= $client_id;
|
||||
// $extractData['client_branch_id']= $client_branch_id;
|
||||
// $extractData['status']= 'success';
|
||||
// $extractData['policy_id']= $policy_id;
|
||||
// $extractData['action']= 'enrollment';
|
||||
// $extractData['created_by']=$employee_id;
|
||||
|
||||
$file_data =$this->fileModel->insert($extractData);
|
||||
// $file_data =$this->fileModel->insert($extractData);
|
||||
|
||||
$extra = [];
|
||||
if (count($data[0]) == 11) {
|
||||
$value = ['Sno','Emp_Code','Name','DOJ','Gender','Relation','DOB','Mail','Mobile','SI','Grade'];
|
||||
$check_miss_match = [];
|
||||
for ($i=0; $i <count($value) ; $i++) {
|
||||
if ($data[0][$i] != $value[$i]) {
|
||||
$check_miss_match[]=$data[0][$i];
|
||||
}
|
||||
}
|
||||
// $extra = [];
|
||||
// if (count($data[0]) == 11) {
|
||||
// $value = ['Sno','Emp_Code','Name','DOJ','Gender','Relation','DOB','Mail','Mobile','SI','Grade'];
|
||||
// $check_miss_match = [];
|
||||
// for ($i=0; $i <count($value) ; $i++) {
|
||||
// if ($data[0][$i] != $value[$i]) {
|
||||
// $check_miss_match[]=$data[0][$i];
|
||||
// }
|
||||
// }
|
||||
// if (count($check_miss_match) > 0) {
|
||||
// return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Column Name's are miss Match's!", 'data'=> $check_miss_match], 200);
|
||||
// }
|
||||
// }
|
||||
|
||||
if (count($check_miss_match) > 0) {
|
||||
return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Column Name's are miss Match's!", 'data'=> $check_miss_match], 200);
|
||||
}
|
||||
}
|
||||
|
||||
if(count($data[0]) != 11){
|
||||
return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Uploaded file row count is Not Match!" ], 200);
|
||||
}
|
||||
// if(count($data[0]) != 11){
|
||||
// return json_encode($data[0]);
|
||||
// return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Uploaded file row count is Not Match!" ], 200);
|
||||
// }
|
||||
|
||||
//this change the column name into index number
|
||||
for ($i = 0; $i < count($data[0]); $i++) {
|
||||
@ -753,18 +741,6 @@ class EmployeeRestController extends AdminController
|
||||
}
|
||||
$dataToInsert = [];
|
||||
$basic_cover_si= [];
|
||||
// if ($extra[9]) {
|
||||
// $new_array = [];
|
||||
// for ($i=0; $i < count($extra[9]); $i++) {
|
||||
// if ($sum_insured_amount_for_check_employee_2 != $extra[9][$i] || $sum_insured_amount_for_check_employee_1 != $extra[9][$i]) {
|
||||
// $new_array[] = $i+1;
|
||||
// }
|
||||
// }
|
||||
// if (count($new_array) > 0) {
|
||||
// $count =count($new_array);
|
||||
// return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "$count Employee Sum Insured is Not Match.. " , 'data' => $new_array], 200);
|
||||
// }
|
||||
// }
|
||||
foreach ($extra['0'] as $index => $id) {
|
||||
$relation ='';
|
||||
if ($extra['5'][$index] === 'Mother' || $extra['5'][$index] === 'Father') {
|
||||
@ -956,6 +932,7 @@ class EmployeeRestController extends AdminController
|
||||
//-------------------------------------
|
||||
public function getAgeRange($terms,$familyFloatesValue)
|
||||
{
|
||||
|
||||
$ageRangeArray = ['self' => ['min' => 18, 'max' => 60] , 'spouse' => ['min' => 18, 'max' => 60] , 'child' => ['min' => 0, 'max' => 25] , 'elders' => ['min' => 18, 'max' => 60] ];
|
||||
|
||||
$ageKey = (preg_replace('/\d/', '', $familyFloatesValue) == 'parent' || preg_replace('/\d/', '', $familyFloatesValue) == 'parent_in_law') ? 'elders' : preg_replace('/\d/', '', $familyFloatesValue);
|
||||
@ -970,7 +947,7 @@ public function getAgeRange($terms,$familyFloatesValue)
|
||||
|
||||
public function getEmployeePolicy()
|
||||
{
|
||||
try {
|
||||
// try {
|
||||
|
||||
$id = $this->request->getGet('id');
|
||||
$emp_code = $this->request->getGet('emp_code');
|
||||
@ -989,7 +966,7 @@ public function getEmployeePolicy()
|
||||
->where('is_active', 1 )
|
||||
->where('is_addon_value',0)->findAll();
|
||||
|
||||
|
||||
|
||||
if ($empPolicy) {
|
||||
|
||||
$result = [];
|
||||
@ -1058,12 +1035,17 @@ public function getEmployeePolicy()
|
||||
$array->floter_text_description = '';
|
||||
}
|
||||
|
||||
// Convert familyFloaters terms data to plain array
|
||||
// remove parent and parent-in-law from familyFloaters
|
||||
if($familyFloates->{'either-parents-pil'} != 0){
|
||||
unset($familyFloates->parents);
|
||||
unset($familyFloates->parents_in_law);
|
||||
}
|
||||
$floters = $this->FloterConvertion($familyFloates);
|
||||
|
||||
$data = [];
|
||||
foreach ($floters as $familyFloatesValue) {
|
||||
$dependent = preg_replace('/\d/', '', $familyFloatesValue);
|
||||
|
||||
if(count($empData)){
|
||||
foreach ($empData as $key => $value) {
|
||||
if ($value['family_floater_key'] === $dependent) {
|
||||
@ -1089,8 +1071,8 @@ public function getEmployeePolicy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Remove Unwanted floter key from floters array based on either-parents-pil term value
|
||||
if($familyFloates->{'either-parents-pil'} == 1 && count($floters))
|
||||
@ -1108,7 +1090,21 @@ public function getEmployeePolicy()
|
||||
$floters = array_filter($floters, fn($value) => strpos($value, 'parent') === false || strpos($value, 'parent_in_law') !== false);
|
||||
}
|
||||
}
|
||||
|
||||
else if($familyFloates->{'either-parents-pil'} == 2 && count($floters))
|
||||
{
|
||||
$count_parent = 0;
|
||||
$count_parent_in_law = 0;
|
||||
foreach ($floters as $value) {
|
||||
if (preg_replace('/\d/', '', $value) == 'parent') { $count_parent++; }
|
||||
if (preg_replace('/\d/', '', $value) == 'parent_in_law') {$count_parent_in_law++;}
|
||||
}
|
||||
if(($count_parent + $count_parent_in_law) == 2) {
|
||||
$floters = array_filter($floters, fn($value) => strpos($value, 'parent') === false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Add family floter buttons placement data for FE validation
|
||||
if(count($floters)){
|
||||
foreach ($floters as $familyFloatesValue) {
|
||||
@ -1161,9 +1157,9 @@ public function getEmployeePolicy()
|
||||
}else{
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => []], 200);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
|
||||
}
|
||||
// } catch (\Exception $e) {
|
||||
// return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -1229,6 +1225,13 @@ public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id,$cl
|
||||
$array->floter_text_description = '';
|
||||
}
|
||||
|
||||
|
||||
// remove parent and parent-in-law from familyFloaters
|
||||
if($familyFloates->{'either-parents-pil'} != 0){
|
||||
unset($familyFloates->parents);
|
||||
unset($familyFloates->parents_in_law);
|
||||
}
|
||||
|
||||
// Convert familyFloaters terms data to plain array
|
||||
$floters = $this->FloterConvertion($familyFloates);
|
||||
$data = [];
|
||||
@ -1278,6 +1281,19 @@ public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id,$cl
|
||||
$floters = array_filter($floters, fn($value) => strpos($value, 'parent') === false || strpos($value, 'parent_in_law') !== false);
|
||||
}
|
||||
}
|
||||
else if($familyFloates->{'either-parents-pil'} == 2 && count($floters))
|
||||
{
|
||||
$count_parent = 0;
|
||||
$count_parent_in_law = 0;
|
||||
foreach ($floters as $value) {
|
||||
if (preg_replace('/\d/', '', $value) == 'parent') { $count_parent++; }
|
||||
if (preg_replace('/\d/', '', $value) == 'parent_in_law') {$count_parent_in_law++;}
|
||||
}
|
||||
if(($count_parent + $count_parent_in_law) == 2) {
|
||||
$floters = array_filter($floters, fn($value) => strpos($value, 'parent') === false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Add family floter buttons placement data for FE validation
|
||||
if(count($floters)){
|
||||
@ -1306,8 +1322,9 @@ public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id,$cl
|
||||
public function FloterConvertion($array){
|
||||
|
||||
$result = [];
|
||||
|
||||
foreach ($array as $key => $value) {
|
||||
if ($value > 0) {
|
||||
if ($value > 0 && $key != 'elders_count') {
|
||||
if ($value != 0 && $key === 'childrens') {
|
||||
for ($i = 1; $i <= $value; $i++) {
|
||||
$result[] = "child" . $i;
|
||||
@ -1477,6 +1494,11 @@ public function getAddOnPolicy()
|
||||
|
||||
// Map family floaters that already exist in the employee table
|
||||
$familyFloates = $policy_terms->family_floaters;
|
||||
// remove parent and parent-in-law from familyFloaters
|
||||
if($familyFloates->{'either-parents-pil'} != 0){
|
||||
unset($familyFloates->parents);
|
||||
unset($familyFloates->parents_in_law);
|
||||
}
|
||||
// Convert familyFloaters terms data to plain array
|
||||
$floters = $this->FloterConvertion($familyFloates);
|
||||
|
||||
@ -1551,6 +1573,34 @@ public function getAddOnPolicy()
|
||||
|
||||
|
||||
}
|
||||
else if($familyFloates->{'either-parents-pil'} == 2 && count($floters))
|
||||
{
|
||||
if(count($addOnEmployeeData) == 0)
|
||||
{
|
||||
$GMCEmpData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
|
||||
->where('is_addon_value',0)
|
||||
->where('is_active', 1 )
|
||||
->where('family_floater_key','parent')
|
||||
->findAll();
|
||||
|
||||
if(count($GMCEmpData) > 0){
|
||||
$floters = array_diff($floters, ["parent1","parent2"]);
|
||||
}else{
|
||||
$floters = array_diff($floters, ["parent_in_law1","parent_in_law2"]);
|
||||
}
|
||||
}else{
|
||||
$count_parent = 0;
|
||||
$count_parent_in_law = 0;
|
||||
foreach ($floters as $value) {
|
||||
if (preg_replace('/\d/', '', $value) == 'parent') { $count_parent++; }
|
||||
if (preg_replace('/\d/', '', $value) == 'parent_in_law') {$count_parent_in_law++;}
|
||||
}
|
||||
if(($count_parent + $count_parent_in_law) == 2) {
|
||||
$floters = array_filter($floters, fn($value) => strpos($value, 'parent') === false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -873,7 +873,7 @@ class EmployeeServiceController extends AdminController
|
||||
$job_details = new Jobs();
|
||||
$r = Jobs::addJob(['job_name' => 'excelFileDataValidation','payload' => ['file_id' => $file_id]]);
|
||||
// $jobWorker = new JobWorker();
|
||||
// JobWorker::processJob($r);s
|
||||
// JobWorker::processJob($r);
|
||||
|
||||
}
|
||||
return $result;
|
||||
@ -942,7 +942,7 @@ class EmployeeServiceController extends AdminController
|
||||
|
||||
if(in_array($file['action'],['inception','addition','dependent_addition','deletion','correction','si_enhancement','enrollment']))// the below funcitons are only for I,DA,A
|
||||
{
|
||||
$employee_data_group_by_family = data_group_by_family($excel_data,'excel','enrollment');
|
||||
$employee_data_group_by_family = data_group_by_family($excel_data,'excel',($file['action'] == 'enrollment' ? 'enrollment' : ''));
|
||||
// dd($employee_data_group_by_family);
|
||||
$is_self_available_in_policy_terms = false;
|
||||
if($policy_details['policy_type_id'] == 3) // GMC parents
|
||||
@ -987,8 +987,7 @@ class EmployeeServiceController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
//check self availbale in uploaded file
|
||||
if(($file['action'] == 'inception' || $file['action'] == 'addition' || $file['action'] == 'enrollment') || ($policy_details['policy_type_id'] == 3 && $is_self_available_in_policy_terms)) // 3 is GMC parents dep addon)
|
||||
if(($policy_details['base_policy'] == null && ($file['action'] == 'inception' || $file['action'] == 'addition' || $file['action'] == 'enrollment')) || ($policy_details['policy_type_id'] == 3 && $is_self_available_in_policy_terms)) // 3 is GMC parents dep addon)
|
||||
{
|
||||
$res = check_self_available_in_family($family,$file['action']);
|
||||
if(!$res['is_self_found'])
|
||||
|
||||
@ -9,6 +9,8 @@ use Psr\Log\LoggerInterface;
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
use CodeIgniter\Files\File;
|
||||
|
||||
use App\Helpers\DepositHelper;
|
||||
|
||||
use App\Models\UserModel;
|
||||
use App\Models\ClientModel;
|
||||
use App\Models\ClientBranchModel;
|
||||
@ -26,6 +28,7 @@ use App\Models\TPAModel;
|
||||
use App\Models\StateModel;
|
||||
use App\Models\PolicyTypeModel;
|
||||
use App\Models\CDMasterModel;
|
||||
use App\Models\ClientDepositModel;
|
||||
|
||||
class MasterController extends AdminController
|
||||
{
|
||||
@ -48,6 +51,7 @@ class MasterController extends AdminController
|
||||
protected $policyTypeModel;
|
||||
protected $CDMasterModel;
|
||||
protected $clientModel;
|
||||
protected $clientDepositModel;
|
||||
|
||||
|
||||
|
||||
@ -74,9 +78,12 @@ class MasterController extends AdminController
|
||||
$this->policyTypeModel = new PolicyTypeModel();
|
||||
$this->CDMasterModel = new CDMasterModel();
|
||||
$this->clientModel = new ClientModel();
|
||||
$this->clientDepositModel = new ClientDepositModel();
|
||||
|
||||
}
|
||||
|
||||
|
||||
//start insurer
|
||||
public function insurerList()
|
||||
{
|
||||
$this->myLogger->logme('error','Insurer list function called');
|
||||
@ -108,7 +115,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function removeInsurerBranch($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Insurer Branch Remove function called');
|
||||
@ -124,9 +130,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function editInsurerOnboarding($id = null)
|
||||
{
|
||||
|
||||
@ -158,7 +161,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function insurerOnboarding()
|
||||
{
|
||||
|
||||
@ -189,7 +191,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function createInsurerGeneralInfo()
|
||||
{
|
||||
|
||||
@ -246,7 +247,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function insurerBranchList($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit Insurer Onboarding function called');
|
||||
@ -259,9 +259,6 @@ class MasterController extends AdminController
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function editInsurerGeneralInfo()
|
||||
{
|
||||
$this->myLogger->logme('error','edit Insurer general info function called');
|
||||
@ -291,7 +288,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editInsurerGet($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit TPA Onboarding function called');
|
||||
@ -341,15 +337,12 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Insurer Ends
|
||||
// Insurer Ends
|
||||
|
||||
|
||||
|
||||
|
||||
// TPA Start
|
||||
|
||||
// TPA Start
|
||||
|
||||
public function tpaList()
|
||||
{
|
||||
@ -367,7 +360,6 @@ class MasterController extends AdminController
|
||||
// $this->loadLayout('insurer_onboarding', $data);
|
||||
}
|
||||
|
||||
|
||||
public function tpaRemove($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','TPA Remove function called');
|
||||
@ -382,8 +374,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function removeTPABranch($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','TPA Branch Remove function called');
|
||||
@ -424,8 +414,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function createTPAGeneralInfo()
|
||||
{
|
||||
|
||||
@ -483,12 +471,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function createTPABranch()
|
||||
{
|
||||
|
||||
@ -521,8 +503,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function editTPAOnboarding($id = null)
|
||||
{
|
||||
|
||||
@ -555,9 +535,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function editTPAGeneralInfo()
|
||||
{
|
||||
$this->myLogger->logme('error','edit TPA general info function called');
|
||||
@ -624,7 +601,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editTPAGet($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit TPA Onboarding function called');
|
||||
@ -639,7 +615,6 @@ class MasterController extends AdminController
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
public function editTPABranch()
|
||||
{
|
||||
$this->myLogger->logme('error','TPA branch CREATE function called');
|
||||
@ -680,7 +655,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function tpaBranchList($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','TPA List function called');
|
||||
@ -693,14 +667,11 @@ class MasterController extends AdminController
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Ends TPA Models
|
||||
|
||||
|
||||
|
||||
//Start KYC
|
||||
|
||||
|
||||
public function kycList()
|
||||
{
|
||||
$this->myLogger->logme('error','KYC list function called');
|
||||
@ -731,7 +702,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function removeKYCDocs($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','KYC Docs Remove function called');
|
||||
@ -772,9 +742,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function createKYCInfo()
|
||||
{
|
||||
|
||||
@ -791,9 +758,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function createKycDocs()
|
||||
{
|
||||
|
||||
@ -818,7 +782,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editKYCOnboarding($id = null)
|
||||
{
|
||||
|
||||
@ -838,9 +801,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function kycDocsList($id = null)
|
||||
{
|
||||
|
||||
@ -855,8 +815,6 @@ class MasterController extends AdminController
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function editKYCInfo()
|
||||
{
|
||||
$this->myLogger->logme('error','edit KYC general info function called');
|
||||
@ -871,7 +829,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editKYCGet($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit KYC Onboarding function called');
|
||||
@ -884,8 +841,6 @@ class MasterController extends AdminController
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function editKYCDocs()
|
||||
{
|
||||
$this->myLogger->logme('error','edit KYC Docs function called');
|
||||
@ -899,16 +854,12 @@ class MasterController extends AdminController
|
||||
echo json_encode(array("status" => false));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Ends KYC
|
||||
|
||||
//Start Policy
|
||||
|
||||
|
||||
//Start Policy
|
||||
|
||||
public function policyTypeList()
|
||||
{
|
||||
$this->myLogger->logme('error','Policy Type list function called');
|
||||
@ -925,7 +876,6 @@ class MasterController extends AdminController
|
||||
// $this->loadLayout('insurer_onboarding', $data);
|
||||
}
|
||||
|
||||
|
||||
public function policyTypeRemove($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Policy Type Remove function called');
|
||||
@ -980,9 +930,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function createPolicies()
|
||||
{
|
||||
$this->myLogger->logme('error','Policies CREATE function called');
|
||||
@ -1004,9 +951,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function createPolicyType()
|
||||
{
|
||||
$this->myLogger->logme('error','Policy Type CREATE function called');
|
||||
@ -1023,7 +967,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editPolicyTypeOnboarding($id = null)
|
||||
{
|
||||
|
||||
@ -1044,7 +987,6 @@ class MasterController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function editPolicyType()
|
||||
{
|
||||
$this->myLogger->logme('error','edit Policy general info function called');
|
||||
@ -1059,7 +1001,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function policesList($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit Policies Onboarding function called');
|
||||
@ -1090,8 +1031,6 @@ class MasterController extends AdminController
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function editPoliciesGet($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','Edit Policies Onboarding function called');
|
||||
@ -1102,7 +1041,6 @@ class MasterController extends AdminController
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
public function editPolicies()
|
||||
{
|
||||
$this->myLogger->logme('error','edit Policy general info function called');
|
||||
@ -1117,9 +1055,11 @@ class MasterController extends AdminController
|
||||
echo json_encode(array("status" => false));
|
||||
}
|
||||
}
|
||||
|
||||
//end policies
|
||||
|
||||
|
||||
|
||||
//start CD Master list
|
||||
public function CDMasterList()
|
||||
{
|
||||
|
||||
@ -1129,7 +1069,6 @@ class MasterController extends AdminController
|
||||
$this->loadLayout('cd_master_list', $data);
|
||||
}
|
||||
|
||||
|
||||
public function createCDMasterData()
|
||||
{
|
||||
|
||||
@ -1137,13 +1076,30 @@ class MasterController extends AdminController
|
||||
$date = (string) $this->request->getPost('opening_date');
|
||||
$data['opening_date'] = date('Y-m-d', strtotime($date));
|
||||
|
||||
// Prepare the array with data
|
||||
$cd_tranction_data = [
|
||||
'amount' => $data['opening_bal'],
|
||||
'sub_type_id' => 7,
|
||||
'client_id' => $data['client_id'],
|
||||
'client_policy_id' => null,
|
||||
'cd_ac_no' => $data['cd_ac_no'],
|
||||
'endorsement_no' => null,
|
||||
'insurer_id' => $data['insurer_id'],
|
||||
'description' => 'opening Amount',
|
||||
'transaction_type' => 'Credit',
|
||||
'updated_by' => 1,
|
||||
];
|
||||
|
||||
$loggedInUserID = get_session_userid();
|
||||
|
||||
if ($data) {
|
||||
|
||||
$insert = $this->CDMasterModel->insert($data);
|
||||
|
||||
if ($insert) {
|
||||
|
||||
$response = DepositHelper::saveDeposit($cd_tranction_data, $loggedInUserID);
|
||||
|
||||
session()->setFlashdata('success', "Cash Deposite Master Added Successfully");
|
||||
return redirect()->to(base_url('/master/cash_deposite/list'));
|
||||
} else {
|
||||
@ -1158,7 +1114,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editCDMasterData($id = null)
|
||||
{
|
||||
|
||||
@ -1171,6 +1126,18 @@ class MasterController extends AdminController
|
||||
|
||||
$insert = $this->CDMasterModel->where('id', $id)->set($data)->update();
|
||||
|
||||
$cd_transaction_updated_data = [
|
||||
'balance' => $data['opening_bal'],
|
||||
'amount' => $data['opening_bal']
|
||||
];
|
||||
|
||||
$cd_tranction = $this->clientDepositModel
|
||||
->where('client_id', $data['client_id'])
|
||||
->where('insurer_id', $data['insurer_id'])
|
||||
->where('cd_ac_no', $data['cd_ac_no'])
|
||||
->where('sub_type', 7)
|
||||
->set($cd_transaction_updated_data)->update();
|
||||
|
||||
if ($insert) {
|
||||
|
||||
session()->setFlashdata('success', "Cash Deposite Master Updated Successfully");
|
||||
@ -1211,8 +1178,8 @@ class MasterController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function removeCDMaster($id){
|
||||
public function removeCDMaster($id)
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','CDMaster Remove function called');
|
||||
$data['updated_by'] = get_session_userid();
|
||||
|
||||
@ -92,11 +92,12 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
public function getVerifiedUserData()
|
||||
{
|
||||
try {
|
||||
// try {
|
||||
$mobile_number = $this->request->getJSON()->mobile_number;
|
||||
$otp = $this->request->getJSON()->otp;
|
||||
|
||||
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first();
|
||||
|
||||
if ($employeeData && $otp == $employeeData["otp"] || $employeeData && isset($this->request->getJSON()->login_by_hr)) {
|
||||
$auth = HttpRequestHelper::getRequestInfo();
|
||||
if ($auth) {
|
||||
@ -120,9 +121,9 @@ class RestAuthenticationController extends AdminController
|
||||
} else {
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP"],200);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
|
||||
}
|
||||
// } catch (\Exception $e) {
|
||||
// return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
|
||||
// }
|
||||
}
|
||||
|
||||
public function verifyHrWithMobileNumber()
|
||||
|
||||
@ -71,7 +71,8 @@ class UserController extends AdminController
|
||||
$admin = 0;
|
||||
}
|
||||
foreach ($temp_team as $key => $value) {
|
||||
if($value == 2){
|
||||
$team = $this->teamModel->where('id' , $value)->first();
|
||||
if($team['name'] == 'Claims'){
|
||||
$hdz_staff = [
|
||||
'emp_code' => $userData['emp_code'],
|
||||
'fullname' => $userData['first_name'],
|
||||
|
||||
@ -13,6 +13,7 @@ use ReflectionClass;
|
||||
require_once('../vendor/autoload.php');
|
||||
|
||||
use App\Models\EmployeeModel;
|
||||
use App\Models\LevelContactModel;
|
||||
|
||||
|
||||
class AuthJWT implements FilterInterface
|
||||
@ -20,7 +21,6 @@ class AuthJWT implements FilterInterface
|
||||
public function before(RequestInterface $request, $arguments = null)
|
||||
{
|
||||
$jwt = $request->getHeader('Authorization');
|
||||
$model = new EmployeeModel();
|
||||
|
||||
if ($jwt) {
|
||||
if (JWTToken::validateJWT($jwt)) {
|
||||
@ -28,22 +28,44 @@ class AuthJWT implements FilterInterface
|
||||
$data = json_decode($data);
|
||||
|
||||
$id = $data->decoded->id;
|
||||
$user_data = $model->where('id', $id)->first();
|
||||
if(isset($data->decoded->emp_code)){
|
||||
$model = new EmployeeModel();
|
||||
$user_data = $model->where('id', $id)->first();
|
||||
|
||||
if($user_data['token_time_out'] > time()){
|
||||
$data =["token_time_out" => time() + getenv('TOKENTIMEOUT') ];
|
||||
$model->update($id, $data);
|
||||
return true;
|
||||
if($user_data['token_time_out'] > time()){
|
||||
$data =["token_time_out" => time() + getenv('TOKENTIMEOUT') ];
|
||||
$model->update($id, $data);
|
||||
return true;
|
||||
}else{
|
||||
$data =["token_time_out" => ''];
|
||||
$model->update($id, $data);
|
||||
header('Content-Type: application/json');
|
||||
http_response_code(401);
|
||||
// $error = json_encode(["status" => 401, "message" => $data->message]);
|
||||
$error = json_encode(["status" => 401, "message" => "Token is Invalid"]);
|
||||
echo $error;
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
$data =["token_time_out" => ''];
|
||||
$model->update($id, $data);
|
||||
header('Content-Type: application/json');
|
||||
http_response_code(401);
|
||||
// $error = json_encode(["status" => 401, "message" => $data->message]);
|
||||
$error = json_encode(["status" => 401, "message" => "Token is Invalid"]);
|
||||
echo $error;
|
||||
exit;
|
||||
$model = new LevelContactModel();
|
||||
$hr_data = $model->where('id', $id)->first();
|
||||
|
||||
if($hr_data['token_time_out'] > time()){
|
||||
$data =["token_time_out" => time() + getenv('TOKENTIMEOUT') ];
|
||||
$model->update($id, $data);
|
||||
return true;
|
||||
}else{
|
||||
$data =["token_time_out" => ''];
|
||||
$model->update($id, $data);
|
||||
header('Content-Type: application/json');
|
||||
http_response_code(401);
|
||||
// $error = json_encode(["status" => 401, "message" => $data->message]);
|
||||
$error = json_encode(["status" => 401, "message" => "Token is Invalid"]);
|
||||
echo $error;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
|
||||
@ -94,7 +94,7 @@ class DepositHelper
|
||||
// $getLastBalanceQuery = "SELECT balance FROM cash_deposit WHERE client_id = ? AND insurer_id = ? ORDER BY created_at DESC LIMIT 1";
|
||||
// $getLastBalanceParams = [$clientId, $insurerId];
|
||||
|
||||
$getLastBalanceQuery = "SELECT balance FROM cash_deposit WHERE cd_ac_no = ? ORDER BY created_at DESC LIMIT 1";
|
||||
$getLastBalanceQuery = "SELECT balance FROM cash_deposit WHERE cd_ac_no = ? AND is_active = 1 ORDER BY created_at DESC LIMIT 1";
|
||||
$getLastBalanceParams = [$cd_ac_no];
|
||||
|
||||
$lastBalance = $model->query($getLastBalanceQuery, $getLastBalanceParams)->getRow()->balance ?? null;
|
||||
@ -103,7 +103,7 @@ class DepositHelper
|
||||
|
||||
$cd_model = new ClientDepositModel();
|
||||
|
||||
$getLastBalanceQuery = "SELECT opening_bal FROM cd_master WHERE client_id = ? AND insurer_id = ? AND cd_ac_no = ? ORDER BY created_at DESC LIMIT 1";
|
||||
$getLastBalanceQuery = "SELECT opening_bal FROM cd_master WHERE client_id = ? AND insurer_id = ? AND cd_ac_no = ? AND is_active = 1 ORDER BY created_at DESC LIMIT 1";
|
||||
$getLastBalanceParams = [$clientId, $insurerId, $cd_ac_no];
|
||||
|
||||
$lastBalance = $cd_model->query($getLastBalanceQuery, $getLastBalanceParams)->getRow()->opening_bal ?? 0;
|
||||
|
||||
@ -13,6 +13,7 @@ use CodeIgniter\HTTP\RequestInterface;
|
||||
use ReflectionClass;
|
||||
|
||||
use App\Models\EmployeeModel;
|
||||
use App\Models\LevelContactModel;
|
||||
|
||||
|
||||
class JWTToken
|
||||
@ -25,13 +26,19 @@ class JWTToken
|
||||
|
||||
try{
|
||||
$token = JWT::encode($request_data ,$secret_Key,'HS512');
|
||||
|
||||
$model = new EmployeeModel();
|
||||
$id = $request_data['id'];
|
||||
$data =[
|
||||
"token_time_out" => time() + getenv('TOKENTIMEOUT')
|
||||
];
|
||||
$model->update($id, $data);
|
||||
$data["token_time_out"] = time() + getenv('TOKENTIMEOUT');
|
||||
|
||||
if(isset($data['emp_code'])){
|
||||
$model = new EmployeeModel();
|
||||
$model->update($id, $data);
|
||||
|
||||
}else{
|
||||
$models = new LevelContactModel();
|
||||
$models->update($id, $data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use PhpOffice\PhpSpreadsheet\Reader\Exception as SpreadsheetReaderException;
|
||||
|
||||
|
||||
|
||||
@ -280,9 +281,9 @@ if (!function_exists('add_totals_row')) {
|
||||
$totalSum = 0;
|
||||
|
||||
foreach ($data as $row) {
|
||||
$gstSum += $row[18];
|
||||
$proRataPremiumSum += $row[19];
|
||||
$totalSum += $row[20];
|
||||
$gstSum += floatval($row[18]);
|
||||
$proRataPremiumSum += floatval($row[19]);
|
||||
$totalSum += floatval($row[20]);
|
||||
}
|
||||
|
||||
// Add a new row with sums
|
||||
@ -535,3 +536,439 @@ if (!function_exists('format_Excel_BasedOn_Client'))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(!function_exists('generate_excel_second_stage')){
|
||||
|
||||
function generate_excel_second_stage($headers, $data, $filename, $totals = null)
|
||||
{
|
||||
// Create a new Spreadsheet object
|
||||
$spreadsheet = new Spreadsheet();
|
||||
|
||||
// Set the active sheet title
|
||||
$spreadsheet->getActiveSheet()->setTitle('Sheet 1');
|
||||
|
||||
// Set headers into the spreadsheet
|
||||
$headerValues = [];
|
||||
foreach ($headers as $header) {
|
||||
$headerValues[] = $header['column_name'];
|
||||
}
|
||||
$spreadsheet->getActiveSheet()->fromArray([$headerValues], null, 'A1');
|
||||
|
||||
// Set data into the spreadsheet
|
||||
$dataValues = [];
|
||||
$serialNumber = 0; // Initialize serial number
|
||||
foreach ($data as $row) {
|
||||
$serialNumber++; // Increment serial number for each row
|
||||
|
||||
$rowData = [];
|
||||
foreach ($headers as $header) {
|
||||
$fieldName = $header['header_name'];
|
||||
|
||||
if ($fieldName === 'index') {
|
||||
$value = $serialNumber;
|
||||
} else {
|
||||
$value = $row->$fieldName ?? '';
|
||||
}
|
||||
|
||||
$rowData[] = $value;
|
||||
}
|
||||
$dataValues[] = $rowData;
|
||||
}
|
||||
// dd($dataValues, $headerValues);
|
||||
$spreadsheet->getActiveSheet()->fromArray($dataValues, null, 'A2');
|
||||
|
||||
// Add totals if specified
|
||||
if ($totals === 1) {
|
||||
// Call function to add totals row for inception
|
||||
add_totals_row($spreadsheet, $data, $headers);
|
||||
} else if ($totals === 2) {
|
||||
// Call function to add totals row for deletion
|
||||
add_totals_for_deletion($spreadsheet, $data);
|
||||
}
|
||||
|
||||
// Create Excel writer
|
||||
$writer = new Xlsx($spreadsheet);
|
||||
|
||||
try {
|
||||
// Save Excel file to the specified path
|
||||
$writer->save($filename);
|
||||
return true; // Return true if file was successfully saved
|
||||
} catch (\Exception $e) {
|
||||
// Log or handle the exception
|
||||
return false; // Return false if there was an error saving the file
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!function_exists('generate_excel_third_stage')){
|
||||
|
||||
function generate_excel_third_stage($headers, $data, $filename, $totals = null)
|
||||
{
|
||||
// Create a new Spreadsheet object
|
||||
$spreadsheet = new Spreadsheet();
|
||||
|
||||
// Set the active sheet title
|
||||
$spreadsheet->getActiveSheet()->setTitle('Sheet 1');
|
||||
|
||||
$spreadsheet->getActiveSheet()->fromArray([$headers], null, 'A1');
|
||||
|
||||
$spreadsheet->getActiveSheet()->fromArray($data, null, 'A2');
|
||||
|
||||
// Add totals if specified
|
||||
if ($totals === 1) {
|
||||
// Call function to add totals row for inception
|
||||
add_totals_row($spreadsheet, $data, $headers);
|
||||
} else if ($totals === 2) {
|
||||
// Call function to add totals row for deletion
|
||||
add_totals_for_deletion($spreadsheet, $data);
|
||||
}
|
||||
|
||||
// Create Excel writer
|
||||
$writer = new Xlsx($spreadsheet);
|
||||
|
||||
try {
|
||||
// Save Excel file to the specified path
|
||||
$writer->save($filename);
|
||||
return true; // Return true if file was successfully saved
|
||||
} catch (\Exception $e) {
|
||||
// Log or handle the exception
|
||||
return false; // Return false if there was an error saving the file
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(!function_exists('generate_insurer_based_excel')){
|
||||
|
||||
function generate_insurer_based_excel($excel_header_array, $excel_need_data){
|
||||
|
||||
usort($excel_header_array, function($a, $b) {
|
||||
return $a['column_index'] <=> $b['column_index'];
|
||||
});
|
||||
|
||||
|
||||
//construct HEADER
|
||||
$headerValues = [];
|
||||
foreach ($excel_header_array as $header) {
|
||||
$headerValues[] = $header['column_name'];
|
||||
}
|
||||
|
||||
//construct EXCEL DATA
|
||||
$dataValues = [];
|
||||
$serialNumber = 0; // Initialize serial number
|
||||
foreach ($excel_need_data as $row) {
|
||||
$serialNumber++;
|
||||
|
||||
$rowData = [];
|
||||
foreach ($excel_header_array as $header) {
|
||||
$fieldName = $header['header_name'];
|
||||
|
||||
if ($fieldName === 'index') {
|
||||
$value = $serialNumber;
|
||||
} else {
|
||||
$value = $row->$fieldName ?? '';
|
||||
}
|
||||
|
||||
$rowData[] = $value;
|
||||
}
|
||||
$dataValues[] = $rowData;
|
||||
}
|
||||
|
||||
return ['header' => $headerValues, 'data' => $dataValues];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!function_exists('read_first_row_of_excel')){
|
||||
|
||||
function read_first_row_of_excel($file)
|
||||
{
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
try {
|
||||
$reader = IOFactory::createReaderForFile($file->getPathname());
|
||||
$spreadsheet = $reader->load($file->getPathname());
|
||||
|
||||
// Get the active sheet
|
||||
$sheet = $spreadsheet->getActiveSheet();
|
||||
|
||||
// Initialize the data array
|
||||
$data = [];
|
||||
|
||||
// Iterate through rows to read data (only the first row)
|
||||
$row = $sheet->getRowIterator()->current(); // Get the first row
|
||||
$rowData = [];
|
||||
foreach ($row->getCellIterator() as $cell) {
|
||||
$rowData[] = $cell->getValue();
|
||||
}
|
||||
$data = $rowData; // Assign the first row data to $data
|
||||
|
||||
return $data;
|
||||
|
||||
} catch (SpreadsheetReaderException $e) {
|
||||
error_log('PhpSpreadsheet reader exception: ' . $e->getMessage());
|
||||
return $e->getMessage();
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!function_exists('query_construct_for_emp_policy_id')){
|
||||
function query_construct_for_emp_policy_id($employees, $col_index){
|
||||
|
||||
// Load the database connection
|
||||
$db = \Config\Database::connect();
|
||||
|
||||
// Start building the query
|
||||
$subQuery = '';
|
||||
foreach ($employees as $index => $employee) {
|
||||
if ($index > 1) {
|
||||
$subQuery .= " UNION ALL ";
|
||||
}
|
||||
if($index == 1){
|
||||
$row_id_alise = ' AS row_id,';
|
||||
$emp_name_alise = 'AS name,';
|
||||
$emp_code_alise = 'AS emp_code,';
|
||||
$emp_dob_alise = 'AS emp_dob,';
|
||||
$emp_gender_alise = 'AS emp_gender,';
|
||||
$pre_existing_alignments_alise = 'AS pre_existing_alignments,';
|
||||
$basic_cover_si_alise = 'AS basic_cover_si,';
|
||||
$emp_relationship_alise = 'AS emp_relationship,';
|
||||
$policy_end_date_alise = 'AS policy_end_date,';
|
||||
$days_alise = 'AS days,';
|
||||
$premium_alise = 'AS premium,';
|
||||
$rata_premimum_alise = 'AS rata_premimum,';
|
||||
$gst_alise = 'AS gst';
|
||||
}else{
|
||||
$row_id_alise = ',';
|
||||
$emp_name_alise = ',';
|
||||
$emp_code_alise = ',';
|
||||
$emp_dob_alise = ',';
|
||||
$emp_gender_alise = ',';
|
||||
$pre_existing_alignments_alise = ',';
|
||||
$basic_cover_si_alise = ',';
|
||||
$emp_relationship_alise = ',';
|
||||
$policy_end_date_alise = ',';
|
||||
$days_alise = ',';
|
||||
$premium_alise = ',';
|
||||
$rata_premimum_alise = ',';
|
||||
$gst_alise = '';
|
||||
}
|
||||
$subQuery .= "SELECT " . intval($index) . $row_id_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['emp_name']] . "'" . $emp_name_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['emp_code']] . "'" . $emp_code_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['emp_dob']] . "'" . $emp_dob_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['emp_gender']] . "'" . $emp_gender_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['pre_existing_alignments']] . "'" . $pre_existing_alignments_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['basic_cover_si']] . "'" . $basic_cover_si_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['emp_relationship']] . "'" . $emp_relationship_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['policy_end_date']] . "'" . $policy_end_date_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['days']] . "'" . $days_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['premium']] . "'" . $premium_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['rata_premimum']] . "'" . $rata_premimum_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['gst']] . "'" . $gst_alise;
|
||||
}
|
||||
|
||||
// Complete the query
|
||||
$mainQuery = "
|
||||
SELECT
|
||||
c.row_id,
|
||||
c.emp_code,
|
||||
c.name,
|
||||
c.emp_dob,
|
||||
c.emp_gender ,
|
||||
c.emp_relationship,
|
||||
c.pre_existing_alignments,
|
||||
c.basic_cover_si ,
|
||||
c.policy_end_date ,
|
||||
c.days ,
|
||||
c.premium ,
|
||||
c.rata_premimum ,
|
||||
c.gst,
|
||||
|
||||
e.emp_code AS db_emp_code,
|
||||
e.name AS db_name ,
|
||||
e.dob as db_dob,
|
||||
e.gender as db_gender,
|
||||
e.relationship as db_emp_relationship,
|
||||
ep.pre_existing_alignments as db_pre_existing_alignments,
|
||||
ep.basic_cover_si as db_basic_cover_si,
|
||||
ep.policy_end_date as db_policy_end_date,
|
||||
ep.days as db_days,
|
||||
ep.premium as db_premium,
|
||||
ep.rata_premimum as db_rata_premimum,
|
||||
ep.gst as db_gst
|
||||
|
||||
FROM ({$subQuery}) AS c
|
||||
LEFT JOIN employees e
|
||||
ON c.emp_code = e.emp_code
|
||||
AND c.name = e.name
|
||||
AND c.emp_dob = e.dob
|
||||
AND c.emp_gender = e.gender
|
||||
AND c.emp_relationship = e.relationship
|
||||
|
||||
LEFT JOIN employee_polices ep
|
||||
ON c.pre_existing_alignments = ep.pre_existing_alignments
|
||||
AND c.basic_cover_si = ep.basic_cover_si
|
||||
AND c.policy_end_date = ep.policy_end_date
|
||||
AND c.days = ep.days
|
||||
AND c.premium = ep.premium
|
||||
AND c.rata_premimum = ep.rata_premimum
|
||||
AND c.gst = ep.gst
|
||||
|
||||
WHERE e.emp_code IS NOT NULL
|
||||
AND e.name IS NOT NULL
|
||||
AND e.dob IS NOT NULL
|
||||
AND e.gender IS NOT NULL
|
||||
AND e.relationship IS NOT NULL
|
||||
AND ep.pre_existing_alignments IS NOT NULL
|
||||
AND ep.basic_cover_si IS NOT NULL
|
||||
AND ep.policy_end_date IS NOT NULL
|
||||
AND ep.days IS NOT NULL
|
||||
AND ep.premium IS NOT NULL
|
||||
AND ep.rata_premimum IS NOT NULL
|
||||
AND ep.gst IS NOT NULL
|
||||
";
|
||||
|
||||
|
||||
// return $mainQuery;
|
||||
// Execute the query
|
||||
$query = $db->query($mainQuery);
|
||||
$result = $query->getResultArray();
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!function_exists('query_construct_second_stage')){
|
||||
function query_construct_second_stage($employees, $col_index){
|
||||
|
||||
// Load the database connection
|
||||
$db = \Config\Database::connect();
|
||||
|
||||
// Start building the query
|
||||
$subQuery = '';
|
||||
foreach ($employees as $index => $employee) {
|
||||
if ($index > 1) {
|
||||
$subQuery .= " UNION ALL ";
|
||||
}
|
||||
if($index == 1){
|
||||
$row_id_alise = ' AS row_id,';
|
||||
$emp_name_alise = 'AS name,';
|
||||
$emp_code_alise = 'AS emp_code,';
|
||||
$emp_dob_alise = 'AS emp_dob,';
|
||||
$emp_gender_alise = 'AS emp_gender,';
|
||||
$pre_existing_alignments_alise = 'AS pre_existing_alignments,';
|
||||
$basic_cover_si_alise = 'AS basic_cover_si,';
|
||||
$emp_relationship_alise = 'AS emp_relationship,';
|
||||
$policy_end_date_alise = 'AS policy_end_date,';
|
||||
$days_alise = 'AS days,';
|
||||
$premium_alise = 'AS premium,';
|
||||
$rata_premimum_alise = 'AS rata_premimum,';
|
||||
$gst_alise = 'AS gst';
|
||||
}else{
|
||||
$row_id_alise = ',';
|
||||
$emp_name_alise = ',';
|
||||
$emp_code_alise = ',';
|
||||
$emp_dob_alise = ',';
|
||||
$emp_gender_alise = ',';
|
||||
$pre_existing_alignments_alise = ',';
|
||||
$basic_cover_si_alise = ',';
|
||||
$emp_relationship_alise = ',';
|
||||
$policy_end_date_alise = ',';
|
||||
$days_alise = ',';
|
||||
$premium_alise = ',';
|
||||
$rata_premimum_alise = ',';
|
||||
$gst_alise = '';
|
||||
}
|
||||
$subQuery .= "SELECT " . intval($index) . $row_id_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['emp_name']] . "'" . $emp_name_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['emp_code']] . "'" . $emp_code_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['emp_dob']] . "'" . $emp_dob_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['emp_gender']] . "'" . $emp_gender_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['pre_existing_alignments']] . "'" . $pre_existing_alignments_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['basic_cover_si']] . "'" . $basic_cover_si_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['emp_relationship']] . "'" . $emp_relationship_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['policy_end_date']] . "'" . $policy_end_date_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['days']] . "'" . $days_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['premium']] . "'" . $premium_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['rata_premimum']] . "'" . $rata_premimum_alise;
|
||||
$subQuery .= "'" . $employee[$col_index['gst']] . "'" . $gst_alise;
|
||||
}
|
||||
|
||||
// Complete the query
|
||||
$mainQuery = "
|
||||
SELECT
|
||||
c.row_id,
|
||||
c.emp_code,
|
||||
c.name,
|
||||
c.emp_dob,
|
||||
c.emp_gender ,
|
||||
c.emp_relationship,
|
||||
c.pre_existing_alignments,
|
||||
c.basic_cover_si ,
|
||||
c.policy_end_date ,
|
||||
c.days ,
|
||||
c.premium ,
|
||||
c.rata_premimum ,
|
||||
c.gst,
|
||||
|
||||
e.emp_code AS db_emp_code,
|
||||
e.name AS db_name ,
|
||||
e.dob as db_dob,
|
||||
e.gender as db_gender,
|
||||
e.relationship as db_emp_relationship,
|
||||
ep.pre_existing_alignments as db_pre_existing_alignments,
|
||||
ep.basic_cover_si as db_basic_cover_si,
|
||||
ep.policy_end_date as db_policy_end_date,
|
||||
ep.days as db_days,
|
||||
ep.premium as db_premium,
|
||||
ep.rata_premimum as db_rata_premimum,
|
||||
ep.gst as db_gst
|
||||
|
||||
FROM ({$subQuery}) AS c
|
||||
LEFT JOIN employees e
|
||||
ON c.emp_code = e.emp_code
|
||||
AND c.name = e.name
|
||||
AND c.emp_dob = e.dob
|
||||
AND c.emp_gender = e.gender
|
||||
AND c.emp_relationship = e.relationship
|
||||
|
||||
LEFT JOIN employee_polices ep
|
||||
ON c.pre_existing_alignments = ep.pre_existing_alignments
|
||||
AND c.basic_cover_si = ep.basic_cover_si
|
||||
AND c.policy_end_date = ep.policy_end_date
|
||||
AND c.days = ep.days
|
||||
AND c.premium = ep.premium
|
||||
AND c.rata_premimum = ep.rata_premimum
|
||||
AND c.gst = ep.gst
|
||||
|
||||
WHERE e.emp_code IS NULL
|
||||
AND e.name IS NULL
|
||||
AND e.dob IS NULL
|
||||
AND e.gender IS NULL
|
||||
AND e.relationship IS NULL
|
||||
AND ep.pre_existing_alignments IS NULL
|
||||
AND ep.basic_cover_si IS NULL
|
||||
AND ep.policy_end_date IS NULL
|
||||
AND ep.days IS NULL
|
||||
AND ep.premium IS NULL
|
||||
AND ep.rata_premimum IS NULL
|
||||
AND ep.gst IS NULL
|
||||
";
|
||||
|
||||
|
||||
// return $mainQuery;
|
||||
// Execute the query
|
||||
$query = $db->query($mainQuery);
|
||||
$result = $query->getResultArray();
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -10,9 +10,10 @@ if(!function_exists('calculate_days_bw_dates'))
|
||||
function calculate_days_bw_dates(string $from_date = "", string $to_date ="",bool $include_start_date = true)
|
||||
{
|
||||
if($to_date == ""){ $currentDateTime = new DateTime(); }
|
||||
else{ $currentDateTime = new DateTime($to_date); }
|
||||
else{ $to_date = convert_string_to_date($to_date); $currentDateTime = new DateTime($to_date); }
|
||||
|
||||
if($from_date == ""){ $passedDateTime = new DateTime(); }
|
||||
else{ $passedDateTime = new DateTime($from_date); }
|
||||
else{ $from_date = convert_string_to_date($from_date); $passedDateTime = new DateTime($from_date); }
|
||||
|
||||
$interval = $currentDateTime->diff($passedDateTime);
|
||||
// $totalDays = $interval->days;
|
||||
@ -246,7 +247,7 @@ if(!function_exists('check_si'))
|
||||
}
|
||||
|
||||
// check age slab
|
||||
if(in_array(strtoupper($row['current_action']), ['I','A','DA']) && strtolower($row['5']) == 'self')
|
||||
if(in_array(strtoupper($row['current_action']), ['I','A','DA']) && (($slab_value['premium_type'] == 1 && strtolower($row['5']) == 'self' ) || ($slab_value['premium_type'] == 2) ) )
|
||||
{
|
||||
if($row[3] != '' && $row[3] != null)// dob
|
||||
{
|
||||
@ -632,7 +633,7 @@ if (!function_exists('check_dependent_conflict'))
|
||||
}
|
||||
}
|
||||
//check for any cross parents but not more than two
|
||||
if($allowed_adults == 0 && $allowed_parents_count == 1 && $allowed_parent_in_laws_count == 1 && (2 < ($received_parents_count + $received_parent_in_laws_count)))
|
||||
if($allowed_adults == 2 && (2 < ($received_parents_count + $received_parent_in_laws_count)))
|
||||
{
|
||||
// dd($allowed_adults);
|
||||
$result['status'] = false;
|
||||
@ -787,6 +788,22 @@ if (!function_exists('calculate_premimum'))
|
||||
}
|
||||
}
|
||||
|
||||
//set primary_rack_rate_acting_self in emp_details_with_empband_max_age_max_count array for policies where self not available and premium type is 1 (i.e.) GMC parents as dep addon policy
|
||||
$transformed_familiy_member_data['temp']['primary_rack_rate_acting_self'] = false;
|
||||
if(!isset($emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['primary_rack_rate_acting_self']) && $current_grid_info['type'] == 'primary')
|
||||
{
|
||||
if(strtolower($transformed_familiy_member_data['relationship']) == 'self')
|
||||
{
|
||||
$transformed_familiy_member_data['temp']['primary_rack_rate_acting_self'] = true;
|
||||
$emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['primary_rack_rate_acting_self'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$transformed_familiy_member_data['temp']['primary_rack_rate_acting_self'] = true;
|
||||
$emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['primary_rack_rate_acting_self'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
//generate relationship code
|
||||
if($transformed_familiy_member_data['temp']['action'] != 'D' && $transformed_familiy_member_data['temp']['action'] != 'C' && $transformed_familiy_member_data['temp']['action'] != 'SI')
|
||||
{
|
||||
@ -1013,7 +1030,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$employee_received_si = $default_si == null ? $emp_data['policy_details']['basic_cover_si'] : $default_si;
|
||||
foreach ($temp_slab_rates as $skey => $slab_value)
|
||||
{
|
||||
if($slab_value['si'] == $employee_received_si && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['additional_rack_rate_acting_self']) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
if($slab_value['si'] == $employee_received_si && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['primary_rack_rate_acting_self'] || $emp_data['temp']['additional_rack_rate_acting_self']) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
{
|
||||
$emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
$emp_data['policy_details']['date_coverage'] = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
@ -1036,7 +1053,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
foreach ($temp_slab_rates as $skey => $slab_value)
|
||||
{
|
||||
$age = calculate_days_bw_dates(from_date: $emp_data['dob'])->y;
|
||||
if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['additional_rack_rate_acting_self']) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['primary_rack_rate_acting_self'] || $emp_data['temp']['additional_rack_rate_acting_self']) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
{
|
||||
// dd($slab_value);
|
||||
$emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
@ -1057,7 +1074,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
foreach ($temp_slab_rates as $skey => $slab_value)
|
||||
{
|
||||
$age = calculate_days_bw_dates(from_date: $emp_data['dob'])->y;
|
||||
if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['additional_rack_rate_acting_self']) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['primary_rack_rate_acting_self'] || $emp_data['temp']['additional_rack_rate_acting_self']) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
{
|
||||
$emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
$emp_data['policy_details']['date_coverage'] = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
@ -1077,7 +1094,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
foreach ($temp_slab_rates as $skey => $slab_value)
|
||||
{
|
||||
$age = calculate_days_bw_dates(from_date: $emp_data['dob'])->y;
|
||||
if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['additional_rack_rate_acting_self']) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['primary_rack_rate_acting_self'] || $emp_data['temp']['additional_rack_rate_acting_self']) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
{
|
||||
// echo $emp_data['name'];
|
||||
$emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
@ -1099,7 +1116,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
foreach ($temp_slab_rates as $skey => $slab_value)
|
||||
{
|
||||
$age = calculate_days_bw_dates(from_date: $emp_data['dob'])->y;
|
||||
if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['additional_rack_rate_acting_self']) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['primary_rack_rate_acting_self'] || $emp_data['temp']['additional_rack_rate_acting_self']) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
{
|
||||
$emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
$emp_data['policy_details']['date_coverage'] = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
@ -1121,7 +1138,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
foreach ($temp_slab_rates as $skey => $slab_value)
|
||||
{
|
||||
|
||||
if($slab_value['grade'] == $employee_received_band && $slab_value['si'] == $employee_received_si && (($slab_value['premium_type'] == 1 && (strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['additional_rack_rate_acting_self']) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
if($slab_value['grade'] == $employee_received_band && $slab_value['si'] == $employee_received_si && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['primary_rack_rate_acting_self'] || $emp_data['temp']['additional_rack_rate_acting_self']) ) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
{
|
||||
// $emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
$emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
@ -1143,7 +1160,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
foreach ($temp_slab_rates as $skey => $slab_value)
|
||||
{
|
||||
|
||||
if($slab_value['si'] == $employee_received_si && (($slab_value['premium_type'] == 1 && (strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['additional_rack_rate_acting_self'])) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
if($slab_value['si'] == $employee_received_si && (($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['primary_rack_rate_acting_self'] || $emp_data['temp']['additional_rack_rate_acting_self'])) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
{
|
||||
$emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
$emp_data['policy_details']['date_coverage'] = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
@ -1170,7 +1187,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
if( $slab_value['si'] == $employee_received_si &&
|
||||
($slab_value['age_from'] <= $max_age && $slab_value['age_to'] >= $max_age) &&
|
||||
(($slab_value['premium_type'] == 1 &&
|
||||
( (strtolower($emp_data['relationship']) == 'self') || ($emp_data['temp']['additional_rack_rate_acting_self']) )) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ) )
|
||||
( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['primary_rack_rate_acting_self'] || $emp_data['temp']['additional_rack_rate_acting_self'])) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ) )
|
||||
{
|
||||
$emp_data['policy_details']['basic_cover_si'] = $employee_received_si;
|
||||
$emp_data['policy_details']['date_coverage'] = isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date'];
|
||||
@ -1195,7 +1212,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
{
|
||||
|
||||
if($slab_value['si'] == $employee_received_si && $slab_value['grade'] == $employee_received_band && (($slab_value['premium_type'] == 1 &&
|
||||
( (strtolower($emp_data['relationship']) == 'self') || ($emp_data['temp']['additional_rack_rate_acting_self']) )) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['primary_rack_rate_acting_self'] || $emp_data['temp']['additional_rack_rate_acting_self'])) || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
{
|
||||
//calculate premium based on count
|
||||
// echo $emp_data['name'];
|
||||
@ -1224,7 +1241,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['basic_cover_si'] = null;
|
||||
foreach ($temp_slab_rates as $skey => $slab_value)
|
||||
{
|
||||
if( $slab_value['si'] == $employee_received_si && ((($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) && $slab_value['relationship'] == $employee_relationship) || ($slab_value['premium_type'] == 1 && (strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['additional_rack_rate_acting_self'] ) )) )
|
||||
if( $slab_value['si'] == $employee_received_si && ((($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) && $slab_value['relationship'] == $employee_relationship) || ($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['primary_rack_rate_acting_self'] || $emp_data['temp']['additional_rack_rate_acting_self']) )) )
|
||||
{
|
||||
|
||||
$emp_data['policy_details']['basic_cover_si'] = $employee_received_si;
|
||||
@ -1249,7 +1266,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$age = calculate_days_bw_dates(from_date: $emp_data['dob'])->y;
|
||||
foreach ($temp_slab_rates as $skey => $slab_value)
|
||||
{
|
||||
if( $slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && ((($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) && $slab_value['relationship'] == $employee_relationship) || ($slab_value['premium_type'] == 1 && (strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['additional_rack_rate_acting_self']) )) )
|
||||
if( $slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && ((($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) && $slab_value['relationship'] == $employee_relationship) || ($slab_value['premium_type'] == 1 && ( strtolower($emp_data['relationship']) == 'self' || $emp_data['temp']['primary_rack_rate_acting_self'] || $emp_data['temp']['additional_rack_rate_acting_self']) )) )
|
||||
{
|
||||
|
||||
$emp_data['policy_details']['basic_cover_si'] = $employee_received_si;
|
||||
|
||||
658
app/Helpers/header.php
Normal file
658
app/Helpers/header.php
Normal file
@ -0,0 +1,658 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title><?= isset($page_name) ? $page_name : 'NHance'; ?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta content="" name="description" />
|
||||
<meta content="NHANCE" name="NHANCE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
|
||||
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi.svg">
|
||||
|
||||
<!-- plugin css -->
|
||||
<link href="<?= base_url() . "public"; ?>/assets/libs/admin-resources/jquery.vectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!-- third party css -->
|
||||
<link href="<?= base_url() . "public"; ?>/assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?= base_url() . "public"; ?>/assets/libs/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?= base_url() . "public"; ?>/assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?= base_url() . "public"; ?>/assets/libs/datatables.net-select-bs4/css//select.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<!-- third party css end -->
|
||||
|
||||
<!-- App css -->
|
||||
<link href="<?= base_url() . "public"; ?>/assets/css/bootstrap-creative.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
|
||||
<link href="<?= base_url() . "public"; ?>/assets/css/app-creative.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" />
|
||||
|
||||
<link href="<?= base_url() . "public"; ?>/assets/css/bootstrap-creative-dark.min.css" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" />
|
||||
<link href="<?= base_url() . "public"; ?>/assets/css/app-creative-dark.min.css" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />
|
||||
|
||||
<!-- icons -->
|
||||
<link href="<?= base_url() . "public"; ?>/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
|
||||
<!-- <link href="<?= base_url() . "public"; ?>/assets/css/bootstrap-material.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" /> -->
|
||||
<!-- <link href="<?= base_url() . "public"; ?>/assets/css/app-material.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" /> -->
|
||||
|
||||
|
||||
<!-- <link href="<?= base_url() . "public"; ?>/assets/css/bootstrap-editable.css" rel="stylesheet" type="text/css" /> -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon/fonts/remixicon.css" rel="stylesheet">
|
||||
|
||||
<!-- Jodit Css -->
|
||||
<link href="<?= base_url() . "public"; ?>/assets/css/jodit.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
|
||||
<!-- JQuery CDN -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<!-- Sweet Alert CDN -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.10.4/dist/sweetalert2.all.min.js"></script>
|
||||
|
||||
<!-- select2 -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" type="text/css">
|
||||
|
||||
|
||||
<link rel="manifest" href="../manifest.json">
|
||||
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', function() {
|
||||
navigator.serviceWorker.register('../service-worker.js').then(function(registration) {
|
||||
// console.log('Service Worker registration successful with scope:', registration.scope);
|
||||
}, function(err) {
|
||||
// console.log('Service Worker registration failed:', err);
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
|
||||
body[data-sidebar-size=condensed]:not([data-layout=compact]):not(.auth-fluid-pages) {
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.navbar-custom {
|
||||
top: -10px !important;
|
||||
height: 61px !important;
|
||||
}
|
||||
|
||||
.logo-box {
|
||||
top: -10px !important;
|
||||
height: 61px !important;
|
||||
}
|
||||
|
||||
.content-page {
|
||||
padding: 80px 15px 65px 15px !important;
|
||||
}
|
||||
|
||||
/* Media query for small screens */
|
||||
@media screen and (min-width: 768px) {
|
||||
|
||||
/* Styles for screens with a minimum width of 768px (e.g., tablets and larger devices) */
|
||||
.navbar-custom .button-menu-mobile {
|
||||
display: none;
|
||||
/* Hide the button on larger screens */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.loader-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #00000069;
|
||||
z-index: 99999;
|
||||
}
|
||||
|
||||
.loader {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
font-size: 0;
|
||||
color: #00c9d0;
|
||||
display: inline-block;
|
||||
margin: -25px 0 0 -25px;
|
||||
text-indent: -9999em;
|
||||
-webkit-transform: translateZ(0);
|
||||
-ms-transform: translateZ(0);
|
||||
transform: translateZ(0);
|
||||
}
|
||||
|
||||
.lead {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.loader div {
|
||||
background-color: #6ad9cf;
|
||||
display: inline-block;
|
||||
float: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
opacity: .5;
|
||||
border-radius: 50%;
|
||||
-webkit-animation: ballPulseDouble 2s ease-in-out infinite;
|
||||
animation: ballPulseDouble 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.loader div:last-child {
|
||||
-webkit-animation-delay: -1s;
|
||||
animation-delay: -1s;
|
||||
}
|
||||
|
||||
@-webkit-keyframes ballPulseDouble {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
-webkit-transform: scale(0);
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
50% {
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes ballPulseDouble {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
-webkit-transform: scale(0);
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
50% {
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.toast-success {
|
||||
background-color: #009688 !important;
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
|
||||
/* .dataTables_wrapper .text-right {
|
||||
position: relative;
|
||||
} */
|
||||
|
||||
.dataTables_wrapper .dt-buttons .buttons-csv,
|
||||
.dataTables_wrapper .dt-buttons .buttons-html5 {
|
||||
background-color: #02a8b5;
|
||||
color: #fff;
|
||||
border-color: #02a8b5;
|
||||
}
|
||||
|
||||
.dataTables_wrapper .dt-buttons .buttons-csv:hover,
|
||||
.dataTables_wrapper .dt-buttons .buttons-html5:hover {
|
||||
background-color: #028291;
|
||||
border-color: #028291;
|
||||
}
|
||||
|
||||
|
||||
.modal-full-width {
|
||||
width: 80% !important;
|
||||
/* width: 95% !important; */
|
||||
/* max-width: none; */
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
/* position: relative;
|
||||
flex: 1 1 auto; */
|
||||
padding: 2rem !important;
|
||||
}
|
||||
</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>
|
||||
|
||||
<style>
|
||||
.select2-container--default .select2-selection--single {
|
||||
height: 37px !important;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height: 35px !important;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
top: 7px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.toast-body {
|
||||
padding: .75rem;
|
||||
background: aliceblue !important;
|
||||
}
|
||||
|
||||
#messages-list li {
|
||||
margin-top: 0;
|
||||
margin-bottom: -25px;
|
||||
/* Adjust this value to reduce the space */
|
||||
}
|
||||
|
||||
.toast-footer {
|
||||
text-align: right;
|
||||
color: #000;
|
||||
border-top: 1px solid aliceblue;
|
||||
margin-top: 11px;
|
||||
margin-bottom: -6px;
|
||||
}
|
||||
|
||||
|
||||
.right-bar {
|
||||
width: 300px;
|
||||
/* Adjust as needed */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fixed-header {
|
||||
position: relative;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
background-color: #f8f9fa !important;
|
||||
}
|
||||
|
||||
.scrollable-content {
|
||||
max-height: 42vh;
|
||||
overflow-y: auto;
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
/* Additional styles to enhance appearance */
|
||||
.header-title {
|
||||
position: relative;
|
||||
bottom: 5px;
|
||||
left: 60px;
|
||||
}
|
||||
|
||||
#app_content_management:hover {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
$(window).on('load', function() {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').fadeOut('slow');
|
||||
}, 1000);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body class="loading" data-layout-mode="" data-layout='{"mode": "light", "width": "fluid", "menuPosition": "fixed", "sidebar": { "color": "light", "size": "condensed", "showuser": false}, "topbar": {"color": "dark"}, "showRightSidebarOnPageLoad": false}'></body>
|
||||
|
||||
<!-- Preloader -->
|
||||
<div class="loader-mask">
|
||||
<div class="loader">
|
||||
<img src="<?= base_url() . "public" ?>/assets/images/nhance-loader-fast.gif" height="40" width="40" alt="Loading...">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <img src="<?= base_url() . "public" ?>/assets/images/nhance-loader-fast.gif" height="40" width="40" alt="Loading..."> -->
|
||||
<!-- Begin page -->
|
||||
<div id="wrapper">
|
||||
|
||||
<!-- Topbar Start -->
|
||||
<div class="navbar-custom">
|
||||
<div class="container-fluid">
|
||||
<ul class="list-unstyled topnav-menu float-right mb-0">
|
||||
|
||||
<li class="d-none d-lg-block">
|
||||
<form class="app-search">
|
||||
<div class="app-search-box dropdown">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" placeholder="Search..." id="top-search">
|
||||
<div class="input-group-append">
|
||||
<button class="btn" type="submit">
|
||||
<i class="fe-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="dropdown-menu dropdown-lg" id="search-dropdown">
|
||||
<div class="dropdown-header noti-title">
|
||||
<h5 class="text-overflow mb-2">Found <span class="text-danger">09</span> results</h5>
|
||||
</div>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="fe-home mr-1"></i>
|
||||
<span>Analytics Report</span>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="fe-aperture mr-1"></i>
|
||||
<span>How can I help you?</span>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="fe-settings mr-1"></i>
|
||||
<span>User profile settings</span>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-header noti-title">
|
||||
<h6 class="text-overflow mb-2 text-uppercase">Users</h6>
|
||||
</div>
|
||||
|
||||
<div class="notification-list">
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<div class="media">
|
||||
<img class="d-flex mr-2 rounded-circle" src="<?= base_url() . "public"; ?>/assets/images/users/avatar-2.jpg" alt="Generic placeholder image" height="32">
|
||||
<div class="media-body">
|
||||
<h5 class="m-0 font-14">Erwin E. Brown</h5>
|
||||
<span class="font-12 mb-0">UI Designer</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<div class="media">
|
||||
<img class="d-flex mr-2 rounded-circle" src="<?= base_url() . "public"; ?>/assets/images/users/avatar-5.jpg" alt="Generic placeholder image" height="32">
|
||||
<div class="media-body">
|
||||
<h5 class="m-0 font-14">Jacob Deo</h5>
|
||||
<span class="font-12 mb-0">Developer</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
|
||||
<li class="dropdown notification-list topbar-dropdown">
|
||||
<a class="nav-link dropdown-toggle right-bar-toggle waves-effect waves-light">
|
||||
<i class="fe-bell noti-icon"></i>
|
||||
<span class="badge badge-danger rounded-circle noti-icon-badge" id="notification_count">0</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="dropdown notification-list topbar-dropdown">
|
||||
<a class="nav-link dropdown-toggle nav-user mr-0 waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
|
||||
<img src="<?php echo (get_userProfile() != null && !empty(get_userProfile())) ? get_userProfile() : base_url() . 'public/assets/images/avatar_2x.png'; ?>" alt="user-image" class="rounded-circle">
|
||||
<span class="pro-user-name ml-1" style="font-size: 16px;">
|
||||
<?= (isset(get_session_userdata()->first_name) ? get_session_userdata()->first_name : 'NOT SET') ?>
|
||||
<!-- <i class="mdi mdi-chevron-down"></i> -->
|
||||
</span>
|
||||
</a>
|
||||
<!--<div class="dropdown-menu dropdown-menu-right profile-dropdown ">
|
||||
<div class="dropdown-header noti-title">
|
||||
<h6 class="text-overflow m-0">Welcome !</h6>
|
||||
</div>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="ri-account-circle-line"></i>
|
||||
<span>My Account</span>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="ri-settings-3-line"></i>
|
||||
<span>Settings</span>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="ri-wallet-line"></i>
|
||||
<span>My Wallet <span class="badge badge-success float-right">3</span> </span>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="ri-lock-line"></i>
|
||||
<span>Lock Screen</span>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="<?= base_url('/logout'); ?>" class="dropdown-item notify-item">
|
||||
<i class="ri-logout-box-line"></i>
|
||||
<span>Logout</span>
|
||||
</a>
|
||||
|
||||
</div>-->
|
||||
</li>
|
||||
|
||||
<!-- <li class="dropdown notification-list">
|
||||
<a href="javascript:void(0);" class="nav-link right-bar-toggle waves-effect waves-light">
|
||||
<i class="fe-settings noti-icon"></i>
|
||||
</a>
|
||||
</li> -->
|
||||
|
||||
<li class="dropdown notification-list">
|
||||
<a href="<?= base_url('/logout'); ?>" class="nav-link waves-effect waves-light">
|
||||
<i class="ri-logout-box-r-line" style="font-size: 25px;"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- LOGO -->
|
||||
<div class="logo-box">
|
||||
<a href="https://localhost/nhance/dashboard/view" class="logo logo-dark text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi.svg" alt="" height="24">
|
||||
<!-- <span class="logo-lg-text-light">NHANCE</span> -->
|
||||
</span>
|
||||
<span class="logo-lg">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi.svg" alt="" height="20">
|
||||
<!-- <span class="logo-lg-text-light">M</span> -->
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="https://localhost/nhance/dashboard/view" class="logo logo-light text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi.svg" alt="" height="24">
|
||||
</span>
|
||||
<!-- <span class="logo-lg">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/logo-light.png" alt="" height="20">
|
||||
</span> -->
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="list-unstyled topnav-menu topnav-menu-left m-0">
|
||||
<li>
|
||||
<button class="button-menu-mobile waves-effect waves-light">
|
||||
<i class="fe-menu"></i>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<!-- Mobile menu toggle (Horizontal Layout)-->
|
||||
<a class="navbar-toggle nav-link" data-toggle="collapse" data-target="#topnav-menu-content">
|
||||
<div class="lines">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</div>
|
||||
</a>
|
||||
<!-- End mobile menu toggle-->
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end Topbar -->
|
||||
|
||||
<!-- ========== Left Sidebar Start ========== -->
|
||||
<div class="left-side-menu">
|
||||
|
||||
|
||||
<!-- LOGO -->
|
||||
<div class="logo-box">
|
||||
<a href="<?= base_url('/dashboard/view') ?>" class="logo logo-dark text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/logo-sm-dark.png" alt="" height="24">
|
||||
<!-- <span class="logo-lg-text-light">nHance</span> -->
|
||||
</span>
|
||||
<span class="logo-lg">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/logo-dark.png" alt="" height="20">
|
||||
<!-- <span class="logo-lg-text-light">N</span> -->
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="<?= base_url('/dashboard/view') ?>" class="logo logo-light text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi_white_2.png" alt="" width="30" height="30">
|
||||
</span>
|
||||
<!-- <span class="logo-lg">
|
||||
<img src="<?= base_url() . "public"; ?>./assets/images/logo-light.png" alt="" height="20">
|
||||
</span> -->
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="h-100" data-simplebar>
|
||||
|
||||
<!--- Sidemenu -->
|
||||
<div id="sidebar-menu">
|
||||
<ul id="side-menu">
|
||||
<li>
|
||||
<a href="<?= base_url('/dashboard/view') ?>">
|
||||
<i class="ri-dashboard-line"></i>
|
||||
<span> Dashboard </span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/client/list') ?>">
|
||||
<i class="mdi mdi-domain"></i>
|
||||
<span> Clients </span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#sidebarDashboards" data-toggle="collapse" class="waves-effect">
|
||||
<i class="fas fa-user-tie"></i>
|
||||
<span class="badge badge-success badge-pill float-right">2</span>
|
||||
<span> Members </span>
|
||||
</a>
|
||||
<div class="collapse" id="sidebarDashboards">
|
||||
<ul class="nav-second-level">
|
||||
|
||||
<li>
|
||||
<a href="<?= base_url('/employee/upload') ?>">Upload</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/employee/list') ?>">List</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/employee/endorsement-list') ?>">Endorsement List</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#sidebarDashboards" data-toggle="collapse" class="waves-effect">
|
||||
<i class="ri-database-2-line"></i>
|
||||
<span class="badge badge-success badge-pill float-right">2</span>
|
||||
<span> Masters </span>
|
||||
</a>
|
||||
<div class="collapse" id="sidebarDashboards">
|
||||
<ul class="nav-second-level">
|
||||
<li>
|
||||
<a href="<?= base_url('/master/insurer/list') ?>">Insurer</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/master/tpa/list') ?>">TPA</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/master/kyc/list') ?>">KYC</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/master/policy/list') ?>">Policy</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/master/cash_deposite/list') ?>">CD Master</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<?php
|
||||
$sessionData = get_session_userdata();
|
||||
$currentUrl = base_url();
|
||||
$parsedUrl = parse_url($currentUrl);
|
||||
$baseUrl = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . '/';
|
||||
$hashedEmail = hash('sha256', $sessionData->email);
|
||||
$redirectUrl = getenv('helpdeskURL') .'/staff/login?' . http_build_query(['token' => $hashedEmail]);
|
||||
?>
|
||||
<a href="<?php echo $redirectUrl; ?>" target="_blank">
|
||||
<i class="mdi mdi-lifebuoy"></i>
|
||||
<span> Tickets </span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/user/list') ?>">
|
||||
<i class=" ri-user-3-line"></i>
|
||||
<span> Users </span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="app_content_management" href="#sidebarDashboardsmenu" data-toggle="collapse" class="waves-effect" style="color: grey;">
|
||||
<i class="fa fa-info-circle" aria-hidden="true"></i>
|
||||
<span class="badge badge-success badge-pill float-right">2</span>
|
||||
<span> App Content Management </span>
|
||||
</a>
|
||||
<div class="collapse" id="sidebarDashboardsmenu">
|
||||
<ul class="nav-second-level">
|
||||
<li>
|
||||
<a href="<?= base_url('/add_image_index') ?>"> Advertisement Images </a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/frontend_content') ?>">Front-end Content</a>
|
||||
</li>
|
||||
<li>
|
||||
</li>
|
||||
<li>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<!-- <li class="menu-title mt-2">Apps</li> -->
|
||||
</ul>
|
||||
</div>
|
||||
<!-- End Sidebar -->
|
||||
|
||||
</div>
|
||||
<!-- Sidebar -left -->
|
||||
|
||||
</div>
|
||||
<!-- Left Sidebar End -->
|
||||
|
||||
<!-- ============================================================== -->
|
||||
<!-- Start Page Content here -->
|
||||
<!-- ============================================================== -->
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
@ -61,24 +61,33 @@ class CDMasterModel extends Model
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getCDMasterList(){
|
||||
public function getCDMasterList()
|
||||
{
|
||||
|
||||
$query = $this->db->table('cd_master')
|
||||
->select('cd_master.*, clients.client_name, clients.short_name, insurers.name AS insurer_name, user_profiles.first_name AS user_name, IFNULL(cd_ac_counts.cd_ac_no_count, 0) AS cd_ac_no_count')
|
||||
->join('clients', 'clients.id = cd_master.client_id')
|
||||
->join('insurers', 'insurers.id = cd_master.insurer_id')
|
||||
->join('user_profiles', 'user_profiles.id = cd_master.created_by')
|
||||
->join(
|
||||
'(SELECT cd_master.cd_ac_no, COUNT(client_policy.cd_ac_no) AS cd_ac_no_count
|
||||
FROM cd_master
|
||||
JOIN client_policy ON client_policy.cd_ac_no = cd_master.cd_ac_no
|
||||
GROUP BY cd_master.cd_ac_no) AS cd_ac_counts',
|
||||
'cd_ac_counts.cd_ac_no = cd_master.cd_ac_no',
|
||||
'left'
|
||||
)
|
||||
->where('cd_master.is_active', 1)
|
||||
->get();
|
||||
|
||||
->select('cd_master.*, clients.client_name, clients.short_name, insurers.name AS insurer_name, user_profiles.first_name AS user_name, IFNULL(cd_ac_counts.cd_ac_no_count, 0) AS cd_ac_no_count, IFNULL(cd_ac_counts_for_cdt.cd_ac_no_count_cd_tranction, 0) AS cd_ac_no_count_cd_tranction')
|
||||
->join('clients', 'clients.id = cd_master.client_id')
|
||||
->join('insurers', 'insurers.id = cd_master.insurer_id')
|
||||
->join('user_profiles', 'user_profiles.id = cd_master.created_by')
|
||||
->join(
|
||||
'(SELECT cd_master.cd_ac_no, COUNT(client_policy.cd_ac_no) AS cd_ac_no_count
|
||||
FROM cd_master
|
||||
JOIN client_policy ON client_policy.cd_ac_no = cd_master.cd_ac_no
|
||||
GROUP BY cd_master.cd_ac_no) AS cd_ac_counts',
|
||||
'cd_ac_counts.cd_ac_no = cd_master.cd_ac_no',
|
||||
'left'
|
||||
)
|
||||
->join(
|
||||
'(SELECT cd_master.cd_ac_no, COUNT(cash_deposit.cd_ac_no) AS cd_ac_no_count_cd_tranction
|
||||
FROM cd_master
|
||||
JOIN cash_deposit ON cash_deposit.cd_ac_no = cd_master.cd_ac_no
|
||||
GROUP BY cd_master.cd_ac_no) AS cd_ac_counts_for_cdt',
|
||||
'cd_ac_counts_for_cdt.cd_ac_no = cd_master.cd_ac_no',
|
||||
'left'
|
||||
)
|
||||
->where('cd_master.is_active', 1)
|
||||
->get();
|
||||
|
||||
$result = $query->getResultArray();
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ class ChatBotModel extends Model
|
||||
"id",
|
||||
"request",
|
||||
"options",
|
||||
"is_option",
|
||||
"created_by",
|
||||
"updated_by",
|
||||
"is_active",
|
||||
|
||||
@ -19,6 +19,11 @@ class ClientBranchModel extends Model
|
||||
"created_by",
|
||||
"updated_by",
|
||||
"is_active",
|
||||
"pincode",
|
||||
"address1",
|
||||
"address2",
|
||||
"gst",
|
||||
"sez",
|
||||
];
|
||||
|
||||
public function getBranchAndContactByBranchId($branch_id){
|
||||
|
||||
@ -131,11 +131,12 @@ class ClientPolicyModel extends Model
|
||||
public function getinsurerswithclientid($id){
|
||||
|
||||
return $this->db->table('client_policy')
|
||||
->select('client_policy.*')
|
||||
->select('client_policy.*, cd_master.cd_ac_no')
|
||||
->select('insurers.name as insurer_name, insurers.short_name as insurer_short')
|
||||
->select('clients.client_name as client_name')
|
||||
->join('clients','clients.id=client_policy.client_id')
|
||||
->join('insurers', 'insurers.id = client_policy.insurer_id')
|
||||
->join('cd_master', 'cd_master.insurer_id = client_policy.insurer_id')
|
||||
->where('client_policy.client_id', $id)
|
||||
->groupBy('client_policy.insurer_id')
|
||||
->groupBy('client_policy.client_id', $id) // Group by insurer_id
|
||||
@ -186,15 +187,18 @@ class ClientPolicyModel extends Model
|
||||
->select('cash_deposit.*')
|
||||
->select('insurers.name as insurer_name, insurers.short_name as insurer_short')
|
||||
->select('clients.client_name as clientname, clients.short_name as clientshort')
|
||||
->select('policies.name as policy_name')
|
||||
// ->select('policies.name as policy_name')
|
||||
->select('policy_type.policy_type')
|
||||
->select('user_profiles.first_name as username')
|
||||
->join('user_profiles', 'user_profiles.id = cash_deposit.created_by', 'left')
|
||||
->join('insurers', 'insurers.id = cash_deposit.insurer_id', 'left')
|
||||
->join('clients', 'clients.id = cash_deposit.client_id', 'left')
|
||||
->join('client_policy', 'client_policy.id = cash_deposit.client_policy_id', 'left')
|
||||
->join('policies', 'policies.id = client_policy.policy_id', 'left')
|
||||
// ->join('policies', 'policies.id = client_policy.policy_id', 'left')
|
||||
->join('policy_type', 'policy_type.id = client_policy.policy_type_id', 'left')
|
||||
->where('cash_deposit.client_id', $clientId)
|
||||
->where('cash_deposit.insurer_id', $insurerId)
|
||||
->where('cash_deposit.is_active', 1)
|
||||
->orderBy('cash_deposit.id', 'DESC')
|
||||
->get()
|
||||
->getResult();
|
||||
|
||||
@ -23,21 +23,22 @@ class InsurerModel extends Model
|
||||
|
||||
|
||||
|
||||
public function getCreatedByUserName(){
|
||||
public function getCreatedByUserName()
|
||||
{
|
||||
|
||||
return $this->db->table('insurers')
|
||||
->select('insurers.*')
|
||||
// ->select('user_profiles.first_name as user_name')
|
||||
// ->join('user_profiles', 'user_profiles.id = clients.created_by')
|
||||
->get()
|
||||
->getResult();
|
||||
|
||||
->getResult();
|
||||
}
|
||||
public function getInsurerName($insurerId)
|
||||
{
|
||||
// Fetch the insurer name based on the insurer ID
|
||||
$query = $this->select('id,name')
|
||||
->where('id', $insurerId)
|
||||
$query = $this->select('insurers.id,insurers.name, cd_master.cd_ac_no')
|
||||
->join('cd_master', 'cd_master.insurer_id = insurers.id')
|
||||
->where('insurers.id', $insurerId)
|
||||
->get();
|
||||
|
||||
if ($query->resultID->num_rows > 0) {
|
||||
@ -47,19 +48,6 @@ class InsurerModel extends Model
|
||||
|
||||
return null; // or handle accordingly if the insurer is not found
|
||||
}
|
||||
// public function getdepositData($id)
|
||||
// {
|
||||
// // Fetch the insurer name based on the insurer ID
|
||||
// $query = $this->db->table('cash_deposit')
|
||||
|
||||
|
||||
// ->get()
|
||||
|
||||
|
||||
// ->getResult();
|
||||
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
210
app/Views/add_image_list.php
Normal file
210
app/Views/add_image_list.php
Normal file
@ -0,0 +1,210 @@
|
||||
<style>
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
table.dataTable thead th {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12{
|
||||
|
||||
max-width: 98% !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row" id="client_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Advertisement Image List</h4>
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right; position: relative;top: 5px;">
|
||||
<a data-toggle="modal" data-target="#bike_make_login-modal" href="#" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Advertisement Image Name</th>
|
||||
<th class="font-weight-medium">Status</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php foreach($addImageList as $row){ ?>
|
||||
<tr >
|
||||
<td class="client_info" data-id="<?php echo $row['id']; ?>"><?php echo $row['name']; ?></td>
|
||||
<td>
|
||||
<?php echo $row['is_active']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item advertise_image_edit" href="#" data-toggle="modal" data-id="<?php echo $row['id']; ?>" data-target="#bike_make_login-modal"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a class="dropdown-item" data-id="<?= $row['id'];?>" onclick="removeClient(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
|
||||
|
||||
<div id="append_client_info"></div>
|
||||
|
||||
<div id="bike_make_login-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="text-center mt-2 mb-4">
|
||||
<h4 id="advertise_add_edit">Add Advertise Image </h4>
|
||||
</div>
|
||||
<form id="model_form_data" class="px-4">
|
||||
|
||||
<input type="text" name="add_image_id" id="add_image_id" value="0" hidden>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label for="branchname">Image</label>
|
||||
<input class="form-control" name="advertise_image" id="advertise_image" type="file" accept="image/*" onchange="PreviewImage();" required="">
|
||||
</div>
|
||||
<div class="form-group col-md-6 float-left" style="position: relative;top: 0px;">
|
||||
<img src=" " width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<button class="btn btn-rounded btn-primary" type="submit" onclick="submitBranch(this)">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function submitBranch(params) {
|
||||
|
||||
// if ($('#add_image_id').val()) {
|
||||
// var url = '<?= base_url("edit_advertise_image/"); ?>'+$('#add_image_id').val();
|
||||
// }else{
|
||||
var url = '<?= base_url("add_advertise_image"); ?>';
|
||||
// }
|
||||
|
||||
var formData = new FormData($('#model_form_data')[0]);
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: url,
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
$('#bike_model_login-modal').modal('hide');
|
||||
$('#bike_make_name').val('');
|
||||
|
||||
window.location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Handle error response here
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function PreviewImage() {
|
||||
console.log('function called');
|
||||
var fileInput = document.getElementById("advertise_image");
|
||||
var file = fileInput.files[0];
|
||||
|
||||
if (file) {
|
||||
var allowedExtensions = ["jpg", "jpeg", "png"];
|
||||
var fileExtension = file.name.split('.').pop().toLowerCase();
|
||||
|
||||
if (!allowedExtensions.includes(fileExtension) || file.size > 200 * 1024) {
|
||||
toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.');
|
||||
fileInput.value = ""; // Clear the file input
|
||||
document.getElementById("uploadPreview").src = "<?= base_url()."public/assets/images/avatar_2x.png" ?>"; // Remove the preview image
|
||||
return;
|
||||
}
|
||||
|
||||
var reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
reader.onload = function (event) {
|
||||
var img = new Image();
|
||||
img.src = event.target.result;
|
||||
|
||||
img.onload = function () {
|
||||
if (img.width !== 1640 || img.height !== 664) {
|
||||
toastr.warning('Image dimensions must be 1640x664 pixels.', 'Invalid image dimensions.');
|
||||
fileInput.value = ""; // Clear the file input
|
||||
document.getElementById("uploadPreview").src = "<?= base_url()."public/assets/images/avatar_2x.png" ?>"; // Remove the preview image
|
||||
} else {
|
||||
document.getElementById("uploadPreview").src = img.src;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$('#btnAdd').click(function () {
|
||||
$('#add_image_id').val(0);
|
||||
$('#advertise_add_edit').html('Add Advertise Image');
|
||||
$('#uploadPreview').attr('src', '<?= base_url()."public/assets/images/avatar_2x.png" ?>');
|
||||
|
||||
})
|
||||
|
||||
$('.advertise_image_edit').click(function (params) {
|
||||
// console.log($(this).data('id'));
|
||||
$('#add_image_id').val($(this).data('id'));
|
||||
var url = '<?= base_url("getAdvertiseImage/"); ?>'+$(this).data('id') ;
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: url,
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
$('#advertise_add_edit').html('Edit Advertise Image');
|
||||
$('#uploadPreview').attr('src', '<?= base_url() . "public/uploads/advertiseImage/"?>' + response)
|
||||
.on('error', function() {
|
||||
$(this).attr('src', '<?= base_url()."public/assets/images/avatar_2x.png" ?>');
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
@ -40,7 +40,7 @@ table.dataTable thead th {
|
||||
<th class="font-weight-medium">Insurer Name</th>
|
||||
<th class="font-weight-medium">Opening Date</th>
|
||||
<th class="font-weight-medium">CD Account No</th>
|
||||
<th class="font-weight-medium">Deposite Amount</th>
|
||||
<th class="font-weight-medium">Opening Amount</th>
|
||||
<th class="font-weight-medium">Date/User</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
@ -60,7 +60,9 @@ table.dataTable thead th {
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);"class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item btnEdit" data-id="<?= $row['id'];?>" data-toggle="modal" data-target="#con-close-modal"> <i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<?php if($row['cd_ac_no_count_cd_tranction'] <= 1) { ?>
|
||||
<a class="dropdown-item btnEdit" data-id="<?= $row['id'];?>" data-toggle="modal" data-target="#con-close-modal"> <i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<?php } ?>
|
||||
<?php if($row['cd_ac_no_count'] == 0) { ?>
|
||||
<a class="dropdown-item" data-id="<?= $row['id'];?>" onclick="removeCDMaster(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
<?php } ?>
|
||||
@ -85,7 +87,7 @@ table.dataTable thead th {
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="title">Add Cash Deposite</h4>
|
||||
<h4 class="modal-title" id="title">Add Opening Amount</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
@ -140,8 +142,8 @@ table.dataTable thead th {
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="mobile">Deposite Amount<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="opening_bal" name="opening_bal" required>
|
||||
<label for="mobile">Opening Amount<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="opening_bal" name="opening_bal" onkeypress="return onlyNumbers(event)" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -215,7 +217,7 @@ table.dataTable thead th {
|
||||
$('#cd_ac_no').val('');
|
||||
$('#opening_bal').val('');
|
||||
$('#CDMasterForm').attr('action', '<?php echo base_url('master/cash_deposite/create');?>');
|
||||
$('#title').html('Add Cash Deposite');
|
||||
$('#title').html('Add Opening Amount');
|
||||
$('#btnSubmit').html('Submit');
|
||||
|
||||
|
||||
@ -237,7 +239,7 @@ table.dataTable thead th {
|
||||
$('body').on('click', '.btnEdit', function () {
|
||||
|
||||
var cd_id = $(this).attr('data-id');
|
||||
$('#title').html('Update Cash Deposite');
|
||||
$('#title').html('Update Opening Amount');
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('master/cash_deposite/list/');?>'+cd_id,
|
||||
@ -336,4 +338,11 @@ function removeCDMaster(element) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
function onlyNumbers(event) {
|
||||
var charcode;
|
||||
charcode = event.which || event.keyCode;
|
||||
if (charcode >= 48 && charcode <= 57 || charcode == 46) return true;
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@ -107,61 +107,12 @@ input:checked + .slider:before {
|
||||
<label for="pan">PAN<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="pan" placeholder="Enter PAN Number" data-parsley-error-message="Invalid PAN Number. Example: ABCDE1234F" value="<?= isset($client['pan']) ? $client['pan'] : '' ?>" name="pan" data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<!-- <div class="form-group col-md-4">
|
||||
<label for="gst">GST<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="gst" placeholder="Enter GST Number" data-parsley-error-message="Invalid GST Number. Example: 12ABCDE1234F5Z6" value="<?= isset($client['gst']) ? $client['gst'] : '' ?>" name="gst" data-parsley-trigger="change" data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address1">Address 1<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="address1"
|
||||
placeholder="Enter Address 1" value="<?= isset($client['address1']) ? $client['address1'] : '' ?>" name="address1" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address2">Address 2<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="address2"
|
||||
placeholder="Enter Address 2" value="<?= isset($client['address2']) ? $client['address2'] : '' ?>" name="address2" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="city">City<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="city"
|
||||
placeholder="Enter City" value="<?= isset($client['city']) ? $client['city'] : '' ?>" name="city" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="state">State<span
|
||||
class="text-danger">*</span></label>
|
||||
<select class="form-control" id="state" name="state" required>
|
||||
<option value="">Select State</option>
|
||||
<?php foreach($state as $value) { ?>
|
||||
<?php if(isset($client['state'])){ ?>
|
||||
<?php if($value['id'] == $client['state']) { ?>
|
||||
<option value="<?= $value['id'] ?>" selected><?= $value['state'] ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
|
||||
<?php } ?>
|
||||
<?php } else { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="pincode">Pincode<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="pincode"
|
||||
placeholder="Enter Pincode" onkeypress = "return onlyNumbers(event)" value="<?= isset($client['pincode']) ? $client['pincode'] : '' ?>" name="pincode" maxlength="6" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
|
||||
@ -51,7 +51,18 @@
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address1">Address Line 1<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="address1" name="address1" placeholder="Enter Address 1" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address2">Address Line 2<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="address2" placeholder="Enter Address 2" name="address2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="state">State<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="state" name="state" required>
|
||||
<option value="">Select State</option>
|
||||
@ -60,16 +71,35 @@
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="district">District<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="district" placeholder="Enter District"
|
||||
name="district" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="city">City<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_city" placeholder="Enter City"
|
||||
name="city" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="gst">Pincode<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="gst">GST<span class="text-danger">*</span></label>
|
||||
<input type="text" name="gst" class="form-control" id="gst" placeholder="Enter GST Number" data-parsley-error-message="Invalid GST Number. Example: 12ABCDE1234F5Z6" data-parsley-trigger="change" data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label class="switch" style="position: relative;top: 43px;left: 20px;">
|
||||
<input id="sez" type="checkbox" name="sez">
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
|
||||
<label for="inception_type" style="position: relative;bottom: 5px;left: 85px;">Enable SEZ</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@ -83,13 +113,17 @@
|
||||
name="name[]" id="name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="last_name">Email<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Email"
|
||||
name="email[]" id="email" data-parsley-trigger="change" data-parsley-type="email"
|
||||
required>
|
||||
<label for="designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Designation Name"
|
||||
name="designation[]" id="designation" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="last_name">Email<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Email"
|
||||
name="email[]" id="email" data-parsley-trigger="change" data-parsley-type="email" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Mobile"
|
||||
@ -99,11 +133,6 @@
|
||||
data-parsley-required-message="Please enter a valid 10-digit mobile number."
|
||||
required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Designation Name"
|
||||
name="designation[]" id="designation" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display: flex;">
|
||||
<button style="margin-right: 10px;" type="button" class="btn btn-primary btn-sm ac"
|
||||
@ -224,7 +253,6 @@ $('#btnBranchAdd').click(function() {
|
||||
})
|
||||
|
||||
$('.btnBack').click(function() {
|
||||
|
||||
$('#add_branch').hide();
|
||||
$('#branch_table').show();
|
||||
$('.btnBack').hide();
|
||||
@ -408,11 +436,21 @@ $('body').on('click', '.btnBranchEdit', function() {
|
||||
$('#btnBranchAdd').hide();
|
||||
$('#branch_name').val(res.data.branch_name);
|
||||
$('#branch_code').val(res.data.branch_code);
|
||||
$('#pincode').val(res.data.pincode);
|
||||
$('#address1').val(res.data.address1);
|
||||
$('#address2').val(res.data.address2);
|
||||
$('#gst').val(res.data.gst);
|
||||
$('#state option[value="' + res.data.state + '"]').prop('selected', true);
|
||||
$('#district').val(res.data.district);
|
||||
$('#branch_city').val(res.data.city);
|
||||
$('#branch_PrimaryKey').val(res.data.id);
|
||||
|
||||
if(res.data.sez == 1){
|
||||
$('#sez').prop('checked', true);
|
||||
}else{
|
||||
$('#sez').prop('checked', false);
|
||||
}
|
||||
|
||||
$('#name').val(res.contact[0].name);
|
||||
$('#email').val(res.contact[0].email);
|
||||
$('#mobile').val(res.contact[0].mobile);
|
||||
@ -470,18 +508,18 @@ function appendContactHtml(contact = false, reset = false) {
|
||||
<input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.email : ''}" type="text" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" data-parsley-trigger="change" data-parsley-type="email" required>
|
||||
<label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="${uniqueId}_designation" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" onchange="checkMobileNumber(this)" onkeypress = "return onlyNumbers(event)" maxlength="10" min="10" data-parsley-type-message="Please enter a valid 10-digit mobile number." data-parsley-required-message="Please enter a valid 10-digit mobile number." required>
|
||||
<label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.email : ''}" type="text" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" data-parsley-trigger="change" data-parsley-type="email" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="${uniqueId}_designation" required>
|
||||
<label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" onchange="checkMobileNumber(this)" onkeypress = "return onlyNumbers(event)" maxlength="10" min="10" data-parsley-type-message="Please enter a valid 10-digit mobile number." data-parsley-required-message="Please enter a valid 10-digit mobile number." required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display: flex;">
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Insurer Name</th>
|
||||
<th class="font-weight-medium">CD Account Number</th>
|
||||
<th class="font-weight-medium">Current Balance</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
@ -30,9 +31,9 @@
|
||||
|
||||
<tr>
|
||||
<?php foreach ($clientData as $value): ?>
|
||||
<td>
|
||||
<?php echo $value->insurer_name;?>
|
||||
</td>
|
||||
|
||||
<td><?php echo $value->insurer_name;?></td>
|
||||
<td><?php echo $value->cd_ac_no;?></td>
|
||||
|
||||
<td>₹
|
||||
<?php
|
||||
@ -45,7 +46,6 @@
|
||||
echo "N/A"; // Display "Not Available" if balance information is not present
|
||||
}
|
||||
?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<a class="dropdown-item"
|
||||
@ -53,13 +53,9 @@
|
||||
<i class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>View Deposit
|
||||
</a>
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -58,7 +58,7 @@ table.dataTable thead th {
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="<?= base_url("client/list/"); ?><?= $row->id;?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a class="dropdown-item" href="<?= base_url("client/deposit/{$row->id}"); ?>"><i class="mdi mdi-cash mr-2 text-muted font-18 vertical-middle"></i>Deposit</a>
|
||||
<a class="dropdown-item" href="<?= base_url("client/deposit/{$row->id}"); ?>"><i class="mdi mdi-cash mr-2 text-muted font-18 vertical-middle"></i>CD Tranctions</a>
|
||||
<?php if(get_role_id() != 3 && get_role_id() != 4) { ?>
|
||||
<a class="dropdown-item" data-id="<?= $row->id;?>" onclick="removeClient(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
<?php } ?>
|
||||
|
||||
@ -307,7 +307,6 @@
|
||||
|
||||
$('.btnAdd').click(function() {
|
||||
|
||||
// fetchClientPolicyList()
|
||||
fetchClientBranch()
|
||||
|
||||
$('#policy_form')[0].reset();
|
||||
@ -564,6 +563,7 @@
|
||||
var OptionsHTML = '';
|
||||
OptionsHTML += '<option value="" selected>Select Policy</option>';
|
||||
$policy_type_value = $('#policy_type').val();
|
||||
|
||||
$.each(res.data, function(index, item) {
|
||||
|
||||
if ($policy_type_value == 3) {
|
||||
@ -621,6 +621,7 @@
|
||||
});
|
||||
|
||||
$('#policy').html(OptionsHTML);
|
||||
|
||||
}).fail(function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
@ -762,10 +763,8 @@
|
||||
success: function(res) {
|
||||
|
||||
console.log('client_policy_res', res)
|
||||
console.log('gst', res.data.gst);
|
||||
|
||||
var gst = (res.data.gst == 0.00) ? 18 : res.data.gst;
|
||||
console.log(gst);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
@ -775,7 +774,7 @@
|
||||
$('#policy_form_action').val('<?= base_url("client/policy/edit"); ?>');
|
||||
|
||||
if (res.status === false) {
|
||||
toastr.error(res.status);
|
||||
toastr.error(res.message);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -792,7 +791,6 @@
|
||||
}
|
||||
|
||||
$('#tpa').val(tpaValue).change();
|
||||
// $('#policy').val(res.data.policy_id).change();
|
||||
$('#policy_type').val(res.data.is_addon).change();
|
||||
$('#base_policy').val(res.data.base_policy);
|
||||
|
||||
@ -835,24 +833,6 @@
|
||||
}
|
||||
|
||||
|
||||
if (res.data.is_addon == 1 && res.data.base_policy > 0) {
|
||||
|
||||
// $("#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',
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
|
||||
|
||||
@ -887,40 +867,12 @@
|
||||
});
|
||||
}
|
||||
|
||||
var policeOptionHTML = '';
|
||||
$.each(res.policy, function(index, 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);
|
||||
|
||||
var OptionsHTML = '';
|
||||
OptionsHTML += '<option value="" selected>Select Base Policy</option>';
|
||||
$.each(res.client_policy_list, function(index, item) {
|
||||
|
||||
if (item.client_branch_id == res.data.client_branch_id) {
|
||||
|
||||
OptionsHTML += '<option data-id="' + item.policy_type_id +
|
||||
'" value="' + item.id + '" ' + (res.data.base_policy === item.id ?
|
||||
'selected="selected"' : '') + '>' + item.name + '( ' + item
|
||||
.policy_type + ' )</option>';
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
$('#base_policy').html(OptionsHTML);
|
||||
|
||||
setTimeout(function() {
|
||||
$('#policy').val(res.data.policy_id).change();
|
||||
$('#base_policy').val(res.data.base_policy);
|
||||
$('#base_policy').change();
|
||||
}, 3000);
|
||||
|
||||
|
||||
setTimeout(function(){
|
||||
appendCDACNO(res.cd_data, res.data.cd_ac_no)
|
||||
}, 3000)
|
||||
appendCDACNO(res.cd_data, res.data.cd_ac_no) // append and select the current CD Account Number
|
||||
appendPolicyList(res.policy, res.data.policy_id, ); // append and select the current policy
|
||||
appendBasePolicyList(res.client_policy_list, res.data.base_policy, res.data.client_branch_id); // append and select the Base palicy
|
||||
}, 2000)
|
||||
|
||||
$('#client_branch').val(res.data.client_branch_id).change();
|
||||
|
||||
@ -1363,12 +1315,13 @@
|
||||
})
|
||||
|
||||
|
||||
// featch client policy to list in the Base policy Dropdown list
|
||||
function fetchClientPolicyList() {
|
||||
|
||||
var client_id = $('#client_id_policy').val()
|
||||
var client_branch_id = $('#client_branch').val()
|
||||
|
||||
// //console.log('client_branch_id', client_branch_id)
|
||||
//console.log('client_branch_id', client_branch_id)
|
||||
|
||||
$.ajax({
|
||||
url: '<?= base_url("util/featch-client-policy-list/") ?>' + client_id,
|
||||
@ -1376,7 +1329,7 @@
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
//console.log('one', res)
|
||||
//console.log('Base policy Dropdown list', res)
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
@ -1429,7 +1382,6 @@
|
||||
|
||||
var dataId = 0;
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#base_policy').change(function() {
|
||||
|
||||
var client_policy_id = $(this).val() ? $(this).val() : 0;
|
||||
@ -1464,7 +1416,7 @@
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
console.log(res)
|
||||
console.log('base policy ajax response', res)
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
@ -1473,20 +1425,16 @@
|
||||
|
||||
if(res.status == true){
|
||||
|
||||
$('#insurer').val(res.data.insurer_branch_id + '-' + res.data.insurer_id)
|
||||
.change();
|
||||
$('#insurer').val(res.data.insurer_branch_id + '-' + res.data.insurer_id).change();
|
||||
$('#tpa').val(res.data.tpa_branch_id + '-' + res.data.tpa_id).change();
|
||||
$('#policy_no').val(res.data.policy_no).change();
|
||||
$('#start_date').val(rearrangeDateFormat(res.data.policy_start_date))
|
||||
.change();
|
||||
$('#start_date').val(rearrangeDateFormat(res.data.policy_start_date)).change();
|
||||
$('#end_date').val(rearrangeDateFormat(res.data.policy_end_date)).change();
|
||||
|
||||
var policeOptionHTML = '';
|
||||
$policy_type_value = $('#policy_type').val();
|
||||
$.each(res.policy, function(index, item) {
|
||||
|
||||
// //console.log(item);
|
||||
|
||||
policeOptionHTML += '<option data-id="' + item.policy_type_id +
|
||||
'" value="' + item.id + '" ' + (res.data.policy_id === item
|
||||
.id ?
|
||||
@ -1495,23 +1443,18 @@
|
||||
|
||||
});
|
||||
|
||||
console.log('policeOptionHTML', policeOptionHTML)
|
||||
|
||||
$('#policy').html(policeOptionHTML);
|
||||
|
||||
if (dataId == 3 || policy_type == 1) {
|
||||
|
||||
// //console.log('step 1')
|
||||
|
||||
setTimeout(function() {
|
||||
// //console.log('step 2')
|
||||
var $option = $('#policy').find('option[data-id="3"]');
|
||||
if ($option.length > 0) {
|
||||
// //console.log('step 3')
|
||||
$option.prop('selected', true).change();
|
||||
} else {
|
||||
// //console.log('step 4');
|
||||
toastr.warning(
|
||||
'The insurer does not have a GMC-Parents policy.',
|
||||
'Warning');
|
||||
toastr.warning('The insurer does not have a GMC-Parents policy.', 'Warning');
|
||||
}
|
||||
}, 1500);
|
||||
}
|
||||
@ -1537,7 +1480,7 @@
|
||||
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
|
||||
}
|
||||
|
||||
|
||||
// fetch the client branch list for the dropdown
|
||||
function fetchClientBranch() {
|
||||
|
||||
//console.log('function called');
|
||||
@ -1583,12 +1526,11 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//append the client branch list for the dropdown
|
||||
function appendClientBranch(data) {
|
||||
|
||||
$('#client_branch').empty();
|
||||
|
||||
|
||||
$('#client_branch').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Branch',
|
||||
@ -1609,13 +1551,13 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#client_branch").on('change', function() {
|
||||
// //console.log('fetchClientPolicyList change')
|
||||
fetchClientPolicyList();
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
//append the CD Account number for the dropdown
|
||||
function appendCDACNO(data, select = null) {
|
||||
|
||||
//console.log('appendCDACNO', data);
|
||||
@ -1641,5 +1583,65 @@
|
||||
$('#cd_ac_no').append(option);
|
||||
});
|
||||
}
|
||||
|
||||
// append Policies list to the dropdown for edit only
|
||||
function appendPolicyList(data, select = null, ) {
|
||||
|
||||
console.log('appendPolicyList', 'function called');
|
||||
console.log('appendPolicyList data', data);
|
||||
console.log('appendPolicyList selected value', select);
|
||||
|
||||
$('#policy').empty();
|
||||
$('#policy').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Policy'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
const option = $('<option>', {
|
||||
value: item.id, //policy id primary key
|
||||
text: item.name + ' - ' + item.policy_type, // policy name
|
||||
'data-id': item.policy_type_id //policy type id like gpa and gmc
|
||||
});
|
||||
|
||||
if (select === item.id) {
|
||||
option.attr('selected', true);
|
||||
}
|
||||
|
||||
$('#policy').append(option);
|
||||
});
|
||||
}
|
||||
|
||||
// append Base Policy to the dropdown for edit only
|
||||
function appendBasePolicyList(data, select = null, client_branch_id = null) {
|
||||
|
||||
console.log('appendBasePolicyList', 'function called');
|
||||
console.log('appendBasePolicyList data', data);
|
||||
console.log('appendBasePolicyList selected value', select);
|
||||
|
||||
$('#base_policy').empty();
|
||||
$('#base_policy').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Base Policy'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
|
||||
if (item.client_branch_id == client_branch_id) {
|
||||
|
||||
const option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.name + ' - ' + item.policy_type,
|
||||
'data-id': item.policy_type_id
|
||||
});
|
||||
|
||||
if (select === item.id) {
|
||||
//console.log('selected');
|
||||
option.attr('selected', true);
|
||||
}
|
||||
$('#base_policy').append(option);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -16,7 +16,7 @@
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="emp_code">Account Manager ( L2 )</label>
|
||||
<label for="emp_code">Account Manager ( L1 )</label>
|
||||
<select class="form-control" id="account_manager" name="account_manager[]" multiple>
|
||||
<?php foreach($RM as $value) { ?>
|
||||
<?php if($value['role'] === '3') { ?>
|
||||
@ -26,7 +26,7 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="profile">Manager ( L1 )</label>
|
||||
<label for="profile">Manager ( L2 )</label>
|
||||
<select class="form-control" id="manager" name="manager">user_id
|
||||
<option value="">Select Manager</option>
|
||||
<?php foreach($RM as $value) { ?>
|
||||
|
||||
@ -64,6 +64,9 @@
|
||||
|
||||
$tool_tip_text = "Live(s) : {$file['employee_count']}" . " | Total premium : ₹ " . format_indian_number($file['total'], 2, ',') . " | Click to reload";
|
||||
echo '<a data-toggle="tooltip" data-placement="top" data-id="' . $file['status'] . '" class="reload" title="' . $tool_tip_text . '" href="#">' . $file['status'] . '</a>';
|
||||
}else{
|
||||
|
||||
echo '<a data-id="' . $file['status'] . '" class="reload" href="#">' . $file['status'] . '</a>';
|
||||
}
|
||||
} else if ($file['status'] == 'success') {
|
||||
|
||||
|
||||
@ -50,7 +50,18 @@
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address1">Address Line 1<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="address1" name="address1" placeholder="Enter Address 1" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address2">Address Line 2<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="address2" placeholder="Enter Address 2" name="address2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="state">State<span
|
||||
class="text-danger">*</span></label>
|
||||
<select class="form-control" id="state" name="state" required>
|
||||
@ -60,18 +71,23 @@
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="district">District<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="district"
|
||||
placeholder="Enter District" name="district" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="city">City<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_city"
|
||||
placeholder="Enter City" name="city" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="gst">Pincode<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@ -85,18 +101,18 @@
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="last_name">Email<span class="text-danger">*</span></label>
|
||||
<input value="" type="email" data-parsley-type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
|
||||
<label for="designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input name="mobile[]" pattern="[0-9]{10}" value="" type="tel" data-parsley-type="number" data-parsley-length="[10,10]" class="form-control" placeholder="Enter Contact Mobile" id="mobile" required>
|
||||
<label for="last_name">Email<span class="text-danger">*</span></label>
|
||||
<input value="" type="email" data-parsley-type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
|
||||
<label for="mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input name="mobile[]" pattern="[0-9]{10}" value="" type="tel" data-parsley-type="number" data-parsley-length="[10,10]" class="form-control" placeholder="Enter Contact Mobile" id="mobile" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display: flex;">
|
||||
@ -317,6 +333,9 @@
|
||||
$('#state option[value="' + res.insurerbranch.state + '"]').prop('selected', true);
|
||||
$('#district').val(res.insurerbranch.district);
|
||||
$('#branch_city').val(res.insurerbranch.city);
|
||||
$('#pincode').val(res.insurerbranch.pincode);
|
||||
$('#address1').val(res.insurerbranch.address1);
|
||||
$('#address2').val(res.insurerbranch.address2);
|
||||
|
||||
$('#contact_id_1').val(res.levelcontact[0].id);
|
||||
$('.form-row').find('#name').val(res.levelcontact[0].name);
|
||||
|
||||
@ -40,6 +40,7 @@
|
||||
|
||||
|
||||
<!-- <link href="<?= base_url() . "public"; ?>/assets/css/bootstrap-editable.css" rel="stylesheet" type="text/css" /> -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon/fonts/remixicon.css" rel="stylesheet">
|
||||
|
||||
<!-- Jodit Css -->
|
||||
<link href="<?= base_url() . "public"; ?>/assets/css/jodit.css" rel="stylesheet" type="text/css" />
|
||||
@ -69,6 +70,8 @@
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
|
||||
body[data-sidebar-size=condensed]:not([data-layout=compact]):not(.auth-fluid-pages) {
|
||||
min-height: 0;
|
||||
}
|
||||
@ -288,6 +291,10 @@
|
||||
bottom: 5px;
|
||||
left: 60px;
|
||||
}
|
||||
|
||||
#app_content_management:hover {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
@ -584,6 +591,9 @@
|
||||
<li>
|
||||
<a href="<?= base_url('/master/cash_deposite/list') ?>">CD Master</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/user/list') ?>"> Users </a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
@ -601,12 +611,34 @@
|
||||
<span> Tickets </span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<!-- <li>
|
||||
<a href="<?= base_url('/user/list') ?>">
|
||||
<i class=" ri-user-3-line"></i>
|
||||
<span> Users </span>
|
||||
</a>
|
||||
</li> -->
|
||||
<li>
|
||||
<a id="app_content_management" href="#sidebarDashboardsmenu" data-toggle="collapse" class="waves-effect" style="color: grey;">
|
||||
<i class="fa fa-info-circle" aria-hidden="true"></i>
|
||||
<span class="badge badge-success badge-pill float-right">2</span>
|
||||
<span> App Content Management </span>
|
||||
</a>
|
||||
<div class="collapse" id="sidebarDashboardsmenu">
|
||||
<ul class="nav-second-level">
|
||||
<li>
|
||||
<a href="<?= base_url('/add_image_index') ?>"> Advertisement Images </a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/frontend_content') ?>">Front-end Content</a>
|
||||
</li>
|
||||
<li>
|
||||
</li>
|
||||
<li>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<!-- <li class="menu-title mt-2">Apps</li> -->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -58,11 +58,11 @@
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_name">Nhance team mail ID's<span class="text-danger">*</span></label>
|
||||
<label for="branch_name">Team mail ID<span class="text-danger">*</span></label>
|
||||
<textarea name="" id="nhance_team_mail_ids" class="form-control" placeholder="Example: jhon@gmail.com, dave@gmail.com"><?php echo isset($client['common_mails']) ? $client['common_mails'] : ''; ?></textarea>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_name">HR mail ID's<span class="text-danger">*</span></label>
|
||||
<label for="branch_name">HR mail ID<span class="text-danger">*</span></label>
|
||||
<textarea name="" id="hr_mail_id" class="form-control" placeholder="Example: jhon@gmail.com, dave@gmail.com"><?php echo isset($client['hr_mails']) ? $client['hr_mails'] : ''; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -746,6 +746,8 @@
|
||||
|
||||
$("#policyJsonForm").submit(function(event) {
|
||||
|
||||
checkAdditionPremiumJSON()
|
||||
|
||||
|
||||
if (!$('#self').prop('checked')) {
|
||||
$('#self_min_age').removeAttr('name');
|
||||
@ -795,6 +797,7 @@
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
$('#policyJsonForm')[0].reset();
|
||||
$('.text-danger-2').html('');
|
||||
if (res.status === false) {
|
||||
@ -828,7 +831,7 @@
|
||||
$('.nav.nav-pills.navtab-bg').prev().css('display', '');
|
||||
var message = 'Policy Terms Updated successfully';
|
||||
toastr.success(message, 'Success');
|
||||
}, 1000);
|
||||
}, 500);
|
||||
});
|
||||
|
||||
|
||||
@ -984,57 +987,57 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (response.policy_addon == '3') {
|
||||
// if (response.policy_addon == '3') {
|
||||
|
||||
$('.jodit-container').prop('disabled', true);
|
||||
$('.waiverofpreexistingdiseases').prop('disabled', true);
|
||||
$('#maternitycoverage').prop('disabled', true);
|
||||
$('#twindelivery').prop('disabled', true);
|
||||
$('#preandpostnatal').prop('disabled', true);
|
||||
$('#babyday1cover').prop('disabled', true);
|
||||
$('.9monthwaitingperiodwaived').prop('disabled', true);
|
||||
$('#coverfromthedateofjoining').prop('disabled', true);
|
||||
$('.waiverof1234thyearexclusions').prop('disabled', true);
|
||||
$('.waiverof30dayswaitingperiod').prop('disabled', true);
|
||||
$('#prehospitalizationcover').prop('disabled', true);
|
||||
$('#posthospitalizationcover').prop('disabled', true);
|
||||
$('.congenitaldiseasesinternal').prop('disabled', true);
|
||||
$('#congenitaldiseasesexternal').prop('disabled', true);
|
||||
$('#copayzonewisecopay').prop('disabled', true);
|
||||
$('#optionalparentalcopay').prop('disabled', true);
|
||||
$('#bioabsorbablestenttoriclensmultifocallens').prop('disabled', true);
|
||||
$('#roomrentlimit').prop('disabled', true);
|
||||
$('#proportionatedeductionclause').prop('disabled', true);
|
||||
$('#nursingallowance').prop('disabled', true);
|
||||
$('.ailmentcapping').prop('disabled', true);
|
||||
$('#ambulancecharges').prop('disabled', true);
|
||||
$('#airambulance').prop('disabled', true);
|
||||
$('#familytransportationbenefit').prop('disabled', true);
|
||||
$('.reasonableandcustomarycharges').prop('disabled', true);
|
||||
$('.daycaretreatment').prop('disabled', true);
|
||||
$('.ayudhtreatmentcover').prop('disabled', true);
|
||||
$('#armdcovered').prop('disabled', true);
|
||||
$('.suminsuredenhancement').prop('disabled', true);
|
||||
$('#automaticsuminsuredreinstatement').prop('disabled', true);
|
||||
$('#lasiksurgery').prop('disabled', true);
|
||||
$('#midterminclusion').prop('disabled', true);
|
||||
$('#capd').prop('disabled', true);
|
||||
$('#organdonorexpenses').prop('disabled', true);
|
||||
$('#moderntreatmentsasperirdai').prop('disabled', true);
|
||||
$('#days_of_discharge').prop('disabled', true);
|
||||
$('#days_from_dod').prop('disabled', true);
|
||||
$('#corporatebuffer').prop('disabled', true);
|
||||
$('#sublimitofcorporatebuffer').prop('disabled', true);
|
||||
// $('.jodit-container').prop('disabled', true);
|
||||
// $('.waiverofpreexistingdiseases').prop('disabled', true);
|
||||
// $('#maternitycoverage').prop('disabled', true);
|
||||
// $('#twindelivery').prop('disabled', true);
|
||||
// $('#preandpostnatal').prop('disabled', true);
|
||||
// $('#babyday1cover').prop('disabled', true);
|
||||
// $('.9monthwaitingperiodwaived').prop('disabled', true);
|
||||
// $('#coverfromthedateofjoining').prop('disabled', true);
|
||||
// $('.waiverof1234thyearexclusions').prop('disabled', true);
|
||||
// $('.waiverof30dayswaitingperiod').prop('disabled', true);
|
||||
// $('#prehospitalizationcover').prop('disabled', true);
|
||||
// $('#posthospitalizationcover').prop('disabled', true);
|
||||
// $('.congenitaldiseasesinternal').prop('disabled', true);
|
||||
// $('#congenitaldiseasesexternal').prop('disabled', true);
|
||||
// $('#copayzonewisecopay').prop('disabled', true);
|
||||
// $('#optionalparentalcopay').prop('disabled', true);
|
||||
// $('#bioabsorbablestenttoriclensmultifocallens').prop('disabled', true);
|
||||
// $('#roomrentlimit').prop('disabled', true);
|
||||
// $('#proportionatedeductionclause').prop('disabled', true);
|
||||
// $('#nursingallowance').prop('disabled', true);
|
||||
// $('.ailmentcapping').prop('disabled', true);
|
||||
// $('#ambulancecharges').prop('disabled', true);
|
||||
// $('#airambulance').prop('disabled', true);
|
||||
// $('#familytransportationbenefit').prop('disabled', true);
|
||||
// $('.reasonableandcustomarycharges').prop('disabled', true);
|
||||
// $('.daycaretreatment').prop('disabled', true);
|
||||
// $('.ayudhtreatmentcover').prop('disabled', true);
|
||||
// $('#armdcovered').prop('disabled', true);
|
||||
// $('.suminsuredenhancement').prop('disabled', true);
|
||||
// $('#automaticsuminsuredreinstatement').prop('disabled', true);
|
||||
// $('#lasiksurgery').prop('disabled', true);
|
||||
// $('#midterminclusion').prop('disabled', true);
|
||||
// $('#capd').prop('disabled', true);
|
||||
// $('#organdonorexpenses').prop('disabled', true);
|
||||
// $('#moderntreatmentsasperirdai').prop('disabled', true);
|
||||
// $('#days_of_discharge').prop('disabled', true);
|
||||
// $('#days_from_dod').prop('disabled', true);
|
||||
// $('#corporatebuffer').prop('disabled', true);
|
||||
// $('#sublimitofcorporatebuffer').prop('disabled', true);
|
||||
|
||||
setTimeout(function() {
|
||||
var editor1 = new Jodit('#additionalsicknessbenefit');
|
||||
var editor2 = new Jodit('#Wellness');
|
||||
// setTimeout(function() {
|
||||
// var editor1 = new Jodit('#additionalsicknessbenefit');
|
||||
// var editor2 = new Jodit('#Wellness');
|
||||
|
||||
editor1.setReadOnly(true);
|
||||
editor2.setReadOnly(true);
|
||||
// editor1.setReadOnly(true);
|
||||
// editor2.setReadOnly(true);
|
||||
|
||||
}, 3000);
|
||||
}
|
||||
// }, 3000);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@ -1376,6 +1379,8 @@
|
||||
|
||||
$('#family_floaters').change(function () {
|
||||
|
||||
checkAdditionPremiumJSON()
|
||||
|
||||
var family_floaters = $(this).val();
|
||||
if($('#family_floaters').val() != 0){
|
||||
$('.other-member-age').css('display','');
|
||||
@ -1450,4 +1455,30 @@
|
||||
$(button).closest('.row').remove();
|
||||
}
|
||||
|
||||
|
||||
function checkAdditionPremiumJSON(){
|
||||
|
||||
var client_id = $('#Client_id').val();
|
||||
var client_policy_id = $('#gmc_client_policy_id').val();
|
||||
|
||||
var url = '<?php echo base_url('util/check_addition_premium_JSON/') ?>' + client_id + '/' + client_policy_id;
|
||||
|
||||
$.get(url, function(response) {
|
||||
|
||||
console.log(response);
|
||||
console.log(response.data);
|
||||
|
||||
if (response.data > 0) {
|
||||
console.log('Please change the additional premium relation');
|
||||
Swal.fire("Please change the additional premium relation");
|
||||
}
|
||||
console.log('outer');
|
||||
|
||||
}).fail(function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -1171,7 +1171,6 @@ $('body').on('click', '.btnPolicyModel', function() {
|
||||
|
||||
createCheckboxes(res.self, additional_relationship);
|
||||
|
||||
|
||||
//console.log('policy_grid_id_value', policy_grid_id_value);
|
||||
//console.log('secondary_policy_grid_id_value', secondary_policy_grid_id_value);
|
||||
|
||||
@ -1823,24 +1822,16 @@ function appendGridtHtml(ui_type = false, secondary = 0, data = false) {
|
||||
|
||||
html = `
|
||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="9_si[]" id="9_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)" required>
|
||||
<div id='sum_insured_number_word_${Count}' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Grade/Band<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.grade : ''}" type="text" class="form-control" placeholder="Enter Grade/Band " name="9_grade[]" id="9_grade" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="9_premium[]" id="9_premium_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)" required>
|
||||
<div id='premium_number_word_${Count}' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
||||
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more_${Count}" onclick="appendGridtHtml(9, ${secondary})">+</button>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
} else if (ui_type == '10') {
|
||||
@ -2759,7 +2750,7 @@ function si_orbp_change_function() {
|
||||
$('#basic_multiplier').removeAttr('required', false);
|
||||
$('#premium_multiplier').removeAttr('required', false);
|
||||
$('#basic_pay').removeAttr('required', false);
|
||||
$('#gpa_basic_si_first').removeAttr('required', false);
|
||||
$('#gpa_basic_si_first').removeAttr('required', false);
|
||||
$('#gpa_basic_premium_first').removeAttr('required', false);
|
||||
|
||||
$('#gpa_sum_multiplier').attr('required', false);
|
||||
@ -2811,7 +2802,8 @@ function getCurrentTime() {
|
||||
function createCheckboxes(obj, additional_relationship) {
|
||||
//console.log('createCheckboxes function called');
|
||||
|
||||
//console.log(additional_relationship);
|
||||
console.log('object', obj);
|
||||
console.log('additional_relationship', additional_relationship);
|
||||
try {
|
||||
additional_relationship = JSON.parse(additional_relationship);
|
||||
//console.log(additional_relationship);
|
||||
@ -2825,10 +2817,17 @@ function createCheckboxes(obj, additional_relationship) {
|
||||
let html = ` <div class="col-12">
|
||||
<label>Additional Premium Applicable to</label>
|
||||
</div>`;
|
||||
const multiplier = 7; // Adjust this value as needed
|
||||
|
||||
if(obj['either-parents-pil'] && obj['either-parents-pil'] > 0){
|
||||
obj['parents'] = 1;
|
||||
obj['parents-in-law'] = 1;
|
||||
}
|
||||
|
||||
|
||||
$.each(obj, function(key, value) {
|
||||
if (value > 0 && key != 'either-parents-pil') {
|
||||
|
||||
if (value > 0 && key != 'elders_count' && key != 'either-parents-pil') {
|
||||
|
||||
const isChecked = additional_relationship && typeof additional_relationship === 'object' && additional_relationship[key] == 1 ? 'checked' : '';
|
||||
//console.log('isChecked', isChecked);
|
||||
html += `
|
||||
@ -2836,7 +2835,6 @@ function createCheckboxes(obj, additional_relationship) {
|
||||
<input class="relation_checkbox" type="checkbox" name="${key}" ${isChecked}>
|
||||
<label style="position: relative;left: 18px;bottom: 30px;">${formatString(key)}</label>
|
||||
</div>`;
|
||||
// //console.log(html);
|
||||
}
|
||||
});
|
||||
|
||||
@ -3113,4 +3111,5 @@ function checkPolicyTermsSI(callback) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@ -391,6 +391,7 @@ function generateTable(rack_rate_type) {
|
||||
$('.excel_textarea').val('');
|
||||
}
|
||||
submitData(rack_rate_type);
|
||||
$('.excel_textarea').val('');
|
||||
}
|
||||
|
||||
function submitData(rack_rate_type) {
|
||||
@ -446,7 +447,6 @@ function submitData(rack_rate_type) {
|
||||
// console.log('obj', obj)
|
||||
// console.log('length of the obj', obj.length)
|
||||
|
||||
|
||||
if ('sum_insured' in obj) {
|
||||
obj.si = obj.sum_insured;
|
||||
delete obj.sum_insured;
|
||||
@ -491,6 +491,7 @@ function submitData(rack_rate_type) {
|
||||
});
|
||||
|
||||
console.log(jsonData);
|
||||
console.log('formatType', formatType);
|
||||
|
||||
if (rack_rate_type == 1) {
|
||||
|
||||
@ -520,7 +521,7 @@ function submitData(rack_rate_type) {
|
||||
|
||||
}
|
||||
|
||||
if (formatType == 1 || formatType == 2) {
|
||||
if (formatType == 1 || formatType == 2 || formatType == 4 || formatType == 6) {
|
||||
var FirstIndex = jsonData[0]
|
||||
addGridHTML(false, FirstIndex, formatType, si_or_bp, 0)
|
||||
jsonData.shift();
|
||||
|
||||
@ -15,19 +15,19 @@
|
||||
placeholder="Enter Policy Type Name" value="<?= isset($policytype['policy_type']) ? $policytype['policy_type'] : '' ?>" name="policy_type" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="bap">Bap<span
|
||||
<label for="bap">BAP<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="bap"
|
||||
placeholder="Enter Bap" value="<?= isset($policytype['bap']) ? $policytype['bap'] : '' ?>" name="bap" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="allocg">Allocg<span
|
||||
<label for="allocg">Category<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="allocg"
|
||||
placeholder="Enter Allocg" value="<?= isset($policytype['allocg']) ? $policytype['allocg'] : '' ?>" name="allocg" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="alloci">Alloci<span
|
||||
<label for="alloci">BAP Category<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="alloci"
|
||||
placeholder="Enter Alloci" value="<?= isset($policytype['alloci']) ? $policytype['alloci'] : '' ?>" name="alloci" required>
|
||||
|
||||
@ -2,22 +2,22 @@
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<!-- <div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Policy Type List</h4>
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right; position: relative;top: 56px;">
|
||||
<a href="<?= base_url("master/policy/create"); ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<table class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Policy Type</th>
|
||||
<th class="font-weight-medium">Bap</th>
|
||||
<th class="font-weight-medium">Allocg</th>
|
||||
<th class="font-weight-medium">Alloci</th>
|
||||
<th class="font-weight-medium">BAP</th>
|
||||
<th class="font-weight-medium">Category</th>
|
||||
<th class="font-weight-medium">BAP Category</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -16,27 +16,19 @@
|
||||
<label for="tpa_short_name">TPA Short Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="short_name" placeholder="Enter Short Name" value="<?= isset($tpa['short_name']) ? $tpa['short_name'] : '' ?>" name="short_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="tpa_logo">TPA Logo<span class="text-danger"></span></label>
|
||||
<input type="file" class="form-control" onchange="PreviewImage();" id="tpa_logo" name="tpa_logo" accept="image/jpeg, image/jpg, image/png">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="tpa_network_hospitals">Network Hospitals<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="tpa_network_hospitals" name="network_hospitals" placeholder="Enter Network Hospitals" value="<?= isset($tpa['network_hospitals']) ? $tpa['network_hospitals'] : '' ?>" required>
|
||||
<input type="url" class="form-control" id="tpa_network_hospitals" name="network_hospitals" placeholder="Enter Network Hospitals" value="<?= isset($tpa['network_hospitals']) ? $tpa['network_hospitals'] : '' ?>" required data-parsley-type="url">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-10">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="tpa_ecard_template">E-Card Template<span class="text-danger"></span></label>
|
||||
<textarea style="height: 380px;" class="form-control" id="ecard_content" placeholder="Enter E-card Content" name="ecard_content"><?= isset($template_data) ? $template_data : '' ?></textarea>
|
||||
</div>
|
||||
<div class="form-group col-md-2 float-right" style="position: relative;top: 0px;left: 40px;">
|
||||
<label for="tpa_logo_preview">Logo Preview<span class="text-danger"></span></label>
|
||||
<img src="<?= isset($tpa['tpa_logo']) && !empty($tpa['tpa_logo']) ? base_url() . "public/uploads/logo/" . $tpa['tpa_logo'] : base_url() . "public/assets/images/avatar_2x.png" ?>" width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row" id="view_pre_btn" style="display :none">
|
||||
@ -46,6 +38,10 @@
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="tpa_logo">TPA Logo<span class="text-danger"></span></label>
|
||||
<input type="file" class="form-control" onchange="PreviewImage();" id="tpa_logo" name="tpa_logo" accept="image/jpeg, image/jpg, image/png">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="tpa_front_card_image">Front card Image<span class="text-danger"></span></label>
|
||||
<input type="file" class="form-control" onchange="PreviewImage2();" id="fc" name="fc" accept="image/jpeg, image/jpg, image/png">
|
||||
@ -57,6 +53,10 @@
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="tpa_logo_preview">TPA Logo Preview<span class="text-danger"></span></label>
|
||||
<img src="<?= isset($tpa['tpa_logo']) && !empty($tpa['tpa_logo']) ? base_url() . "public/uploads/logo/" . $tpa['tpa_logo'] : base_url() . "public/assets/images/avatar_2x.png" ?>" width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="tpa_front_card_preview">Front card Preview<span class="text-danger"></span></label>
|
||||
<img src="<?= isset($tpa['front_card']) && !empty($tpa['front_card']) ? base_url() . "public/uploads/template_bg/" . $tpa['front_card'] : base_url() . "public/assets/images/avatar_2x.png" ?>" width="100" height="100" id="uploadPreview2" class="avatar img-circle img-thumbnail" alt="avatar" />
|
||||
|
||||
@ -49,7 +49,18 @@
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address1">Address Line 1<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="address1" name="address1" placeholder="Enter Address 1" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address2">Address Line 2<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="address2" placeholder="Enter Address 2" name="address2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="state">State<span
|
||||
class="text-danger">*</span></label>
|
||||
<select class="form-control" id="state" name="state" required>
|
||||
@ -60,17 +71,22 @@
|
||||
<?php } }?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="district">District<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="district"
|
||||
placeholder="Enter District" name="district" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="city">City</label>
|
||||
<input type="text" class="form-control" id="branch_city"
|
||||
placeholder="Enter City" name="city" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="gst">Pincode<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@ -83,18 +99,18 @@
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="last_name">Email<span class="text-danger">*</span></label>
|
||||
<input value="" data-parsley-type="email" type="email" data-parsley-type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
|
||||
<label for="designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input value="" data-parsley-type="number" data-parsley-length="[10,10]" type="tel" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="mobile" required>
|
||||
<label for="last_name">Email<span class="text-danger">*</span></label>
|
||||
<input value="" data-parsley-type="email" type="email" data-parsley-type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
|
||||
<label for="mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input value="" data-parsley-type="number" data-parsley-length="[10,10]" type="tel" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="mobile" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display: flex;">
|
||||
@ -301,6 +317,9 @@ $(document).ready(function () {
|
||||
$('#district').val(res.tpabranch.district);
|
||||
$('#branch_city').val(res.tpabranch.city);
|
||||
$('#tpa_Branch_PrimaryKey').val(res.tpabranch.id);
|
||||
$('#pincode').val(res.tpabranch.pincode);
|
||||
$('#address1').val(res.tpabranch.address1);
|
||||
$('#address2').val(res.tpabranch.address2);
|
||||
|
||||
$('.form-row').find('#name').val(res.levelcontact[0].name);
|
||||
$('#email').val(res.levelcontact[0].email);
|
||||
@ -382,59 +401,56 @@ $(document).ready(function () {
|
||||
|
||||
function appendContactHtml(contact = false, reset = false) {
|
||||
|
||||
console.log('appendContactHtml function called ')
|
||||
contactCount++;
|
||||
console.log('appendContactHtml function called ')
|
||||
contactCount++;
|
||||
|
||||
var container = document.getElementById('container');
|
||||
var uniqueId = Date.now().toString();
|
||||
var container = document.getElementById('container');
|
||||
var uniqueId = Date.now().toString();
|
||||
|
||||
var html = `
|
||||
<div id="${uniqueId}">
|
||||
<hr>
|
||||
<h6 class="header-title">Contact ${contactCount}</h6>
|
||||
<br>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required>
|
||||
var html = `
|
||||
<div id="${uniqueId}">
|
||||
<hr>
|
||||
<h6 class="header-title">Contact ${contactCount}</h6>
|
||||
<br>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="${uniqueId}_designation" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
<input data-parsley-type="email" value="${contact !== undefined && contact !== false ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" required>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
<input data-parsley-type="email" value="${contact !== undefined && contact !== false ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display: flex;">
|
||||
<button style="margin-right: 10px;" type="button" class="btn btn-primary btn-sm ac" onclick="appendContactHtml()" id="${uniqueId}_add">Add Contact</button>
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="removeContact(this)" id="${uniqueId}_remove">Remove</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="${uniqueId}_designation" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display: flex;">
|
||||
<button style="margin-right: 10px;" type="button" class="btn btn-primary btn-sm ac" onclick="appendContactHtml()" id="${uniqueId}_add">Add Contact</button>
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="removeContact(this)" id="${uniqueId}_remove">Remove</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
`;
|
||||
|
||||
if(reset == false){
|
||||
console.log(reset)
|
||||
container.insertAdjacentHTML('beforeend', html);
|
||||
storeButtonId(uniqueId + '_add');
|
||||
if(reset == false){
|
||||
console.log(reset)
|
||||
container.insertAdjacentHTML('beforeend', html);
|
||||
storeButtonId(uniqueId + '_add');
|
||||
|
||||
if (contactCount >= 3) {
|
||||
hideStoredAddButtons();
|
||||
if (contactCount >= 3) {
|
||||
hideStoredAddButtons();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function removeContact(button) {
|
||||
var uniqueId = button.id.split("_")[0];
|
||||
var contactSection = document.getElementById(uniqueId);
|
||||
@ -459,7 +475,6 @@ function storeButtonId(id) {
|
||||
localStorage.setItem('buttonIds', JSON.stringify(buttonIds));
|
||||
}
|
||||
|
||||
|
||||
function hideStoredAddButtons() {
|
||||
var storedIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
storedIds.forEach(function(id) {
|
||||
@ -505,48 +520,47 @@ function validateForm() {
|
||||
return isValid;
|
||||
}
|
||||
|
||||
function removeTPABranch(element) {
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this TPA branch.",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
}).then((result) => {
|
||||
|
||||
function removeTPABranch(element) {
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this TPA branch.",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
}).then((result) => {
|
||||
|
||||
if (result.isConfirmed) {
|
||||
var id = element.getAttribute('data-id');
|
||||
var form_action = '<?= base_url("master/tpa/branch/remove/") ?>' + id;
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
// console.log(res.status == true);
|
||||
if(res){
|
||||
if (res.status == true) {
|
||||
toastr.success('TPA branch removed successfully', 'success');
|
||||
location.reload();
|
||||
} else {
|
||||
toastr.warning('Failed to remove TPA branch', 'warning');
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
if (result.isConfirmed) {
|
||||
var id = element.getAttribute('data-id');
|
||||
var form_action = '<?= base_url("master/tpa/branch/remove/") ?>' + id;
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
// console.log(res.status == true);
|
||||
if(res){
|
||||
if (res.status == true) {
|
||||
toastr.success('TPA branch removed successfully', 'success');
|
||||
location.reload();
|
||||
} else {
|
||||
toastr.warning('Failed to remove TPA branch', 'warning');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Failed to remove TPA branch', 'warning');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@ -4,7 +4,16 @@
|
||||
<div class="card-body">
|
||||
|
||||
<div class="text-center">
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
<i class="font-24"></i>
|
||||
<h4>CD Account No : <?php echo isset($insurerName->cd_ac_no) && !empty($insurerName->cd_ac_no) ? $insurerName->cd_ac_no : 'N/A' ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 col-xl-5">
|
||||
@ -12,8 +21,7 @@
|
||||
<i class="font-24"></i>
|
||||
<h4>Deposit Summary Of <?php echo $clientData->short_name?></h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-6 col-xl-5">
|
||||
<div class="py-1">
|
||||
<i class=" font-24"></i>
|
||||
@ -21,9 +29,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row mt-3 text-center">
|
||||
|
||||
<div class="col-3">
|
||||
@ -56,6 +63,7 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -98,31 +106,32 @@
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">CD Account No</th>
|
||||
<th class="font-weight-medium">Policy Name</th>
|
||||
<th class="font-weight-medium">Date</th>
|
||||
<!-- <th class="font-weight-medium">CD Account No</th> -->
|
||||
<th class="font-weight-medium">Policy</th>
|
||||
<th class="font-weight-medium">Endorsement No</th>
|
||||
<th class="font-weight-medium">Sub Type</th>
|
||||
<th class="font-weight-medium">Credit</th>
|
||||
<th class="font-weight-medium">Debit</th>
|
||||
<th class="font-weight-medium">Balance</th>
|
||||
<th class="font-weight-medium">Description</th>
|
||||
<th class="font-weight-medium">Date/User</th>
|
||||
<th class="font-weight-medium">User</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($depositdata as $row) { ?>
|
||||
<tr id="<?php echo $row->id;?>">
|
||||
<td><?php echo $row->cd_ac_no; ?></td>
|
||||
<td><?php echo $row->policy_name; ?></td>
|
||||
<td><?php echo $row->endorsement_no; ?></td>
|
||||
<td><?php echo date('d-M-Y h:i A', strtotime($row->created_at)); ?></td>
|
||||
<!-- <td><?php echo $row->policy_name ?? '<center> - </center>'; ?></td> -->
|
||||
<td><?php echo $row->policy_type ?? '<center> - </center>'; ?></td>
|
||||
<td><?php echo $row->endorsement_no ?? '<center> - </center>'; ?></td>
|
||||
<td><?php echo isset($subTypeOptions[$row->sub_type]) ? $subTypeOptions[$row->sub_type] : ''; ?>
|
||||
</td>
|
||||
<td><?php echo ($row->transaction_type == 'Credit') ? $row->amount : ''; ?></td>
|
||||
<td><?php echo ($row->transaction_type == 'Debit') ? $row->amount : ''; ?></td>
|
||||
<td><?php echo $row->balance; ?></td>
|
||||
<td><?php echo $row->description; ?></td>
|
||||
<td><?php echo date('d-M-Y h:i A', strtotime($row->created_at)); ?> by
|
||||
<?php echo $row->username; ?> </td>
|
||||
<td><?php echo $row->username; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
@ -156,23 +165,27 @@
|
||||
<label for="transactionMode" class="control-label">Transaction Mode</label>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="transactionMode" id="addMode"value="1" checked>
|
||||
<label class="form-check-label" for="addMode">Replenishment</label>
|
||||
<label class="form-check-label" for="addMode">Replenishment by Client</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="transactionMode" id="refund_by_insurer"value="6">
|
||||
<label class="form-check-label" for="addMode">Refund by Insurer</label>
|
||||
</div>
|
||||
<!-- <div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="transactionMode" id="adjustmentModeadd"value="2">
|
||||
<label class="form-check-label" for="adjustmentMode">Adjustment Add</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="transactionMode" id="adjustmentModereduce"value="3">
|
||||
<label class="form-check-label" for="adjustmentMode">Adjustment Reduce</label>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="transactionMode" id="assetpolicyadd"value="4">
|
||||
<label class="form-check-label" for="adjustmentMode">Asset policy Add</label>
|
||||
<label class="form-check-label" for="adjustmentMode">Non EB Credit</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="transactionMode" id="assetpolicyreduce"value="5">
|
||||
<label class="form-check-label" for="adjustmentMode">Asset policy Reduce</label>
|
||||
<label class="form-check-label" for="adjustmentMode">No EB Debit</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -323,6 +336,9 @@ $(document).ready(function() {
|
||||
}else if(transactionTypeValue == 5){
|
||||
transactionType = 'Debit'
|
||||
subType = '5'; // Asset Policy reduce
|
||||
}else if(transactionTypeValue == 6){
|
||||
transactionType = 'Debit'
|
||||
subType = '6'; // Refund by indurer
|
||||
}
|
||||
|
||||
console.log('transactionTypeValue', transactionTypeValue)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user