MERGE_PULL_NOTIFY_INCEPTION_AMT

This commit is contained in:
Venba 2024-05-17 12:41:27 +00:00
commit 2c6dca879a
30 changed files with 976 additions and 657 deletions

View File

@ -23,6 +23,10 @@ $routes->get('download-e-card/(:segment)', 'EmployeeController::generateIDCardFo
$routes->get('download-kyc-docs/(:segment)', 'ClientController::downloadKYCDocument/$1'); $routes->get('download-kyc-docs/(:segment)', 'ClientController::downloadKYCDocument/$1');
$routes->get('get-notification', 'DashboardController::getDashboardNotifications');
$routes->get('acknowledge-notification/(:segment)', 'DashboardController::acknowledgeMessage/$1');
$routes->group("/user", ["filter" => "authMVC"], function ($routes) { $routes->group("/user", ["filter" => "authMVC"], function ($routes) {
$routes->post("create", "UserController::create"); $routes->post("create", "UserController::create");

View File

@ -653,6 +653,7 @@ class ClientController extends AdminController
} }
$data['policy_no'] = $this->request->getPost('policy_no');
$data['policy_start_date'] = change_date_format($this->request->getPost('policy_start_date'), 'd-m-Y', 'Y-m-d'); $data['policy_start_date'] = change_date_format($this->request->getPost('policy_start_date'), 'd-m-Y', 'Y-m-d');
$data['policy_end_date'] = change_date_format($this->request->getPost('policy_end_date'), 'd-m-Y', 'Y-m-d'); $data['policy_end_date'] = change_date_format($this->request->getPost('policy_end_date'), 'd-m-Y', 'Y-m-d');
$data['created_by'] = get_session_userid(); $data['created_by'] = get_session_userid();
@ -696,6 +697,7 @@ class ClientController extends AdminController
$data['tpa_id'] = $tpaId; $data['tpa_id'] = $tpaId;
$data['policy_id'] = $this->request->getPost('policy_id'); $data['policy_id'] = $this->request->getPost('policy_id');
$data['policy_type_id'] = $this->request->getPost('policy_type_id'); $data['policy_type_id'] = $this->request->getPost('policy_type_id');
$data['policy_no'] = $this->request->getPost('policy_no');
$data['policy_start_date'] = change_date_format($this->request->getPost('policy_start_date'), 'd-m-Y', 'Y-m-d'); $data['policy_start_date'] = change_date_format($this->request->getPost('policy_start_date'), 'd-m-Y', 'Y-m-d');
$data['policy_end_date'] = change_date_format($this->request->getPost('policy_end_date'), 'd-m-Y', 'Y-m-d'); $data['policy_end_date'] = change_date_format($this->request->getPost('policy_end_date'), 'd-m-Y', 'Y-m-d');
@ -741,6 +743,7 @@ class ClientController extends AdminController
// dd($data); // dd($data);
$data['updated_by'] = get_session_userid(); $data['updated_by'] = get_session_userid();
// print_r($data);die;
$insert = $this->clientPolicyModel->update($id,$data); $insert = $this->clientPolicyModel->update($id,$data);
$lastQuery = $this->clientPolicyModel->getLastQuery(); $lastQuery = $this->clientPolicyModel->getLastQuery();
@ -1247,7 +1250,6 @@ class ClientController extends AdminController
$data['corporatebuffer'] = $this->request->getPost("corporatebuffer") ? $this->request->getPost("corporatebuffer") : 0; $data['corporatebuffer'] = $this->request->getPost("corporatebuffer") ? $this->request->getPost("corporatebuffer") : 0;
$data['family_floaters'] = $this->request->getPost("family_floaters") ?? []; $data['family_floaters'] = $this->request->getPost("family_floaters") ?? [];
// print_r($this->request->getPost());die;
$data['age_ratio']['self']['min'] = $this->request->getPost("self_min_age") ? $this->request->getPost("self_min_age") :0; $data['age_ratio']['self']['min'] = $this->request->getPost("self_min_age") ? $this->request->getPost("self_min_age") :0;
$data['age_ratio']['self']['max'] = $this->request->getPost("self_max_age") ? $this->request->getPost("self_max_age") : 0; $data['age_ratio']['self']['max'] = $this->request->getPost("self_max_age") ? $this->request->getPost("self_max_age") : 0;
$data['age_ratio']['spouse']['min'] = $this->request->getPost("spouse_min_age") ? $this->request->getPost("spouse_min_age") : 0; $data['age_ratio']['spouse']['min'] = $this->request->getPost("spouse_min_age") ? $this->request->getPost("spouse_min_age") : 0;
@ -1255,7 +1257,7 @@ class ClientController extends AdminController
$data['age_ratio']['child']['min'] = $this->request->getPost("child_min_age") ? $this->request->getPost("child_min_age") : 0; $data['age_ratio']['child']['min'] = $this->request->getPost("child_min_age") ? $this->request->getPost("child_min_age") : 0;
$data['age_ratio']['child']['max'] = $this->request->getPost("child_max_age") ? $this->request->getPost("child_max_age") : 0; $data['age_ratio']['child']['max'] = $this->request->getPost("child_max_age") ? $this->request->getPost("child_max_age") : 0;
$data['age_ratio']['elders']['min'] = $this->request->getPost("other_member_min_age") ? $this->request->getPost("other_member_min_age") :0; $data['age_ratio']['elders']['min'] = $this->request->getPost("other_member_min_age") ? $this->request->getPost("other_member_min_age") :0;
$data['age_ratio']['elders']['max'] = $this->request->getPost("other_member_min_age") ? $this->request->getPost("other_member_min_age") : 0; $data['age_ratio']['elders']['max'] = $this->request->getPost("other_member_max_age") ? $this->request->getPost("other_member_max_age") : 0;
@ -1331,6 +1333,8 @@ class ClientController extends AdminController
$data['family_floaters']['elders_count'] =$this->request->getPost("member_count") ? $this->request->getPost("member_count") : 0; $data['family_floaters']['elders_count'] =$this->request->getPost("member_count") ? $this->request->getPost("member_count") : 0;
// print_r($data);die;
$data['waiverofpreexistingdiseases'] =$this->request->getPost("waiverofpreexistingdiseases"); $data['waiverofpreexistingdiseases'] =$this->request->getPost("waiverofpreexistingdiseases");
if ($data['waiverofpreexistingdiseases'] == 1) { if ($data['waiverofpreexistingdiseases'] == 1) {
$data['maternitycoverage'] =str_replace(',', '',$this->request->getPost("maternitycoverage")); $data['maternitycoverage'] =str_replace(',', '',$this->request->getPost("maternitycoverage"));

View File

@ -7,12 +7,22 @@ use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface; use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use CodeIgniter\API\ResponseTrait;
use App\Models\MessageModel;
use App\Models\UserMessageModel;
class DashboardController extends AdminController class DashboardController extends AdminController
{ {
use ResponseTrait;
protected $messageModel;
protected $userMessageModel;
public function __construct() public function __construct()
{ {
$this->messageModel = new MessageModel();
$this->userMessageModel = new UserMessageModel();
} }
public function dashboard() public function dashboard()
@ -22,11 +32,26 @@ class DashboardController extends AdminController
echo view('layout/footer'); echo view('layout/footer');
} }
public function dashboardNotifications() public function getDashboardNotifications()
{ {
//pull notofications to dashboard especially for file upload cases //pull notofications to dashboard especially for file upload cases
$userId = get_session_userid();
$roleId = 5;
$teamId = 1;
$messages = $this->messageModel->getMessagesForUser($userId, $roleId, $teamId);
return $this->respond($messages);
}
public function acknowledgeMessage($messageId)
{
$userId = get_session_userid();
$this->userMessageModel->markAsRead($userId, $messageId);
return $this->respond(['status' => 'success']);
} }
} }

View File

@ -22,6 +22,8 @@ use App\Models\BatchFileModel;
use App\Models\EmpEndorsementModel; use App\Models\EmpEndorsementModel;
use App\Models\ClientDepositModel; use App\Models\ClientDepositModel;
use App\Models\NotificationModel; use App\Models\NotificationModel;
use App\Models\MessageModel;
use App\Models\UserMessageModel;
use App\Controllers\Jobs; use App\Controllers\Jobs;
use App\Controllers\JobWorker; use App\Controllers\JobWorker;
@ -48,6 +50,8 @@ class EmpDataServiceController extends BaseController
protected $empEndorsementModel; protected $empEndorsementModel;
protected $clientDepositModel; protected $clientDepositModel;
protected $notificationModel; protected $notificationModel;
protected $messageModel;
protected $userMessageModel;
public function __construct() public function __construct()
{ {
@ -64,6 +68,8 @@ class EmpDataServiceController extends BaseController
$this->empEndorsementModel = new EmpEndorsementModel(); $this->empEndorsementModel = new EmpEndorsementModel();
$this->clientDepositModel = new ClientDepositModel(); $this->clientDepositModel = new ClientDepositModel();
$this->notificationModel = new NotificationModel(); $this->notificationModel = new NotificationModel();
$this->messageModel = new MessageModel();
$this->userMessageModel = new UserMessageModel();
} }
@ -638,7 +644,10 @@ class EmpDataServiceController extends BaseController
$this->batchFileModel->where('id', $file_id)->set($data)->update(); $this->batchFileModel->where('id', $file_id)->set($data)->update();
$this->myLogger->logme('error', 'importInceptionFileValidation TPAID already updated'); $this->myLogger->logme('error', 'importInceptionFileValidation TPAID already updated');
return 3; $file_data = $this->getDataByFileId($file_id, 'failure');
$this->setPullNotification($file_data);
return 'The list of employees provided has already been updated with the TPA ID, or this is not the correct file';
} else if ($insurer_or_tpa == 'insurer') { } else if ($insurer_or_tpa == 'insurer') {
@ -649,7 +658,10 @@ class EmpDataServiceController extends BaseController
$this->batchFileModel->where('id', $file_id)->set($data)->update(); $this->batchFileModel->where('id', $file_id)->set($data)->update();
$this->myLogger->logme('error', 'importInceptionFileValidation UHID already updated'); $this->myLogger->logme('error', 'importInceptionFileValidation UHID already updated');
return 5; $file_data = $this->getDataByFileId($file_id, 'failure');
$this->setPullNotification($file_data);
return 'The list of employees provided has already been updated with the UHID, or this is not the correct file';
} }
$this->myLogger->logme('error', 'importInceptionFileValidation UHID or TPAID already updated or the uploadedfile is not correct'); $this->myLogger->logme('error', 'importInceptionFileValidation UHID or TPAID already updated or the uploadedfile is not correct');
@ -685,7 +697,10 @@ class EmpDataServiceController extends BaseController
$this->batchFileModel->where('id', $file_id)->set($data)->update(); $this->batchFileModel->where('id', $file_id)->set($data)->update();
$this->myLogger->logme('error', 'importInceptionFileValidation excel file count ( {excel} ) exceeds db count ( {db} )', ['db' => $emp_data_count, 'excel' => $excel_data_count]); $this->myLogger->logme('error', 'importInceptionFileValidation excel file count ( {excel} ) exceeds db count ( {db} )', ['db' => $emp_data_count, 'excel' => $excel_data_count]);
return 6; $file_data = $this->getDataByFileId($file_id, 'failure');
$this->setPullNotification($file_data);
return 'The Excel record count exceeds the DB record count. excel file count : ' . $excel_data_count . 'db count : ' . $emp_data_count;
} }
@ -877,11 +892,17 @@ class EmpDataServiceController extends BaseController
if ($insurer_or_tpa == 'tpa') { if ($insurer_or_tpa == 'tpa') {
return 2; $file_data = $this->getDataByFileId($file_id, 'failure');
$this->setPullNotification($file_data);
return 'The TPA ID column is either partially or entirely empty.';
} else if ($insurer_or_tpa == 'insurer') { } else if ($insurer_or_tpa == 'insurer') {
return 4; $file_data = $this->getDataByFileId($file_id, 'failure');
$this->setPullNotification($file_data);
return 'The UHID column is either partially or entirely empty.';
} }
} }
@ -923,6 +944,7 @@ class EmpDataServiceController extends BaseController
$job_details = new Jobs(); $job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'importInceptionUpdateTPAandUHID','payload' => ['file_id' => $file_id]]); $r = Jobs::addJob(['job_name' => 'importInceptionUpdateTPAandUHID','payload' => ['file_id' => $file_id]]);
// $this->importInceptionUpdateTPAandUHID(['file_id' => $file_id]); // $this->importInceptionUpdateTPAandUHID(['file_id' => $file_id]);
} }
@ -945,7 +967,10 @@ class EmpDataServiceController extends BaseController
$this->batchFileModel->where('id', $file_id)->set($data)->update(); $this->batchFileModel->where('id', $file_id)->set($data)->update();
$this->myLogger->logme('error', 'importInceptionUpdateTPAandUHID the Physical file not found - file id : {data}', ['data' => $file_id]); $this->myLogger->logme('error', 'importInceptionUpdateTPAandUHID the Physical file not found - file id : {data}', ['data' => $file_id]);
return 0; // Return error code if file not found $file_data = $this->getDataByFileId($file_id, 'failure');
$this->setPullNotification($file_data);
return 'importInceptionUpdateTPAandUHID the Physical file not found'; // Return error code if file not found
} }
$client_id = $file['client_id']; $client_id = $file['client_id'];
@ -1051,6 +1076,7 @@ class EmpDataServiceController extends BaseController
$this->myLogger->logme('error', 'importInceptionUpdateTPAandUHID total amount for cash deposite : {data}', ['data'=> $totals]); $this->myLogger->logme('error', 'importInceptionUpdateTPAandUHID total amount for cash deposite : {data}', ['data'=> $totals]);
if ($file['insurer_or_tpa'] == 'tpa') { if ($file['insurer_or_tpa'] == 'tpa') {
$this->myLogger->logme('error', 'importInceptionUpdateTPAandUHID set cashDepositCalculationForInception and sendMailForDownloadingECard in JOB QUEUE'); $this->myLogger->logme('error', 'importInceptionUpdateTPAandUHID set cashDepositCalculationForInception and sendMailForDownloadingECard in JOB QUEUE');
@ -1086,10 +1112,12 @@ class EmpDataServiceController extends BaseController
// $this->cashDepositCalculationForInception($depositeData); // $this->cashDepositCalculationForInception($depositeData);
// $this->sendMailForDownloadingECard($empty_emp_tpa_uh_ids); // $this->sendMailForDownloadingECard($empty_emp_tpa_uh_ids);
} }
return 1; $file_data = $this->getDataByFileId($file_id, 'success');
$this->setPullNotification($file_data);
return 'Import Inception Updated '. $status_val . '- Updated Count : ' . $emp_count;
} }
@ -2063,10 +2091,12 @@ class EmpDataServiceController extends BaseController
$this->myLogger->logme('error', 'sendMailForDownloadingECard - inside try'); $this->myLogger->logme('error', 'sendMailForDownloadingECard - inside try');
$count = 0; $count = 0;
$counts = 0;
foreach ($ids as $key => $id) { foreach ($ids as $key => $id) {
$get_emp_email_and_other_details = $this->employeePolicyModel $get_emp_email_and_other_details = $this->employeePolicyModel
->select('employee_polices.client_policy_id, employees.emp_code, employees.email_corporate,employees.client_id as client_id, employees.name, employee_polices.rand_string, employee_polices.tpa_id') ->select('employee_polices.client_policy_id, employees.relationship, employees.emp_code, employees.email_corporate,employees.client_id as client_id, employees.name, employee_polices.rand_string, employee_polices.tpa_id')
->join('employees', 'employees.id = employee_polices.employee_id') ->join('employees', 'employees.id = employee_polices.employee_id')
->where('employees.emp_status', 'active') ->where('employees.emp_status', 'active')
->where('employees.is_active', '1') ->where('employees.is_active', '1')
@ -2091,12 +2121,18 @@ class EmpDataServiceController extends BaseController
$params['notification'] = $notification; $params['notification'] = $notification;
$params['notification'] = $notification; $params['notification'] = $notification;
$params['get_emp_email_and_other_details'] = $get_emp_email_and_other_details; $params['get_emp_email_and_other_details'] = $get_emp_email_and_other_details;
// $this->myLogger->logme('error', 'sendMailForDownloadingECard - Send Bulk Mail function end ',);
if (isset($get_emp_email_and_other_details['email_corporate']) && !empty($get_emp_email_and_other_details['email_corporate']) && $get_emp_email_and_other_details['relationship'] === 'Self') {
$wholeData[] = sendMailNotification::sendMailNotification('member_ecard_mail', $params); $wholeData[] = sendMailNotification::sendMailNotification('member_ecard_mail', $params);
$count++; $count++;
}
$counts++;
if ($count == 20 || $count == count($ids) - 1) { if ($count == 20 || $counts == count($ids) - 1) {
if(count($wholeData) > 0){
$this->myLogger->logme('error', 'sendMailForDownloadingECard - create a job to bulk mail',); $this->myLogger->logme('error', 'sendMailForDownloadingECard - create a job to bulk mail',);
@ -2104,6 +2140,9 @@ class EmpDataServiceController extends BaseController
$r = Jobs::addJob(['job_name' => 'bulk_mail', 'payload' => $wholeData]); $r = Jobs::addJob(['job_name' => 'bulk_mail', 'payload' => $wholeData]);
$wholeData = []; $wholeData = [];
$count = 0; $count = 0;
}
} }
$this->myLogger->logme('error', 'sendMailForDownloadingECard - Send Bulk Mail function end ',); $this->myLogger->logme('error', 'sendMailForDownloadingECard - Send Bulk Mail function end ',);
@ -2174,4 +2213,58 @@ class EmpDataServiceController extends BaseController
} }
public function getDataByFileId($file_id, $status = 'success'){
$data = $this->batchFileModel
->select('batch_files.*, clients.client_name, clients.short_name, policies.name as policy_name')
->join('clients', 'clients.id = batch_files.client_id')
->join('client_policy', 'client_policy.id = batch_files.client_policy_id')
->join('policies', 'policies.id = client_policy.policy_id')
->where('batch_files.id', $file_id)
->first();
if($status == 'success'){
$msg_txt = $data['short_name'] . ' - ' . $data['policy_name'] . ' - ' . $data['event_type'] . ' - ' . $data['actions'] . ' - ' . $data['insurer_or_tpa'];
$msg_title = 'File Upload Success';
}else if ($status == 'failure'){
$msg_txt = $data['short_name'] . ' - ' . $data['policy_name'] . ' - ' . $data['event_type'] . ' - ' . $data['actions'] . ' - ' . $data['insurer_or_tpa'];
$msg_title = 'File Upload Failure';
}
$user_id = $data['created_by'];
$url = 'employee/upload#KYC-DOC-tab';
return ['msg_txt' => $msg_txt, 'user_id' => $user_id, 'url' => $url, 'status' => $status, 'title' => $msg_title];
}
public function setPullNotification($data){
$array = ['message_text' => $data['msg_txt'], 'action_url' => $data['url'], 'msg_status' => $data['status'], 'msg_title' => $data['title']];
$jsonEncodeData = json_encode($array);
$msg_data = [
'message_text' => $jsonEncodeData,
'user_id' => $data['user_id'],
'role_id' => NULL,
'team_id' => NULL,
'message_type' => '1to1',
];
$this->messageModel->insert($msg_data);
}
} }

