MERGE_UAT_MOBILE_CHATBOT_TICKET_CLAIM_LIVE_ISSUES
This commit is contained in:
commit
1c6f73a454
4
.gitignore
vendored
4
.gitignore
vendored
@ -22,8 +22,8 @@ writable/debugbar/*
|
||||
writable/**/*.db
|
||||
writable/**/*.sqlite
|
||||
|
||||
writable/e_card_template/*
|
||||
!writable/e_card_template/.gitkeep
|
||||
# writable/e_card_template/*
|
||||
# !writable/e_card_template/.gitkeep
|
||||
|
||||
writable/tmp/*
|
||||
!writable/tmp/.gitkeep
|
||||
|
||||
@ -59,6 +59,7 @@ $routes->get('/update-emp-policy-status', 'ClientController::updateEmpAndPolicyS
|
||||
$routes->get('download-e-card/(:any)', 'EmployeeController::generateIDCardForEmployee/$1');
|
||||
$routes->get('download-kyc-docs/(:segment)', 'ClientController::downloadKYCDocument/$1');
|
||||
$routes->get('claim-form-download/(:any)', 'TicketController::downloadClaimForm/$1');
|
||||
$routes->get('downloadClaimFile/(:any)', 'TicketController::downloadClaimFile/$1');
|
||||
$routes->match (['get','post'],"claims-feedback-form/(:any)/(:any)", "TicketController::viewClaimFeedbackForm/$1/$2");
|
||||
$routes->match (['get','post'],"claims-feedback-form/(:any)", "TicketController::viewClaimFeedbackForm/$1");
|
||||
|
||||
@ -73,6 +74,9 @@ $routes->group("/user", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->get("deactive/(:hash)", "UserController::deactive/$1");
|
||||
$routes->get("rolesandteams", "UserController::getRolesAndTeams");
|
||||
$routes->get("getUserActivityHistory", "UserController::getUserActivityHistory");
|
||||
$routes->match(['get','post','put'], 'partner', 'UserController::partner');
|
||||
$routes->match(['get','post','put'], 'partnerIncentive', 'UserController::partnerIncentive');
|
||||
$routes->get("download-incentive-file/(:any)", "UserController::downloadIncentivesFile/$1");
|
||||
});
|
||||
|
||||
$routes->group("/dashboard", ["filter" => "authMVC"], function ($routes) {
|
||||
@ -181,6 +185,8 @@ $routes->group("/employee", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->post("test-rack-rate", "EmployeeController::testRackRate");
|
||||
$routes->get('test_members_list', 'EmployeeController::test_members_list');
|
||||
$routes->post('get_emp_history','EmployeeController::getEmpHistory');
|
||||
$routes->get("retail-endorsement-list", "EmployeeController::retailendorsementlist");
|
||||
$routes->post("retail-endorsement-save", "EmployeeController::retailendorsementsave");
|
||||
});
|
||||
|
||||
|
||||
@ -364,7 +370,8 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->get('transformMailContent', 'LeadsController::transformMailContent');
|
||||
$routes->get('getCDAmount', 'ClientController::getCDAmount');
|
||||
$routes->get('getTheEmpDataForClaim/(:any)', 'ClientController::getTheEmpDataForClaim/$1');
|
||||
$routes->get('getTheEmpDataForClaimSearchByMobile/(:any)', 'ClientController::getTheEmpDataForClaimSearchByMobile/$1');
|
||||
// $routes->get('getTheEmpDataForClaimSearchByMobile/(:any)', 'ClientController::getTheEmpDataForClaimSearchByMobile/$1');
|
||||
$routes->get('getTheEmpDataForClaimSearchByMobile', 'ClientController::getTheEmpDataForClaimSearchByMobile');
|
||||
$routes->get('getLeadNonEB/(:any)', 'LeadsController::getLeadNonEB/$1');
|
||||
$routes->get('getPolicyTypeFields', 'LeadsController::getPolicyTypeFields');
|
||||
$routes->get('removeMultiFile', 'LeadsController::removeMultiFile');
|
||||
@ -498,11 +505,9 @@ $routes->get('get_ticket_data',"EmployeeRestController::get_ticket_data");
|
||||
|
||||
//api
|
||||
$routes->group("/api", ["filter" => "authJWT"], function ($routes) {
|
||||
$routes->get('get_ticket_type',"EmployeeRestController::get_ticket_type");
|
||||
$routes->post("logined", "RestAuthenticationController::logined");
|
||||
$routes->post("getId", "RestAuthenticationController::getUserIdFromToken");
|
||||
$routes->post('initiateClaim',"EmployeeRestController::initiateClaim");
|
||||
$routes->get('get_ticket_type',"EmployeeRestController::get_ticket_type");
|
||||
$routes->get('get_ticket_data',"EmployeeRestController::get_ticket_data");
|
||||
});
|
||||
|
||||
$routes->post("employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
|
||||
@ -575,6 +580,12 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
|
||||
$routes->post("hrFileUpload", "EmployeeRestController::hrFileUpload");
|
||||
$routes->post("updateHrFileUploadData", "EmployeeRestController::updateHrFileUploadData");
|
||||
|
||||
//claims
|
||||
$routes->post('initiateClaim',"EmployeeRestController::initiateClaim");
|
||||
$routes->get('get_ticket_type',"EmployeeRestController::get_ticket_type");
|
||||
$routes->get('get_ticket_data',"EmployeeRestController::get_ticket_data");
|
||||
|
||||
|
||||
});
|
||||
$routes->get("hrFileDownload", "EmployeeRestController::hrFileDownload");
|
||||
$routes->post("hrFileList", "EmployeeRestController::hrFileList");
|
||||
@ -624,6 +635,8 @@ $routes->group("/ticket", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->post('upload_url',"TicketController::upload_url");
|
||||
$routes->post('getUrlDataByTicketId',"TicketController::getUrlDataByTicketId");
|
||||
$routes->get('remove_url',"TicketController::remove_url");
|
||||
$routes->get('fetchVehiclePolicy/(:any)','TicketController::fetchVehiclePolicy/$1');
|
||||
|
||||
});
|
||||
|
||||
$routes->group("clientApi",["filter" => "AuthClientApi"], function ($routes){
|
||||
@ -674,4 +687,9 @@ $routes->get("ticketHistoryList", "ThzController::ticketHistoryList");
|
||||
$routes->group('test', function($routes) {
|
||||
$routes->post('api/saveForm', 'TestingController::saveForm');
|
||||
$routes->get('insurerRFQRemainder', 'LeadsController::remainderForQcr');
|
||||
$routes->get('generatePDF', 'TestingController::generatePDF');
|
||||
$routes->get('viewPDF', 'TestingController::viewPDF');
|
||||
$routes->get('generate-pdf-view', 'TestingController::generatePDFWithView');
|
||||
});
|
||||
$routes->cli('cli/testcli', 'TestingController::testcli');
|
||||
|
||||
|
||||
@ -52,25 +52,27 @@ class NetworkHospitalConversation extends Conversation
|
||||
// });
|
||||
|
||||
$this->bot->ask($question, function ($answer) {
|
||||
$path = $this->bot->userStorage()->get('path');
|
||||
$path = $this->bot->userStorage()->get('path');
|
||||
array_push($path,
|
||||
$answer->getValue()
|
||||
);
|
||||
$this->bot->userStorage()->save([
|
||||
'path' => $path
|
||||
]);
|
||||
log_message('error', ('user_reponse : ' . $answer->getValue()));
|
||||
|
||||
// log_message('error', ('user_reponse : ' . $answer->getValue()));
|
||||
// log_message('error', ('user_reponse : ' . json_encode(explode('#',$answer->getValue()))));
|
||||
switch ($answer->getValue()) {
|
||||
|
||||
case is_string($answer->getValue()) && is_array(explode('#',$answer->getValue())) && count((explode('#',$answer->getValue()))) == 2:
|
||||
|
||||
$client_poilicy_id = explode('#',$answer->getValue())[1];
|
||||
$hospital_link = ChatbotHelper::getHospitalLink($client_poilicy_id);
|
||||
$emp_poilicy_id = explode('#',$answer->getValue());
|
||||
$emp_poilicy_id = array_shift($emp_poilicy_id);
|
||||
log_message('error','EMP POL ID FOR HOSPITAL' . $emp_poilicy_id);
|
||||
$hospital_link = ChatbotHelper::getHospitalLink($emp_poilicy_id);
|
||||
|
||||
if($hospital_link)
|
||||
{
|
||||
$this->say('<a href="' . $hospital_link['network_hospitals'] . '" target="_blank">Click here for hospital details</a>');
|
||||
$this->say('<a href="' . $hospital_link . '" target="_blank">Click here for hospital details</a>');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -24,10 +24,19 @@ class ReimbursementClaimStatusConversation extends Conversation
|
||||
|
||||
$chat_session_info = get_chatbot_session_info();
|
||||
$data = ChatbotHelper::getReimbursementClaimStatus($chat_session_info);
|
||||
|
||||
log_message('error','Claim Number - ' . json_encode($data['claim_number']));
|
||||
$this->bot->types();
|
||||
if ($data){
|
||||
$this->say("The claim status for the claim Number {$data['claim_number']} is currently in <strong>{$data['client_status']}</strong> status. <br> More Detailed Information is sent to your mail");
|
||||
if(isset($data['claim_number']) && $data['claim_number'] !== null)
|
||||
{
|
||||
log_message('error','Claim Number YES- ' . json_encode($data['claim_number']));
|
||||
$this->say("The claim status for the claim Number {$data['claim_number']} is currently in <strong>{$data['client_status']}</strong> status. <br> More Detailed Information is sent to your mail");
|
||||
}
|
||||
else
|
||||
{
|
||||
log_message('error','Claim Number NO- ' . json_encode($data['claim_number']));
|
||||
$this->say("The claim status for your latest claim (ID not generated) is currently in <strong>{$data['client_status']}</strong> status. <br> More Detailed Information is sent to your mail");
|
||||
}
|
||||
$this->bot->startConversation(new doYouWantToContinueConversation());
|
||||
}else{
|
||||
$this->say("No Claim Raised against the user.");
|
||||
|
||||
@ -77,6 +77,7 @@ class doYouWantToContinueConversation extends Conversation
|
||||
|
||||
|
||||
$this->say("Thank you for your time! If you need anything else, feel free to reach out. Goodbye!");
|
||||
$this->say("Say Hi or Help or Hello to start conversation again!");
|
||||
break;
|
||||
default:
|
||||
$this->say("Invalid selection. Please choose an option.");
|
||||
|
||||
@ -196,7 +196,7 @@ class vehicleFormConversation extends Conversation
|
||||
// $cityName = $response->getText();
|
||||
$sent_staus = ChatbotHelper::sendQuotationRequestMail($vehicle_info);
|
||||
if ($sent_staus){
|
||||
$this->say('Our Executive will contact you with the quotation soon.');
|
||||
$this->say('Thanks.Our Executive will contact you with the quotation soon.');
|
||||
$this->bot->startConversation(new doYouWantToContinueConversation());
|
||||
}else{
|
||||
$this->say("There was a problem while requesting for a quotation please try again later.");
|
||||
|
||||
@ -116,7 +116,7 @@ class ChatbotControllerNew extends BaseController
|
||||
// Start the Main Menu when user says "hi" or "start"
|
||||
$this->botman->hears('start|hi|hello|help|help me', function (BotMan $bot) {
|
||||
if ($this->isMemberLoggedIn){
|
||||
$bot->reply('Hi how can i assist?');
|
||||
// $bot->reply('Hi how can i assist?');
|
||||
$bot->startConversation(new MainMenuConversation());
|
||||
}else {
|
||||
$bot->startConversation(new LoginToContiueConversation());
|
||||
|
||||
@ -772,6 +772,8 @@ class ClientController extends AdminController
|
||||
|
||||
$editData['client'] = $this->clientModel->where(['id' => $id])->first();
|
||||
$editData['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $id)->findAll();
|
||||
$editData['client_kyc_primary_table'] = $this->generateKycPrimaryTable($id);
|
||||
$editData['client_kyc_other_table'] = $this->generateKycOthersTable($id);
|
||||
$editData['client_branch'] = $this->clientBranchModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
||||
$editData['client_relation'] = $this->clientRMModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
||||
$editData['client_branch']['role'] = get_role_id();
|
||||
@ -870,6 +872,8 @@ class ClientController extends AdminController
|
||||
{
|
||||
$this->myLogger->logme('error', 'create Client kyc function called');
|
||||
$data = $this->request->getPost();
|
||||
$form_type = $this->request->getPost('form_type') ?? null;
|
||||
|
||||
// print_r($data); die;
|
||||
unset($data['file_name']);
|
||||
$uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents';
|
||||
@ -885,8 +889,12 @@ class ClientController extends AdminController
|
||||
$data['created_by'] = get_session_userid();
|
||||
$insert = $this->clientKYCDocsModel->insert($data);
|
||||
if ($insert) {
|
||||
|
||||
$kycDocs = $this->clientKYCDocsModel->where('client_id', $this->request->getPost('client_id'))->findAll();
|
||||
// $kycDocs = $this->clientKYCDocsModel->where('client_id', $this->request->getPost('client_id'))->findAll();
|
||||
if($form_type == "others"){
|
||||
$kycDocs = $this->generateKycOthersTable($this->request->getPost('client_id'));
|
||||
}else{
|
||||
$kycDocs = $this->generateKycPrimaryTable($this->request->getPost('client_id'));
|
||||
}
|
||||
return $this->respond(['status' => true, 'code' => 200, 'data' => $kycDocs, 'file_name' => $File], 200);
|
||||
} else {
|
||||
return $this->respond(['status' => false, 'code' => 404, 'message' => 'no data found'], 200);
|
||||
@ -899,6 +907,8 @@ class ClientController extends AdminController
|
||||
$this->myLogger->logme('error', 'edit client kyc function called');
|
||||
$uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents';
|
||||
$File = file_Upload($this->request->getFile('file_name'), $uploadFilePath);
|
||||
$form_type = $this->request->getPost('form_type') ?? null;
|
||||
|
||||
if (!empty($File)) {
|
||||
$data['file_name'] = $File;
|
||||
}
|
||||
@ -907,8 +917,14 @@ class ClientController extends AdminController
|
||||
$data['kyc_doc_type_id'] = $this->request->getPost('kyc_doc_id');
|
||||
$data['updated_by'] = get_session_userid();
|
||||
$insert = $this->clientKYCDocsModel->insert($data);
|
||||
|
||||
if ($insert) {
|
||||
$kycDocs = $this->clientKYCDocsModel->getKycDocsName($id);
|
||||
// $kycDocs = $this->clientKYCDocsModel->getKycDocsName($id);
|
||||
if($form_type == "others"){
|
||||
$kycDocs = $this->generateKycOthersTable($this->request->getPost('client_id'));
|
||||
}else{
|
||||
$kycDocs = $this->generateKycPrimaryTable($this->request->getPost('client_id'));
|
||||
}
|
||||
return $this->respond(['status' => true, 'code' => 200, 'data' => $kycDocs], 200);
|
||||
} else {
|
||||
return $this->respond(['status' => false, 'code' => 404, 'message' => 'no data found'], 200);
|
||||
@ -2148,6 +2164,50 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function generateKycPrimaryTable($client_id){
|
||||
|
||||
$db = db_connect();
|
||||
$builder = $db->table('kyc_docs kd');
|
||||
$builder->select('kd.*, ck.file_name AS upload_doc_name');
|
||||
$builder->join('clients c', 'kd.kyc_type_id = c.entity_type_id');
|
||||
$builder->join(
|
||||
'client_kyc_documents ck',
|
||||
'kd.id = ck.kyc_doc_type_id AND ck.client_id = c.id AND ck.is_active = 1',
|
||||
'left'
|
||||
);
|
||||
$builder->where('c.id', $client_id);
|
||||
$builder->groupBy(['kd.id', 'ck.file_name']);
|
||||
|
||||
$query = $builder->get();
|
||||
$result['data'] = $query->getResultArray();
|
||||
$result['client_id'] = $client_id;
|
||||
|
||||
$table = view('client_kyc_primary_table', $result);
|
||||
|
||||
return $table;
|
||||
// print_r($table); die;
|
||||
|
||||
}
|
||||
|
||||
public function generateKycOthersTable($client_id){
|
||||
|
||||
$result['data'] = $this->clientKYCDocsModel
|
||||
->where('is_active', 1)
|
||||
->where('client_id', $client_id)
|
||||
->groupStart()
|
||||
->where('kyc_doc_type_id', null)
|
||||
->orWhere('kyc_doc_type_id', 0)
|
||||
->groupEnd()
|
||||
->findAll();
|
||||
|
||||
$result['client_id'] = $client_id;
|
||||
$table = view('client_kyc_other_table', $result);
|
||||
|
||||
return $table;
|
||||
// print_r($table); die;
|
||||
|
||||
}
|
||||
|
||||
public function getPolicesByInsurerId($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error', 'getPolicesByInsurerId function called');
|
||||
@ -2423,6 +2483,7 @@ class ClientController extends AdminController
|
||||
|
||||
// echo "<pre>";
|
||||
// print_r($this->request->getPost());die;
|
||||
$this->myLogger->logme('error', "post data : " . json_encode($this->request->getPost() ?? []));
|
||||
$this->myLogger->logme('error', 'Terms CREATE function called');
|
||||
|
||||
/*** Client Policy Table Primary Key(ID) ***/
|
||||
@ -2624,7 +2685,7 @@ class ClientController extends AdminController
|
||||
}
|
||||
|
||||
$data['enrollment_display_key'] = $this->enrollmentGMCDisplayValueTransform();
|
||||
|
||||
$this->myLogger->logme('error', "contructed post data : " . json_encode($data ?? []));
|
||||
// print_r($data);die;
|
||||
|
||||
$jsonData = json_encode($data);
|
||||
@ -2658,194 +2719,269 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
// public function enrollmentGMCDisplayValueTransform()
|
||||
// {
|
||||
// $data = [];
|
||||
|
||||
// if ($this->request->getPost("waiverofpreexistingdiseases_display")) {
|
||||
// $data['Waiver of Pre-existing Diseases'] = $this->request->getPost("waiverofpreexistingdiseases");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("waiverof1234thyearexclusions_display")) {
|
||||
// $data['Waiver of 1, 2, 3 & 4th year Exclusions'] = $this->request->getPost("waiverof1,2,3&4thyearexclusions");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("waiverof30dayswaitingperiod_display")) {
|
||||
// $data['Waiver of 30 days waiting period'] = $this->request->getPost("waiverof30dayswaitingperiod");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("suminsuredenhancement_display")) {
|
||||
// $data['Sum Insured Enhancement'] = $this->request->getPost("suminsuredenhancement");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("waiver_of_90_days_waiting_period_display")) {
|
||||
// $data['Waiver of 90 Days Waiting Period'] = $this->request->getPost("waiver_of_90_days_waiting_period");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("waiver_of_other_waiting_periods_display")) {
|
||||
// $data['Waiver of Other Waiting Periods'] = $this->request->getPost("waiver_of_other_waiting_periods");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("maternity_benefit_display")) {
|
||||
// $data['Maternity Benefit'] = $this->request->getPost("maternity_benefit");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("9monthwaitingperiodwaived_display")) {
|
||||
// $data['9-month waiting Period - waived'] = $this->request->getPost("9monthwaitingperiodwaived");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("maternitycoverage_display")) {
|
||||
// $data['Maternity Coverage'] = $this->request->getPost("maternitycoverage");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("twindelivery_display")) {
|
||||
// $data['Twin Delivery'] = $this->request->getPost("twindelivery");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("well_baby_well_mother_expenses_display")) {
|
||||
// $data['Well baby / Well Mother Expenses'] = $this->request->getPost("well_baby_well_mother_expenses");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("preandpostnatal_display")) {
|
||||
// $data['Pre and Post natal'] = $this->request->getPost("preandpostnatal");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("infertility_treatment_coverage_display")) {
|
||||
// $data['Infertility Treatment Coverage'] = $this->request->getPost("infertility_treatment_coverage");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("babyday1cover_display")) {
|
||||
// $data['Baby Day 1 Cover'] = $this->request->getPost("babyday1cover");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("coverfromthedateofjoining_display")) {
|
||||
// $data['Cover from the date of Joining'] = $this->request->getPost("coverfromthedateofjoining");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse_display")) {
|
||||
// $data['Mid Term Addition of New Born / Newly Wedded Spouse'] = $this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("prehospitalizationcover_display")) {
|
||||
// $data['Pre Hospitalization Cover'] = $this->request->getPost("prehospitalizationcover");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("posthospitalizationcover_display")) {
|
||||
// $data['Post Hospitalization Cover'] = $this->request->getPost("posthospitalizationcover");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("congenitaldiseasesinternal_display")) {
|
||||
// $data['Congenital Diseases - Internal'] = $this->request->getPost("congenitaldiseasesinternal");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("congenitaldiseasesexternal_display")) {
|
||||
// $data['Congenital Diseases - External'] = $this->request->getPost("congenitaldiseasesexternal");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("copayzonewisecopay_display")) {
|
||||
// $data['Co-Pay/Zone wise Co Pay'] = $this->request->getPost("copayzonewisecopay");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("roomrentlimit_display")) {
|
||||
// $data['Room Rent Limit'] = $this->request->getPost("roomrentlimit");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("icu_limit_display")) {
|
||||
// $data['ICU Limit'] = $this->request->getPost("icu_limit");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("proportionatedeductionclause_display")) {
|
||||
// $data['Proportionate Deduction Clause'] = $this->request->getPost("proportionatedeductionclause");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("ailmentcapping_display")) {
|
||||
// $data['Ailment capping'] = $this->request->getPost("ailmentcapping");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("ailment_capping_details_display")) {
|
||||
// $data['Ailment capping Details'] = $this->request->getPost("ailment_capping_details");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("corporatebuffer_display")) {
|
||||
// $data['Corporate Buffer'] = $this->request->getPost("corporatebuffer");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("non_admissible_contingency_corporate_buffer_display")) {
|
||||
// $data['Non-Admissible / Contingency Corporate Buffer'] = $this->request->getPost("non_admissible_contingency_corporate_buffer");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("ambulancecharges_display")) {
|
||||
// $data['Ambulance Charges'] = $this->request->getPost("ambulancecharges");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("airambulance_display")) {
|
||||
// $data['Air Ambulance'] = $this->request->getPost("airambulance");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("reasonableandcustomarycharges_display")) {
|
||||
// $data['Reasonable and Customary Charges'] = $this->request->getPost("reasonableandcustomarycharges");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("daycaretreatment_display")) {
|
||||
// $data['Day Care Treatment'] = $this->request->getPost("daycaretreatment");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("lasiksurgery_display")) {
|
||||
// $data['Lasik Surgery'] = $this->request->getPost("lasiksurgery");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("ayushtreatmentcover_display")) {
|
||||
// $data['AYUSH treatment cover'] = $this->request->getPost("ayudhtreatmentcover");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("moderntreatmentsasperirdai_display")) {
|
||||
// $data['Modern treatments as per IRDAI'] = $this->request->getPost("moderntreatmentsasperirdai");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("opd_treatment_display")) {
|
||||
// $data['OPD Treatment'] = $this->request->getPost("opd_treatment");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("days_of_discharge_display")) {
|
||||
// $data['Claim Intimation Clause'] = $this->request->getPost("days_of_discharge");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("days_from_dod_display")) {
|
||||
// $data['Claim Submission'] = $this->request->getPost("days_from_dod");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("terrorism_display")) {
|
||||
// $data['Terrorism'] = $this->request->getPost("terrorism");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("widower_cover_display")) {
|
||||
// $data['Widower Cover'] = $this->request->getPost("widower_cover");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("breavement_cover_display")) {
|
||||
// $data['Breavement Cover'] = $this->request->getPost("breavement_cover");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("special_condition_display_value")) {
|
||||
|
||||
// $specialConditionKeyValue = $this->request->getPost("special_condition_display_value") ?? [];
|
||||
// $specialConditionKeyValue = json_decode($specialConditionKeyValue, true);
|
||||
|
||||
// if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
|
||||
// $mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
|
||||
// $data = array_merge($data, $mergedArray);
|
||||
// }
|
||||
// }
|
||||
|
||||
// if(isset($data) && !empty($data)){
|
||||
// return $data;
|
||||
// }else{
|
||||
// $data = [];
|
||||
// return $data;
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
public function enrollmentGMCDisplayValueTransform()
|
||||
{
|
||||
$data = [];
|
||||
|
||||
if ($this->request->getPost("waiverofpreexistingdiseases_display")) {
|
||||
$data['Waiver of Pre-existing Diseases'] = $this->request->getPost("waiverofpreexistingdiseases");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("waiverof1234thyearexclusions_display")) {
|
||||
$data['Waiver of 1, 2, 3 & 4th year Exclusions'] = $this->request->getPost("waiverof1,2,3&4thyearexclusions");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("waiverof30dayswaitingperiod_display")) {
|
||||
$data['Waiver of 30 days waiting period'] = $this->request->getPost("waiverof30dayswaitingperiod");
|
||||
}
|
||||
// Mapping of POST keys to display labels
|
||||
$fields = [
|
||||
'waiverofpreexistingdiseases' => 'Waiver of Pre-existing Diseases',
|
||||
'waiverof1,2,3&4thyearexclusions' => 'Waiver of 1, 2, 3 & 4th year Exclusions',
|
||||
'waiverof30dayswaitingperiod' => 'Waiver of 30 days waiting period',
|
||||
'suminsuredenhancement' => 'Sum Insured Enhancement',
|
||||
'waiver_of_90_days_waiting_period' => 'Waiver of 90 Days Waiting Period',
|
||||
'waiver_of_other_waiting_periods' => 'Waiver of Other Waiting Periods',
|
||||
'maternity_benefit' => 'Maternity Benefit',
|
||||
'9monthwaitingperiodwaived' => '9-month waiting Period - waived',
|
||||
'maternitycoverage' => 'Maternity Coverage',
|
||||
'twindelivery' => 'Twin Delivery',
|
||||
'well_baby_well_mother_expenses' => 'Well baby / Well Mother Expenses',
|
||||
'preandpostnatal' => 'Pre and Post natal',
|
||||
'infertility_treatment_coverage' => 'Infertility Treatment Coverage',
|
||||
'babyday1cover' => 'Baby Day 1 Cover',
|
||||
'coverfromthedateofjoining' => 'Cover from the date of Joining',
|
||||
'mid_term_addition_of_new_born_newly_wedded_spouse' => 'Mid Term Addition of New Born / Newly Wedded Spouse',
|
||||
'prehospitalizationcover' => 'Pre Hospitalization Cover',
|
||||
'posthospitalizationcover' => 'Post Hospitalization Cover',
|
||||
'congenitaldiseasesinternal' => 'Congenital Diseases - Internal',
|
||||
'congenitaldiseasesexternal' => 'Congenital Diseases - External',
|
||||
'copayzonewisecopay' => 'Co-Pay/Zone wise Co Pay',
|
||||
'roomrentlimit' => 'Room Rent Limit',
|
||||
'icu_limit' => 'ICU Limit',
|
||||
'proportionatedeductionclause' => 'Proportionate Deduction Clause',
|
||||
'ailmentcapping' => 'Ailment capping',
|
||||
'ailment_capping_details' => 'Ailment capping Details',
|
||||
'corporatebuffer' => 'Corporate Buffer',
|
||||
'non_admissible_contingency_corporate_buffer' => 'Non-Admissible / Contingency Corporate Buffer',
|
||||
'ambulancecharges' => 'Ambulance Charges',
|
||||
'airambulance' => 'Air Ambulance',
|
||||
'reasonableandcustomarycharges' => 'Reasonable and Customary Charges',
|
||||
'daycaretreatment' => 'Day Care Treatment',
|
||||
'lasiksurgery' => 'Lasik Surgery',
|
||||
'ayudhtreatmentcover' => 'AYUSH treatment cover',
|
||||
'moderntreatmentsasperirdai' => 'Modern treatments as per IRDAI',
|
||||
'opd_treatment' => 'OPD Treatment',
|
||||
'days_of_discharge' => 'Claim Intimation Clause',
|
||||
'days_from_dod' => 'Claim Submission',
|
||||
'terrorism' => 'Terrorism',
|
||||
'widower_cover' => 'Widower Cover',
|
||||
'breavement_cover' => 'Breavement Cover'
|
||||
];
|
||||
|
||||
if ($this->request->getPost("suminsuredenhancement_display")) {
|
||||
$data['Sum Insured Enhancement'] = $this->request->getPost("suminsuredenhancement");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("waiver_of_90_days_waiting_period_display")) {
|
||||
$data['Waiver of 90 Days Waiting Period'] = $this->request->getPost("waiver_of_90_days_waiting_period");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("waiver_of_other_waiting_periods_display")) {
|
||||
$data['Waiver of Other Waiting Periods'] = $this->request->getPost("waiver_of_other_waiting_periods");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("maternity_benefit_display")) {
|
||||
$data['Maternity Benefit'] = $this->request->getPost("maternity_benefit");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("9monthwaitingperiodwaived_display")) {
|
||||
$data['9-month waiting Period - waived'] = $this->request->getPost("9monthwaitingperiodwaived");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("maternitycoverage_display")) {
|
||||
$data['Maternity Coverage'] = $this->request->getPost("maternitycoverage");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("twindelivery_display")) {
|
||||
$data['Twin Delivery'] = $this->request->getPost("twindelivery");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("well_baby_well_mother_expenses_display")) {
|
||||
$data['Well baby / Well Mother Expenses'] = $this->request->getPost("well_baby_well_mother_expenses");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("preandpostnatal_display")) {
|
||||
$data['Pre and Post natal'] = $this->request->getPost("preandpostnatal");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("infertility_treatment_coverage_display")) {
|
||||
$data['Infertility Treatment Coverage'] = $this->request->getPost("infertility_treatment_coverage");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("babyday1cover_display")) {
|
||||
$data['Baby Day 1 Cover'] = $this->request->getPost("babyday1cover");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("coverfromthedateofjoining_display")) {
|
||||
$data['Cover from the date of Joining'] = $this->request->getPost("coverfromthedateofjoining");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse_display")) {
|
||||
$data['Mid Term Addition of New Born / Newly Wedded Spouse'] = $this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("prehospitalizationcover_display")) {
|
||||
$data['Pre Hospitalization Cover'] = $this->request->getPost("prehospitalizationcover");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("posthospitalizationcover_display")) {
|
||||
$data['Post Hospitalization Cover'] = $this->request->getPost("posthospitalizationcover");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("congenitaldiseasesinternal_display")) {
|
||||
$data['Congenital Diseases - Internal'] = $this->request->getPost("congenitaldiseasesinternal");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("congenitaldiseasesexternal_display")) {
|
||||
$data['Congenital Diseases - External'] = $this->request->getPost("congenitaldiseasesexternal");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("copayzonewisecopay_display")) {
|
||||
$data['Co-Pay/Zone wise Co Pay'] = $this->request->getPost("copayzonewisecopay");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("roomrentlimit_display")) {
|
||||
$data['Room Rent Limit'] = $this->request->getPost("roomrentlimit");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("icu_limit_display")) {
|
||||
$data['ICU Limit'] = $this->request->getPost("icu_limit");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("proportionatedeductionclause_display")) {
|
||||
$data['Proportionate Deduction Clause'] = $this->request->getPost("proportionatedeductionclause");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("ailmentcapping_display")) {
|
||||
$data['Ailment capping'] = $this->request->getPost("ailmentcapping");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("ailment_capping_details_display")) {
|
||||
$data['Ailment capping Details'] = $this->request->getPost("ailment_capping_details");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("corporatebuffer_display")) {
|
||||
$data['Corporate Buffer'] = $this->request->getPost("corporatebuffer");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("non_admissible_contingency_corporate_buffer_display")) {
|
||||
$data['Non-Admissible / Contingency Corporate Buffer'] = $this->request->getPost("non_admissible_contingency_corporate_buffer");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("ambulancecharges_display")) {
|
||||
$data['Ambulance Charges'] = $this->request->getPost("ambulancecharges");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("airambulance_display")) {
|
||||
$data['Air Ambulance'] = $this->request->getPost("airambulance");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("reasonableandcustomarycharges_display")) {
|
||||
$data['Reasonable and Customary Charges'] = $this->request->getPost("reasonableandcustomarycharges");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("daycaretreatment_display")) {
|
||||
$data['Day Care Treatment'] = $this->request->getPost("daycaretreatment");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("lasiksurgery_display")) {
|
||||
$data['Lasik Surgery'] = $this->request->getPost("lasiksurgery");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("ayushtreatmentcover_display")) {
|
||||
$data['AYUSH treatment cover'] = $this->request->getPost("ayudhtreatmentcover");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("moderntreatmentsasperirdai_display")) {
|
||||
$data['Modern treatments as per IRDAI'] = $this->request->getPost("moderntreatmentsasperirdai");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("opd_treatment_display")) {
|
||||
$data['OPD Treatment'] = $this->request->getPost("opd_treatment");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("days_of_discharge_display")) {
|
||||
$data['Claim Intimation Clause'] = $this->request->getPost("days_of_discharge");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("days_from_dod_display")) {
|
||||
$data['Claim Submission'] = $this->request->getPost("days_from_dod");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("terrorism_display")) {
|
||||
$data['Terrorism'] = $this->request->getPost("terrorism");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("widower_cover_display")) {
|
||||
$data['Widower Cover'] = $this->request->getPost("widower_cover");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("breavement_cover_display")) {
|
||||
$data['Breavement Cover'] = $this->request->getPost("breavement_cover");
|
||||
}
|
||||
|
||||
if ($this->request->getPost("special_condition_display_value")) {
|
||||
|
||||
$specialConditionKeyValue = $this->request->getPost("special_condition_display_value") ?? [];
|
||||
$specialConditionKeyValue = json_decode($specialConditionKeyValue, true);
|
||||
|
||||
if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
|
||||
$mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
|
||||
$data = array_merge($data, $mergedArray);
|
||||
foreach ($fields as $postKey => $label) {
|
||||
$displayKey = $postKey . '_display';
|
||||
$value = $this->request->getPost($postKey);
|
||||
if ($this->request->getPost($displayKey) && $value !== null && $value !== '') {
|
||||
$data[$label] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($data) && !empty($data)){
|
||||
return $data;
|
||||
}else{
|
||||
$data = [];
|
||||
return $data;
|
||||
|
||||
// Handle special conditions
|
||||
if ($this->request->getPost("special_condition_display_value")) {
|
||||
$specialConditionKeyValue = json_decode($this->request->getPost("special_condition_display_value"), true);
|
||||
if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
|
||||
$mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
|
||||
// Only add non-empty values
|
||||
foreach ($mergedArray as $k => $v) {
|
||||
if ($v !== null && $v !== '') {
|
||||
$data[$k] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
public function getterms()
|
||||
{
|
||||
$client_policy_id = $this->request->getVar('client_policy_id');
|
||||
@ -3005,92 +3141,145 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
// public function enrollmentGPADisplayValueTransform()
|
||||
// {
|
||||
// $data = [];
|
||||
|
||||
// if ($this->request->getPost("accidentalDeathBenefit_display")) {
|
||||
// $data['Accidental Death Benefit'] = $this->request->getPost("accidentalDeathBenefit");
|
||||
// }
|
||||
// if ($this->request->getPost("permanentTotalDisablement_display")) {
|
||||
// $data['Permanent Total Disablement'] = $this->request->getPost("permanentTotalDisablement");
|
||||
// }
|
||||
// if ($this->request->getPost("permanentPartialDisablement_display")) {
|
||||
// $data['Permanent Partial Disablement'] = $this->request->getPost("permanentPartialDisablement");
|
||||
// }
|
||||
// if ($this->request->getPost("temporaryTotalDisablementBenefit_display")) {
|
||||
// $data['Temporary Total Disablement Benefit'] = $this->request->getPost("temporaryTotalDisablementBenefit");
|
||||
// }
|
||||
// if ($this->request->getPost("medical_expenses_medical_extension_display")) {
|
||||
// $data['Medical Expenses / Medical Extension (IPD)'] = $this->request->getPost("medical_expenses_medical_extension");
|
||||
// }
|
||||
// if ($this->request->getPost("opd_treatment_cover_display")) {
|
||||
// $data['OPD Treatment Cover'] = $this->request->getPost("opd_treatment_cover");
|
||||
// }
|
||||
// if ($this->request->getPost("ambulanceCharges_display")) {
|
||||
// $data['Ambulance Charges'] = $this->request->getPost("ambulanceCharges");
|
||||
// }
|
||||
// if ($this->request->getPost("repatriation_of_mortal_remains_display")) {
|
||||
// $data['Repatriation of Mortal Remains'] = $this->request->getPost("repatriation_of_mortal_remains");
|
||||
// }
|
||||
// if ($this->request->getPost("childrenEducationWelfareFund_display")) {
|
||||
// $data['Children Education Welfare Fund'] = $this->request->getPost("childrenEducationWelfareFund");
|
||||
// }
|
||||
// if ($this->request->getPost("terrorism_display")) {
|
||||
// $data['Terrorism'] = $this->request->getPost("terrorism");
|
||||
// }
|
||||
// if ($this->request->getPost("worldwideCover_display")) {
|
||||
// $data['Worldwide Cover'] = $this->request->getPost("worldwideCover");
|
||||
// }
|
||||
// if ($this->request->getPost("family_transportation_benefits_display")) {
|
||||
// $data['Family Transportation Benefits'] = $this->request->getPost("family_transportation_benefits");
|
||||
// }
|
||||
// if ($this->request->getPost("fractures_dislocation_burns_display")) {
|
||||
// $data['Fractures / Dislocation / Burns'] = $this->request->getPost("fractures_dislocation_burns");
|
||||
// }
|
||||
// if ($this->request->getPost("coma_display")) {
|
||||
// $data['Coma'] = $this->request->getPost("coma");
|
||||
// }
|
||||
// if ($this->request->getPost("carriageofDeadBody_display")) {
|
||||
// $data['Carriage of Dead Body'] = $this->request->getPost("carriageOfDeadBody");
|
||||
// }
|
||||
// if ($this->request->getPost("compassionateVisitExpenses_display")) {
|
||||
// $data['Compassionate Visit Expenses'] = $this->request->getPost("compassionateVisitExpenses");
|
||||
// }
|
||||
// if ($this->request->getPost("travel_expenses_for_medical_treatment_display")) {
|
||||
// $data['Travel expenses for Medical Treatment'] = $this->request->getPost("travel_expenses_for_medical_treatment");
|
||||
// }
|
||||
// if ($this->request->getPost("daily_cash_allowance_display")) {
|
||||
// $data['Daily cash Allowance'] = $this->request->getPost("daily_cash_allowance");
|
||||
// }
|
||||
// if ($this->request->getPost("artifical_limb_and_prosthesis_display")) {
|
||||
// $data['Artifical Limb and Prosthesis'] = $this->request->getPost("artifical_limb_and_prosthesis");
|
||||
// }
|
||||
// if ($this->request->getPost("animalSnakeInsectBite_display")) {
|
||||
// $data['Animal/Snake/Insect Bite'] = $this->request->getPost("animalSnakeInsectBite");
|
||||
// }
|
||||
// if ($this->request->getPost("air_ambulance_display")) {
|
||||
// $data['Air Ambulance'] = $this->request->getPost("air_ambulance");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("gpa_special_condition_display_value")) {
|
||||
|
||||
// $specialConditionKeyValue = $this->request->getPost("gpa_special_condition_display_value") ?? [];
|
||||
// $specialConditionKeyValue = json_decode($specialConditionKeyValue, true);
|
||||
|
||||
// if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
|
||||
// $mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
|
||||
// $data = array_merge($data, $mergedArray);
|
||||
// }
|
||||
// }
|
||||
// // print_r($data); die;
|
||||
|
||||
// if (isset($data) && !empty($data)) {
|
||||
// return $data;
|
||||
// } else {
|
||||
// $data = [];
|
||||
// return $data;
|
||||
// }
|
||||
// }
|
||||
|
||||
public function enrollmentGPADisplayValueTransform()
|
||||
{
|
||||
{
|
||||
$data = [];
|
||||
|
||||
if ($this->request->getPost("accidentalDeathBenefit_display")) {
|
||||
$data['Accidental Death Benefit'] = $this->request->getPost("accidentalDeathBenefit");
|
||||
}
|
||||
if ($this->request->getPost("permanentTotalDisablement_display")) {
|
||||
$data['Permanent Total Disablement'] = $this->request->getPost("permanentTotalDisablement");
|
||||
}
|
||||
if ($this->request->getPost("permanentPartialDisablement_display")) {
|
||||
$data['Permanent Partial Disablement'] = $this->request->getPost("permanentPartialDisablement");
|
||||
}
|
||||
if ($this->request->getPost("temporaryTotalDisablementBenefit_display")) {
|
||||
$data['Temporary Total Disablement Benefit'] = $this->request->getPost("temporaryTotalDisablementBenefit");
|
||||
}
|
||||
if ($this->request->getPost("medical_expenses_medical_extension_display")) {
|
||||
$data['Medical Expenses / Medical Extension (IPD)'] = $this->request->getPost("medical_expenses_medical_extension");
|
||||
}
|
||||
if ($this->request->getPost("opd_treatment_cover_display")) {
|
||||
$data['OPD Treatment Cover'] = $this->request->getPost("opd_treatment_cover");
|
||||
}
|
||||
if ($this->request->getPost("ambulanceCharges_display")) {
|
||||
$data['Ambulance Charges'] = $this->request->getPost("ambulanceCharges");
|
||||
}
|
||||
if ($this->request->getPost("repatriation_of_mortal_remains_display")) {
|
||||
$data['Repatriation of Mortal Remains'] = $this->request->getPost("repatriation_of_mortal_remains");
|
||||
}
|
||||
if ($this->request->getPost("childrenEducationWelfareFund_display")) {
|
||||
$data['Children Education Welfare Fund'] = $this->request->getPost("childrenEducationWelfareFund");
|
||||
}
|
||||
if ($this->request->getPost("terrorism_display")) {
|
||||
$data['Terrorism'] = $this->request->getPost("terrorism");
|
||||
}
|
||||
if ($this->request->getPost("worldwideCover_display")) {
|
||||
$data['Worldwide Cover'] = $this->request->getPost("worldwideCover");
|
||||
}
|
||||
if ($this->request->getPost("family_transportation_benefits_display")) {
|
||||
$data['Family Transportation Benefits'] = $this->request->getPost("family_transportation_benefits");
|
||||
}
|
||||
if ($this->request->getPost("fractures_dislocation_burns_display")) {
|
||||
$data['Fractures / Dislocation / Burns'] = $this->request->getPost("fractures_dislocation_burns");
|
||||
}
|
||||
if ($this->request->getPost("coma_display")) {
|
||||
$data['Coma'] = $this->request->getPost("coma");
|
||||
}
|
||||
if ($this->request->getPost("carriageofDeadBody_display")) {
|
||||
$data['Carriage of Dead Body'] = $this->request->getPost("carriageOfDeadBody");
|
||||
}
|
||||
if ($this->request->getPost("compassionateVisitExpenses_display")) {
|
||||
$data['Compassionate Visit Expenses'] = $this->request->getPost("compassionateVisitExpenses");
|
||||
}
|
||||
if ($this->request->getPost("travel_expenses_for_medical_treatment_display")) {
|
||||
$data['Travel expenses for Medical Treatment'] = $this->request->getPost("travel_expenses_for_medical_treatment");
|
||||
}
|
||||
if ($this->request->getPost("daily_cash_allowance_display")) {
|
||||
$data['Daily cash Allowance'] = $this->request->getPost("daily_cash_allowance");
|
||||
}
|
||||
if ($this->request->getPost("artifical_limb_and_prosthesis_display")) {
|
||||
$data['Artifical Limb and Prosthesis'] = $this->request->getPost("artifical_limb_and_prosthesis");
|
||||
}
|
||||
if ($this->request->getPost("animalSnakeInsectBite_display")) {
|
||||
$data['Animal/Snake/Insect Bite'] = $this->request->getPost("animalSnakeInsectBite");
|
||||
}
|
||||
if ($this->request->getPost("air_ambulance_display")) {
|
||||
$data['Air Ambulance'] = $this->request->getPost("air_ambulance");
|
||||
}
|
||||
// Map POST keys to display labels
|
||||
$fields = [
|
||||
'accidentalDeathBenefit' => 'Accidental Death Benefit',
|
||||
'permanentTotalDisablement' => 'Permanent Total Disablement',
|
||||
'permanentPartialDisablement' => 'Permanent Partial Disablement',
|
||||
'temporaryTotalDisablementBenefit' => 'Temporary Total Disablement Benefit',
|
||||
'medical_expenses_medical_extension' => 'Medical Expenses / Medical Extension (IPD)',
|
||||
'opd_treatment_cover' => 'OPD Treatment Cover',
|
||||
'ambulanceCharges' => 'Ambulance Charges',
|
||||
'repatriation_of_mortal_remains' => 'Repatriation of Mortal Remains',
|
||||
'childrenEducationWelfareFund' => 'Children Education Welfare Fund',
|
||||
'terrorism' => 'Terrorism',
|
||||
'worldwideCover' => 'Worldwide Cover',
|
||||
'family_transportation_benefits' => 'Family Transportation Benefits',
|
||||
'fractures_dislocation_burns' => 'Fractures / Dislocation / Burns',
|
||||
'coma' => 'Coma',
|
||||
'carriageOfDeadBody' => 'Carriage of Dead Body',
|
||||
'compassionateVisitExpenses' => 'Compassionate Visit Expenses',
|
||||
'travel_expenses_for_medical_treatment' => 'Travel expenses for Medical Treatment',
|
||||
'daily_cash_allowance' => 'Daily cash Allowance',
|
||||
'artifical_limb_and_prosthesis' => 'Artifical Limb and Prosthesis',
|
||||
'animalSnakeInsectBite' => 'Animal/Snake/Insect Bite',
|
||||
'air_ambulance' => 'Air Ambulance'
|
||||
];
|
||||
|
||||
if ($this->request->getPost("gpa_special_condition_display_value")) {
|
||||
|
||||
$specialConditionKeyValue = $this->request->getPost("gpa_special_condition_display_value") ?? [];
|
||||
$specialConditionKeyValue = json_decode($specialConditionKeyValue, true);
|
||||
|
||||
if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
|
||||
$mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
|
||||
$data = array_merge($data, $mergedArray);
|
||||
foreach ($fields as $postKey => $label) {
|
||||
$displayKey = $postKey . '_display';
|
||||
$value = $this->request->getPost($postKey);
|
||||
if ($this->request->getPost($displayKey) && $value !== null && $value !== '') {
|
||||
$data[$label] = $value;
|
||||
}
|
||||
}
|
||||
// print_r($data); die;
|
||||
|
||||
if (isset($data) && !empty($data)) {
|
||||
return $data;
|
||||
} else {
|
||||
$data = [];
|
||||
return $data;
|
||||
// Handle GPA special conditions
|
||||
if ($this->request->getPost("gpa_special_condition_display_value")) {
|
||||
$specialConditionKeyValue = json_decode($this->request->getPost("gpa_special_condition_display_value"), true);
|
||||
if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
|
||||
$mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
|
||||
foreach ($mergedArray as $k => $v) {
|
||||
if ($v !== null && $v !== '') {
|
||||
$data[$k] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getPolicyGPATerms()
|
||||
@ -5404,7 +5593,8 @@ class ClientController extends AdminController
|
||||
employees.mobile AS emp_mobile,
|
||||
employees.email_corporate AS emp_email,
|
||||
employees.relationship AS emp_relationship,
|
||||
employee_polices.uhid AS policy_no
|
||||
employee_polices.uhid AS policy_no,
|
||||
employee_polices.client_policy_id
|
||||
")
|
||||
->join('clients', 'client_policy.client_id = clients.id', 'left')
|
||||
->join('insurers', 'client_policy.insurer_id = insurers.id', 'left')
|
||||
@ -5417,9 +5607,15 @@ class ClientController extends AdminController
|
||||
->where('employees.is_active', 1)
|
||||
->where('employees.relationship', "Self")
|
||||
->where('employee_polices.is_active', 1)
|
||||
->whereIn('employees.emp_status', ['active'])
|
||||
->whereIn('employee_polices.status', ['active'])
|
||||
->where('employees.is_active', 1)
|
||||
->where('client_policy.id', $param)
|
||||
->groupBy('employees.emp_code')
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
// print_r(db_connect()->getLastQuery()); die;
|
||||
|
||||
$dataForClientAndInsurer = $this->clientPolicyModel
|
||||
->select("
|
||||
@ -5461,20 +5657,39 @@ class ClientController extends AdminController
|
||||
'memberData' => $memberData
|
||||
], 404);
|
||||
}
|
||||
}
|
||||
|
||||
public function getTheEmpDataForClaimSearchByMobile($param, $type = 'mobile', $client_policy_id = null, $client_id = null, $ticket_type_id = null)
|
||||
{
|
||||
}
|
||||
|
||||
// public function getTheEmpDataForClaimSearchByMobile($param, $type = 'mobile', $client_policy_id = null, $client_id = null, $ticket_type_id = null)
|
||||
public function getTheEmpDataForClaimSearchByMobile()
|
||||
{
|
||||
|
||||
$request = $this->request;
|
||||
|
||||
// Get parameters from GET request
|
||||
$param = $request->getGet('param');
|
||||
$type = $request->getGet('type') ?? 'mobile';
|
||||
$client_policy_id = $request->getGet('client_policy_id');
|
||||
$client_id = $request->getGet('client_id');
|
||||
$ticket_type_id = $request->getGet('ticket_type_id');
|
||||
|
||||
// Validate required parameter
|
||||
if (empty($param)) {
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Parameter is required'
|
||||
])->setStatusCode(400);
|
||||
}
|
||||
|
||||
$field_name = 'employees.' . $type;
|
||||
|
||||
$policy_type_id = [];
|
||||
if($ticket_type_id == 1){
|
||||
if ($ticket_type_id == 1) {
|
||||
$policy_type_id = [2, 3, 4, 5];
|
||||
}else if($ticket_type_id == 2){
|
||||
} else if ($ticket_type_id == 2) {
|
||||
$policy_type_id = [1];
|
||||
}else if($ticket_type_id == 3){
|
||||
} else if ($ticket_type_id == 3) {
|
||||
$policy_type_id = [6];
|
||||
}else if($ticket_type_id == 4){
|
||||
} else if ($ticket_type_id == 4) {
|
||||
$policy_type_id = [7];
|
||||
}
|
||||
|
||||
@ -5512,24 +5727,24 @@ class ClientController extends AdminController
|
||||
->where('employee_polices.status', "active")
|
||||
->where($field_name, $param);
|
||||
|
||||
if (!empty($client_id)) {
|
||||
$query->where('employees.client_id', $client_id);
|
||||
}
|
||||
if (!empty($client_id)) {
|
||||
$query->where('employees.client_id', $client_id);
|
||||
}
|
||||
|
||||
if (!empty($client_policy_id)) {
|
||||
$query->where('employee_polices.client_policy_id', $client_policy_id);
|
||||
}
|
||||
if (!empty($client_policy_id)) {
|
||||
$query->where('employee_polices.client_policy_id', $client_policy_id);
|
||||
}
|
||||
|
||||
if($policy_type_id != null){
|
||||
$query->whereIn('client_policy.policy_type_id', $policy_type_id);
|
||||
}
|
||||
|
||||
$query->groupBy('employees.id')
|
||||
->orderBy('employees.id', 'DESC');
|
||||
|
||||
$data = $query->get()->getRowArray();
|
||||
if ($policy_type_id != null) {
|
||||
$query->whereIn('client_policy.policy_type_id', $policy_type_id);
|
||||
}
|
||||
|
||||
// print_r(db_connect()->getLastQuery()); die;
|
||||
$query->groupBy('employees.id')
|
||||
->orderBy('employees.id', 'DESC');
|
||||
|
||||
$data = $query->get()->getRowArray();
|
||||
|
||||
// print_r(db_connect()->getLastQuery()); die;
|
||||
|
||||
$memberData = [];
|
||||
$dataForClientAndInsurer = [];
|
||||
@ -5540,15 +5755,15 @@ class ClientController extends AdminController
|
||||
// ->where('user_profiles.role', 3)
|
||||
// ->get()
|
||||
// ->getResultArray();
|
||||
|
||||
if(!empty($data) && count($data) > 0){
|
||||
|
||||
if (!empty($data) && count($data) > 0) {
|
||||
|
||||
$memberData = $this->employeeModel->getEmployeeByEmployeeCode($data['emp_code'], $client_policy_id, $client_id);
|
||||
$acms_datas = $this->employeeModel->getAcmUsingClientID($data['client_id']);
|
||||
// if(!empty($acms_datas)){
|
||||
// $acms = $acms_datas;
|
||||
// }
|
||||
}else{
|
||||
} else {
|
||||
$acms_datas = "";
|
||||
}
|
||||
|
||||
|
||||
@ -2088,6 +2088,7 @@ class EmpDataServiceController extends BaseController
|
||||
'base_premium' => $base_bremium_and_gst['base_premium'] ?? null,
|
||||
'gst' => $base_bremium_and_gst['gst'] ?? null,
|
||||
'policy_issue_date' => $policy_issue_date ?? null,
|
||||
'created_by' => $file['created_by'] ?? null,
|
||||
]]);
|
||||
|
||||
// $this->cashDepositCalculationForInception($depositeData);
|
||||
@ -2523,6 +2524,7 @@ class EmpDataServiceController extends BaseController
|
||||
'emp_count' => $emp_count ?? null,
|
||||
'action_type' => $file['event_type'] ?? null,
|
||||
'policy_issue_date' => $policy_issue_date ?? null,
|
||||
'created_by' => $file['created_by'] ?? null,
|
||||
]]);
|
||||
|
||||
|
||||
@ -3185,6 +3187,7 @@ class EmpDataServiceController extends BaseController
|
||||
'base_premium' => $base_bremium_and_gst['base_premium'] ?? null,
|
||||
'gst' => $base_bremium_and_gst['gst'] ?? null,
|
||||
'policy_issue_date' => $policy_issue_date ?? null,
|
||||
'created_by' => $file['created_by'] ?? null,
|
||||
]]);
|
||||
|
||||
}
|
||||
@ -3695,6 +3698,7 @@ class EmpDataServiceController extends BaseController
|
||||
'base_premium' => $base_bremium_and_gst['base_premium'] ?? null,
|
||||
'gst' => $base_bremium_and_gst['gst'] ?? null,
|
||||
'policy_issue_date' => $policy_issue_date ?? null,
|
||||
'created_by' => $file['created_by'] ?? null,
|
||||
]]);
|
||||
}
|
||||
|
||||
@ -4989,7 +4993,7 @@ class EmpDataServiceController extends BaseController
|
||||
'policy_no' => $policy_data['policy_no'] ?? null,
|
||||
'cd_ac_no' => $policy_data['cd_ac_no'] ?? null,
|
||||
'cd_ac_pk' => $policy_data['cd_ac_pk'] ?? null,
|
||||
'policy_issue_date' => $policy_data['policy_issue_date'] ?? null,
|
||||
'policy_issue_date' => $params['policy_issue_date'] ?? null,
|
||||
'policy_start_date' => $policy_data['policy_start_date'] ?? null,
|
||||
'policy_end_date' => $policy_data['policy_end_date'] ?? null,
|
||||
'data_received_date' => $policy_data['data_received_date'] ?? null,
|
||||
@ -5000,7 +5004,7 @@ class EmpDataServiceController extends BaseController
|
||||
'co_share' => $policy_data['co_share'] ?? 0,
|
||||
'pre_payable_by' => $policy_data['pre_payable_by'] ?? 1,
|
||||
'renewal_date' => $policy_data['policy_end_date'] ?? null,
|
||||
'month' => date('Y-m-01', strtotime($policy_data['policy_issue_date'] ?? "")) ?? null,
|
||||
'month' => date('Y-m-01', strtotime($params['policy_issue_date'] ?? "")) ?? null,
|
||||
'ct_type' => 1,
|
||||
'is_cd_reduce_from_bds' => 0,
|
||||
'client_type_id' => 0,
|
||||
@ -5015,6 +5019,7 @@ class EmpDataServiceController extends BaseController
|
||||
'source_client_policy_id' => $lead_data['source_policy_id'] ?? null,
|
||||
'tsi' => generate_tsi_code($lead_data['lead_type'] ?? 1) ?? null,
|
||||
'installment' => $lead_data['no_of_installment'] ?? null,
|
||||
'created_by' => $params['created_by'] ?? null,
|
||||
];
|
||||
|
||||
$this->myLogger->logme("error", "Constructed policy transaction data: " . json_encode($policyTransactionData));
|
||||
|
||||
@ -27,6 +27,7 @@ use App\Models\ClientDepositModel;
|
||||
use App\Models\PolicyPremium2Model;
|
||||
use App\Models\AuditHistoryModel;
|
||||
use App\Models\UserModel;
|
||||
use App\Models\PartnerEndorsementRequestModel;
|
||||
|
||||
|
||||
use App\Controllers\Jobs;
|
||||
@ -68,6 +69,7 @@ class EmployeeController extends AdminController
|
||||
protected $PolicyPremium2Model;
|
||||
protected $auditHistory;
|
||||
protected $userModel;
|
||||
protected $partnerEndorsementRequestModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -90,6 +92,7 @@ class EmployeeController extends AdminController
|
||||
$this->PolicyPremium2Model = new PolicyPremium2Model();
|
||||
$this->auditHistory = new AuditHistoryModel();
|
||||
$this->userModel = new userModel();
|
||||
$this->partnerEndorsementRequestModel = new PartnerEndorsementRequestModel();
|
||||
}
|
||||
|
||||
public function list()
|
||||
@ -1180,8 +1183,10 @@ class EmployeeController extends AdminController
|
||||
return $response;
|
||||
}
|
||||
|
||||
//E-CARD DOWNLOAD FUNCTION
|
||||
public function generateIDCardForEmployee($rand_string, $people = 0)
|
||||
// --------------- For E-Card Download -----------------------------------------------------------------------------------------------------
|
||||
|
||||
//E-CARD DOWNLOAD FUNCTION USING HTML PRINT
|
||||
public function generateIDCardForEmployeeUsingHtml($rand_string, $people = 0)
|
||||
{
|
||||
// dd($rand_string, $people);
|
||||
try {
|
||||
@ -1316,6 +1321,258 @@ class EmployeeController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
// Preview E-Card Template function
|
||||
public function previewTemplate($id = null)
|
||||
{
|
||||
$value = [
|
||||
'tpa_id' => 'TPA12345',
|
||||
'name' => 'John Doe',
|
||||
'uhid' => 'UHID67890',
|
||||
'gender' => 'Male',
|
||||
'dob' => '1985-05-15',
|
||||
'self' => 'John Doe',
|
||||
'policy_end_date' => '2024-12-31',
|
||||
'policy_start_date' => '2023-01-01',
|
||||
'policy_no' => 'POL1234567890',
|
||||
'insurer_name' => 'Example Insurance Company',
|
||||
'emp_code' => 'EMP001122',
|
||||
'client_name' => 'Corporate Client Inc.',
|
||||
'emp_age' => 39,
|
||||
'tpa_name' => 'Example TPA',
|
||||
'insurer_branch_city' => 'New York',
|
||||
'relationship' => 'Self',
|
||||
'basic_cover_si' => '5,00,000',
|
||||
];
|
||||
|
||||
$tpa_id = $this->TPAModel->where('id', $id)->first();
|
||||
|
||||
$template_data_path = WRITEPATH . 'e_card_template/';
|
||||
$tpa_short_name = strtolower(str_replace(' ', '_', $tpa_id['short_name'])) . '.html';
|
||||
$final_path = $template_data_path . $tpa_short_name;
|
||||
|
||||
if (!file_exists($final_path)) {
|
||||
|
||||
$data['message'] = 'Record Not Found';
|
||||
return view('errors/404', $data);
|
||||
}
|
||||
|
||||
$tmplt_data = file_get_contents($final_path);
|
||||
|
||||
$placeholders = [
|
||||
'{TPA_ID}' => $value['tpa_id'],
|
||||
'{NAME}' => $value['name'],
|
||||
'{UHID}' => $value['uhid'],
|
||||
'{GENDER}' => $value['gender'],
|
||||
'{DOB}' => date('d-M-Y', strtotime($value['dob'])),
|
||||
'{SELF_NAME}' => $value['self'] ?? $value['name'],
|
||||
'{POLICY_DATE}' => date('d-M-Y', strtotime($value['policy_end_date'])),
|
||||
'{POLICY_START_DATE}' => date('d-M-Y', strtotime($value['policy_start_date'])),
|
||||
'{POLICY_NO}' => $value['policy_no'],
|
||||
'{INSURER_NAME}' => strtoupper($value['insurer_name']),
|
||||
'{EMP_ID}' => $value['emp_code'],
|
||||
'{SI_AMT}' => $value['basic_cover_si'],
|
||||
'{CORPORATE_NAME}' => $value['client_name'],
|
||||
'{AGE}' => $value['emp_age'],
|
||||
'{TPA_NAME}' => $value['tpa_name'],
|
||||
'{INSURER_BRANCH}' => $value['insurer_branch_city'],
|
||||
'{RELATION}' => $value['relationship'],
|
||||
'{FRONT_CARD}' => base_url() . 'public/uploads/template_bg/' . $tpa_id['front_card'],
|
||||
'{BACK_CARD}' => base_url() . 'public/uploads/template_bg/' . $tpa_id['back_card'],
|
||||
'{TPA_LOGO}' => base_url() . 'public/uploads/logo/' . $tpa_id['tpa_logo'],
|
||||
'{INSURER_LOGO}' => base_url() . 'public/assets/images/sample_logo_3.png',
|
||||
'{MEDI_USER}' => base_url() . 'public/e_card_imgs/medi_uesr.jpg',
|
||||
'{MEDI_INSURER}' => base_url() . 'public/e_card_imgs/Magma.png',
|
||||
'{MEDI_BARCODE}' => base_url() . 'public/e_card_imgs/borcode.jpeg',
|
||||
'{QR_ANDROID}' => base_url() . 'public/e_card_imgs/android.png',
|
||||
'{QR_IOS}' => base_url() . 'public/e_card_imgs/ios.png',
|
||||
'{QR_ANDROID_2}' => base_url() . 'public/e_card_imgs/play_store.png',
|
||||
'{QR_IOS_2}' => base_url() . 'public/e_card_imgs/appstore.png',
|
||||
|
||||
];
|
||||
|
||||
$placeholders['{LEVELS}'] = '
|
||||
<span style="font-family: sans-serif;">Level 1</span><br><br>
|
||||
<span style="font-family: sans-serif;">1. Gowtham / 8754081806 / gowtham@gmail.com</span><br>
|
||||
<span style="font-family: sans-serif;">2. Gowtham / 8754081806 / gowtham@gmail.com</span><br><br>';
|
||||
|
||||
// dd($placeholders);
|
||||
|
||||
// Get the values to replace the placeholders
|
||||
$replaceValues = array_values($placeholders);
|
||||
|
||||
// Get the placeholders to search for
|
||||
$searchPlaceholders = array_keys($placeholders);
|
||||
|
||||
// Replace placeholders with values in HTML content
|
||||
$htmlContent = str_replace($searchPlaceholders, $replaceValues, $tmplt_data);
|
||||
|
||||
|
||||
echo $htmlContent;
|
||||
}
|
||||
|
||||
//E-CARD DOWNLOAD FUNCTION USING DOM PDF ( CURRENTLY USING THIS )
|
||||
public function generateIDCardForEmployee($rand_string, $people = 0, $mode = 0)
|
||||
{
|
||||
// dd($rand_string, $people);
|
||||
$this->myLogger->logme('error', 'generateIDCardForEmployee params .' . json_encode(["rand_string" => $rand_string, "people" => $people, "mode" => $mode]));
|
||||
try {
|
||||
$this->myLogger->logme('error', 'generateIDCardForEmployee function started.');
|
||||
|
||||
// Step 1: Attempt to fetch employee code and client policy ID
|
||||
$this->myLogger->logme('error', 'Fetching employee code and client policy ID.');
|
||||
|
||||
$get_emp_code_and_client_policy_id = $this->employeePolicyModel
|
||||
->select('employee_polices.client_policy_id, employees.emp_code, tpa.short_name,employees.client_id')
|
||||
->join('client_policy', 'client_policy.id = employee_polices.client_policy_id')
|
||||
->join('employees', 'employees.id = employee_polices.employee_id')
|
||||
->join('tpa', 'tpa.id = client_policy.tpa_id')
|
||||
->where('employees.emp_status', 'active')
|
||||
->where('employees.is_active', '1')
|
||||
->where("employee_polices.tpa_id IS NOT NULL AND employee_polices.tpa_id <> ''")
|
||||
->where('employee_polices.status', 'active')
|
||||
->where('employee_polices.is_active', '1')
|
||||
->where('employee_polices.rand_string', $rand_string)
|
||||
->first();
|
||||
|
||||
// dd($this->employeePolicyModel->getLastQuery());
|
||||
|
||||
// dd($rand_string, $get_emp_code_and_client_policy_id);
|
||||
|
||||
if ($get_emp_code_and_client_policy_id == null || $get_emp_code_and_client_policy_id == "") {
|
||||
$this->myLogger->logme('error', 'Member not found in this rand_string: ' . $rand_string);
|
||||
$data['message'] = 'Record Not Found';
|
||||
return view('errors/404', $data);
|
||||
}
|
||||
|
||||
$this->myLogger->logme('error', 'Member found. Client policy ID: ' . $get_emp_code_and_client_policy_id['client_policy_id']);
|
||||
|
||||
$client_policy_id = $get_emp_code_and_client_policy_id['client_policy_id'];
|
||||
$emp_code = $get_emp_code_and_client_policy_id['emp_code'];
|
||||
$client_id = $get_emp_code_and_client_policy_id['client_id'];
|
||||
|
||||
// Step 2: Fetch ECard data
|
||||
$this->myLogger->logme('error', 'Fetching ECard data using client_policy_id: ' . $client_policy_id . ' and emp_code: ' . $emp_code);
|
||||
$data = $this->employeePolicyModel->getECardDataUsingMd5($client_policy_id, $emp_code,$client_id);
|
||||
|
||||
if ($people == 0) {
|
||||
$this->myLogger->logme('error', 'Fetching single ECard data using rand_string: ' . $rand_string . ' and emp_code: ' . $emp_code);
|
||||
$data = $this->employeePolicyModel->getECardSingleData($rand_string, $emp_code,$client_id);
|
||||
}
|
||||
|
||||
// Step 3: Prepare template path
|
||||
$template_data_path = WRITEPATH . 'e_card_template/';
|
||||
// $tpa_short_name = strtolower(str_replace(' ', '_', $get_emp_code_and_client_policy_id['short_name'])) . '.html';
|
||||
$tpa_short_name = 'common.html';
|
||||
$final_path = $template_data_path . $tpa_short_name;
|
||||
|
||||
$this->myLogger->logme('error', 'Checking if template file exists at: ' . $final_path);
|
||||
|
||||
if (!file_exists($final_path)) {
|
||||
$this->myLogger->logme('error', 'Template file not found: ' . $final_path);
|
||||
$data['message'] = 'Template File Not Found';
|
||||
return view('errors/404', $data);
|
||||
}
|
||||
|
||||
$this->myLogger->logme('error', 'Template file found. Reading template data.');
|
||||
$tmplt_data = file_get_contents($final_path);
|
||||
|
||||
// Step 4: Generate HTML content
|
||||
$this->myLogger->logme('error', 'Generating HTML content from template.');
|
||||
$html = "";
|
||||
foreach ($data as $key => $value) {
|
||||
$htmlContent = $tmplt_data;
|
||||
|
||||
$value['front_card'] = "Nhance_Ecard_working_1_front.png";
|
||||
$value['back_card'] = "Nhance_Ecard_working_1_Back.png";
|
||||
|
||||
$placeholders = [
|
||||
'{CLIENT_NAME}' => $value['client_name'],
|
||||
'{TPA_ID}' => $value['tpa_id'],
|
||||
'{NAME}' => $value['name'],
|
||||
'{UHID}' => $value['uhid'],
|
||||
'{GENDER}' => $value['gender'],
|
||||
'{DOB}' => date('d-M-Y', strtotime($value['dob'])),
|
||||
'{SELF_NAME}' => $value['self'] ?? $value['name'],
|
||||
'{POLICY_DATE}' => date('d-M-Y', strtotime($value['policy_end_date'])),
|
||||
'{POLICY_START_DATE}' => date('d-M-Y', strtotime($value['policy_start_date'])),
|
||||
'{POLICY_NO}' => $value['policy_no'],
|
||||
'{INSURER_NAME}' => strtoupper($value['insurer_name']),
|
||||
'{INSURER_LOGO}' => base_url() . 'public/uploads/logo/' . $value['insurer_logo'],
|
||||
'{FRONT_CARD}' => base_url() . 'public/uploads/template_bg/' . $value['front_card'],
|
||||
'{BACK_CARD}' => base_url() . 'public/uploads/template_bg/' . $value['back_card'],
|
||||
'{EMP_ID}' => $value['emp_code'],
|
||||
'{SI_AMT}' => $value['basic_cover_si'],
|
||||
'{CORPORATE_NAME}' => $value['client_name'],
|
||||
'{AGE}' => $value['emp_age'],
|
||||
'{TPA_NAME}' => $value['tpa_name'],
|
||||
'{INSURER_BRANCH}' => $value['insurer_branch_city'],
|
||||
'{RELATION}' => $value['relationship'],
|
||||
'{TPA_LOGO}' => base_url() . 'public/uploads/logo/' . $value['tpa_logo'],
|
||||
'{MEDI_USER}' => base_url() . 'public/e_card_imgs/medi_uesr.jpg',
|
||||
'{MEDI_INSURER}' => base_url() . 'public/e_card_imgs/Magma.png',
|
||||
'{MEDI_BARCODE}' => base_url() . 'public/e_card_imgs/borcode.jpeg',
|
||||
'{QR_ANDROID}' => base_url() . 'public/e_card_imgs/android.png',
|
||||
'{QR_IOS}' => base_url() . 'public/e_card_imgs/ios.png',
|
||||
'{QR_ANDROID_2}' => base_url() . 'public/e_card_imgs/play_store.png',
|
||||
'{QR_IOS_2}' => base_url() . 'public/e_card_imgs/appstore.png',
|
||||
];
|
||||
|
||||
$placeholders['{LEVELS}'] = $this->generateAcmAndMForEcard($client_id);
|
||||
|
||||
foreach ($placeholders as $placeholder => $replaceValue) {
|
||||
$htmlContent = str_replace($placeholder, $replaceValue, $htmlContent);
|
||||
}
|
||||
|
||||
$html .= $htmlContent;
|
||||
}
|
||||
|
||||
// DomPdf
|
||||
$options = new Options();
|
||||
$options->set('isRemoteEnabled', true);
|
||||
$options->set('isHtml5ParserEnabled', true);
|
||||
|
||||
$dompdf = new Dompdf($options);
|
||||
$dompdf->loadHtml('<style>@page { margin: 0; }</style>' . $html); // remove the margin
|
||||
$dompdf->setPaper('A4', 'portrait');
|
||||
$dompdf->render();
|
||||
|
||||
// Set document title
|
||||
$dompdf->addInfo("Title", "E-Card");
|
||||
|
||||
$filename = 'ecard_' . date('Y-m-d_H-i-s') . '.pdf';
|
||||
|
||||
// if($mode == 1){
|
||||
// $dompdf->stream($filename, ['Attachment' => false]); // Inline view
|
||||
// }else{
|
||||
// $dompdf->stream($filename, ['Attachment' => true]); // Force download
|
||||
// }
|
||||
|
||||
if ($mode == 1) {
|
||||
// Inline view
|
||||
return $this->response
|
||||
->setHeader('Content-Type', 'application/pdf')
|
||||
->setHeader('Content-Disposition', 'inline; filename="' . $filename . '"')
|
||||
->setBody($dompdf->output());
|
||||
} else {
|
||||
// Force download
|
||||
return $this->response
|
||||
->setHeader('Content-Type', 'application/pdf')
|
||||
->setHeader('Content-Disposition', 'attachment; filename="' . $filename . '"')
|
||||
->setBody($dompdf->output());
|
||||
}
|
||||
|
||||
$this->myLogger->logme('error', 'generateIDCardForEmployee function completed successfully.');
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$this->myLogger->logme('error', 'Exception occurred: ' . $e->getMessage());
|
||||
$data['message'] = 'Record Not Found';
|
||||
return view('errors/404', $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public function viewECard()
|
||||
{
|
||||
|
||||
@ -1883,95 +2140,6 @@ class EmployeeController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
// Preview E-Card Template function
|
||||
public function previewTemplate($id = null)
|
||||
{
|
||||
$value = [
|
||||
'tpa_id' => 'TPA12345',
|
||||
'name' => 'John Doe',
|
||||
'uhid' => 'UHID67890',
|
||||
'gender' => 'Male',
|
||||
'dob' => '1985-05-15',
|
||||
'self' => 'John Doe',
|
||||
'policy_end_date' => '2024-12-31',
|
||||
'policy_start_date' => '2023-01-01',
|
||||
'policy_no' => 'POL1234567890',
|
||||
'insurer_name' => 'Example Insurance Company',
|
||||
'emp_code' => 'EMP001122',
|
||||
'client_name' => 'Corporate Client Inc.',
|
||||
'emp_age' => 39,
|
||||
'tpa_name' => 'Example TPA',
|
||||
'insurer_branch_city' => 'New York',
|
||||
'relationship' => 'Self',
|
||||
'basic_cover_si' => '5,00,000',
|
||||
];
|
||||
|
||||
$tpa_id = $this->TPAModel->where('id', $id)->first();
|
||||
|
||||
$template_data_path = WRITEPATH . 'e_card_template/';
|
||||
$tpa_short_name = strtolower(str_replace(' ', '_', $tpa_id['short_name'])) . '.html';
|
||||
$final_path = $template_data_path . $tpa_short_name;
|
||||
|
||||
if (!file_exists($final_path)) {
|
||||
|
||||
$data['message'] = 'Record Not Found';
|
||||
return view('errors/404', $data);
|
||||
}
|
||||
|
||||
$tmplt_data = file_get_contents($final_path);
|
||||
|
||||
$placeholders = [
|
||||
'{TPA_ID}' => $value['tpa_id'],
|
||||
'{NAME}' => $value['name'],
|
||||
'{UHID}' => $value['uhid'],
|
||||
'{GENDER}' => $value['gender'],
|
||||
'{DOB}' => date('d-M-Y', strtotime($value['dob'])),
|
||||
'{SELF_NAME}' => $value['self'] ?? $value['name'],
|
||||
'{POLICY_DATE}' => date('d-M-Y', strtotime($value['policy_end_date'])),
|
||||
'{POLICY_START_DATE}' => date('d-M-Y', strtotime($value['policy_start_date'])),
|
||||
'{POLICY_NO}' => $value['policy_no'],
|
||||
'{INSURER_NAME}' => strtoupper($value['insurer_name']),
|
||||
'{EMP_ID}' => $value['emp_code'],
|
||||
'{SI_AMT}' => $value['basic_cover_si'],
|
||||
'{CORPORATE_NAME}' => $value['client_name'],
|
||||
'{AGE}' => $value['emp_age'],
|
||||
'{TPA_NAME}' => $value['tpa_name'],
|
||||
'{INSURER_BRANCH}' => $value['insurer_branch_city'],
|
||||
'{RELATION}' => $value['relationship'],
|
||||
'{FRONT_CARD}' => base_url() . 'public/uploads/template_bg/' . $tpa_id['front_card'],
|
||||
'{BACK_CARD}' => base_url() . 'public/uploads/template_bg/' . $tpa_id['back_card'],
|
||||
'{TPA_LOGO}' => base_url() . 'public/uploads/logo/' . $tpa_id['tpa_logo'],
|
||||
'{INSURER_LOGO}' => base_url() . 'public/assets/images/sample_logo_3.png',
|
||||
'{MEDI_USER}' => base_url() . 'public/e_card_imgs/medi_uesr.jpg',
|
||||
'{MEDI_INSURER}' => base_url() . 'public/e_card_imgs/Magma.png',
|
||||
'{MEDI_BARCODE}' => base_url() . 'public/e_card_imgs/borcode.jpeg',
|
||||
'{QR_ANDROID}' => base_url() . 'public/e_card_imgs/android.png',
|
||||
'{QR_IOS}' => base_url() . 'public/e_card_imgs/ios.png',
|
||||
'{QR_ANDROID_2}' => base_url() . 'public/e_card_imgs/play_store.png',
|
||||
'{QR_IOS_2}' => base_url() . 'public/e_card_imgs/appstore.png',
|
||||
|
||||
];
|
||||
|
||||
$placeholders['{LEVELS}'] = '
|
||||
<span style="font-family: sans-serif;">Level 1</span><br><br>
|
||||
<span style="font-family: sans-serif;">1. Gowtham / 8754081806 / gowtham@gmail.com</span><br>
|
||||
<span style="font-family: sans-serif;">2. Gowtham / 8754081806 / gowtham@gmail.com</span><br><br>';
|
||||
|
||||
// dd($placeholders);
|
||||
|
||||
// Get the values to replace the placeholders
|
||||
$replaceValues = array_values($placeholders);
|
||||
|
||||
// Get the placeholders to search for
|
||||
$searchPlaceholders = array_keys($placeholders);
|
||||
|
||||
// Replace placeholders with values in HTML content
|
||||
$htmlContent = str_replace($searchPlaceholders, $replaceValues, $tmplt_data);
|
||||
|
||||
|
||||
echo $htmlContent;
|
||||
}
|
||||
|
||||
public function errorListExportImport($file_id)
|
||||
{
|
||||
|
||||
@ -2842,4 +3010,80 @@ class EmployeeController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Below function displays the endorsement list page.
|
||||
*
|
||||
* This method retrieves filter data from the request and fetches the endorsement list
|
||||
* based on the provided filters such as client ID, policy ID, and status.
|
||||
*/
|
||||
public function retailendorsementlist()
|
||||
{
|
||||
|
||||
$data = [];
|
||||
$data['status'] = ['open' => 'Open', 'inprogress' => 'In-Progress', 'complete' => 'Complete'];
|
||||
$data['client'] = $this->clientModel->select('clients.id,client_name,short_name')
|
||||
->where('clients.is_active',1)
|
||||
->where('clients.client_type',2)
|
||||
->findAll();
|
||||
$data['insurer'] = $this->insurerModel->select('insurers.id,name,short_name')
|
||||
->where('insurers.is_active',1)
|
||||
->findAll();
|
||||
// if (count($this->request->getGet())) {
|
||||
$filterData = $this->request->getGet();
|
||||
$data['employees'] = $this->partnerEndorsementRequestModel->getRetailEndorsementList(
|
||||
client_id: $filterData['client_id'] ?? null,
|
||||
insurers_id: $filterData['insurer_id'] ?? null,
|
||||
status: $filterData['status'] ?? null
|
||||
);
|
||||
|
||||
$data['getData'] = $filterData;
|
||||
// echo "<pre>";
|
||||
// print_r($data); die;
|
||||
// }
|
||||
|
||||
$this->loadLayout('retail_endorsement_list', $data);
|
||||
}
|
||||
|
||||
public function retailendorsementsave()
|
||||
{
|
||||
try {
|
||||
$data = $this->request->getPost();
|
||||
if (!empty($data['id'])) {
|
||||
$text = "update";
|
||||
$updateID = $data['id'];
|
||||
$result = $this->partnerEndorsementRequestModel->where('id', $updateID)->set($data)->update();
|
||||
} else {
|
||||
$text = "create";
|
||||
$data['created_by'] = get_session_userid();
|
||||
$this->thzMasterModel->insert($data);
|
||||
$insertID = $this->partnerEndorsementRequestModel->insertID();
|
||||
$result = true;
|
||||
}
|
||||
|
||||
$id = isset($insertID) && !empty($insertID) ? $insertID : $updateID;
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => $result ? 'success' : 'error',
|
||||
'message' => $result ? "Partner Endorsement Request {$text}d successfully " : "Unable to {$text} Partner Endorsement Request. Please try again.",
|
||||
])->setStatusCode($result ? 200 : 400);
|
||||
} catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
|
||||
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
|
||||
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => 'error',
|
||||
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ use CodeIgniter\API\ResponseTrait;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Controllers\EmployeeServiceController;
|
||||
|
||||
use App\Models\ClaimFilesModel;
|
||||
use Kreait\Firebase\Factory;
|
||||
use Kreait\Firebase\Messaging\CloudMessage;
|
||||
use Kreait\Firebase\Messaging\Notification;
|
||||
@ -2622,9 +2622,38 @@ class EmployeeRestController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $this->respond(['status' => (count($data) ? 'success' : 'failed'),'code' => (count($data) ? 200 : 404),'data' => $data ], 200);
|
||||
$ticketMesssageModel = new TicketMessageModel();
|
||||
$ticket_message = $ticketMesssageModel
|
||||
->where('is_active', 1)
|
||||
->where('sender', "user")
|
||||
->where('ticket_id', $ticket_id)
|
||||
->orderBy('id', "desc")
|
||||
->first();
|
||||
|
||||
$claim_file_urls = [];
|
||||
|
||||
if (isset($ticket_message['id'])) {
|
||||
|
||||
$claimFiles = new ClaimFilesModel();
|
||||
$claim_files_data = $claimFiles
|
||||
->select('id as claim_file_id, doc_name as claim_file_name')
|
||||
->where('is_active', 1)
|
||||
->where('file_type', 2)
|
||||
->where('ticket_id', $ticket_id)
|
||||
->where('ticket_message_id', $ticket_message['id'])
|
||||
->findAll();
|
||||
|
||||
foreach ($claim_files_data as &$value) {
|
||||
$value['url'] = base_url('downloadClaimFile/') . $value['claim_file_id'];
|
||||
$claim_file_urls[] = $value;
|
||||
}
|
||||
unset($value);
|
||||
}
|
||||
|
||||
$data['claim_files'] = $claim_file_urls;
|
||||
|
||||
return $this->respond(['status' => (count($data) ? 'success' : 'failed'),'code' => (count($data) ? 200 : 404),'data' => $data, ], 200);
|
||||
}
|
||||
|
||||
|
||||
@ -2820,18 +2849,29 @@ class EmployeeRestController extends AdminController
|
||||
{
|
||||
$policyGroup = 'gpa';
|
||||
$data['ticket_type_id'] = 2;
|
||||
$data['claim_subject'] = "Claim GPA";
|
||||
$data['sum_insured_label'] = "Sum Assured";
|
||||
|
||||
}else if($ClientPolicyValue['policy_type_id'] == 6)
|
||||
{
|
||||
$policyGroup = 'gpa';
|
||||
$data['ticket_type_id'] = 3;
|
||||
$data['claim_subject'] = "Claim EDLI";
|
||||
$data['sum_insured_label'] = "Sum Assured";
|
||||
|
||||
}else if($ClientPolicyValue['policy_type_id'] == 7)
|
||||
{
|
||||
$policyGroup = 'gpa';
|
||||
$data['ticket_type_id'] = 4;
|
||||
$data['claim_subject'] = "Claim GTLI";
|
||||
$data['sum_insured_label'] = "Sum Assured";
|
||||
|
||||
}else
|
||||
{
|
||||
$policyGroup = 'gmc';
|
||||
$data['ticket_type_id'] = 1;
|
||||
$data['claim_subject'] = "Claim GMC";
|
||||
$data['sum_insured_label'] = "Sum Insured";
|
||||
}
|
||||
|
||||
$terms = json_decode($ClientPolicyValue['policy_terms'] , true);
|
||||
@ -3406,11 +3446,20 @@ class EmployeeRestController extends AdminController
|
||||
{
|
||||
|
||||
$received_data = $this->request->getPost();
|
||||
// print_r($received_data); die;
|
||||
$this->myLogger->logme('error', 'API claim initiate Recevied Params :' . json_encode($received_data ?? []));
|
||||
$get_file_data = $this->request->getFiles('claim_docs');
|
||||
// print_r($get_file_data); die;
|
||||
$employee_id = $received_data['emp_id'];
|
||||
$client_policy_id = $received_data['client_policy_id'];
|
||||
$insured_emp_id = $received_data['insured_emp_id'];
|
||||
|
||||
$file_data = [];
|
||||
if(isset($get_file_data) && !empty($get_file_data)){
|
||||
$file_path = WRITEPATH . 'uploads/claim_files/';
|
||||
$file_data = multi_file_Upload($get_file_data, $file_path);
|
||||
}
|
||||
|
||||
|
||||
if (empty($received_data['doa'])) {
|
||||
$received_data['doa'] = null;
|
||||
} else{
|
||||
@ -3503,11 +3552,14 @@ class EmployeeRestController extends AdminController
|
||||
'mail_content' => $fetchData['message'] ?? "New Claim",
|
||||
];
|
||||
|
||||
$ticket_message_id = null;
|
||||
if (!empty($messagesData['ticket_id'])) {
|
||||
$TicketMessageModel = new TicketMessageModel();
|
||||
$TicketMessageModel->insert($messagesData);
|
||||
$ticket_message_id = $TicketMessageModel->insert($messagesData);
|
||||
}
|
||||
|
||||
$this->handleCliamFiles($file_data, $ticket_id, $ticket_message_id);
|
||||
|
||||
$mail_sent_status = ($this->ticketController->sendAutoMailTrigger($ticket_id));
|
||||
if (gettype($mail_sent_status) == 'array') {
|
||||
$message = 'Claim Iniated Successfully';
|
||||
@ -3544,15 +3596,132 @@ class EmployeeRestController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function handleCliamFiles($data, $ticket_id, $ticket_message_id)
|
||||
{
|
||||
if(!empty($data) && !empty($ticket_id))
|
||||
{
|
||||
$insert_ids = [];
|
||||
$claim_file = new ClaimFilesModel();
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
$data = [
|
||||
'ticket_id' => $ticket_id,
|
||||
'doc_name' => $value['file_name'],
|
||||
'url' => $value['file_path'],
|
||||
'file_type' => 2,
|
||||
'ticket_message_id' => $ticket_message_id,
|
||||
];
|
||||
|
||||
$insert_ids[] = $claim_file->insert($data);
|
||||
}
|
||||
|
||||
return $insert_ids;
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
//department
|
||||
// public function get_ticket_type()
|
||||
// {
|
||||
// $ticket_type = $this->ticketController->ticketType;
|
||||
// $ticket_type = array_map(fn($value, $key) => (object) ['id' => $key, 'name' => $value], array_values($ticket_type), array_keys($ticket_type));
|
||||
// // print_r($ticket_type); die;
|
||||
// return $this->response->setJSON(['ticket_type' => $ticket_type])->setStatusCode(200);
|
||||
// }
|
||||
|
||||
public function get_ticket_type()
|
||||
{
|
||||
$ticket_type = $this->ticketController->ticketType;
|
||||
$ticket_type = array_map(fn($value, $key) => (object) ['id' => $key, 'name' => $value], array_values($ticket_type), array_keys($ticket_type));
|
||||
// print_r($ticket_type); die;
|
||||
return $this->response->setJSON(['ticket_type' => $ticket_type])->setStatusCode(200);
|
||||
try {
|
||||
|
||||
$client_id = $this->request->getGet('client_id');
|
||||
$emp_code = $this->request->getGet('emp_code');
|
||||
|
||||
if (empty($client_id) || empty($emp_code)) {
|
||||
|
||||
$this->myLogger->logme('error', "Missing required parameters: client_id={$client_id}, emp_code={$emp_code}");
|
||||
// return $this->response->setJSON([
|
||||
// 'status' => false,
|
||||
// 'code' => 400,
|
||||
// 'message' => 'client_id and emp_code are required'
|
||||
// ])->setStatusCode(400);
|
||||
|
||||
$ticket_type = $this->ticketController->ticketType;
|
||||
$ticket_type = array_map(fn($value, $key) => (object) ['id' => $key, 'name' => $value], array_values($ticket_type), array_keys($ticket_type));
|
||||
return $this->response->setJSON(['ticket_type' => $ticket_type])->setStatusCode(200);
|
||||
}
|
||||
|
||||
// Get policy type ids
|
||||
$policy_type_ids = $this->employeePolicyModel
|
||||
->select('client_policy.policy_type_id')
|
||||
->join('employees', 'employee_polices.employee_id = employees.id')
|
||||
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id')
|
||||
->where('employees.is_active', 1)
|
||||
->whereIn('employees.emp_status', ['active', 'expired'])
|
||||
->where('employee_polices.is_active', 1)
|
||||
->whereIn('employee_polices.status', ['active', 'expired'])
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->groupBy('employee_polices.client_policy_id')
|
||||
->findAll();
|
||||
|
||||
if (!$policy_type_ids) {
|
||||
$this->myLogger->logme('error', "No policy types found for client_id={$client_id}, emp_code={$emp_code}");
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'code' => 404,
|
||||
'message' => 'No policy types found'
|
||||
])->setStatusCode(404);
|
||||
}
|
||||
|
||||
$this->myLogger->logme('info', "Policy type IDs fetched: " . json_encode($policy_type_ids));
|
||||
|
||||
$ticket_type = $this->ticketController->ticketType;
|
||||
$filtered = [];
|
||||
|
||||
$mapping = [
|
||||
2 => 1,
|
||||
3 => 1,
|
||||
4 => 1,
|
||||
5 => 1,
|
||||
1 => 2,
|
||||
6 => 3,
|
||||
7 => 4,
|
||||
];
|
||||
|
||||
foreach ($policy_type_ids as $value) {
|
||||
$ticketTypeId = $value['policy_type_id'] ?? null;
|
||||
|
||||
if (isset($mapping[$ticketTypeId]) && isset($ticket_type[$mapping[$ticketTypeId]])) {
|
||||
$mappedId = $mapping[$ticketTypeId];
|
||||
$mappedName = $ticket_type[$mappedId];
|
||||
|
||||
// Use mappedId as key to avoid duplicates
|
||||
$filtered[$mappedId] = [
|
||||
'id' => $mappedId,
|
||||
'name' => $mappedName
|
||||
];
|
||||
|
||||
$this->myLogger->logme('info', "Ticket type resolved: ID={$ticketTypeId}, Name={$mappedName}");
|
||||
} else {
|
||||
$this->myLogger->logme('warning', "No valid ticket type mapping for policy_type_id={$ticketTypeId}");
|
||||
}
|
||||
}
|
||||
|
||||
$filtered = array_values($filtered);
|
||||
return $this->response->setJSON(['status' => true,'code' => 200, 'ticket_type' => $filtered ])->setStatusCode(200);
|
||||
|
||||
} catch (\Throwable $e) {
|
||||
$this->myLogger->logme('error', "Error in get_ticket_type: " . $e->getMessage() . " Trace: " . $e->getTraceAsString());
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'code' => 500,
|
||||
'message' => 'Internal Server Error'
|
||||
])->setStatusCode(500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//ticket data
|
||||
public function get_ticket_data()
|
||||
{
|
||||
@ -3566,6 +3735,10 @@ class EmployeeRestController extends AdminController
|
||||
$emp_id = $this->request->getGet('emp_id');
|
||||
$ticket_type = $this->request->getGet('ticket_type') ?? null;
|
||||
$ticket_id = $this->request->getGet('ticket_id') ?? null;
|
||||
$request = \Config\Services::request();
|
||||
$uri = $request->uri->getPath();
|
||||
$returnType = "";
|
||||
// $returnType = (strpos($uri, 'api') !== false) ? 'api' : 'web';
|
||||
// dd($emp_id);
|
||||
|
||||
if (empty($emp_id)) {
|
||||
@ -3573,7 +3746,7 @@ class EmployeeRestController extends AdminController
|
||||
}
|
||||
|
||||
$TicketMasterModel = new TicketMasterModel();
|
||||
$ticket_data = $TicketMasterModel->get_ticket_data($emp_id, $ticket_type, $ticket_id);
|
||||
$ticket_data = $TicketMasterModel->get_ticket_data($emp_id, $returnType, $ticket_type, $ticket_id);
|
||||
|
||||
if (!empty($ticket_data)) {
|
||||
|
||||
@ -3589,6 +3762,7 @@ class EmployeeRestController extends AdminController
|
||||
];
|
||||
|
||||
foreach ($ticket_data as $key => $value) {
|
||||
|
||||
foreach ($client_claim_status as $claim_key => $claim_value) {
|
||||
if (in_array($value['claim_status_id'], $claim_value)) { // Corrected argument order
|
||||
$ticket_data[$key]['claim_status'] = $claim_key ?? null; // Assign back to the main array
|
||||
@ -3603,6 +3777,29 @@ class EmployeeRestController extends AdminController
|
||||
}
|
||||
$ticket_data[$key]['claim_type_value'] = $claimType[$claimPrimaryTypey][$value['claim_type']] ?? null;
|
||||
$ticket_data[$key]['ticket_policy_type'] = $ticketTypeArray[$value['ticket_type_id']] ?? null;
|
||||
|
||||
$claim_file_urls = [];
|
||||
|
||||
if (isset($value['ticket_message_id'])) {
|
||||
|
||||
$claimFiles = new ClaimFilesModel();
|
||||
$claim_files_data = $claimFiles
|
||||
->select('id as claim_file_id, doc_name as claim_file_name')
|
||||
->where('is_active', 1)
|
||||
->where('file_type', 2)
|
||||
->where('ticket_id', $value['id'])
|
||||
->where('ticket_message_id', $value['ticket_message_id'])
|
||||
->findAll();
|
||||
|
||||
foreach ($claim_files_data as &$value) {
|
||||
$value['url'] = base_url('downloadClaimFile/') . $value['claim_file_id'];
|
||||
$claim_file_urls[] = $value;
|
||||
}
|
||||
unset($value);
|
||||
}
|
||||
|
||||
// always set the key (empty if no files found)
|
||||
$ticket_data[$key]['claim_files'] = $claim_file_urls;
|
||||
|
||||
}
|
||||
}
|
||||
@ -3653,6 +3850,11 @@ class EmployeeRestController extends AdminController
|
||||
], 200);
|
||||
}
|
||||
|
||||
public function getClaimFiles()
|
||||
{
|
||||
$ticket_id = $this->request->getGet('ticket_id');
|
||||
}
|
||||
|
||||
// public function getPreEmployeePolicyCount($mobile_no, $clientId = null)
|
||||
// {
|
||||
// log_message('error', 'getPreEmployeePolicyCount called with params : ' . json_encode(['mobile_no' => $mobile_no, 'client_id' => $clientId], true));
|
||||
|
||||
@ -1702,6 +1702,15 @@ class EmployeeServiceController extends AdminController
|
||||
$value['relationship'] = ucfirst(trim($value['relationship']));
|
||||
if(count($employee))
|
||||
{
|
||||
if (isset($employee[0]['email_corporate']) && $employee[0]['email_corporate'] != '')
|
||||
{
|
||||
unset($value['email_corporate']);
|
||||
}
|
||||
|
||||
if (isset($employee[0]['mobile']) && $employee[0]['mobile'] != '')
|
||||
{
|
||||
unset($value['mobile']);
|
||||
}
|
||||
$value['updated_by'] = $file['created_by'];
|
||||
$value['id'] = $employee[0]['id'];
|
||||
$value['emp_status'] = 'active';
|
||||
|
||||
@ -57,8 +57,8 @@ class Home extends PublicController
|
||||
$data['gemini_response'] = 'An error occurred: ' . $e->getMessage();
|
||||
}
|
||||
|
||||
print_rr($data);
|
||||
}
|
||||
//print_rr($data);
|
||||
}
|
||||
|
||||
public function check_gemini_2()
|
||||
{
|
||||
@ -78,8 +78,9 @@ class Home extends PublicController
|
||||
$filePath = 'C:/Users/Venba/Desktop/ins stmts/NIC MDU June-2025 (1).pdf';
|
||||
$filePath = 'C:/Users/Venba/Desktop/ins stmts/UIIC GR June-2025.pdf';
|
||||
$filePath = 'C:/Users/Venba/Desktop/ins stmts/UIIC VLR June-2025 (2).xlsx';
|
||||
$filePath = 'C:/Users/Venba/Desktop/ins stmts/pdf/2.pdf';
|
||||
$filePath = 'C:\Users\Venba\Downloads\Raheja June-2025.csv';
|
||||
$filePath = 'C:/Users/Venba/Desktop/ins stmts/pdf/1.pdf';
|
||||
$filePath = 'C:/Users/Venba/Desktop/ins stmts/output.csv';
|
||||
// $filePath = 'C:\Users\Venba\Downloads\Raheja June-2025.csv';
|
||||
// $filePath = 'C:/Users/Venba/Downloads/Raheja June-2025.pdf';
|
||||
// $filePath = 'C:/Users/Venba/Desktop/ins stmts/ICICI Pru June-2025 (1).xlsx';
|
||||
// $filePath = 'C:/Users/Venba/Desktop/ins stmts/Digit Life June-2025.xlsx';
|
||||
@ -102,7 +103,7 @@ class Home extends PublicController
|
||||
$base64Content = base64_encode($fileContent);
|
||||
// The prompt you want to send to the model
|
||||
$prompt = "give me a json with emp data like name,age,dob,mobile and email. only json not any explanations";
|
||||
$prompt = "Read the following insurer monthly statement file and convert into JSON format as sample specified.attach statement items in 'items' key and if any other data available put it in 'meta'. Give me only JSON,not any explanations. If you find the same details like insured name, policy number,endorsement no,policy start date,policy end date group it as single policy and identify base premium, third party premium and terrorism premium.";
|
||||
$prompt = "Read the following insurer monthly statement file and convert into JSON format as sample specified.attach statement items in 'items' key and if any other data available put it in 'meta'. Give me only JSON,not any explanations. If you find the same details like insured name, policy number,endorsement no,policy start date,policy end date group it as single policy and identify base premium, third party premium and terrorism premium.All brokerage amount may in the same name as brokerage or commission, so pick accordingly";
|
||||
$prompt .= "{\'items\': [{\'sno\': 1, \'policy_no\': \'\', \'insured_name\': \'\', \'endorsement_no\': \'\', \'policy_start_date\': \'\', \'policy_end_date\': \'\', \'actual_base_premium_amount\': \'\', \'actual_third_party_premium_amount\': \'\', \'actual_terrorism_premium_amount\': \'\', \'actual_base_premium_percentage\': \'\', \'actual_third_party_premium_percentage\': \'\', \'actual_terrorism_premium_percentage\': \'\', \'actual_bp_brokerage_amount\': \'\', \'actual_tp_brokerage_amount\': \'\', \'actual_tep_brokerage_amount\': \'\', \'reward_amount\': \'\'}]}";
|
||||
|
||||
$payloadPart = null;
|
||||
@ -270,6 +271,7 @@ public function convertToPdf($inputFile = null)
|
||||
{
|
||||
// 1. Load your Excel file
|
||||
$inputFile = 'C:/Users/Venba/Desktop/ins stmts/Raheja June-2025.xlsx';
|
||||
$inputFile = 'C:/Users/Venba/Desktop/ins stmts/ICICI Lom June-2025.xlsx';
|
||||
// $inputFile = 'C:/Users/Venba/Desktop/ins stmts/pdf/sample.pdf';
|
||||
$spreadsheet = IOFactory::load($inputFile);
|
||||
|
||||
@ -293,7 +295,7 @@ public function convertToPdf($inputFile = null)
|
||||
$mpdf->AddPage();
|
||||
$mpdf->WriteHTML($html);
|
||||
}
|
||||
$pdfPath = 'C:/Users/Venba/Desktop/ins stmts/pdf/2.pdf';
|
||||
$pdfPath = 'C:/Users/Venba/Desktop/ins stmts/pdf/1.pdf';
|
||||
// $pdfPath = WRITEPATH.'tmp';
|
||||
$mpdf->Output($pdfPath, \Mpdf\Output\Destination::FILE); // Save file on server
|
||||
// 4. Output
|
||||
|
||||
@ -1894,6 +1894,8 @@ class MasterController extends AdminController
|
||||
'cache' => WRITEPATH . 'cache',
|
||||
'sample_import_excel' => ROOTPATH . 'public/sample_import_excel',
|
||||
'lead_files' => WRITEPATH . 'uploads/lead_files/',
|
||||
'claim_files' => WRITEPATH . 'uploads/claim_files/',
|
||||
'claim_dump_excel' => WRITEPATH . 'uploads/claim_dump_excel/',
|
||||
'claim_sample_forms' => ROOTPATH . 'public/claim_sample_forms/',
|
||||
];
|
||||
|
||||
|
||||
@ -87,6 +87,8 @@ class NotificationController extends AdminController
|
||||
'client_hr_summary_mail_btn'
|
||||
];
|
||||
$data = [];
|
||||
$emptyTemplate = [];
|
||||
$updatedTemplate = [];
|
||||
|
||||
foreach ($checkboxNames as $checkboxName)
|
||||
{
|
||||
@ -111,9 +113,31 @@ class NotificationController extends AdminController
|
||||
$id = $find['id'];
|
||||
$changeData['enabled']= $value;
|
||||
$update = $notificationModel->update($id, $changeData);
|
||||
$updatedTemplate [] = $key;
|
||||
}
|
||||
|
||||
if(!$find && $value == 1){
|
||||
$emptyTemplate [] = $key;
|
||||
}
|
||||
}
|
||||
return json_encode("true");
|
||||
|
||||
if(count($emptyTemplate) > 0){
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'code' => 400,
|
||||
'message' => 'Notification settings updation Failed.',
|
||||
'updated_templates' => $updatedTemplate,
|
||||
'empty_templates' => $emptyTemplate
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => true,
|
||||
'code' => 200,
|
||||
'message' => 'Notification settings updated successfully.',
|
||||
'updated_templates' => $updatedTemplate,
|
||||
'empty_templates' => $emptyTemplate
|
||||
]);
|
||||
}
|
||||
|
||||
// This for Load the Template Data for in View Page
|
||||
|
||||
@ -383,7 +383,12 @@ class PolicyTransactionController extends BaseController
|
||||
}
|
||||
|
||||
$client_data = $this->clientModel->where('id', $data['client_id'])->first();
|
||||
$data['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $data['client_id'])->findAll();
|
||||
$data['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $data['client_id'])->findAll();
|
||||
|
||||
$clientController = new ClientController();
|
||||
$data['client_kyc_primary_table'] = $clientController->generateKycPrimaryTable($data['client_id']);
|
||||
$data['client_kyc_other_table'] = $clientController->generateKycOthersTable($data['client_id']);
|
||||
|
||||
$data['entity_type_id'] = $client_data['entity_type_id'];
|
||||
|
||||
return $this->respondSuccess($insert, "Policy transaction created successfully", $data);
|
||||
@ -433,6 +438,11 @@ class PolicyTransactionController extends BaseController
|
||||
|
||||
$client_data = $this->clientModel->where('id', $data['client_id'])->first();
|
||||
$data['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $data['client_id'])->findAll();
|
||||
|
||||
$clientController = new ClientController();
|
||||
$data['client_kyc_primary_table'] = $clientController->generateKycPrimaryTable($data['client_id']);
|
||||
$data['client_kyc_other_table'] = $clientController->generateKycOthersTable($data['client_id']);
|
||||
|
||||
$data['entity_type_id'] = $client_data['entity_type_id'];
|
||||
|
||||
return $this->respondSuccess($id, "Policy transaction updated successfully", $data);
|
||||
@ -977,7 +987,12 @@ class PolicyTransactionController extends BaseController
|
||||
->join('employee_polices', 'employees.id = employee_polices.employee_id', 'left')
|
||||
->where('employees.client_id', $data['client_id'])
|
||||
->where('employees.is_active', 1)->findAll();
|
||||
$data['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $data['client_id'])->findAll();
|
||||
// $data['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $data['client_id'])->findAll();
|
||||
|
||||
$clientController = new ClientController();
|
||||
$data['client_kyc_primary_table'] = $clientController->generateKycPrimaryTable($data['client_id']);
|
||||
$data['client_kyc_other_table'] = $clientController->generateKycOthersTable($data['client_id']);
|
||||
|
||||
$data['vehicle_docs'] = $this->clientKYCDocsModel
|
||||
->where('client_id', $data['client_id'])
|
||||
->where('vehicle_id', $data['vehicle_id'])
|
||||
|
||||
@ -3,12 +3,21 @@
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\EmployeePolicyModel;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
use Dompdf\Dompdf;
|
||||
use Dompdf\Options;
|
||||
|
||||
class TestingController extends BaseController
|
||||
{
|
||||
use ResponseTrait;
|
||||
protected $myLogger;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->myLogger = \Config\Services::mylogger();
|
||||
}
|
||||
|
||||
public function saveForm()
|
||||
{
|
||||
@ -22,4 +31,209 @@ class TestingController extends BaseController
|
||||
'data' => $data
|
||||
]);
|
||||
}
|
||||
|
||||
public function testcli()
|
||||
{
|
||||
echo "hi";
|
||||
$this->myLogger->logme('error', "test log");
|
||||
echo "hi 2";
|
||||
log_message('error', 'test message for log_message_function');
|
||||
echo "hi 3";
|
||||
}
|
||||
|
||||
|
||||
public function generatePDF()
|
||||
{
|
||||
// Sample data - replace with your actual data source
|
||||
$data = [
|
||||
'NAME' => 'John Doe',
|
||||
'GENDER' => 'Male',
|
||||
'DOB' => '01/01/1990',
|
||||
'RELATION' => 'Self',
|
||||
'POLICY_NO' => 'POL123456789',
|
||||
'TPA_ID' => 'TPA987654321',
|
||||
'POLICY_START_DATE' => '01/01/2024',
|
||||
'POLICY_DATE' => '31/12/2024',
|
||||
'INSURER_NAME' => 'ABC Insurance Co.',
|
||||
'TPA_NAME' => 'XYZ TPA Ltd.',
|
||||
'FRONT_CARD' => base_url('assets/images/front-card.jpg'), // Your card images
|
||||
'BACK_CARD' => base_url('assets/images/back-card.jpg'),
|
||||
'LEVELS' => 'Level 1: 1800-XXX-XXXX<br>Level 2: support@company.com'
|
||||
];
|
||||
|
||||
// Load the HTML template
|
||||
$html = $this->loadTemplate($data);
|
||||
|
||||
// Configure DomPDF options
|
||||
$options = new Options();
|
||||
$options->set('isRemoteEnabled', true); // Enable loading of remote images
|
||||
$options->set('isHtml5ParserEnabled', true);
|
||||
$options->set('isPhpEnabled', true);
|
||||
$options->set('debugPng', false);
|
||||
$options->set('debugKeepTemp', false);
|
||||
$options->set('debugCss', false);
|
||||
$options->set('debugLayout', false);
|
||||
$options->set('debugLayoutLines', false);
|
||||
$options->set('debugLayoutBlocks', false);
|
||||
$options->set('debugLayoutInline', false);
|
||||
$options->set('debugLayoutPaddingBox', false);
|
||||
|
||||
// Initialize DomPDF
|
||||
$dompdf = new Dompdf($options);
|
||||
|
||||
// Load HTML content
|
||||
$dompdf->loadHtml($html);
|
||||
|
||||
// Set paper size and orientation
|
||||
$dompdf->setPaper('A4', 'landscape'); // or 'portrait'
|
||||
|
||||
// Render PDF
|
||||
$dompdf->render();
|
||||
|
||||
// Output PDF to browser
|
||||
$filename = 'ecard_' . date('Y-m-d_H-i-s') . '.pdf';
|
||||
$dompdf->stream($filename, ['Attachment' => true]); // Set to false for inline view
|
||||
}
|
||||
|
||||
public function viewPDF()
|
||||
{
|
||||
// Same as generatePDF but with inline view
|
||||
$data = [
|
||||
'NAME' => 'Korukonda Naga Venkata Ramalinga Satya Swarna Kumari',
|
||||
'GENDER' => 'Male',
|
||||
'DOB' => '01/01/1990',
|
||||
'RELATION' => 'Self',
|
||||
'POLICY_NO' => '97000034230400000109_EX_Parental',
|
||||
'TPA_ID' => 'TPA987654321',
|
||||
'POLICY_START_DATE' => '01/01/2024',
|
||||
'POLICY_DATE' => '31/12/2024',
|
||||
'INSURER_NAME' => 'ZURICH KOTAK GTNERAL INSURANCE COIIPANY lNDlA LIMITED',
|
||||
'TPA_NAME' => 'HealthIndia Insurance TPA Services Pvt. Ltd.',
|
||||
'FRONT_CARD' => base_url() .('public/uploads/template_bg/Nhance_Ecard_working_1_front_3.png'),
|
||||
'BACK_CARD' => base_url() . ('public/uploads/template_bg/Nhance_Ecard_working_1_Back_3.png'),
|
||||
'LEVELS' => 'Level 1: 1800-XXX-XXXX<br>Level 2: support@company.com'
|
||||
];
|
||||
|
||||
$data2 = [
|
||||
'NAME' => 'John Doe',
|
||||
'GENDER' => 'Male',
|
||||
'DOB' => '01/01/1990',
|
||||
'RELATION' => 'Self',
|
||||
'POLICY_NO' => 'POL123456789',
|
||||
'TPA_ID' => 'TPA987654321',
|
||||
'POLICY_START_DATE' => '01/01/2024',
|
||||
'POLICY_DATE' => '31/12/2024',
|
||||
'INSURER_NAME' => 'ABC Insurance Co.',
|
||||
'TPA_NAME' => 'XYZ TPA Ltd.',
|
||||
'FRONT_CARD' => base_url() .('public/uploads/template_bg/Nhance_Ecard_working_1_front_3.png'),
|
||||
'BACK_CARD' => base_url() . ('public/uploads/template_bg/Nhance_Ecard_working_1_Back_3.png'),
|
||||
'LEVELS' => 'Level 1: 1800-XXX-XXXX<br>Level 2: support@company.com'
|
||||
];
|
||||
|
||||
$employeeController = new EmployeeController();
|
||||
// $html = $employeeController->generateIDCardForEmployeeUsingDom('LfpH3R');
|
||||
$html = $this->loadTemplate($data2);
|
||||
// print_r($html); die;
|
||||
$options = new Options();
|
||||
$options->set('isRemoteEnabled', true);
|
||||
$options->set('isHtml5ParserEnabled', true);
|
||||
|
||||
$dompdf = new Dompdf($options);
|
||||
// $dompdf->loadHtml($html);
|
||||
$dompdf->loadHtml('<style>@page { margin: 0; }</style>' . $html);
|
||||
$dompdf->setPaper('A4', 'portrait');
|
||||
// $dompdf->setPaper('A4', 'landscape');
|
||||
$dompdf->render();
|
||||
|
||||
$filename = 'ecard_' . date('Y-m-d_H-i-s') . '.pdf';
|
||||
// $dompdf->stream($filename, ['Attachment' => true]); // Inline view
|
||||
$dompdf->stream($filename, ['Attachment' => false]); // Force download
|
||||
|
||||
}
|
||||
|
||||
private function loadTemplate($data)
|
||||
{
|
||||
// Load your HTML template
|
||||
$template = file_get_contents(WRITEPATH . 'e_card_template/common.html');
|
||||
|
||||
// Replace placeholders with actual data
|
||||
foreach ($data as $key => $value) {
|
||||
$template = str_replace('{' . $key . '}', $value, $template);
|
||||
}
|
||||
|
||||
return $template;
|
||||
}
|
||||
|
||||
// not using and not working
|
||||
public function viewPdfUsingMpdf()
|
||||
{
|
||||
$data = [
|
||||
'NAME' => 'Korukonda Naga Venkata Ramalinga Satya Swarna Kumari',
|
||||
'GENDER' => 'Male',
|
||||
'DOB' => '01/01/1990',
|
||||
'RELATION' => 'Self',
|
||||
'POLICY_NO' => '97000034230400000109_EX_Parental',
|
||||
'TPA_ID' => 'TPA987654321',
|
||||
'POLICY_START_DATE' => '01/01/2024',
|
||||
'POLICY_DATE' => '31/12/2024',
|
||||
'INSURER_NAME' => 'ZURICH KOTAK GTNERAL INSURANCE COIIPANY lNDlA LIMITED',
|
||||
'TPA_NAME' => 'HealthIndia Insurance TPA Services Pvt. Ltd.',
|
||||
'FRONT_CARD' => base_url('public/uploads/template_bg/Nhance_Ecard_working_1_front_3.png'),
|
||||
'BACK_CARD' => base_url('public/uploads/template_bg/Nhance_Ecard_working_1_Back_3.png'),
|
||||
'LEVELS' => 'Level 1: 1800-XXX-XXXX<br>Level 2: support@company.com'
|
||||
];
|
||||
|
||||
$html = $this->loadTemplate($data);
|
||||
|
||||
// Load mPDF
|
||||
$mpdf = "";
|
||||
|
||||
// $mpdf = new \Mpdf\Mpdf([
|
||||
// 'mode' => 'utf-8',
|
||||
// 'format' => 'A4',
|
||||
// 'margin_left' => 0,
|
||||
// 'margin_right' => 0,
|
||||
// 'margin_top' => 0,
|
||||
// 'margin_bottom' => 0,
|
||||
// 'tempDir' => __DIR__ . '/writable/mpdf'
|
||||
// ]);
|
||||
|
||||
// Optional: Stretch background or images fully
|
||||
// $html = '
|
||||
// <style>
|
||||
// body { margin:0; padding:0; }
|
||||
// @page { margin:0; }
|
||||
// </style>' . $html;
|
||||
|
||||
// $mpdf->WriteHTML($html);
|
||||
|
||||
// // Output inline (no download prompt)
|
||||
// $filename = 'ecard_' . date('Y-m-d_H-i-s') . '.pdf';
|
||||
// $mpdf->Output($filename, 'D');
|
||||
/*
|
||||
'I' = inline view in browser (no download prompt).
|
||||
'D' = force download.
|
||||
'F' = save to file.
|
||||
'S' = return as string.
|
||||
*/
|
||||
}
|
||||
|
||||
public function getEmployeePolicyTypes($client_id, $emp_code, $emp_id)
|
||||
{
|
||||
$employeePolicy = new EmployeePolicyModel();
|
||||
|
||||
$data = $employeePolicy
|
||||
->select('client_policy.policy_type_id')
|
||||
->join('employees', 'employee_polices.employee_id = employees.id')
|
||||
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id')
|
||||
->where('employees.is_active', 1)
|
||||
->where('employees.emp_status', ['active', 'expired'])
|
||||
->where('employee_polices.is_active', 1)
|
||||
->where('employee_polices.status', ['active', 'expired'])
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->groupBy('employee_polices.client_policy_id')
|
||||
->findAll();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ use App\Models\UserModel;
|
||||
use App\Models\ClientPolicyModel;
|
||||
use App\Models\ClientModel;
|
||||
use App\Models\TicketMailTemplateModel;
|
||||
use App\Models\ClientRMModel;
|
||||
|
||||
|
||||
class ThzController extends BaseController
|
||||
@ -31,6 +32,8 @@ class ThzController extends BaseController
|
||||
protected $clientModel;
|
||||
|
||||
protected $ticketMailTemplateModel;
|
||||
|
||||
protected $cientRmModel;
|
||||
protected $myLogger;
|
||||
|
||||
public function __construct()
|
||||
@ -43,6 +46,7 @@ class ThzController extends BaseController
|
||||
$this->userModel = new UserModel();
|
||||
$this->clientPolicyModel = new ClientPolicyModel();
|
||||
$this->clientModel = new ClientModel();
|
||||
$this->cientRmModel = new ClientRMModel();
|
||||
$this->ticketMailTemplateModel = new TicketMailTemplateModel();
|
||||
$this->myLogger = \Config\Services::mylogger();
|
||||
}
|
||||
@ -52,170 +56,181 @@ class ThzController extends BaseController
|
||||
//
|
||||
}
|
||||
|
||||
public function ticketSave(){
|
||||
try
|
||||
{
|
||||
$data = $this->request->getPost();
|
||||
public function ticketSave()
|
||||
{
|
||||
try {
|
||||
$data = $this->request->getPost();
|
||||
$references = "";
|
||||
if (!empty($data['thz_id'])) {
|
||||
|
||||
if (!empty($data['thz_id'])) {
|
||||
$text = "update";
|
||||
// here insert history Status.
|
||||
$old = $this->thzMasterModel->where('thz_id', $data['thz_id'])->get()->getRowArray();
|
||||
$result = $this->updateTicket($data);
|
||||
|
||||
$text = "update";
|
||||
$result = $this->updateTicket($data);
|
||||
// here insert history Status.
|
||||
$old = $this->thzMasterModel->where('thz_id', $data['thz_id'])->get()->getRowArray();
|
||||
|
||||
if ($old && isset($data['status'])) {
|
||||
if ($old['status'] != $data['status']) {
|
||||
$history = [
|
||||
'thz_id' => $data['thz_id'],
|
||||
'field_name' => 'status',
|
||||
'display_name' => 'Status',
|
||||
'old_value' => $old['status'],
|
||||
'new_value' => $data['status'],
|
||||
'is_active' => 1
|
||||
];
|
||||
if ($old && isset($data['status'])) {
|
||||
|
||||
if (!empty(get_session_userid())) {
|
||||
$history['created_by'] = get_session_userid();
|
||||
}
|
||||
if ($old['status'] != $data['status']) {
|
||||
$history = [
|
||||
'thz_id' => $data['thz_id'],
|
||||
'field_name' => 'status',
|
||||
'display_name' => 'Status',
|
||||
'old_value' => $old['status'],
|
||||
'new_value' => $data['status'],
|
||||
'is_active' => 1
|
||||
];
|
||||
|
||||
$this->thzHistoryModel->insert($history);
|
||||
if (!empty(get_session_userid())) {
|
||||
$history['created_by'] = get_session_userid();
|
||||
}
|
||||
|
||||
$hist_id = $this->thzHistoryModel->insert($history);
|
||||
$references = $old['status'] . " - " . $data['status'] . " - " . $hist_id;
|
||||
} else {
|
||||
$references = $old['status'] . " - " . $data['status'];
|
||||
}
|
||||
} else {
|
||||
$references = "No Details";
|
||||
}
|
||||
|
||||
$updateID = $data['thz_id'];
|
||||
} else {
|
||||
|
||||
$text = "create";
|
||||
$insertID = $this->insertTicket($data);
|
||||
$result = true;
|
||||
$references = "";
|
||||
}
|
||||
|
||||
$updateID = $data['thz_id'];
|
||||
|
||||
} else {
|
||||
$id = isset($insertID) && !empty($insertID) ? $insertID : $updateID;
|
||||
|
||||
$text = "create";
|
||||
$insertID = $this->insertTicket($data);
|
||||
$result = true;
|
||||
$emailNotificationResult = $this->ticketSaveNotification($data, $insertOrUpdate = $text, $id);
|
||||
|
||||
}
|
||||
|
||||
$id = isset($insertID) && !empty($insertID) ? $insertID : $updateID ;
|
||||
|
||||
$emailNotificationResult = $this->ticketSaveNotification($data , $insertOrUpdate = $text , $id);
|
||||
|
||||
return $this->response->setJSON([
|
||||
return $this->response->setJSON([
|
||||
'status' => $result ? 'success' : 'error',
|
||||
'message' => $result ? "Ticket {$text}d successfully " : "Unable to {$text} ticket. Please try again." ,
|
||||
'notification' => $emailNotificationResult ? 'Email Notification Success..!!' : 'Email Notification Failed..!!'
|
||||
])->setStatusCode($result ? 200 : 400);
|
||||
} catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
'message' => $result ? "Ticket {$text}d successfully " : "Unable to {$text} ticket. Please try again.",
|
||||
'notification' => $emailNotificationResult ? 'Email Notification Success..!!' : 'Email Notification Failed..!!',
|
||||
'ref' => $references
|
||||
])->setStatusCode($result ? 200 : 400);
|
||||
} catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
|
||||
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
|
||||
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
|
||||
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database' : 'application' . $code . ' / ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => 'error',
|
||||
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function ticketList()
|
||||
{
|
||||
|
||||
try{
|
||||
$returnType = strtolower($this->request->getGet('return_type') ?? 'api');
|
||||
|
||||
|
||||
$data = $this->request->getGet();
|
||||
if ($returnType === 'web' && in_array(get_role_id(), [2,3,4])) {
|
||||
$data['assign_to'] = $data['assign_to'] ?? get_session_userid();
|
||||
}
|
||||
try {
|
||||
$returnType = strtolower($this->request->getGet('return_type') ?? 'api');
|
||||
|
||||
$tickets = $this->fetchTicketsBasedOnrole($data);
|
||||
|
||||
|
||||
if ($returnType === 'api') {
|
||||
if (empty($tickets)) {
|
||||
// return $this->response->setJSON([ 'status' => 'error','message' => 'No tickets found'])->setStatusCode(404);
|
||||
throw new \RuntimeException('No tickets found', 400);
|
||||
$data = $this->request->getGet();
|
||||
if ($returnType === 'web' && in_array(get_role_id(), [2, 3, 4])) {
|
||||
$data['assign_to'] = $data['assign_to'] ?? get_session_userid();
|
||||
}
|
||||
}else{
|
||||
|
||||
$data['page_name'] = "Tickets";
|
||||
$data['ticket_data'] = $tickets;
|
||||
$data['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3','4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu
|
||||
// 2,3,4 remain person varannum.
|
||||
$data['client_list'] = $this->clientModel->getCreatedByUserName();
|
||||
$data['ticket_type'] = $this->thzTypeModel->where('is_active', 1)->findAll();
|
||||
|
||||
return $this->loadLayout('thz_list', $data);
|
||||
}
|
||||
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => 'success',
|
||||
'data' => $tickets,
|
||||
])->setStatusCode(200);
|
||||
}
|
||||
catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
$tickets = $this->fetchTicketsBasedOnrole($data);
|
||||
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
|
||||
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
|
||||
if ($returnType === 'api') {
|
||||
if (empty($tickets)) {
|
||||
// return $this->response->setJSON([ 'status' => 'error','message' => 'No tickets found'])->setStatusCode(404);
|
||||
throw new \RuntimeException('No tickets found', 400);
|
||||
}
|
||||
} else {
|
||||
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database' : 'application' . $code . ' / ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
$data['page_name'] = "Tickets";
|
||||
$data['ticket_data'] = $tickets;
|
||||
$data['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3', '4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu
|
||||
// 2,3,4 remain person varannum.
|
||||
$data['client_list'] = $this->clientModel->getCreatedByUserName();
|
||||
$data['ticket_type'] = $this->thzTypeModel->where('is_active', 1)->findAll();
|
||||
|
||||
return $this->loadLayout('thz_list', $data);
|
||||
}
|
||||
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => 'success',
|
||||
'data' => $tickets,
|
||||
])->setStatusCode(200);
|
||||
} catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
|
||||
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
|
||||
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => 'error',
|
||||
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
}
|
||||
|
||||
public function ticketConversationSave(){
|
||||
public function ticketConversationSave()
|
||||
{
|
||||
|
||||
try {
|
||||
try {
|
||||
$data = $this->request->getPost();
|
||||
|
||||
$data['notes_type'] = $data['notes_type'] ?? 'External' ;
|
||||
$data['notes_type'] = $data['notes_type'] ?? 'External';
|
||||
|
||||
$result = $this->thzMasterNotesModel->insert($data);
|
||||
|
||||
if(empty($result)){
|
||||
if (empty($result)) {
|
||||
// return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(404);
|
||||
throw new \RuntimeException('No tickets found', 404);
|
||||
throw new \RuntimeException('No tickets found', 404);
|
||||
}
|
||||
|
||||
if($data['notes_type'] == "External"){
|
||||
if ($data['notes_type'] == "External") {
|
||||
$emailNotificationResult = $this->ticketConversationSaveNotification($data);
|
||||
}else{
|
||||
$emailNotificationResult = false ;
|
||||
} else {
|
||||
$emailNotificationResult = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $this->response->setJSON([
|
||||
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => $result ? 'success' : 'error',
|
||||
'message' => $result ? "Ticket Notes created successfully" : "Unable to create ticket notes. Please try again." ,
|
||||
'message' => $result ? "Ticket Notes created successfully" : "Unable to create ticket notes. Please try again.",
|
||||
'notification' => $emailNotificationResult ? 'Email Notification Success..!!' : 'Email Notification Failed Or No Need..!!'
|
||||
])->setStatusCode($result ? 200 : 400);
|
||||
}
|
||||
catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
])->setStatusCode($result ? 200 : 400);
|
||||
} catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
|
||||
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
|
||||
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
|
||||
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database' : 'application' . $code . ' / ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => 'error',
|
||||
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
}
|
||||
|
||||
@ -246,190 +261,193 @@ class ThzController extends BaseController
|
||||
}
|
||||
|
||||
return $this->response->setJSON(['status' => 'success', 'data' => $result])->setStatusCode(200);
|
||||
} catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
|
||||
}
|
||||
catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
|
||||
|
||||
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database' : 'application' . $code . ' / ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
return $this->response->setJSON([
|
||||
'status' => 'error',
|
||||
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
}
|
||||
|
||||
public function ticketConversationList()
|
||||
{
|
||||
$data = $this->request->getGet();
|
||||
$data = $this->request->getGet();
|
||||
|
||||
$returnType = strtolower($this->request->getGet('return_type') ?? 'api');
|
||||
$returnType = strtolower($this->request->getGet('return_type') ?? 'api');
|
||||
|
||||
$thz_id = $data['thz_id'] ?? null;
|
||||
|
||||
$ticketType = $data['notes_type'] ?? 'External' ;
|
||||
$thz_id = $data['thz_id'] ?? null;
|
||||
|
||||
if($thz_id){
|
||||
$result['master'] = $this->thzMasterModel
|
||||
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
|
||||
->where('thz_master.thz_id', $thz_id)
|
||||
->findAll();
|
||||
$ticketType = $data['notes_type'] ?? 'External';
|
||||
|
||||
if(!empty($result['master'])){
|
||||
$notes = $this->thzMasterNotesModel->ticketConversationList($thz_id, $returnType );
|
||||
$result['notes'] = !empty($notes) ? $notes : [];
|
||||
}else{
|
||||
// return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(400);
|
||||
throw new \RuntimeException('No tickets found', 400);
|
||||
}
|
||||
}else{
|
||||
// return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(404);
|
||||
throw new \RuntimeException('No tickets found', 404);
|
||||
if ($thz_id) {
|
||||
$result['master'] = $this->thzMasterModel
|
||||
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
|
||||
->where('thz_master.thz_id', $thz_id)
|
||||
->findAll();
|
||||
|
||||
if (!empty($result['master'])) {
|
||||
$notes = $this->thzMasterNotesModel->ticketConversationList($thz_id, $returnType);
|
||||
$result['notes'] = !empty($notes) ? $notes : [];
|
||||
} else {
|
||||
// return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(400);
|
||||
throw new \RuntimeException('No tickets found', 400);
|
||||
}
|
||||
} else {
|
||||
// return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(404);
|
||||
throw new \RuntimeException('No tickets found', 404);
|
||||
}
|
||||
|
||||
if ($returnType === 'api') {
|
||||
try {
|
||||
return $this->response->setJSON((['status' => 'success', 'data' => $result]))->setStatusCode(200);
|
||||
} catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
if ($returnType === 'api') {
|
||||
try {
|
||||
return $this->response->setJSON((['status' => 'success', 'data' => $result]))->setStatusCode(200);
|
||||
} catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
|
||||
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
|
||||
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
|
||||
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database' : 'application' . $code . ' / ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
}else{
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
$assign_to = $result['master'][0]['assign_to'];
|
||||
$mobile = $result['master'][0]['mobile'];
|
||||
return $this->response->setJSON([
|
||||
'status' => 'error',
|
||||
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
} else {
|
||||
|
||||
$toGetPolicyId = (!empty($result['master'][0]['policy_id']) && strtolower($result['master'][0]['policy_id']) !== 'null')
|
||||
? $result['master'][0]['policy_id']
|
||||
: '';
|
||||
$assign_to = $result['master'][0]['assign_to'];
|
||||
$mobile = $result['master'][0]['mobile'];
|
||||
|
||||
$result['related_tickets'] = $this->thzMasterModel
|
||||
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
|
||||
->where('thz_master.assign_to', $assign_to)
|
||||
->where('thz_master.mobile',$mobile)
|
||||
->where('thz_master.thz_id !=',$thz_id)
|
||||
->where('thz_master.status !=','Closed')
|
||||
->where('thz_master.status !=','Resolved')
|
||||
->findAll();
|
||||
|
||||
$result['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3','4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu
|
||||
// 2,3,4 remain person varannum.
|
||||
$result['policy_terms'] = $toGetPolicyId ? $this->getPolicyTerms($toGetPolicyId) : '';
|
||||
$toGetPolicyId = (!empty($result['master'][0]['policy_id']) && strtolower($result['master'][0]['policy_id']) !== 'null')
|
||||
? $result['master'][0]['policy_id']
|
||||
: '';
|
||||
|
||||
$result['ticket_type'] = $this->thzTypeModel->where('is_active', 1)->findAll();
|
||||
|
||||
return $this->loadLayout('thz_notes', $result);
|
||||
|
||||
}
|
||||
$result['related_tickets'] = $this->thzMasterModel
|
||||
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
|
||||
->where('thz_master.assign_to', $assign_to)
|
||||
->where('thz_master.mobile', $mobile)
|
||||
->where('thz_master.thz_id !=', $thz_id)
|
||||
->where('thz_master.status !=', 'Closed')
|
||||
->where('thz_master.status !=', 'Resolved')
|
||||
->findAll();
|
||||
|
||||
$result['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3', '4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu
|
||||
// 2,3,4 remain person varannum.
|
||||
$result['policy_terms'] = $toGetPolicyId ? $this->getPolicyTerms($toGetPolicyId) : '';
|
||||
|
||||
$result['ticket_type'] = $this->thzTypeModel->where('is_active', 1)->findAll();
|
||||
|
||||
return $this->loadLayout('thz_notes', $result);
|
||||
}
|
||||
}
|
||||
|
||||
public function ticketType()
|
||||
{
|
||||
$method = $this->request->getMethod(); // get, post
|
||||
try{
|
||||
if ($method === 'get') {
|
||||
try {
|
||||
if ($method === 'get') {
|
||||
$types = $this->thzTypeModel->select('id,name,is_active')->where('is_active', 1)->findAll();
|
||||
if (empty($types)) {
|
||||
return $this->response->setJSON(['status' => 'error','message' => 'No ticket types found'])->setStatusCode(404);
|
||||
return $this->response->setJSON(['status' => 'error', 'message' => 'No ticket types found'])->setStatusCode(404);
|
||||
}
|
||||
return $this->response->setJSON(['status' => 'success','data' => $types])->setStatusCode(200);
|
||||
}
|
||||
|
||||
return $this->response->setJSON(['status' => 'success', 'data' => $types])->setStatusCode(200);
|
||||
}
|
||||
|
||||
if ($method === 'post') {
|
||||
|
||||
|
||||
$data = $this->request->getPost();
|
||||
if (!empty($data['id'])) {
|
||||
$text = "update";
|
||||
$text = "update";
|
||||
$result = $this->thzTypeModel->update($data['id'], $data);
|
||||
$updateID = $data['id'];
|
||||
} else {
|
||||
$text = "create";
|
||||
$text = "create";
|
||||
$insertID = $this->thzTypeModel->insert($data);
|
||||
$result = true;
|
||||
}
|
||||
|
||||
$id = isset($insertID) && !empty($insertID) ? $insertID : ($updateID ?? null);
|
||||
|
||||
return $this->response->setJSON([
|
||||
return $this->response->setJSON([
|
||||
'status' => $id ? 'success' : 'error',
|
||||
'message' => $id ? "Ticket Type {$text}d successfully" : "Unable to {$text} ticket type. Please try again.",
|
||||
'id' => $id
|
||||
])->setStatusCode($id ? 200 : 400);
|
||||
}
|
||||
return $this->response->setJSON([ 'status' => 'error', 'message' => 'Invalid request method' ])->setStatusCode(405);
|
||||
}
|
||||
catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
return $this->response->setJSON(['status' => 'error', 'message' => 'Invalid request method'])->setStatusCode(405);
|
||||
} catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
|
||||
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
|
||||
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
|
||||
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database' : 'application' . $code . ' / ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => 'error',
|
||||
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
}
|
||||
|
||||
public function ticketHistoryList()
|
||||
{
|
||||
try
|
||||
{
|
||||
$data = $this->request->getGet();
|
||||
$thz_id = $data['thz_id'];
|
||||
// $details = $this->thzHistoryModal->whereIn('thz_id', $thz_id)->where('is_active', 1)->get()->getResultArray();
|
||||
$details = $this->thzHistoryModel->select('thz_history.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as created_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_history.created_by', 'left')
|
||||
->where('thz_history.thz_id', $thz_id)->where('thz_history.is_active', 1)
|
||||
->orderBy('thz_history.created_at', 'desc')
|
||||
->get()->getResultArray();
|
||||
try {
|
||||
$data = $this->request->getGet();
|
||||
$thz_id = $data['thz_id'];
|
||||
// $details = $this->thzHistoryModal->whereIn('thz_id', $thz_id)->where('is_active', 1)->get()->getResultArray();
|
||||
$details = $this->thzHistoryModel->select('thz_history.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as created_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_history.created_by', 'left')
|
||||
->where('thz_history.thz_id', $thz_id)->where('thz_history.is_active', 1)
|
||||
->orderBy('thz_history.created_at', 'desc')
|
||||
->get()->getResultArray();
|
||||
|
||||
|
||||
|
||||
|
||||
if (empty($details)) {
|
||||
// return $this->response->setJSON([ 'status' => 'error','message' => 'No History found'])->setStatusCode(404);
|
||||
throw new \RuntimeException('No History found', 404);
|
||||
}
|
||||
|
||||
|
||||
return $this->response->setJSON(['status' => 'success','data' => $details])->setStatusCode(200);
|
||||
} catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
return $this->response->setJSON(['status' => 'success', 'data' => $details])->setStatusCode(200);
|
||||
} catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
|
||||
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database / ' : 'application / ' . $code . ' / ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
|
||||
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => 'error',
|
||||
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
}
|
||||
|
||||
@ -446,70 +464,73 @@ class ThzController extends BaseController
|
||||
if (!empty($assign_to)) {
|
||||
// Tickets assigned to a staff
|
||||
return $this->thzMasterModel
|
||||
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
|
||||
->where('thz_master.assign_to', $assign_to)
|
||||
->orderBy('thz_master.created_at','desc')
|
||||
->findAll();
|
||||
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
|
||||
->where('thz_master.assign_to', $assign_to)
|
||||
->orderBy('thz_master.created_at', 'desc')
|
||||
->findAll();
|
||||
}
|
||||
|
||||
// if (!empty($id) && !empty($mobile)) {
|
||||
if (!empty($mobile)) {
|
||||
// Specific ticket by ID and mobile
|
||||
return $this->thzMasterModel
|
||||
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
|
||||
// ->where('thz_id', $id)
|
||||
->where('thz_master.mobile', $mobile)
|
||||
->orderBy('thz_master.created_at','desc')
|
||||
->findAll();
|
||||
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
|
||||
// ->where('thz_id', $id)
|
||||
->where('thz_master.mobile', $mobile)
|
||||
->orderBy('thz_master.created_at', 'desc')
|
||||
->findAll();
|
||||
}
|
||||
|
||||
// All tickets (e.g., for managers)
|
||||
return $this->thzMasterModel
|
||||
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
|
||||
->orderBy('thz_master.created_at','desc')
|
||||
->findAll();
|
||||
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
|
||||
->orderBy('thz_master.created_at', 'desc')
|
||||
->findAll();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function ticketSaveNotification( $data , $insertOrUpdate , $id){
|
||||
|
||||
private function ticketSaveNotification($data, $insertOrUpdate, $id)
|
||||
{
|
||||
|
||||
$user_email = $data['email'] ?? null;
|
||||
|
||||
$assignee_id = $data['assign_to'] ?? null;
|
||||
|
||||
$assignee_email = $this->findAssigneeEmail($assignee_id);
|
||||
|
||||
$client_id = $data['client_id'] ?? null;
|
||||
|
||||
$emailToNotified = [
|
||||
'user_email' => $user_email,
|
||||
'assignee_email' => $assignee_email
|
||||
'assignee_email' => $assignee_email
|
||||
];
|
||||
|
||||
$ticketId = $id;
|
||||
|
||||
$result = $this->ticketSaveEmailNotificationBasedOnRole($emailToNotified , $insertOrUpdate , $ticketId , $data);
|
||||
|
||||
return $result;
|
||||
$result = $this->ticketSaveEmailNotificationBasedOnRole($emailToNotified, $insertOrUpdate, $ticketId, $data, $client_id);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function ticketConversationSaveNotification($data){
|
||||
private function ticketConversationSaveNotification($data)
|
||||
{
|
||||
|
||||
$thz_id = $data['thz_id'] ; // thz is alias of ticket
|
||||
$thz_id = $data['thz_id']; // thz is alias of ticket
|
||||
|
||||
$data['subject'] = $this->findSubject($data['thz_id']);
|
||||
|
||||
$assignee_id = $this->findAssigneeId($data['thz_id']) ;
|
||||
$assignee_id = $this->findAssigneeId($data['thz_id']);
|
||||
|
||||
$user_email = $this->findUserEmail($data['thz_id']);
|
||||
|
||||
$user_email = $this->findUserEmail($data['thz_id']) ;
|
||||
|
||||
$assignee_email = $this->findAssigneeEmail($assignee_id) ?? '';
|
||||
|
||||
$sender_mail = $data['notes_by'] == "User" ? $user_email : $assignee_email ;
|
||||
$receiver_mail = $data['notes_by'] == "User" ? $assignee_email : $user_email ;
|
||||
$sender_mail = $data['notes_by'] == "User" ? $user_email : $assignee_email;
|
||||
$receiver_mail = $data['notes_by'] == "User" ? $assignee_email : $user_email;
|
||||
|
||||
$templateName = "ticket_conversation_save_notification";
|
||||
|
||||
@ -519,40 +540,43 @@ class ThzController extends BaseController
|
||||
|
||||
$message = $data['notes'] ?? '';
|
||||
|
||||
$this->sendEmail( $templateName, $data , $to_email , $ticketId , $message);
|
||||
$this->sendEmail($templateName, $data, $to_email, $ticketId, $message);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private function findAssigneeEmail($assignee_id){
|
||||
private function findAssigneeEmail($assignee_id)
|
||||
{
|
||||
|
||||
$row = $this->userModel->where('id', $assignee_id)->get()->getRow();
|
||||
$assigneeEmail = $row ? $row->email : null;
|
||||
return $assigneeEmail ? $assigneeEmail : "";
|
||||
|
||||
return $assigneeEmail ? $assigneeEmail : "";
|
||||
}
|
||||
|
||||
private function findAssigneeId($ticketId){
|
||||
private function findAssigneeId($ticketId)
|
||||
{
|
||||
$row = $this->thzMasterModel->where('thz_id', $ticketId)->get()->getRow();
|
||||
$assigneeId = $row ? $row->assign_to : null;
|
||||
return $assigneeId ? $assigneeId : 0 ;
|
||||
return $assigneeId ? $assigneeId : 0;
|
||||
}
|
||||
|
||||
private function findUserEmail($ticket_id){
|
||||
private function findUserEmail($ticket_id)
|
||||
{
|
||||
$row = $this->thzMasterModel->where('thz_id', $ticket_id)->get()->getRow();
|
||||
$email = $row ? $row->email : null;
|
||||
return $email ? $email : " " ;
|
||||
return $email ? $email : " ";
|
||||
}
|
||||
|
||||
private function findSubject($ticketId){
|
||||
private function findSubject($ticketId)
|
||||
{
|
||||
$row = $this->thzMasterModel->where('thz_id', $ticketId)->get()->getRow();
|
||||
$subject = $row ? $row->subject : null;
|
||||
return $subject ? $subject : " " ;
|
||||
return $subject ? $subject : " ";
|
||||
}
|
||||
|
||||
private function ticketSaveEmailNotificationBasedOnRole($emailToNotified , $insertOrUpdate , $ticketId , $data){
|
||||
private function ticketSaveEmailNotificationBasedOnRole($emailToNotified, $insertOrUpdate, $ticketId, $data, $client_id)
|
||||
{
|
||||
|
||||
$user_email = $emailToNotified['user_email'] ?? null;
|
||||
$assignee_email = $emailToNotified['assignee_email'] ?? null;
|
||||
@ -564,21 +588,20 @@ class ThzController extends BaseController
|
||||
|
||||
case 'update':
|
||||
|
||||
$this->sendEmail( 'ticket_save_update_assignee', $data ,$assignee_email , $ticketId ) ;
|
||||
$this->sendEmail('ticket_save_update_assignee', $data, $assignee_email, $ticketId);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'create':
|
||||
|
||||
$this->sendEmail( 'ticket_save_create_assignee', $data ,$assignee_email , $ticketId ) ;
|
||||
|
||||
$this->sendEmail('ticket_save_create_assignee', $data, $assignee_email, $ticketId);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
# code...
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!empty($user_email)) {
|
||||
@ -587,47 +610,55 @@ class ThzController extends BaseController
|
||||
|
||||
case 'update':
|
||||
|
||||
if(empty($assignee_email)){
|
||||
$data['assigneeAndStatus'] = "Not Yet Assigned";
|
||||
$this->sendEmail( 'ticket_save_update_user', $data ,$user_email , $ticketId ) ;
|
||||
}else{
|
||||
$data['assigneeAndStatus'] = "Assigned With {$assignee_email}";
|
||||
$this->sendEmail( 'ticket_save_update_user', $data ,$user_email , $ticketId ) ;
|
||||
}
|
||||
$data['assigneeAndStatus'] = empty($assignee_email)
|
||||
? "Not Yet Assigned"
|
||||
: "Assigned With {$assignee_email}";
|
||||
|
||||
$this->sendEmail('ticket_save_update_user', $data, $user_email, $ticketId);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
break;
|
||||
|
||||
case 'create':
|
||||
|
||||
if(empty($assignee_email)){
|
||||
$this->sendEmail( 'ticket_save_create_user_unassigned', $data ,$user_email , $ticketId ) ;
|
||||
}else{
|
||||
$data['assignee_email'] = $assignee_email ;
|
||||
$this->sendEmail( 'ticket_save_create_user_assigned', $data , $user_email , $ticketId ) ;
|
||||
$account_manager_email = $this->cientRmModel->findAccountManagerEmail($client_id);
|
||||
|
||||
$cc = getenv(' G_ticketing_system_cc');
|
||||
|
||||
$template = empty($assignee_email)
|
||||
? 'ticket_save_create_user_unassigned'
|
||||
: 'ticket_save_create_user_assigned';
|
||||
|
||||
if (!empty($assignee_email)) {
|
||||
$data['assignee_email'] = $assignee_email;
|
||||
}
|
||||
|
||||
|
||||
$this->sendEmail($template, $data, $user_email, $ticketId);
|
||||
|
||||
// send to account manager and if it is more than one email also no problem we send to all account managers
|
||||
if (!empty($account_manager_email)) {
|
||||
$this->sendEmail($template, $data, $account_manager_email, $ticketId, $cc);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
# code...
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function updateTicket($data){
|
||||
private function updateTicket($data)
|
||||
{
|
||||
|
||||
$data['updated_by'] = get_session_userid();
|
||||
$ticket_id = $data['thz_id'];
|
||||
$result = $this->thzMasterModel->where('thz_id', $ticket_id)->set($data)->update();
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
private function insertTicket($data)
|
||||
@ -639,12 +670,13 @@ class ThzController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
private function sendEmail( $templateName, $data , $to_email , $ticketId , $message = ""){
|
||||
|
||||
$mailTemplate = $this->ticketMailTemplateModel->where('template_name',$templateName )->findAll()[0] ?? [];
|
||||
private function sendEmail($templateName, $data, $to_email, $ticketId , $cc = "", $message = "", $bcc = "")
|
||||
{
|
||||
|
||||
if(empty($mailTemplate)){
|
||||
return ;
|
||||
$mailTemplate = $this->ticketMailTemplateModel->where('template_name', $templateName)->findAll()[0] ?? [];
|
||||
|
||||
if (empty($mailTemplate)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$mailTemplate['subject'] = str_replace('%subject%', $data['subject'] ?? '', $mailTemplate['subject']);
|
||||
@ -657,39 +689,35 @@ class ThzController extends BaseController
|
||||
|
||||
$mailTemplate['mail_content'] = str_replace('%assignee_email%', $data['assignee_email'] ?? '', $mailTemplate['mail_content']);
|
||||
|
||||
$mailTemplate['mail_content'] = str_replace('%assigneeAndStatus%',$data['assigneeAndStatus'] ?? '' ,$mailTemplate['mail_content']);
|
||||
$mailTemplate['mail_content'] = str_replace('%assigneeAndStatus%', $data['assigneeAndStatus'] ?? '', $mailTemplate['mail_content']);
|
||||
|
||||
$from_mail = "";
|
||||
$to_mail = $to_email;
|
||||
$cc_string = "";
|
||||
$subject = $mailTemplate['subject'] ;
|
||||
$message = $mailTemplate['mail_content'] ;
|
||||
$cc_string = $cc;
|
||||
$subject = $mailTemplate['subject'];
|
||||
$message = $mailTemplate['mail_content'];
|
||||
$attachments = "";
|
||||
$reply_to = "";
|
||||
$bcc_string = "";
|
||||
|
||||
$res = MailHelper::send_email(['from_mail' => $from_mail, 'mail' => $to_mail , 'cc' => $cc_string, 'subject' => $subject, 'message' => $message, 'attachments' => $attachments, 'reply_to' => $reply_to, 'bcc' => $bcc_string]);
|
||||
$bcc_string = $bcc;
|
||||
|
||||
$res = MailHelper::send_email(['from_mail' => $from_mail, 'mail' => $to_mail, 'cc' => $cc_string, 'subject' => $subject, 'message' => $message, 'attachments' => $attachments, 'reply_to' => $reply_to, 'bcc' => $bcc_string]);
|
||||
}
|
||||
|
||||
|
||||
public function getPolicyTerms($client_policy_id)
|
||||
{
|
||||
$policy_data = $this->clientPolicyModel->where('is_active', 1)->where('id', $client_policy_id)->first();
|
||||
|
||||
$policy_terms = [];
|
||||
if(isset($policy_data['policy_terms']) && !empty($policy_data['policy_terms'])){
|
||||
|
||||
$raw_terms = json_decode($policy_data['policy_terms'] ?? [] , true) ?? [];
|
||||
|
||||
$ticketController = new TicketController();
|
||||
$policy_terms = $ticketController->convertTermsToDisplay($raw_terms);
|
||||
$policy_terms = [];
|
||||
if (isset($policy_data['policy_terms']) && !empty($policy_data['policy_terms'])) {
|
||||
|
||||
$raw_terms = json_decode($policy_data['policy_terms'] ?? [], true) ?? [];
|
||||
|
||||
$ticketController = new TicketController();
|
||||
$policy_terms = $ticketController->convertTermsToDisplay($raw_terms);
|
||||
}
|
||||
|
||||
$data['policy_terms'] = $policy_terms;
|
||||
return view('view_policy_terms', $data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -22,6 +22,8 @@ use App\Models\EmployeeModel;
|
||||
use App\Models\TPAModel;
|
||||
use App\Models\ClaimFilesModel;
|
||||
use App\Models\ClaimDumpFileModel;
|
||||
use App\Models\VehicleModel;
|
||||
use App\Models\PartnerPolicyModel;
|
||||
|
||||
use DOMDocument;
|
||||
use Psr\Log\LoggerInterface;
|
||||
@ -62,6 +64,8 @@ class TicketController extends BaseController
|
||||
protected $TPAModel;
|
||||
protected $claimFilesModel;
|
||||
protected $claimDumpFileModel;
|
||||
protected $vehicleModel;
|
||||
protected $partnerPolicyModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -71,7 +75,7 @@ class TicketController extends BaseController
|
||||
|
||||
$this->ticketMasterModel = new TicketMasterModel();
|
||||
|
||||
$this->ticketType = [1 => "Claim-GMC", 2 => "Claim-GPA", 3 => "EDLI", 4 => "GTLI"];
|
||||
$this->ticketType = [1 => "Claim-GMC", 2 => "Claim-GPA", 3 => "EDLI", 4 => "GTLI", 8 => "Motor"];
|
||||
$this->priorityType = [
|
||||
1 => "Low",
|
||||
2 => "Medium",
|
||||
@ -348,6 +352,8 @@ class TicketController extends BaseController
|
||||
$this->TPAModel = new TPAModel();
|
||||
$this->claimFilesModel = new ClaimFilesModel();
|
||||
$this->claimDumpFileModel = new ClaimDumpFileModel();
|
||||
$this->vehicleModel = new VehicleModel();
|
||||
$this->partnerPolicyModel = new PartnerPolicyModel();
|
||||
}
|
||||
|
||||
public function ticketList()
|
||||
@ -684,6 +690,9 @@ class TicketController extends BaseController
|
||||
case 4:
|
||||
$data['ticket_form'] = 'GTLI';
|
||||
break;
|
||||
case 8:
|
||||
$data['ticket_form'] = 'Motor';
|
||||
break;
|
||||
}
|
||||
|
||||
// Fetch ACM Users
|
||||
@ -704,7 +713,10 @@ class TicketController extends BaseController
|
||||
$claim_status_id = 25;
|
||||
}else if($ticket_type == 4){
|
||||
$claim_status_id = 35;
|
||||
}else{
|
||||
}else if($ticket_type == 8){
|
||||
$claim_status_id = 62;
|
||||
}
|
||||
else{
|
||||
$claim_status_id = 1;
|
||||
}
|
||||
}
|
||||
@ -719,11 +731,79 @@ class TicketController extends BaseController
|
||||
$data['claim_type'] = $this->claimType[2];
|
||||
}
|
||||
|
||||
$data['client_for_motor'] = $this->clientModel->select('id,client_name,phone')->where('client_type', 2)->where('is_active', 1)->findAll();
|
||||
|
||||
$this->myLogger->logme('error', "Ticket form data fetched successfully for Ticket Type: $ticket_type");
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function fetchVehiclePolicy($id)
|
||||
{
|
||||
$method = $this->request->getMethod();
|
||||
|
||||
try {
|
||||
if (!$id) {
|
||||
throw new \Exception('Invalid ID', 400);
|
||||
}
|
||||
|
||||
if ($method === 'get') {
|
||||
$data['vehicle_list'] = $this->vehicleModel
|
||||
->where('is_active', 1)
|
||||
->where('owner', $id)
|
||||
->findAll();
|
||||
|
||||
// $data['partner_policy_list'] = $this->partnerPolicyModel
|
||||
// ->where('is_active', 1)
|
||||
// ->findAll();
|
||||
$data['partner_policy_list'] = $this->partnerPolicyModel->partnerPolicyList();
|
||||
|
||||
$client = $this->clientModel
|
||||
->where('is_active', 1)
|
||||
->where('id', $id)
|
||||
->first();
|
||||
|
||||
$data['email'] = !empty($client) ? $client['email'] : null;
|
||||
$data['phone'] = !empty($client) ? $client['phone'] : null;
|
||||
|
||||
if (empty($data['vehicle_list']) && empty($data['partner_policy_list'])) {
|
||||
throw new \Exception('No Records found', 404);
|
||||
}
|
||||
|
||||
return $this->response
|
||||
->setJSON(['status' => 'success', 'data' => $data])
|
||||
->setStatusCode(200);
|
||||
}
|
||||
|
||||
throw new \Exception('Invalid request method', 405);
|
||||
|
||||
} catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
|
||||
$context = [
|
||||
'title' => get_class($e),
|
||||
'type' => get_class($e),
|
||||
'code' => $code,
|
||||
'message' => $e->getMessage(),
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine()
|
||||
];
|
||||
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => 'error',
|
||||
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => ($isDbError ? 'database - ' : 'application - ') . $code . ' - ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//transform the claim status
|
||||
public function transFormClaimStatus($claimStatusId, $ticket_type)
|
||||
{
|
||||
@ -792,9 +872,10 @@ class TicketController extends BaseController
|
||||
}
|
||||
|
||||
public function view_ticket($ticket_id)
|
||||
{
|
||||
{
|
||||
// $ticket_data = $this->ticketMasterModel->where('id', $ticket_id)->where('is_active', 1)->first();
|
||||
$ticket_data = $this->ticketMasterModel->getTicketDataByTicketID($ticket_id);
|
||||
|
||||
$ticket_data = $this->formatDateForClaim($ticket_data, 'd/m/Y');
|
||||
|
||||
if (in_array($ticket_data['claim_status_id'], [15, 25, 35])) {
|
||||
@ -853,6 +934,14 @@ class TicketController extends BaseController
|
||||
// print_rr($data); die;
|
||||
}
|
||||
|
||||
// 8TH TYPE is Motor - so do not remove it....
|
||||
if($ticket_data['ticket_type_id'] == 8){
|
||||
$claim_status_id = $ticket_data['claim_status_id'];
|
||||
$ticket_type = $ticket_data['ticket_type_id'];
|
||||
$data['claim_status'] = $this->transFormClaimStatus($claim_status_id, $ticket_type);
|
||||
$data['client_for_motor'] = $this->clientModel->select('id,client_name,phone')->where('client_type', 2)->where('is_active', 1)->findAll();
|
||||
}
|
||||
|
||||
return $this->loadLayout('ticket_edit_onbording', $data);
|
||||
}
|
||||
|
||||
@ -1157,13 +1246,23 @@ class TicketController extends BaseController
|
||||
->orderBy('ticket_messages.created_at', 'DESC')
|
||||
->findAll();
|
||||
|
||||
foreach ($dataToSend['messages'] as $message) {
|
||||
foreach ($dataToSend['messages'] as &$message) {
|
||||
$mail_content_converted = $this->convertHtmlToText($message['mail_content']);
|
||||
$message['mail_content'] = $mail_content_converted;
|
||||
|
||||
$claimFiles = new ClaimFilesModel();
|
||||
$message["files_data"] = $claimFiles->where('is_active', 1)
|
||||
->where('file_type', 2)->where('ticket_id', $ticket_master_id)
|
||||
->where('ticket_message_id', $message['id'])
|
||||
->findAll();
|
||||
|
||||
}
|
||||
unset($message);
|
||||
|
||||
$dataToSend['emp_name'] = $this->ticketMasterModel->select('emp_name')
|
||||
->where('id', $ticket_master_id)->where('is_active', 1)
|
||||
->first()['emp_name'];
|
||||
|
||||
// dd($dataToSend);
|
||||
if ($dataToSend) {
|
||||
return $dataToSend;
|
||||
@ -1173,6 +1272,38 @@ class TicketController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function downloadClaimFile($claim_file_id = null)
|
||||
{
|
||||
// $actionType = $this->request->getGet();
|
||||
$claimFiles = new ClaimFilesModel();
|
||||
$file_data = $claimFiles->where('id', $claim_file_id)->first();
|
||||
$fileName = $file_data['doc_name'];
|
||||
|
||||
$filePath = WRITEPATH . '/uploads/claim_files/' . $fileName;
|
||||
|
||||
try {
|
||||
|
||||
// Check if the file exists
|
||||
if (file_exists($filePath)) {
|
||||
// Set the appropriate MIME type
|
||||
$mimeType = mime_content_type($filePath);
|
||||
|
||||
// Send the file to the client for download
|
||||
return $this->response->download($filePath, null, $mimeType);
|
||||
} else {
|
||||
|
||||
$data['message'] = 'The Physical File Not Found';
|
||||
echo view('errors/404', $data);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Handle any exceptions
|
||||
$errorMessage = $e->getMessage();
|
||||
$this->myLogger->logme('error', $errorMessage);
|
||||
// You can return an error response here
|
||||
echo $errorMessage;
|
||||
}
|
||||
}
|
||||
|
||||
public function convertHtmlToText($html)
|
||||
{
|
||||
if(!empty($html)){
|
||||
@ -2198,7 +2329,8 @@ class TicketController extends BaseController
|
||||
'url' => $data['url'][$key]??'',
|
||||
'ticket_id'=> $data['ticket_id_url']??'',
|
||||
'created_by' => get_session_userid(),
|
||||
'is_active' => 1
|
||||
'is_active' => 1,
|
||||
'file_type' => 1
|
||||
];
|
||||
|
||||
$insertArr[] = $insertData;
|
||||
@ -2235,6 +2367,7 @@ class TicketController extends BaseController
|
||||
$urlData = $this->claimFilesModel
|
||||
->where('ticket_id', $ticket_id)
|
||||
->where('is_active',1)
|
||||
->where('file_type',1)
|
||||
->findAll();
|
||||
|
||||
return $this->response->setJSON([
|
||||
|
||||
@ -18,6 +18,8 @@ use App\Models\UserTeamsModel;
|
||||
use App\Helpers\BookStackUserHelper;
|
||||
use App\Models\AuthHistoryModel;
|
||||
use App\Models\UserActivityHistoryModel;
|
||||
use App\Models\PartnerStaffModel;
|
||||
use App\Models\PartnerManagerIncentiveFileModel;
|
||||
|
||||
|
||||
class UserController extends AdminController
|
||||
@ -32,6 +34,8 @@ class UserController extends AdminController
|
||||
protected $bookStack;
|
||||
protected $authHistoryModel;
|
||||
protected $userActivityHistoryModel;
|
||||
protected $partnerStaffModel;
|
||||
protected $partnerManagerIncentiveFileModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -45,6 +49,8 @@ class UserController extends AdminController
|
||||
$this->bookStack = new BookStackUserHelper();
|
||||
$this->authHistoryModel = new AuthHistoryModel();
|
||||
$this->userActivityHistoryModel = new UserActivityHistoryModel();
|
||||
$this->partnerStaffModel = new PartnerStaffModel();
|
||||
$this->partnerManagerIncentiveFileModel = new PartnerManagerIncentiveFileModel();
|
||||
}
|
||||
|
||||
public function list()
|
||||
@ -563,4 +569,226 @@ class UserController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function partner()
|
||||
{
|
||||
$method = $this->request->getMethod(); // get, post
|
||||
try{
|
||||
// Listing
|
||||
if ($method === 'get') {
|
||||
$types = $this->partnerStaffModel->findAll();
|
||||
if (empty($types)) {
|
||||
return $this->response->setJSON(['status' => 'error','message' => 'No Staff found'])->setStatusCode(404);
|
||||
}
|
||||
return $this->response->setJSON(['status' => 'success','data' => $types])->setStatusCode(200);
|
||||
}
|
||||
|
||||
// add/update
|
||||
if ($method === 'post') {
|
||||
|
||||
$data = $this->request->getPost();
|
||||
if (!empty($data['id'])) {
|
||||
$text = "update";
|
||||
$result = $this->partnerStaffModel->update($data['id'], $data);
|
||||
$updateID = $data['id'];
|
||||
} else {
|
||||
$text = "create";
|
||||
$data['role_id'] = 1;
|
||||
$data['created_by'] = get_session_userid();
|
||||
$insertID = $this->partnerStaffModel->insert($data);
|
||||
$result = true;
|
||||
}
|
||||
|
||||
$id = isset($insertID) && !empty($insertID) ? $insertID : ($updateID ?? null);
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => $id ? 'success' : 'error',
|
||||
'message' => $id ? "Staff {$text}d successfully" : "Unable to {$text} staff. Please try again.",
|
||||
'id' => $id
|
||||
])->setStatusCode($id ? 200 : 400);
|
||||
}
|
||||
|
||||
// delete
|
||||
if ($method === 'put') {
|
||||
$data = $this->request->getRawInput();
|
||||
$id = $data['id'] ?? null;
|
||||
|
||||
if (!$id) {
|
||||
return $this->response->setJSON(['status' => 'error', 'message' => 'ID is required'])->setStatusCode(400);
|
||||
}
|
||||
|
||||
$staff = $this->partnerStaffModel->find($id);
|
||||
if (!$staff) {
|
||||
return $this->response->setJSON(['status' => 'error','message' => 'Staff not found'])->setStatusCode(404);
|
||||
}
|
||||
|
||||
if ($staff['is_active'] == 1) {
|
||||
$result = $this->partnerStaffModel->update($id, ['is_active' => 0]);
|
||||
$message = "Staff deleted successfully";
|
||||
} else {
|
||||
return $this->response->setJSON(['status' => 'error','message' => 'Staff already deleted'])->setStatusCode(400);
|
||||
}
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => $result ? 'success' : 'error',
|
||||
'message' => $result ? $message : "Unable to delete staff. Please try again.",
|
||||
'id' => $id
|
||||
])->setStatusCode($result ? 200 : 400);
|
||||
}
|
||||
return $this->response->setJSON([ 'status' => 'error', 'message' => 'Invalid request method' ])->setStatusCode(405);
|
||||
}
|
||||
catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
|
||||
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
|
||||
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
}
|
||||
|
||||
public function partnerIncentive()
|
||||
{
|
||||
$method = $this->request->getMethod(); // get, post
|
||||
try{
|
||||
// Listing
|
||||
if ($method === 'get') {
|
||||
$manager_id = $this->request->getGet('manager_id');
|
||||
$files = $this->partnerManagerIncentiveFileModel->where('manager_id', $manager_id)->findAll();
|
||||
if (empty($files)) {
|
||||
return $this->response->setJSON(['status' => 'error','message' => 'No Records found'])->setStatusCode(404);
|
||||
}
|
||||
return $this->response->setJSON(['status' => 'success','data' => $files])->setStatusCode(200);
|
||||
}
|
||||
|
||||
// add/update
|
||||
if ($method === 'post') {
|
||||
|
||||
$file = $this->request->getFile('incentive_file_name');
|
||||
$month = $this->request->getPost('incentive_month');
|
||||
$managerId = $this->request->getPost('manager_id');
|
||||
$fileId = $this->request->getPost('id');
|
||||
|
||||
if ($file && $file->isValid() && !$file->hasMoved()) {
|
||||
|
||||
$originalName = $file->getClientName();
|
||||
$extension = $file->getExtension();
|
||||
|
||||
$fileName = pathinfo($originalName, PATHINFO_FILENAME) . '_' . date('Ymd_His') . '.' . $extension;
|
||||
|
||||
$path = WRITEPATH . 'uploads/incentives';
|
||||
$file->move($path, $fileName);
|
||||
$data = [
|
||||
'manager_id' => $managerId,
|
||||
'incentive_month' => date('M Y', strtotime($month)),
|
||||
'incentive_file_name' => $fileName,
|
||||
'created_by' => get_session_userid()
|
||||
];
|
||||
|
||||
if ($fileId) {
|
||||
$text = "update";
|
||||
$this->partnerManagerIncentiveFileModel->update($fileId, $data);
|
||||
$updateID = $data['id'];
|
||||
} else {
|
||||
$text = "create";
|
||||
$insertID = $this->partnerManagerIncentiveFileModel->insert($data);
|
||||
$result = true;
|
||||
}
|
||||
|
||||
$id = isset($insertID) && !empty($insertID) ? $insertID : ($updateID ?? null);
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => $id ? 'success' : 'error',
|
||||
'message' => $id ? "File {$text}d successfully" : "Unable to {$text} file. Please try again.",
|
||||
'id' => $id
|
||||
])->setStatusCode($id ? 200 : 400);
|
||||
}
|
||||
return $this->response->setJSON([
|
||||
'status' => 'error',
|
||||
'message' => "Unable to Upload file. Please try again.",
|
||||
'id' => ''
|
||||
])->setStatusCode(400);
|
||||
}
|
||||
|
||||
// delete
|
||||
if ($method === 'put') {
|
||||
$data = $this->request->getRawInput();
|
||||
$id = $data['id'] ?? null;
|
||||
|
||||
if (!$id) {
|
||||
return $this->response->setJSON(['status' => 'error', 'message' => 'ID is required'])->setStatusCode(400);
|
||||
}
|
||||
|
||||
$files = $this->partnerManagerIncentiveFileModel->find($id);
|
||||
if (!$files) {
|
||||
return $this->response->setJSON(['status' => 'error','message' => 'No Records found'])->setStatusCode(404);
|
||||
}
|
||||
|
||||
if ($files['is_active'] == 1) {
|
||||
$result = $this->partnerManagerIncentiveFileModel->update($id, ['is_active' => 0]);
|
||||
$message = "Files deleted successfully";
|
||||
} else {
|
||||
return $this->response->setJSON(['status' => 'error','message' => 'files already deleted'])->setStatusCode(400);
|
||||
}
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => $result ? 'success' : 'error',
|
||||
'message' => $result ? $message : "Unable to delete staff. Please try again.",
|
||||
'id' => $id
|
||||
])->setStatusCode($result ? 200 : 400);
|
||||
}
|
||||
return $this->response->setJSON([ 'status' => 'error', 'message' => 'Invalid request method' ])->setStatusCode(405);
|
||||
}
|
||||
catch (\Throwable $e) {
|
||||
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
|
||||
|
||||
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|
||||
|| $e instanceof \mysqli_sql_exception
|
||||
|| $e instanceof \PDOException;
|
||||
|
||||
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
|
||||
|
||||
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
|
||||
|
||||
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
|
||||
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
|
||||
])->setStatusCode($code);
|
||||
}
|
||||
}
|
||||
|
||||
public function downloadIncentivesFile($file_id)
|
||||
{
|
||||
try {
|
||||
$result = $this->partnerManagerIncentiveFileModel->where('id', $file_id)->first();
|
||||
|
||||
if (!$result || empty($result['incentive_file_name'])) {
|
||||
throw new \Exception("File Name Not Found");
|
||||
}
|
||||
|
||||
$incentive_file_name = $result['incentive_file_name'];
|
||||
$file_name = basename($incentive_file_name);
|
||||
$filePath = WRITEPATH . 'uploads/incentives/' . $file_name;
|
||||
|
||||
if (file_exists($filePath)) {
|
||||
return $this->response->download($filePath, null);
|
||||
} else {
|
||||
throw new \Exception("File Not Found");
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
$this->myLogger->logme('error', $e->getMessage());
|
||||
|
||||
// Show 404 error view
|
||||
$data['message'] = $e->getMessage();
|
||||
return view('errors/404', $data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -30,16 +30,16 @@ class ChatbotHelper
|
||||
$emp_code = $chat_session_info['emp_code'];
|
||||
$client_id = $chat_session_info['client_id'];
|
||||
$client_branch_id = $chat_session_info['client_branch_id'];
|
||||
// $relationship ='Father';
|
||||
$relationship ='Self';
|
||||
$EmployeeModel = new EmployeeModel();
|
||||
return $EmployeeModel->getEmpFamilybyEmpCode(emp_code: $emp_code,client_id: $client_id,emp_status: ['draft'],policy_status:['draft'],client_branch_id:[ $client_branch_id ]);//,relationship:[$relationship];
|
||||
return $EmployeeModel->getEmpFamilybyEmpCode(emp_code: $emp_code,client_id: $client_id,emp_status: ['active'],policy_status:['active'],client_branch_id:[ $client_branch_id ],relationship:[$relationship]);//,relationship:[$relationship];
|
||||
}
|
||||
|
||||
public static function getHospitalLink($client_policy_id){
|
||||
public static function getHospitalLink($emp_policy_id){
|
||||
// $client_policy_id = 336;
|
||||
// $emp_id = 12288;
|
||||
$EmployeePolicyModel = new EmployeePolicyModel();
|
||||
$res = $EmployeePolicyModel->getHospitalLinkByPolicyandEmp($client_policy_id);
|
||||
$res = $EmployeePolicyModel->getHospitalLinkByPolicyandEmp($emp_policy_id);
|
||||
|
||||
return is_array($res) && count($res) ? $res[0]['network_hospitals'] : null;
|
||||
}
|
||||
@ -64,16 +64,18 @@ class ChatbotHelper
|
||||
{
|
||||
$message = SELF::ReimbursementProcessMailTemplate();
|
||||
|
||||
$attachments = [
|
||||
["filePath" => ROOTPATH."public/sample_excel/sample_addition.xls","fileName" => "sample_addition.xls"],
|
||||
["filePath" => ROOTPATH."public/sample_excel/sample_inception.xls","fileName" => "sample_inception.xls"],
|
||||
["filePath" => ROOTPATH."public/assets/images/login_bg.jpg","fileName" => "login_bg.jpg"]
|
||||
];
|
||||
// $attachments = [
|
||||
// ["filePath" => ROOTPATH."public/sample_excel/sample_addition.xls","fileName" => "sample_addition.xls"],
|
||||
// ["filePath" => ROOTPATH."public/sample_excel/sample_inception.xls","fileName" => "sample_inception.xls"],
|
||||
// ["filePath" => ROOTPATH."public/assets/images/login_bg.jpg","fileName" => "login_bg.jpg"]
|
||||
// ];
|
||||
|
||||
|
||||
$common = ['mail_type'=>'reimbursement_mail_process_bot'];
|
||||
$email_id = $data['email_corporate'];
|
||||
$res = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Mail Via CLI', 'message' => $message,'attachments' => $attachments,'common'=>$common]);
|
||||
// $email_id = 'vitvelz@gmail.com';
|
||||
// $res = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Claim Reimbursement Process', 'message' => $message,'attachments' => $attachments,'common'=>$common]);
|
||||
$res = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Claim Reimbursement Process', 'message' => $message,'common'=>$common]);
|
||||
|
||||
$res = json_decode($res);
|
||||
if($res->status == 'success')
|
||||
@ -166,7 +168,7 @@ class ChatbotHelper
|
||||
<div class="steps">
|
||||
<ol>
|
||||
<li><strong>Gather Documents:</strong> Collect all required documents such as bills, invoices, and medical reports.</li>
|
||||
<li><strong>Complete the Claim Form:</strong> Fill out the insurance claim form accurately.</li>
|
||||
<li><strong>Complete the Claim Form:</strong> Fill out the insurance claim form in the portal.</li>
|
||||
<li><strong>Attach Supporting Documents:</strong> Attach all necessary documents to support your claim.</li>
|
||||
<li><strong>Submit Your Claim:</strong> Send the completed form and documents via email or through our online portal.</li>
|
||||
<li><strong>Track Your Claim:</strong> Use our tracking system to monitor the status of your claim.</li>
|
||||
@ -174,12 +176,10 @@ class ChatbotHelper
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<a href="[CLAIM_PORTAL_URL]" class="btn">Submit Your Claim</a>
|
||||
|
||||
<p>If you have any questions, feel free to contact our support team.</p>
|
||||
|
||||
<div class="footer">
|
||||
<p>Best Regards,<br><strong>Insurance Support Team</strong><br><a href="mailto:support@example.com">support@example.com</a></p>
|
||||
<p>Best Regards,<br><strong>NhanceIndia Support Team</strong><br><a href="mailto:support@example.com">info@nhanceindia.in</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -202,7 +202,8 @@ class ChatbotHelper
|
||||
|
||||
$common = ['mail_type'=>'request_quotation_bot'];
|
||||
$email_id = getenv('email.enquiryMail');
|
||||
$res = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Quotation Request Received from bot.', 'message' => $message,'common'=>$common]);
|
||||
// $res = MailHelper::send_email(['mail' => $email_id, 'bcc' => 'vitvelz@gmail.com','subject' => '(TESTING)Quotation Request Received from bot.', 'message' => $message,'common'=>$common]);
|
||||
$res = MailHelper::send_email(['mail' => $email_id,'subject' => 'Quotation Request Received from bot.', 'message' => $message,'common'=>$common]);
|
||||
|
||||
$res = json_decode($res);
|
||||
log_message('error','res: '.json_encode($res));
|
||||
@ -218,7 +219,7 @@ class ChatbotHelper
|
||||
}
|
||||
|
||||
public static function quotationRequestMailTemplate($data){
|
||||
$message = 'A customer has requested for a quotation using bot,Here are all the details for it:
|
||||
$message = 'A customer has requested for a quotation using bot,Here are all the details for it:<br>
|
||||
'.$data;
|
||||
return $message;
|
||||
}
|
||||
@ -266,7 +267,8 @@ class ChatbotHelper
|
||||
$mail_content = Self::ReimbursementStatusMailTemplate($data['emp_name'],$data['claim_number'],$matched_key);
|
||||
$common = ['mail_type'=>'Claim Status'];
|
||||
$email_id = $data['emp_mail'];
|
||||
$res = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Here is your claim status you requested in bot.', 'message' => $mail_content,'common'=>$common]);
|
||||
// $email_id = 'vitvelz@gmail.com';
|
||||
$res = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Claim status as you requested in bot.', 'message' => $mail_content,'common'=>$common]);
|
||||
|
||||
$res = json_decode($res);
|
||||
log_message('error','res: '.json_encode($res));
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
|
||||
|
||||
body[data-sidebar-size=condensed]:not([data-layout=compact]):not(.auth-fluid-pages) {
|
||||
min-height: 0;
|
||||
max-height:100vh !important;
|
||||
}
|
||||
|
||||
.navbar-custom {
|
||||
|
||||
@ -64,6 +64,79 @@ if (!function_exists('file_Upload')) {
|
||||
}
|
||||
}
|
||||
|
||||
// if (!function_exists('multi_file_Upload')) {
|
||||
// function multi_file_Upload($fileToUpload, $filepath)
|
||||
// {
|
||||
// $uploadedFiles = [];
|
||||
|
||||
// // Handle multiple files
|
||||
// if (is_array($fileToUpload)) {
|
||||
// foreach ($fileToUpload as $file) {
|
||||
// if ($file !== null && $file->isValid() && !$file->hasMoved()) {
|
||||
// $file->move($filepath);
|
||||
// $fileName = $file->getName(); // safer unique name
|
||||
// $uploadedFiles[] = [
|
||||
// 'file_name' => $fileName,
|
||||
// 'file_path' => $filepath . $fileName
|
||||
// ];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // Handle single file
|
||||
// else {
|
||||
// if ($fileToUpload !== null && $fileToUpload->isValid() && !$fileToUpload->hasMoved()) {
|
||||
// $fileToUpload->move($filepath);
|
||||
// $fileName = $fileToUpload->getName();
|
||||
// $uploadedFiles[] = [
|
||||
// 'file_name' => $fileName,
|
||||
// 'file_path' => $filepath . $fileName
|
||||
// ];
|
||||
// }
|
||||
// }
|
||||
|
||||
// return $uploadedFiles; // always return array of files
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!function_exists('multi_file_Upload')) {
|
||||
function multi_file_Upload($fileToUpload, $filepath)
|
||||
{
|
||||
$uploadedFiles = [];
|
||||
|
||||
// Normalize: always work with an array of UploadedFile objects
|
||||
$files = is_array($fileToUpload) ? $fileToUpload : [$fileToUpload];
|
||||
|
||||
foreach ($files as $file) {
|
||||
// If file is itself an array (multiple under same input name)
|
||||
if (is_array($file)) {
|
||||
foreach ($file as $f) {
|
||||
if ($f !== null && $f->isValid() && !$f->hasMoved()) {
|
||||
$fileName = $f->getRandomName(); // safer unique name
|
||||
$f->move($filepath, $fileName);
|
||||
$uploadedFiles[] = [
|
||||
'file_name' => $fileName,
|
||||
'file_path' => $filepath . $fileName
|
||||
];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Single file
|
||||
if ($file !== null && $file->isValid() && !$file->hasMoved()) {
|
||||
$fileName = $file->getRandomName();
|
||||
$file->move($filepath, $fileName);
|
||||
$uploadedFiles[] = [
|
||||
'file_name' => $fileName,
|
||||
'file_path' => $filepath . $fileName
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $uploadedFiles; // always return array
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('file_unlink')) {
|
||||
function file_unlink($filepath)
|
||||
{
|
||||
|
||||
@ -11,6 +11,8 @@ class ClaimFilesModel extends Model
|
||||
protected $allowedFields = [
|
||||
'id',
|
||||
'ticket_id',
|
||||
'ticket_message_id',
|
||||
'file_type',
|
||||
'doc_name',
|
||||
'url',
|
||||
'created_by',
|
||||
|
||||
@ -21,22 +21,38 @@ class ClientRMModel extends Model
|
||||
public function checkExistenceOfClientRelation($id, $user_id, $level)
|
||||
{
|
||||
$query = $this->where('client_id', $id)
|
||||
->where('user_id', $user_id)
|
||||
->where('level', $level)
|
||||
->countAllResults();
|
||||
->where('user_id', $user_id)
|
||||
->where('level', $level)
|
||||
->countAllResults();
|
||||
return ($query > 0) ? true : false;
|
||||
}
|
||||
|
||||
public function getAllClientRM(){
|
||||
public function getAllClientRM()
|
||||
{
|
||||
|
||||
return $this->db->table('client_rm')
|
||||
->select('client_rm.client_id, client_rm.level,')
|
||||
->select('user_profiles.first_name as account_manager')
|
||||
->join('user_profiles', 'user_profiles.id = client_rm.user_id')
|
||||
->where('level', 3)
|
||||
->get()
|
||||
->getResult();
|
||||
|
||||
->select('client_rm.client_id, client_rm.level,')
|
||||
->select('user_profiles.first_name as account_manager')
|
||||
->join('user_profiles', 'user_profiles.id = client_rm.user_id')
|
||||
->where('level', 3)
|
||||
->get()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
public function findAccountManagerEmail($client_id)
|
||||
{
|
||||
$builder = $this->db->table('client_rm');
|
||||
$builder->select('user_profiles.email');
|
||||
$builder->join('user_profiles', 'user_profiles.id = client_rm.user_id');
|
||||
$builder->where('client_rm.client_id', $client_id);
|
||||
$builder->where('client_rm.level', 3); // Assuming level 3 is for account managers
|
||||
$result = $builder->get()->getResultArray();
|
||||
|
||||
if (count($result) > 0) {
|
||||
// Extract just the email values into a simple string array
|
||||
return array_column($result, 'email');
|
||||
} else {
|
||||
return null; // or []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2089,11 +2089,15 @@ class EmployeePolicyModel extends Model
|
||||
return $result[0];
|
||||
}
|
||||
|
||||
public function getHospitalLinkByPolicyandEmp($client_policy_id){
|
||||
$data = $this->db->table('client_policy')
|
||||
public function getHospitalLinkByPolicyandEmp($emp_policy_id){
|
||||
$data = $this->db->table('employee_polices')
|
||||
->select('tpa.network_hospitals')
|
||||
->where('client_policy.id', $client_policy_id)
|
||||
->where('employee_polices.id', $emp_policy_id)
|
||||
->where('employee_polices.is_active', 1)
|
||||
->where('employee_polices.status', 'active')
|
||||
// ->where('client_policy.id', $client_policy_id)
|
||||
// ->where('employee_polices.is_active', 1)
|
||||
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id AND client_policy.is_active = 1')
|
||||
->join('tpa', 'tpa.id = client_policy.tpa_id AND tpa.is_active = 1')
|
||||
// ->join('employees', 'employees.id = employee_polices.employee_id AND employees.id = ' . (int) $emp_id)
|
||||
->get()->getResultArray();
|
||||
|
||||
89
app/Models/PartnerEndorsementRequestModel.php
Executable file
89
app/Models/PartnerEndorsementRequestModel.php
Executable file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class PartnerEndorsementRequestModel extends Model
|
||||
{
|
||||
protected $table = 'partner_endorsement_request';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
// Auto-increment
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
// Return type
|
||||
protected $returnType = 'array';
|
||||
|
||||
// Soft deletes (you’re using is_active instead of deleted_at, so keep it false)
|
||||
protected $useSoftDeletes = false;
|
||||
|
||||
// Allowed fields (columns you want to insert/update)
|
||||
protected $allowedFields = [
|
||||
'id',
|
||||
'client_id',
|
||||
'client_policy_id',
|
||||
'insurer_id',
|
||||
'insurer_branch_id',
|
||||
'policy_number',
|
||||
'endorsement_no',
|
||||
'endorsement_type',
|
||||
'endorsement_description',
|
||||
'updated_by',
|
||||
'is_active',
|
||||
'created_by',
|
||||
'manager_id',
|
||||
'agent_id',
|
||||
'status',
|
||||
];
|
||||
|
||||
public function getRetailEndorsementList($client_id, $insurers_id, $status)
|
||||
{
|
||||
$query = $this->db->table('partner_endorsement_request per')
|
||||
->distinct()
|
||||
->select('
|
||||
per.id,
|
||||
per.client_id,
|
||||
per.client_policy_id,
|
||||
per.insurer_id,
|
||||
per.insurer_branch_id,
|
||||
per.policy_number,
|
||||
per.endorsement_no,
|
||||
per.endorsement_type,
|
||||
per.endorsement_description,
|
||||
per.created_at,
|
||||
per.updated_by,
|
||||
per.updated_at,
|
||||
per.is_active,
|
||||
per.created_by,
|
||||
per.manager_id,
|
||||
per.agent_id,
|
||||
per.status,
|
||||
i.name as insurer_name,
|
||||
i.short_name as insurer_short_name,
|
||||
c.client_name,
|
||||
c.short_name as client_short_name,
|
||||
ps.name as manager_name,
|
||||
pa.name as agent_name
|
||||
')
|
||||
->join('insurers as i', 'i.id = per.insurer_id', 'left')
|
||||
->join('clients as c', 'c.id = per.client_id AND c.client_type = 2', 'left')
|
||||
->join('partner_staff as ps', 'ps.id = per.manager_id AND ps.role_id = 1', 'left')
|
||||
->join('partner_agent as pa', 'pa.id = per.agent_id', 'left');
|
||||
|
||||
if (!empty($status)) {
|
||||
$query->where('per.status', $status);
|
||||
}
|
||||
if (!empty($client_id)) {
|
||||
$query->where('per.client_id', $client_id);
|
||||
}
|
||||
if (!empty($insurers_id)) {
|
||||
$query->where('per.insurer_id', $insurers_id);
|
||||
}
|
||||
|
||||
$query->orderBy('per.id', 'desc');
|
||||
|
||||
return $query->get()->getResultArray();
|
||||
}
|
||||
|
||||
}
|
||||
56
app/Models/PartnerManagerIncentiveFileModel.php
Executable file
56
app/Models/PartnerManagerIncentiveFileModel.php
Executable file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class PartnerManagerIncentiveFileModel extends Model
|
||||
{
|
||||
protected $table = 'partner_manager_incentive_file';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
protected $returnType = 'array'; // or 'object'
|
||||
protected $useSoftDeletes = false;
|
||||
|
||||
protected $allowedFields = [
|
||||
'manager_id',
|
||||
'incentive_month',
|
||||
'incentive_file_name',
|
||||
'is_active',
|
||||
'created_by',
|
||||
'created_on',
|
||||
'updated_by',
|
||||
'updated_on'
|
||||
];
|
||||
|
||||
// Timestamps
|
||||
protected $useTimestamps = true;
|
||||
protected $createdField = 'created_on';
|
||||
protected $updatedField = 'updated_on';
|
||||
protected $dateFormat = 'datetime'; // can be 'date' or 'int'
|
||||
|
||||
// Validation Rules (optional, can add more)
|
||||
// protected $validationRules = [
|
||||
// 'manager_id' => 'required|integer',
|
||||
// 'incentive_month' => 'required|valid_date',
|
||||
// 'incentive_file_name'=> 'required|string|max_length[150]',
|
||||
// ];
|
||||
|
||||
// protected $validationMessages = [
|
||||
// 'manager_id' => [
|
||||
// 'required' => 'Manager ID is required',
|
||||
// 'integer' => 'Manager ID must be a number',
|
||||
// ],
|
||||
// 'incentive_month' => [
|
||||
// 'required' => 'Incentive Month is required',
|
||||
// 'valid_date' => 'Incentive Month must be a valid date (Y-m-d)',
|
||||
// ],
|
||||
// 'incentive_file_name' => [
|
||||
// 'required' => 'File name is required',
|
||||
// 'max_length' => 'File name cannot exceed 150 characters',
|
||||
// ],
|
||||
// ];
|
||||
|
||||
// protected $skipValidation = false;
|
||||
}
|
||||
72
app/Models/PartnerPolicyModel.php
Executable file
72
app/Models/PartnerPolicyModel.php
Executable file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class PartnerPolicyModel extends Model
|
||||
{
|
||||
protected $table = 'partner_policy';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
// Allowed fields (make sure to include only updatable/insertable ones)
|
||||
protected $allowedFields = [
|
||||
'quotation_id',
|
||||
'insured_name',
|
||||
'rc_no',
|
||||
'premium_amount',
|
||||
'policy_number',
|
||||
'payment_mode',
|
||||
'policy_pdf_file_name',
|
||||
'policy_payment_receipt_file_name',
|
||||
'is_active',
|
||||
'issued_date',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'manager_id',
|
||||
'client_id',
|
||||
'client_policy_id',
|
||||
'vehicle_id',
|
||||
'policy_transaction_id',
|
||||
'pt_oc_share_details_id',
|
||||
'created_by',
|
||||
'updated_by'
|
||||
];
|
||||
|
||||
// Optional settings
|
||||
protected $useTimestamps = true; // enables auto timestamp
|
||||
protected $createdField = 'created_on';
|
||||
protected $updatedField = 'updated_on';
|
||||
protected $dateFormat = 'datetime';
|
||||
|
||||
|
||||
public function partnerPolicyList()
|
||||
{
|
||||
return $this->db->table('partner_policy as pp')
|
||||
->select('
|
||||
pp.id,
|
||||
pp.id as partner_policy_id,
|
||||
pp.enquiry_id,
|
||||
pp.insured_name,
|
||||
pp.policy_number,
|
||||
pp.agent_id,
|
||||
pp.manager_id,
|
||||
pp.client_id,
|
||||
pp.client_policy_id,
|
||||
pp.is_active as partner_policy_is_active,
|
||||
pe.insurer_id,
|
||||
pe.is_active as partner_enquiry_is_active,
|
||||
i.name as insurer_name,
|
||||
i.short_name as insurer_short_name,
|
||||
i.is_active as insurer_is_active
|
||||
')
|
||||
->join('partner_enquiry as pe', 'pe.id = pp.enquiry_id', 'left')
|
||||
->join('insurers as i', 'i.id = pe.insurer_id', 'left')
|
||||
->where('pp.is_active', 1)
|
||||
->get()
|
||||
->getResultArray();
|
||||
}
|
||||
// $data['partner_policy_list'] = $this->partnerPolicyModel
|
||||
// ->where('is_active', 1)
|
||||
// ->findAll();
|
||||
}
|
||||
50
app/Models/PartnerStaffModel.php
Executable file
50
app/Models/PartnerStaffModel.php
Executable file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class PartnerStaffModel extends Model
|
||||
{
|
||||
protected $table = 'partner_staff'; // table name
|
||||
protected $primaryKey = 'id'; // primary key
|
||||
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
// return results as array
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = false;
|
||||
|
||||
// allowed fields for insert/update
|
||||
protected $allowedFields = ['name','email','mobile','emp_id','role_id','email_otp','is_active','created_by','updated_by','manager_id'];
|
||||
|
||||
// automatic timestamps
|
||||
protected $useTimestamps = true;
|
||||
protected $createdField = 'created_on';
|
||||
protected $updatedField = 'updated_on';
|
||||
protected $dateFormat = 'datetime';
|
||||
|
||||
// validation rules
|
||||
// protected $validationRules = [
|
||||
// 'name' => 'required|min_length[2]|max_length[150]',
|
||||
// 'email' => 'permit_empty|valid_email|max_length[150]',
|
||||
// 'mobile' => 'permit_empty|regex_match[/^[0-9]{10,20}$/]',
|
||||
// ];
|
||||
|
||||
// protected $validationMessages = [
|
||||
// 'name' => [
|
||||
// 'required' => 'Name is required',
|
||||
// 'min_length' => 'Name must have at least 2 characters',
|
||||
// 'max_length' => 'Name cannot exceed 150 characters'
|
||||
// ],
|
||||
// 'email' => [
|
||||
// 'valid_email' => 'Please provide a valid email address',
|
||||
// 'max_length' => 'Email cannot exceed 150 characters'
|
||||
// ],
|
||||
// 'mobile' => [
|
||||
// 'regex_match' => 'Mobile number must be 10–20 digits only'
|
||||
// ]
|
||||
// ];
|
||||
|
||||
// protected $skipValidation = false;
|
||||
}
|
||||
@ -79,7 +79,10 @@ class TicketMasterModel extends Model
|
||||
'approved_description',
|
||||
'file_id',
|
||||
'denial_letter',
|
||||
|
||||
|
||||
'manager_id',
|
||||
'agent_id' ,
|
||||
'vehicle_id',
|
||||
];
|
||||
|
||||
|
||||
@ -788,13 +791,13 @@ class TicketMasterModel extends Model
|
||||
}
|
||||
|
||||
//api
|
||||
public function get_ticket_data($emp_id, $ticket_type = null, $ticket_id = null)
|
||||
public function get_ticket_data($emp_id, $returnType,$ticket_type = null, $ticket_id = null)
|
||||
{
|
||||
$query = $this->select('ticket_master.*, tms.mail_subject as subject')
|
||||
$query = $this->select('ticket_master.*, tms.mail_subject as subject, tms.id as ticket_message_id')
|
||||
->join('ticket_messages tms', 'ticket_master.id = tms.ticket_id', 'left')
|
||||
->where('ticket_master.is_active', 1)
|
||||
->where('tms.sender', "user")
|
||||
->where('ticket_master.emp_id', $emp_id);
|
||||
->where('ticket_master.is_active', 1);
|
||||
$query->whereIn('sender', ['staff', 'user']);
|
||||
$query->where('ticket_master.emp_id', $emp_id);
|
||||
|
||||
if (!empty($ticket_id)) {
|
||||
$query->where('ticket_master.id', $ticket_id);
|
||||
@ -804,8 +807,10 @@ class TicketMasterModel extends Model
|
||||
$query->where('ticket_master.ticket_type_id', $ticket_type);
|
||||
}
|
||||
|
||||
$query->groupBy('ticket_master.id');
|
||||
$data = $query->findAll();
|
||||
// dd($data, db_connect()->getLastQuery());
|
||||
// dd($data, db_connect()->getLastQuery());
|
||||
// print_r($this->db->getLastQuery());die;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@ -167,28 +167,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
.navtab-bg .nav-link {
|
||||
margin: 0 5px 10px!important;
|
||||
}
|
||||
|
||||
.nav-link{
|
||||
color:black !important;
|
||||
background-color: #D4F5F6 !important;
|
||||
font-size: small;
|
||||
padding:8px;
|
||||
border-radius: 10px !important;
|
||||
}
|
||||
.nav-link.active-tab {
|
||||
color: white !important;
|
||||
background-color: #00999E !important;
|
||||
font-size: small;
|
||||
padding:8px;
|
||||
border-radius: 10px !important;
|
||||
|
||||
}
|
||||
.tab-content-styles{
|
||||
#client_add .tab-content-styles{
|
||||
background-color:#F4F4F4;
|
||||
margin-right:20px;
|
||||
margin-top:0px !important;
|
||||
border-radius:25px!important;
|
||||
min-height: 70vh !important;
|
||||
}
|
||||
@ -200,7 +182,7 @@
|
||||
|
||||
</style>
|
||||
|
||||
<p style="color:black;font-size:x-large;margin-left:50px;margin-bottom:20px;"><b>Dashboard</b></p>
|
||||
<p style="color:black;font-size:x-large;margin-left:20px !important;margin-bottom:20px;"><b>Dashboard</b></p>
|
||||
|
||||
<?php if(in_array(get_role_id(), [1,2,3,4,5]) || (in_array(ENROLLMENT_TEAM_ID, user_team()) || in_array(CLAIMS_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()))) { ?>
|
||||
|
||||
@ -208,8 +190,6 @@
|
||||
<div class="col-12">
|
||||
<!-- <div class="card"> -->
|
||||
<div class="card-body">
|
||||
|
||||
<br>
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
|
||||
<?php if(in_array(get_role_id(), [1,2,3,5])) { ?>
|
||||
@ -275,7 +255,7 @@
|
||||
|
||||
|
||||
</ul>
|
||||
<br>
|
||||
|
||||
<div class="tab-content tab-content-styles">
|
||||
|
||||
<?php if ((get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team())) || in_array(get_role_id(),[1,5])) :?>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,20 +1,21 @@
|
||||
|
||||
<!-- modal content -->
|
||||
<div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
|
||||
<div class="modal-dialog" <?= !isset($CD_Master_Data) ? 'style="max-width: 35% !important;"' : '' ?>>
|
||||
<div id="con-close-modal" class="modal fade app-font-family" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg" <?= !isset($CD_Master_Data) ? 'style="max-width: 35% !important; margin:5px auto!important;"' : '' ?>>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="title">Add Opening Amount</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="resetCdMasterFormModal()">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body p-4">
|
||||
<div class="modal-body">
|
||||
<div class="">
|
||||
<form role="form" class="parsley-examples" id="CDMasterForm" enctype="multipart/form-data">
|
||||
<form role="form" class="parsley-examples" id="CDMasterForm" enctype="multipart/form-data">
|
||||
<input type="hidden" name="PrimaryKey" id="CD_Master_ID" />
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="emp_code">Client<span class="text-danger">*</span></label>
|
||||
<select class="form-control <?= !isset($CD_Master_Data) ? 'readonly-select' : '' ?>" id="cd_client_id" name="client_id" required>
|
||||
<option value="" >Select Client</option>
|
||||
@ -30,10 +31,8 @@
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="profile">Insurer<span class="text-danger">*</span></label>
|
||||
<select class="form-control <?= !isset($CD_Master_Data) ? 'readonly-select' : '' ?>" id="insurer_id_for_cd" name="insurer_id" <?= isset($CD_Master_Data) ? 'onchange="filterInsurerBranch(this)"' : '' ?> required>
|
||||
<option value="">Select Insurer</option>
|
||||
@ -45,7 +44,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="insurer_branch_id">Insurer Branch<span class="text-danger">*</span></label>
|
||||
<select class="form-control <?= !isset($CD_Master_Data) ? 'readonly-select' : '' ?>" id="insurer_branch_id" name="insurer_branch_id" required>
|
||||
<option value="">Select Insurer Branch</option>
|
||||
@ -55,24 +54,23 @@
|
||||
<?php } } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="email">Opening Date<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="opening_date" id="opening_date" required>
|
||||
<div class="input-icon">
|
||||
<input type="text" class="form-control" name="opening_date" id="opening_date" required>
|
||||
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile">CD Account Number<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="cd_ac_no_for_cd_master" name="cd_ac_no" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile">Opening Amount<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="opening_bal" name="opening_bal" onkeypress="return onlyNumbers(event)" required>
|
||||
</div>
|
||||
@ -81,7 +79,8 @@
|
||||
</div>
|
||||
|
||||
<div id="cdButtonWrapper" class="form-group text-right m-b-0">
|
||||
<button class="btn btn-primary waves-effect waves-light mr-1" id="cd_master_btn_Submit">Submit</button>
|
||||
<button class="btn app-btn-outline-secondary mr-2 " type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="resetCdMasterFormModal()">Cancel</button>
|
||||
<button class="btn btn-primary waves-effect waves-light" id="cd_master_btn_Submit">Submit</button>
|
||||
<!-- <button type="button" class="btn btn-secondry waves-effect waves-light mr-1" data-dismiss="modal" aria-hidden="true">Close</button> -->
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -55,10 +55,10 @@ table.dataTable thead th {
|
||||
<div class="row" id="client_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-body maincard">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">CD Master List</h4>
|
||||
<h4 style="position: relative;">CD Master</h4>
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right; position: relative;top: 56px;">
|
||||
<!-- <button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light"
|
||||
|
||||
@ -116,7 +116,7 @@
|
||||
frameEndpoint: `<?=base_url('widget')?>`,
|
||||
title: "Ask ILA",
|
||||
placeholderText: "Type your message here...",
|
||||
aboutText: "Insurance Assistant ILA",
|
||||
aboutText: "Press enter to send messages",
|
||||
enableAttachments: false,
|
||||
introMessage: ('Welcome '+ name + '...! Say Hi...'),
|
||||
bubbleAvatarUrl:"https://botman.io/img/logo.png",
|
||||
@ -570,10 +570,10 @@ function setupMessageObserver() {
|
||||
if (window.botmanWidget) {
|
||||
botmanChatWidget.open();
|
||||
|
||||
setTimeout(function(){
|
||||
botmanChatWidget.sayAsBot('Hi ' + (typeof name !== "undefined" && name !== null && name !== "" ? name : "Guest User") + ', This is ILA your Insurance Assistant, plz choose the following options');
|
||||
botmanChatWidget.whisper('Hi');
|
||||
}, 1000);
|
||||
// setTimeout(function(){
|
||||
// botmanChatWidget.sayAsBot('Hi ' + (typeof name !== "undefined" && name !== null && name !== "" ? name : "Guest User") + ', This is ILA your Insurance Assistant, plz choose the following options');
|
||||
// botmanChatWidget.whisper('Hi');
|
||||
// }, 10);
|
||||
|
||||
applyBotManChatCSS();
|
||||
|
||||
@ -593,6 +593,14 @@ function setupMessageObserver() {
|
||||
chatFrame.addEventListener("load", () => {
|
||||
console.log('Iframe loaded event triggered');
|
||||
setTimeout(() => injectCSS(chatFrame), 100);
|
||||
|
||||
// DADA
|
||||
setTimeout(function(){
|
||||
botmanChatWidget.sayAsBot('Hi ' + (typeof name !== "undefined" && name !== null && name !== "" ? name : "Guest User") + ', This is ILA your Insurance Assistant, plz choose the following options');
|
||||
botmanChatWidget.whisper('Hi');
|
||||
}, 100);
|
||||
|
||||
// DADA
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -677,8 +685,8 @@ function setupMessageObserver() {
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
|
||||
</head>
|
||||
|
||||
<script src='https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/js/widget.js'></script>
|
||||
|
||||
|
||||
@ -64,11 +64,30 @@ input:checked + .slider:before {
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
|
||||
<form role="form" class="parsley-examples" method="post" id="general_form" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="general_PrimaryKey" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
||||
<input type="hidden" name="client_id" id="client_id" />
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="">Upload Your Logo</label> <br>
|
||||
<img
|
||||
src="<?= isset($client['client_logo']) && !empty($client['client_logo']) ? base_url() . "public/uploads/logo/" . $client['client_logo'] : base_url()."public/assets/images/avatar_2x.png" ?>"
|
||||
width="75" height="75"
|
||||
id="uploadPreview"
|
||||
class="avatar img-circle img-thumbnail"
|
||||
style="border-radius:25px; border:1px solid #00999E;padding:10px;color:#00999E;"
|
||||
alt="avatar"/>
|
||||
<span style="margin-bottom:5px;">
|
||||
<input type="file" name="client_logo" id="client_logo" accept="image/*" onchange="PreviewImage();"><br>
|
||||
<i class="text">( Image dimensions 100 x 100 pixels and size of 200KB. )</i>
|
||||
</span>
|
||||
<br>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="entity_type_id">Entity Type <span
|
||||
@ -125,16 +144,7 @@ input:checked + .slider:before {
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="gst">Logo</label>
|
||||
<input type="file" name="client_logo" id="client_logo" accept="image/*" onchange="PreviewImage();"><br>
|
||||
<i class="text">( Image dimensions 100 x 100 pixels and size of 200KB. )</i>
|
||||
</div>
|
||||
<div class="form-group col-md-6 float-right" style="position: relative;top: 20px;">
|
||||
<img src="<?= isset($client['client_logo']) && !empty($client['client_logo']) ? base_url() . "public/uploads/logo/" . $client['client_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>
|
||||
<label class="switch">
|
||||
@ -346,7 +356,7 @@ input:checked + .slider:before {
|
||||
if (!allowedExtensions.includes(fileExtension) || file.size > 200 * 1024) {
|
||||
toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.');
|
||||
fileInput.value = ""; // Clear the file input
|
||||
document.getElementById("uploadPreview").src = "http://ssl.gstatic.com/accounts/ui/avatar_2x.png"; // Remove the preview image
|
||||
document.getElementById("uploadPreview").src = "<?= base_url()?>/public/assets/images/avatar_2x.png"; // Remove the preview image
|
||||
} else {
|
||||
var reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
@ -368,7 +378,7 @@ input:checked + .slider:before {
|
||||
// Check if the file extension is allowed
|
||||
if (!allowedExtensions.includes(fileExtension)) {
|
||||
toastr.warning('Only JPG, JPEG, PNG files are allowed.', 'Invalid file type.');
|
||||
$("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png");
|
||||
$("#uploadPreview").attr("src", "<?= base_url()?>/public/assets/images/avatar_2x.png");
|
||||
input.value = "";
|
||||
}
|
||||
|
||||
@ -377,7 +387,7 @@ input:checked + .slider:before {
|
||||
const fileSize = file.size / 1024; // in KB
|
||||
if (fileSize > 200) {
|
||||
toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.');
|
||||
$("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png");
|
||||
$("#uploadPreview").attr("src", "<?= base_url()?>/public/assets/images/avatar_2x.png");
|
||||
input.value = "";
|
||||
}
|
||||
|
||||
@ -386,7 +396,7 @@ input:checked + .slider:before {
|
||||
img.onload = function() {
|
||||
if (this.width !== 100 || this.height !== 100) {
|
||||
toastr.warning('Image dimensions should be 100x100 pixels.', 'Invalid image dimensions.');
|
||||
$("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png");
|
||||
$("#uploadPreview").attr("src", "<?= base_url()?>/public/assets/images/avatar_2x.png");
|
||||
}
|
||||
// If both size and dimensions are valid, you can proceed with your logic here
|
||||
// For example, you can display the image
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
<div class="table-responsive" id="branch_table">
|
||||
|
||||
<table data-custom-table-css="table" class="table table-borderless table-nowrap mb-0">
|
||||
<thead class="thead-light">
|
||||
<thead class="">
|
||||
<tr>
|
||||
<th>Branch Name</th>
|
||||
<th>Branch Code</th>
|
||||
@ -343,6 +343,8 @@ $('.btnBack').click(function() {
|
||||
}
|
||||
}
|
||||
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
|
||||
})
|
||||
|
||||
$("#branch_form").submit(function(event) {
|
||||
@ -466,7 +468,12 @@ $("#branch_form").submit(function(event) {
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
console.log('Something Wrong!', 'warning');
|
||||
}, 300);
|
||||
},
|
||||
complete: function() {
|
||||
console.log('Ajax request completed');
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
contactCount = 1
|
||||
@ -511,7 +518,7 @@ $('body').on('click', '.btnBranchEdit', function() {
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 500);
|
||||
|
||||
// console.log('branch contact : ',res.contact)
|
||||
|
||||
|
||||
$('#add_branch').show();
|
||||
$('#branch_table').hide();
|
||||
|
||||
@ -1,3 +1,16 @@
|
||||
<style>
|
||||
#relationship_manager {
|
||||
border-collapse: separate; /* important */
|
||||
border-spacing: 20px 0; /* 20px horizontal, 0 vertical */
|
||||
}
|
||||
|
||||
#client_info_modal .modal-body{
|
||||
padding:20px 0px 10px 40px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<div id="client_info">
|
||||
|
||||
<div class="row">
|
||||
@ -34,62 +47,25 @@
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
|
||||
<div class="card-body" style="position: relative;bottom: 25px;">
|
||||
|
||||
<h2>Relationship Manager</h2>
|
||||
<br>
|
||||
<div class="row">
|
||||
<!--
|
||||
<div class="col-6">
|
||||
|
||||
<table data-custom-table-css="table">
|
||||
<tr>
|
||||
<td style="font-size: 18px;"></td>
|
||||
</tr>
|
||||
<table id="relationship_manager">
|
||||
<thead>
|
||||
<tr style="color:black;">
|
||||
<th>Account Manager</th>
|
||||
<th>Manager</th>
|
||||
<th>Head</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr style="color:black;">
|
||||
<td><?= implode(', ', $account_managers) ?></td>
|
||||
<td><?= implode(', ', $managers) ?></td>
|
||||
<td><?= implode(', ', $heads) ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div> -->
|
||||
|
||||
<div class="col-6">
|
||||
|
||||
<table data-custom-table-css="table">
|
||||
<tr>
|
||||
<td style="font-size: 18px;"> <strong> Relationship Manager </strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- <div class="col-6">
|
||||
<table data-custom-table-css="table">
|
||||
<tr>
|
||||
<td style="padding: 3px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 3px;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div> -->
|
||||
|
||||
<div class="col-6">
|
||||
<table data-custom-table-css="table">
|
||||
<tr>
|
||||
<td style="padding: 3px;"><label> Account Manager :
|
||||
</label> <?= implode(', ', $account_managers) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 3px;"><label> Manager :
|
||||
</label> <?= implode(', ', $managers) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 3px;"><label> Head : </label>
|
||||
<?= implode(', ', $heads) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -138,7 +114,7 @@
|
||||
<?php foreach ($client_policy as $key => $value) { ?>
|
||||
<tr class="policy_terms"
|
||||
data-id="<?= htmlspecialchars($value['policy_terms']) ?>"
|
||||
data-toggle="modal" data-target="#bs-example-modal-lg">
|
||||
data-toggle="modal" data-target="#client_info_modal">
|
||||
<td><?= $value['branch_name'] ?></td>
|
||||
<td><?= $value['policy_type'] ?></td>
|
||||
<td><?= $value['insurer_short_name'] ?></td>
|
||||
@ -243,7 +219,7 @@
|
||||
|
||||
|
||||
<!-- Modal content for the Large example -->
|
||||
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
|
||||
<div class="modal fade" id="client_info_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
|
||||
aria-hidden="true" aria-modal="true" data-backdrop="static" style="padding-right: 15px">
|
||||
<div class="modal-dialog modal-full-width">
|
||||
<div class="modal-content">
|
||||
|
||||
@ -1,4 +1,35 @@
|
||||
<style>
|
||||
#kyc_table #tbody td,
|
||||
#other_docs_table tbody td
|
||||
{
|
||||
background-color: white !important;
|
||||
}
|
||||
|
||||
#kyc_table #tbody tr ,
|
||||
#other_docs_table tbody tr
|
||||
{
|
||||
box-shadow: 0px 2px 4px 0px #00000024;
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#kyc_table #tbody tr:hover td ,
|
||||
#other_docs_table tr:hover td
|
||||
{
|
||||
background-color: #e0e0e0 !important;
|
||||
}
|
||||
|
||||
#KYC-DOC-tab .card-body ,
|
||||
#other_docs_table .card-body
|
||||
{
|
||||
background-color: #F5FFFF !important;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 4px 4px 0px #00000040;
|
||||
}
|
||||
|
||||
#KYC-DOC-tab thead{
|
||||
padding: 15px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -12,19 +43,19 @@
|
||||
<table data-custom-table-css="table" id="kyc_table" class="table table-sm mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.no</th>
|
||||
<th>Document Name</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
<?= isset($client_kyc_primary_table) ? $client_kyc_primary_table : "" ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- end table-responsive-->
|
||||
|
||||
<hr>
|
||||
|
||||
<button class="btn btn-primary waves-effect waves-light btn-sm" id="btn_other_docs">Other Documents</button>
|
||||
<!-- <button class="btn btn-primary waves-effect waves-light btn-sm" id="btn_other_docs">Other Documents</button> -->
|
||||
|
||||
</div>
|
||||
</div> <!-- end card -->
|
||||
@ -34,28 +65,31 @@
|
||||
<div class="col-12">
|
||||
<div class="card" style="margin-left: 12px;margin-right: -12px;">
|
||||
<div class="card-body">
|
||||
<h3>Additional Documents</h3>
|
||||
<form role="form" class="parsley-examples" method="post" id="kyc_form"
|
||||
enctype="multipart/form-data">
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="kyc_PrimaryKey" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
||||
<input type="hidden" name="client_id" id="client_id_kyc" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
||||
<input type="hidden" name="kyc_doc_type_id" value="0" />
|
||||
<input type="hidden" name="kyc_doc_type_id" value="" />
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="emp_code">Other Documents<span
|
||||
<label for="emp_code">Document Name<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="other_docs_name" placeholder="Document Name" name="other_docs_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="kyc_docs">File<span
|
||||
class="text-danger">*</span></label>
|
||||
<input class="form-control" type="file" name="file_name" id="kyc_docs_file" required accept=".pdf, .jpeg, .jpg, .png">
|
||||
<input class="form-control" type="file" name="file_name"
|
||||
id="kyc_docs_file"
|
||||
required accept=".pdf, .jpeg, .jpg, .png">
|
||||
</div>
|
||||
<!-- <div class="form-group col-md-4 align-self-end"> -->
|
||||
<div class="form-group col-md-4" style="<?= isset($client['id']) ? 'margin-top: 41px;' : 'margin-top: 30px;' ?>">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"id="btnSubmit">Upload</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"id="btnSubmit">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -79,10 +113,10 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="other_docs">
|
||||
<?= isset($client_kyc_other_table) ? $client_kyc_other_table : "" ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- end table-responsive-->
|
||||
|
||||
</div>
|
||||
</div> <!-- end card -->
|
||||
</div> <!-- end col -->
|
||||
@ -97,10 +131,6 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
kycPrimaryKey = $('#kyc_PrimaryKey').val();
|
||||
|
||||
$('#others').hide()
|
||||
$('#other_docs_table').hide();
|
||||
|
||||
$(document).on('click', '.submit', function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
@ -111,7 +141,6 @@
|
||||
var fileInputs = form.find('input[type="file"]');
|
||||
var allowedExtensions = ['pdf', 'png', 'jpeg', 'jpg'];
|
||||
|
||||
|
||||
if (kycPrimaryKey === '') {
|
||||
toastr.error('Client is required', 'Error');
|
||||
form.trigger('reset')
|
||||
@ -141,7 +170,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
@ -152,94 +180,32 @@
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
// res = JSON.parse(res)
|
||||
console.log(res);
|
||||
|
||||
if(res){
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.success('File Uploaded successfully', 'Success');
|
||||
}, 500);
|
||||
console.log('KYC PRIMARY SUBMIT', res);
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
if(res.status == true){
|
||||
$('#tbody').empty();
|
||||
$('#tbody').append(res.data);
|
||||
toastr.success('File uploaded successfully', 'Success');
|
||||
}else{
|
||||
toastr.warning('File uploaded failed', 'WARNING');
|
||||
}
|
||||
|
||||
form.trigger('reset')
|
||||
$.each(res.data, function (index, item) {
|
||||
|
||||
$('#name_'+item.kyc_doc_type_id).show();
|
||||
$('#name_'+item.kyc_doc_type_id).html(item.file_name);
|
||||
$('#form_'+item.kyc_doc_type_id).hide();
|
||||
|
||||
// var url = "<?= base_url('/downloadGdriveFile'); ?>" +
|
||||
// "?client_id=" + item.client_id +
|
||||
// "&file_type=kyc" +
|
||||
// "&file_name=" + item.file_name +
|
||||
// "&client_policy_id=client_policy_id";
|
||||
|
||||
var url = '<?= base_url('download-kyc-docs/') ?>' + item.file_name;
|
||||
|
||||
// console.log('step 1')
|
||||
|
||||
if(item.file_name != null && item.file_name != ""){
|
||||
// console.log('step 2')
|
||||
|
||||
$('#download_'+item.kyc_doc_type_id).show();
|
||||
$('#download_' + item.kyc_doc_type_id).attr('href', url);
|
||||
$('#delete_'+item.kyc_doc_type_id).show();
|
||||
|
||||
}
|
||||
else{
|
||||
// console.log('step 3')
|
||||
|
||||
$('#download_'+item.kyc_doc_type_id).hide();
|
||||
$('#download_' + item.kyc_doc_type_id).attr('href', '#');
|
||||
$('#delete_'+item.kyc_doc_type_id).hide();
|
||||
|
||||
}
|
||||
// console.log('step 4')
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if(kycPrimaryKey !== ''){
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
var entity_type_id = '<?= isset($client['entity_type_id']) ? $client['entity_type_id'] : '' ?>'
|
||||
var client_id = '<?= isset($client['id']) ? $client['id'] : '' ?>'
|
||||
getKYCEntityDocument(entity_type_id, client_id);
|
||||
|
||||
var data = <?= isset($client_kyc) ? json_encode($client_kyc) : '[]' ?>;
|
||||
appendKycTableListData(data)
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
$('#btn_other_docs').click(function(){
|
||||
$('#others').toggle();
|
||||
$('#other_docs_table').toggle();
|
||||
});
|
||||
|
||||
/*** for Others documents form submit ***/
|
||||
$("#kyc_form").submit(function(event) {
|
||||
event.preventDefault();
|
||||
@ -255,6 +221,7 @@
|
||||
form_action = '<?= base_url("client/kyc/edit"); ?>';
|
||||
}
|
||||
var formData = new FormData($('#kyc_form')[0]);
|
||||
formData.append("form_type", "others");
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
@ -268,74 +235,27 @@
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
setTimeout(function() {
|
||||
console.log('KYC OTHERS SUBMIT', res);
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
// console.log(res);
|
||||
$('#kyc_form').trigger('reset');
|
||||
if(res){
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
var message = (kycPrimaryKey === '') ? 'KYC Other Docs Uploaded successfully' : 'KYC Other Docs Uploaded successfully';
|
||||
toastr.success(message, 'Success');
|
||||
}, 500);
|
||||
|
||||
if(res.status == true){
|
||||
$('#other_docs').empty();
|
||||
$('#other_docs').append(res.data);
|
||||
toastr.success('File uploaded successfully', 'Success');
|
||||
}else{
|
||||
toastr.warning('File uploaded failed', 'WARNING');
|
||||
}
|
||||
|
||||
var other_docs_count = 0;
|
||||
|
||||
$('#other_docs tr').remove();
|
||||
$.each(res.data, function(index, item) {
|
||||
|
||||
if(item.other_docs_name != ""){
|
||||
|
||||
other_docs_count++;
|
||||
}
|
||||
|
||||
// var url = "<?= base_url('/downloadGdriveFile'); ?>" +
|
||||
// "?client_id=" + item.client_id +
|
||||
// "&file_type=kyc" +
|
||||
// "&file_name=" + item.file_name +
|
||||
// "&client_policy_id=client_policy_id";
|
||||
|
||||
|
||||
var url = '<?= base_url('download-kyc-docs/') ?>' + item.file_name;
|
||||
|
||||
// console.log("Current item:", item);
|
||||
if (item.kyc_doc_type_id == '0') {
|
||||
// console.log("Appending item:", item);
|
||||
var rowHtml = `
|
||||
<tr id="kyc-${item.id}">
|
||||
<td>${item.other_docs_name}</td>
|
||||
<td>${item.file_name}</td>
|
||||
<td>
|
||||
<a href = "${url}" data-id="${item.id}" class="mdi mdi-download" style="font-size:18px;" download></a>
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
}
|
||||
$('#other_docs').append(rowHtml);
|
||||
|
||||
//<i data-id="${item.id}" class="mdi mdi-delete btnKycOtherDelete" style="font-size:18px;"></i>
|
||||
|
||||
|
||||
if(other_docs_count > 0){
|
||||
$('#others').show()
|
||||
$('#other_docs_table').show();
|
||||
}
|
||||
});
|
||||
$('#kyc_form').trigger('reset');
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@ -402,6 +322,8 @@
|
||||
contentType: false,
|
||||
success: function (res) {
|
||||
|
||||
console.log("KYC DOCUMENTS TABLE RSPONSE", res);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
@ -412,6 +334,7 @@
|
||||
|
||||
$.each(res.data, function(index, item) {
|
||||
var row = `<tr>
|
||||
<td>${index+1}</td>
|
||||
<td>${item.file_name}</td>
|
||||
<td id="form_${item.id}">
|
||||
<form class="ajax">
|
||||
@ -419,7 +342,7 @@
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>">
|
||||
<input type="hidden" class="form-control" value="${item.id}" name="kyc_doc_type_id">
|
||||
<input type="hidden" name="client_id" value="${client_id}">
|
||||
<button class="btn btn-sm btn-primary submit" style="position: relative; right: 80px;">Submit</button>
|
||||
<button class="btn btn-sm btn-primary submit" style="position: relative; right:0px;">Submit</button>
|
||||
</form>
|
||||
</td>
|
||||
<td id="name_${item.id}" style="display:none;"></td>
|
||||
@ -484,9 +407,8 @@
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
|
||||
}
|
||||
// <i data-id="${item.id}" class="mdi mdi-delete btnKycOtherDelete" style="font-size:18px;"></i>
|
||||
// <i data-id="${item.id}" class="mdi mdi-delete btnKycOtherDelete" style="font-size:18px;"></i>
|
||||
|
||||
});
|
||||
|
||||
|
||||
14
app/Views/client_kyc_other_table.php
Normal file
14
app/Views/client_kyc_other_table.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php if (isset($data) && !empty($data)): ?>
|
||||
<?php foreach ($data as $index => $item): ?>
|
||||
<tr id="kyc-<?= $item['id'] ?>">
|
||||
<!-- <td><?= $index + 1; ?></td> -->
|
||||
<td><?= esc($item['file_name']); ?></td>
|
||||
<td><?= esc($item['other_docs_name']); ?></td>
|
||||
<td><a id="download_<?= esc($item['id']); ?>" data-id="<?= esc($item['id']); ?>" class="mdi mdi-download" style="font-size:18px;" download></a></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td colspan="5" class="text-center">No records found</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
28
app/Views/client_kyc_primary_table.php
Normal file
28
app/Views/client_kyc_primary_table.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php if (isset($data) && !empty($data)): ?>
|
||||
<?php foreach ($data as $index => $item): ?>
|
||||
<tr>
|
||||
<td><?= $index + 1; ?></td>
|
||||
<td><?= esc($item['file_name']); ?></td>
|
||||
|
||||
<?php if(empty($item['upload_doc_name'])) { ?>
|
||||
<td id="form_<?= esc($item['id']); ?>">
|
||||
<form class="ajax" enctype="multipart/form-data" method="post">
|
||||
<input class="file-input__input" type="file" name="file_name">
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>">
|
||||
<input type="hidden" class="form-control" value="<?= esc($item['id']); ?>" name="kyc_doc_type_id">
|
||||
<input type="hidden" name="client_id" value="<?= esc($client_id); ?>">
|
||||
<button type="submit" class="btn btn-sm btn-primary submit" style="position: relative; right: 80px;">Submit</button>
|
||||
</form>
|
||||
</td>
|
||||
<td></td>
|
||||
<?php } else { ?>
|
||||
<td><?= esc($item['upload_doc_name']); ?></td>
|
||||
<td><a id="download_<?= esc($item['id']); ?>" data-id="<?= esc($item['id']); ?>" class="mdi mdi-download" style="font-size:18px;" download></a></td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td colspan="5" class="text-center">No records found</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
@ -48,6 +48,26 @@ table.dataTable thead th {
|
||||
color: #16181b !important;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.add-from-lead{
|
||||
color:#E26828;
|
||||
border : 0px solid white ;
|
||||
background-color: white;
|
||||
text-decoration: underline ;
|
||||
}
|
||||
|
||||
.add-from-lead:hover{
|
||||
color:#E26828;
|
||||
border : 0px solid white ;
|
||||
background-color: white;
|
||||
text-decoration: underline ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<div class="row" id="client_list">
|
||||
@ -69,6 +89,7 @@ table.dataTable thead th {
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">S.No</th>
|
||||
<th class="font-weight-medium">Client Name</th>
|
||||
<th class="font-weight-medium">Account Manager</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
@ -76,8 +97,9 @@ table.dataTable thead th {
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php foreach($clientList as $row){ ?>
|
||||
<?php foreach($clientList as $index => $row){ ?>
|
||||
<tr >
|
||||
<td><?=$index+1?></td>
|
||||
<td class="client_info" data-id="<?php echo $row->id; ?>"><?php echo $row->client_name; ?> ( <?php echo $row->short_name; ?> ) </td>
|
||||
<td>
|
||||
<?php $account_managers = ''; ?>
|
||||
@ -278,6 +300,21 @@ $(document).ready(function()
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [
|
||||
|
||||
{
|
||||
text: 'Add From Lead',
|
||||
className: 'btn-filter add-from-lead', // custom class
|
||||
action: function(e, dt, node, config) {
|
||||
showModal();
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '+ create New Client',
|
||||
className: 'btn-filter buttons-html5', // custom class
|
||||
action: function(e, dt, node, config) {
|
||||
addClient();
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
@ -286,20 +323,6 @@ $(document).ready(function()
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
},
|
||||
{
|
||||
text: 'Add From Lead',
|
||||
className: 'btn-filter', // custom class
|
||||
action: function(e, dt, node, config) {
|
||||
showModal();
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Add',
|
||||
className: 'btn-filter', // custom class
|
||||
action: function(e, dt, node, config) {
|
||||
addClient();
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
@ -258,6 +258,49 @@ body {
|
||||
border-radius: 4px;
|
||||
border: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
#client_add .nav-pills ,
|
||||
#client_add .nav-link
|
||||
{
|
||||
background-color: #F5FFFF !important;
|
||||
color : #00999E !important;
|
||||
border-radius:10px;
|
||||
|
||||
}
|
||||
|
||||
#client_add .nav-pills
|
||||
{
|
||||
background-color: #F5FFFF !important;
|
||||
color : #00999E !important;
|
||||
box-shadow: 0px 2px 4px 0px #00000040;
|
||||
padding-top: 5px ;
|
||||
}
|
||||
|
||||
|
||||
#client_add .nav-link.active-tab {
|
||||
color: white !important;
|
||||
background-color: #00999E !important;
|
||||
font-size: small !important;
|
||||
padding:8px 16px;
|
||||
border-radius: 10px !important;
|
||||
box-shadow: 0px 2px 4px 0px #00000040;
|
||||
|
||||
}
|
||||
|
||||
#hr_activity_history_append_area{
|
||||
padding-top:0;
|
||||
margin-top:0;
|
||||
background-color: #F5FFFF !important;
|
||||
border: 2px solid #F5FFFF;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 4px 4px 0px #00000040;
|
||||
}
|
||||
|
||||
#hr_activity_history_append_area tbody tr{
|
||||
background-color: white !important;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@ -277,7 +320,7 @@ body {
|
||||
|
||||
<br>
|
||||
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<ul class="nav nav-pills navtab-bg" >
|
||||
<li class="nav-item">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-2 active" id="general_tab">
|
||||
@ -357,7 +400,7 @@ body {
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body" id="hr_activity_history_append_area" style="padding-top:0; margin-top:0;">
|
||||
<div class="card-body" id="hr_activity_history_append_area">
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end col -->
|
||||
@ -932,4 +975,16 @@ body {
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#client_add .nav-link').click(function(){
|
||||
|
||||
// change bg color of tab
|
||||
$('#client_add .nav-link').removeClass('active-tab');
|
||||
$(this).addClass('active-tab');
|
||||
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -17,6 +17,14 @@
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#lead_modal .modal-dialog{
|
||||
width:600px !important;
|
||||
}
|
||||
|
||||
#lead_modal .modal-body{
|
||||
min-height: 200px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="save-indicator" id="saveIndicator">Saved</div>
|
||||
@ -29,8 +37,8 @@
|
||||
|
||||
<div class="table-responsive" id="table_list">
|
||||
<table data-custom-table-css="table" class="table table-borderless table mb-0" id="table-client-policy">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<thead class="">
|
||||
<tr style="color:black !important;">
|
||||
<th>Insurer</th>
|
||||
<th>Policy</th>
|
||||
<th>Client Branch</th>
|
||||
@ -231,7 +239,7 @@
|
||||
|
||||
<!-- Center modal content -->
|
||||
<div class="modal fade" id="lead_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="false">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myCenterModalLabel">Lead List</h4>
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
<div class="tab-pane fade" id="RM-tab">
|
||||
<div class="tab-pane fade card " id="RM-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="col-12" id="collapseOne">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row float-right" style="position: relative; bottom: 20px; right:13px;">
|
||||
<button class="btn btn-primary btn-sm" id="client_rm_edit" ><span id="rm_icons" class="mdi mdi-lead-pencil"></span> Edit</button>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<form role="form" class="parsley-examples" method="post" id="relation_form" enctype="multipart/form-data">
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
|
||||
@ -195,7 +195,7 @@
|
||||
<?php } ?>
|
||||
|
||||
<?php if(in_array($employee['policy_type_id'], [2,3,4,5]) && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
|
||||
<a href="<?= base_url('download-e-card/'). $employee['rand_string'] ?>" class="dropdown-item" target="_blank"><i class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>View E-Card</a>
|
||||
<a href="<?= base_url('download-e-card/'). $employee['rand_string'] . "/0/1" ?>" class="dropdown-item" target="_blank"><i class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>View E-Card</a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($employee['relationship'] == 'Self' && in_array($employee['policy_type_id'], [2,3,4,5]) && $employee['email_corporate'] != '' && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
|
||||
@ -245,7 +245,7 @@
|
||||
<!-- modal content -->
|
||||
|
||||
<div id="emp_modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Edit Employee</h4>
|
||||
|
||||
@ -45,18 +45,25 @@ table.dataTable tbody td {
|
||||
color: #16181b !important;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
.row{
|
||||
margin-right:20px !important;
|
||||
margin-left:30px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<h3 class="m-1">
|
||||
<span>Members</span>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
</h3>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
@ -116,7 +123,9 @@ table.dataTable tbody td {
|
||||
<div class="row justify-content-end">
|
||||
<div class="col-auto">
|
||||
<!-- <div id="categoryFilter_12"> -->
|
||||
<a href="#" class="btn btn-primary waves-effect waves-light" onclick="sendManualEcard(this)">Send Ecard</a>
|
||||
<a href="#" class="btn btn-primary waves-effect waves-light"
|
||||
style="background-color: #F5FFFF; color:black; border:1px solid #00999E;"
|
||||
onclick="sendManualEcard(this)">Send Ecard</a>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
|
||||
@ -72,42 +72,37 @@ option:disabled {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="form-row" id="file_upload">
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-12">
|
||||
<label>Upload file</label> [ <a id="excel_download"
|
||||
data-toggle="tooltip" data-placement="top"
|
||||
data-toggle="tooltip" data-placement="top" style="color:#00999E"
|
||||
title="Download Sample Excel">Sample Excel</a> ]
|
||||
<br>
|
||||
<input type="file" name="emplist" id="emplist"
|
||||
accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-start"
|
||||
style="margin-top: 18px;">
|
||||
<div class="form-group col-md-11">
|
||||
<!-- Adjusted the width to 11 columns -->
|
||||
<div class="col-md-3">
|
||||
<button id="emp_form_submit_button" type="submit"
|
||||
class="btn btn-primary waves-effect waves-light justify-content-end">Upload</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<button id="emp_form_submit_button" type="submit"
|
||||
class=" nav-link-btn px-3 py-1 btn btn-primary waves-effect waves-light justify-content-end">Upload</button>
|
||||
|
||||
<div class="form-group col-md-2"
|
||||
style="margin-top: 26px;position: relative;left: 65px;"> OR </div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4" style="margin-top: 18px;">
|
||||
<a class="btn btn-primary waves-effect waves-light justify-content-end"
|
||||
<span style="color:black;"> OR </span>
|
||||
|
||||
|
||||
|
||||
<a class=" nav-link-btn px-3 py-1 btn btn-primary waves-effect waves-light justify-content-end"
|
||||
id="fetch_enrolled_data" data-toggle="modal"
|
||||
data-target="#full-width-modal" title="Download Sample Excel">Fetch
|
||||
Enrolled Data</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -129,6 +124,7 @@ option:disabled {
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="full-width-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="fullWidthModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-full-width">
|
||||
|
||||
@ -14,145 +14,149 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label>Client</label> <br />
|
||||
<select class="form-control" id="clients">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
<div class="container-fluid">
|
||||
<h2>Endorsement</h2>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label>Client</label> <br />
|
||||
<select class="form-control" id="clients">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Branch</label> <br />
|
||||
<select name="branch_id" class="form-control" id="branch_id">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Policy</label> <br />
|
||||
<select class="form-control" id="policies">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Status</label> <br />
|
||||
<select class="form-control" id="status1">
|
||||
<option value="0">Select</option>
|
||||
<?php foreach ($status as $key => $value) { ?>
|
||||
<option value="<?= $key ?>" <?= (isset($getData) && $getData['status'] == $key) ? 'selected' : '' ?>>
|
||||
<?= $value ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Branch</label> <br />
|
||||
<select name="branch_id" class="form-control" id="branch_id">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
<div class="row">
|
||||
<div class="col-12" style="text-align: right;">
|
||||
<a href="<?= base_url("employee/endorsement-list"); ?>" class="btn btn-primary waves-effect waves-light" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Policy</label> <br />
|
||||
<select class="form-control" id="policies">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Status</label> <br />
|
||||
<select class="form-control" id="status1">
|
||||
<option value="0">Select</option>
|
||||
<?php foreach ($status as $key => $value) { ?>
|
||||
<option value="<?= $key ?>" <?= (isset($getData) && $getData['status'] == $key) ? 'selected' : '' ?>>
|
||||
<?= $value ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12" style="text-align: right;">
|
||||
<a href="<?= base_url("employee/endorsement-list"); ?>" class="btn btn-primary waves-effect waves-light" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="client_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Endorsement List</h4>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row" id="client_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Endorsement List</h4>
|
||||
</div>
|
||||
<table data-custom-table-css="table" class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<th class="font-weight-medium">Name/code</th>
|
||||
<th class="font-weight-medium">Policy name</th>
|
||||
<th class="font-weight-medium">Endorsement ID</th>
|
||||
<th class="font-weight-medium">Insurer name</th>
|
||||
<th class="font-weight-medium">Remarks</th>
|
||||
<th class="font-weight-medium">Endorsement Type</th>
|
||||
<th class="font-weight-medium">Status</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="font-12">
|
||||
<?php
|
||||
if (isset($employees)) {
|
||||
foreach ($employees as $key => $employee) { ?>
|
||||
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1) ?></b></td>
|
||||
<td><?php echo $employee['name'] ?>( <?php echo $employee['emp_code'] ?> )</td>
|
||||
<!-- <td><?php echo isset($employee['policy_name']) ? $employee['policy_name'] : '' ?> - <?php echo isset($employee['policy_no']) ? $employee['policy_no'] : '' ?> - <?php echo isset($employee['policy_type']) ? $employee['policy_type'] : '' ?></td> -->
|
||||
<td><?php echo isset($employee['policy_type']) ? $employee['policy_type'] : '' ?> - <?php echo isset($employee['policy_no']) ? $employee['policy_no'] : '' ?></td>
|
||||
<td><?php echo $employee['endorsement_id'] ?></td>
|
||||
<td><?php echo isset($employee['insurer_short_name']) ? $employee['insurer_short_name'] : '' ?>
|
||||
</td>
|
||||
<td><?php echo $employee['remarks'] ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ($employee['actions'] == 'c') {
|
||||
echo 'Correction';
|
||||
} elseif ($employee['actions'] == 'si') {
|
||||
echo 'SI Enhancement';
|
||||
} elseif ($employee['actions'] == 'd') {
|
||||
echo 'Deletion';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($employee['status'] == 'pending') {
|
||||
echo '<span class="badge badge-danger">' . $employee['status'] . '</span>';
|
||||
} elseif ($employee['status'] == 'inprogress') {
|
||||
echo '<span class="badge badge-warning">' . $employee['status'] . '</span>';
|
||||
} elseif ($employee['status'] == 'complete') {
|
||||
echo '<span class="badge badge-success">' . $employee['status'] . '</span>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="text-center"><a href="#" data-id="<?php echo $employee['id'] ?>" class="mdi mdi-eye emp_data_model" aria-hidden="true" data-toggle="modal" data-target="#centermodal"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<table data-custom-table-css="table" class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<th class="font-weight-medium">Name/code</th>
|
||||
<th class="font-weight-medium">Policy name</th>
|
||||
<th class="font-weight-medium">Endorsement ID</th>
|
||||
<th class="font-weight-medium">Insurer name</th>
|
||||
<th class="font-weight-medium">Remarks</th>
|
||||
<th class="font-weight-medium">Endorsement Type</th>
|
||||
<th class="font-weight-medium">Status</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="font-12">
|
||||
<?php
|
||||
if (isset($employees)) {
|
||||
foreach ($employees as $key => $employee) { ?>
|
||||
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1) ?></b></td>
|
||||
<td><?php echo $employee['name'] ?>( <?php echo $employee['emp_code'] ?> )</td>
|
||||
<!-- <td><?php echo isset($employee['policy_name']) ? $employee['policy_name'] : '' ?> - <?php echo isset($employee['policy_no']) ? $employee['policy_no'] : '' ?> - <?php echo isset($employee['policy_type']) ? $employee['policy_type'] : '' ?></td> -->
|
||||
<td><?php echo isset($employee['policy_type']) ? $employee['policy_type'] : '' ?> - <?php echo isset($employee['policy_no']) ? $employee['policy_no'] : '' ?></td>
|
||||
<td><?php echo $employee['endorsement_id'] ?></td>
|
||||
<td><?php echo isset($employee['insurer_short_name']) ? $employee['insurer_short_name'] : '' ?>
|
||||
</td>
|
||||
<td><?php echo $employee['remarks'] ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ($employee['actions'] == 'c') {
|
||||
echo 'Correction';
|
||||
} elseif ($employee['actions'] == 'si') {
|
||||
echo 'SI Enhancement';
|
||||
} elseif ($employee['actions'] == 'd') {
|
||||
echo 'Deletion';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($employee['status'] == 'pending') {
|
||||
echo '<span class="badge badge-danger">' . $employee['status'] . '</span>';
|
||||
} elseif ($employee['status'] == 'inprogress') {
|
||||
echo '<span class="badge badge-warning">' . $employee['status'] . '</span>';
|
||||
} elseif ($employee['status'] == 'complete') {
|
||||
echo '<span class="badge badge-success">' . $employee['status'] . '</span>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="text-center"><a href="#" data-id="<?php echo $employee['id'] ?>" class="mdi mdi-eye emp_data_model" aria-hidden="true" data-toggle="modal" data-target="#centermodal"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Center modal content -->
|
||||
<div class="modal fade" id="centermodal" tabindex="-1" role="dialog" aria-hidden="true" aria-modal="true" data-backdrop="static">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
|
||||
@ -40,15 +40,74 @@
|
||||
.card {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.row.visa_status_count_view .card-header{
|
||||
background-color: #F5FFFF;
|
||||
padding: 25px;
|
||||
border: 2px solid #fff;
|
||||
border-radius: 10px;
|
||||
/* box-shadow: 2px 2px 2px; */
|
||||
box-shadow: 0px 1px 1px 0px #00000040;
|
||||
}
|
||||
|
||||
.row.visa_status_count_view .card-header #categoryFilter_11 a{
|
||||
background-color: #D4F5F6 !important;
|
||||
font-weight:800;
|
||||
color:#000 !important;
|
||||
border : 1px solid #D4F5F6 !important;
|
||||
border-radius: 15px;
|
||||
padding : 5px 10px;
|
||||
}
|
||||
|
||||
#categoryFilter_12 a ,
|
||||
#categoryFilter_13 a ,
|
||||
#categoryFilter_14 a
|
||||
{
|
||||
background-color: #00999E;
|
||||
box-shadow: 0px 2px 4px 0px #00000040;
|
||||
|
||||
}
|
||||
|
||||
#statusContent{
|
||||
background-color: #F5FFFF;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 1px 1px 0px #00000040;
|
||||
}
|
||||
|
||||
#statusContent .statusContent-flex{
|
||||
display:flex;
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
|
||||
.statusContent-flex .my-2{
|
||||
color:black !important;
|
||||
}
|
||||
|
||||
#statusContent .custom-card{
|
||||
min-width:300px;
|
||||
min-height: 50px;
|
||||
padding:15px;
|
||||
background-color: white;
|
||||
color:black;
|
||||
margin-right:15px;
|
||||
margin-top :10px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 2px 4px 0px #00000024 !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<h2>Enrollment</h2>
|
||||
<div class="row visa_status_count_view">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row" style="margin-bottom: -22px;">
|
||||
<div class="row" >
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter" style="display: flex;">
|
||||
<div id="categoryFilter" >
|
||||
<label for="">Client</label>
|
||||
<select class="form-control" id="clients" onchange="populateBranches()">
|
||||
<option value="0">Select Client</option>
|
||||
<?php foreach ($client_list as $client) { ?>
|
||||
@ -59,6 +118,7 @@
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter_11">
|
||||
<label for="">Branch</label>
|
||||
<select name="branch_id" class="form-control" id="branch_id" onchange="populatePolicies()">
|
||||
<option value="0">Select Branch</option>
|
||||
</select>
|
||||
@ -66,106 +126,82 @@
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter_14">
|
||||
<label for="">Policy</label>
|
||||
<select name="client_policy_id" class="form-control" id="client_policy_id">
|
||||
<option value="0">Select Policy</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<div id="categoryFilter_11">
|
||||
<a class="btn btn-primary waves-effect waves-light" onclick="fetchEmpolyeeList(event);" data-toggle="tooltip" data-placement="top" title="Search" id="get-emp-list"><i class="mdi mdi-magnify" aria-hidden="true"></i></a>
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter_11" >
|
||||
<a class="btn btn-primary waves-effect waves-light"
|
||||
style="margin-top:30px !important"
|
||||
onclick="fetchEmpolyeeList(event);"
|
||||
data-toggle="tooltip" data-placement="top" title="Search"
|
||||
id="get-emp-list"><i class="mdi mdi-magnify" aria-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-0" style="margin-right: 15px; ">
|
||||
<div id="categoryFilter_12">
|
||||
<a class="btn btn-primary waves-effect waves-light" onclick="sendManualReminder(this)" data-toggle="tooltip" data-placement="top" title="Send Reminder"><i class="mdi mdi-bell" aria-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-0">
|
||||
<div id="categoryFilter_13">
|
||||
<a class="btn btn-primary waves-effect waves-light" onclick="uploadEnrollmentFile(this)" data-toggle="tooltip" data-placement="top" title="Enrollment File Upload"><i class="mdi mdi-file-export" ></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- </div> -->
|
||||
<div class="col-6" style="margin-right: 15px; margin-top:30px; ">
|
||||
<span id="categoryFilter_12" style="margin-right: 15px;">
|
||||
<a class="btn btn-primary waves-effect waves-light" onclick="sendManualReminder(this)" data-toggle="tooltip" data-placement="top" title="Send Reminder"><span >Send Remainder</span></a>
|
||||
</span>
|
||||
|
||||
<span id="categoryFilter_13" style="margin-right: 15px;">
|
||||
<a class="btn btn-primary waves-effect waves-light" onclick="uploadEnrollmentFile(this)" data-toggle="tooltip" data-placement="top" title="Enrollment File Upload"><span >File Upload</span></a>
|
||||
</span>
|
||||
|
||||
<!-- <div class="row" style="margin-bottom: 44px;"> -->
|
||||
<div class="col-1 text-right view-status-btn" style="position: relative;bottom: 7px;">
|
||||
<button type="button" class="btn btn-link visa_status_button" onclick="toggleContent()" style="color: #000;" data-toggle="tooltip" data-placement="top" title="View Status Card">
|
||||
Status <i id="toggleIcon" class="mdi mdi-minus" style="background-color:white"></i>
|
||||
<button id="categoryFilter_14" type="button" class="btn btn-link visa_status_button" onclick="toggleContent()" data-toggle="tooltip" data-placement="top" >
|
||||
<a class="btn btn-primary waves-effect waves-light" data-toggle="tooltip" data-placement="top" title="View Status"><span >View Status</span></a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-body status-option" id="statusContent" style="padding: 1.5rem !important;background-color: darkgrey;">
|
||||
|
||||
<div class="card-body status-option" id="statusContent" >
|
||||
<h4>Status</h4>
|
||||
<div class="text-center">
|
||||
|
||||
<div class="row" style="margin-left: 125px; margin-bottom: -11px;">
|
||||
<div class="col-xl-2 col-md-2">
|
||||
<div class="card cardWidth">
|
||||
<div class="card-body" id="emp_count_view_click">
|
||||
<div class="d-flex justify-content-between" style="justify-content: center !important;">
|
||||
<div>
|
||||
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Emp Count">Emp Count</h5>
|
||||
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_count_view">0</span></h3>
|
||||
</div>
|
||||
|
||||
<div style="margin-left: 60px; margin-top: 0px;">
|
||||
<div class="statusContent-flex">
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_count_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Emp Count">Emp Count</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_count_view" >0</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
<div class="col-xl-2 col-md-2">
|
||||
<div class="card">
|
||||
<div class="card-body" id="emp_enrolled_view_click">
|
||||
<div class="d-flex justify-content-between" style="justify-content: center !important;">
|
||||
<div>
|
||||
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Enrolled">Enroled</h5>
|
||||
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_enrolled_view">0</span></h3>
|
||||
</div>
|
||||
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_enrolled_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Enrolled">Enroled</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_enrolled_view" >0</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
<div class="col-xl-2 col-md-2">
|
||||
<div class="card">
|
||||
<div class="card-body" id="emp_not_enrolled_view_click">
|
||||
<div class="d-flex justify-content-between" style="justify-content: center !important;">
|
||||
<div>
|
||||
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Not Enrolled">Not Enroled</h5>
|
||||
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_not_enrolled_view">0</span></h3>
|
||||
</div>
|
||||
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_not_enrolled_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Not Enrolled">Not Enroled</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_not_enrolled_view">0</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
<div class="col-xl-2 col-md-2">
|
||||
<div class="card">
|
||||
<div class="card-body" id="emp_logged_in_view_click">
|
||||
<div class="d-flex justify-content-between" style="justify-content: center !important;">
|
||||
<div>
|
||||
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Logged-In">Logged-In</h5>
|
||||
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_logged_in_view">0</span></h3>
|
||||
</div>
|
||||
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_logged_in_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Logged-In">Logged-In</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_logged_in_view">0</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
<div class="col-xl-2 col-md-2">
|
||||
<div class="card">
|
||||
<div class="card-body" id="emp_not_logged_in_view_click">
|
||||
<div class="d-flex justify-content-between" style="justify-content: center !important;">
|
||||
<div>
|
||||
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="Not Logged-In">Not Logged-In</h5>
|
||||
<h3 class="my-2 py-1"><span data-plugin="counterup" id="emp_not_logged_in_view">0</span></h3>
|
||||
</div>
|
||||
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_not_logged_in_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Not Logged-In">Not Logged-In</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_not_logged_in_view">0</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
@ -200,6 +236,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Center modal content -->
|
||||
<div class="modal fade" id="upload_enrollment_model" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="false">
|
||||
|
||||
@ -1,12 +1,76 @@
|
||||
<style>
|
||||
<?php foreach ($hr_access_data as $key => $value) {
|
||||
$key = $key + 1;
|
||||
?>
|
||||
|
||||
|
||||
#user<?php echo "$key"; ?>-active {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#user<?= $key ?>-active .checkbox-item {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#user<?= $key ?>-active label {
|
||||
font-size: 11px !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
#user<?php echo "$key"; ?>-pre {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#user<?= $key ?>-pre .checkbox-item {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#user<?= $key ?>-pre label {
|
||||
font-size: 11px !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
#user<?php echo "$key"; ?>-gmc2 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#user<?= $key ?>-gmc2 .checkbox-item {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#user<?= $key ?>-gmc2 label {
|
||||
font-size: 11px !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
#user<?php echo "$key"; ?>-cd {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#user<?= $key ?>-cd .checkbox-item {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#user<?= $key ?>-cd label {
|
||||
font-size: 11px !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
|
||||
<?php } ?>
|
||||
</style>
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
<?php if(isset($hr_access_data) && !empty($hr_access_data)) { ?>
|
||||
|
||||
<?php if (isset($hr_access_data) && !empty($hr_access_data)) { ?>
|
||||
<form id="insuranceForm" onsubmit="submitForm(event)">
|
||||
|
||||
<?php foreach ($hr_access_data as $key => $value) {
|
||||
$key = $key + 1 ?>
|
||||
$key = $key + 1;
|
||||
?>
|
||||
|
||||
<!-- User 1 Card -->
|
||||
<div class="user-card" data-user-id="<?= 'user' . $key ?>">
|
||||
@ -16,9 +80,9 @@
|
||||
<input type="hidden" name="<?= 'user' . $key ?>_post_hr_id" value="<?= $value['post_hr_id'] ?>">
|
||||
<input type="hidden" name="<?= 'user' . $key ?>_post_client_id" value="<?= $value['post_client_id'] ?>">
|
||||
|
||||
<div class="card-header" onclick="toggleAccordion(this)">
|
||||
<div class="card-header" onclick="toggleAccordion(this)" style="background-color: #F5FFFF;">
|
||||
<div class="user-info">
|
||||
<h5 class="mb-0"><?= $value['hr_name'] ?>
|
||||
<h5 class="mb-0"><?= $value['hr_name'] ?>
|
||||
<!-- <i class="mdi mdi-information-outline" aria-hidden="true" data-id="<?= (!empty($value['pre_hr_id']) ? $value['pre_hr_id'] : 0) . '-' . (!empty($value['post_hr_id']) ? $value['post_hr_id'] : 0) ?>"></i> -->
|
||||
</h5>
|
||||
<p class="user-email"><?= $value['hr_mail'] ?></p>
|
||||
@ -28,7 +92,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="content-inner">
|
||||
<div class="content-inner" style="background-color: #F5FFFF;">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-lg-3">
|
||||
<div class="section">
|
||||
@ -68,7 +132,9 @@
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="policy-checkbox <?= $statusClass ?>" name="<?= 'user' . $key ?>_pre_policies" data-user="<?= $key ?>" data-group="pre" value="<?= $policies['client_policy_id'] ?>"
|
||||
<?= in_array($policies['client_policy_id'], $value['allowed_pre_policies']) ? 'checked' : '' ?>>
|
||||
<label style="<?php if($policies['policy_status'] == 0){echo 'color:#ff5757';} ?>"><?= $policies['policy_type'] . ' - ' . $policies['policy_no'] ?></label>
|
||||
<label style="<?php if ($policies['policy_status'] == 0) {
|
||||
echo 'color:#ff5757';
|
||||
} ?>"><?= $policies['policy_type'] . ' - ' . $policies['policy_no'] ?></label>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
@ -86,9 +152,13 @@
|
||||
} ?>>
|
||||
<i class="mdi mdi-check-circle mr-2"></i>Active policies
|
||||
</div>
|
||||
<div class="<?php if (in_array(2, $value['allowed_post_modules'])) {echo 'checkbox-group';} else {echo 'checkbox-group hidden';} ?>" id="<?= 'user' . $key ?>-active">
|
||||
<div class="<?php if (in_array(2, $value['allowed_post_modules'])) {
|
||||
echo 'checkbox-group';
|
||||
} else {
|
||||
echo 'checkbox-group hidden';
|
||||
} ?>" id="<?= 'user' . $key ?>-active">
|
||||
|
||||
|
||||
|
||||
<!-- Select All -->
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="select-all" data-type="all" data-user="<?= $key ?>" data-group="post">
|
||||
@ -107,14 +177,20 @@
|
||||
<label>Select all In-Active policies</label>
|
||||
</div>
|
||||
|
||||
<?php foreach ($post_policy_data as $key2 => $policies) {
|
||||
<?php foreach ($post_policy_data as $key2 => $policies) {
|
||||
$statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active';
|
||||
$statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive';
|
||||
?>
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="policy-checkbox <?= $statusClass ?>" id="<?= 'user' . $key ?>-gmc2" name="<?= 'user' . $key ?>_active_policies" data-user="<?= $key ?>" data-group="post"
|
||||
value="<?= $policies['client_policy_id'] ?>" <?php if (in_array($policies['client_policy_id'], $value['allowed_active_policies'])) {echo 'checked';} ?>>
|
||||
<label for="<?= 'user' . $key ?>-gmc2" style="<?php if($policies['policy_status'] == 0){echo 'color:#ff5757';} ?>"><?= $policies['policy_type'] . ' - ' . $policies['policy_no'] ?></label>
|
||||
value="<?= $policies['client_policy_id'] ?>" <?php if (in_array($policies['client_policy_id'], $value['allowed_active_policies'])) {
|
||||
echo 'checked';
|
||||
} ?>>
|
||||
<label for="<?= 'user' . $key ?>-gmc2" style="<?php if ($policies['policy_status'] == 0) {
|
||||
echo 'color:#ff5757';
|
||||
} ?>">
|
||||
<?= $policies['policy_type'] . ' - ' . $policies['policy_no'] ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
@ -127,11 +203,17 @@
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<input type="checkbox" class="main-checkbox"
|
||||
onchange="toggleSection(this, '<?= 'user' . $key ?>-cd')" name="<?= 'user' . $key ?>_modules" value="3" <?php if (in_array(3, $value['allowed_post_modules'])) { echo 'checked';} ?>>
|
||||
onchange="toggleSection(this, '<?= 'user' . $key ?>-cd')" name="<?= 'user' . $key ?>_modules" value="3" <?php if (in_array(3, $value['allowed_post_modules'])) {
|
||||
echo 'checked';
|
||||
} ?>>
|
||||
<i class="mdi mdi-file mr-2"></i>CD statement
|
||||
</div>
|
||||
|
||||
<div class="<?php if (in_array(3, $value['allowed_post_modules'])) {echo 'checkbox-group';} else {echo 'checkbox-group hidden';} ?>" id="<?= 'user' . $key ?>-cd">
|
||||
<div class="<?php if (in_array(3, $value['allowed_post_modules'])) {
|
||||
echo 'checkbox-group';
|
||||
} else {
|
||||
echo 'checkbox-group hidden';
|
||||
} ?>" id="<?= 'user' . $key ?>-cd">
|
||||
|
||||
<!-- Select All -->
|
||||
<div class="checkbox-item">
|
||||
@ -141,7 +223,9 @@
|
||||
|
||||
<?php foreach ($post_cd_data as $key3 => $cd) { ?>
|
||||
<div class="checkbox-item">
|
||||
<input type="checkbox" class="policy-checkbox" data-user="<?= $key ?>" data-group="cd" id="<?= 'user' . $key ?>-icici1" name="<?= 'user' . $key ?>_cd" value="<?= $cd['cd_master_pk'] ?>" <?php if (in_array($cd['cd_master_pk'], $value['allowed_cd'])) { echo 'checked';} ?>>
|
||||
<input type="checkbox" class="policy-checkbox" data-user="<?= $key ?>" data-group="cd" id="<?= 'user' . $key ?>-icici1" name="<?= 'user' . $key ?>_cd" value="<?= $cd['cd_master_pk'] ?>" <?php if (in_array($cd['cd_master_pk'], $value['allowed_cd'])) {
|
||||
echo 'checked';
|
||||
} ?>>
|
||||
<label for="<?= 'user' . $key ?>-icici1"><?= $cd['insurer_short_name'] ?> - <span class="policy-number"><?= $cd['cd_account_no'] ?></span></label>
|
||||
</div>
|
||||
<?php } ?>
|
||||
@ -152,7 +236,9 @@
|
||||
<div class="col-md-6 col-lg-3">
|
||||
<div class="section">
|
||||
<div class="section-title">
|
||||
<input type="checkbox" class="main-checkbox" name="<?= 'user' . $key ?>_modules" value="4" <?php if (in_array(4, $value['allowed_post_modules'])) {echo 'checked';} ?>>
|
||||
<input type="checkbox" class="main-checkbox" name="<?= 'user' . $key ?>_modules" value="4" <?php if (in_array(4, $value['allowed_post_modules'])) {
|
||||
echo 'checked';
|
||||
} ?>>
|
||||
<i class="mdi mdi-clipboard-text mr-2"></i>Claims
|
||||
</div>
|
||||
</div>
|
||||
@ -173,7 +259,9 @@
|
||||
</form>
|
||||
|
||||
<?php } else { ?>
|
||||
<div class="submit-container"> <p align="center"> <b>There is no HR data</b></p> </div>
|
||||
<div class="submit-container">
|
||||
<p align="center"> <b>There is no HR data</b></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -23,9 +23,31 @@ table.dataTable tbody td {
|
||||
} */
|
||||
</style>
|
||||
|
||||
<div class="row" style="position: relative;left: 250px;top: 55px;">
|
||||
<style>
|
||||
/* Put this in your CSS */
|
||||
#scroll-horizontal-datatable_wrapper .btn-secondary {
|
||||
cursor: pointer;
|
||||
width: auto;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
border: 1px solid #F5FFFF;
|
||||
background-color: #F5FFFF !important;
|
||||
}
|
||||
|
||||
#scroll-horizontal-datatable_wrapper #submitBtn{
|
||||
background-color: #E26728 !important;
|
||||
color: white !important;
|
||||
border: 1px solid #E26728;
|
||||
padding: 5px 10px !important;
|
||||
border-radius: 10px !important;
|
||||
cursor: pointer !important;
|
||||
box-shadow: 0px 2px 4px 0px #00000024 !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<!-- <div class="row" style="position: relative;left: 250px;top: 55px;">
|
||||
<div class="form-group col-md-3" id="date_div">
|
||||
<!-- <label>ActivityDate<span class="text-danger"></span></label> -->
|
||||
<div id="reportrange" class="form-control" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
|
||||
<i class="mdi mdi-calendar-blank"></i>
|
||||
<span></span> <i class="mdi mdi-menu-down"></i>
|
||||
@ -36,9 +58,9 @@ table.dataTable tbody td {
|
||||
<div class="form-group col-md-3">
|
||||
<button type="button" class="btn btn-primary" onclick="appendHrActivityHistoryHtml(this, true)"> submit </button>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap flex-grow">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S. No</th>
|
||||
@ -69,9 +91,9 @@ $(document).ready(function () {
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
var table = ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-2'f><'col-sm-2'>>" + // Filter left, buttons right
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // search left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-3'i><'col-sm-2'l><'col-sm-7'p>>",
|
||||
language: {
|
||||
@ -80,40 +102,62 @@ $(document).ready(function () {
|
||||
},
|
||||
paging: true,
|
||||
pageLength: 25,
|
||||
ordering: false
|
||||
ordering: false,
|
||||
buttons: [
|
||||
{
|
||||
text: '<div id="reportrange" class="form-control d-inline-block mr-2 custom-daterange" style="background:white; cursor: pointer; width: auto; display:inline-flex; align-items:center;">' +
|
||||
'<i class="mdi mdi-calendar-blank"></i> <span></span> <i class="mdi mdi-menu-down"></i>' +
|
||||
'</div>' +
|
||||
'<input type="hidden" id="startDate">' +
|
||||
'<input type="hidden" id="endDate">' +
|
||||
'<button type="button" id="submitBtn" class="btn btn-primary ml-2">Submit</button>',
|
||||
className: 'btn-group d-inline-block btn-secondary',
|
||||
style : 'background: white; border: 1px solid #ced4da; padding: 5px 10px; border-radius: 5px;',
|
||||
action: function () {
|
||||
appendHrActivityHistoryHtml(this, true);
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// Attach submit handler separately so it works
|
||||
$(document).on("click", "#submitBtn", function () {
|
||||
appendHrActivityHistoryHtml(this, true);
|
||||
});
|
||||
|
||||
// Daterangepicker setup
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const startDateParam = params.get('start_date') || moment().subtract(29, 'days').format('DD-MM-YYYY');
|
||||
const endDateParam = params.get('end_date') || moment().format('DD-MM-YYYY');
|
||||
|
||||
const start = moment(startDateParam, 'DD-MM-YYYY');
|
||||
const end = moment(endDateParam, 'DD-MM-YYYY');
|
||||
|
||||
function cb(start, end) {
|
||||
$('#reportrange span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
||||
$('#startDate').val(start.format('DD-MM-YYYY'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
|
||||
// Daterangepicker setup
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const startDateParam = params.get('start_date') || moment().subtract(29, 'days').format('DD-MM-YYYY');
|
||||
const endDateParam = params.get('end_date') || moment().format('DD-MM-YYYY');
|
||||
|
||||
const start = moment(startDateParam, 'DD-MM-YYYY');
|
||||
const end = moment(endDateParam, 'DD-MM-YYYY');
|
||||
|
||||
function cb(start, end) {
|
||||
$('#reportrange span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
||||
$('#startDate').val(start.format('DD-MM-YYYY'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -55,25 +55,28 @@
|
||||
</script>
|
||||
|
||||
<div class="row" id="client_add" style="position: relative; bottom: 25px;">
|
||||
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<h3>Inception</h3>
|
||||
<br>
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2 active" id="general_tab">
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-1 active-tab" id="general_tab">
|
||||
<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 dash-tab-font">Data From Client</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#KYC-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="kyc_tab">
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<a href="#KYC-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-1" id="kyc_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-file"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Insurer or TPA Data</span>
|
||||
<span class="d-none d-sm-inline-block dash-tab-font">Insurer or TPA Data</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#HR-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="hr_tab">
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<a href="#HR-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-1" id="hr_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-file"></i></span>
|
||||
<span class="d-none d-sm-inline-block">HR Uploaded Files</span>
|
||||
<span class="d-none d-sm-inline-block dash-tab-font">HR Uploaded Files</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<style>
|
||||
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
@ -37,11 +38,11 @@
|
||||
}
|
||||
|
||||
input:checked + .slider {
|
||||
background-color: #2196F3;
|
||||
background-color: #00999E;
|
||||
}
|
||||
|
||||
input:focus + .slider {
|
||||
box-shadow: 0 0 1px #2196F3;
|
||||
box-shadow: 0 0 1px #00999E;
|
||||
}
|
||||
|
||||
input:checked + .slider:before {
|
||||
@ -60,105 +61,130 @@ input:checked + .slider:before {
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="tab-pane fade active show" id="general-q-tab">
|
||||
|
||||
<!---- new ----->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<form role="form" class="parsley-examples" method="post" id="insurer_general_form" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="insurer_General_PrimaryKey" value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>" />
|
||||
<input type="hidden" name="insurer_id" id="insurer_id" />
|
||||
<div class="form-group">
|
||||
<div class="custom-form">
|
||||
<form role="form" class="parsley-examples" method="post" id="insurer_general_form" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="insurer_General_PrimaryKey" value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>" />
|
||||
<input type="hidden" name="insurer_id" id="insurer_id" />
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="insurer_name">Insurer Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="insurer_name" placeholder="Enter Insurer Name" value="<?= isset($insurer['name']) ? $insurer['name'] : '' ?>" name="name" required>
|
||||
</div>
|
||||
<!-- Insurer Name -->
|
||||
<div class="form-group row">
|
||||
<label for="insurer_name" class="col-md-4 col-form-label">Insurer Name<span class="text-danger">*</span></label>
|
||||
<div class="col-md-5">
|
||||
<input type="text" class="form-control" id="insurer_name" placeholder="Enter Insurer Name"
|
||||
value="<?= isset($insurer['name']) ? $insurer['name'] : '' ?>" name="name" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Short Name -->
|
||||
<div class="form-group row">
|
||||
<label for="short_name" class="col-md-4 col-form-label">Insurer Short Name<span class="text-danger">*</span></label>
|
||||
<div class="col-md-5">
|
||||
<input type="text" class="form-control" id="short_name" placeholder="Enter Short Name"
|
||||
value="<?= isset($insurer['short_name']) ? $insurer['short_name'] : '' ?>" name="short_name" required minlength="3" maxlength="8">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Insurer Type -->
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4 col-form-label">Insurer Type</label>
|
||||
<div class="col-md-6 d-flex align-items-center">
|
||||
<input type="radio" id="type_pvt" name="type" value="pvt"
|
||||
<?= isset($insurer['type']) && $insurer['type'] == 'pvt' ? 'checked' : '' ?>>
|
||||
<label for="type_pvt" class="mr-3 ml-2 mt-1 ">PVT</label>
|
||||
<input type="radio" id="type_psu" name="type" value="psu"
|
||||
<?= isset($insurer['type']) && $insurer['type'] == 'psu' ? 'checked' : '' ?>>
|
||||
<label for="type_psu" class="mr-3 ml-2 mt-1 ">PSU</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Insurer Category -->
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4 col-form-label">Insurer Category</label>
|
||||
<div class="col-md-6 d-flex align-items-center">
|
||||
<input type="radio" id="cat_life" name="category" value="life"
|
||||
<?= isset($insurer['category']) && $insurer['category'] == 'life' ? 'checked' : '' ?>>
|
||||
<label for="cat_life" class="mr-3 ml-2 mt-1 ">Life</label>
|
||||
<input type="radio" id="cat_general" name="category" value="general"
|
||||
<?= isset($insurer['category']) && $insurer['category'] == 'general' ? 'checked' : '' ?>>
|
||||
<label for="cat_general" class="mr-3 ml-2 mt-1 ">General (Non Life)</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Add one day (Addition) -->
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4 col-form-label">Add one day to date of coverage when Addition/Dependent addition</label>
|
||||
<div class="col-md-6 d-flex align-items-center">
|
||||
<label class="switch">
|
||||
<input id="addition_add_day" type="checkbox" name="addition_add_day"
|
||||
<?= (isset($insurer['addition_add_day']) && $insurer['addition_add_day'] == 1) ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Add one day (Deletion) -->
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4 col-form-label">Add one day to date of Deletion</label>
|
||||
<div class="col-md-6 d-flex align-items-center">
|
||||
<label class="switch">
|
||||
<input id="deletion_add_day" type="checkbox" name="deletion_add_day"
|
||||
<?= (isset($insurer['deletion_add_day']) && $insurer['deletion_add_day'] == 1) ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Multievent Export -->
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4 col-form-label">Multievent Export</label>
|
||||
<div class="col-md-6 d-flex align-items-center">
|
||||
<label class="switch mb-0">
|
||||
<input id="is_multi_event" type="checkbox" name="is_multi_event"
|
||||
<?= (isset($insurer['is_multi_event']) && $insurer['is_multi_event'] == 1) ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Logo -->
|
||||
<div class="form-group row">
|
||||
<label for="insurer_logo" class="col-md-4 col-form-label">Insurer Logo</label>
|
||||
<div class="col-md-5">
|
||||
<div class="input-icon">
|
||||
<input type="file" class="form-control" id="insurer_logo" name="insurer_logo"
|
||||
accept="image/jpeg, image/jpg, image/png" onchange="PreviewImage();">
|
||||
<i class="mdi mdi-upload additional-icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<img src="<?= isset($insurer['insurer_logo']) && !empty($insurer['insurer_logo']) ? base_url() . "public/uploads/logo/" . $insurer['insurer_logo'] : base_url() . "public/assets/images/avatar_2x.png" ?>"
|
||||
width="100" height="100" id="uploadPreview"
|
||||
class="avatar img-circle img-thumbnail" alt="avatar" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
<label for="short_name">Insurer Short Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="short_name" placeholder="Enter Short Name" value="<?= isset($insurer['short_name']) ? $insurer['short_name'] : '' ?>" name="short_name" required minlength="3" maxlength="8">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label class="switch" style="position: absolute;top: 32px;left: 17px;">
|
||||
<input id="addition_add_day" type="checkbox" name="addition_add_day" <?= (isset($insurer['addition_add_day']) && $insurer['addition_add_day'] == 1) ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
<label for="addition_add_day" style="position: relative;top: 30px;left: 82px;">Add one day to date of coverage when <br> Addition/Dependent addition</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
<label class="switch" style="position: absolute;top: 32px;left: 17px;">
|
||||
<input id="deletion_add_day" type="checkbox" name="deletion_add_day" <?= (isset($insurer['deletion_add_day']) && $insurer['deletion_add_day'] == 1) ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
<label for="deletion_add_day" style="position: relative;top: 30px;left: 82px;">Add one day to date of Deletion </label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
<label for="html">Insurer Type</label><br>
|
||||
<div style="margin-top: 10px;">
|
||||
<input type="radio" id="html" name="type" value="pvt" <?= isset($insurer['type']) && $insurer['type'] == 'pvt' ? 'checked' : '' ?>>
|
||||
<label for="html">PVT</label>
|
||||
<input type="radio" id="css" name="type" value="psu" <?= isset($insurer['type']) && $insurer['type'] == 'psu' ? 'checked' : '' ?>>
|
||||
<label for="css">PSU</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
<label class="switch" style="position: absolute;top: 34px;left: 17px;">
|
||||
<input id="is_multi_event" type="checkbox" name="is_multi_event" <?= (isset($insurer['is_multi_event']) && $insurer['is_multi_event'] == 1) ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
<label for="deletion_add_day" style="position: relative;top: 30px;left: 82px;">Multievent Export</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4" style="position: relative;right: 0px;">
|
||||
<label for="html">Insurer Category</label><br>
|
||||
<div style="margin-top: 10px;">
|
||||
<input type="radio" id="html" name="category" value="life" <?= isset($insurer['category']) && $insurer['category'] == 'life' ? 'checked' : '' ?>>
|
||||
<label for="html">Life</label>
|
||||
<input type="radio" id="css" name="category" value="general" <?= isset($insurer['category']) && $insurer['category'] == 'general' ? 'checked' : '' ?>>
|
||||
<label for="css" style="position: absolute;left: 70px;">General(Non Life)</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="short_name">Insurer Logo<span class="text-danger"></span></label>
|
||||
<input type="file" class="form-control" onchange="PreviewImage();" id="insurer_logo" name="insurer_logo" accept="image/jpeg, image/jpg, image/png">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 float-right" style="position: relative;left: 90px;top: 30px;">
|
||||
<img src="<?= isset($insurer['insurer_logo']) && !empty($insurer['insurer_logo']) ? base_url() . "public/uploads/logo/" . $insurer['insurer_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 class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack" id="btnBack">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- Buttons -->
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12 text-right">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack" id="btnBack">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
<!---- ends ------>
|
||||
</div>
|
||||
<!-- end -->
|
||||
|
||||
|
||||
@ -1,13 +1,46 @@
|
||||
<div class="tab-pane fade" id="branch-tab">
|
||||
<style>
|
||||
.modal-subtitle {
|
||||
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-size: 18px;
|
||||
line-height: 100%;
|
||||
letter-spacing: 0%;
|
||||
text-align: center;
|
||||
margin-top: 5px;
|
||||
color: #6c757d;
|
||||
}
|
||||
</style>
|
||||
<!-- Optional CSS -->
|
||||
<style>
|
||||
/* Make modal really XL and scrollable */
|
||||
#insurerBranchModal .modal-dialog.modal-xl {
|
||||
max-width: 90%;
|
||||
height: 90vh;
|
||||
}
|
||||
|
||||
#insurerBranchModal .modal-content {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#insurerBranchModal .modal-body {
|
||||
overflow-y: auto;
|
||||
max-height: 80vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="tab-pane fade" id="branch-tab" style="padding-left: 25px;">
|
||||
|
||||
<div class="row float-right" style="padding-bottom: 10px;position: relative;right: 13px;">
|
||||
<button type="button" id="btnBranchAdd" class="btn btn-primary waves-effect waves-light btn-sm"><span class="mdi mdi-plus-box-outline" aria-hidden="true" style="padding: 5px 10px;"></span>Add Branch</button>
|
||||
<div class="row float-right" style="padding-bottom: 10px;position: relative;">
|
||||
<a href="#" id="btnBranchAdd" class="btn app-btn-primary mr-2"><span class="mdi mdi-plus" aria-hidden="true" style="padding: 5px 10px;"></span>Add Branch</a>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive" id="branch_table" >
|
||||
|
||||
<table data-custom-table-css="table" class="table table-borderless table-nowrap mb-0">
|
||||
<thead class="thead-light">
|
||||
<table data-custom-table-css="table" class="table table-borderless table-nowrap mb-0" id="branch-datatable">
|
||||
<thead class="">
|
||||
|
||||
<tr>
|
||||
<th>Branch Name</th>
|
||||
<th>Branch Code</th>
|
||||
@ -19,7 +52,7 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="row" id="add_branch">
|
||||
<!-- <div class="row" id="add_branch">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<div class="row float-right" style="position: relative; bottom: 20px; right: 13px;">
|
||||
@ -132,10 +165,158 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end col-->
|
||||
</div> !-- end col-- -->
|
||||
</div>
|
||||
<!-- end -->
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="insurerBranchModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-xl" style="max-width: 1140px !important;">
|
||||
<div class="modal-content">
|
||||
<!-- Modal Header -->
|
||||
<div class="modal-header flex-column">
|
||||
<div class="d-flex w-100 justify-content-between align-items-center">
|
||||
<h4 class="modal-title mb-0" id="modalLabel">New Branch</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Body -->
|
||||
<div class="modal-body" style="overflow-y:auto; max-height:80vh;">
|
||||
<form id="insurer_branch_form" role="form" class="parsley-examples" method="post" action="" enctype="multipart/form-data">
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="insurer_Branch_PrimaryKey" />
|
||||
<input type="hidden" name="insurer_id" id="insurer_id_branch" value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>"/>
|
||||
|
||||
<div class="row">
|
||||
<!-- Left Section: Branch Details -->
|
||||
<div class="col-md-8 d-flex flex-column" style="max-height: calc(80vh - 50px);">
|
||||
<!-- Branch Name & Code -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_name">Branch Name <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_name"
|
||||
placeholder="Enter Branch Name" name="branch_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_code">Branch Code <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_code"
|
||||
placeholder="Enter Branch Code" name="branch_code" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Address Lines -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address1">Address Line 1 <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="address1" name="address1" placeholder="Enter Address 1" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address2">Address Line 2</label>
|
||||
<input type="text" class="form-control" id="address2" placeholder="Enter Address 2" name="address2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- State & District -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="state">State <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="state" name="state" required>
|
||||
<option value="">Select State</option>
|
||||
<?php foreach($state as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="district">District <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="district"
|
||||
placeholder="Enter District" name="district" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- City & Pincode -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_city">City <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_city"
|
||||
placeholder="Enter City" name="city" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="pincode">Pincode <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Submit / Cancel -->
|
||||
<div class="form-row">
|
||||
<!-- <div class="form-group col-md-12 mt-2"> -->
|
||||
<div style="margin-top: 85px;">
|
||||
<button type="submit" class="btn btn-primary mr-2" id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn app-btn-outline-secondary btnBack" id="btnBack" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Section: Contact Details -->
|
||||
<div class="col-md-4" style="background:#f8f9fa; max-height: calc(80vh - 50px); overflow-y:auto; border-radius:8px; padding:10px;">
|
||||
<!-- First Contact -->
|
||||
<div id="contact_1_wrapper" class="bg-white p-2 mb-2 rounded contact-block">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<h6 class="modal-subtitle mb-0">Contact 1</h6>
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="mdi mdi-trash-can text-danger" style="cursor:pointer; font-size:24px !important;" onclick="removeContact(this)" id="${uniqueId}_remove"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Contact Form Fields -->
|
||||
<div class="form-row">
|
||||
<!-- <input type="hidden" name="primarykey[]" id="contact_id_1" value=""/> -->
|
||||
<div class="form-group col-md-12">
|
||||
<label for="name">Name <span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="designation">Designation <span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="email">Email <span class="text-danger">*</span></label>
|
||||
<input value="" type="email" data-parsley-type="email" data-parsley-trigger="change"class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="mobile">Mobile <span class="text-danger">*</span></label>
|
||||
<!-- <input name="mobile[]" pattern="[0-9]{10}" value="" type="tel" data-parsley-type="number" data-parsley-length="[10,10]" class="form-control" placeholder="Enter Contact Mobile" id="mobile" required> -->
|
||||
<!-- oninput="this.value = this.value.replace(/[^0-9]/g,'');" maxlength="10" -->
|
||||
<input value="" name="mobile[]" value="" data-parsley-type="digits" data-parsley-length="[10,10]" data-parsley-trigger="change" type="text" class="form-control" placeholder="Enter Contact Mobile" id="mobile" required maxlength="10" inputmode="numeric">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Container for dynamically added contacts -->
|
||||
<div id="container"></div>
|
||||
|
||||
<div>
|
||||
<button type="button" class="btn btn-primary btn-sm ac me-3" style="width: 100%;" onclick="appendContactHtml()" id="add"><i class="mdi mdi-plus"></i> Add Contact</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
@ -146,14 +327,17 @@
|
||||
$(document).ready(function () {
|
||||
|
||||
insurer_Branch_PrimaryKey = $('#insurer_id_branch').val();
|
||||
var myModal = new bootstrap.Modal(document.getElementById('insurerBranchModal'));
|
||||
myModal.hide();
|
||||
|
||||
$('#add_branch').hide();
|
||||
$('.btnBack').hide();
|
||||
// $('#add_branch').hide();
|
||||
// $('.btnBack').hide();
|
||||
|
||||
if(insurer_Branch_PrimaryKey !== ''){
|
||||
|
||||
var branchTable = '';
|
||||
var data = <?= isset($insuer_branch) ? json_encode($insuer_branch) : '[]' ?>;
|
||||
console.log("insurer branch data", data);
|
||||
$.each(data, function(index, item) {
|
||||
branchTable += `
|
||||
<tr>
|
||||
@ -169,6 +353,10 @@
|
||||
$('#insurer_branch_list').append(branchTable);
|
||||
}
|
||||
|
||||
$('#branch-datatable').DataTable({
|
||||
paging: true ,
|
||||
searching: true
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -177,10 +365,12 @@
|
||||
$("#insurer_branch_form")[0].reset();
|
||||
contactCount = 1
|
||||
insurer_branch_form_action = '<?= base_url("master/insurer/branch/create"); ?>';
|
||||
$('#add_branch').show();
|
||||
$('#branch_table').hide();
|
||||
$('.btnBack').show();
|
||||
$('#btnBranchAdd').hide();
|
||||
var myModal = new bootstrap.Modal(document.getElementById('insurerBranchModal'));
|
||||
myModal.show();
|
||||
// $('#add_branch').show();
|
||||
// $('#branch_table').hide();
|
||||
// $('.btnBack').show();
|
||||
// $('#btnBranchAdd').hide();
|
||||
|
||||
$('#branch_name').val('');
|
||||
$('#branch_code').val('');
|
||||
@ -219,11 +409,13 @@
|
||||
$('.btnBack').click(function(){
|
||||
|
||||
$("#insurer_branch_form")[0].reset();
|
||||
|
||||
contactCount = 1
|
||||
$('#add_branch').hide();
|
||||
$('#branch_table').show();
|
||||
$('.btnBack').hide();
|
||||
$('#btnBranchAdd').show();
|
||||
$('.close').click();
|
||||
// $('#add_branch').hide();
|
||||
// $('#branch_table').show();
|
||||
// $('.btnBack').hide();
|
||||
// $('#btnBranchAdd').show();
|
||||
|
||||
$('#branch_name').val('');
|
||||
$('#branch_code').val('');
|
||||
@ -235,6 +427,7 @@
|
||||
$('#email').val('');
|
||||
$('#mobile').val('');
|
||||
$('#designation').val('');
|
||||
$('#container').empty(); $('#contact_1_wrapper input').val('');
|
||||
|
||||
})
|
||||
|
||||
@ -256,12 +449,12 @@
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
beforeSend: function() {
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
},
|
||||
success: function(res) {
|
||||
$("#insurer_branch_form")[0].reset();
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
$('#insurer_branch_list tr').remove();
|
||||
var insurerBranchTableInsert = ''
|
||||
@ -279,10 +472,13 @@
|
||||
});
|
||||
|
||||
$('#insurer_branch_list').append(insurerBranchTableInsert);
|
||||
$('#add_branch').hide();
|
||||
$('#branch_table').show();
|
||||
$('.btnBack').hide();
|
||||
$('#btnBranchAdd').show();
|
||||
$('#container').empty(); $('#contact_1_wrapper input').val('');
|
||||
$('.close').click();
|
||||
// window.location.reload();
|
||||
// $('#add_branch').hide();
|
||||
// $('#branch_table').show();
|
||||
// $('.btnBack').hide();
|
||||
// $('#btnBranchAdd').show();
|
||||
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
@ -290,10 +486,17 @@
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
},
|
||||
complete: function() {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
$('.close').click();
|
||||
}
|
||||
});
|
||||
|
||||
@ -324,10 +527,13 @@
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
$('#add_branch').show();
|
||||
$('#branch_table').hide();
|
||||
$('.btnBack').show();
|
||||
$('#btnBranchAdd').hide();
|
||||
var myModal = new bootstrap.Modal(document.getElementById('insurerBranchModal'));
|
||||
myModal.show();
|
||||
// $('#add_branch').show();
|
||||
// $('#branch_table').show();
|
||||
// $('.btnBack').show();
|
||||
// $('#btnBranchAdd').hide();
|
||||
console.log("res.levelcontact[0].id"+res.levelcontact[0].id);
|
||||
$('#branch_name').val(res.insurerbranch.branch_name);
|
||||
$('#branch_code').val(res.insurerbranch.branch_code);
|
||||
$('#state option[value="' + res.insurerbranch.state + '"]').prop('selected', true);
|
||||
@ -368,95 +574,198 @@
|
||||
|
||||
|
||||
|
||||
// function appendContactHtml(contact = false, reset = false) {
|
||||
|
||||
// console.log('appendContactHtml function called ')
|
||||
// contactCount++;
|
||||
|
||||
// var container = document.getElementById('container');
|
||||
// var uniqueId = Date.now().toString();
|
||||
|
||||
// var html = `
|
||||
// <div id="${uniqueId}" class="bg-white p-2 mb-2 rounded">
|
||||
// <div class="d-flex justify-content-between align-items-center mb-2">
|
||||
// <h6 class="modal-subtitle mb-0">Contact ${contactCount}</h6>
|
||||
// <div class="d-flex align-items-center">
|
||||
// <i class="mdi mdi-trash-can text-danger" style="cursor:pointer; font-size:24px !important;" onclick="removeContact(this)" id="${uniqueId}_remove"></i>
|
||||
// </div>
|
||||
// </div>
|
||||
// <br>
|
||||
// <div class="form-row">
|
||||
// <input type="hidden" name="primarykey[]" id="contact_id_1" value="${contact !== undefined && contact !== false ? contact.id : ''}"/>
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label>
|
||||
// <input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
// <input data-parsley-type="email" value="${contact !== undefined && contact !== false ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
// <input data-parsley-type="number" data-parsley-length="[10,10]" pattern="[0-9]{10}" value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label>
|
||||
// <input value="${contact !== undefined && contact !== false ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="${uniqueId}_designation" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// `;
|
||||
|
||||
// if(reset == false){
|
||||
// container.insertAdjacentHTML('beforeend', html);
|
||||
// storeButtonId(uniqueId + '_add');
|
||||
|
||||
// if (contactCount >= 3) {
|
||||
// hideStoredAddButtons();
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// function removeContact(button) {
|
||||
// var uniqueId = button.id.split("_")[0];
|
||||
// var contactSection = document.getElementById(uniqueId);
|
||||
|
||||
// if (contactSection) {
|
||||
// contactSection.parentNode.removeChild(contactSection);
|
||||
// contactCount --;
|
||||
|
||||
// if (contactCount < 3) {
|
||||
// var addButton = document.querySelector('.ac');
|
||||
// if (addButton) {
|
||||
// addButton.style.display = 'block';
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// function storeButtonId(id) {
|
||||
|
||||
// var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
// buttonIds.push(id);
|
||||
// localStorage.setItem('buttonIds', JSON.stringify(buttonIds));
|
||||
// }
|
||||
|
||||
|
||||
// function hideStoredAddButtons() {
|
||||
// var storedIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
// storedIds.forEach(function(id) {
|
||||
// var addButton = document.getElementById(id);
|
||||
// var first_addButton = document.querySelector('.ac')
|
||||
// if (addButton) {
|
||||
// addButton.style.display = 'none';
|
||||
// first_addButton.style.display = 'none';
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
function renumberContacts() {
|
||||
var contacts = document.querySelectorAll('.contact-block');
|
||||
|
||||
contacts.forEach(function(contact, index) {
|
||||
let title = contact.querySelector('.modal-subtitle');
|
||||
if (title) {
|
||||
title.textContent = "Contact " + (index + 1); // auto numbering
|
||||
}
|
||||
});
|
||||
|
||||
contactCount = contacts.length; // keep global in sync
|
||||
}
|
||||
|
||||
|
||||
function appendContactHtml(contact = false, reset = false) {
|
||||
console.log('appendContactHtml function called ');
|
||||
|
||||
console.log('appendContactHtml function called ')
|
||||
contactCount++;
|
||||
var container = document.getElementById('container');
|
||||
var uniqueId = Date.now().toString();
|
||||
|
||||
var container = document.getElementById('container');
|
||||
var uniqueId = Date.now().toString();
|
||||
|
||||
var html = `
|
||||
<div id="${uniqueId}">
|
||||
<hr>
|
||||
<h6 class="header-title">Contact ${contactCount}</h6>
|
||||
<br>
|
||||
<div class="form-row">
|
||||
<input type="hidden" name="primarykey[]" id="contact_id_1" value="${contact !== undefined && contact !== false ? contact.id : ''}"/>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
<input data-parsley-type="email" value="${contact !== undefined && contact !== false ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input data-parsley-type="number" data-parsley-length="[10,10]" pattern="[0-9]{10}" value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="${uniqueId}_designation" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display: flex;">
|
||||
<button style="margin-right: 10px;" type="button" class="btn btn-primary btn-sm ac" onclick="appendContactHtml()" id="${uniqueId}_add">Add Contact</button>
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="removeContact(this)" id="${uniqueId}_remove">Remove</button>
|
||||
// <input type="hidden" name="primarykey[]" id="contact_id_1" value="${contact !== undefined && contact !== false ? contact.id : ''}"/>
|
||||
var html = `
|
||||
<div id="${uniqueId}" class="bg-white p-2 mb-2 rounded contact-block">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<h6 class="modal-subtitle mb-0"></h6>
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="mdi mdi-trash-can text-danger" style="cursor:pointer; font-size:24px !important;" onclick="removeContact(this)" id="${uniqueId}_remove"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label>Name<span class="text-danger">*</span></label>
|
||||
<input value="${contact ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" required>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
if(reset == false){
|
||||
container.insertAdjacentHTML('beforeend', html);
|
||||
storeButtonId(uniqueId + '_add');
|
||||
|
||||
if (contactCount >= 3) {
|
||||
hideStoredAddButtons();
|
||||
}
|
||||
}
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label>Designation<span class="text-danger">*</span></label>
|
||||
<input value="${contact ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label>Email<span class="text-danger">*</span></label>
|
||||
<input value="${contact ? contact.email : ''}" type="email" data-parsley-type="email" data-parsley-trigger="change"class="form-control" placeholder="Enter Contact Email" name="email[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label>Mobile<span class="text-danger">*</span></label>
|
||||
<input value="${contact ? contact.mobile : ''}" name="mobile[]" value="" data-parsley-type="digits" data-parsley-length="[10,10]" data-parsley-trigger="change" type="text" class="form-control" placeholder="Enter Contact Mobile" id="mobile" required maxlength="10" inputmode="numeric">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
if(!reset){
|
||||
container.insertAdjacentHTML('beforeend', html);
|
||||
renumberContacts(); // ✅ fix numbering
|
||||
toggleAddButton();
|
||||
}
|
||||
}
|
||||
|
||||
function removeContact(button) {
|
||||
var uniqueId = button.id.split("_")[0];
|
||||
var contactSection = document.getElementById(uniqueId);
|
||||
|
||||
if (contactSection) {
|
||||
contactSection.parentNode.removeChild(contactSection);
|
||||
contactCount --;
|
||||
function removeContact(btn){
|
||||
var $block = $(btn).closest('.contact-block');
|
||||
var isFirst = $block.attr('id') === 'contact_1_wrapper';
|
||||
|
||||
if (contactCount < 3) {
|
||||
var addButton = document.querySelector('.ac');
|
||||
if (addButton) {
|
||||
addButton.style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isFirst) {
|
||||
var $next = $('#container .contact-block').first();
|
||||
if ($next.length){
|
||||
$block.replaceWith($next);
|
||||
$next.attr('id','contact_1_wrapper');
|
||||
$next.find('.modal-subtitle').text('Contact 1');
|
||||
} else {
|
||||
$block.find('input').val('');
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
$block.remove();
|
||||
}
|
||||
|
||||
function storeButtonId(id) {
|
||||
renumberContacts();
|
||||
toggleAddButton();
|
||||
}
|
||||
|
||||
var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
buttonIds.push(id);
|
||||
localStorage.setItem('buttonIds', JSON.stringify(buttonIds));
|
||||
|
||||
function toggleAddButton() {
|
||||
var totalContacts = document.querySelectorAll('.contact-block, #contact_1_wrapper').length;
|
||||
var addButton = document.querySelector('.ac');
|
||||
|
||||
if (totalContacts >= 3) {
|
||||
addButton.style.display = 'none';
|
||||
} else {
|
||||
addButton.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function hideStoredAddButtons() {
|
||||
var storedIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
storedIds.forEach(function(id) {
|
||||
var addButton = document.getElementById(id);
|
||||
var first_addButton = document.querySelector('.ac')
|
||||
if (addButton) {
|
||||
addButton.style.display = 'none';
|
||||
first_addButton.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showNextAddButton() {
|
||||
var storedIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
var addButtonShown = false;
|
||||
|
||||
@ -45,37 +45,40 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="tab-pane fade" id="template-tab">
|
||||
<div class="tab-pane fade" id="template-tab" style="padding-left: 25px;">
|
||||
|
||||
<input type="hidden" id="insurer_templete_count" value="<?= isset($insurer_templete_count) ? $insurer_templete_count : ''?>">
|
||||
<input type="hidden" id="insurer_id" value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>">
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-4">
|
||||
<div class="custom-form">
|
||||
<label for="email">Existing Insurer Export<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="insurer" name="insurer" required>
|
||||
<option value="">Select Insurer</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6" style="position: relative;top: 28px;">
|
||||
<label for="email"><span class="text-danger"></span></label>
|
||||
<a href="#" class="btn btn-primary waves-effect waves-light" onclick="checkInsurerTemplete(this)">Copy</a>
|
||||
<a href="#" class="btn app-btn-secondary mr-2" onclick="checkInsurerTemplete(this)">Copy</a>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2" style="position: relative;top: 28px;left: 80px;">
|
||||
<label for="email"><span class="text-danger"></span></label>
|
||||
<a href="#" class="btn btn-primary waves-effect waves-light" onclick="addNewJsonExportTemplate(this)">Add New</a>
|
||||
<div class="form-group col-md-2" style="position: relative;top: 28px;">
|
||||
<div class="float-right">
|
||||
<label for="email"><span class="text-danger"></span></label>
|
||||
<a href="#" class="btn app-btn-primary " onclick="addNewJsonExportTemplate(this)"><i class="mdi mdi-plus"></i> Add </a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="table-responsive" id="branch_table" >
|
||||
|
||||
<table data-custom-table-css="table" class="table table-borderless table-nowrap mb-0">
|
||||
<thead class="thead-light">
|
||||
<table data-custom-table-css="table" class="table table-borderless table-nowrap mb-0" id="insurer_datatable">
|
||||
<thead class="">
|
||||
|
||||
<tr>
|
||||
<th>S.NO</th>
|
||||
<th>Policy Type</th>
|
||||
@ -164,7 +167,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<hr class="mb-0">
|
||||
|
||||
<!-- <div class="form-row dynamic-form-row">
|
||||
<div class="form-group col-md-5">
|
||||
@ -191,7 +194,7 @@
|
||||
|
||||
</div>
|
||||
<div class="form-group text-right m-b-0" id="hide_smbt_btn">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1">Submit</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -255,7 +258,15 @@
|
||||
$(document).ready(function(){
|
||||
$('#insurer').select2();
|
||||
// $('#event').select2();
|
||||
featchInsurerList()
|
||||
featchInsurerList();
|
||||
|
||||
setTimeout(() => {
|
||||
$('#insurer_datatable').DataTable({
|
||||
paging: true ,
|
||||
searching: true
|
||||
});
|
||||
}, 2000);
|
||||
|
||||
})
|
||||
|
||||
$('#templateForm').submit(function(event) {
|
||||
@ -471,7 +482,12 @@
|
||||
const newRow = document.createElement('div');
|
||||
newRow.className = 'form-row dynamic-form-row';
|
||||
newRow.innerHTML = `
|
||||
|
||||
<div class="mt-3 p-3" style="width: 100%; background: #F7F7F7;
|
||||
border-radius: 30px !important;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
opacity: 1;
|
||||
">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="db_column_name">DataBase Column Name<span class="text-danger"></span></label>
|
||||
<select class="form-control db-column-name-select dbColumn" name="db_column_name[]" onchange="checkForDuplicates(this); handleDbColumnChange(this)" ${data !== null && data !== undefined && data !== '' && data.default_value != "" && data.default_value != null ? 'disabled' : ''}>
|
||||
@ -494,10 +510,11 @@
|
||||
<input id="default_value" value="${data != null && data != undefined && data != '' && data.default_value != "" && data.default_value != null ? data.default_value : ''}" class="form-control" type="text" name="default_value[]" placeholder="Excel Default value">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2" style="position: relative;top: 28px;">
|
||||
<a class="btn btn-primary waves-effect waves-light mr-1" onclick="addHTMLInput(this)">+</a>
|
||||
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this)">x</a>
|
||||
<div class="form-group col-md-2" style="position: relative;left: 28px;">
|
||||
<a class="btn app-btn-secondary waves-effect waves-light mr-1" onclick="addHTMLInput(this)"><i class="mdi mdi-plus text-white" style="cursor:pointer; font-size:15px !important;"></i></a>
|
||||
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this)"><i class="mdi mdi-trash-can text-white" style="cursor:pointer; font-size:15px !important;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
container.appendChild(newRow);
|
||||
if (data != null && data.db_column_name != undefined) {
|
||||
|
||||
@ -43,10 +43,10 @@
|
||||
<div class="row" id="insurer_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-body maincard">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Insurer List</h4>
|
||||
<h4 style="position: relative;">Insurers</h4>
|
||||
</div>
|
||||
</div>
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<div class="row" id="insurer_add">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="card-body maincard">
|
||||
<!-- <div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Insurer</h4>
|
||||
</div>
|
||||
@ -11,12 +11,19 @@
|
||||
<i class="mdi mdi-arrow-left" style="font-size: 17px;"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
<div class="row" style="padding-bottom: 10px;padding-left: 5px;">
|
||||
<h4 class="d-flex align-items-center" style="gap: 8px;">
|
||||
<span onclick="history.back()" style="cursor: pointer;">
|
||||
<i class="mdi mdi-chevron-left" style="font-size: 43px;"></i>
|
||||
</span>
|
||||
<span class="title-text ">Insurer</span>
|
||||
</h4>
|
||||
</div>
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-2 active">
|
||||
class="nav-link px-3 py-2 active-tab active">
|
||||
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
|
||||
<span class="d-none d-sm-inline-block">General</span>
|
||||
</a>
|
||||
@ -61,9 +68,9 @@
|
||||
$('#btnBranchAdd').hide();
|
||||
toastr.warning('First Add the Insurer!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||
// if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||
$('#btnBranchAdd').show();
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<div class="table-responsive" id="branch_table" >
|
||||
|
||||
<table data-custom-table-css="table" class="table table-borderless table-nowrap mb-0" id="table-kyc-docs">
|
||||
<thead class="thead-light">
|
||||
<thead class="">
|
||||
<tr>
|
||||
<th>File Name</th>
|
||||
<th>Action</th>
|
||||
@ -18,7 +18,7 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="row" id="add_branch">
|
||||
<!-- <div class="row" id="add_branch">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<div class="row float-right" style="position: relative; bottom: 20px; right: 13px;">
|
||||
@ -52,19 +52,68 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end col-->
|
||||
</div> end col -->
|
||||
</div>
|
||||
<!-- end -->
|
||||
|
||||
<div class="modal fade" id="kycdocsModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
|
||||
<!-- Modal Header -->
|
||||
<div class="modal-header flex-column">
|
||||
<div class="d-flex w-100 justify-content-between align-items-center">
|
||||
<h4 class="modal-title mb-0" id="modalLabel">KYC Docs</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Body -->
|
||||
<div class="modal-body" style="overflow-y:auto; max-height:80vh;">
|
||||
<form role="form" class="parsley-examples" method="post" id="kyc_docs_form" enctype="multipart/form-data">
|
||||
|
||||
<!-- CSRF + hidden inputs -->
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="kyc_Docs_PrimaryKey" />
|
||||
<input type="hidden" name="kyc_type_id" id="kyc_type_id" value="<?= isset($kyc['id']) ? $kyc['id'] : '' ?>"/>
|
||||
|
||||
<!-- Form fields -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="file_name">KYC Docs File Name <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="file_name" name="file_name" placeholder="Enter File Name" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Form Actions -->
|
||||
<div class="form-group text-right mb-0">
|
||||
<button type="button" class="btn app-btn-outline-secondary waves-effect btnBack" id="btnBack" data-dismiss="modal">
|
||||
Cancel
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">
|
||||
Submit
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
var kyc_Docs_PrimaryKey = $('#kyc_General_PrimaryKey').val();
|
||||
var kyc_docs_form_action = '';
|
||||
|
||||
$('#add_branch').hide();
|
||||
$('.btnBack').hide();
|
||||
var myModal = new bootstrap.Modal(document.getElementById('kycdocsModal'));
|
||||
myModal.hide();
|
||||
// $('#add_branch').hide();
|
||||
// $('.btnBack').hide();
|
||||
|
||||
loadKYCDocsList();
|
||||
|
||||
@ -72,11 +121,12 @@ $(document).ready(function () {
|
||||
$('#btnBranchAdd').click(function(){
|
||||
|
||||
kyc_docs_form_action = '<?= base_url("master/kyc/kycdocs/createpost"); ?>';
|
||||
|
||||
$('#add_branch').show();
|
||||
$('#branch_table').hide();
|
||||
$('.btnBack').show();
|
||||
$('#btnBranchAdd').hide();
|
||||
var myModal = new bootstrap.Modal(document.getElementById('kycdocsModal'));
|
||||
myModal.show();
|
||||
// $('#add_branch').show();
|
||||
// $('#branch_table').hide();
|
||||
// $('.btnBack').show();
|
||||
// $('#btnBranchAdd').hide();
|
||||
|
||||
$('#file_name').val('');
|
||||
$('#state').val('');
|
||||
@ -100,11 +150,12 @@ $(document).ready(function () {
|
||||
})
|
||||
|
||||
$('.btnBack').click(function(){
|
||||
|
||||
$('#add_branch').hide();
|
||||
$('#branch_table').show();
|
||||
$('.btnBack').hide();
|
||||
$('#btnBranchAdd').show();
|
||||
var myModal = new bootstrap.Modal(document.getElementById('kycdocsModal'));
|
||||
myModal.hide();
|
||||
// $('#add_branch').hide();
|
||||
// $('#branch_table').show();
|
||||
// $('.btnBack').hide();
|
||||
// $('#btnBranchAdd').show();
|
||||
|
||||
$('#file_name').val('');
|
||||
$('#state').val('');
|
||||
@ -189,10 +240,12 @@ $(document).ready(function () {
|
||||
`;
|
||||
});
|
||||
$('#kyc_docs_list').append(insurerBranchTableInsert);
|
||||
$('#add_branch').hide();
|
||||
$('#branch_table').show();
|
||||
$('.btnBack').hide();
|
||||
$('#btnBranchAdd').show();
|
||||
var myModal = new bootstrap.Modal(document.getElementById('kycdocsModal'));
|
||||
myModal.hide();
|
||||
// $('#add_branch').hide();
|
||||
// $('#branch_table').show();
|
||||
// $('.btnBack').hide();
|
||||
// $('#btnBranchAdd').show();
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
@ -223,10 +276,12 @@ $(document).ready(function () {
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log("right.........");
|
||||
$('#add_branch').show();
|
||||
$('#branch_table').hide();
|
||||
$('.btnBack').show();
|
||||
$('#btnBranchAdd').hide();
|
||||
var myModal = new bootstrap.Modal(document.getElementById('kycdocsModal'));
|
||||
myModal.show();
|
||||
// $('#add_branch').show();
|
||||
// $('#branch_table').hide();
|
||||
// $('.btnBack').show();
|
||||
// $('#btnBranchAdd').hide();
|
||||
$('#file_name').val(res.policies.file_name);
|
||||
$('#kyc_Docs_PrimaryKey').val(res.policies.id);
|
||||
|
||||
@ -314,7 +369,7 @@ $(document).ready(function () {
|
||||
setTimeout(() => {
|
||||
$('#table-kyc-docs').DataTable({
|
||||
paging: true ,
|
||||
searching: false
|
||||
searching: true
|
||||
});
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<div class="tab-pane fade active show" id="general-q-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<div class="card-body subcard">
|
||||
<div class="custom-form">
|
||||
<form role="form" class="parsley-examples" method="post" id="kyc_general_form" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="kyc_General_PrimaryKey" value="<?= isset($kyc['id']) ? $kyc['id'] : '' ?>"/>
|
||||
@ -16,16 +17,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack"
|
||||
id="btnBack">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
|
||||
@ -43,10 +43,10 @@
|
||||
<div class="row" id="kyc_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-body maincard">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">KYC List</h4>
|
||||
<h4 style="position: relative;">KYC</h4>
|
||||
</div>
|
||||
</div>
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
|
||||
@ -33,19 +33,27 @@ body {
|
||||
<div class="row" id="insurer_add">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-body maincard">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<h4 class="d-flex align-items-center" style="gap: 8px;">
|
||||
<span onclick="history.back()" style="cursor: pointer;">
|
||||
<i class="mdi mdi-chevron-left" style="font-size: 43px;"></i>
|
||||
</span>
|
||||
<span class="title-text ">KYC Entity Type</span>
|
||||
</h4>
|
||||
</div>
|
||||
<!-- <div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">KYC Entity Type</h4>
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right;">
|
||||
<a href="<?= base_url("master/kyc/list"); ?>" ><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i> </a>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-2 active">
|
||||
class="nav-link px-3 py-2 active-tab active">
|
||||
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
|
||||
<span class="d-none d-sm-inline-block">General</span>
|
||||
</a>
|
||||
|
||||
@ -992,6 +992,36 @@ function confirmActionSweertAlert(message = "Are you sure?", confirmText = "Yes,
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('.nav-link').click(function(){
|
||||
|
||||
// change bg color of tab
|
||||
$('.nav-link').removeClass('active-tab');
|
||||
$(this).addClass('active-tab');
|
||||
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function openModal(modalId) {
|
||||
var modalEl = document.getElementById(modalId);
|
||||
|
||||
if (typeof bootstrap !== "undefined" && bootstrap.Modal) {
|
||||
// Bootstrap 5
|
||||
var modal = bootstrap.Modal.getOrCreateInstance(modalEl);
|
||||
modal.show();
|
||||
} else if (typeof $ !== "undefined" && typeof $.fn.modal === "function") {
|
||||
// Bootstrap 4
|
||||
$('#' + modalId).modal('show');
|
||||
} else {
|
||||
console.error("No compatible Bootstrap modal found.");
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -215,8 +215,7 @@ table.dataTable tbody td {
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<a href="javascript:void(0);"
|
||||
class="dropdown-item btnHistory app-text-black"
|
||||
<a class="dropdown-item btnHistory app-text-black"
|
||||
data-id="<?= $row['id']; ?>"
|
||||
title="Click to view Mail History">
|
||||
<i class="mdi mdi-history mr-2 text-muted font-18 vertical-middle"></i>Email History
|
||||
@ -272,7 +271,7 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade app-font-family" id="EmailModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal fade " id="EmailModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-xl" style="max-width: 1140px !important;">
|
||||
<div class="modal-content">
|
||||
|
||||
@ -344,6 +343,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
// Handle clicks on dropdown items
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
console.log("##############");
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
@ -358,7 +358,13 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
if (id) {
|
||||
getLeadsDataForEdit(id, lead_form_type);
|
||||
}
|
||||
}else{
|
||||
}else if (this.classList.contains('btnHistory')) {
|
||||
let lead_id = this.getAttribute('data-id');
|
||||
if(lead_id){ console.log("******** Clicked from td lead_id-", lead_id); getLeadsDataForMailHistory(lead_id); }
|
||||
else{ console.log("******** Clicked from td but i don`t have lead_id"); }
|
||||
|
||||
}
|
||||
else{
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
@ -387,6 +393,16 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
activeDropdown = null;
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener("click", function(e) {
|
||||
if (e.target.closest(".btnHistory")) {
|
||||
let lead_id = e.target.closest(".btnHistory").dataset.id;
|
||||
console.log("******** in triple dot id available - " + lead_id);
|
||||
getLeadsDataForMailHistory(lead_id);
|
||||
}
|
||||
else{ console.log("******** in triple dot but id not available"); }
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@ -462,146 +478,141 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
window.location.href = url;
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
document.addEventListener("click", function(e) {
|
||||
if (e.target.closest(".btnHistory")) {
|
||||
let lead_id = e.target.closest(".btnHistory").dataset.id;
|
||||
console.log("*********" + lead_id);
|
||||
let url = '<?= base_url('/util/getLeadEmailHistory/') ?>' + lead_id;
|
||||
console.log("*********" + url);
|
||||
fetch('<?= base_url('/util/getLeadEmailHistory/') ?>' + lead_id, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Accept": "application/json"
|
||||
function getLeadsDataForMailHistory(lead_id){
|
||||
|
||||
console.log("******** Inside Fnz :", lead_id);
|
||||
let url = '<?= base_url('/util/getLeadEmailHistory/') ?>' + lead_id;
|
||||
console.log("******** Fetching:", url);
|
||||
|
||||
fetch(url, {
|
||||
method: "GET",
|
||||
headers: { "Accept": "application/json" }
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(response => {
|
||||
let container = document.querySelector(".history-container");
|
||||
container.innerHTML = "";
|
||||
if (response.status === "success" && response.data.length > 0) {
|
||||
console.log("******** 1" + response.status);
|
||||
let table = `
|
||||
<div class="table-responsive">
|
||||
<table data-custom-table-css="table" id="historytable" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table">
|
||||
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th><div class="column-header">S.No.</div></th>
|
||||
<th><div class="column-header">From Mail</div></th>
|
||||
<th><div class="column-header">To Mail</div></th>
|
||||
<th><div class="column-header">BCC</div></th>
|
||||
<th><div class="column-header">CC</div></th>
|
||||
<th><div class="column-header">Type</div></th>
|
||||
<th><div class="column-header">Status</div></th>
|
||||
<th><div class="column-header">Date/Time</div></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
`;
|
||||
|
||||
response.data.forEach((row, index) => {
|
||||
let formattedDate = "-";
|
||||
let statusValue = "-";
|
||||
if (row.received_message) {
|
||||
if (row.received_message.toLowerCase().includes("error")) {
|
||||
statusValue = "Failed";
|
||||
} else {
|
||||
statusValue = "Success";
|
||||
}
|
||||
}
|
||||
if (row.created_at) {
|
||||
let dt = new Date(row.created_at);
|
||||
let dateStr = dt.toLocaleDateString("en-GB", {
|
||||
day: "2-digit",
|
||||
month: "long",
|
||||
year: "numeric"
|
||||
});
|
||||
let timeStr = dt.toLocaleTimeString("en-US", {
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
hour12: true
|
||||
}).toLowerCase();
|
||||
formattedDate = `${dateStr} ${timeStr}`;
|
||||
}
|
||||
let fromMails = "-";
|
||||
if (row.from_mail) {
|
||||
fromMails = row.from_mail
|
||||
.split(",") // split by comma
|
||||
.map(m => m.trim().replace(/^"|"$/g, "")) // trim + remove quotes at start/end
|
||||
.filter(m => m !== "") // remo
|
||||
.join("<br>"); // join with line break
|
||||
}
|
||||
let toMails = "-";
|
||||
if (row.mail) {
|
||||
toMails = row.mail
|
||||
.split(",")
|
||||
.map(m => m.trim().replace(/^"|"$/g, ""))
|
||||
.filter(m => m !== "")
|
||||
.join("<br>");
|
||||
}
|
||||
let ccMails = "-";
|
||||
if (row.cc && row.cc.trim() !== "") {
|
||||
ccMails = row.cc
|
||||
.split(",")
|
||||
.map(m => m.trim().replace(/^"|"$/g, ""))
|
||||
.filter(m => m !== "")
|
||||
.join("<br>");
|
||||
}
|
||||
let bccMails = "-";
|
||||
if (row.bcc && row.bcc.trim() !== "") {
|
||||
bccMails = row.bcc
|
||||
.split(",")
|
||||
.map(m => m.trim().replace(/^"|"$/g, ""))
|
||||
.filter(m => m !== "")
|
||||
.join("<br>");
|
||||
}
|
||||
|
||||
|
||||
table += `
|
||||
<tr>
|
||||
<td style="white-space: nowrap !important;">${index + 1}</td>
|
||||
<td style="white-space: nowrap !important;">${fromMails}</td>
|
||||
<td style="white-space: nowrap !important;">${toMails}</td>
|
||||
<td style="white-space: nowrap !important;">${bccMails ? bccMails : '-'}</td>
|
||||
<td style="white-space: nowrap !important;">${ccMails ? ccMails : '-'}</td>
|
||||
<td style="white-space: nowrap !important;">${row.mail_type ? row.mail_type.toUpperCase() : '-'}</td>
|
||||
<td style="white-space: nowrap !important;">${statusValue ? statusValue.toUpperCase() : '-'}</td>
|
||||
<td style="white-space: nowrap !important;">${formattedDate}</td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
table += `</tbody></table>`;
|
||||
container.innerHTML = table;
|
||||
// show modal (if using Bootstrap 5)
|
||||
} else {
|
||||
|
||||
container.innerHTML = `
|
||||
<div class="d-flex justify-content-center align-items-center" style="height: 50vh; width:100%;">
|
||||
<p class="text-center font-color-black"><i>${response.message ?? "No History Available"}</i></p>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
// Show modal always
|
||||
new bootstrap.Modal(document.getElementById("EmailModal")).show();
|
||||
|
||||
})
|
||||
.catch(error => {
|
||||
console.log("******** 3" + error);
|
||||
document.querySelector(".history-container").innerHTML = `
|
||||
<div class="d-flex justify-content-center align-items-center" style="height: 50vh; width:100%;">
|
||||
<p class="text-center font-color-black"><i>No Data Found</i></p>
|
||||
</div>
|
||||
`;
|
||||
let EmailModal = new bootstrap.Modal(document.getElementById("EmailModal"));
|
||||
EmailModal.show();
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(response => {
|
||||
let container = document.querySelector(".history-container");
|
||||
container.innerHTML = ""; // clear old content
|
||||
if (response.status === "success" && response.data.length > 0) {
|
||||
console.log("******** 1" + response.status);
|
||||
let table = `
|
||||
<div class="table-responsive">
|
||||
<table data-custom-table-css="table" id="historytable" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table">
|
||||
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th><div class="column-header">S.No.</div></th>
|
||||
<th><div class="column-header">From Mail</div></th>
|
||||
<th><div class="column-header">To Mail</div></th>
|
||||
<th><div class="column-header">BCC</div></th>
|
||||
<th><div class="column-header">CC</div></th>
|
||||
<th><div class="column-header">Type</div></th>
|
||||
<th><div class="column-header">Status</div></th>
|
||||
<th><div class="column-header">Date/Time</div></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
`;
|
||||
|
||||
response.data.forEach((row, index) => {
|
||||
let formattedDate = "-";
|
||||
let statusValue = "-";
|
||||
if (row.received_message) {
|
||||
if (row.received_message.toLowerCase().includes("error")) {
|
||||
statusValue = "Failed";
|
||||
} else {
|
||||
statusValue = "Success";
|
||||
}
|
||||
}
|
||||
if (row.created_at) {
|
||||
let dt = new Date(row.created_at);
|
||||
let dateStr = dt.toLocaleDateString("en-GB", {
|
||||
day: "2-digit",
|
||||
month: "long",
|
||||
year: "numeric"
|
||||
});
|
||||
let timeStr = dt.toLocaleTimeString("en-US", {
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
hour12: true
|
||||
}).toLowerCase();
|
||||
formattedDate = `${dateStr} ${timeStr}`;
|
||||
}
|
||||
let fromMails = "-";
|
||||
if (row.from_mail) {
|
||||
fromMails = row.from_mail
|
||||
.split(",") // split by comma
|
||||
.map(m => m.trim().replace(/^"|"$/g, "")) // trim + remove quotes at start/end
|
||||
.filter(m => m !== "") // remo
|
||||
.join("<br>"); // join with line break
|
||||
}
|
||||
let toMails = "-";
|
||||
if (row.mail) {
|
||||
toMails = row.mail
|
||||
.split(",")
|
||||
.map(m => m.trim().replace(/^"|"$/g, ""))
|
||||
.filter(m => m !== "")
|
||||
.join("<br>");
|
||||
}
|
||||
let ccMails = "-";
|
||||
if (row.cc && row.cc.trim() !== "") {
|
||||
ccMails = row.cc
|
||||
.split(",")
|
||||
.map(m => m.trim().replace(/^"|"$/g, ""))
|
||||
.filter(m => m !== "")
|
||||
.join("<br>");
|
||||
}
|
||||
let bccMails = "-";
|
||||
if (row.bcc && row.bcc.trim() !== "") {
|
||||
bccMails = row.bcc
|
||||
.split(",")
|
||||
.map(m => m.trim().replace(/^"|"$/g, ""))
|
||||
.filter(m => m !== "")
|
||||
.join("<br>");
|
||||
}
|
||||
|
||||
|
||||
table += `
|
||||
<tr>
|
||||
<td style="white-space: nowrap !important;">${index + 1}</td>
|
||||
<td style="white-space: nowrap !important;">${fromMails}</td>
|
||||
<td style="white-space: nowrap !important;">${toMails}</td>
|
||||
<td style="white-space: nowrap !important;">${bccMails ? bccMails : '-'}</td>
|
||||
<td style="white-space: nowrap !important;">${ccMails ? ccMails : '-'}</td>
|
||||
<td style="white-space: nowrap !important;">${row.mail_type ? row.mail_type.toUpperCase() : '-'}</td>
|
||||
<td style="white-space: nowrap !important;">${statusValue ? statusValue.toUpperCase() : '-'}</td>
|
||||
<td style="white-space: nowrap !important;">${formattedDate}</td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
table += `</tbody></table>`;
|
||||
container.innerHTML = table;
|
||||
} else {
|
||||
console.log("******** 2" + response.status);
|
||||
container.innerHTML = `
|
||||
<div class="d-flex justify-content-center align-items-center" style="height: 50vh; width:100%;">
|
||||
<p class="text-center"><i>${response.message ?? 'No history found'}</i></p>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
// show modal (if using Bootstrap 5)
|
||||
let EmailModal = new bootstrap.Modal(document.getElementById("EmailModal"));
|
||||
EmailModal.show();
|
||||
})
|
||||
.catch(error => {
|
||||
console.log("******** 3" + error);
|
||||
document.querySelector(".history-container").innerHTML = `
|
||||
<div class="d-flex justify-content-center align-items-center" style="height: 50vh; width:100%;">
|
||||
<p class="text-center"><i>No Data Found</i></p>
|
||||
</div>
|
||||
`;
|
||||
let EmailModal = new bootstrap.Modal(document.getElementById("EmailModal"));
|
||||
EmailModal.show();
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
@ -1,37 +1,115 @@
|
||||
<style>
|
||||
#notification_table{
|
||||
overflow-x : unset;
|
||||
#notification_table {
|
||||
overflow-x: unset;
|
||||
}
|
||||
.preview_button{
|
||||
display:none;
|
||||
|
||||
.preview_button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.scrollb {
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
|
||||
#editor-container {
|
||||
width: 100%;
|
||||
min-height: 600px;
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
max-width: 90% !important;
|
||||
width: 90% !important;
|
||||
}
|
||||
.modal-dialog {
|
||||
max-width: 90% !important;
|
||||
width: 90% !important;
|
||||
}
|
||||
|
||||
/* Also ensure the modal body has proper height */
|
||||
/* Also ensure the modal body has proper height */
|
||||
|
||||
.modal-body {
|
||||
min-height: 600px;
|
||||
padding: 20px;
|
||||
}
|
||||
.modal-body {
|
||||
min-height: 600px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* If you're using Bootstrap's modal, you might also want to ensure proper positioning */
|
||||
.modal-dialog {
|
||||
margin: 1.75rem auto;
|
||||
}
|
||||
/* If you're using Bootstrap's modal, you might also want to ensure proper positioning */
|
||||
.modal-dialog {
|
||||
margin: 1.75rem auto;
|
||||
}
|
||||
|
||||
.mail-section {
|
||||
border: 1px solid #00999E;
|
||||
border-radius: 10px;
|
||||
padding: 5px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
/* Custom switch (responsive, no inline styles) */
|
||||
#notification-tab .switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 2.5rem;
|
||||
height: 1.2rem;
|
||||
}
|
||||
|
||||
#notification-tab .switch input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
#notification-tab .slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
inset: 0;
|
||||
background-color: #ccc;
|
||||
transition: 0.3s;
|
||||
border-radius: 34px;
|
||||
}
|
||||
|
||||
#notification-tab .slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 1rem;
|
||||
width: 1rem;
|
||||
left: 0.2rem;
|
||||
bottom: 0.1rem;
|
||||
background-color: #fff;
|
||||
transition: 0.3s;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
#notification-tab input:checked+.slider {
|
||||
background-color: #2196F3;
|
||||
}
|
||||
|
||||
#notification-tab input:checked+.slider:before {
|
||||
transform: translateX(1.2rem);
|
||||
}
|
||||
|
||||
/* Reusable row styling */
|
||||
#notification-tab .mail-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-left: .5rem;
|
||||
padding-right: .5rem;
|
||||
}
|
||||
|
||||
#notification-tab .mail-row .mail-section {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#notification-tab .mail-row .mail-section .left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: .3rem;
|
||||
flex: 0 0 70%;
|
||||
}
|
||||
|
||||
#notification-tab .mail-row .mail-section .right {
|
||||
flex: 0 0 30%;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
<div class="tab-pane fade" id="notification-tab">
|
||||
<input type="hidden" id="client_id_for_client_branch" value="<?= isset($notification['id']) ? $notification['id'] : '' ?>" />
|
||||
@ -106,94 +184,121 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- mail section -->
|
||||
|
||||
|
||||
<!-- Member welcome mail row-->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_name">Member welcome mail</label>
|
||||
<label class="switch">
|
||||
<input id="member_welcome_mail_btn" type="checkbox" name="member_welcome_mail_btn" <?= ($member_welcome_mail == 1) ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
|
||||
<a href="" data-toggle="modal" id="member_welcome_mail" onclick="getMailTemplateData(this)" data-target="#member_welcome_mail_modal">Edit</a>
|
||||
|
||||
<!-- Example: Member welcome mail -->
|
||||
<div class="form-group col-md-6 mail-row">
|
||||
<div class="mail-section">
|
||||
<div class="left">
|
||||
<label class="switch">
|
||||
<input id="member_welcome_mail_btn" type="checkbox" name="member_welcome_mail_btn" <?= ($member_welcome_mail == 1) ? 'checked' : '' ?>>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
<span class="ml-2">Member welcome mail</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a href="#" id="member_welcome_mail" onclick="getMailTemplateData(this)" data-toggle="modal" data-target="#member_welcome_mail_modal">
|
||||
<i class="mdi mdi-pencil"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-5">
|
||||
<textarea style="display:none;" name="" id="" class="form-control "></textarea>
|
||||
|
||||
<!-- Example: Member reminder mail -->
|
||||
<div class="form-group col-md-6 mail-row">
|
||||
<div class="mail-section">
|
||||
<div class="left">
|
||||
<label class="switch">
|
||||
<input id="member_reminder_mail_btn" type="checkbox" name="member_reminder_mail_btn" <?= ($member_reminder_mail == 1) ? 'checked' : '' ?>>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
<span class="ml-2">Member reminder mail</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a href="#" id="member_reminder_mail" onclick="getMailTemplateData(this)" data-toggle="modal" data-target="#member_reminder_mail_modal">
|
||||
<i class="mdi mdi-pencil"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Member Ecard mail row-->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_name">Member reminder mail</label>
|
||||
<label class="switch">
|
||||
<input id="member_reminder_mail_btn" type="checkbox" name="member_reminder_mail_btn" <?= $member_reminder_mail == 1 ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
|
||||
<a href="" data-toggle="modal" id="member_reminder_mail" onclick="getMailTemplateData(this)" data-target="#member_reminder_mail_modal">Edit</a>
|
||||
<div class="form-group col-md-6 mail-row">
|
||||
<div class="mail-section">
|
||||
<div class="left">
|
||||
<label class="switch">
|
||||
<input id="member_ecard_mail_btn" type="checkbox" name="member_ecard_mail_btn" <?= $member_ecard_mail == 1 ? 'checked' : '' ?>>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<span class="ml-2"> Member ECard mail</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a href="" data-toggle="modal" id="member_ecard_mail" onclick="getMailTemplateData(this)" data-target="#member_ecard_mail_modal">
|
||||
<i class="mdi mdi-pencil"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-5">
|
||||
<textarea style="display:none;" name="" id="" class="form-control "></textarea>
|
||||
<div class="form-group col-md-6 mail-row">
|
||||
<div class="mail-section">
|
||||
<div class="left">
|
||||
<label class="switch">
|
||||
<input id="member_review_and_summary_mail_btn" type="checkbox" name="member_review_and_summary_mail_btn" <?= $member_review_and_summary_mail == 1 ? 'checked' : '' ?>>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<span class="ml-2"> Member Review And Summary Mail</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a href="" data-toggle="modal" id="member_review_and_summary_mail" onclick="getMailTemplateData(this)" data-target="#member_review_and_summary_mail_modal">
|
||||
<i class="mdi mdi-pencil"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Account Manager Summary Mail row-->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_name">Member ECard mail</label>
|
||||
<label class="switch">
|
||||
<input id="member_ecard_mail_btn" type="checkbox" name="member_ecard_mail_btn" <?= $member_ecard_mail == 1 ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
|
||||
<a href="" data-toggle="modal" id="member_ecard_mail" onclick="getMailTemplateData(this)" data-target="#member_ecard_mail_modal">Edit</a>
|
||||
<div class="form-group col-md-6 mail-row">
|
||||
<div class="mail-section">
|
||||
<div class="left">
|
||||
<label class="switch">
|
||||
<input id="account_maneger_summary_mail_btn" type="checkbox" name="account_maneger_summary_mail_btn" <?= $account_maneger_summary_mail ? 'checked' : '' ?>>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<span class="ml-2"> Account Manager summary mail</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a href="" data-toggle="modal" id="account_maneger_summary_mail" onclick="getMailTemplateData(this)" data-target="#account_maneger_summary_mail_modal">
|
||||
<i class="mdi mdi-pencil"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-5">
|
||||
<textarea style="display:none;" name="" id="" class="form-control "></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_name">Member Review and summary mail</label>
|
||||
<label class="switch">
|
||||
<input id="member_review_and_summary_mail_btn" type="checkbox" name="member_review_and_summary_mail_btn" <?= $member_review_and_summary_mail == 1 ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
|
||||
<a href="" data-toggle="modal" id="member_review_and_summary_mail" onclick="getMailTemplateData(this)" data-target="#member_review_and_summary_mail_modal">Edit</a>
|
||||
</div>
|
||||
<div class="form-group col-md-5">
|
||||
<textarea style="display:none;" name="" id="" class="form-control "></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_name">Account Manager summary mail</label>
|
||||
<label class="switch">
|
||||
<input id="account_maneger_summary_mail_btn" type="checkbox" name="account_maneger_summary_mail_btn" <?= $account_maneger_summary_mail ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
|
||||
<a href="" data-toggle="modal" id="account_maneger_summary_mail" onclick="getMailTemplateData(this)" data-target="#account_maneger_summary_mail_modal">Edit</a>
|
||||
</div>
|
||||
<div class="form-group col-md-5">
|
||||
<textarea style="display:none;" name="" id="" class="form-control "></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_name">Client HR summary mail</label>
|
||||
<label class="switch">
|
||||
<input id="client_hr_summary_mail_btn" type="checkbox" name="client_hr_summary_mail_btn" <?= $client_hr_summary_mail == 1 ? 'checked' : '' ?>>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
|
||||
<a href="" data-toggle="modal" id="client_hr_summary_mail" onclick="getMailTemplateData(this)" data-target="#client_hr_summary_mail_modal">Edit</a>
|
||||
</div>
|
||||
<div class="form-group col-md-5">
|
||||
<textarea style="display:none;" name="" id="" class="form-control "></textarea>
|
||||
<div class="form-group col-md-6 mail-row">
|
||||
<div class="mail-section">
|
||||
<div class="left">
|
||||
<label class="switch">
|
||||
<input id="client_hr_summary_mail_btn" type="checkbox" name="client_hr_summary_mail_btn" <?= $client_hr_summary_mail == 1 ? 'checked' : '' ?>>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<span class="ml-2">Client HR summary mail</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a href="" data-toggle="modal" id="client_hr_summary_mail" onclick="getMailTemplateData(this)" data-target="#client_hr_summary_mail_modal">
|
||||
<i class="mdi mdi-pencil"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -204,6 +309,8 @@
|
||||
<a style="float:right;" id="notification_enable_form_submit" class="btn btn-primary waves-effect waves-light mr-1">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- </form> -->
|
||||
@ -615,9 +722,9 @@
|
||||
<hr>
|
||||
<!-- Unlayer editor -->
|
||||
<!-- <div class="form-row" id="rac_rate_dropdown"> -->
|
||||
<div class="form-group col-md-12">
|
||||
<div id="account_maneger_summary_mail_editor_container" style="height: 600px"></div>
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<div id="account_maneger_summary_mail_editor_container" style="height: 600px"></div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-primary waves-effect waves-light mr-1 preview_button"
|
||||
@ -683,48 +790,48 @@
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
</div> -->
|
||||
<div class="form-row" id="rac_rate_dropdown">
|
||||
<div class="form-group col-md-12">
|
||||
<select id="client_hr_summary_mail_customButton" class="form-control" style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;" onchange="copyToClipboard(this)">
|
||||
<option value="">PlaceHolders</option>
|
||||
<?php foreach ($placeHolders as $value): ?>
|
||||
<?php if ($value == 'member_name' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name' || $value == 'member_summary') { ?>
|
||||
<?php $valueChange = str_replace('_', ' ', $value);
|
||||
$valueChange = ucwords($valueChange); ?>
|
||||
<option value="{{<?php echo $value; ?>}}"><?php echo $valueChange; ?></option>
|
||||
<?php } ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<span id="copy-feedback" style="display: none; position: absolute; top: 50px; right: 10px; color: green; font-size: 12px;">Copied to clipboard!</span>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-row" id="rac_rate_dropdown">
|
||||
<div class="form-group col-md-12">
|
||||
<select id="client_hr_summary_mail_customButton" class="form-control" style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;" onchange="copyToClipboard(this)">
|
||||
<option value="">PlaceHolders</option>
|
||||
<?php foreach ($placeHolders as $value): ?>
|
||||
<?php if ($value == 'member_name' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name' || $value == 'member_summary') { ?>
|
||||
<?php $valueChange = str_replace('_', ' ', $value);
|
||||
$valueChange = ucwords($valueChange); ?>
|
||||
<option value="{{<?php echo $value; ?>}}"><?php echo $valueChange; ?></option>
|
||||
<?php } ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<span id="copy-feedback" style="display: none; position: absolute; top: 50px; right: 10px; color: green; font-size: 12px;">Copied to clipboard!</span>
|
||||
</div>
|
||||
<hr>
|
||||
<!-- Unlayer editor -->
|
||||
<div class="form-row" id="rac_rate_dropdown">
|
||||
<div class="form-group col-md-12">
|
||||
<div id="client_hr_summary_mail_editor_container" style="height: 600px"></div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<!-- Unlayer editor -->
|
||||
<div class="form-row" id="rac_rate_dropdown">
|
||||
<div class="form-group col-md-12">
|
||||
<div id="client_hr_summary_mail_editor_container" style="height: 600px"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="editor"></div>
|
||||
|
||||
|
||||
<input type="file" id="Question_title_fileInput" style="display: none;">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-primary waves-effect waves-light mr-1 preview_button"
|
||||
id="">Preview</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnGridSubmit_2">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="editor"></div>
|
||||
|
||||
|
||||
<input type="file" id="Question_title_fileInput" style="display: none;">
|
||||
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-primary waves-effect waves-light mr-1 preview_button"
|
||||
id="">Preview</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnGridSubmit_2">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
<!-- /.modal -->
|
||||
|
||||
|
||||
@ -1396,7 +1503,7 @@
|
||||
console.log("Creating new editor instance...");
|
||||
editor = unlayer.createEditor({
|
||||
id: `${template_name}_editor_container`,
|
||||
projectId: <?=getenv('unlayer.projectID') ?>,
|
||||
projectId: <?= getenv('unlayer.projectID') ?>,
|
||||
displayMode: "email",
|
||||
features: {
|
||||
textEditor: {
|
||||
@ -1406,7 +1513,9 @@
|
||||
enabled: true,
|
||||
deviceOptions: ['desktop', 'mobile']
|
||||
},
|
||||
preview: { enabled: true },
|
||||
preview: {
|
||||
enabled: true
|
||||
},
|
||||
imageEditor: {
|
||||
enabled: true
|
||||
},
|
||||
@ -1454,7 +1563,7 @@
|
||||
function getMailTemplateData(element) {
|
||||
template_name = element.id;
|
||||
const validTemplates = [
|
||||
"account_maneger_summary_mail", "member_reminder_mail", "member_ecard_mail", "member_welcome_mail","member_review_and_summary_mail","client_hr_summary_mail"
|
||||
"account_maneger_summary_mail", "member_reminder_mail", "member_ecard_mail", "member_welcome_mail", "member_review_and_summary_mail", "client_hr_summary_mail"
|
||||
];
|
||||
|
||||
if (!validTemplates.includes(template_name)) {
|
||||
@ -1973,52 +2082,85 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
$(document).on('click', '#notification_enable_form_submit', function() {
|
||||
var formData = [];
|
||||
console.log($('#hr_mail_id').val());
|
||||
$(document).on('click', '#notification_enable_form_submit', function() {
|
||||
var formData = [];
|
||||
console.log($('#hr_mail_id').val());
|
||||
|
||||
formData.push({name:'client_id', value: $('#general_PrimaryKey').val()})
|
||||
formData.push({ name: 'nhance_team_mail_ids', value: $('#nhance_team_mail_ids').val() });
|
||||
formData.push({ name: 'hr_mail_id', value: $('#hr_mail_id').val() });
|
||||
formData.push({ name: 'mail_domain', value: $('#mail_domain').val() });
|
||||
formData.push({ name: 'reply_to', value: $('#reply_to').val() });
|
||||
formData.push({ name: 'member_welcome_mail_btn', value: $('#member_welcome_mail_btn').prop('checked') });
|
||||
formData.push({ name: 'member_reminder_mail_btn', value: $('#member_reminder_mail_btn').prop('checked') });
|
||||
formData.push({ name: 'member_ecard_mail_btn', value: $('#member_ecard_mail_btn').prop('checked') });
|
||||
formData.push({ name: 'member_review_and_summary_mail_btn', value: $('#member_review_and_summary_mail_btn').prop('checked') });
|
||||
formData.push({ name: 'account_maneger_summary_mail_btn', value: $('#account_maneger_summary_mail_btn').prop('checked') });
|
||||
formData.push({ name: 'client_hr_summary_mail_btn', value: $('#client_hr_summary_mail_btn').prop('checked') });
|
||||
formData.push({
|
||||
name: 'client_id',
|
||||
value: $('#general_PrimaryKey').val()
|
||||
})
|
||||
formData.push({
|
||||
name: 'nhance_team_mail_ids',
|
||||
value: $('#nhance_team_mail_ids').val()
|
||||
});
|
||||
formData.push({
|
||||
name: 'hr_mail_id',
|
||||
value: $('#hr_mail_id').val()
|
||||
});
|
||||
formData.push({
|
||||
name: 'mail_domain',
|
||||
value: $('#mail_domain').val()
|
||||
});
|
||||
formData.push({
|
||||
name: 'reply_to',
|
||||
value: $('#reply_to').val()
|
||||
});
|
||||
formData.push({
|
||||
name: 'member_welcome_mail_btn',
|
||||
value: $('#member_welcome_mail_btn').prop('checked')
|
||||
});
|
||||
formData.push({
|
||||
name: 'member_reminder_mail_btn',
|
||||
value: $('#member_reminder_mail_btn').prop('checked')
|
||||
});
|
||||
formData.push({
|
||||
name: 'member_ecard_mail_btn',
|
||||
value: $('#member_ecard_mail_btn').prop('checked')
|
||||
});
|
||||
formData.push({
|
||||
name: 'member_review_and_summary_mail_btn',
|
||||
value: $('#member_review_and_summary_mail_btn').prop('checked')
|
||||
});
|
||||
formData.push({
|
||||
name: 'account_maneger_summary_mail_btn',
|
||||
value: $('#account_maneger_summary_mail_btn').prop('checked')
|
||||
});
|
||||
formData.push({
|
||||
name: 'client_hr_summary_mail_btn',
|
||||
value: $('#client_hr_summary_mail_btn').prop('checked')
|
||||
});
|
||||
|
||||
var form_action = '<?= base_url("client/notification/update_enable") ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
type: "POST",
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
success: function(res)
|
||||
{
|
||||
console.log(res);
|
||||
if (res)
|
||||
{
|
||||
toastr.success('Update Successfully');
|
||||
}
|
||||
var form_action = '<?= base_url("client/notification/update_enable") ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
type: "POST",
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
if (res.status == true) {
|
||||
toastr.success('Update Successfully');
|
||||
}
|
||||
|
||||
if (res.status == false) {
|
||||
let empty_templates = res.empty_templates.join(", ");
|
||||
toastr.warning(`Updation Failed. The following templates were empty: ${empty_templates}`);
|
||||
}
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
},
|
||||
error: function (xhr, status, error)
|
||||
{
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function()
|
||||
{
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
1189
app/Views/oldheader.php
Normal file
1189
app/Views/oldheader.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -775,8 +775,34 @@
|
||||
|
||||
console.log('autoSaveOtherTerms function called');
|
||||
|
||||
var formData = new FormData($('#otherPolicyTerms')[0]);
|
||||
console.log("formData", formData);
|
||||
// var formData = new FormData($('#otherPolicyTerms')[0]);
|
||||
// console.log("formData", formData);
|
||||
|
||||
var form = $('#otherPolicyTerms')[0];
|
||||
if (!form) {
|
||||
console.error("Form #otherPolicyTerms not found");
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if form has any data before proceeding
|
||||
var formData = new FormData(form);
|
||||
var hasData = false;
|
||||
|
||||
|
||||
for (let [key, value] of formData.entries()) {
|
||||
console.log("Key:", key, "Value:", value);
|
||||
if(key == "sum_insureds"){
|
||||
if (value && value.toString().trim() !== '') {
|
||||
hasData = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasData) {
|
||||
console.warn("Form data is empty, skipping auto-save");
|
||||
return;
|
||||
}
|
||||
|
||||
var policy_form_action = '<?= base_url("client/terms/other_terms") ?>';
|
||||
console.log("policy_form_action", policy_form_action);
|
||||
@ -809,9 +835,9 @@
|
||||
// Append the JSON string to the FormData object
|
||||
formData.append('policy_terms', jsonString);
|
||||
|
||||
formData.forEach((value, key) => {
|
||||
console.log(key + ': ' + value);
|
||||
});
|
||||
// formData.forEach((value, key) => {
|
||||
// console.log(key + ': ' + value);
|
||||
// });
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<div class="table-responsive" id="branch_table" >
|
||||
|
||||
<table data-custom-table-css="table" class="table table-borderless table-nowrap mb-0" id="table-policies">
|
||||
<thead class="thead-light">
|
||||
<thead class="">
|
||||
<tr>
|
||||
<th>Insurer</th>
|
||||
<th>Name</th>
|
||||
|
||||
@ -95,6 +95,21 @@
|
||||
/* margin-left: 141px; */
|
||||
width: 576px;
|
||||
}
|
||||
|
||||
#policyGMCTerms input ,
|
||||
#policyGMCTerms select,
|
||||
#policyGMCTerms .select2-container .select2-selection--single ,
|
||||
#policyGMCTerms .select2-container .select2-selection--multiple {
|
||||
background-color: #ECECEC !important;
|
||||
border:1px solid #ECECEC !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.policy-base-info{
|
||||
margin-top:10px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<div id="policyGMCTerms" style="display:none">
|
||||
@ -112,221 +127,173 @@
|
||||
<div class="form-group">
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-4">
|
||||
<label for="sumInsured">Sum Insured</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input style="width: 128%;" type="text" name="sum_insured" id="sum_insured" class="form-control"
|
||||
onkeypress="return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word(this)">
|
||||
</div>
|
||||
<div class="col-md-2" style="position: relative;left: 88px;">
|
||||
<button type="button" class="btn btn-primary si-add-more" onclick="appendGMCSIAddMore()">+</button>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div id='numberToWordGMC' class="text-danger-2"></div>
|
||||
|
||||
<div class="col">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<label for="sumInsured" class="form-label" >Sum Insured</label>
|
||||
<input class="form-control mr-2" type="text" name="sum_insured" id="sum_insured" style="max-width:200px;"
|
||||
onkeypress="return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word(this)">
|
||||
<button type="button" class="btn btn-primary si-add-more mr-2" onclick="appendGMCSIAddMore()"
|
||||
style="background-color: #e26728; border:1px solid #e26728;"
|
||||
>
|
||||
<i class="mdi mdi-plus"></i>
|
||||
</button>
|
||||
<div id='numberToWordGMC' class="text-danger-2 mr-2"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="gmc_si_add_more"></div>
|
||||
|
||||
<div class="row" style="margin-bottom:10px;">
|
||||
<div class="col">
|
||||
<label for="totalSumInsured" class="form-label me-3">Family Floater</label>
|
||||
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" id="familyFloaterYes" name="family_floater" value="1">
|
||||
<label class="form-check-label" for="familyFloaterYes">Yes</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" id="familyFloaterNo" name="family_floater" value="0">
|
||||
<label class="form-check-label" for="familyFloaterNo">No</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col"
|
||||
style="background-color: #F5FFFF;border-radius:10px;box-shadow: 0px 2px 2px 0px #00000040;
|
||||
padding:20px;">
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="totalSumInsured">Family Floater</label>
|
||||
</div>
|
||||
<div class="d-flex align-items-center policy-base-info">
|
||||
<input type="checkbox" style="margin-right: 10px;color:black;"
|
||||
name="family_floaters[]" value="self" id="self" checked>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
<input type="radio" id="familyFloaterYes" name="family_floater" class="family_floater" value="1">
|
||||
<label for="familyFloaterYes">Yes</label>
|
||||
<span style="margin-right:150px;color:black;">Self:</span>
|
||||
|
||||
<br>
|
||||
|
||||
<input type="radio" id="familyFloaterNo" name="family_floater" class="family_floater" value="0" style="margin-left:10px">
|
||||
<label for="familyFloaterNo">No</label>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
|
||||
<div class="col-md-8" style="margin-bottom:10px">
|
||||
|
||||
<table data-custom-table-css="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 11%;"><span style="margin-right:20px;color:black;">Self:</span></td>
|
||||
<td style="width: 11%;"><input type="checkbox" style="margin-right: 70px;color:black;"
|
||||
name="family_floaters[]" value="self" id="self" checked> </td>
|
||||
<td style="width: 28%;">
|
||||
<div class="self-age"><span style="margin-right:20px;color:black;;">Min Age:</span><input
|
||||
<div class="self-age">
|
||||
<span style="margin-right:10px;color:black;;">Min Age:</span>
|
||||
<input
|
||||
class="underline-input min_age"
|
||||
value="<?php echo (isset($self_min_age) && $self_min_age > 0) ? $self_min_age : '18'; ?>"
|
||||
style="width: 35%;;" type="number" name="self_min_age" id="self_min_age"
|
||||
onchange="lowerIsEighteen(this)"></div>
|
||||
</td>
|
||||
<td style="width: 28%;">
|
||||
<div class="self-age"><span style="margin-right:20px;color:black;">Max Age:</span><input
|
||||
onchange="lowerIsEighteen(this)">
|
||||
</div>
|
||||
|
||||
<div class="self-age">
|
||||
<span style="margin-right:10px;color:black;">Max Age:</span>
|
||||
<input
|
||||
class="underline-input max_age"
|
||||
value="<?php echo isset($self_max_age) ? $self_max_age : '60'; ?>"
|
||||
style="width: 35%;;" type="number" name="self_max_age" id="self_max_age"
|
||||
onchange="lowerIsEighteen(this)"></div>
|
||||
</td>
|
||||
<!-- <td style="width: 11%;"><span class="self-age"
|
||||
style="margin-right:20px;color:black;font-size: 12px;">Is Payable by employee:</span></td>
|
||||
<td style="width: 11%;"><input class="self-age" type="checkbox"
|
||||
style="margin-right: 70px;" name="is_payable_employee_for_self"
|
||||
id="is_payable_employee_for_self"> </td> -->
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 11%;"><span style="margin-right:20px;color:black;">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: 28%;">
|
||||
<div class="spouse-age"><span style="margin-right:20px;color:black;">Min Age:</span><input
|
||||
onchange="lowerIsEighteen(this)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center policy-base-info">
|
||||
<input type="checkbox" style="margin-right:10px;"
|
||||
name="family_floaters[]" value="spouse" id="spouse">
|
||||
|
||||
<span style="margin-right:125px;color:black;">
|
||||
Spouse:</span>
|
||||
|
||||
<div class="spouse-age"><span style="margin-right:10px;color:black;">Min Age:</span>
|
||||
<input
|
||||
class="underline-input min_age"
|
||||
value="<?php echo isset($spouse_min_age) ? $spouse_min_age : '18'; ?>"
|
||||
style="width: 35%;;" type="number" name="spouse_min_age" id="spouse_min_age"
|
||||
onchange="lowerIsEighteen(this)"></div>
|
||||
</td>
|
||||
<td style="width: 28%;">
|
||||
<div class="spouse-age"><span style="margin-right:20px;color:black;">Max Age:</span><input
|
||||
onchange="lowerIsEighteen(this)">
|
||||
</div>
|
||||
|
||||
<div class="spouse-age"><span style="margin-right:10px;color:black;">Max Age:</span>
|
||||
<input
|
||||
class="underline-input max_age"
|
||||
value="<?php echo isset($spouse_max_age) ? $spouse_max_age : '60'; ?>"
|
||||
style="width: 35%;;" type="number" name="spouse_max_age" id="spouse_max_age"
|
||||
onchange="lowerIsEighteen(this)"></div>
|
||||
</td>
|
||||
<!-- <td style="width: 11%;"><span class="spouse-age"
|
||||
style="margin-right:20px;color:black;font-size: 12px;">Is Payable by employee:</span></td>
|
||||
<td style="width: 11%;"><input class="spouse-age" type="checkbox"
|
||||
style="margin-right: 70px;" name="is_payable_employee_for_spouse"
|
||||
id="is_payable_employee_for_spouse"> </td> -->
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 11%;"><span for="children">Children:</span></td>
|
||||
<td style="width: 11%;"><select name="family_floaters[]" id="children">
|
||||
onchange="lowerIsEighteen(this)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center policy-base-info">
|
||||
<span for="children" style="color:black;" class="mr-2">Children:</span>
|
||||
|
||||
<select name="family_floaters[]" id="children" style="margin-right:60px;" class="px-1" >
|
||||
<option value="0">None</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="width: 28%;">
|
||||
<div class="child-age"><span style="margin-right:20px;color:black;">Min Age:</span><input
|
||||
|
||||
<div class="child-age"><span style="margin-right:10px;color:black;">Min Age:</span>
|
||||
<input
|
||||
class="underline-input min_age"
|
||||
value="<?php echo isset($child_min_age) ? $child_min_age : '0'; ?>"
|
||||
style="width: 35%;;" type="number" name="child_min_age" id="child_min_age"
|
||||
oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div>
|
||||
</td>
|
||||
<td style="width: 28%;">
|
||||
<div class="child-age"><span style="margin-right:20px;color:black;">Max Age:</span><input
|
||||
|
||||
<div class="child-age"><span style="margin-right:10px;color:black;">Max Age:</span>
|
||||
<input
|
||||
class="underline-input max_age"
|
||||
value="<?php echo isset($child_max_age) ? $child_max_age : '25'; ?>"
|
||||
style="width: 35%;;" type="number" name="child_max_age" id="child_max_age"
|
||||
oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div>
|
||||
</td>
|
||||
<!-- <td style="width: 11%;"><span class="child-age"
|
||||
style="margin-right:20px;color:black;font-size: 12px;">Is Payable by employee:</span></td>
|
||||
<td style="width: 11%;"><input class="child-age" type="checkbox"
|
||||
style="margin-right: 70px;" name="is_payable_employee_for_child"
|
||||
id="is_payable_employee_for_child"> </td> -->
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top:10px"></div>
|
||||
<div style="margin-top:10px"></div>
|
||||
<div class="d-flex align-items-center policy-base-info flex-nowrap">
|
||||
|
||||
<div style="margin-top:10px">
|
||||
<span for="family_floaters" style="color:black;">Select Other Members:</span>
|
||||
<select name="family_floaters[]" id="family_floaters" style="margin-left: 10px;">
|
||||
<option value="0">None</option>
|
||||
<option value="1P">Only one parent (Either Father / Mother)</option>
|
||||
<option value="2P">Only two parents (Father+Mother)</option>
|
||||
<option value="1PIL">Only one parent in law (Either MIL / FIL)</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="EPORPIL">Either Parents or PIL (Parents or Parents In Law)</option>
|
||||
<option value="4EPORPIL">Parents + PIL (Father + Mother + MIL + FIL)</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- Select Other Members -->
|
||||
<div class="d-flex align-items-center">
|
||||
<span class="me-2 fw-bold text-dark mr-3">
|
||||
<b>Select Other Members:</b>
|
||||
</span>
|
||||
<select name="family_floaters[]" id="family_floaters" class="form-select mr-3 px-1">
|
||||
<option value="0">None</option>
|
||||
<option value="1P">Only one parent (Either Father / Mother)</option>
|
||||
<option value="2P">Only two parents (Father+Mother)</option>
|
||||
<option value="1PIL">Only one parent in law (Either MIL / FIL)</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="EPORPIL">Either Parents or PIL (Parents or Parents In Law)</option>
|
||||
<option value="4EPORPIL">Parents + PIL (Father + Mother + MIL + FIL)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div style="margin-top:10px">
|
||||
<table data-custom-table-css="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 22%;">
|
||||
<div class="other-member-age"><span style="margin-right:20px;color:black;">Elders
|
||||
Count:</span><input class="underline-input" id="member_count"
|
||||
style="width: 30%; width: 30%;background: lightgray;" type="number"
|
||||
name="elder_member_count" id="member_count" readonly></div>
|
||||
</td>
|
||||
<td style="width: 28%;">
|
||||
<div class="other-member-age" style="margin-left: 32px;"><span
|
||||
style="margin-right:20px;color:black;">Min Age:</span><input
|
||||
class="underline-input min_age"
|
||||
value="<?php echo isset($other_member_min_age) ? $other_member_min_age : '18'; ?>"
|
||||
style="width: 35%;;" type="number" class="underline-input min_age"
|
||||
name="other_member_min_age" id="other_member_min_age"
|
||||
onchange="lowerIsEighteen(this)"></div>
|
||||
</td>
|
||||
<td style="width: 28%;">
|
||||
<div class="other-member-age" style="margin-left: 17px;"><span
|
||||
style="margin-right:20px;color:black;">Max Age:</span><input
|
||||
class="underline-input max_age"
|
||||
value="<?php echo isset($other_member_max_age) ? $other_member_max_age : '60'; ?>"
|
||||
style="width: 35%;;" type="number" class="underline-input max_age"
|
||||
name="other_member_max_age" id="other_member_max_age"
|
||||
onchange="lowerIsEighteen(this)"></div>
|
||||
</td>
|
||||
<!-- <td style="width: 11%;"><span class="other-member-age"
|
||||
style="margin-right:20px;color:black;font-size: 12px;">Is Payable by employee:</span>
|
||||
</td>
|
||||
<td style="width: 11%;"><input class="other-member-age" type="checkbox"
|
||||
style="margin-right: 70px;" name="is_payable_employee_for_elders"
|
||||
id="is_payable_employee_for_elders"> </td> -->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- Elders Count -->
|
||||
<div class="d-flex align-items-center">
|
||||
<span class="me-2 text-dark" style="margin-right:10px;color:black;">Elders Count:</span>
|
||||
<input class="underline-input" type="number" style="width: 35%;"
|
||||
name="elder_member_count" id="member_count" readonly>
|
||||
</div>
|
||||
|
||||
<!-- Min Age -->
|
||||
<div class="d-flex align-items-center">
|
||||
<span class="me-2 text-dark" style="margin-right:10px;color:black;">Min Age:</span>
|
||||
<input class="underline-input" type="number"
|
||||
name="other_member_min_age" id="other_member_min_age" style="width: 35%;"
|
||||
value="<?php echo isset($other_member_min_age) ? $other_member_min_age : '18'; ?>"
|
||||
onchange="lowerIsEighteen(this)">
|
||||
</div>
|
||||
|
||||
<!-- Max Age -->
|
||||
<div class="d-flex align-items-center">
|
||||
<span class="me-2 text-dark" style="margin-right:10px;color:black;">Max Age:</span>
|
||||
<input class="underline-input" type="number"
|
||||
name="other_member_max_age" id="other_member_max_age" style="width: 35%;"
|
||||
value="<?php echo isset($other_member_max_age) ? $other_member_max_age : '60'; ?>"
|
||||
onchange="lowerIsEighteen(this)">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" name="waiverofpreexistingdiseases_display" id="waiverofpreexistingdiseases_display" class="unchecked" checked>
|
||||
@ -361,8 +328,7 @@
|
||||
<label for="waiverof30dayswaitingperiod">Waiver of 30 days waiting period</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="waiverof30dayswaitingperiod" class="form-control waiverof30dayswaitingperiod"
|
||||
value="1">
|
||||
<input type="text" name="waiverof30dayswaitingperiod" class="form-control waiverof30dayswaitingperiod">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -861,10 +827,16 @@
|
||||
<label for="totalSumInsured">Sum Insured enhancement</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="radio" name="suminsuredenhancement" class="suminsuredenhancement" value="1">
|
||||
<label for="">Yes</label>
|
||||
<input type="radio" name="suminsuredenhancement" class="suminsuredenhancement" value="0" style="margin-left:10px"> No
|
||||
<label for="">No</label>
|
||||
<span>
|
||||
<input type="radio" name="suminsuredenhancement" class="suminsuredenhancement" value="1">
|
||||
<span style="color:black;"><b>Yes</b></span>
|
||||
</span>
|
||||
<span>
|
||||
<input type="radio" name="suminsuredenhancement" class="suminsuredenhancement" value="0" style="margin-left:10px">
|
||||
<span style="color:black;"><b>No</b></span>
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1691,6 +1663,7 @@
|
||||
// // Update the input value
|
||||
// input.value = value;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
$('#self').change(function() {
|
||||
@ -1781,22 +1754,28 @@
|
||||
|
||||
var html = `
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-4">
|
||||
<label for="sumInsured">Additional Sum Insured</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input style="width: 128%;" value="${data == null || data == undefined || data == "" ? '' : data}" type="text" name="multiple_sum_insured[]" class="form-control multiple_sum_insured" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this); numtowordinkeyup(this)">
|
||||
</div>
|
||||
<div class="col-md-2" style="position: relative;left: 88px;">
|
||||
<button type="button" class="btn btn-danger si-remove-multi" onclick="removeGMCAdditionalSI(this)">x</button>
|
||||
<button type="button" class="btn btn-primary si-add-more" onclick="appendGMCSIAddMore()">+</button>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="text-danger-2 numberToWordSumInsured"></div>
|
||||
</div>
|
||||
</div>`;
|
||||
<div class="col">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<label for="sumInsured" class="form-label" >Additional Sum Insured</label>
|
||||
<input class="form-control mr-2" style="max-width:200px;"
|
||||
value="${data == null || data == undefined || data == "" ? '' : data}" type="text" name="multiple_sum_insured[]"
|
||||
class="form-control multiple_sum_insured mr-2" onkeypress="return onlyNumbers(event)"
|
||||
onkeyup="formatNumber(this); numtowordinkeyup(this)">
|
||||
<button type="button" class="btn btn-danger si-remove-multi mr-2" onclick="removeGMCAdditionalSI(this)"
|
||||
style="background-color: #BD0707;border:1px solid #BD0707">
|
||||
<i class="mdi mdi-delete"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary si-add-more mr-2" onclick="appendGMCSIAddMore()"
|
||||
style="background-color: #e26728; border:1px solid #e26728;"
|
||||
>
|
||||
<i class="mdi mdi-plus"></i>
|
||||
</button>
|
||||
|
||||
<div id='numberToWordSumInsured' class="text-danger-2 mr-2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
$('#gmc_si_add_more').append(html);
|
||||
}
|
||||
@ -1942,6 +1921,34 @@
|
||||
|
||||
console.log("autoSaveGmcTerms function called");
|
||||
|
||||
// Add form validation before proceeding
|
||||
var form = $('#policyJsonForm')[0];
|
||||
if (!form) {
|
||||
console.error("Form #policyJsonForm not found");
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if form has any data before proceeding
|
||||
var formData = new FormData(form);
|
||||
var hasData = false;
|
||||
|
||||
console.log("form entries : ", formData.entries());
|
||||
|
||||
for (let [key, value] of formData.entries()) {
|
||||
console.log("Key:", key, "Value:", value);
|
||||
if(key == "sum_insured"){
|
||||
if (value && value.toString().trim() !== '') {
|
||||
hasData = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasData) {
|
||||
console.warn("Form data is empty, skipping auto-save");
|
||||
return;
|
||||
}
|
||||
|
||||
var specialConditions = [];
|
||||
|
||||
$(".removeDom").each(function() {
|
||||
@ -1956,19 +1963,15 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
console.log("specialConditions", specialConditions);
|
||||
|
||||
var formData = new FormData($('#policyJsonForm')[0]);
|
||||
console.log("formData", formData);
|
||||
// var formData = new FormData($('#policyJsonForm')[0]);
|
||||
|
||||
var policy_form_action = '<?= base_url("client/policy/policyGMCTerms") ?>';
|
||||
console.log("policy_form_action", policy_form_action);
|
||||
|
||||
formData.append("special_condition_display_value", JSON.stringify(specialConditions));
|
||||
// console.log('formData', formData);
|
||||
formData.forEach((value, key) => {
|
||||
// console.log(key + ':', value);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
|
||||
@ -74,6 +74,16 @@
|
||||
width: 689px;
|
||||
}
|
||||
|
||||
|
||||
#policyGPATermsForm input ,
|
||||
#policyGPATermsForm select,
|
||||
#policyGPATermsForm .select2-container .select2-selection--single ,
|
||||
#policyGPATermsForm .select2-container .select2-selection--multiple {
|
||||
background-color: #ECECEC !important;
|
||||
border:1px solid #ECECEC !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="policyGPATermsForm" style="display:none">
|
||||
@ -96,373 +106,314 @@
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
|
||||
<div class="col-md-6">
|
||||
<label for="sumInsured">Sum Insured</label>
|
||||
<div class="col">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<label for="sumInsured" class="form-label" >Sum Insured</label>
|
||||
<input class="form-control mr-2" type="text" name="sumInsured2" id="sumInsured2" style="max-width:200px;"
|
||||
onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
|
||||
<button type="button" class="btn btn-primary si-add-more mr-2" onclick="appendGPASIAddMore()"
|
||||
style="background-color: #e26728; border:1px solid #e26728;"
|
||||
>
|
||||
<i class="mdi mdi-plus"></i>
|
||||
</button>
|
||||
<div id='numberToWordSumInsured' class="text-danger-2 mr-2"></div>
|
||||
</div>
|
||||
|
||||
<div id="gpa_si_add_more"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
|
||||
<div class="col">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<label for="totalSumInsured">Total Sum Assured</label>
|
||||
<input type="text" style="max-width: 200px !important;" class="form-control mr-2" name="totalSumInsured"
|
||||
id="totalSumInsured" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
|
||||
<div id='numberToWordTotalSumInsured' class="text-danger-2 mr-2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col d-flex align-items-center"
|
||||
style="background-color: #F5FFFF;border-radius:10px;box-shadow: 0px 2px 2px 0px #00000040;
|
||||
padding:20px;">
|
||||
|
||||
<input disabled type="checkbox" style="color:black;" name="family_floaters[]"
|
||||
value="self" id="self" checked>
|
||||
|
||||
<span style="margin-right: 40px;color:black;">Self</span>
|
||||
|
||||
<div class="self-age" style="margin-right: 20px;">
|
||||
<span style="margin-right: 20px;color:black;">Min Age:</span>
|
||||
<input class="underline-input min_age"
|
||||
style="background-color: white !important;"
|
||||
value="<?php echo isset($self_min_age) ? $self_min_age : '18'; ?>"
|
||||
type="number" name="self_min_age" id="self_min_age_gpa"
|
||||
onchange="lowerIsEighteen(this)">
|
||||
</div>
|
||||
|
||||
<div class="self-age" style="margin-right: 20px;">
|
||||
<span style="margin-right: 20px;color:black;">Max Age:</span>
|
||||
<input class="underline-input max_age"
|
||||
style="background-color:white !important"
|
||||
value="<?php echo isset($self_max_age) ? $self_max_age : '60'; ?>"
|
||||
type="number" name="self_max_age" id="self_max_age_gpa"
|
||||
onchange="lowerIsEighteen(this)">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input class="form-check-input me-2" type="checkbox" id="accidentalDeathBenefit_display" name="accidentalDeathBenefit_display" checked>
|
||||
<label class="form-check-label mb-0" for="accidentalDeathBenefit_display">
|
||||
Accidental Death Benefit
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input style="width: 128%;" class="form-control" type="text" name="sumInsured2" id="sumInsured2"
|
||||
onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)"
|
||||
style="width: 100% !important;">
|
||||
</div>
|
||||
<div class="col-md-2" style="position: relative;left: 88px;">
|
||||
<button type="button" class="btn btn-primary si-add-more" onclick="appendGPASIAddMore()">+</button>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div id='numberToWordSumInsured' class="text-danger-2"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="gpa_si_add_more"></div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for="totalSumInsured">Total Sum Assured</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" style="width: 100% !important;" class="form-control" name="totalSumInsured"
|
||||
id="totalSumInsured" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div id='numberToWordTotalSumInsured' class="text-danger-2"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for=""></label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<table data-custom-table-css="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 5%;">
|
||||
<span style="margin-right: 20px;">Self:</span>
|
||||
</td>
|
||||
<td style="width: 11%;">
|
||||
<input disabled type="checkbox" style="margin-right: 70px;" name="family_floaters[]"
|
||||
value="self" id="self" checked>
|
||||
</td>
|
||||
<td style="width: 20%;">
|
||||
<div class="self-age">
|
||||
<span style="margin-right: 20px;">Min Age:</span>
|
||||
<input class="underline-input min_age"
|
||||
value="<?php echo isset($self_min_age) ? $self_min_age : '18'; ?>"
|
||||
style="width: 65%;" type="number" name="self_min_age" id="self_min_age_gpa"
|
||||
onchange="lowerIsEighteen(this)">
|
||||
</div>
|
||||
</td>
|
||||
<td style="width: 20%;">
|
||||
<div class="self-age">
|
||||
<span style="margin-right: 20px;">Max Age:</span>
|
||||
<input class="underline-input max_age"
|
||||
value="<?php echo isset($self_max_age) ? $self_max_age : '60'; ?>"
|
||||
style="width: 65%;" type="number" name="self_max_age" id="self_max_age_gpa"
|
||||
onchange="lowerIsEighteen(this)">
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="accidentalDeathBenefit_display" id="accidentalDeathBenefit_display" checked>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="totalSumInsured">Accidental Death Benefit</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="accidentalDeathBenefit" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="permanentTotalDisablement_display" id="permanentTotalDisablement_display" checked>
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input class="form-check-input me-2" type="checkbox" id="permanentTotalDisablement_display" name="permanentTotalDisablement_display" checked>
|
||||
<label class="form-check-label mb-0" for="permanentTotalDisablement_display">
|
||||
Permanent Total Disablement
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="permanentTotalDisablement">Permanent Total Disablement</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="permanentTotalDisablement" id="permanentTotalDisablement"
|
||||
class="form-control">
|
||||
<input type="text" name="permanentTotalDisablement" id="permanentTotalDisablement" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="permanentPartialDisablement_display" id="permanentPartialDisablement_display" checked>
|
||||
<div class="row mb-2">
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input me-2" name="permanentPartialDisablement_display" id="permanentPartialDisablement_display" checked>
|
||||
<label class="form-check-label mb-0" for="permanentPartialDisablement">Permanent Partial Disablement</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="permanentPartialDisablement">Permanent Partial Disablement</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="permanentPartialDisablement" id="permanentPartialDisablement"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="temporaryTotalDisablementBenefit_display" id="temporaryTotalDisablementBenefit_display" checked>
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input me-2" name="temporaryTotalDisablementBenefit_display" id="temporaryTotalDisablementBenefit_display" checked>
|
||||
<label class="form-check-label mb-0" for="temporaryTotalDisablementBenefit">Temporary Total Disablement Benefit</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="temporaryTotalDisablementBenefit">Temporary Total Disablement Benefit</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="temporaryTotalDisablementBenefit" id="temporaryTotalDisablementBenefit"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="medical_expenses_medical_extension_display" id="medical_expenses_medical_extension_display" checked>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input me-2" name="medical_expenses_medical_extension_display" id="medical_expenses_medical_extension_display" checked>
|
||||
<label class="form-check-label mb-0" for="medical_expenses_medical_extension">Medical Expenses / Medical Extension (IPD)</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="medical_expenses_medical_extension">Medical Expenses / Medical Extension (IPD)</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="medical_expenses_medical_extension" id="medical_expenses_medical_extension"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input me-2" name="opd_treatment_cover_display" id="opd_treatment_cover_display" checked>
|
||||
<label class="form-check-label mb-0" for="opd_treatment_cover">OPD Treatment Cover</label>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="opd_treatment_cover_display" id="opd_treatment_cover_display" checked>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="opd_treatment_cover">OPD Treatment Cover</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="opd_treatment_cover" id="opd_treatment_cover" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="ambulanceCharges_display" id="ambulanceCharges_display" checked>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input me-2" name="ambulanceCharges_display" id="ambulanceCharges_display" checked>
|
||||
<label class="form-check-label mb-0" for="ambulanceCharges"> Ambulance Charges</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="ambulanceCharges"> Ambulance Charges</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="ambulanceCharges" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="repatriation_of_mortal_remains_display" id="repatriation_of_mortal_remains_display" checked>
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox"class="form-check-input me-2" name="repatriation_of_mortal_remains_display" id="repatriation_of_mortal_remains_display" checked>
|
||||
<label class="form-check-label mb-0" for="repatriation_of_mortal_remains">Repatriation of Mortal Remains</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="repatriation_of_mortal_remains">Repatriation of Mortal Remains</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="repatriation_of_mortal_remains" id="repatriation_of_mortal_remains" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="childrenEducationWelfareFund_display" id="childrenEducationWelfareFund_display" checked>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input me-2" name="childrenEducationWelfareFund_display" id="childrenEducationWelfareFund_display" checked>
|
||||
<label class="form-check-label mb-0" for="childrenEducationWelfareFund">Children Education Welfare Fund</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="childrenEducationWelfareFund">Children Education Welfare Fund</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="childrenEducationWelfareFund" id="childrenEducationWelfareFund" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="terrorism_display" id="gpa_terrorism_display" checked>
|
||||
<div class="col-md-2">
|
||||
<div class="form-check align-items-center">
|
||||
<input type="checkbox" class="form-check-input me-2" name="terrorism_display" id="gpa_terrorism_display" checked>
|
||||
<label class="form-check-label mb-0"for="terrorism">Terrorism</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="terrorism">Terrorism</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="terrorism" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="worldwideCover_display" id="worldwideCover_display" checked>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input" name="worldwideCover_display" id="worldwideCover_display" checked>
|
||||
<label class="form-check-label" for="worldwideCover">Worldwide Cover</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="worldwideCover">Worldwide Cover</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="worldwideCover" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="family_transportation_benefits_display" id="family_transportation_benefits_display" checked>
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input" name="family_transportation_benefits_display" id="family_transportation_benefits_display" checked>
|
||||
<label class="form-check-label" for="family_transportation_benefits">Family Transportation Benefits</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="family_transportation_benefits">Family Transportation Benefits</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="family_transportation_benefits" id="family_transportation_benefits" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="fractures_dislocation_burns_display" id="fractures_dislocation_burns_display" checked>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input" name="fractures_dislocation_burns_display" id="fractures_dislocation_burns_display" checked>
|
||||
<label class="form-check-label"for="fractures_dislocation_burns">Fractures / Dislocation / Burns</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="fractures_dislocation_burns">Fractures / Dislocation / Burns</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="fractures_dislocation_burns" id="fractures_dislocation_burns" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="coma_display" id="coma_display" checked>
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input" name="coma_display" id="coma_display" checked>
|
||||
<label class="form-check-label" for="coma">Coma</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="coma">Coma</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="coma" id="coma" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="carriageofDeadBody_display" id="carriageofDeadBody_display" checked>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex-align-items-center">
|
||||
<input type="checkbox" class="form-check-input" name="carriageofDeadBody_display" id="carriageofDeadBody_display" checked>
|
||||
<label class="form-check-label" for="carriageOfDeadBody">Carriage of Dead Body</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="carriageOfDeadBody">Carriage of Dead Body</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="carriageOfDeadBody" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="compassionateVisitExpenses_display" id="compassionateVisitExpenses_display" checked>
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex-align-items-center">
|
||||
<input type="checkbox" class="form-check-input" name="compassionateVisitExpenses_display" id="compassionateVisitExpenses_display" checked>
|
||||
<label class="form-check-label" for="compassionateVisitExpenses">Compassionate Visit Expenses</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="compassionateVisitExpenses">Compassionate Visit Expenses</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="compassionateVisitExpenses" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="travel_expenses_for_medical_treatment_display" id="travel_expenses_for_medical_treatment_display" checked>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input" name="travel_expenses_for_medical_treatment_display" id="travel_expenses_for_medical_treatment_display" checked>
|
||||
<label class="form-check-label" for="travel_expenses_for_medical_treatment">Travel expenses for Medical Treatment</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="travel_expenses_for_medical_treatment">Travel expenses for Medical Treatment</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="travel_expenses_for_medical_treatment" id="travel_expenses_for_medical_treatment" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="daily_cash_allowance_display" id="daily_cash_allowance_display" checked>
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input" name="daily_cash_allowance_display" id="daily_cash_allowance_display" checked>
|
||||
<label class="form-check-label" for="daily_cash_allowance">Daily cash Allowance</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="daily_cash_allowance">Daily cash Allowance</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="daily_cash_allowance" id="daily_cash_allowance" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="artifical_limb_and_prosthesis_display" id="artifical_limb_and_prosthesis_display" checked>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input" name="artifical_limb_and_prosthesis_display" id="artifical_limb_and_prosthesis_display" checked>
|
||||
<label class="form-check-label" for="artifical_limb_and_prosthesis">Artifical Limb and Prosthesis</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="artifical_limb_and_prosthesis">Artifical Limb and Prosthesis</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="artifical_limb_and_prosthesis" id="artifical_limb_and_prosthesis" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="animalSnakeInsectBite_display" id="animalSnakeInsectBite_display" checked>
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input" name="animalSnakeInsectBite_display" id="animalSnakeInsectBite_display" checked>
|
||||
<label class="form-check-label" for="animalSnakeInsectBite">Animal/Snake/Insect bite</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="animalSnakeInsectBite">Animal/Snake/Insect bite</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="animalSnakeInsectBite" id="animalSnakeInsectBite" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-1">
|
||||
<input type="checkbox" style="margin-top: 12px" class="unchecked" name="air_ambulance_display" id="air_ambulance_display" checked>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-2">
|
||||
<div class="form-check d-flex align-items-center">
|
||||
<input type="checkbox" class="form-check-input" name="air_ambulance_display" id="air_ambulance_display" checked>
|
||||
<label class="form-check-label" for="air_ambulance">Air Ambulance</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="air_ambulance">Air Ambulance</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" name="air_ambulance" id="air_ambulance" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="gpa_special_condition">
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="form-group text-right m-b-0" style="margin-top: -49px;">
|
||||
<a href="#" class="button-like" id="gpaButtonSpecialCondition" title="Special Condition">Special Condition</a>
|
||||
<a href="#" class="btn button-like" id="gpaButtonSpecialCondition" title="Special Condition">Special Condition</a>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnGPATermsSubmit" style="margin-top: 100px;">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
@ -617,45 +568,77 @@
|
||||
|
||||
let gpaJsonObjectForSpecialCondition = JSON.parse(res.data);
|
||||
Object.keys(gpaJsonObjectForSpecialCondition).forEach(function(key) {
|
||||
if (key.includes("gpa_special_condition_label") || key.includes(
|
||||
"gpa_special_condition_input")) {
|
||||
|
||||
// if (key.includes("gpa_special_condition_label") || key.includes("gpa_special_condition_input")) {
|
||||
|
||||
// if (key.includes("gpa_special_condition_label")) {
|
||||
// for (let index = 0; index <
|
||||
// gpaJsonObjectForSpecialCondition[key].length; index++) {
|
||||
// specialConditionForGPA();
|
||||
// }
|
||||
// }
|
||||
|
||||
// let elements = document.getElementsByName(`${key}[]`);
|
||||
|
||||
// if (elements) {
|
||||
// elements.forEach((element, index) => {
|
||||
|
||||
// if (gpaJsonObjectForSpecialCondition[key][
|
||||
// index
|
||||
// ] == undefined) {
|
||||
// element.value = " ";
|
||||
// } else {
|
||||
// element.value =
|
||||
// gpaJsonObjectForSpecialCondition[key][
|
||||
// index
|
||||
// ];
|
||||
|
||||
// if (key.includes("gpa_special_condition_label")) {
|
||||
// let checkbox = $(element).closest('.form-group').find('input[name="gpa_special_condition_display[]"]');
|
||||
// console.log("First element:", element);
|
||||
|
||||
// if (checkbox.length) {
|
||||
// console.log("Checkbox found:", checkbox);
|
||||
|
||||
// // Correct way to set the 'id' attribute
|
||||
// let formattedValue = gpaJsonObjectForSpecialCondition[key][index].replace(/[\s\-\/,&]+/g, '').toLowerCase();
|
||||
// console.log('formattedValue', formattedValue);
|
||||
// checkbox.attr('id', formattedValue + '_display');
|
||||
|
||||
// console.log("Updated Checkbox:", checkbox);
|
||||
// } else {
|
||||
// console.log("Checkbox not found for:", element);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
if (key.includes("gpa_special_condition_label") || key.includes("gpa_special_condition_input")) {
|
||||
|
||||
if (key.includes("gpa_special_condition_label")) {
|
||||
for (let index = 0; index <
|
||||
gpaJsonObjectForSpecialCondition[key].length; index++) {
|
||||
specialConditionForGPA();
|
||||
let count = gpaJsonObjectForSpecialCondition[key]?.length || 0;
|
||||
for (let i = 0; i < count; i++) {
|
||||
specialConditionForGPA(); // Called once per label entry
|
||||
}
|
||||
}
|
||||
|
||||
let elements = document.getElementsByName(`${key}[]`);
|
||||
|
||||
if (elements) {
|
||||
elements.forEach((element, index) => {
|
||||
if (elements && elements.length) {
|
||||
Array.from(elements).forEach((element, index) => {
|
||||
let value = gpaJsonObjectForSpecialCondition[key]?.[index] || "";
|
||||
|
||||
if (gpaJsonObjectForSpecialCondition[key][
|
||||
index
|
||||
] == undefined) {
|
||||
element.value = " ";
|
||||
} else {
|
||||
element.value =
|
||||
gpaJsonObjectForSpecialCondition[key][
|
||||
index
|
||||
];
|
||||
element.value = value;
|
||||
|
||||
if (key.includes("gpa_special_condition_label")) {
|
||||
let checkbox = $(element).closest('.form-group').find('input[name="gpa_special_condition_display[]"]');
|
||||
console.log("First element:", element);
|
||||
if (key.includes("gpa_special_condition_label")) {
|
||||
let checkbox = $(element).closest('.form-group')
|
||||
.find('input[name="gpa_special_condition_display[]"]');
|
||||
|
||||
if (checkbox.length) {
|
||||
console.log("Checkbox found:", checkbox);
|
||||
|
||||
// Correct way to set the 'id' attribute
|
||||
let formattedValue = gpaJsonObjectForSpecialCondition[key][index].replace(/[\s\-\/,&]+/g, '').toLowerCase();
|
||||
console.log('formattedValue', formattedValue);
|
||||
checkbox.attr('id', formattedValue + '_display');
|
||||
|
||||
console.log("Updated Checkbox:", checkbox);
|
||||
} else {
|
||||
console.log("Checkbox not found for:", element);
|
||||
}
|
||||
if (checkbox.length) {
|
||||
let formattedValue = value.replace(/[\s\-\/,&]+/g, '').toLowerCase();
|
||||
checkbox.attr('id', formattedValue + '_display');
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -937,22 +920,28 @@
|
||||
|
||||
var html = `
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for="sumInsured">Additional Sum Insured</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input style="width: 128%;" value="${data == null || data == undefined || data == "" ? '' : data}" type="text" name="multiple_sum_insured[]" class="form-control multiple_sum_insured" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this); numtowordinkeyup(this)">
|
||||
</div>
|
||||
<div class="col-md-2" style="position: relative;left: 88px;">
|
||||
<button type="button" class="btn btn-danger si-remove-multi" onclick="removeGMCAdditionalSI(this)">x</button>
|
||||
<button type="button" class="btn btn-primary si-add-more" onclick="appendGPASIAddMore()">+</button>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="text-danger-2 numberToWordSumInsured"></div>
|
||||
</div>
|
||||
</div>`;
|
||||
<div class="col">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<label for="sumInsured" class="form-label" >Additional Sum Insured</label>
|
||||
<input
|
||||
style="max-width:200px;"
|
||||
value="${data == null || data == undefined || data == "" ? '' : data}" type="text" name="multiple_sum_insured[]"
|
||||
class="form-control multiple_sum_insured mr-2" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this); numtowordinkeyup(this)">
|
||||
<button type="button" class="btn btn-danger si-remove-multi mr-2" onclick="removeGMCAdditionalSI(this)"
|
||||
style="background-color: #BD0707;border:1px solid #BD0707">
|
||||
<i class="mdi mdi-delete"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary si-add-more mr-2" onclick="appendGPASIAddMore()"
|
||||
style="background-color: #e26728; border:1px solid #e26728;" >
|
||||
<i class="mdi mdi-plus"></i>
|
||||
</button>
|
||||
<div id='numberToWordSumInsured' class="text-danger-2 "></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
`;
|
||||
|
||||
$('#gpa_si_add_more').append(html);
|
||||
}
|
||||
@ -1051,6 +1040,32 @@
|
||||
|
||||
console.log('autoSaveGpaTerms function called');
|
||||
|
||||
var form = $('#policyGPATerms')[0];
|
||||
if (!form) {
|
||||
console.error("Form #policyGPATerms not found");
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if form has any data before proceeding
|
||||
var formData = new FormData(form);
|
||||
var hasData = false;
|
||||
|
||||
|
||||
for (let [key, value] of formData.entries()) {
|
||||
console.log("Key:", key, "Value:", value);
|
||||
if(key == "sumInsured2"){
|
||||
if (value && value.toString().trim() !== '') {
|
||||
hasData = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasData) {
|
||||
console.warn("Form data is empty, skipping auto-save");
|
||||
return;
|
||||
}
|
||||
|
||||
var specialConditions = [];
|
||||
|
||||
$(".removeDom").each(function () {
|
||||
@ -1063,12 +1078,9 @@
|
||||
specialConditions.push({ [label]: input });
|
||||
}
|
||||
});
|
||||
|
||||
console.log("gpa_specialConditions", specialConditions);
|
||||
|
||||
var formData = new FormData($('#policyGPATerms')[0]);
|
||||
console.log("formData", formData);
|
||||
|
||||
// var formData = new FormData($('#policyGPATerms')[0]);
|
||||
var policy_form_action = '<?= base_url("client/terms/gpa_create") ?>';
|
||||
console.log("policy_form_action", policy_form_action);
|
||||
|
||||
|
||||
@ -26,9 +26,10 @@
|
||||
border: 2px solid red; /* or any other style you prefer */
|
||||
}
|
||||
|
||||
/* .unitDiv{
|
||||
display: none;
|
||||
} */
|
||||
#bs-example-modal-lg .modal-dialog{
|
||||
width:1080px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
@ -60,7 +61,7 @@
|
||||
<!-- Modal content for the Large example -->
|
||||
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
|
||||
aria-hidden="true" aria-modal="true" data-backdrop="static" style="padding-right: 15px">
|
||||
<div class="modal-dialog modal-full-width">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<div class="col-md-6">
|
||||
@ -3391,7 +3392,7 @@ function appendNewTab(tabNameData = null, data = null)
|
||||
<a href="#" id="copyfromexcel_${tabId}" onclick="copyFromExcel(this, '${tabId}')">Copy from excel</a>
|
||||
<hr>
|
||||
|
||||
<div class="form-row" id="grid_content_input_for_additional_${tabId}" style="display: true;">
|
||||
<div class="form-row" id="grid_content_input_for_additional_${tabId}" style="display: block;">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -1253,11 +1253,16 @@ $(document).ready(function(){
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
if(shouldClose){
|
||||
console.log("alert closed")
|
||||
localStorage.removeItem('vehicleFormData');
|
||||
$("#vehicle_form").find("input, select, textarea").val("");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$('#aadhar').attr('data-parsley-required', 'false');
|
||||
$('#aadhar').removeAttr('required');
|
||||
@ -1736,8 +1741,16 @@ function getPolicyTransactionDataForEdit(input) {
|
||||
$('#cd_ac_pk_for_leader').val(res.data.cd_ac_pk);
|
||||
|
||||
// $('#entity_type_id').val(res.data.entity_type_id);
|
||||
getKYCEntityDocument(res.data.entity_type_id, res.data.client_id);
|
||||
appendKycTableListData(res.data.client_kyc);
|
||||
// getKYCEntityDocument(res.data.entity_type_id, res.data.client_id);
|
||||
// appendKycTableListData(res.data.client_kyc);
|
||||
|
||||
$('#tbody').empty();
|
||||
$('#tbody').append(res.data.client_kyc_primary_table);
|
||||
|
||||
$('#other_docs').empty();
|
||||
$('#other_docs').append(res.data.client_kyc_other_table);
|
||||
|
||||
|
||||
|
||||
|
||||
// Setting values to correct fields
|
||||
@ -3346,8 +3359,14 @@ $("#inception_form_id").submit(function(event) {
|
||||
$('#client_id_for_vehicle_file_upload').val(res.data.client_id);
|
||||
$('#vehicle_id_for_file_upload').val(res.data.vehicle_id);
|
||||
|
||||
getKYCEntityDocument(res.data.entity_type_id, res.data.client_id);
|
||||
appendKycTableListData(res.data.client_kyc);
|
||||
// getKYCEntityDocument(res.data.entity_type_id, res.data.client_id);
|
||||
// appendKycTableListData(res.data.client_kyc);
|
||||
|
||||
$('#tbody').empty();
|
||||
$('#tbody').append(res.data.client_kyc_primary_table);
|
||||
|
||||
$('#other_docs').empty();
|
||||
$('#other_docs').append(res.data.client_kyc_other_table);
|
||||
|
||||
//setTimeout(function(){
|
||||
//}, 1000)
|
||||
|
||||
@ -131,8 +131,18 @@ table.dataTable tbody td {
|
||||
}
|
||||
|
||||
.slider.round:before {
|
||||
border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
#inception_filter{
|
||||
margin-bottom:-20px !important;
|
||||
margin-left:30px !important;
|
||||
}
|
||||
|
||||
#inception_list{
|
||||
margin-left:20px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="row" id="inception_filter">
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<div class="tab-pane fade active show" id="general-q-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<div class="card-body subcard">
|
||||
<div class="custom-form">
|
||||
<form role="form" class="parsley-examples" method="post" id="policytype_general_form" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="policytype_General_PrimaryKey" value="<?= isset($policytype['id']) ? $policytype['id'] : '' ?>"/>
|
||||
@ -70,16 +71,18 @@
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<!-- <hr> -->
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack"
|
||||
id="btnBack">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
<div class="row" id="policy_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-body maincard">
|
||||
<!-- <div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Policy Type List</h4>
|
||||
@ -78,6 +78,11 @@
|
||||
<a href="<?= base_url("master/policy/create"); ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Policy</h4>
|
||||
</div>
|
||||
</div>
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
|
||||
@ -30,23 +30,32 @@ body {
|
||||
|
||||
</style>
|
||||
|
||||
<div class="row" id="policy_add">
|
||||
<div id="policy_add">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="card-body maincard">
|
||||
<!-- <div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Policy Type</h4>
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right;">
|
||||
<a href="<?= base_url("master/policy/list"); ?>"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i> </a>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<h4 class="d-flex align-items-center" style="gap: 8px;">
|
||||
<span onclick="history.back()" style="cursor: pointer;">
|
||||
<i class="mdi mdi-chevron-left" style="font-size: 43px;"></i>
|
||||
</span>
|
||||
<span class="title-text ">Policy Type</span>
|
||||
</h4>
|
||||
</div>
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-2 active">
|
||||
class="nav-link px-3 py-2 active-tab active">
|
||||
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
|
||||
|
||||
<span class="d-none d-sm-inline-block">General</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@ -176,56 +176,192 @@ $(document).ready(function() {
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
// buttons: [
|
||||
// {
|
||||
// extend: 'csv',
|
||||
// text: 'CSV',
|
||||
// title: 'Policy-Tranction-BDS-List',
|
||||
// },
|
||||
// {
|
||||
// extend: 'excel',
|
||||
// text: 'Excel',
|
||||
// title: 'Policy-Tranction-BDS-List',
|
||||
// customize: function(xlsx) {
|
||||
// var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
||||
// var total = 0;
|
||||
|
||||
// // 🔹 Force column K (11) and L (12) as string
|
||||
// $('row c[r^="K"], row c[r^="L"]', sheet).attr('t', 'inlineStr');
|
||||
|
||||
// // Find cells in column AB (28th column in Excel)
|
||||
// $('row c[r^="AB"]', sheet).each(function() {
|
||||
// var value = parseFloat($('v', this).text()); // Get the value inside the cell
|
||||
// if (!isNaN(value)) {
|
||||
// total += value;
|
||||
// }
|
||||
// });
|
||||
|
||||
// // Get the last row index and append the total row
|
||||
// var lastRow = $('row:last', sheet);
|
||||
// var rowIndex = parseInt(lastRow.attr('r')) + 2; // Find the next row index
|
||||
// var totalRow = '<row r="' + rowIndex + '">' +
|
||||
// '<c t="inlineStr" r="AA' + rowIndex + '"><is><t>Total</t></is></c>' + // Insert "Total" in AA
|
||||
// '<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '</v></c>' + // Insert sum in AB
|
||||
// '</row>';
|
||||
|
||||
// // Append the new total row to the sheet
|
||||
// $(sheet).find('sheetData').append(totalRow);
|
||||
// },
|
||||
// exportOptions: {
|
||||
// orthogonal: 'sort'
|
||||
// },
|
||||
// customizeData: function (data) {
|
||||
// for (var i = 0; i < data.body.length; i++) {
|
||||
// for (var j = 0; j < data.body[i].length; j++) {
|
||||
// // Check if the column is the 9th index (10th column) and 10th index (11th column)
|
||||
// if (j === 9 || j === 10) {
|
||||
// data.body[i][j] = '\u200C' + data.body[i][j];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// ],
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
exportOptions: {
|
||||
columns: ':visible', // or specify exact columns [0,1,2,...]
|
||||
format: {
|
||||
body: function (data, row, column, node) {
|
||||
// Force K and L columns to string
|
||||
if (column === 10 || column === 11) {
|
||||
// Option 1: prepend single quote
|
||||
return '\u200C' + data;
|
||||
|
||||
// Option 2: use Excel formula trick
|
||||
// return '="' + data + '"';
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
customize: function(xlsx) {
|
||||
// customize: function (xlsx) {
|
||||
// var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
||||
// var total = 0;
|
||||
|
||||
// // 🔹 Force column K (11) and L (12) as string
|
||||
// // $('row c[r^="K"], row c[r^="L"]', sheet).attr('t', 'inlineStr');
|
||||
// // 🔹 Convert column K (11th) & L (12th) to inline string
|
||||
// $('row c[r^="K"], row c[r^="L"]', sheet).each(function () {
|
||||
// var cell = $(this);
|
||||
// console.log(cell);
|
||||
// var val = cell.find('v').text(); // get value
|
||||
// if (val) {
|
||||
// cell.attr('t', 'inlineStr'); // mark as text
|
||||
// cell.remove('v'); // remove <v>
|
||||
// cell.append('<is><t>' + val + '</t></is>'); // replace with inline string
|
||||
// }
|
||||
// });
|
||||
|
||||
// // Calculate total in AB (28th column)
|
||||
// $('row c[r^="AB"]', sheet).each(function () {
|
||||
// var value = parseFloat($('v', this).text());
|
||||
// if (!isNaN(value)) {
|
||||
// total += value;
|
||||
// }
|
||||
// });
|
||||
|
||||
// // Append total row
|
||||
// var lastRow = $('row:last', sheet);
|
||||
// var rowIndex = parseInt(lastRow.attr('r')) + 2;
|
||||
// var totalRow = '<row r="' + rowIndex + '">' +
|
||||
// '<c t="inlineStr" r="AA' + rowIndex + '"><is><t>Total</t></is></c>' +
|
||||
// '<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '</v></c>' +
|
||||
// '</row>';
|
||||
|
||||
// $(sheet).find('sheetData').append(totalRow);
|
||||
// },
|
||||
customize: function (xlsx) {
|
||||
var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
||||
var total = 0;
|
||||
|
||||
// Find cells in column AB (28th column in Excel)
|
||||
$('row c[r^="AB"]', sheet).each(function() {
|
||||
var value = parseFloat($('v', this).text()); // Get the value inside the cell
|
||||
if (!isNaN(value)) {
|
||||
total += value;
|
||||
function forceAsText(cell) {
|
||||
var val = cell.find('v').text();
|
||||
if (val) {
|
||||
// Remove old <v>
|
||||
cell.find('v').remove();
|
||||
|
||||
// Force as inline string
|
||||
cell.attr('t', 'inlineStr');
|
||||
cell.append('<is><t>' + val + '</t></is>');
|
||||
}
|
||||
}
|
||||
|
||||
function forceAsTextPreserveOriginal(cell) {
|
||||
// Get the original cell value from the cell's text content
|
||||
var vElement = cell.find('v');
|
||||
if (vElement.length > 0) {
|
||||
var originalValue = vElement.text();
|
||||
|
||||
// Remove the <v> element
|
||||
vElement.remove();
|
||||
|
||||
// Set cell type to inline string and preserve the original value
|
||||
cell.attr('t', 'inlineStr');
|
||||
cell.append('<is><t>' + originalValue + '</t></is>');
|
||||
}
|
||||
}
|
||||
|
||||
// 🔹 Force K column as text (working correctly)
|
||||
$('row c[r^="K"]', sheet).each(function () {
|
||||
forceAsText($(this));
|
||||
});
|
||||
|
||||
// Get the last row index and append the total row
|
||||
// 🔹 Force L column as text with better preservation
|
||||
$('row c[r^="L"]', sheet).each(function () {
|
||||
forceAsTextPreserveOriginal($(this));
|
||||
});
|
||||
|
||||
// 🔹 Calculate total in AB (28th column)
|
||||
$('row c[r^="AB"] v', sheet).each(function () {
|
||||
var value = parseFloat($(this).text());
|
||||
if (!isNaN(value)) total += value;
|
||||
});
|
||||
|
||||
// 🔹 Append total row
|
||||
var lastRow = $('row:last', sheet);
|
||||
var rowIndex = parseInt(lastRow.attr('r')) + 2; // Find the next row index
|
||||
var rowIndex = parseInt(lastRow.attr('r')) + 2;
|
||||
var totalRow = '<row r="' + rowIndex + '">' +
|
||||
'<c t="inlineStr" r="AA' + rowIndex + '"><is><t>Total</t></is></c>' + // Insert "Total" in AA
|
||||
'<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '</v></c>' + // Insert sum in AB
|
||||
'<c t="inlineStr" r="AA' + rowIndex + '"><is><t>Total</t></is></c>' +
|
||||
'<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '</v></c>' +
|
||||
'</row>';
|
||||
|
||||
// Append the new total row to the sheet
|
||||
$(sheet).find('sheetData').append(totalRow);
|
||||
},
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
customizeData: function (data) {
|
||||
for (var i = 0; i < data.body.length; i++) {
|
||||
for (var j = 0; j < data.body[i].length; j++) {
|
||||
// Check if the column is the 9th index (10th column) and 10th index (11th column)
|
||||
if (j === 9 || j === 10) {
|
||||
data.body[i][j] = '\u200C' + data.body[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
customizeData: function (data) {
|
||||
for (var i = 0; i < data.body.length; i++) {
|
||||
for (var j = 0; j < data.body[i].length; j++) {
|
||||
// Force 10th (index 9) & 11th (index 10) as text
|
||||
if (j === 9 || j === 10 || j === 11 || j === 12 ) {
|
||||
data.body[i][j] = '\u200C' + data.body[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
|
||||
376
app/Views/retail_endorsement_list.php
Executable file
376
app/Views/retail_endorsement_list.php
Executable file
@ -0,0 +1,376 @@
|
||||
<style>
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.btn .btn-secondary .buttons-csv .buttons-html5 .my_class {
|
||||
position: relative;
|
||||
left: 79px;
|
||||
}
|
||||
.emp_data_model {
|
||||
font-size: 17px; /* keep fixed size */
|
||||
color: #555 !important;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s, color 0.2s; /* smooth hover effect */
|
||||
display: inline-block; /* important for transform */
|
||||
}
|
||||
|
||||
.emp_data_model:hover {
|
||||
color: #00999E !important;
|
||||
transform: scale(1.5);
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="container-fluid">
|
||||
<h2>Retail Endorsement</h2>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label>Client</label> <br />
|
||||
<select class="form-control" id="clients">
|
||||
<option value="0">Select</option>
|
||||
<?php foreach ($client as $key => $value) { ?>
|
||||
<option value="<?= $value['id'] ?>" <?= (($getData['client_id'] ?? '') == $value['id']) ? 'selected' : '' ?>>
|
||||
<?= $value['client_name'] . (!empty($value['short_name']) ? ' ( ' . $value['short_name'] . ' )' : '') ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Insurer</label> <br />
|
||||
<select class="form-control" id="insurer">
|
||||
<option value="0">Select</option>
|
||||
<?php foreach ($insurer as $key => $value) { ?>
|
||||
<option value="<?= $value['id'] ?>" <?= (($getData['insurer_id'] ?? '') == $value['id']) ? 'selected' : '' ?>>
|
||||
<?= $value['name'] . (!empty($value['short_name']) ? ' ( ' . $value['short_name'] . ' )' : '') ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Status</label> <br />
|
||||
<select class="form-control" id="status1">
|
||||
<option value="0">Select</option>
|
||||
<?php foreach ($status as $key => $value) { ?>
|
||||
<option value="<?= $key ?>" <?= (($getData['status'] ?? '') == $key) ? 'selected' : '' ?>>
|
||||
<?= $value ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12" style="text-align: right;">
|
||||
<a href="<?= base_url("employee/retail-endorsement-list"); ?>" class="btn btn-primary waves-effect waves-light" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="client_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Endorsement</h4>
|
||||
</div>
|
||||
</div>
|
||||
<table data-custom-table-css="table" class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<th class="font-weight-medium">Policy number</th>
|
||||
<th class="font-weight-medium">Endorsement Number</th>
|
||||
<th class="font-weight-medium">Description</th>
|
||||
<th class="font-weight-medium">Client</th>
|
||||
<th class="font-weight-medium">Insurer name</th>
|
||||
<th class="font-weight-medium">Agent</th>
|
||||
<th class="font-weight-medium">Mananger</th>
|
||||
<th class="font-weight-medium">Created At</th>
|
||||
<th class="font-weight-medium">Status</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="font-12">
|
||||
<?php
|
||||
if (isset($employees)) {
|
||||
foreach ($employees as $key => $employee) { ?>
|
||||
<tr>
|
||||
<td class="text-center"><b><?php echo ($key + 1) ?></b></td>
|
||||
<td class="text-center"><?php echo $employee['policy_number'] ?></td>
|
||||
<td class="text-center"><?php echo $employee['endorsement_no'] ?></td>
|
||||
<td class="text-center"><?php echo $employee['endorsement_description'] ?></td>
|
||||
<td class="text-center"><?php echo $employee['client_name'] ? $employee['client_name'] .' ( '. $employee['client_short_name'] .' ) ' : 'N/A' ?></td>
|
||||
<td class="text-center"><?php echo $employee['insurer_name'] ? $employee['insurer_name'] .' ( '. $employee['insurer_short_name'] .' ) ' : 'N/A' ?></td>
|
||||
<td class="text-center"><?php echo $employee['agent_name'] ?? 'N/A' ?></td>
|
||||
<td class="text-center"><?php echo $employee['manager_name'] ?? 'N/A' ?></td>
|
||||
<td class="text-center"><?php if (!empty($employee['created_at'])):
|
||||
$cd = date("j F Y", strtotime($employee['created_at']));
|
||||
$ct = date("h:i a", strtotime($employee['created_at']));
|
||||
echo $cd . "<br><span class='time'> " . $ct . "</span>";
|
||||
endif; ?></td>
|
||||
<td class="text-center"><?php if ($employee['status'] == 'open') {
|
||||
echo '<span class="badge badge-primary">' . $employee['status'] . '</span>';
|
||||
} elseif ($employee['status'] == 'inprogress') {
|
||||
echo '<span class="badge badge-warning">' . $employee['status'] . '</span>';
|
||||
} elseif ($employee['status'] == 'complete') {
|
||||
echo '<span class="badge badge-success">' . $employee['status'] . '</span>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="text-center"><a href="#" data-id="<?php echo $employee['id'] ?>" data-eno="<?php echo $employee['endorsement_no'] ?>" data-status="<?php echo $employee['status'] ?>"
|
||||
class="mdi mdi-pencil text-muted vertical-middle emp_data_model" aria-hidden="true" data-toggle="modal" data-target="#centermodal"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="modal fade app-text-black " id="centermodal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<form id="retailEndorsementForm">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title title-text" id="myCenterModalLabel" style="font-size:27px !important">Edit Endorsement Details <span id="heading"></span></h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="form-row">
|
||||
<input type="hidden" id="edit_id" name="id">
|
||||
<input type="hidden" id="updated_by" name="updated_by" value="<?= get_session_userid(); ?>">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>"/>
|
||||
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="endorsement_no" class="sub-title-text ">Endorsement Number<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="endorsement_no" placeholder="Enter Endorsement Number" name="endorsement_no" required>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="edit_status" class="sub-title-text ">Status<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="edit_status" name="status" required>
|
||||
<option value="">Select Status</option>
|
||||
<?php foreach ($status as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"><?= $value ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn app-btn-outline-secondary mr-2 " type="button" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<button type="submit" class="btn app-btn-secondary" id="btnSubmit" onclick="submitRetailEndorsement(event)">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Initialize select2
|
||||
$("#clients").select2();
|
||||
$("#insurer").select2();
|
||||
});
|
||||
|
||||
var client_id = '<?= $getData['client_id'] ?? '' ?>';
|
||||
var insurer_id = '<?= $getData['insurer_id'] ?? '' ?>';
|
||||
var status_id = '<?= $getData['status'] ?? '' ?>';
|
||||
|
||||
$(window).on("load", function() {
|
||||
console.log("window loaded");
|
||||
});
|
||||
|
||||
|
||||
// Function to convert object to query parameters
|
||||
function objectToQueryString(obj) {
|
||||
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
|
||||
}
|
||||
|
||||
function fetchEmpolyeeList(event) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
|
||||
var client_id = $('#clients').val();
|
||||
var insurer_id = $('#insurer').val();
|
||||
var status = $('#status1').val();
|
||||
|
||||
var queryParams = {
|
||||
client_id: client_id,
|
||||
insurer_id: insurer_id,
|
||||
status: status,
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
|
||||
// console.log(apiURL);
|
||||
window.location.href = apiURL;
|
||||
|
||||
}
|
||||
|
||||
document.getElementById('toggleIcon').addEventListener('click', function() {
|
||||
var icon = document.getElementById('icon');
|
||||
icon.classList.toggle('mdi-chevron-down');
|
||||
icon.classList.toggle('mdi-chevron-up');
|
||||
});
|
||||
|
||||
|
||||
$('.emp_data_model').click(function() {
|
||||
var id = $(this).data('id');
|
||||
var eno = $(this).data('eno');
|
||||
var status = $(this).data('status');
|
||||
// console.log(val);
|
||||
fetchRetailEndorsementData(id,eno,status)
|
||||
|
||||
});
|
||||
|
||||
function submitRetailEndorsement(e) {
|
||||
e.preventDefault(); // stop normal form submit
|
||||
var form = document.getElementById("retailEndorsementForm");
|
||||
var id = form.querySelector("[name='id']").value;
|
||||
var formData = new FormData(form);
|
||||
form.classList.remove('was-validated');
|
||||
var btn = document.getElementById("btnSubmit");
|
||||
btn.disabled = true;
|
||||
btn.innerText = "Saving...";
|
||||
|
||||
var endorsement_no = document.getElementById('endorsement_no').value.trim();
|
||||
var edit_status = document.getElementById('edit_status').value.trim();
|
||||
|
||||
if (endorsement_no === "" || edit_status === "") {
|
||||
toastr.warning('Please fill all required fields.', 'Warning');
|
||||
form.classList.add('was-validated');
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "<?= base_url('/employee/retail-endorsement-save') ?>",
|
||||
type: "POST",
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.status === "success") {
|
||||
toastr.success(response.message, 'Success');
|
||||
$('.emp_data_model').modal('hide');
|
||||
form.reset();
|
||||
window.location.href = "<?= base_url('/employee/retail-endorsement-list') ?>";
|
||||
} else {
|
||||
toastr.error(response.message, 'Error');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
toastr.error("Something went wrong!", 'Error');
|
||||
console.error(xhr.responseText);
|
||||
},
|
||||
complete: function() {
|
||||
btn.disabled = false;
|
||||
btn.innerText = "Save";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function fetchRetailEndorsementData(id,eno,status) {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
var form = document.getElementById('retailEndorsementForm');
|
||||
form.reset();
|
||||
|
||||
$("#edit_id").val(id);
|
||||
$("#endorsement_no").val(eno);
|
||||
$("#edit_status").val(status);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 200);
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Retail-Endorsement-List',
|
||||
className: 'my_class',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)',
|
||||
format: {
|
||||
body: function (data, row, column, node) {
|
||||
// Convert data to string to avoid scientific notation in CSV
|
||||
if (!isNaN(data) && parseFloat(data) > 1e20) {
|
||||
return `'${data}`;
|
||||
}
|
||||
return data.toString();// Ensures all data is treated as strings
|
||||
}
|
||||
}
|
||||
}
|
||||
}],
|
||||
initComplete: function(settings, json) {
|
||||
$('.my_class').css({
|
||||
"position": "relative",
|
||||
"left": "15px"
|
||||
});
|
||||
},
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true,
|
||||
// pagingType: 'full_numbers'
|
||||
columnDefs: [
|
||||
{ type: 'scientific', targets: 0 } // Apply custom sorting type to the first column
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
@ -91,12 +91,7 @@ th, td {
|
||||
text-align: center; /* Or left/right depending on your preference */
|
||||
vertical-align: middle; /* Ensures content is vertically centered */
|
||||
}
|
||||
input[type="checkbox"] {
|
||||
width: 16px; /* Standard checkbox size */
|
||||
height: 16px;
|
||||
margin: 0; /* Remove default margin */
|
||||
vertical-align: middle; /* Align with text or other elements */
|
||||
}
|
||||
|
||||
th:first-child, td:first-child {
|
||||
width: 50px; /* Adjust width as needed */
|
||||
}
|
||||
@ -108,6 +103,24 @@ th:first-child, td:first-child {
|
||||
table-layout: fixed; /* Prevent columns from resizing dynamically */
|
||||
}
|
||||
|
||||
.unmapEmployees{
|
||||
background-color:#00999E ;
|
||||
margin-right:10px;
|
||||
}
|
||||
.mapEmployees{
|
||||
background-color:#00999E ;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
.unmapEmployees:hover{
|
||||
background-color:#00999E ;
|
||||
margin-right:10px;
|
||||
}
|
||||
.mapEmployees:hover{
|
||||
background-color:#00999E ;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
@ -119,7 +132,7 @@ th:first-child, td:first-child {
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Employees</h4>
|
||||
<h3 style="position: relative;">Employees</h3>
|
||||
</div>
|
||||
</div>
|
||||
<table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table">
|
||||
@ -398,7 +411,7 @@ th:first-child, td:first-child {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<div class="form-group ">
|
||||
<label for="email">Email<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="email_corporate" placeholder="Enter Email" name="email_corporate" data-parsley-trigger="change" data-parsley-type="email" >
|
||||
</div>
|
||||
@ -533,13 +546,15 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
text:'Map Employees',
|
||||
action: function(e, dt, node, config) {
|
||||
mapEmployees();
|
||||
}
|
||||
},
|
||||
className:"mapEmployees"
|
||||
},
|
||||
{
|
||||
text:'Unmap Employees',
|
||||
action: function(e, dt, node, config) {
|
||||
unmapEmployees();
|
||||
}
|
||||
},
|
||||
className:"unmapEmployees"
|
||||
}],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
|
||||
@ -1,63 +1,10 @@
|
||||
<style>
|
||||
|
||||
/* Force DataTable to allow rounded corners */
|
||||
#scroll-horizontal-datatable {
|
||||
border-collapse: separate !important;
|
||||
border-spacing: 0 8px !important; /* space between rows */
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* .table thead th {
|
||||
vertical-align: bottom;
|
||||
border-bottom: 2px solid #fff;
|
||||
} */
|
||||
|
||||
|
||||
/* Add shadow + spacing row "card" effect */
|
||||
tbody tr {
|
||||
/* box-shadow: 0 2px 5px rgba(0,0,0,0.08); */
|
||||
}
|
||||
|
||||
/* Search input with icon */
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.dataTables_filter input {
|
||||
padding-right: 30px;
|
||||
background: url('https://cdn.jsdelivr.net/npm/@mdi/svg/svg/magnify.svg') no-repeat right 8px center;
|
||||
background-size: 16px;
|
||||
}
|
||||
|
||||
/* Optional: control first column width */
|
||||
.table th:nth-child(1),
|
||||
.table td:nth-child(1) {
|
||||
max-width: 50px !important;
|
||||
min-width: 50px !important;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
|
||||
.maincard{
|
||||
margin-top:0 !important;
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.dataTables_filter input {
|
||||
padding-right: 30px; /* space for icon */
|
||||
background: url('https://cdn.jsdelivr.net/npm/@mdi/svg/svg/magnify.svg') no-repeat right 8px center;
|
||||
background-size: 16px;
|
||||
}
|
||||
|
||||
.right-align-input {
|
||||
text-align: right;
|
||||
@ -72,15 +19,8 @@ tbody tr {
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
/* .table th:nth-child(1),
|
||||
.table td:nth-child(1) {
|
||||
max-width: 200px !important;
|
||||
min-width: 100px !important;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
white-space: nowrap !important;
|
||||
} */
|
||||
|
||||
.text-custom-grey{
|
||||
font-size: 0.85em;
|
||||
@ -92,107 +32,6 @@ table.dataTable td.wrap {
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
table thead th {
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.btn-custom {
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
letter-spacing: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.table-custom th {
|
||||
font-family: 'Poppins', sans-serif !important;
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-size: 13px;
|
||||
line-height: 1.44;
|
||||
letter-spacing: -0.02em;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
||||
|
||||
/* Remove borders from all pagination buttons */
|
||||
/* Pagination (p) */
|
||||
.dataTables_wrapper .dataTables_paginate .paginate_button,
|
||||
.dataTables_wrapper .dataTables_paginate .paginate_button:active,
|
||||
.dataTables_wrapper .dataTables_paginate .paginate_button:focus,
|
||||
.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
|
||||
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
|
||||
padding: 2px 6px !important;
|
||||
font-size: 12px !important;
|
||||
background: transparent !important;
|
||||
border-radius: 13px !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.dataTables_wrapper .dataTables_paginate .page-item.previous .page-link,
|
||||
.dataTables_wrapper .dataTables_paginate .page-item.next .page-link {
|
||||
/* box-shadow: 0 0 0 0.15rem rgba(0,153,158,0.5) !important;
|
||||
background: rgba(0,153,158,0.8) !important;*/
|
||||
border-radius: 13px !important;
|
||||
background-color: #F5FFFF;
|
||||
border: none !important;
|
||||
box-shadow: 0 0 0 0.15rem #F5FFFF;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Active page number */
|
||||
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
|
||||
color: #fff !important;
|
||||
border-radius: 13px !important;
|
||||
}
|
||||
|
||||
/* Inactive (not active) page numbers */
|
||||
.dataTables_wrapper .dataTables_paginate .page-item:not(.active) .page-link {
|
||||
border: 1px solid #fff !important;
|
||||
border-radius: 13px !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Info text (i) */
|
||||
.dataTables_info {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
background-color: #ECECEC !important;
|
||||
border: 1px solid #ccc; /* optional */
|
||||
/* color: #000; keep text readable */
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
background-color: #ECECEC !important; /* keep same color on focus */
|
||||
box-shadow: none; /* remove blue glow */
|
||||
}
|
||||
|
||||
/* Select2 box */
|
||||
.select2-container .select2-selection--single {
|
||||
background-color: #ECECEC !important;
|
||||
border: 1px solid #ccc !important;
|
||||
height: 38px !important;
|
||||
}
|
||||
|
||||
/* Text inside */
|
||||
.select2-container .select2-selection__rendered {
|
||||
line-height: 36px !important;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
|
||||
background-color: #00999E !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@ -201,11 +40,11 @@ table thead th {
|
||||
<div class="card-body maincard">
|
||||
<div class="row">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<p class="title-text app-font-family font-color-black" style="position: relative;">Tickets </p>
|
||||
<p class="title-text font-color-black" style="position: relative;">Tickets </p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap text-custom-black text-custom app-font-family app-datatable">
|
||||
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap text-custom-black text-custom app-datatable">
|
||||
<thead class="app-table-head">
|
||||
<tr>
|
||||
<th>Ticket ID</th>
|
||||
@ -274,10 +113,10 @@ table thead th {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade app-font-family" id="ticketModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal fade " id="ticketModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-xl" style="margin:5px auto!important;">
|
||||
<div class="modal-content">
|
||||
<form id="ticketForm">
|
||||
<form class="parsley-examples" id="ticketForm">
|
||||
<!-- <div class="modal-header">
|
||||
<h4 class="modal-title" id="modalLabel">New Ticket</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
@ -286,13 +125,13 @@ table thead th {
|
||||
|
||||
<!-- first row -->
|
||||
<div class="d-flex w-100 justify-content-between align-items-center">
|
||||
<h4 class="modal-title app-font-family mb-0" id="modalLabel" style="font-size:27px !important">New Ticket</h4>
|
||||
<h4 class="modal-title mb-0" id="modalLabel" style="font-size:27px !important">New Ticket</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
<!-- second row -->
|
||||
<div class="form-row mt-3 w-100">
|
||||
<div class="form-group col-md-6 app-font-family">
|
||||
<div class="form-row mt-3 w-100 ">
|
||||
<div class="form-group col-md-6 ">
|
||||
<label for="client_id">Client</label>
|
||||
<select class="form-control app-field-grey font-color-black" id="client_id" name="client_id">
|
||||
<option value="">Select Client</option>
|
||||
@ -304,7 +143,7 @@ table thead th {
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-5 app-font-family">
|
||||
<div class="form-group col-md-5 ">
|
||||
<label for="mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control app-field-grey" id="mobile" placeholder="Enter Mobile Number"
|
||||
name="mobile"
|
||||
@ -313,7 +152,7 @@ table thead th {
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-1" style="padding:32.5px 0 0 18px;">
|
||||
<button type="button" class="btn-custom app-btn-primary app-font-family" style="padding: 0 10px !important; border-radius:13px;" onclick="getAutoFetchDetails()"><i class="mdi mdi-cached " style="font-size:24px;"></i></button>
|
||||
<button type="button" class="btn-custom app-btn-primary " style="padding: 0 10px !important; border-radius:13px;" onclick="getAutoFetchDetails()"><i class="mdi mdi-cached " style="font-size:24px;"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -326,12 +165,12 @@ table thead th {
|
||||
<input type="hidden" id="policy_id" name="policy_id">
|
||||
<input type="hidden" id="created_by" name="created_by" value="<?= get_session_userid(); ?>">
|
||||
|
||||
<div class="form-group col-md-4 app-font-family">
|
||||
<div class="form-group col-md-4 ">
|
||||
<label for="name">Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="Enter Name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 app-font-family">
|
||||
<div class="form-group col-md-4 ">
|
||||
<label for="email">Email Id<span class="text-danger">*</span></label>
|
||||
<input type="email" class="form-control" id="email"
|
||||
name="email" placeholder="Enter Email"
|
||||
@ -340,13 +179,13 @@ table thead th {
|
||||
title="Please enter a valid email address">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 app-font-family">
|
||||
<div class="form-group col-md-4 ">
|
||||
<label for="empcode">Employee code</label>
|
||||
<input type="text" class="form-control" id="empcode" name="empcode" placeholder="Enter Employee code">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4 app-font-family">
|
||||
<div class="form-group col-md-4 ">
|
||||
<label for="ticket_type">Ticket Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="ticket_type" name="ticket_type" required onchange="hideandshowpolicy()">
|
||||
<option value="">Select Ticket Type</option>
|
||||
@ -364,7 +203,7 @@ table thead th {
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 app-font-family" id="policy_container">
|
||||
<div class="form-group col-md-4 " id="policy_container">
|
||||
<label for="policy_no">Policy Number</label>
|
||||
<select class="form-control" id="policy_no" name="policy_no" onchange="changevalue()">
|
||||
<option value="" selected data-id="">Select Policy</option>
|
||||
@ -403,11 +242,11 @@ table thead th {
|
||||
<input type="hidden" id="hide_assign_to" name="assign_to" value="<?= esc(get_session_userid()); ?>">
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- <div class="form-group col-md-12 app-font-family">
|
||||
<!-- <div class="form-group col-md-12 ">
|
||||
<label for="subject">Subject<span class="text-danger">*</span></label>
|
||||
<small id="subjectCounter" class="form-text text-muted app-text-right">0/150</small>
|
||||
</div> -->
|
||||
<div class="form-group col-md-12 app-font-family">
|
||||
<div class="form-group col-md-12 ">
|
||||
<div class="d-flex justify-content-between">
|
||||
<label for="subject" class="mb-1">Subject <span class="text-danger">*</span></label>
|
||||
<small id="subjectCounter" class="form-text text-muted">0/150</small>
|
||||
@ -415,7 +254,7 @@ table thead th {
|
||||
<input type="text" class="form-control" id="subject" name="subject" placeholder="Enter Subject" required maxlength="150">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12 app-font-family">
|
||||
<div class="form-group col-md-12 ">
|
||||
<div class="d-flex justify-content-between">
|
||||
<label for="message">Message<span class="text-danger">*</span></label>
|
||||
<small id="messageCounter" class="form-text text-muted text-end app-text-right">0/1500</small>
|
||||
@ -427,8 +266,8 @@ table thead th {
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn app-btn-primary app-btn-border-radius mr-2 " onclick="resetTicket()">Reset</button>
|
||||
<button type="button" class="btn app-btn-secondary app-btn-border-radius" onclick="submitTicket()">Save</button>
|
||||
<button type="button" class="btn app-btn-primary mr-2 " onclick="resetTicket()">Reset</button>
|
||||
<button type="submit" class="btn app-btn-secondary " onclick="submitTicket(event)">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -436,7 +275,7 @@ table thead th {
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade app-font-family" id="AssignModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal fade " id="AssignModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -460,7 +299,7 @@ table thead th {
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn-custom app-btn-secondary app-btn-border-radius app-font-family" onclick="updateAssignTo()">Save</button>
|
||||
<button type="button" class="btn-custom app-btn-secondary " onclick="updateAssignTo()">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -488,7 +327,10 @@ table thead th {
|
||||
$("#ticket_type").select2();
|
||||
}
|
||||
|
||||
function submitTicket() {
|
||||
function submitTicket(event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var form = document.getElementById('ticketForm');
|
||||
|
||||
// reset any old error styles
|
||||
@ -537,6 +379,10 @@ table thead th {
|
||||
var form = document.getElementById("ticketForm"); // your form ID
|
||||
var formData = new FormData(form);
|
||||
|
||||
var btn = event.target;
|
||||
btn.disabled = true;
|
||||
btn.innerText = "Saving...";
|
||||
|
||||
$.ajax({
|
||||
url: "<?= base_url('ticketSave') ?>",
|
||||
type: "POST",
|
||||
@ -557,6 +403,10 @@ table thead th {
|
||||
error: function(xhr) {
|
||||
toastr.error("Something went wrong!", 'Error');
|
||||
console.error(xhr.responseText);
|
||||
},
|
||||
complete: function() {
|
||||
btn.disabled = false;
|
||||
btn.innerText = "Save";
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -744,27 +594,25 @@ $(document).ready(function() {
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [
|
||||
{
|
||||
text: '<i class="mdi mdi-plus" ></i><span class="app-font-family btn-custom"> Create New Ticket </span>',
|
||||
className: 'btn app-btn-primary app-btn-border-radius mr-2',
|
||||
text: '<i class="mdi mdi-plus" ></i><span class=" btn-custom"> Create New Ticket </span>',
|
||||
className: 'btn app-btn-primary mr-2',
|
||||
action: function(e, dt, node, config) {
|
||||
openTicket();
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'collection',
|
||||
text: '<span class="app-font-family btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
|
||||
className: 'btn app-btn-secondary app-btn-border-radius',
|
||||
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
|
||||
className: 'btn app-btn-secondary ',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" app-font-family btn-custom"> CSV </span>',
|
||||
title: 'Tickets',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
className: 'app-btn-primary ',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" app-font-family btn-custom"> EXCEL </span>',
|
||||
title: 'Tickets',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
@ -773,16 +621,9 @@ $(document).ready(function() {
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search...",
|
||||
paginate: {
|
||||
previous: "◄",
|
||||
next: "►"
|
||||
}
|
||||
},
|
||||
paging: true,
|
||||
pageLength: 25,
|
||||
order: [[0, 'desc']]
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
@ -69,11 +69,6 @@
|
||||
transform: scale(1.5);
|
||||
}
|
||||
|
||||
.maincard{
|
||||
margin-top:0 !important;
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
.conversation-card,
|
||||
.conversation-card .card-header,
|
||||
.conversation-card .card-body {
|
||||
@ -149,7 +144,7 @@ hr{
|
||||
<span onclick="history.back()" style="cursor: pointer;">
|
||||
<i class="mdi mdi-chevron-left" style="font-size: 43px;"></i>
|
||||
</span>
|
||||
<span class="title-text app-font-family">Ticket ID-<?= $master[0]['thz_id']; ?></span>
|
||||
<span class="title-text ">Ticket ID-<?= $master[0]['thz_id']; ?></span>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
@ -160,7 +155,7 @@ hr{
|
||||
<div class="col-5" id="notes-body-left">
|
||||
<div class="card master-card" style="background:#F5FFFF;">
|
||||
<div class="card-header d-flex justify-content-between align-items-center" style="background:none; border:none;">
|
||||
<p class="sub-title-text app-font-family mb-0">Details</p>
|
||||
<p class="sub-title-text mb-0">Details</p>
|
||||
<?php if($master[0]['status'] !== "Closed") : ?>
|
||||
<a href="javascript:void(0);" onclick="openEditTicket()">
|
||||
<i class="mdi mdi-pencil edit-icon" title="Edit"></i>
|
||||
@ -173,22 +168,22 @@ hr{
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="card-body card-scroll sub-title-text app-font-family" style="padding:0 27px !important; background:#F5FFFF;">
|
||||
<div class="card-body card-scroll sub-title-text " style="padding:0 27px !important; background:#F5FFFF;">
|
||||
<div class="row mb-2 ml-o">
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Ticket ID</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;"><?= $master[0]['thz_id'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey ">Ticket ID</div>
|
||||
<div class="col-8 app-text app-text-black text-end " style="font-weight: 500 !important;"><?= $master[0]['thz_id'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Name</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;"><?= $master[0]['name'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey ">Name</div>
|
||||
<div class="col-8 app-text app-text-black text-end " style="font-weight: 500 !important;"><?= $master[0]['name'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Mobile</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;"><?= $master[0]['mobile'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey ">Mobile</div>
|
||||
<div class="col-8 app-text app-text-black text-end " style="font-weight: 500 !important;"><?= $master[0]['mobile'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Policy Number</div>
|
||||
<div class="col-8 app-text text-end app-font-family app-text-black" style="font-weight: 500 !important;">
|
||||
<div class="col-4 app-subtitle app-text-grey ">Policy Number</div>
|
||||
<div class="col-8 app-text text-end app-text-black" style="font-weight: 500 !important;">
|
||||
<?= (!empty($master[0]['policy_no']) && strtolower($master[0]['policy_no']) !== 'null')
|
||||
? '<u class="app-text-black">
|
||||
<a href="javascript:void(0);"
|
||||
@ -204,12 +199,12 @@ hr{
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Assigned To</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;"><?= $master[0]['assignee_name'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey ">Assigned To</div>
|
||||
<div class="col-8 app-text app-text-black text-end " style="font-weight: 500 !important;"><?= $master[0]['assignee_name'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Status</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;">
|
||||
<div class="col-4 app-subtitle app-text-grey ">Status</div>
|
||||
<div class="col-8 app-text app-text-black text-end " style="font-weight: 500 !important;">
|
||||
<?= (!empty($master[0]['status']) && strtolower($master[0]['status']) !== 'null')
|
||||
? '<u class="app-text-black">
|
||||
<a href="javascript:void(0);"
|
||||
@ -225,20 +220,20 @@ hr{
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Ticket Type</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;"><?= $master[0]['ticket_type'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey ">Ticket Type</div>
|
||||
<div class="col-8 app-text app-text-black text-end " style="font-weight: 500 !important;"><?= $master[0]['ticket_type'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Subject</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important; text-align: justify;"><?= $master[0]['subject'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey ">Subject</div>
|
||||
<div class="col-8 app-text app-text-black text-end " style="font-weight: 500 !important; text-align: justify;"><?= $master[0]['subject'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Message</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important; text-align: justify;"><?= $master[0]['message'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey ">Message</div>
|
||||
<div class="col-8 app-text app-text-black text-end " style="font-weight: 500 !important; text-align: justify;"><?= $master[0]['message'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Related Tickets</div>
|
||||
<div class="col-8 app-text text-end app-font-family" style="font-weight: 500 !important;">
|
||||
<div class="col-4 app-subtitle app-text-grey ">Related Tickets</div>
|
||||
<div class="col-8 app-text text-end " style="font-weight: 500 !important;">
|
||||
<u class="text-warning">
|
||||
<a href="javascript:void(0);"
|
||||
class="text-warning"
|
||||
@ -264,7 +259,7 @@ hr{
|
||||
<!-- Conversation Card -->
|
||||
<div class="card mb-3 conversation-card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center" style="background:none; border:none; padding-bottom: 0px;">
|
||||
<p class="sub-title-text app-font-family app-text-black" >Conversation</p>
|
||||
<p class="sub-title-text app-text-black" >Conversation</p>
|
||||
</div>
|
||||
<div class="card-body recard-scroll" style="padding:0 27px !important; margin:0 !important; background:#F5FFFF;">
|
||||
<?php if(!empty($notes)): ?>
|
||||
@ -273,20 +268,20 @@ hr{
|
||||
<div style="border:none; padding: 0px; margin: 0px;">
|
||||
<hr/>
|
||||
<!-- Top Row: Message + Badge -->
|
||||
<div class="d-flex justify-content-between align-items-start app-text app-text-black app-font-family">
|
||||
<p class="mb-1 ml-0 mr-0 app-font-family" style="font-weight: 400 !important;"><?= $conv['notes'] ?></p>
|
||||
<div class="d-flex justify-content-between align-items-start app-text app-text-black ">
|
||||
<p class="mb-1 ml-0 mr-0 " style="font-weight: 400 !important;"><?= $conv['notes'] ?></p>
|
||||
<!-- <?php if(!empty($conv['notes_by'])): ?>
|
||||
<span class="badge bg-warning text-dark"><?= $conv['notes_by'] ?></span>
|
||||
<?php endif; ?> -->
|
||||
<?php if (!empty($conv['notes_type']) && $conv['notes_type'] === "Internal"): ?>
|
||||
<span class="badge app-badge-secondary app-text-white app-font-family" style="font-size:10px;"><?= $conv['notes_type'] ?></span>
|
||||
<span class="badge app-badge-secondary app-text-white " style="font-size:10px;"><?= $conv['notes_type'] ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- Bottom Row: Name + Date -->
|
||||
<div class="d-flex justify-content-between small text-muted" style="padding-top: 5px;">
|
||||
<span class="app-font-family" style="font-weight: 400 !important;"><i class="mdi mdi-account"></i> <?= $conv['name'] ?></span>
|
||||
<span style="font-size:9px; font-weight: 400 !important;" class="app-font-family"><?= date("j F Y h:i a", strtotime($conv['created_at'])) ?></span>
|
||||
<span class="" style="font-weight: 400 !important;"><i class="mdi mdi-account"></i> <?= $conv['name'] ?></span>
|
||||
<span style="font-size:9px; font-weight: 400 !important;" class=""><?= date("j F Y h:i a", strtotime($conv['created_at'])) ?></span>
|
||||
</div>
|
||||
|
||||
<!-- <?php echo $i < count($notes)-1 ? '<hr/>' : ''; ?> -->
|
||||
@ -294,9 +289,9 @@ hr{
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<div class="d-flex justify-content-center align-items-center app-font-family"
|
||||
<div class="d-flex justify-content-center align-items-center "
|
||||
style="height: 45vh; width:100%;">
|
||||
<p class="text-center app-font-family font-color-black"><i>No Data Found</i></p>
|
||||
<p class="text-center font-color-black"><i>No Data Found</i></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@ -313,9 +308,9 @@ hr{
|
||||
<textarea class="form-control" id="notes" name="notes" placeholder="Write your notes here..." required maxlength="1500"></textarea>
|
||||
<div class="icon-buttons">
|
||||
<!-- save btn means local - internal -->
|
||||
<button type="button" class="btn-icon" onclick="submitConverstionTicket('Internal')"><i class="mdi mdi-content-save"></i></button>
|
||||
<button type="button" class="btn-icon" onclick="submitConverstionTicket('Internal', this)"><i class="mdi mdi-content-save"></i></button>
|
||||
<!-- mail btn means notify - external -->
|
||||
<button type="button" class="btn-icon" onclick="submitConverstionTicket('External')"><i class="mdi mdi-email"></i></button>
|
||||
<button type="button" class="btn-icon" onclick="submitConverstionTicket('External', this)"><i class="mdi mdi-email"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<small id="messageCounter" class="form-text text-muted text-end app-text-right">0/1500</small>
|
||||
@ -329,7 +324,7 @@ hr{
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade app-text-black app-font-family" id="EditModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal fade app-text-black " id="EditModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<form id="ticketForm">
|
||||
@ -344,7 +339,7 @@ hr{
|
||||
<input type="hidden" id="updated_by" name="updated_by" value="<?= get_session_userid(); ?>">
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="ticket_type" class="sub-title-text app-font-family">Ticket Type<span class="text-danger">*</span></label>
|
||||
<label for="ticket_type" class="sub-title-text ">Ticket Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="ticket_type" name="ticket_type" required>
|
||||
<option value="">Select Ticket Type</option>
|
||||
<!-- <option value="Sales">Sales</option>
|
||||
@ -361,7 +356,7 @@ hr{
|
||||
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="status" class="sub-title-text app-font-family">Status</label>
|
||||
<label for="status" class="sub-title-text ">Status</label>
|
||||
<select class="form-control" id="status" name="status">
|
||||
<option value="">Select Status</option>
|
||||
<option value="Open">Open</option>
|
||||
@ -375,7 +370,7 @@ hr{
|
||||
// 2,3,4 dropdown data'va varannum but dropdown hide pannanum -->
|
||||
<?php if(in_array(get_role_id(), [1,5]) ) { ?>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="assign_to" class="sub-title-text app-font-family">Assign To</label>
|
||||
<label for="assign_to" class="sub-title-text ">Assign To</label>
|
||||
<select class="form-control" id="assign_to" name="assign_to">
|
||||
<option value="">Select Assign To</option>
|
||||
<?php if(isset($assignee)) { ?>
|
||||
@ -391,32 +386,32 @@ hr{
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn app-btn-secondary app-btn-border-radius" onclick="submitTicket()">Save</button>
|
||||
<button type="button" class="btn app-btn-secondary " onclick="submitTicket()">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade app-font-family" id="relatedTicketModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal fade " id="relatedTicketModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content" style="border-radius:15px;">
|
||||
|
||||
<div class="modal-header" style="border-bottom-width:0;">
|
||||
<h4 class="modal-title title-text app-font-family" style="font-size:27px !important">Related Tickets</h4>
|
||||
<h4 class="modal-title title-text " style="font-size:27px !important">Related Tickets</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body card-scroll" style="padding-top:5px!important;">
|
||||
|
||||
<?php if(!empty($related_tickets)): foreach($related_tickets as $j => $rt): ?>
|
||||
<div class="card related-ticket-card app-font-family app-text"
|
||||
<div class="card related-ticket-card app-text"
|
||||
style="cursor: pointer;"
|
||||
onclick="window.open('<?= base_url().'/ticketConversationList?return_type=web&thz_id='.$rt['thz_id']; ?>', '_blank')">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center" style="margin-bottom: 10px !important;">
|
||||
<h5 class="app-font-family app-text"><?php echo '# '.$rt['thz_id']." / ".$rt['ticket_type']; ?></h5>
|
||||
<small classs="app-font-family" style="font-size:7px;">
|
||||
<h5 class=" app-text"><?php echo '# '.$rt['thz_id']." / ".$rt['ticket_type']; ?></h5>
|
||||
<small classs="" style="font-size:7px;">
|
||||
<?php if (!empty($rt['created_at'])):
|
||||
$cd = date("j F Y", strtotime($rt['created_at']));
|
||||
$ct = date("h:i a", strtotime($rt['created_at']));
|
||||
@ -425,11 +420,11 @@ hr{
|
||||
?>
|
||||
</small>
|
||||
</div>
|
||||
<p class="mt-1 app-font-family"
|
||||
<p class="mt-1 "
|
||||
style="font-size:9px; font-weight:400; margin:4px;">
|
||||
<?= $rt['subject'] ? $rt['subject'] : " "; ?>
|
||||
</p>
|
||||
<small class="app-font-family" style="font-size:7px;"><span style="color: green !important; font-weight: 500;">Status: </span><?php echo $rt['status']; ?></small>
|
||||
<small class="" style="font-size:7px;"><span style="color: green !important; font-weight: 500;">Status: </span><?php echo $rt['status']; ?></small>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;
|
||||
@ -445,12 +440,12 @@ hr{
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade app-font-family" id="PolicyModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal fade " id="PolicyModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content" style="border-radius:15px;">
|
||||
|
||||
<div class="modal-header" style="border-bottom-width:0;">
|
||||
<h4 class="modal-title title-text app-font-family">Policy Terms</h4>
|
||||
<h4 class="modal-title title-text ">Policy Terms</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
@ -469,13 +464,13 @@ hr{
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade app-font-family" id="StatusModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal fade " id="StatusModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg" >
|
||||
<!-- style="max-width: 775px !important;"> -->
|
||||
<div class="modal-content" style="border-radius:15px;">
|
||||
|
||||
<div class="modal-header" style="border-bottom-width:0;">
|
||||
<h4 class="modal-title title-text app-font-family">Status History</h4>
|
||||
<h4 class="modal-title title-text ">Status History</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
@ -538,6 +533,17 @@ hr{
|
||||
var form = document.getElementById("ticketForm");
|
||||
var id = form.querySelector("[name='thz_id']").value;
|
||||
var formData = new FormData(form);
|
||||
form.classList.remove('was-validated');
|
||||
var btn = document.querySelector("button[onclick='submitTicket()']");
|
||||
btn.disabled = true;
|
||||
btn.innerText = "Saving...";
|
||||
|
||||
var ticketType = document.getElementById('ticket_type').value.trim();
|
||||
if (ticketType === "") {
|
||||
toastr.warning('Please fill all required fields.', 'Warning');
|
||||
form.classList.add('was-validated');
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "<?= base_url('ticketSave') ?>",
|
||||
@ -559,11 +565,16 @@ hr{
|
||||
error: function(xhr) {
|
||||
toastr.error("Something went wrong!", 'Error');
|
||||
console.error(xhr.responseText);
|
||||
},
|
||||
complete: function() {
|
||||
btn.disabled = false;
|
||||
btn.innerText = "Save";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submitConverstionTicket(notetype) {
|
||||
function submitConverstionTicket(notetype,btn) {
|
||||
btn.disabled = true;
|
||||
|
||||
document.getElementById("notes_type").value = notetype;
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
@ -602,7 +613,8 @@ hr{
|
||||
error: function(xhr) {
|
||||
toastr.error("Something went wrong!", 'Error');
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
},
|
||||
complete: function() { btn.disabled = false;}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@ -620,7 +632,7 @@ function statusHistory(thzId) {
|
||||
if (response.status === "success" && response.data.length > 0) {
|
||||
let table = `
|
||||
<div class="table-responsive">
|
||||
<table data-custom-table-css="table" class="table w-100 nowrap text-custom-black text-custom app-font-family app-datatable">
|
||||
<table data-custom-table-css="table" class="table w-100 nowrap text-custom-black text-custom app-datatable">
|
||||
<thead class="app-table-head">
|
||||
<tr>
|
||||
<th class="app-text app-text-white">S.No</th>
|
||||
@ -669,7 +681,7 @@ function statusHistory(thzId) {
|
||||
} else {
|
||||
container.html(`
|
||||
<div class="d-flex justify-content-center align-items-center" style="height: 50vh; width:100%;">
|
||||
<p class="text-center app-font-family font-color-black"><i>${response.message ?? 'No history found'}</i></p>
|
||||
<p class="text-center font-color-black"><i>${response.message ?? 'No history found'}</i></p>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
@ -679,7 +691,7 @@ function statusHistory(thzId) {
|
||||
error: function(xhr) {
|
||||
$(".history-container").html(`
|
||||
<div class="d-flex justify-content-center align-items-center" style="height: 50vh; width:100%;">
|
||||
<p class="text-center app-font-family font-color-black"><i>No Data Found</i></p>
|
||||
<p class="text-center font-color-black"><i>No Data Found</i></p>
|
||||
</div>
|
||||
`);
|
||||
$("#StatusModal").modal("show");
|
||||
|
||||
@ -28,6 +28,17 @@
|
||||
<div id="msg_388" class="form-group">
|
||||
<p><?= $message['mail_content'] ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
<?php if (isset($message['files_data']) && !empty($message['files_data'])) {
|
||||
foreach ($message['files_data'] as $index => $datas) {
|
||||
$index = $index + 1;
|
||||
?>
|
||||
<p>File <?= $index ?> : <a href="<?= base_url('downloadClaimFile/') . $datas['id'] ?>" target="_blank"><?= $datas['doc_name'] ?></a></p>
|
||||
<?php } } ?>
|
||||
|
||||
</div>
|
||||
<!-- <div class="form-group mt-5">
|
||||
<button class="btn btn-dark btn-sm" type="button" onclick="quoteMessage(388);"><i
|
||||
class="fa fa-quote-left"></i> Quote</button>
|
||||
|
||||
@ -54,6 +54,7 @@
|
||||
<span class="d-none d-sm-inline-block">History</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
|
||||
<li class="nav-item">
|
||||
<a href="#autoQuery-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="auto_query_tab"
|
||||
aria-expanded="false">
|
||||
@ -61,6 +62,7 @@
|
||||
<span class="d-none d-sm-inline-block">Auto Query Content</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="nav-item">
|
||||
<a href="#uploads-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="uploads_tab"
|
||||
aria-expanded="false">
|
||||
@ -68,6 +70,7 @@
|
||||
<span class="d-none d-sm-inline-block">Claim Files</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
|
||||
<li class="nav-item">
|
||||
<a href="#viewpolicyterms-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="viewpolicyterms_tab"
|
||||
aria-expanded="false">
|
||||
@ -75,6 +78,7 @@
|
||||
<span class="d-none d-sm-inline-block">View Policy Terms</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
||||
<!-- Tab Content -->
|
||||
@ -84,9 +88,11 @@
|
||||
|
||||
if ($ticket_data['ticket_type_id'] == 1) {
|
||||
include('ticket_form_gmc.php');
|
||||
} else if($ticket_data['ticket_type_id'] == 8){
|
||||
include('ticket_form_motor.php');
|
||||
} else {
|
||||
include('ticket_form_gpa.php');
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="reply-tab">
|
||||
@ -98,15 +104,19 @@
|
||||
<div class="tab-pane fade" id="history-tab">
|
||||
<?php include('ticket_history.php'); ?>
|
||||
</div>
|
||||
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
|
||||
<div class="tab-pane fade" id="autoQuery-tab">
|
||||
<?php include('ticket_auto_query.php'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="tab-pane fade" id="uploads-tab">
|
||||
<?php include('claim_files_upload.php'); ?>
|
||||
</div>
|
||||
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
|
||||
<div class="tab-pane fade" id="viewpolicyterms-tab">
|
||||
<?php include('view_policy_terms.php'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -146,7 +156,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-primary close" data-dismiss="modal" aria-label="Close">Submit</a>
|
||||
<a class="btn btn-primary" data-dismiss="modal" aria-label="Close">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -46,6 +46,8 @@
|
||||
if (!isset($view_ticket_page)) {
|
||||
if ($selected_ticket_type == 1) {
|
||||
include('ticket_form_gmc.php');
|
||||
} else if ($selected_ticket_type == 8) {
|
||||
include('ticket_form_motor.php');
|
||||
} else {
|
||||
include('ticket_form_gpa.php');
|
||||
}
|
||||
@ -193,7 +195,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-primary close" data-dismiss="modal" aria-label="Close"
|
||||
<a class="btn btn-primary" data-dismiss="modal" aria-label="Close"
|
||||
onclick="toResetTheModelFields()">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -601,8 +603,11 @@
|
||||
param = $(input).val();
|
||||
client_id = $('#emp_client_data_list').val()
|
||||
}
|
||||
let url = '<?= base_url('util/getTheEmpDataForClaimSearchByMobile/') ?>' + param + '/' + type + '/' +
|
||||
client_policy_id + '/' + client_id + '/'+ selected_ticket_type_id;
|
||||
|
||||
// let url = '<?= base_url('util/getTheEmpDataForClaimSearchByMobile/') ?>' + param + '/' + type + '/' +
|
||||
// client_policy_id + '/' + client_id + '/'+ selected_ticket_type_id;
|
||||
|
||||
let url = '<?= base_url('util/getTheEmpDataForClaimSearchByMobile') ?>';
|
||||
|
||||
// Data to send in the AJAX request
|
||||
let requestData = {
|
||||
|
||||
1191
app/Views/ticket_form_motor.php
Normal file
1191
app/Views/ticket_form_motor.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -14,6 +14,7 @@
|
||||
<option value="2">Claim-GPA</option>
|
||||
<option value="3">EDLI</option>
|
||||
<option value="4">GTLI</option>
|
||||
<option value="8">Motor</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,7 +1,65 @@
|
||||
<style>
|
||||
.image-preview {
|
||||
|
||||
border: 1px solid #00999E;
|
||||
border-radius: 12px;
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
/* margin-right: 15px; */
|
||||
}
|
||||
|
||||
.image-preview img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.upload-btn {
|
||||
background-color: #00999E;
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 25px;
|
||||
padding: 6px 20px;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* .delete-btn {
|
||||
background-color: #e5f7f6;
|
||||
color: #00999E;
|
||||
border: none;
|
||||
border-radius: 25px;
|
||||
padding: 6px 20px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
} */
|
||||
|
||||
.helper-text {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
margin-top: 8px;
|
||||
|
||||
/* wrapping fixes */
|
||||
word-wrap: break-word; /* old browsers */
|
||||
overflow-wrap: break-word; /* modern browsers */
|
||||
white-space: normal; /* allow wrapping */
|
||||
max-width: 285px; /* adjust to your design width */
|
||||
}
|
||||
|
||||
.hidden-input {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="tab-pane fade active show" id="general-q-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<div class="card-body subcard">
|
||||
<div class="custom-form">
|
||||
<form role="form" class="parsley-examples" method="post" id="tpa_general_form" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="tpa_General_PrimaryKey" value="<?= isset($tpa['id']) ? $tpa['id'] : '' ?>" />
|
||||
@ -22,7 +80,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<br>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
@ -37,7 +95,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<!-- <div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="tpa_logo">TPA Logo<span class="text-danger"></span></label>
|
||||
<input type="file" class="form-control" onchange="PreviewImage();" id="tpa_logo" name="tpa_logo" accept="image/jpeg, image/jpg, image/png">
|
||||
@ -50,9 +108,9 @@
|
||||
<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">
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-row">
|
||||
<!-- <div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="tpa_logo_preview">TPA Logo Preview<span class="text-danger"></span></label>
|
||||
<img src="<?= isset($tpa['tpa_logo']) && !empty($tpa['tpa_logo']) ? base_url() . "public/uploads/logo/" . $tpa['tpa_logo'] : base_url() . "public/assets/images/avatar_2x.png" ?>" width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar" />
|
||||
@ -65,15 +123,118 @@
|
||||
<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" />
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-row">
|
||||
<!-- TPA Logo -->
|
||||
<div class="form-group col-md-4">
|
||||
<label for="tpa_logo">TPA Logo</label>
|
||||
<div class="row align-items-center">
|
||||
<!-- Left column: Image -->
|
||||
<div class="col-auto">
|
||||
<div class="image-preview">
|
||||
<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" ?>"
|
||||
id="uploadPreview0"
|
||||
class="avatar img-circle img-thumbnail"
|
||||
alt="TPA Logo" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right column: Buttons + text -->
|
||||
<div class="col">
|
||||
<div class="d-flex">
|
||||
<button type="button" class="upload-btn" onclick="document.getElementById('tpa_logo').click();">Upload</button>
|
||||
<!-- <button type="button" class="delete-btn" onclick="removeImage0();">Delete</button> -->
|
||||
</div>
|
||||
<div class="helper-text" id="fileNameText0">
|
||||
<?= isset($tpa['tpa_logo']) && !empty($tpa['tpa_logo']) ? $tpa['tpa_logo'] : '( Upload Your TPA Logo )' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hidden File Input -->
|
||||
<input type="file" class="hidden-input"
|
||||
id="tpa_logo" name="tpa_logo"
|
||||
accept="image/jpeg, image/jpg, image/png"
|
||||
onchange="PreviewImage0(event);" />
|
||||
</div>
|
||||
<!-- TPA Logo Ends -->
|
||||
<!-- Front Image -->
|
||||
<div class="form-group col-md-4">
|
||||
<label for="tpa_logo">Front card Image</label>
|
||||
<div class="row align-items-center">
|
||||
<!-- Left column: Image -->
|
||||
<div class="col-auto">
|
||||
<div class="image-preview">
|
||||
<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" ?>"
|
||||
id="uploadPreview1"
|
||||
class="avatar img-circle img-thumbnail"
|
||||
alt="avatar" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right column: Buttons + text -->
|
||||
<div class="col">
|
||||
<div class="d-flex">
|
||||
<button type="button" class="upload-btn" onclick="document.getElementById('fc').click();">Upload</button>
|
||||
<!-- <button type="button" class="delete-btn" onclick="removeImage1();">Delete</button> -->
|
||||
</div>
|
||||
<div class="helper-text" id="fileNameText1">
|
||||
<?= isset($tpa['front_card']) && !empty($tpa['front_card']) ? $tpa['front_card'] : '( Upload Your Front card Image )' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hidden File Input -->
|
||||
<input type="file" class="hidden-input"
|
||||
id="fc" name="fc"
|
||||
accept="image/jpeg, image/jpg, image/png"
|
||||
onchange="PreviewImage1(event);" />
|
||||
</div>
|
||||
<!-- Front Image Ends -->
|
||||
<!-- Back Image -->
|
||||
<div class="form-group col-md-4">
|
||||
<label for="tpa_logo">Back card Image</label>
|
||||
<div class="row align-items-center">
|
||||
<!-- Left column: Image -->
|
||||
<div class="col-auto">
|
||||
<div class="image-preview">
|
||||
<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" ?>"
|
||||
id="uploadPreview4"
|
||||
class="avatar img-circle img-thumbnail"
|
||||
alt="avatar" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right column: Buttons + text -->
|
||||
<div class="col">
|
||||
<div class="d-flex">
|
||||
<button type="button" class="upload-btn" onclick="document.getElementById('bc').click();">Upload</button>
|
||||
<!-- <button type="button" class="delete-btn" onclick="removeImage4();">Delete</button> -->
|
||||
</div>
|
||||
<div class="helper-text" id="fileNameText4">
|
||||
<?= isset($tpa['back_card']) && !empty($tpa['back_card']) ? $tpa['back_card'] : '( Upload Your Back card Image )' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hidden File Input -->
|
||||
<input type="file" class="hidden-input"
|
||||
id="bc" name="bc"
|
||||
accept="image/jpeg, image/jpg, image/png"
|
||||
onchange="PreviewImage4(event);" />
|
||||
</div>
|
||||
<!-- Back Image Ends -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||
<button type="submit" class="btn app-btn-secondary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack" id="btnBack">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
@ -213,7 +374,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
function PreviewImage2() {
|
||||
var oFReader = new FileReader();
|
||||
oFReader.readAsDataURL(document.getElementById("fc").files[0]);
|
||||
@ -232,6 +392,75 @@
|
||||
};
|
||||
};
|
||||
|
||||
function PreviewImage0(event) {
|
||||
const input = event.target;
|
||||
const file = input.files[0];
|
||||
if (file) {
|
||||
// Show preview
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
document.getElementById('uploadPreview0').src = e.target.result;
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
// Show file name
|
||||
document.getElementById('fileNameText0').innerText = file.name;
|
||||
}
|
||||
}
|
||||
|
||||
function removeImage0() {
|
||||
// Reset preview to default
|
||||
document.getElementById('uploadPreview0').src = "<?= base_url() . 'public/assets/images/avatar_2x.png' ?>";
|
||||
document.getElementById('fileNameText0').innerText = '( Upload Your TPA Logo )';
|
||||
document.getElementById('tpa_logo').value = ""; // clear file input
|
||||
}
|
||||
|
||||
function PreviewImage1(event) {
|
||||
const input = event.target;
|
||||
const file = input.files[0];
|
||||
if (file) {
|
||||
// Show preview
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
document.getElementById('uploadPreview1').src = e.target.result;
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
// Show file name
|
||||
document.getElementById('fileNameText1').innerText = file.name;
|
||||
}
|
||||
}
|
||||
|
||||
function removeImage1() {
|
||||
// Reset preview to default
|
||||
document.getElementById('uploadPreview1').src = "<?= base_url() . 'public/assets/images/avatar_2x.png' ?>";
|
||||
document.getElementById('fileNameText1').innerText = '( Upload Your Front card Image )';
|
||||
document.getElementById('fc').value = ""; // clear file input
|
||||
}
|
||||
|
||||
function PreviewImage4(event) {
|
||||
const input = event.target;
|
||||
const file = input.files[0];
|
||||
if (file) {
|
||||
// Show preview
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
document.getElementById('uploadPreview4').src = e.target.result;
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
|
||||
// Show file name
|
||||
document.getElementById('fileNameText4').innerText = file.name;
|
||||
}
|
||||
}
|
||||
|
||||
function removeImage4() {
|
||||
// Reset preview to default
|
||||
document.getElementById('uploadPreview4').src = "<?= base_url() . 'public/assets/images/avatar_2x.png' ?>";
|
||||
document.getElementById('fileNameText4').innerText = '( Upload Your Back card Image )';
|
||||
document.getElementById('bc').value = ""; // clear file input
|
||||
}
|
||||
|
||||
$('#preview').click(function() {
|
||||
var ecardContent = $('#ecard_content').val();
|
||||
$('#Preview_data').html(ecardContent);
|
||||
|
||||
@ -1,13 +1,45 @@
|
||||
<style>
|
||||
.modal-subtitle {
|
||||
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-size: 18px;
|
||||
line-height: 100%;
|
||||
letter-spacing: 0%;
|
||||
text-align: center;
|
||||
margin-top: 5px;
|
||||
color: #6c757d;
|
||||
}
|
||||
</style>
|
||||
<!-- Optional CSS -->
|
||||
<style>
|
||||
/* Make modal really XL and scrollable */
|
||||
#tpaBranchModal .modal-dialog.modal-xl {
|
||||
max-width: 90%;
|
||||
height: 90vh;
|
||||
}
|
||||
|
||||
#tpaBranchModal .modal-content {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#tpaBranchModal .modal-body {
|
||||
overflow-y: auto;
|
||||
max-height: 80vh;
|
||||
}
|
||||
</style>
|
||||
<div class="tab-pane fade" id="branch-tab">
|
||||
|
||||
<div class="row float-right" style="padding-bottom: 10px;position: relative;right: 13px;">
|
||||
<button type="button" id="btnBranchAdd" class="btn btn-primary waves-effect waves-light btn-sm"><span class="mdi mdi-plus-box-outline" aria-hidden="true" style="padding: 5px 10px;"></span>Add Branch</button>
|
||||
<div class="row float-right" style="padding-bottom: 10px;position: relative;">
|
||||
<a href="#" id="btnBranchAdd" class="btn app-btn-primary mr-2"><span class="mdi mdi-plus" aria-hidden="true" style="padding: 5px 10px;"></span>Add Branch</a>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive" id="branch_table" >
|
||||
|
||||
<table data-custom-table-css="table" class="table table-borderless table-nowrap mb-0">
|
||||
<thead class="thead-light">
|
||||
<table data-custom-table-css="table" class="table table-borderless table-nowrap mb-0" id="tpa-branch-datatable">
|
||||
<thead class="">
|
||||
|
||||
<tr>
|
||||
<th>Branch Name</th>
|
||||
<th>Branch Code</th>
|
||||
@ -19,7 +51,7 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="row" id="add_branch">
|
||||
<!-- <div class="row" id="add_branch">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<div class="row float-right" style="position: relative; bottom: 20px; right: 13px;">
|
||||
@ -130,9 +162,154 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end col-->
|
||||
</div> !-- end col-- -->
|
||||
</div>
|
||||
<!-- end -->
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="tpaBranchModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-xl" style="max-width: 1140px !important;">
|
||||
<div class="modal-content">
|
||||
<!-- Modal Header -->
|
||||
<div class="modal-header flex-column">
|
||||
<div class="d-flex w-100 justify-content-between align-items-center">
|
||||
<h4 class="modal-title mb-0" id="modalLabel">New Branch</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Body -->
|
||||
<div class="modal-body" style="overflow-y:auto; max-height:80vh;">
|
||||
<form id="tpa_branch_form" role="form" class="parsley-examples" method="post" action="" enctype="multipart/form-data">
|
||||
<div class="row">
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="tpa_Branch_PrimaryKey" />
|
||||
<input type="hidden" name="tpa_id" id="tpa_id_branch" value="<?= isset($tpa['id']) ? $tpa['id'] : '' ?>"/>
|
||||
<!-- Left Section: Branch Details -->
|
||||
<div class="col-md-8 d-flex flex-column" style="max-height: calc(80vh - 50px);">
|
||||
<!-- Branch Name & Code -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_name">Branch Name <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_name"
|
||||
placeholder="Enter Branch Name" name="branch_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_code">Branch Code <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_code"
|
||||
placeholder="Enter Branch Code" name="branch_code" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Address Lines -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address1">Address Line 1 <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="address1" name="address1" placeholder="Enter Address 1" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="address2">Address Line 2</label>
|
||||
<input type="text" class="form-control" id="address2" placeholder="Enter Address 2" name="address2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- State & District -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="state">State <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="state" name="state" required>
|
||||
<option value="">Select State</option>
|
||||
<?php if ($state) {
|
||||
foreach($state as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
|
||||
<?php } }?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="district">District <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="district"
|
||||
placeholder="Enter District" name="district" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- City & Pincode -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="branch_city">City <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="branch_city"
|
||||
placeholder="Enter City" name="city" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="pincode">Pincode <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Submit / Cancel -->
|
||||
<div class="form-row">
|
||||
<!-- <div class="form-group col-md-12 mt-2"> -->
|
||||
<div style="margin-top: 85px;">
|
||||
<button type="submit" class="btn app-btn-secondary mr-2" id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn app-btn-outline-secondary btnBack" id="btnBack" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Section: Contact Details -->
|
||||
<div class="col-md-4" style="background:#f8f9fa; max-height: calc(80vh - 50px); overflow-y:auto; border-radius:8px; padding:10px;">
|
||||
<!-- First Contact -->
|
||||
<div id="contact_1_wrapper" class="bg-white p-2 mb-2 rounded contact-block">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<h6 class="modal-subtitle mb-0">Contact 1</h6>
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="mdi mdi-trash-can text-danger" style="cursor:pointer; font-size:24px !important;" onclick="removeContact(this)" id="contact_1_remove"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Contact Form Fields -->
|
||||
<!-- <input type="hidden" name="primarykey[]" id="contact_id_1" value=""/> -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="name">Name <span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="designation">Designation <span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="email">Email <span class="text-danger">*</span></label>
|
||||
<input value="" data-parsley-type="email" type="email" data-parsley-trigger="change" data-parsley-type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="mobile">Mobile <span class="text-danger">*</span></label>
|
||||
<input value="" data-parsley-type="digits" data-parsley-length="[10,10]" data-parsley-trigger="change" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="mobile" required maxlength="10" inputmode="numeric">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Container for dynamically added contacts -->
|
||||
<div id="container"></div>
|
||||
|
||||
<div>
|
||||
<button type="button" class="btn btn-primary btn-sm ac me-3" style="width: 100%;" onclick="appendContactHtml()" id="add"><i class="mdi mdi-plus"></i> Add Contact</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
@ -140,23 +317,29 @@ var contactCount = 1;
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#tpa-branch-datatable').DataTable({
|
||||
paging: true ,
|
||||
searching: true
|
||||
});
|
||||
|
||||
var tpa_Branch_PrimaryKey = $('#tpa_id_branch').val();
|
||||
var tpa_branch_form_action = '';
|
||||
|
||||
$('#add_branch').hide();
|
||||
$('.btnBack').hide();
|
||||
|
||||
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
|
||||
myModal.hide();
|
||||
// $('#add_branch').hide();
|
||||
// $('.btnBack').hide();
|
||||
|
||||
loadBranchList();
|
||||
|
||||
$('#btnBranchAdd').click(function(){
|
||||
|
||||
tpa_branch_form_action = '<?= base_url("master/tpa/branch/create"); ?>';
|
||||
|
||||
$('#add_branch').show();
|
||||
$('#branch_table').hide();
|
||||
$('.btnBack').show();
|
||||
$('#btnBranchAdd').hide();
|
||||
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
|
||||
myModal.show();
|
||||
// $('#add_branch').show();
|
||||
// $('#branch_table').hide();
|
||||
// $('.btnBack').show();
|
||||
// $('#btnBranchAdd').hide();
|
||||
|
||||
$('#branch_name').val('');
|
||||
$('#branch_code').val('');
|
||||
@ -196,10 +379,12 @@ $(document).ready(function () {
|
||||
|
||||
$('.btnBack').click(function(){
|
||||
|
||||
$('#add_branch').hide();
|
||||
$('#branch_table').show();
|
||||
$('.btnBack').hide();
|
||||
$('#btnBranchAdd').show();
|
||||
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
|
||||
myModal.hide();
|
||||
// $('#add_branch').hide();
|
||||
// $('#branch_table').show();
|
||||
// $('.btnBack').hide();
|
||||
// $('#btnBranchAdd').show();
|
||||
|
||||
$('#branch_name').val('');
|
||||
$('#branch_code').val('');
|
||||
@ -211,6 +396,7 @@ $(document).ready(function () {
|
||||
$('#email').val('');
|
||||
$('#mobile').val('');
|
||||
$('#designation').val('');
|
||||
$('#container').empty(); $('#contact_1_wrapper input').val('');
|
||||
|
||||
|
||||
})
|
||||
@ -257,24 +443,34 @@ $(document).ready(function () {
|
||||
console.log(res);
|
||||
$('#tpa_branch_list tr').remove();
|
||||
var tpaBranchTableInsert = ''
|
||||
$.each(res.data, function(index, item) {
|
||||
if (data.length === 0) {
|
||||
tpaBranchTableInsert += `
|
||||
<tr>
|
||||
<td>${item.branch_name}</td>
|
||||
<td>${item.branch_code}</td>
|
||||
<td>
|
||||
<a class="mdi mdi-lead-pencil btnBranchEdit" href="#" data-id="${item.id}" style="font-size:18px;"></a>
|
||||
<a style="color:#02a8b5" data-id="${item.id}" onclick="removeTPABranch(this)"><i data-id="${item.id}" class="mdi mdi-delete" style="font-size:18px;"></i></a>
|
||||
</td>
|
||||
|
||||
<td colspan="3" class="text-center app-text-black">No data available in table</td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
`;
|
||||
} else {
|
||||
$.each(res.data, function(index, item) {
|
||||
tpaBranchTableInsert += `
|
||||
<tr>
|
||||
<td>${item.branch_name}</td>
|
||||
<td>${item.branch_code}</td>
|
||||
<td>
|
||||
<a class="mdi mdi-lead-pencil btnBranchEdit" href="#" data-id="${item.id}" style="font-size:18px;"></a>
|
||||
<a style="color:#02a8b5" data-id="${item.id}" onclick="removeTPABranch(this)"><i data-id="${item.id}" class="mdi mdi-delete" style="font-size:18px;"></i></a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
}
|
||||
$('#tpa_branch_list').append(tpaBranchTableInsert);
|
||||
$('#add_branch').hide();
|
||||
$('#branch_table').show();
|
||||
$('.btnBack').hide();
|
||||
$('#btnBranchAdd').show();
|
||||
$('#container').empty(); $('#contact_1_wrapper input').val('');
|
||||
$('.close').click();
|
||||
// $('#add_branch').hide();
|
||||
// $('#branch_table').show();
|
||||
// $('.btnBack').hide();
|
||||
// $('#btnBranchAdd').show();
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
@ -284,6 +480,13 @@ $(document).ready(function () {
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
},
|
||||
complete: function() {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
$('.close').click();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -307,10 +510,12 @@ $(document).ready(function () {
|
||||
}, 1000);
|
||||
console.log("tpa.............");
|
||||
console.log(res)
|
||||
$('#add_branch').show();
|
||||
$('#branch_table').hide();
|
||||
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
|
||||
myModal.show();
|
||||
// $('#add_branch').show();
|
||||
// $('#branch_table').hide();
|
||||
$('.btnBack').show();
|
||||
$('#btnBranchAdd').hide();
|
||||
// $('#btnBranchAdd').hide();
|
||||
$('#branch_name').val(res.tpabranch.branch_name);
|
||||
$('#branch_code').val(res.tpabranch.branch_code);
|
||||
$('#state option[value="' + res.tpabranch.state + '"]').prop('selected', true);
|
||||
@ -367,18 +572,26 @@ $(document).ready(function () {
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
var branchTable = '';
|
||||
$.each(response.tpa_branch, function(index, item) {
|
||||
if (data.length === 0) {
|
||||
branchTable += `
|
||||
<tr>
|
||||
<td>${item.branch_name}</td>
|
||||
<td>${item.branch_code}</td>
|
||||
<td>
|
||||
<a class="mdi mdi-lead-pencil btnBranchEdit" href="#" data-id="${item.id}" style="font-size:18px;"></a>
|
||||
<a style="color:#02a8b5" data-id="${item.id}" onclick="removeTPABranch(this)"><i data-id="${item.id}" class="mdi mdi-delete" style="font-size:18px;"></i></a>
|
||||
</td>
|
||||
<td colspan="3" class="text-center app-text-black ">No data available in table</td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
`;
|
||||
} else {
|
||||
$.each(response.tpa_branch, function(index, item) {
|
||||
branchTable += `
|
||||
<tr>
|
||||
<td>${item.branch_name}</td>
|
||||
<td>${item.branch_code}</td>
|
||||
<td>
|
||||
<a class="mdi mdi-lead-pencil btnBranchEdit" href="#" data-id="${item.id}" style="font-size:18px;"></a>
|
||||
<a style="color:#02a8b5" data-id="${item.id}" onclick="removeTPABranch(this)"><i data-id="${item.id}" class="mdi mdi-delete" style="font-size:18px;"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
}
|
||||
$('#tpa_branch_list').html(branchTable);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
@ -399,75 +612,174 @@ $(document).ready(function () {
|
||||
|
||||
|
||||
|
||||
function appendContactHtml(contact = false, reset = false) {
|
||||
// function appendContactHtml(contact = false, reset = false) {
|
||||
|
||||
console.log('appendContactHtml function called ')
|
||||
contactCount++;
|
||||
// console.log('appendContactHtml function called ')
|
||||
// contactCount++;
|
||||
|
||||
// var container = document.getElementById('container');
|
||||
// var uniqueId = Date.now().toString();
|
||||
|
||||
// var html = `
|
||||
// <div id="${uniqueId}">
|
||||
// <hr>
|
||||
// <h6 class="header-title">Contact ${contactCount}</h6>
|
||||
// <br>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label>
|
||||
// <input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label>
|
||||
// <input value="${contact !== undefined && contact !== false ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="${uniqueId}_designation" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
// <input data-parsley-type="email" value="${contact !== undefined && contact !== false ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-row">
|
||||
// <div class="form-group col-md-12">
|
||||
// <label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
// <input value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" required>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="form-group" style="display: flex;">
|
||||
// <button type="button" class="btn btn-danger btn-sm" onclick="removeContact(this)" id="${uniqueId}_remove">Remove</button>
|
||||
// </div>
|
||||
// </div>
|
||||
// `;
|
||||
|
||||
// if(reset == false){
|
||||
// console.log(reset)
|
||||
// container.insertAdjacentHTML('beforeend', html);
|
||||
// storeButtonId(uniqueId + '_add');
|
||||
|
||||
// if (contactCount >= 3) {
|
||||
// hideStoredAddButtons();
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
function renumberContacts() {
|
||||
var contacts = document.querySelectorAll('.contact-block');
|
||||
|
||||
contacts.forEach(function(contact, index) {
|
||||
let title = contact.querySelector('.modal-subtitle');
|
||||
if (title) {
|
||||
title.textContent = "Contact " + (index + 1); // auto numbering
|
||||
}
|
||||
});
|
||||
|
||||
contactCount = contacts.length; // keep global in sync
|
||||
}
|
||||
|
||||
|
||||
function appendContactHtml(contact = false, reset = false) {
|
||||
console.log('appendContactHtml function called ');
|
||||
|
||||
var container = document.getElementById('container');
|
||||
var uniqueId = Date.now().toString();
|
||||
|
||||
// <input type="hidden" name="primarykey[]" value="${contact ? contact.id : ''}"/>
|
||||
var html = `
|
||||
<div id="${uniqueId}">
|
||||
<hr>
|
||||
<h6 class="header-title">Contact ${contactCount}</h6>
|
||||
<br>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_first_name">Name<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="${uniqueId}_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_designation">Designation<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="${uniqueId}_designation" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
<input data-parsley-type="email" value="${contact !== undefined && contact !== false ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display: flex;">
|
||||
<button style="margin-right: 10px;" type="button" class="btn btn-primary btn-sm ac" onclick="appendContactHtml()" id="${uniqueId}_add">Add Contact</button>
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="removeContact(this)" id="${uniqueId}_remove">Remove</button>
|
||||
<div id="${uniqueId}" class="bg-white p-2 mb-2 rounded contact-block">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<h6 class="modal-subtitle mb-0"></h6>
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="mdi mdi-trash-can text-danger" style="cursor:pointer; font-size:24px !important;" onclick="removeContact(this)" id="${uniqueId}_remove"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label>Name<span class="text-danger">*</span></label>
|
||||
<input value="${contact ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label>Designation<span class="text-danger">*</span></label>
|
||||
<input value="${contact ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label>Email<span class="text-danger">*</span></label>
|
||||
<input value="${contact ? contact.email : ''}" data-parsley-type="email" type="email" data-parsley-trigger="change" data-parsley-type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label>Mobile<span class="text-danger">*</span></label>
|
||||
<input value="${contact ? contact.mobile : ''}" data-parsley-type="digits" data-parsley-length="[10,10]" data-parsley-trigger="change" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" required maxlength="10" inputmode="numeric">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
if(reset == false){
|
||||
console.log(reset)
|
||||
if(!reset){
|
||||
container.insertAdjacentHTML('beforeend', html);
|
||||
storeButtonId(uniqueId + '_add');
|
||||
|
||||
if (contactCount >= 3) {
|
||||
hideStoredAddButtons();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function removeContact(button) {
|
||||
var uniqueId = button.id.split("_")[0];
|
||||
var contactSection = document.getElementById(uniqueId);
|
||||
|
||||
if (contactSection) {
|
||||
contactSection.parentNode.removeChild(contactSection);
|
||||
contactCount --;
|
||||
|
||||
if (contactCount < 3) {
|
||||
var addButton = document.querySelector('.ac');
|
||||
if (addButton) {
|
||||
addButton.style.display = 'block';
|
||||
}
|
||||
}
|
||||
renumberContacts(); // ✅ fix numbering
|
||||
toggleAddButton();
|
||||
}
|
||||
}
|
||||
|
||||
function removeContact(btn){
|
||||
var $block = $(btn).closest('.contact-block');
|
||||
var isFirst = $block.attr('id') === 'contact_1_wrapper';
|
||||
|
||||
if (isFirst) {
|
||||
var $next = $('#container .contact-block').first();
|
||||
if ($next.length){
|
||||
$block.replaceWith($next);
|
||||
$next.attr('id','contact_1_wrapper');
|
||||
$next.find('.modal-subtitle').text('Contact 1');
|
||||
} else {
|
||||
$block.find('input').val('');
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
$block.remove();
|
||||
}
|
||||
|
||||
renumberContacts();
|
||||
toggleAddButton();
|
||||
}
|
||||
|
||||
function toggleAddButton() {
|
||||
var totalContacts = document.querySelectorAll('.contact-block, #contact_1_wrapper').length;
|
||||
var addButton = document.querySelector('.ac');
|
||||
|
||||
if (totalContacts >= 3) {
|
||||
addButton.style.display = 'none';
|
||||
} else {
|
||||
addButton.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
// function removeContact(button) {
|
||||
// var uniqueId = button.id.split("_")[0];
|
||||
// var contactSection = document.getElementById(uniqueId);
|
||||
|
||||
// if (contactSection) {
|
||||
// contactSection.parentNode.removeChild(contactSection);
|
||||
// contactCount --;
|
||||
|
||||
// if (contactCount < 3) {
|
||||
// var addButton = document.querySelector('.ac');
|
||||
// if (addButton) {
|
||||
// addButton.style.display = 'block';
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
function storeButtonId(id) {
|
||||
|
||||
var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || [];
|
||||
|
||||
@ -43,10 +43,10 @@
|
||||
<div class="row" id="tpa_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-body maincard">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">TPA List</h4>
|
||||
<h4 style="position: relative;">TPA</h4>
|
||||
</div>
|
||||
</div>
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
|
||||
@ -35,17 +35,24 @@ body {
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 class="d-flex align-items-center" style="gap: 8px;">
|
||||
<span onclick="history.back()" style="cursor: pointer;">
|
||||
<i class="mdi mdi-chevron-left" style="font-size: 43px;"></i>
|
||||
</span>
|
||||
<span class="title-text ">TPA</span>
|
||||
</h4>
|
||||
|
||||
<!-- <div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">TPA</h4>
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right;">
|
||||
<a href="<?= base_url("master/tpa/list"); ?>"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i> </a>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-2 active">
|
||||
class="nav-link px-3 py-2 active-tab active">
|
||||
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
|
||||
<span class="d-none d-sm-inline-block">General</span>
|
||||
</a>
|
||||
@ -76,9 +83,9 @@ body {
|
||||
$('#btnBranchAdd').hide();
|
||||
toastr.warning('First Add the TPA!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||
// if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||
$('#btnBranchAdd').show();
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -65,10 +65,10 @@ table.dataTable tbody td {
|
||||
<div class="row" id="client_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-body maincard">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Vehicle Master List</h4>
|
||||
<h4 style="position: relative;">Vehicle Master</h4>
|
||||
</div>
|
||||
</div>
|
||||
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
@ -125,7 +125,7 @@ table.dataTable tbody td {
|
||||
|
||||
<div class="modal fade" id="vehicle_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myCenterModalLabel">Add New Vehicle</h4>
|
||||
@ -218,7 +218,8 @@ table.dataTable tbody td {
|
||||
|
||||
</div>
|
||||
<div class="form-group text-right m-b-0" id="hide_smbt_btn">
|
||||
<button type="submit" id="btnSubmit" class="btn btn-primary">Submit</button>
|
||||
<button class="btn app-btn-outline-secondary mr-2 colse" type="button" id="close_btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<button type="submit" id="btnSubmit" class="btn app-btn-secondary waves-effect waves-light" id="cd_master_btn_Submit">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -1,62 +1,59 @@
|
||||
|
||||
<style>
|
||||
.metrics{
|
||||
border:1px solid lightgrey;border-radius:10px;box-shadow: 0px 4px 4px 0px #00000040;
|
||||
min-width: none;
|
||||
max-width: 350px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="text-center">
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
<i class="font-24"></i>
|
||||
<h4>CD Account No : <?php echo isset($insurerName->cd_master_account_no) && !empty($insurerName->cd_master_account_no) ? $insurerName->cd_master_account_no : 'N/A' ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<a href="<?= base_url("client/deposit/$clientData->id"); ?>" style="color:black; font-size: 40px; margin-right: 10px;">
|
||||
<i class="mdi mdi-chevron-left"></i>
|
||||
</a>
|
||||
<h3 style="margin: 0;">Transaction Details - <?php echo $insurerName->name; ?></h3>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<div class="row">
|
||||
<br>
|
||||
|
||||
<div class="col-md-6 col-xl-5">
|
||||
<div class="py-1">
|
||||
<i class="font-24"></i>
|
||||
<h4>Deposit Summary Of <?php echo $clientData->short_name?></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 col-xl-5">
|
||||
<div class="py-1">
|
||||
<i class=" font-24"></i>
|
||||
<h4><?php echo $insurerName->name; ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div><h4>CD Account No : <?php echo isset($insurerName->cd_master_account_no) && !empty($insurerName->cd_master_account_no) ? $insurerName->cd_master_account_no : 'N/A' ?></h4></div>
|
||||
<div> <h4>Deposit Summary Of <?php echo $clientData->short_name?></h4></div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="row text-center">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row mt-3 text-center">
|
||||
|
||||
<div class="col-3">
|
||||
<p class="text-muted font-15 mb-1 text-truncate">Deposits</p>
|
||||
<h4 style="font-size: 26px;"><i
|
||||
class="fe-arrow-up text-success mr-1"></i>₹<?php echo $deposiamount->total_credit?>
|
||||
<div class="col-3 d-flex justify-content-between align-items-center metrics mr-2 mt-2">
|
||||
<span class="text-muted font-15 mb-1 text-truncate">Deposits</span>
|
||||
<h4 style="font-size: 18px;display:inline;"><i
|
||||
class="fe-arrow-up text-success mr-1" ></i>₹<?php echo $deposiamount->total_credit?>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<p class="text-muted font-15 mb-1 text-truncate">Consumed</p>
|
||||
<h4 style="font-size: 26px;"><i
|
||||
<div class="col-3 d-flex justify-content-between align-items-center metrics mr-2 mt-2">
|
||||
<span class="text-muted font-15 mb-1 text-truncate">Consumed</span>
|
||||
<h4 style="font-size: 20px;display:inline;"><i
|
||||
class="fe-arrow-down text-danger mr-1"></i>₹<?php echo $deposiamount->total_withdraw?>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<p class="text-muted font-15 mb-1 text-truncate">Refund</p>
|
||||
<h4 style="font-size: 26px;"><i
|
||||
<div class="col-3 d-flex justify-content-between align-items-center metrics mr-2 mt-2">
|
||||
<span class="text-muted font-15 mb-1 text-truncate">Refund</span>
|
||||
<h4 style="font-size: 20px;display:inline;"><i
|
||||
class="fe-arrow-up text-success mr-1"></i>₹<?php echo $deposiamount->total_refund?>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<p class="text-muted font-15 mb-1 text-truncate">Current Balance</p>
|
||||
<h4 style="font-size: 26px;"><i
|
||||
<div class="col-3 d-flex justify-content-between align-items-center metrics mr-2 mt-2">
|
||||
<span class="text-muted font-15 mb-1 text-truncate">Current Balance</span>
|
||||
<h4 style="font-size: 20px;display:inline;"><i
|
||||
class="fe-credit-card text-sucess mr-1"></i>₹<?php echo $deposiamount->balance?>
|
||||
</h4>
|
||||
</div>
|
||||
@ -68,39 +65,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- start page title -->
|
||||
<!-- <div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title"></h4>
|
||||
<div class="page-title-right">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- end page title -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row" id="List-page">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12" style="text-align: right;">
|
||||
<a href="<?= base_url("client/deposit/$clientData->id"); ?>"><i class="mdi mdi-arrow-left"
|
||||
style="font-size: 17px;"></i></a>
|
||||
<!-- <div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="text-align: right; position: relative;top: 56px; z-index:999">
|
||||
<button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="modal" data-target="#addTransactionModal"> + Add</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Transaction Details</h4>
|
||||
</div>
|
||||
|
||||
<div class="col-6" style="text-align: right; position: relative;top: 56px;">
|
||||
<button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light"
|
||||
data-toggle="modal" data-target="#addTransactionModal">New</button>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
@ -172,46 +150,48 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<h3>Transaction Mode</h3>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="transactionMode" class="control-label">Transaction Mode</label>
|
||||
<div class="form-check">
|
||||
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="radio" name="transactionMode" id="addMode"value="1" checked>
|
||||
<label class="form-check-label" for="addMode">Replenishment by Client</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="radio" name="transactionMode" id="refund_by_insurer"value="6">
|
||||
<label class="form-check-label" for="addMode">Refund by Insurer</label>
|
||||
</div>
|
||||
<!-- <div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="transactionMode" id="adjustmentModeadd"value="2">
|
||||
<label class="form-check-label" for="adjustmentMode">Adjustment Add</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="transactionMode" id="adjustmentModereduce"value="3">
|
||||
<label class="form-check-label" for="adjustmentMode">Adjustment Reduce</label>
|
||||
</div> -->
|
||||
<div class="form-check">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="radio" name="transactionMode" id="assetpolicyadd"value="4">
|
||||
<label class="form-check-label" for="adjustmentMode">Non EB Credit</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="radio" name="transactionMode" id="assetpolicyreduce"value="5">
|
||||
<label class="form-check-label" for="adjustmentMode">No EB Debit</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="field-1" class="control-label">Amount<span class="text-danger">*</span></label>
|
||||
<input type="number" class="form-control" id="amount" placeholder="Amount" required>
|
||||
<br><label for="record_date">Record Date <span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control policy_start_date" id="record_date" name="record_date" placeholder="Record Date">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="record_date">Record Date <span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control policy_start_date" id="record_date" name="record_date" placeholder="Record Date">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="row" id="transactionTypeRow" style="display:none;">
|
||||
@ -275,45 +255,58 @@
|
||||
|
||||
});
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-7 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'CD TransactionDetails',
|
||||
exportOptions: {
|
||||
columns: ''
|
||||
dom: "<'row'<'col-sm-2'f><'col-sm-10 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
|
||||
buttons: [
|
||||
{
|
||||
text: '+ add',
|
||||
className: 'btn btn-primary buttons-html5',
|
||||
action: function () {
|
||||
var myModal = new bootstrap.Modal(document.getElementById('addTransactionModal'));
|
||||
myModal.show();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'pdf',
|
||||
text: 'PDF',
|
||||
title: 'TransactionDetails',
|
||||
exportOptions: {
|
||||
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
||||
format: {
|
||||
body: function(data, row, column, node) {
|
||||
return data.replace(/<.*?>/g, '');
|
||||
}
|
||||
,
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'CD TransactionDetails',
|
||||
exportOptions: {
|
||||
columns: ''
|
||||
}
|
||||
},
|
||||
customize: function(doc) {
|
||||
doc.pageOrientation = 'landscape';
|
||||
doc.styles.tableHeader.alignment = 'left';
|
||||
doc.defaultStyle.alignment = 'left';
|
||||
doc.content[1].table.widths = ['9%', '9%', '8%', '9%', '10%', '9%', '9%', '9%', '9%', '11%', '8%'];
|
||||
{
|
||||
extend: 'pdf',
|
||||
text: 'PDF',
|
||||
title: 'TransactionDetails',
|
||||
exportOptions: {
|
||||
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
||||
format: {
|
||||
body: function (data, row, column, node) {
|
||||
return data.replace(/<.*?>/g, '');
|
||||
}
|
||||
}
|
||||
},
|
||||
customize: function (doc) {
|
||||
doc.pageOrientation = 'landscape';
|
||||
doc.styles.tableHeader.alignment = 'left';
|
||||
doc.defaultStyle.alignment = 'left';
|
||||
doc.content[1].table.widths = [
|
||||
'9%', '9%', '8%', '9%', '10%',
|
||||
'9%', '9%', '9%', '9%', '11%', '8%'
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
ordering: false,
|
||||
paging: true,
|
||||
});
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
ordering: false,
|
||||
paging: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
5829
app/Views/view_rfq_non_eb_new.php
Normal file
5829
app/Views/view_rfq_non_eb_new.php
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 626 B After Width: | Height: | Size: 787 B |
91
writable/e_card_template/common.html
Normal file
91
writable/e_card_template/common.html
Normal file
@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.ecard-container {
|
||||
width: 100%;
|
||||
display: table; /* Dompdf supports table better than flex */
|
||||
table-layout: fixed;
|
||||
border-spacing: 10px; /* Gap between front & back */
|
||||
}
|
||||
.ecard-section {
|
||||
display: table-cell;
|
||||
width: 50%;
|
||||
height: 200px; /* Fixed height */
|
||||
max-height: 200px;
|
||||
font-size: 9px;
|
||||
background-size: contain;
|
||||
background-position: top center;
|
||||
background-repeat: no-repeat;
|
||||
vertical-align: top;
|
||||
padding: 12px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
.ecard-table {
|
||||
font-size: 9px;
|
||||
line-height: 14px; /* 🔹 Reduced line height */
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.ecard-table td {
|
||||
padding: 0px 3px; /* 🔹 Reduced vertical padding */
|
||||
vertical-align: top;
|
||||
}
|
||||
.label {
|
||||
font-weight: bold;
|
||||
width: 70px; /* Fixed width for alignment */
|
||||
white-space: nowrap;
|
||||
}
|
||||
.colon {
|
||||
width: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
.value {
|
||||
width: auto;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="ecard-container">
|
||||
<!-- FRONT CARD -->
|
||||
<div class="ecard-section front" style="background-image: url('{FRONT_CARD}');">
|
||||
<div style="margin-left: 100px; margin-top: 20px; position: relative; top: -8px;">
|
||||
<table class="ecard-table">
|
||||
<tr><td class="label">Name</td><td class="colon">:</td><td class="value">{NAME}</td></tr>
|
||||
<tr><td class="label">Gender</td><td class="colon">:</td><td class="value">{GENDER}</td></tr>
|
||||
<tr><td class="label">D.O.B</td><td class="colon">:</td><td class="value">{DOB}</td></tr>
|
||||
<tr><td class="label">Relationship</td><td class="colon">:</td><td class="value">{RELATION}</td></tr>
|
||||
<tr><td class="label">Policy No</td><td class="colon">:</td><td class="value">{POLICY_NO}</td></tr>
|
||||
<tr><td class="label">TPA/UHID</td><td class="colon">:</td><td class="value">{TPA_ID}</td></tr>
|
||||
<tr><td class="label">Policy Start</td><td class="colon">:</td><td class="value">{POLICY_START_DATE}</td></tr>
|
||||
<tr><td class="label">Policy End</td><td class="colon">:</td><td class="value">{POLICY_DATE}</td></tr>
|
||||
<tr><td class="label">Insurer</td><td class="colon">:</td><td class="value">{INSURER_NAME}</td></tr>
|
||||
<tr><td class="label">TPA</td><td class="colon">:</td><td class="value">{TPA_NAME}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- BACK CARD -->
|
||||
<div class="ecard-section back" style="background-image: url('{BACK_CARD}');">
|
||||
<div style="margin-left: 110px; margin-top: 15px; font-size: 9px; line-height: 11px; position: relative; top: -8px;">
|
||||
<div>
|
||||
<span style="color: #AA292E;">For support, Please contact us:</span><br>
|
||||
{LEVELS}
|
||||
</div>
|
||||
|
||||
<div style="margin-top: -10px;">
|
||||
<span style="color: #AA292E;">For cashless claims:</span><br>
|
||||
Share a valid ID with this E-card at the Hospital Insurance Desk.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
149
writable/e_card_template/common_1.html
Normal file
149
writable/e_card_template/common_1.html
Normal file
@ -0,0 +1,149 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<style>
|
||||
@media print {
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.ecard-container {
|
||||
width: 97%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
padding-top: 35px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.ecard-section {
|
||||
width: 50%;
|
||||
min-height: 255px;
|
||||
padding-left: 15px;
|
||||
font-size: 13px;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.front, .back {
|
||||
break-inside: avoid;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
}
|
||||
@media screen {
|
||||
.ecard-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
width: 840px;
|
||||
}
|
||||
.ecard-section {
|
||||
width: 420px;
|
||||
min-height: 255px;
|
||||
padding-left: 15px;
|
||||
font-size: 13px;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
.label {
|
||||
font-family: sans-serif;
|
||||
font-weight: bold;
|
||||
min-width: 100px; /* Adjust based on your needs */
|
||||
}
|
||||
.text-wrap {
|
||||
font-family: sans-serif;
|
||||
word-wrap: break-word;
|
||||
white-space: normal;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="ecard-container">
|
||||
<div class="ecard-section front" style="background-image: url('{FRONT_CARD}');">
|
||||
<div style="margin-left: 111px; margin-top: 35px; line-height: 18px; font-size: 10px;">
|
||||
<div style="display: flex; gap: 3px;">
|
||||
<div class="label">
|
||||
<span>Name</span>
|
||||
<span style="margin-left: 53px;">:</span>
|
||||
</div>
|
||||
<div class="text-wrap">{NAME}</div>
|
||||
</div>
|
||||
<div style="display: flex; gap: 3px;">
|
||||
<div class="label">
|
||||
<span>Gender</span>
|
||||
<span style="margin-left: 45px;">:</span>
|
||||
</div>
|
||||
<div class="text-wrap">{GENDER}</div>
|
||||
</div>
|
||||
<div style="display: flex; gap: 3px;">
|
||||
<div class="label">
|
||||
<span>D.O.B</span>
|
||||
<span style="margin-left: 53px;">:</span>
|
||||
</div>
|
||||
<div class="text-wrap">{DOB}</div>
|
||||
</div>
|
||||
<div style="display: flex; gap: 3px;">
|
||||
<div class="label">
|
||||
<span>Relationship</span>
|
||||
<span style="margin-left: 21px;">:</span>
|
||||
</div>
|
||||
<div class="text-wrap">{RELATION}</div>
|
||||
</div>
|
||||
<div style="display: flex; gap: 3px;">
|
||||
<div class="label">
|
||||
<span>Policy No</span>
|
||||
<span style="margin-left: 36px;">:</span>
|
||||
</div>
|
||||
<div class="text-wrap">{POLICY_NO}</div>
|
||||
</div>
|
||||
<div style="display: flex; gap: 3px;">
|
||||
<div class="label">
|
||||
<span>TPA/UHID</span>
|
||||
<span style="margin-left: 36px;">:</span>
|
||||
</div>
|
||||
<div class="text-wrap">{TPA_ID}</div>
|
||||
</div>
|
||||
<div style="display: flex; gap: 3px;">
|
||||
<div class="label">
|
||||
<span>Policy Start Date</span>
|
||||
<span style="margin-left: 3px;">:</span>
|
||||
</div>
|
||||
<div class="text-wrap">{POLICY_START_DATE}</div>
|
||||
</div>
|
||||
<div style="display: flex; gap: 3px;">
|
||||
<div class="label">
|
||||
<span>Policy End Date</span>
|
||||
<span style="margin-left: 8px;">:</span>
|
||||
</div>
|
||||
<div class="text-wrap">{POLICY_DATE}</div>
|
||||
</div>
|
||||
<div style="display: flex; gap: 3px;">
|
||||
<div class="label">
|
||||
<span>Insurer</span>
|
||||
<span style="margin-left: 49px;">:</span>
|
||||
</div>
|
||||
<div class="text-wrap">{INSURER_NAME}</div>
|
||||
</div>
|
||||
<div style="display: flex; gap: 3px;">
|
||||
<div class="label">
|
||||
<span>TPA</span>
|
||||
<span style="margin-left: 63px;">:</span>
|
||||
</div>
|
||||
<div class="text-wrap">{TPA_NAME}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ecard-section back" style="background-image: url('{BACK_CARD}');">
|
||||
<div style="padding-left: 20px; margin-left: 90px; margin-top: 25px;">
|
||||
<div style="font-size: 10px;">
|
||||
<span style="color: #AA292E; font-family: sans-serif;">For support, Please contact us:</span> <br>
|
||||
{LEVELS}
|
||||
</div>
|
||||
|
||||
<div style="font-size: 10px;">
|
||||
<span style="color: #AA292E; font-family: sans-serif;">For cashless claims:</span><br>
|
||||
<span style="font-family: sans-serif;">Share a valid ID with this E-card at the Hospital Insurance Desk.</span><br><br><br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user