View File

@ -216,13 +216,40 @@ class EmployeeController extends AdminController
$data['import_or_export'] = ['import' => 'Import', 'export' => 'Export']; $data['import_or_export'] = ['import' => 'Import', 'export' => 'Export'];
$data['insurer_or_tpa'] = ['insurer' => 'Insurer', 'tpa' => 'TPA']; $data['insurer_or_tpa'] = ['insurer' => 'Insurer', 'tpa' => 'TPA'];
// $data['fileList'] = $this->fileModel
// ->select(['files.*', 'up.emp_code', 'up.first_name', 'pm.name as policy_name', 'c.short_name', 'cp.id as client_policy_id'])
// ->join('user_profiles up', 'files.created_by = up.id')
// ->join('client_policy cp', 'files.policy_id = cp.id', 'left')
// ->join('policies pm', 'cp.policy_id = pm.id', 'left')
// ->join('clients c', 'files.client_id = c.id and files.client_id = cp.client_id', 'left')
// ->where('files.created_by', get_session_userid())->orderBy('files.created_at', 'desc')->findAll();
// dd($this->fileModel->getLastQuery());
$data['fileList'] = $this->fileModel $data['fileList'] = $this->fileModel
->select(['files.*', 'up.emp_code', 'up.first_name', 'pm.name as policy_name', 'c.short_name', 'cp.id as client_policy_id']) ->select([
'files.*',
'up.emp_code',
'up.first_name',
'pm.name as policy_name',
'c.short_name',
'cp.id as client_policy_id',
'(SELECT COUNT(*)
FROM employees e
JOIN employee_polices ep ON e.id = ep.employee_id
WHERE e.file_id = files.id AND ep.client_policy_id = files.policy_id) as employee_count',
'(SELECT SUM(ep.rata_premimum) + SUM(ep.gst)
FROM employees e
JOIN employee_polices ep ON e.id = ep.employee_id
WHERE e.file_id = files.id AND ep.client_policy_id = files.policy_id) as total'
])
->join('user_profiles up', 'files.created_by = up.id') ->join('user_profiles up', 'files.created_by = up.id')
->join('client_policy cp', 'files.policy_id = cp.id', 'left') ->join('client_policy cp', 'files.policy_id = cp.id', 'left')
->join('policies pm', 'cp.policy_id = pm.id', 'left') ->join('policies pm', 'cp.policy_id = pm.id', 'left')
->join('clients c', 'files.client_id = c.id and files.client_id = cp.client_id', 'left') ->join('clients c', 'files.client_id = c.id and files.client_id = cp.client_id', 'left')
->where('files.created_by', get_session_userid())->orderBy('files.created_at', 'desc')->findAll(); ->where('files.created_by', get_session_userid())
->orderBy('files.created_at', 'desc')
->findAll();
// dd($data['fileList']);
$data['batch_list'] = $this->batchFileModel->select('batch_files.*, policies.name as policy_name, clients.short_name as client_short_name') $data['batch_list'] = $this->batchFileModel->select('batch_files.*, policies.name as policy_name, clients.short_name as client_short_name')
->join('client_policy', 'client_policy.id = batch_files.client_policy_id') ->join('client_policy', 'client_policy.id = batch_files.client_policy_id')
@ -901,6 +928,7 @@ class EmployeeController extends AdminController
'{CORPORATE_NAME}' =>$value['client_name'], '{CORPORATE_NAME}' =>$value['client_name'],
'{AGE}' =>$value['emp_age'], '{AGE}' =>$value['emp_age'],
'{TPA_NAME}' =>$value['emp_age'], '{TPA_NAME}' =>$value['emp_age'],
'{TPA_LOGO}' => base_url() . 'public/uploads/logo/' . $value['tpa_logo'],
]; ];
// Replace placeholders with values in HTML content // Replace placeholders with values in HTML content

View File

@ -877,7 +877,7 @@ class EmployeeRestController extends AdminController
if (isset($notification) && $notification['enabled'] == 1) { if (isset($notification) && $notification['enabled'] == 1) {
//trigger //trigger
if ($dataToInsert[$a]['relationship'] == 'Self') { if ($dataToInsert[$a]['relationship'] == 'Self' && isset($dataToInsert[$a]['email_corporate']) && !empty($dataToInsert[$a]['email_corporate'])) {
$params['dataToInsert'] = $dataToInsert[$a]; $params['dataToInsert'] = $dataToInsert[$a];
$params['notification'] = $notification; $params['notification'] = $notification;
@ -887,14 +887,13 @@ class EmployeeRestController extends AdminController
$count++; $count++;
} }
if($count == 20 || $a == count($dataToInsert)-1){ if($count == 20 || $a == count($dataToInsert)-1){
if (count($wholeData) > 0) {
$job_details = new Jobs(); $job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'bulk_mail','payload' => $wholeData]); $r = Jobs::addJob(['job_name' => 'bulk_mail','payload' => $wholeData]);
// $wholeData[]= $r;
// Mailhelper::bulk_mail($wholeData);
$wholeData = []; $wholeData = [];
$count = 0; $count = 0;
} }
}
// if ($dataToInsert[$a]['email_corporate'] != null || $dataToInsert[$a]['email_corporate'] != '' && $dataToInsert[$a]['relationship'] == 'Self') { // if ($dataToInsert[$a]['email_corporate'] != null || $dataToInsert[$a]['email_corporate'] != '' && $dataToInsert[$a]['relationship'] == 'Self') {

View File

@ -15,6 +15,7 @@ use App\Models\ClientPolicyModel;
use App\Models\PolicesModel; use App\Models\PolicesModel;
use App\Models\FileModel; use App\Models\FileModel;
use App\Models\EmpEndorsementModel; use App\Models\EmpEndorsementModel;
use App\Models\MessageModel;
use App\Controllers\Jobs ; use App\Controllers\Jobs ;
use App\Controllers\JobWorker ; use App\Controllers\JobWorker ;
@ -33,6 +34,7 @@ class EmployeeServiceController extends AdminController
protected $clientPolicyModel; protected $clientPolicyModel;
protected $policiesModel; protected $policiesModel;
protected $empEndorsementModel; protected $empEndorsementModel;
protected $messageModel;
protected $general_relationships = ['self' => ['name' => 'Self', 'gender' => 'M','age_min' => 18,'age_max' => null], 'spouse' => ['name' => 'Spouse', 'gender' => 'F','age_min' => 18,'age_max' => null], 'son' => ['name' => 'Son', 'gender' => 'M','age_min' => null,'age_max' => 25], 'daughter' => ['name' => 'Daughter', 'gender' => 'F','age_min' => null,'age_max' => 25], 'father' => ['name' => 'Father', 'gender' => 'M','age_min' => 18,'age_max' => null], 'mother' => ['name' => 'Mother', 'gender' => 'F','age_min' => 18,'age_max' => null], 'father-in-law' => ['name' => 'Father in Law', 'gender' => 'M','age_min' => 18,'age_max' => null], 'mother-in-law' => ['name' => 'Mother in Law', 'gender' => 'F','age_min' => 18,'age_max' => null]]; protected $general_relationships = ['self' => ['name' => 'Self', 'gender' => 'M','age_min' => 18,'age_max' => null], 'spouse' => ['name' => 'Spouse', 'gender' => 'F','age_min' => 18,'age_max' => null], 'son' => ['name' => 'Son', 'gender' => 'M','age_min' => null,'age_max' => 25], 'daughter' => ['name' => 'Daughter', 'gender' => 'F','age_min' => null,'age_max' => 25], 'father' => ['name' => 'Father', 'gender' => 'M','age_min' => 18,'age_max' => null], 'mother' => ['name' => 'Mother', 'gender' => 'F','age_min' => 18,'age_max' => null], 'father-in-law' => ['name' => 'Father in Law', 'gender' => 'M','age_min' => 18,'age_max' => null], 'mother-in-law' => ['name' => 'Mother in Law', 'gender' => 'F','age_min' => 18,'age_max' => null]];
protected $inception_excel_columns = ['sno'=>['col_idx'=>0,'col_cell_name'=>'A','col_name'=>'S.No','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'emp_id'=>['col_idx'=>1,'col_cell_name'=>'B','col_name'=>'EMP ID','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'name_of_emp_dep'=>['col_idx'=>2,'col_cell_name'=>'C','col_name'=>'NAME OF EMP/DEP','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'dob'=>['col_idx'=>3,'col_cell_name'=>'D','col_name'=>'DOB','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'custom'=>'check_dob_diff','params'=>['row','relationship','default_age_ratio']],'gender'=>['col_idx'=>4,'col_cell_name'=>'E','col_name'=>'Gender','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>['M','F']],'relationship'=>['col_idx'=>5,'col_cell_name'=>'F','col_name'=>'RELATIONSHIP','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_relationship','params'=>['row','relationship','policy_terms']],'basic_cover_si'=>['col_idx'=>6,'col_cell_name'=>'G','col_name'=>'BASIC COVER SI','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom' => 'check_si','params' => ['row','policy_terms','slab_details']],'doc'=>['col_idx'=>7,'col_cell_name'=>'H','col_name'=>'Date of Coverage','is_mandatory'=>['A','DA'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'params'=>['row']],'doj'=>['col_idx'=>8,'col_cell_name'=>'I','col_name'=>'DOJ','is_mandatory'=>false,'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'custom'=>'check_doj','params'=>['row']],'basic_pay'=>['col_idx'=>9,'col_cell_name'=>'J','col_name'=>'Basic Pay','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_basic_pay','params'=>['row','policy_terms','slab_details']],'band_grade'=>['col_idx'=>10,'col_cell_name'=>'K','col_name'=>'Band/Grade','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_employee_band','params'=>['row','policy_terms','slab_details']],'designation'=>['col_idx'=>11,'col_cell_name'=>'L','col_name'=>'Designation','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'phone'=>['col_idx'=>12,'col_cell_name'=>'M','col_name'=>'Phone','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom' => 'check_dup_mobileno','params' => ['row','existing_mobilenos']],'email'=>['col_idx'=>13,'col_cell_name'=>'N','col_name'=>'Email','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'pre_existing_ailments'=>['col_idx'=>14,'col_cell_name'=>'O','col_name'=>'PRE EXISTING AILMENTS','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>['0','1']],'change_event'=>['col_idx'=>15,'col_cell_name'=>'P','col_name'=>'Change event','is_mandatory'=>['A','DA','D'],'data_type'=>'str','format'=>null,'allowed_values'=>null],'date_of_exit'=>['col_idx'=>16,'col_cell_name'=>'Q','col_name'=>'Date of exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null],'reason_for_exit'=>['col_idx'=>17,'col_cell_name'=>'R','col_name'=>'Reason for exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>null,'allowed_values'=>null]]; protected $inception_excel_columns = ['sno'=>['col_idx'=>0,'col_cell_name'=>'A','col_name'=>'S.No','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'emp_id'=>['col_idx'=>1,'col_cell_name'=>'B','col_name'=>'EMP ID','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'name_of_emp_dep'=>['col_idx'=>2,'col_cell_name'=>'C','col_name'=>'NAME OF EMP/DEP','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'dob'=>['col_idx'=>3,'col_cell_name'=>'D','col_name'=>'DOB','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'custom'=>'check_dob_diff','params'=>['row','relationship','default_age_ratio']],'gender'=>['col_idx'=>4,'col_cell_name'=>'E','col_name'=>'Gender','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>['M','F']],'relationship'=>['col_idx'=>5,'col_cell_name'=>'F','col_name'=>'RELATIONSHIP','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_relationship','params'=>['row','relationship','policy_terms']],'basic_cover_si'=>['col_idx'=>6,'col_cell_name'=>'G','col_name'=>'BASIC COVER SI','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom' => 'check_si','params' => ['row','policy_terms','slab_details']],'doc'=>['col_idx'=>7,'col_cell_name'=>'H','col_name'=>'Date of Coverage','is_mandatory'=>['A','DA'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'params'=>['row']],'doj'=>['col_idx'=>8,'col_cell_name'=>'I','col_name'=>'DOJ','is_mandatory'=>false,'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'custom'=>'check_doj','params'=>['row']],'basic_pay'=>['col_idx'=>9,'col_cell_name'=>'J','col_name'=>'Basic Pay','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_basic_pay','params'=>['row','policy_terms','slab_details']],'band_grade'=>['col_idx'=>10,'col_cell_name'=>'K','col_name'=>'Band/Grade','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_employee_band','params'=>['row','policy_terms','slab_details']],'designation'=>['col_idx'=>11,'col_cell_name'=>'L','col_name'=>'Designation','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'phone'=>['col_idx'=>12,'col_cell_name'=>'M','col_name'=>'Phone','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom' => 'check_dup_mobileno','params' => ['row','existing_mobilenos']],'email'=>['col_idx'=>13,'col_cell_name'=>'N','col_name'=>'Email','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'pre_existing_ailments'=>['col_idx'=>14,'col_cell_name'=>'O','col_name'=>'PRE EXISTING AILMENTS','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>['0','1']],'change_event'=>['col_idx'=>15,'col_cell_name'=>'P','col_name'=>'Change event','is_mandatory'=>['A','DA','D'],'data_type'=>'str','format'=>null,'allowed_values'=>null],'date_of_exit'=>['col_idx'=>16,'col_cell_name'=>'Q','col_name'=>'Date of exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null],'reason_for_exit'=>['col_idx'=>17,'col_cell_name'=>'R','col_name'=>'Reason for exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>null,'allowed_values'=>null]];
@ -54,6 +56,7 @@ class EmployeeServiceController extends AdminController
$this->clientPolicyModel = new ClientPolicyModel(); $this->clientPolicyModel = new ClientPolicyModel();
$this->policiesModel = new PolicesModel(); $this->policiesModel = new PolicesModel();
$this->empEndorsementModel = new EmpEndorsementModel(); $this->empEndorsementModel = new EmpEndorsementModel();
$this->messageModel = new MessageModel();
} }
public function excelFileFormatValidation($params) public function excelFileFormatValidation($params)
@ -143,7 +146,7 @@ class EmployeeServiceController extends AdminController
$policy_details = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']); $policy_details = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']);
$policy_terms = json_decode($policy_details[0]->policy_terms); $policy_terms = json_decode($policy_details[0]->policy_terms);
$policy_terms = (array) $policy_terms;// convert obj to array $policy_terms = (array) $policy_terms;// convert obj to array
$default_age_ratio = isset($policy_details[0]->age_ratio) ? json_decode($policy_details[0]->age_ratio) : []; $default_age_ratio = isset($policy_terms['age_ratio']) ? json_decode(json_encode($policy_terms['age_ratio']),true) : [];
// //
// dd($default_age_ratio); // dd($default_age_ratio);
@ -271,6 +274,9 @@ class EmployeeServiceController extends AdminController
$failure_reason = ((json_encode($result))); $failure_reason = ((json_encode($result)));
$this->fileModel->where('id', $file_id)->set(['status' => $status,'reason' => $failure_reason])->update(); $this->fileModel->where('id', $file_id)->set(['status' => $status,'reason' => $failure_reason])->update();
$this->myLogger->logme("error",'{file_id} uploaded failed',['file_id' => $file_id]); $this->myLogger->logme("error",'{file_id} uploaded failed',['file_id' => $file_id]);
//set failure msg to pull notifications
$this->setPullNotification($this->getFileMetaDataByFileId($file_id,'failure'));
} }
else //trigger next data validation via job queue server else //trigger next data validation via job queue server
{ {
@ -376,26 +382,28 @@ class EmployeeServiceController extends AdminController
} }
} }
if(($file['action'] == 'inception' || $file['action'] == 'addition' || $file['action'] == 'dependent_addition') && ($policy_details['policy_type_id'] != 3)) // 3 is GMC parents (base policy or dep addon) //check self availbale in uploaded file
if(($file['action'] == 'inception' || $file['action'] == 'addition') && ($policy_details['policy_type_id'] == 3 && $policy_details['base_policy'] == null)) // 3 is GMC parents dep addon)
{ {
// dd('file check');
$res = check_self_available_in_family($family,$file['action']); $res = check_self_available_in_family($family,$file['action']);
// dd($res); // dd($res);
if(!$res['is_self_found']) if(!$res['is_self_found'])
{ {
array_push($result['error_summary'],14); // Self not found array_push($result['error_summary'],14); // Self not found
$result['error_data'][ $res['row_id'] ]['sno']['error'][] = "Self not found "; $result['error_data'][ $res['row_id'] ]['sno']['error'][] = "Self not found in uploaded file";
} }
} }
//check self avaialbe where self data is not available either in excel or same policy (i.e.) gMC parents //check self avaialbe where self data is not available either same policy (i.e.) gMC parents
if($policy_details['policy_type_id'] == 3) // 3 is GMC parents (base policy or dep addon) if($file['action'] == 'dependent_addition' || ($policy_details['policy_type_id'] == 3 && $policy_details['base_policy'] == null)) // 3 is GMC parents as base policy not as dep addon)
{ {
$self_details = $this->employeeModel->getEmpFamilybyEmpCode(emp_code: $emp_id,client_id: $file['client_id'],emp_status: ['active'],policy_status:['active']); $self_details = $this->employeeModel->getEmpFamilybyEmpCode(emp_code: $emp_id,client_id: $file['client_id'],emp_status: ['active'],policy_status:['active']);
// dd($self_details); // dd($self_details);
if(!count($self_details)) if(!count($self_details))
{ {
array_push($result['error_summary'],14); // Self not found array_push($result['error_summary'],14); // Self not found
$result['error_data'][ $family[0][0] ]['sno']['error'][] = "Self not found "; $result['error_data'][ $family[0][0] ]['sno']['error'][] = "Self not found in System";
} }
} }
@ -446,8 +454,8 @@ class EmployeeServiceController extends AdminController
$failure_reason = ((json_encode($result))); $failure_reason = ((json_encode($result)));
$this->fileModel->where('id', $file_id)->set(['status' => $status,'reason' => $failure_reason])->update(); $this->fileModel->where('id', $file_id)->set(['status' => $status,'reason' => $failure_reason])->update();
$this->myLogger->logme("error",'{file_id} uploaded failed',['file_id' => $file_id]); $this->myLogger->logme("error",'{file_id} uploaded failed',['file_id' => $file_id]);
//return $this->respond(['dataStatus' => true,'code' => 404,'data' => 'file upload failed with errors'], 200); //set failure msg to pull notifications
// dd($failure_reason); $this->setPullNotification($this->getFileMetaDataByFileId($file_id,'failure'));
} }
else if($file['action'] == 'deletion') else if($file['action'] == 'deletion')
{ {
@ -571,6 +579,8 @@ class EmployeeServiceController extends AdminController
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update(); $this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]); $this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]);
$this->setPullNotification($this->getFileMetaDataByFileId($file_id,'success'));
} }
else if(isset($params['client_policy_id']))//handle data from enrollment to inception else if(isset($params['client_policy_id']))//handle data from enrollment to inception
@ -708,6 +718,9 @@ class EmployeeServiceController extends AdminController
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update(); $this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]); $this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]);
//set success msg to pull notifications
$this->setPullNotification($this->getFileMetaDataByFileId($file_id,'success'));
return $endorsement_data; return $endorsement_data;
} }
@ -768,6 +781,8 @@ class EmployeeServiceController extends AdminController
} }
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update(); $this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]); $this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]);
//set success msg to pull notifications
$this->setPullNotification($this->getFileMetaDataByFileId($file_id,'success'));
return true; return true;
} }
@ -838,6 +853,8 @@ class EmployeeServiceController extends AdminController
} }
$this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update(); $this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update();
$this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]); $this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]);
//set success msg to pull notifications
$this->setPullNotification($this->getFileMetaDataByFileId($file_id,'success'));
return true; return true;
} }
@ -1088,6 +1105,54 @@ class EmployeeServiceController extends AdminController
// --------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------
public function getFileMetaDataByFileId($file_id, $status = 'success'){
$data = $this->fileModel
->select('files.*, clients.client_name, clients.short_name, policies.name as policy_name')
->join('clients', 'clients.id = files.client_id')
->join('client_policy', 'client_policy.id = files.policy_id')
->join('policies', 'policies.id = client_policy.policy_id')
->where('files.id', $file_id)
->first();
if($status == 'success')
{
$msg_title = 'File Upload Success';
}
else if ($status == 'failure')
{
$msg_title = 'File Upload Failure';
}
$msg_txt = $data['client_name'] . ' - ' . $data['policy_name'] . ' - ' . ucfirst($data['action']);
$user_id = $data['created_by'];
$url = 'employee/upload';
return ['msg_txt' => $msg_txt, 'user_id' => $user_id, 'url' => $url, 'status' => $status, 'title' => $msg_title];
}
public function setPullNotification($data){
$array = ['message_text' => $data['msg_txt'], 'action_url' => $data['url'], 'msg_status' => $data['status'], 'msg_title' => $data['title']];
$jsonEncodeData = json_encode($array);
$msg_data = [
'message_text' => $jsonEncodeData,
'user_id' => $data['user_id'],
'role_id' => NULL,
'team_id' => NULL,
'message_type' => '1to1',
];
$this->messageModel->insert($msg_data);
}
} }

View File

@ -185,7 +185,7 @@ class JobWorker extends AdminController
//die(); //die();
$job_status = self::STATUS_FAILED; $job_status = self::STATUS_FAILED;
$runtime = $runtime === null ? microtime(true) - $start : $runtime; $runtime = $runtime === null ? microtime(true) - $start : $runtime;
$response = $e->getMessage(); $response = ['file_name' => $e->getFile(),'error' => $e->getMessage(),'line_no' => $e->getLine(),'info' => $e->getTraceAsString()];
} }
$db->query("UPDATE jobs SET status=?, run_time=?, response=? WHERE id=? AND uuid=?", [ $db->query("UPDATE jobs SET status=?, run_time=?, response=? WHERE id=? AND uuid=?", [

View File

@ -6,10 +6,17 @@ use App\Controllers\PublicController;
class SubJob extends PublicController class SubJob extends PublicController
{ {
protected $myLogger;
public function __construct()
{
$this->myLogger = \Config\Services::mylogger();
}
public function handle($payload) public function handle($payload)
{ {
$log = \Config\Services::mylogger(); $log = \Config\Services::mylogger();
$log->logme('error', 'handle called'); $log->logme('error', 'insdie handle called');
$this->myLogger->logme('error', 'common handle called');
return $payload['a'] - $payload['b']; return $payload['a'] - $payload['b'];
} }

View File

@ -427,6 +427,7 @@ class MasterController extends AdminController
$data['tpa_logo'] = $file_name; $data['tpa_logo'] = $file_name;
$data['front_card'] = $front_card_file_name; $data['front_card'] = $front_card_file_name;
$data['back_card'] = $back_card_file_name; $data['back_card'] = $back_card_file_name;
$data['network_hospitals'] = $this->request->getPost('network_hospitals');
$insert = $this->tpaModel->insert($data); $insert = $this->tpaModel->insert($data);
@ -566,6 +567,7 @@ class MasterController extends AdminController
$data['back_card'] = $back_card_file_name; $data['back_card'] = $back_card_file_name;
} }
$data['network_hospitals'] = $this->request->getPost('network_hospitals');
$update = $this->tpaModel->update($id,$data); $update = $this->tpaModel->update($id,$data);

View File

@ -147,12 +147,15 @@ class NotificationController extends AdminController
$count++; $count++;
$temp_whole_data[] = $value; $temp_whole_data[] = $value;
if($count == 20 || $whole_index == count($wholeData)-1 && $index == count($values)-1){ if($count == 20 || $whole_index == count($wholeData)-1 && $index == count($values)-1){
if (count($temp_whole_data) > 0) {
$job_details = new Jobs(); $job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'bulk_mail','payload' => $temp_whole_data]); $r = Jobs::addJob(['job_name' => 'bulk_mail','payload' => $temp_whole_data]);
$temp_whole_data = []; $temp_whole_data = [];
$count = 0; $count = 0;
} }
}
} }
} }
} }

View File

@ -58,21 +58,32 @@ class sendMailNotification
$emp_data = $EmployeeModel->where('client_id', $client_data['id'])->where('emp_code', $value['emp_code'])->where('is_active',1)->findAll(); $emp_data = $EmployeeModel->where('client_id', $client_data['id'])->where('emp_code', $value['emp_code'])->where('is_active',1)->findAll();
foreach ($emp_data as $key => $value) { if(count($emp_data) > 1){
$mail ='';
foreach ($emp_data as $key => $values) {
if ($value['relationship'] == 'Self') { if ($value['relationship'] == 'Self') {
$employee_name =$value['name']; $employee_name =$values['name'];
$mail_content = str_replace("[[member_name]]", $employee_name, $mail_content); $mail_content = str_replace("[[member_name]]", $employee_name, $mail_content);
$mail = $value['email_corporate']; $mail = $values['email_corporate'];
} }
} }
}else{
$mail ='';
}
}else{ }else{
$employee_name =$value['name']; $employee_name =$value['name'];
$mail_content = str_replace("[[member_name]]", $employee_name, $mail_content); $mail_content = str_replace("[[member_name]]", $employee_name, $mail_content);
$mail = $value['email_corporate']; $mail = $value['email_corporate'];
} }
if (isset($mail) && !empty($mail)) {
$wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']]; $wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']];
} }
}
if (count($wholeData) < 1) {
$wholeData = [];
}
return $wholeData; return $wholeData;
}else{ }else{
return "false"; return "false";
@ -194,8 +205,9 @@ class sendMailNotification
$mail_content = str_replace("[[member_summary]]", $table_content , $mail_content); $mail_content = str_replace("[[member_summary]]", $table_content , $mail_content);
// $mail = "aadhavanvalli@gmail.com"; // $mail = "aadhavanvalli@gmail.com";
// if (isset($mail) && !empty($mail)) {
$wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']]; $wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails']];
// }
return $wholeData; return $wholeData;

View File

@ -185,6 +185,36 @@ if (!function_exists('get_base64_image')) {
} }
if (!function_exists('format_indian_number')) {
function format_indian_number($number) {
// Round the number to two decimal places
$number = round($number, 2);
// Split the number into integer and decimal parts
$numberParts = explode('.', number_format($number, 2, '.', ''));
$integerPart = $numberParts[0];
$decimalPart = isset($numberParts[1]) ? $numberParts[1] : '00';
// Format the integer part with commas
$length = strlen($integerPart);
$formattedStr = '';
$counter = 0;
for ($i = $length - 1; $i >= 0; $i--) {
$formattedStr = $integerPart[$i] . $formattedStr;
$counter++;
if ($counter == 3 && $i != 0) {
$formattedStr = ',' . $formattedStr;
$counter = 0;
} elseif ($counter == 2 && $i != 0 && $length - $i > 3) {
$formattedStr = ',' . $formattedStr;
$counter = 0;
}
}
// Combine the integer and decimal parts
return $formattedStr . '.' . $decimalPart;
}
}

View File

@ -41,8 +41,9 @@ class ClientModel extends Model
foreach ($clients as &$client) { foreach ($clients as &$client) {
$clientPolicyModel = new ClientPolicyModel(); $clientPolicyModel = new ClientPolicyModel();
$clientPolicies = $clientPolicyModel->select(['client_policy.id','p.name']) $clientPolicies = $clientPolicyModel->select(['client_policy.id','p.name','pt.policy_type'])
->join('policies p', 'p.id = client_policy.policy_id') ->join('policies p', 'p.id = client_policy.policy_id')
->join('policy_type pt','client_policy.policy_type_id = pt.id')
->where('client_policy.client_id',$client['id']) ->where('client_policy.client_id',$client['id'])
->where('client_policy.is_active', 1) ->where('client_policy.is_active', 1)
->where('client_policy.policy_status', 1) ->where('client_policy.policy_status', 1)

View File

@ -40,7 +40,8 @@ class ClientPolicyModel extends Model
"updated_by", "updated_by",
"Is_active", "Is_active",
"date_of_exit", "date_of_exit",
"reason_for_exit" "reason_for_exit",
"policy_no"
]; ];
public function getClientPolicyById($id){ public function getClientPolicyById($id){

View File

@ -0,0 +1,77 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class MessageModel extends Model
{
protected $table = 'messages';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = [
'id',
'message_text',
'user_id',
'role_id',
'team_id',
'message_type',
'created_at',
'action_url',
'msg_status',
];
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
// Validation
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = [];
protected $afterInsert = [];
protected $beforeUpdate = [];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function getMessagesForUser($userId, $roleId, $teamId)
{
$builder = $this->db->table($this->table);
$builder->select('messages.*');
$builder->join('user_messages', 'user_messages.message_id = messages.id AND user_messages.user_id = ' . $this->db->escape($userId), 'left');
$builder->groupStart();
$builder->where('user_messages.is_read', null);
$builder->orWhere('user_messages.is_read', 0);
$builder->groupEnd();
$builder->groupStart();
$builder->orwhere('messages.message_type', 'broadcast');
$builder->orWhere('messages.user_id', $userId);
$builder->orWhere('messages.role_id', $roleId);
$builder->orWhere('messages.team_id', $teamId);
$builder->groupEnd();
$query = $builder->get();
return $query->getResult();
dd($this->db->getLastQuery());
}
}

View File

@ -15,6 +15,7 @@ class TPAModel extends Model
"front_card", "front_card",
"back_card", "back_card",
"tpa_logo", "tpa_logo",
"network_hospitals",
"created_by", "created_by",
"updated_by", "updated_by",
"is_active", "is_active",

View File

@ -0,0 +1,69 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class UserMessageModel extends Model
{
protected $table = 'user_messages';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = [
'id',
'message_id',
'user_id',
'is_read',
'read_at',
];
protected bool $allowEmptyInserts = false;
// Dates
protected $useTimestamps = false;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
// Validation
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = [];
protected $afterInsert = [];
protected $beforeUpdate = [];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function markAsRead($userId, $messageId)
{
$data = [
'is_read' => 1,
'read_at' => date('Y-m-d H:i:s')
];
$existingEntry = $this->where('user_id', $userId)
->where('message_id', $messageId)
->first();
if ($existingEntry) {
return $this->update($existingEntry['id'], $data);
} else {
$data['user_id'] = $userId;
$data['message_id'] = $messageId;
return $this->insert($data);
}
}
}

View File

@ -54,7 +54,7 @@
</div> </div>
<div class="form-group col-md-4" id="base_policy_id" style="display: none;"> <div class="form-group col-md-4" id="base_policy_id" style="display: none;">
<label for="addon_policy">Base Policy<span class="text-danger">*</span></label> <label for="addon_policy">Base Policy<span id="base_danger" class="text-danger">*</span></label>
<select class="form-control" id="base_policy" name="base_policy"> <select class="form-control" id="base_policy" name="base_policy">
<option value="" selected>Select Base Policy</option> <option value="" selected>Select Base Policy</option>
</select> </select>
@ -92,15 +92,19 @@
</div> </div>
<div class="form-row" id="second" style="display: none;"> <div class="form-row" id="second" style="display: none;">
<div class="form-group col-md-4"> <div class="form-group col-md-3">
<label for="policy_no">Policy No<span class="text-danger">*</span></label>
<input value="" type="text" class="form-control" placeholder="Enter Policy Number " name="policy_no" id="policy_no" required>
</div>
<div class="form-group col-md-3">
<label for="policy_start_date">Policy Start Date<span class="text-danger">*</span></label> <label for="policy_start_date">Policy Start Date<span class="text-danger">*</span></label>
<input value="" type="text" class="form-control" placeholder="Enter Start Date " name="policy_start_date" id="start_date" required> <input value="" type="text" class="form-control" placeholder="Enter Start Date " name="policy_start_date" id="start_date" required>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-3">
<label for="policy_end_date">Policy End Date<span class="text-danger">*</span></label> <label for="policy_end_date">Policy End Date<span class="text-danger">*</span></label>
<input value="" type="text" class="form-control" placeholder="Enter End Date " name="policy_end_date" id="end_date" required> <input value="" type="text" class="form-control" placeholder="Enter End Date " name="policy_end_date" id="end_date" required>
</div> </div>
<div class="form-group col-md-4" id="policy_status_field"> <div class="form-group col-md-3" id="policy_status_field">
<label for="policy_status">Policy Status</label> <label for="policy_status">Policy Status</label>
<input value="" type="text" class="form-control" placeholder="Policy Status" id="policy_status" readonly> <input value="" type="text" class="form-control" placeholder="Policy Status" id="policy_status" readonly>
</div> </div>
@ -196,6 +200,7 @@
$('.btnAdd').hide(); $('.btnAdd').hide();
$('#insurer').val('').change(); $('#insurer').val('').change();
$('#tpa').val('').change(); $('#tpa').val('').change();
$('#policy_no').val('').change();
$('#start_date').val('').change(); $('#start_date').val('').change();
$('#end_date').val('').change(); $('#end_date').val('').change();
$('#policy').html('<option value="" selected>Select Policy</option>').change(); $('#policy').html('<option value="" selected>Select Policy</option>').change();
@ -222,6 +227,7 @@
$('.btnAdd').show(); $('.btnAdd').show();
$('#insurer').val('').change(); $('#insurer').val('').change();
$('#tpa').val('').change(); $('#tpa').val('').change();
$('#policy_no').val('').change();
$('#start_date').val('').change(); $('#start_date').val('').change();
$('#end_date').val('').change(); $('#end_date').val('').change();
$('#policy').html('<option value="" selected>Select Policy</option>'); $('#policy').html('<option value="" selected>Select Policy</option>');
@ -461,6 +467,7 @@
$('#insurer').val(''); $('#insurer').val('');
$('#tpa').val(''); $('#tpa').val('');
$('#policy_no').val('');
$('#start_date').val(''); $('#start_date').val('');
$('#end_date').val(''); $('#end_date').val('');
$('#policy').html('<option value="" selected>Select Policy</option>'); $('#policy').html('<option value="" selected>Select Policy</option>');
@ -605,7 +612,8 @@
var displayStatus = $('#base_policy_id').css('display'); var displayStatus = $('#base_policy_id').css('display');
$('#base_policy_id').show(); $('#base_policy_id').show();
$('#base_policy').prop('required', true); $('#base_danger').hide();
// $('#base_policy').prop('required', true);
if (displayStatus === 'none') { if (displayStatus === 'none') {
console.log('step 2.1') console.log('step 2.1')
@ -621,7 +629,8 @@
var displayStatus = $('#base_policy_id').css('display'); var displayStatus = $('#base_policy_id').css('display');
$('#base_policy_id').hide(); $('#base_policy_id').hide();
$('#base_policy').prop('required', false); $('#base_danger').show();
// $('#base_policy').prop('required', false);
if (displayStatus === 'none') { if (displayStatus === 'none') {
console.log('step 3.1') console.log('step 3.1')
@ -648,7 +657,7 @@
dataType: 'json', dataType: 'json',
success: function(res) { success: function(res) {
console.log(res) console.log('client_policy_res', res)
setTimeout(function() { setTimeout(function() {
$('.loader').fadeOut(); $('.loader').fadeOut();
@ -681,6 +690,7 @@
$('#policy_type_id').val(res.data.policy_type_id); $('#policy_type_id').val(res.data.policy_type_id);
$('#policy_PrimaryKey').val(res.data.id); $('#policy_PrimaryKey').val(res.data.id);
$('#policy_no').val(res.data.policy_no);
$('#start_date').val(rearrangeDateFormat(res.data.policy_start_date)); $('#start_date').val(rearrangeDateFormat(res.data.policy_start_date));
$('#end_date').val(rearrangeDateFormat(res.data.policy_end_date)); $('#end_date').val(rearrangeDateFormat(res.data.policy_end_date));
$('#policy_status').val(checkDateStatus(res.data.policy_end_date)); $('#policy_status').val(checkDateStatus(res.data.policy_end_date));
@ -1254,10 +1264,12 @@
$('#insurer').val('').change(); $('#insurer').val('').change();
$('#tpa').val('').change(); $('#tpa').val('').change();
$('#policy_no').val('');
$('#start_date').val(''); $('#start_date').val('');
$('#end_date').val(''); $('#end_date').val('');
$('#base_policy').val('').change(); $('#base_policy').val('').change();
if ($(this).val() == 2 || $(this).val() == 3) { if ($(this).val() == 2 || $(this).val() == 3) {
$("#insurer").next(".select2-container").css({ $("#insurer").next(".select2-container").css({
@ -1273,6 +1285,12 @@
$('#select2-tpa-container').css({ $('#select2-tpa-container').css({
'background-color': '#ebebe0', 'background-color': '#ebebe0',
}); });
var baseDanger = $('#base_danger');
if (baseDanger.css('display') === 'none') {
baseDanger.show();
}
} else { } else {
$("#insurer").next(".select2-container").css({ $("#insurer").next(".select2-container").css({
@ -1426,6 +1444,7 @@
$('#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(); $('#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(); $('#end_date').val(rearrangeDateFormat(res.data.policy_end_date)).change();

View File

@ -476,11 +476,10 @@ function appendPolicies(data) {
value: '', value: '',
text: 'Select' text: 'Select'
})); }));
$.each(data, function(index, item) { $.each(data, function(index, item) {
$('#policy_id').append($('<option>', { $('#policy_id').append($('<option>', {
value: item.id, value: item.id,
text: item.name text: item.name + ' ('+ item.policy_type+')'
})); }));
}); });
} }

View File

@ -59,10 +59,15 @@
}else if( $file['status'] == 'inprogress'){ }else if( $file['status'] == 'inprogress'){
echo '<a data-toggle="tooltip" data-placement="top" data-id="' . $file['status'] . '" class="reload" title="Click to reload" href="#">' . $file['status'] . '</a>'; $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{ }else{
echo $file['status'];
$tool_tip_text = "Live(s) : {$file['employee_count']}" . " | Total premium : ₹ " . format_indian_number($file['total'],2,',') ;
// $tool_tip_text = "dssd";
// Total Amount : $file['total']";
echo '<span data-toggle="tooltip" data-placement="top" data-id="' . $file['status'] . '" title=" '. $tool_tip_text.' ">' . $file['status'] . '</span>';
} }
?> ?>
</td> </td>

View File

@ -1,13 +1,12 @@
<style> <style>
.table th,
.table th, .table td { .table td {
padding: 8px; padding: 8px;
} }
table.dataTable tbody td { table.dataTable tbody td {
padding: 4px 4px !important; padding: 4px 4px !important;
} }
</style> </style>
<div class="row" id="client_add" style="position: relative; bottom: 25px;"> <div class="row" id="client_add" style="position: relative; bottom: 25px;">
@ -15,8 +14,7 @@
<div class="card-body"> <div class="card-body">
<ul class="nav nav-pills navtab-bg"> <ul class="nav nav-pills navtab-bg">
<li class="nav-item"> <li class="nav-item">
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false" <a href="#general-q-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2 active" id="general_tab">
class="nav-link px-3 py-2 active" id="general_tab">
<span class="mr-1"><i class="mdi mdi-contacts"></i></span> <span class="mr-1"><i class="mdi mdi-contacts"></i></span>
<span class="d-none d-sm-inline-block">Data From Client</span> <span class="d-none d-sm-inline-block">Data From Client</span>
</a> </a>
@ -39,4 +37,13 @@
<script>
$(document).ready(function() {
if (window.location.hash === '#KYC-DOC-tab') {
console.log('url hash :', window.location.hash)
$('#kyc_tab').click();
}
})
</script>

View File

@ -7,7 +7,9 @@
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<script>document.write(new Date().getFullYear())</script> &copy; NHANCE <script>
document.write(new Date().getFullYear())
</script> &copy; NHANCE
</div> </div>
<!-- <div class="col-md-6"> <!-- <div class="col-md-6">
<div class="text-md-right footer-links d-none d-sm-block"> <div class="text-md-right footer-links d-none d-sm-block">
@ -35,393 +37,19 @@
<div class="right-bar"> <div class="right-bar">
<div data-simplebar class="h-100"> <div data-simplebar class="h-100">
<!-- Nav tabs -->
<ul class="nav nav-tabs nav-bordered nav-justified" role="tablist">
<li class="nav-item">
<a class="nav-link py-2" data-toggle="tab" href="#chat-tab" role="tab">
<i class="mdi mdi-message-text-outline d-block font-22 my-1"></i>
</a>
</li>
<li class="nav-item">
<a class="nav-link py-2" data-toggle="tab" href="#tasks-tab" role="tab">
<i class="mdi mdi-format-list-checkbox d-block font-22 my-1"></i>
</a>
</li>
<li class="nav-item">
<a class="nav-link py-2 active" data-toggle="tab" href="#settings-tab" role="tab">
<i class="mdi mdi-cog-outline d-block font-22 my-1"></i>
</a>
</li>
</ul>
<!-- Tab panes --> <!-- Tab panes -->
<div class="tab-content pt-0">
<div class="tab-pane" id="chat-tab" role="tabpanel">
<form class="search-bar p-3">
<div class="position-relative">
<input type="text" class="form-control" placeholder="Search...">
<span class="mdi mdi-magnify"></span>
</div>
</form>
<h6 class="font-weight-medium px-3 mt-2 text-uppercase">Group Chats</h6>
<div class="p-2">
<a href="javascript: void(0);" class="text-reset notification-item pl-3 mb-2 d-block">
<i class="mdi mdi-checkbox-blank-circle-outline mr-1 text-success"></i>
<span class="mb-0 mt-1">App Development</span>
</a>
<a href="javascript: void(0);" class="text-reset notification-item pl-3 mb-2 d-block">
<i class="mdi mdi-checkbox-blank-circle-outline mr-1 text-warning"></i>
<span class="mb-0 mt-1">Office Work</span>
</a>
<a href="javascript: void(0);" class="text-reset notification-item pl-3 mb-2 d-block">
<i class="mdi mdi-checkbox-blank-circle-outline mr-1 text-danger"></i>
<span class="mb-0 mt-1">Personal Group</span>
</a>
<a href="javascript: void(0);" class="text-reset notification-item pl-3 d-block">
<i class="mdi mdi-checkbox-blank-circle-outline mr-1"></i>
<span class="mb-0 mt-1">Freelance</span>
</a>
</div>
<h6 class="font-weight-medium px-3 mt-3 text-uppercase">Favourites <a href="javascript: void(0);" class="font-18 text-danger"><i class="float-right mdi mdi-plus-circle"></i></a></h6>
<div class="p-2">
<a href="javascript: void(0);" class="text-reset notification-item">
<div class="media">
<div class="position-relative mr-2">
<span class="user-status"></span>
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-10.jpg" class="rounded-circle avatar-sm" alt="user-pic">
</div>
<div class="media-body overflow-hidden">
<h6 class="mt-0 mb-1 font-14">Andrew Mackie</h6>
<div class="font-13 text-muted">
<p class="mb-0 text-truncate">It will seem like simplified English.</p>
</div>
</div>
</div>
</a>
<a href="javascript: void(0);" class="text-reset notification-item">
<div class="media">
<div class="position-relative mr-2">
<span class="user-status"></span>
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-1.jpg" class="rounded-circle avatar-sm" alt="user-pic">
</div>
<div class="media-body overflow-hidden">
<h6 class="mt-0 mb-1 font-14">Rory Dalyell</h6>
<div class="font-13 text-muted">
<p class="mb-0 text-truncate">To an English person, it will seem like simplified</p>
</div>
</div>
</div>
</a>
<a href="javascript: void(0);" class="text-reset notification-item">
<div class="media">
<div class="position-relative mr-2">
<span class="user-status busy"></span>
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-9.jpg" class="rounded-circle avatar-sm" alt="user-pic">
</div>
<div class="media-body overflow-hidden">
<h6 class="mt-0 mb-1 font-14">Jaxon Dunhill</h6>
<div class="font-13 text-muted">
<p class="mb-0 text-truncate">To achieve this, it would be necessary.</p>
</div>
</div>
</div>
</a>
</div>
<h6 class="font-weight-medium px-3 mt-3 text-uppercase">Other Chats <a href="javascript: void(0);" class="font-18 text-danger"><i class="float-right mdi mdi-plus-circle"></i></a></h6>
<div class="p-2 pb-4">
<a href="javascript: void(0);" class="text-reset notification-item">
<div class="media">
<div class="position-relative mr-2">
<span class="user-status online"></span>
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-2.jpg" class="rounded-circle avatar-sm" alt="user-pic">
</div>
<div class="media-body overflow-hidden">
<h6 class="mt-0 mb-1 font-14">Jackson Therry</h6>
<div class="font-13 text-muted">
<p class="mb-0 text-truncate">Everyone realizes why a new common language.</p>
</div>
</div>
</div>
</a>
<a href="javascript: void(0);" class="text-reset notification-item">
<div class="media">
<div class="position-relative mr-2">
<span class="user-status away"></span>
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-4.jpg" class="rounded-circle avatar-sm" alt="user-pic">
</div>
<div class="media-body overflow-hidden">
<h6 class="mt-0 mb-1 font-14">Charles Deakin</h6>
<div class="font-13 text-muted">
<p class="mb-0 text-truncate">The languages only differ in their grammar.</p>
</div>
</div>
</div>
</a>
<a href="javascript: void(0);" class="text-reset notification-item">
<div class="media">
<div class="position-relative mr-2">
<span class="user-status online"></span>
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-5.jpg" class="rounded-circle avatar-sm" alt="user-pic">
</div>
<div class="media-body overflow-hidden">
<h6 class="mt-0 mb-1 font-14">Ryan Salting</h6>
<div class="font-13 text-muted">
<p class="mb-0 text-truncate">If several languages coalesce the grammar of the resulting.</p>
</div>
</div>
</div>
</a>
<a href="javascript: void(0);" class="text-reset notification-item">
<div class="media">
<div class="position-relative mr-2">
<span class="user-status online"></span>
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-6.jpg" class="rounded-circle avatar-sm" alt="user-pic">
</div>
<div class="media-body overflow-hidden">
<h6 class="mt-0 mb-1 font-14">Sean Howse</h6>
<div class="font-13 text-muted">
<p class="mb-0 text-truncate">It will seem like simplified English.</p>
</div>
</div>
</div>
</a>
<a href="javascript: void(0);" class="text-reset notification-item">
<div class="media">
<div class="position-relative mr-2">
<span class="user-status busy"></span>
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-7.jpg" class="rounded-circle avatar-sm" alt="user-pic">
</div>
<div class="media-body overflow-hidden">
<h6 class="mt-0 mb-1 font-14">Dean Coward</h6>
<div class="font-13 text-muted">
<p class="mb-0 text-truncate">The new common language will be more simple.</p>
</div>
</div>
</div>
</a>
<a href="javascript: void(0);" class="text-reset notification-item">
<div class="media">
<div class="position-relative mr-2">
<span class="user-status away"></span>
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-8.jpg" class="rounded-circle avatar-sm" alt="user-pic">
</div>
<div class="media-body overflow-hidden">
<h6 class="mt-0 mb-1 font-14">Hayley East</h6>
<div class="font-13 text-muted">
<p class="mb-0 text-truncate">One could refuse to pay expensive translators.</p>
</div>
</div>
</div>
</a>
<div class="text-center mt-3">
<a href="javascript:void(0);" class="btn btn-sm btn-white">
<i class="mdi mdi-spin mdi-loading mr-2"></i>
Load more
</a>
</div>
</div>
</div>
<div class="tab-pane" id="tasks-tab" role="tabpanel">
<h6 class="font-weight-medium p-3 m-0 text-uppercase">Working Tasks</h6>
<div class="px-2">
<a href="javascript: void(0);" class="text-reset item-hovered d-block p-2">
<p class="text-muted mb-0">App Development<span class="float-right">75%</span></p>
<div class="progress mt-2" style="height: 4px;">
<div class="progress-bar bg-success" role="progressbar" style="width: 75%" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</a>
<a href="javascript: void(0);" class="text-reset item-hovered d-block p-2">
<p class="text-muted mb-0">Database Repair<span class="float-right">37%</span></p>
<div class="progress mt-2" style="height: 4px;">
<div class="progress-bar bg-info" role="progressbar" style="width: 37%" aria-valuenow="37" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</a>
<a href="javascript: void(0);" class="text-reset item-hovered d-block p-2">
<p class="text-muted mb-0">Backup Create<span class="float-right">52%</span></p>
<div class="progress mt-2" style="height: 4px;">
<div class="progress-bar bg-warning" role="progressbar" style="width: 52%" aria-valuenow="52" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</a>
</div>
<h6 class="font-weight-medium px-3 mb-0 mt-4 text-uppercase">Upcoming Tasks</h6>
<div class="p-2">
<a href="javascript: void(0);" class="text-reset item-hovered d-block p-2">
<p class="text-muted mb-0">Sales Reporting<span class="float-right">12%</span></p>
<div class="progress mt-2" style="height: 4px;">
<div class="progress-bar bg-danger" role="progressbar" style="width: 12%" aria-valuenow="12" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</a>
<a href="javascript: void(0);" class="text-reset item-hovered d-block p-2">
<p class="text-muted mb-0">Redesign Website<span class="float-right">67%</span></p>
<div class="progress mt-2" style="height: 4px;">
<div class="progress-bar bg-primary" role="progressbar" style="width: 67%" aria-valuenow="67" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</a>
<a href="javascript: void(0);" class="text-reset item-hovered d-block p-2">
<p class="text-muted mb-0">New Admin Design<span class="float-right">84%</span></p>
<div class="progress mt-2" style="height: 4px;">
<div class="progress-bar bg-success" role="progressbar" style="width: 84%" aria-valuenow="84" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</a>
</div>
<div class="p-3 mt-2">
<a href="javascript: void(0);" class="btn btn-success btn-block waves-effect waves-light">Create Task</a>
</div>
</div>
<div class="tab-pane active" id="settings-tab" role="tabpanel">
<h6 class="font-weight-medium px-3 m-0 py-2 font-13 text-uppercase bg-light"> <h6 class="font-weight-medium px-3 m-0 py-2 font-13 text-uppercase bg-light">
<span class="d-block py-1">Theme Settings</span> <i class="mdi mdi-message-text-outline font-22"></i><span class="" style="position: relative;bottom: 5px;left: 60px;">Notification</span>
</h6> </h6>
<div class="p-3"> <div id="header-bar">
<div class="alert alert-warning" role="alert"> <div>
<strong>Customize </strong> the overall color scheme, sidebar menu, etc. <ul class="list-unstyled" id="messages-list"></ul>
</div>
<h6 class="font-weight-medium font-14 mt-4 mb-2 pb-1">Color Scheme</h6>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="color-scheme-mode" value="light"
id="light-mode-check" checked />
<label class="custom-control-label" for="light-mode-check">Light Mode</label>
</div>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="color-scheme-mode" value="dark"
id="dark-mode-check" />
<label class="custom-control-label" for="dark-mode-check">Dark Mode</label>
</div>
<!-- Width -->
<h6 class="font-weight-medium font-14 mt-4 mb-2 pb-1">Width</h6>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="width" value="fluid" id="fluid-check" checked />
<label class="custom-control-label" for="fluid-check">Fluid</label>
</div>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="width" value="boxed" id="boxed-check" />
<label class="custom-control-label" for="boxed-check">Boxed</label>
</div>
<!-- Topbar -->
<h6 class="font-weight-medium font-14 mt-4 mb-2 pb-1">Topbar</h6>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="topbar-color" value="dark" id="darktopbar-check"
checked />
<label class="custom-control-label" for="darktopbar-check">Dark</label>
</div>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="topbar-color" value="light" id="lighttopbar-check" />
<label class="custom-control-label" for="lighttopbar-check">Light</label>
</div>
<!-- Menu positions -->
<h6 class="font-weight-medium font-14 mt-4 mb-2 pb-1">Menus Positon <small>(Leftsidebar and Topbar)</small></h6>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="menus-position" value="fixed" id="fixed-check"
checked />
<label class="custom-control-label" for="fixed-check">Fixed</label>
</div>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="menus-position" value="scrollable"
id="scrollable-check" />
<label class="custom-control-label" for="scrollable-check">Scrollable</label>
</div>
<!-- Left Sidebar-->
<h6 class="font-weight-medium font-14 mt-4 mb-2 pb-1">Left Sidebar Color</h6>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="leftsidebar-color" value="light" id="light-check" checked />
<label class="custom-control-label" for="light-check">Light</label>
</div>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="leftsidebar-color" value="dark" id="dark-check" />
<label class="custom-control-label" for="dark-check">Dark</label>
</div>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="leftsidebar-color" value="brand" id="brand-check" />
<label class="custom-control-label" for="brand-check">Brand</label>
</div>
<div class="custom-control custom-switch mb-3">
<input type="radio" class="custom-control-input" name="leftsidebar-color" value="gradient" id="gradient-check" />
<label class="custom-control-label" for="gradient-check">Gradient</label>
</div>
<!-- size -->
<h6 class="font-weight-medium font-14 mt-4 mb-2 pb-1">Left Sidebar Size</h6>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="leftsidebar-size" value="default"
id="default-size-check" checked />
<label class="custom-control-label" for="default-size-check">Default</label>
</div>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="leftsidebar-size" value="condensed"
id="condensed-check" />
<label class="custom-control-label" for="condensed-check">Condensed <small>(Extra Small size)</small></label>
</div>
<div class="custom-control custom-switch mb-1">
<input type="radio" class="custom-control-input" name="leftsidebar-size" value="compact"
id="compact-check" />
<label class="custom-control-label" for="compact-check">Compact <small>(Small size)</small></label>
</div>
<!-- User info -->
<h6 class="font-weight-medium font-14 mt-4 mb-2 pb-1">Sidebar User Info</h6>
<div class="custom-control custom-switch mb-1">
<input type="checkbox" class="custom-control-input" name="leftsidebar-user" value="fixed" id="sidebaruser-check" />
<label class="custom-control-label" for="sidebaruser-check">Enable</label>
</div>
<button class="btn btn-primary btn-block mt-4" id="resetBtn">Reset to Default</button>
<a href=""
class="btn btn-danger btn-block mt-2" target="_blank"><i class="mdi mdi-basket mr-1"></i> Purchase Now</a>
</div>
</div> </div>
</div> </div>
</div> <!-- end slimscroll-menu--> </div> <!-- end slimscroll-menu-->
</div> </div>
<!-- /Right-bar --> <!-- /Right-bar -->
@ -496,10 +124,6 @@
<!-- Jodit Js --> <!-- Jodit Js -->
<script src="<?= base_url() . "public"; ?>/assets/js/jodit.min.js"></script> <script src="<?= base_url() . "public"; ?>/assets/js/jodit.min.js"></script>
<script src="<?= base_url()."public"; ?>/assets/libs/quill/quill.min.js"></script>
<script src="<?= base_url()."public"; ?>/assets/js/pages/form-quilljs.init.js"></script>
<!-- select2 --> <!-- select2 -->
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
@ -510,9 +134,175 @@ toastr.options = {
"timeOut": 5000, "timeOut": 5000,
"closeButton": true, "closeButton": true,
}; };
</script>
<script>
$(document).ready(function() {
function fetchMessages() {
$.ajax({
url: '<?= base_url('get-notification') ?>',
method: 'GET',
success: function(response) {
// $(document).ready(function() {
// $("#playMusic").get(0).play();
// });
console.log('responce', response)
let unreadCount = 0;
let messagesList = $('#messages-list');
messagesList.empty();
var html = "";
response.forEach(message => {
if (!message.is_read) {
unreadCount++;
}
var jasonDecodeData = JSON.parse(message.message_text)
var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Success';
if(jasonDecodeData.msg_status == 'failure'){
toast_body_css = 'background : #fdcfcf !important;';
toast_head_css = 'background-color : rgb(235 105 105 / 85%) !important; color :#000; border-bottom: 0;';
toast_icon = 'mdi mdi-information mr-auto'
toast_status_word = 'Failure';
}else if(jasonDecodeData.msg_status == 'success'){
toast_body_css = 'background : #bfd7eb !important;';
toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto'
toast_status_word = 'Success';
}
var html = ` <li data-id="${message.id}" data-url="${jasonDecodeData.action_url != undefined && jasonDecodeData.action_url != "" ? jasonDecodeData.action_url : 'dashboard/view'}">
<div class="p-3">
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
<div class="toast-header " style="${toast_head_css}" >
<strong class="${toast_icon}"> ${toast_status_word}</strong>
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="toast-body" style="${toast_body_css}">
<strong>${jasonDecodeData.msg_title ? jasonDecodeData.msg_title : ''}</strong> <br><br>
<small style="position: relative;bottom: 8px;">${jasonDecodeData.message_text}</small>
<div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 25px;position: relative;top: 2px;">${jasonDecodeData.action_url != undefined && jasonDecodeData.action_url != "" ? 'see more' : ''}</small></a>
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;">${formatDate(message.created_at)}</small>
</div>
</div>
</div>
</div>
</li>`
messagesList.append(html);
$(function() {
$('[data-toggle="tooltip"]').tooltip();
});
});
$('#notification_count').html(unreadCount);
}
});
}
function acknowledgeMessage(messageId) {
$.ajax({
url: '<?= base_url('acknowledge-notification/') ?>' + messageId,
method: 'GET',
success: function(response) {
fetchMessages();
}
});
}
$('#messages-list').on('click', 'li', function(event) {
console.log('messages-list click li')
if ($(event.target).closest('.rm_msg').length > 0) {
console.log('.rm_msg')
let messageId = $(this).data('id');
let url = $(this).data('url');
acknowledgeMessage(messageId);
$(this).delay(300).fadeOut('slow', function() {
$(this).remove();
});
} else if ($(event.target).closest('.redirect_page').length > 0){
console.log('redirect_page')
let messageId = $(this).data('id');
let url = $(this).data('url');
console.log('url : ', url)
acknowledgeMessage(messageId);
window.location.href = '<?= base_url() ?>' + url;
}
});
fetchMessages();
setInterval(fetchMessages, 10000); // Fetch messages every minute
});
</script> </script>
<script>
function formatDate(dateString) {
// Parse the input date string
let date = new Date(dateString);
// Define months array
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
// Extract day, month, year, hours, and minutes
let day = date.getDate();
let month = months[date.getMonth()];
let year = date.getFullYear();
let hours = date.getHours();
let minutes = date.getMinutes();
// Convert hours to 12-hour format
let period = hours >= 12 ? 'pm' : 'am';
hours = hours % 12;
hours = hours ? hours : 12; // Handle midnight (0 hours)
// Format the time string
let timeString = ('0' + hours).slice(-2) + ':' + ('0' + minutes).slice(-2) + ' ' + period;
// Format the date string
let formattedDate = day + '-' + month + '-' + year + ' ' + timeString;
return formattedDate;
}
</script>
</body> </body>
</html> </html>

View File

@ -44,10 +44,6 @@
<link href="<?= base_url()."public"; ?>/assets/css/jodit.css" rel="stylesheet" type="text/css" /> <link href="<?= base_url()."public"; ?>/assets/css/jodit.css" rel="stylesheet" type="text/css" />
<link href="<?= base_url()."public"; ?>/assets/libs/quill/quill.snow.css" rel="stylesheet" type="text/css" />
<!-- JQuery CDN --> <!-- JQuery CDN -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
@ -234,6 +230,28 @@
.select2-container--default .select2-selection--single .select2-selection__arrow { .select2-container--default .select2-selection--single .select2-selection__arrow {
top: 7px !important; 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;
}
</style> </style>
<script> <script>
@ -247,7 +265,6 @@
</head> </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> <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>
@ -330,88 +347,15 @@
</form> </form>
</li> </li>
<!-- <li class="dropdown notification-list topbar-dropdown"> <li class="dropdown notification-list topbar-dropdown">
<a class="nav-link dropdown-toggle waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false"> <a class="nav-link dropdown-toggle right-bar-toggle waves-effect waves-light">
<i class="fe-bell noti-icon"></i> <i class="fe-bell noti-icon"></i>
<span class="badge badge-danger rounded-circle noti-icon-badge">1</span> <span class="badge badge-danger rounded-circle noti-icon-badge" id="notification_count">0</span>
</a> </a>
<div class="dropdown-menu dropdown-menu-right dropdown-lg"> <!-- <audio id="playMusic" playcount="2">
<source src="https://media.geeksforgeeks.org/wp-content/uploads/20190531135120/beep.mp3" type="audio/mpeg">
<div class="dropdown-item noti-title"> </audio> -->
<h5 class="m-0"> </li>
<span class="float-right">
<a href="" class="text-dark">
<small>Clear All</small>
</a>
</span>Notification
</h5>
</div>
<div class="noti-scroll" data-simplebar>
<a href="javascript:void(0);" class="dropdown-item notify-item active">
<div class="notify-icon bg-soft-primary text-primary">
<i class="mdi mdi-comment-account-outline"></i>
</div>
<p class="notify-details">Doug Dukes commented on Admin Dashboard
<small class="text-muted">1 min ago</small>
</p>
</a>
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon">
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-2.jpg" class="img-fluid rounded-circle" alt="" /> </div>
<p class="notify-details">Mario Drummond</p>
<p class="text-muted mb-0 user-msg">
<small>Hi, How are you? What about our next meeting</small>
</p>
</a>
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon">
<img src="<?= base_url()."public"; ?>/assets/images/users/avatar-4.jpg" class="img-fluid rounded-circle" alt="" /> </div>
<p class="notify-details">Karen Robinson</p>
<p class="text-muted mb-0 user-msg">
<small>Wow ! this admin looks good and awesome design</small>
</p>
</a>
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon bg-soft-warning text-warning">
<i class="mdi mdi-account-plus"></i>
</div>
<p class="notify-details">New user registered.
<small class="text-muted">5 hours ago</small>
</p>
</a>
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon bg-info">
<i class="mdi mdi-comment-account-outline"></i>
</div>
<p class="notify-details">Caleb Flakelar commented on Admin
<small class="text-muted">4 days ago</small>
</p>
</a>
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon bg-secondary">
<i class="mdi mdi-heart"></i>
</div>composer create-project laravel/laravel:^11.0 example-app
<p class="notify-details">Carlos Crouch liked
<b>Admin</b>
<small class="text-muted">13 days ago</small>
</p>
</a>
</div>
<a href="javascript:void(0);" class="dropdown-item text-center text-primary notify-item notify-all">
View all
<i class="fe-arrow-right"></i>
</a>
</div>
</li> -->
<li class="dropdown notification-list topbar-dropdown"> <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"> <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">

View File

@ -142,8 +142,8 @@
<tr> <tr>
<td style="width: 11%;"><span style="margin-right: 20px;">Spouse:</span></td> <td style="width: 11%;"><span style="margin-right: 20px;">Spouse:</span></td>
<td style="width: 11%;"><input type="checkbox" style="margin-right: 70px;"name="family_floaters[]" value="spouse" id="spouse"></td> <td style="width: 11%;"><input type="checkbox" style="margin-right: 70px;"name="family_floaters[]" value="spouse" id="spouse"></td>
<td style="width: 28%;" ><div class="spouse-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo (isset($spouse_min_age) && $spouse_min_age > 0) ? $spouse_min_age : '18'; ?>" style="width: 25%;;" type="number" name="spouse_min_age" id="spouse_min_age" oninput="this.value = Math.max(this.value.replace(/\D/g, '').substring(0, 2),18)"></div></td> <td style="width: 28%;" ><div class="spouse-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo isset($spouse_min_age) ? $spouse_min_age : '60'; ?>" style="width: 25%;;" type="number" name="spouse_min_age" id="spouse_min_age"></div></td>
<td style="width: 28%;" ><div class="spouse-age"><span style="margin-right: 20px;">Max Age:</span><input class="underline-input max_age" value="<?php echo isset($spouse_max_age) ? $spouse_max_age : '60'; ?>" style="width: 25%;;" type="number" name="spouse_max_age" id="spouse_max_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td> <td style="width: 28%;" ><div class="spouse-age"><span style="margin-right: 20px;">Max Age:</span><input class="underline-input max_age" value="<?php echo isset($spouse_max_age) ? $spouse_max_age : '60'; ?>" style="width: 25%;;" type="number" name="spouse_max_age" id="spouse_max_age" ></div></td>
</tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr> </tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
<tr> <tr>
<td style="width: 11%;"><span for="children">Children:</span></td> <td style="width: 11%;"><span for="children">Children:</span></td>
@ -177,7 +177,7 @@
<option value="2PIL">Only two parents in law (FIL + MIL)</option> <option value="2PIL">Only two parents in law (FIL + MIL)</option>
<option value="2EPORPIL">Parents or PIL (Any two of Father, Mother, MIl, FIL)</option> <option value="2EPORPIL">Parents or PIL (Any two of Father, Mother, MIl, FIL)</option>
<option value="EPORPIL">Either Parents or PIL (Parents or Parents In Law)</option> <option value="EPORPIL">Either Parents or PIL (Parents or Parents In Law)</option>
<option valueCONFLICT="4EPORPIL">Parents + PIL (Father + Mother + MIL + FIL)</option> <option value="4EPORPIL">Parents + PIL (Father + Mother + MIL + FIL)</option>
</select> </select>
</div> </div>
<div style="margin-top:10px"> <div style="margin-top:10px">
@ -185,8 +185,8 @@
<tbody> <tbody>
<tr> <tr>
<td style="width: 22%;" ><div class="other-member-age"><span style="margin-right: 20px;">Elders Count:</span><input class="underline-input" id="member_count" style="width: 25%;;" type="number" name="member_count" disabled id="member_count"></div></td> <td style="width: 22%;" ><div class="other-member-age"><span style="margin-right: 20px;">Elders Count:</span><input class="underline-input" id="member_count" style="width: 25%;;" type="number" name="member_count" disabled id="member_count"></div></td>
<td style="width: 28%;" ><div class="other-member-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo isset($other_member_min_age) ? $other_member_min_age : '18'; ?>" style="width: 25%;;" type="number" class="underline-input min_age" name="other_member_min_age" id="other_member_min_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td> <td style="width: 28%;" ><div class="other-member-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input min_age" value="<?php echo isset($other_member_min_age) ? $other_member_min_age : '18'; ?>" style="width: 25%;;" type="number" class="underline-input min_age" name="other_member_min_age" id="other_member_min_age" ></div></td>
<td style="width: 28%;" ><div class="other-member-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input max_age" value="<?php echo isset($other_member_max_age) ? $other_member_max_age : '60'; ?>" style="width: 25%;;" type="number" class="underline-input max_age" name="other_member_max_age" id="other_member_max_age" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div></td> <td style="width: 28%;" ><div class="other-member-age"><span style="margin-right: 20px;">Min Age:</span><input class="underline-input max_age" value="<?php echo isset($other_member_max_age) ? $other_member_max_age : '60'; ?>" style="width: 25%;;" type="number" class="underline-input max_age" name="other_member_max_age" id="other_member_max_age" ></div></td>
</tr> </tr>
</tbody> </tbody>

View File

@ -13,29 +13,33 @@
<input type="text" class="form-control" id="tpa_name" placeholder="Enter TPA Name" value="<?= isset($tpa['name']) ? $tpa['name'] : '' ?>" name="name" required> <input type="text" class="form-control" id="tpa_name" placeholder="Enter TPA Name" value="<?= isset($tpa['name']) ? $tpa['name'] : '' ?>" name="name" required>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="short_name">TPA Short Name<span class="text-danger">*</span></label> <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> <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>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="short_name">TPA Logo<span class="text-danger"></span></label> <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"> <input type="file" class="form-control" onchange="PreviewImage();" id="tpa_logo" name="tpa_logo" accept="image/jpeg, image/jpg, image/png">
</div> </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>
</div>
</div> </div>
<hr> <hr>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-10"> <div class="form-group col-md-10">
<label for="tpa_name">E-Card Template<span class="text-danger"></span></label> <label for="tpa_ecard_template">E-Card Template<span class="text-danger"></span></label>
<textarea style="height: 100px;" class="form-control" id="ecard_content" placeholder="Enter E-card Content" name="ecard_content"><?= isset($template_data) ? $template_data : '' ?></textarea> <textarea style="height: 100px;" class="form-control" id="ecard_content" placeholder="Enter E-card Content" name="ecard_content"><?= isset($template_data) ? $template_data : '' ?></textarea>
</div> </div>
<div class="form-group col-md-2 float-right" style="position: relative;top: 0px;left: 40px;"> <div class="form-group col-md-2 float-right" style="position: relative;top: 0px;left: 40px;">
<label for="short_name">Logo Preview<span class="text-danger"></span></label> <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" /> <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> </div>
<div class="form-row"> <div class="form-row" id="view_pre_btn" style="display :none">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<a href="<?= isset($tpa['id']) ? base_url('/util/preview-card/') . $tpa['id'] : '' ?>" class="btn btn-primary" id="preview" target="_blank">Preview</a> <a href="<?= isset($tpa['id']) ? base_url('/util/preview-card/') . $tpa['id'] : '' ?>" class="btn btn-primary" id="preview" target="_blank">Preview</a>
</div> </div>
@ -43,22 +47,22 @@
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="short_name">Front card Image<span class="text-danger"></span></label> <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"> <input type="file" class="form-control" onchange="PreviewImage2();" id="fc" name="fc" accept="image/jpeg, image/jpg, image/png">
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="short_name">Back card Image<span class="text-danger"></span></label> <label for="tpa_back_card_image">Back card Image<span class="text-danger"></span></label>
<input type="file" class="form-control" onchange="PreviewImage3();" id="bc" name="bc" accept="image/jpeg, image/jpg, image/png"> <input type="file" class="form-control" onchange="PreviewImage3();" id="bc" name="bc" accept="image/jpeg, image/jpg, image/png">
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="short_name">Front card Preview<span class="text-danger"></span></label> <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" /> <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" />
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="short_name">Back card Preview<span class="text-danger"></span></label> <label for="tpa_back_card_preview">Back card Preview<span class="text-danger"></span></label>
<img src="<?= isset($tpa['back_card']) && !empty($tpa['back_card']) ? base_url() . "public/uploads/template_bg/" . $tpa['back_card'] : base_url() . "public/assets/images/avatar_2x.png" ?>" width="100" height="100" id="uploadPreview3" class="avatar img-circle img-thumbnail" alt="avatar" /> <img src="<?= isset($tpa['back_card']) && !empty($tpa['back_card']) ? base_url() . "public/uploads/template_bg/" . $tpa['back_card'] : base_url() . "public/assets/images/avatar_2x.png" ?>" width="100" height="100" id="uploadPreview3" class="avatar img-circle img-thumbnail" alt="avatar" />
</div> </div>
</div> </div>
@ -99,6 +103,11 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
if($('#tpa_General_PrimaryKey').val() != ""){
$('#view_pre_btn').show()
}
$("#tpa_general_form").submit(function(events) { $("#tpa_general_form").submit(function(events) {
events.preventDefault(); events.preventDefault();
@ -106,6 +115,7 @@
var PrimaryKey = $('#tpa_General_PrimaryKey').val(); var PrimaryKey = $('#tpa_General_PrimaryKey').val();
var form_action = ''; var form_action = '';
if (isValid) { if (isValid) {
if (PrimaryKey === '') { if (PrimaryKey === '') {
@ -126,6 +136,12 @@
processData: false, processData: false,
contentType: false, contentType: false,
success: function(res) { success: function(res) {
if($('#tpa_General_PrimaryKey').val() == ""){
window.location.href = '<?= base_url("master/tpa/list/"); ?>' + res.data.id;
}
setTimeout(function() { setTimeout(function() {
$('.loader').fadeOut(); $('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow'); $('.loader-mask').delay(350).fadeOut('slow');

View File

@ -0,0 +1,118 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vidal Ecard</title>
<style>
</style>
</head>
<body>
<div style="display: flex;gap: 5px;width: 840px;justify-content: center;margin: 0 auto;">
<div class="card" style="border: 1px solid #50505059;width: 420px;min-height: 280px; padding:10px 10px 0px 10px;background-image: url(../image/vidal\ background\ image.jpg);background-position: center;background-size: cover;">
<div><img src="../image/New_India_Assurance.png" alt="" width="70px" height="70px" style="position: absolute;object-fit: fill;right: 16px;top: 17px;"></div>
<h6 style="margin-top: 20px;margin-bottom: 26px;font-weight: 700;font-size: 14px;">THE NEW INDIA COMPANY PRIVATE LIMITED</h6>
<table style="font-size: 14px;margin-top:9px ;margin-left: 20px;">
<tbody>
<tr>
<td>Card No</td>
<td>:</td>
<td>CHE-NI-K0674-001-0000003-A</td>
</tr>
<tr>
<td>Name</td>
<td>:</td>
<td>BHODANADHAN S</td>
</tr>
<tr>
<td>Gender</td>
<td>:</td>
<td>M</td>
</tr>
<tr>
<td>age</td>
<td>:</td>
<td>53 years</td>
</tr>
<tr>
<td>Employee code</td>
<td>:</td>
<td>1015</td>
</tr>
<tr>
<td>Corporate name</td>
<td>:</td>
<td>KELD ELLENTOFT INDIA PVT LTD</td>
</tr>
<tr>
<td>Valid form</td>
<td>:</td>
<td>28-04-2024</td>
</tr>
</tbody>
</table>
<div style="position: absolute;bottom: 11px;right: 11px;"><img src="../image/logo.png" alt="" width="170px" height="30px" style="object-fit: fill;"></div>
</div>
<div class="card" style="border: 1px solid #50505059;width:420px;min-height: 280px; padding: 0px 20px 5px 0px;">
<h6 style="text-align: center;font-weight: 700;margin: 0px;font-size: 14px;"><u>Terms&conditions</u></h6>
<ul style="font-size: 11px;text-align: justify;font-weight: bolder;font-weight: 600;line-height: 13px;margin-bottom: 5px;">
<li>Submit this card & photo ID for availing cashless insurrer empanelled hospitals</li>
<li>Cashless facility is subject to approved by vidal health as per policy terms and conditions</li>
<li>Validdity of this card is subject to valid policy renewal of policy</li>
<li>imidiate intimation to vidal health is must incase of any hospitalisation</li>
<li>Download the vidal health mobile app from android iOS to get an E-Card check your policy claim status, Hospital list and more, Give a missed call to 022-4892-6099 from your registered mobile number, or visit www.vidalhealthpa.com,or scan << Qr code on corner >></li>
</ul>
<div >
<img src="../image/logo.png" alt="" width="100px" height="25px" style="object-fit: fill; rotate: -90deg; position: absolute;left: -34px;bottom: 77px;">
</div>
<div style="font-size: 10px;font-weight: bold; line-height: 10px;margin-left: 40px;width: 70%;">
<div><u>24x7 help line no</u> </div>
<div>
<div>
<span>karnataka/andrapradesh/telangana</span><span style="padding: 0px 5px 0px 5px ;">:</span><span style="font-weight: 400;">080-46267018/1860425051</span>
</div>
<div>
<span>North and east region/gujarat</span><span style="padding: 0px 5px 0px 5px ;">:</span><span style="font-weight: 400;">080-46267021/18604250261</span>
</div>
<div>
<span>Maharastra</span><span style="padding: 0px 5px 0px 5px ;">:</span><span style="font-weight: 400;">080-46267020/18604250254</span>
</div>
<div>
<span>Tamil Nadu</span style="padding: 0px 5px 0px 5px ;">:<span></span><span style="font-weight: 400;">080-46267020/18604250254</span>
</div>
<div>
<span>Kerala</span><span style="padding: 0px 5px 0px 5px ;">:</span><span style="font-weight: 400;">080-46267019/18604250253</span>
</div>
<div>
<span>S.R citizen</span><span style="padding: 0px 5px 0px 5px ;">:</span><span style="font-weight: 400;">080-4626-7070</span>
</div>
<div>
<span style="font-weight: 400;">vidal health insurance <b>TPA</b> pvt limited,tower no 2,</span>
<br>
<span style="font-weight: 400;">First Floor,<b>SJR </b>ipark,<b>EPIP </b>zone ,whitefield,bangalore,</span>
<br>
</div>
<div>
<span style="font-weight: 400;"><b>email:</b>helpvidalhealthpa@gmail.com</span><span style="padding: 0px 5px 0px 5px ;">/</span><span style="font-weight: 400;"><b>website:</b>WWW.vidalhealthp.com</span>
</div>
</div>
</div>
<div><img src="../image/2-play store.png" alt="" width="80px" height="80px" style="position: absolute;top: 158px; right: 90px;"></div>
<div><img src="../image/2-appstore.png" alt="" width="76px" height="80px" style="position: absolute;right: 10px;top:158px;"></div>
</div>
</div>
</body>
</html>

View File

View File

View File