MERGE_UAT_HR_MULTI_ENTITY_SUPPORT&SMS_OTP&LIVE_ISSUES

This commit is contained in:
Ubuntu 2025-10-11 18:26:23 +05:30
commit c62ac34df6
135 changed files with 21350 additions and 16635 deletions

View File

@ -101,6 +101,6 @@ class Autoload extends AutoloadConfig
* @phpstan-var list<string> * @phpstan-var list<string>
*/ */
public $helpers = ['uuid','session','utility', 'form', 'url', 'oauth', 'fileupload', public $helpers = ['uuid','session','utility', 'form', 'url', 'oauth', 'fileupload',
'excel_import_export', 'file', 'drive','ExcelSanitizeHelper', 'api_helper','exception' 'excel_import_export', 'file', 'drive','ExcelSanitizeHelper', 'api_helper','exception','sms_helper'
]; ];
} }

View File

@ -90,11 +90,13 @@ $routes->group("/dashboard", ["filter" => "authMVC"], function ($routes) {
$routes->group("/client", ["filter" => "authMVC"], function ($routes) { $routes->group("/client", ["filter" => "authMVC"], function ($routes) {
$routes->get("list", "ClientController::index"); $routes->get("list", "ClientController::index");
$routes->get("type/(:any)", "ClientController::type/$1");
$routes->get("create", "ClientController::clientOnboarding"); $routes->get("create", "ClientController::clientOnboarding");
$routes->get('deposit/(:num)', 'ClientController::deposit/$1'); $routes->get('deposit/(:num)', 'ClientController::deposit/$1');
$routes->get('remove/(:num)', 'ClientController::removeClient/$1'); $routes->get('remove/(:num)', 'ClientController::removeClient/$1');
$routes->get("list/(:any)", "ClientController::editClientOnboarding/$1"); $routes->get("list/(:any)", "ClientController::editClientOnboarding/$1");
$routes->post('wipe', 'ClientController::wipeDemoClient'); $routes->post('wipe', 'ClientController::wipeDemoClient');
$routes->get("typeList/(:any)", "ClientController::typeList/$1");
// application/config/routes.php // application/config/routes.php
@ -124,6 +126,8 @@ $routes->group("/client", ["filter" => "authMVC"], function ($routes) {
$routes->post("edit", "ClientController::editClientBranch"); $routes->post("edit", "ClientController::editClientBranch");
$routes->get("list/(:any)", "ClientController::getSingleBranchDataById/$1"); $routes->get("list/(:any)", "ClientController::getSingleBranchDataById/$1");
$routes->get("remove/(:any)", "ClientController::removeClientBranch/$1"); $routes->get("remove/(:any)", "ClientController::removeClientBranch/$1");
$routes->post("auto_fetch_branch","ClientController::auto_fetch_branch");
$routes->post("auto_fetch_branch_details","ClientController::auto_fetch_branch_details");
}); });
$routes->group("relation", ["filter" => "authMVC"], function ($routes) { $routes->group("relation", ["filter" => "authMVC"], function ($routes) {
@ -168,6 +172,7 @@ $routes->group("/client", ["filter" => "authMVC"], function ($routes) {
$routes->group("others", ["filter" => "authMVC"], function ($routes) { $routes->group("others", ["filter" => "authMVC"], function ($routes) {
$routes->post("create", "ClientController::createOtherTabContent"); $routes->post("create", "ClientController::createOtherTabContent");
$routes->post('check-duplicate', 'ClientController::validateDuplicateByClientBranch');
}); });
}); });
@ -384,6 +389,12 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
$routes->get('getClaimDumpFileErrorData', 'TicketController::getClaimDumpFileErrorData'); $routes->get('getClaimDumpFileErrorData', 'TicketController::getClaimDumpFileErrorData');
$routes->get("claim_dump_excel_error/(:any)", "TicketController::getClaimDumpExcelFileErrors/$1"); $routes->get("claim_dump_excel_error/(:any)", "TicketController::getClaimDumpExcelFileErrors/$1");
$routes->get("download_claim_dump_file/(:any)", "TicketController::downloadClaimDumpFile/$1"); $routes->get("download_claim_dump_file/(:any)", "TicketController::downloadClaimDumpFile/$1");
$routes->post('uploadMultiFileFromRfq', 'LeadsController::uploadMultiFileFromRfq');
$routes->get('downloadMemberFile/(:any)', 'LeadsController::downloadMemberFile/$1');
$routes->get('downloadFullMemberDataExcelErrorFile/(:any)', 'LeadsController::downloadFullMemberDataExcelErrorFile/$1');
$routes->get('getMemberDataExcelFileErrors', 'LeadsController::getMemberDataExcelFileErrors');
$routes->post('savePlacementDataAndValidateMemberDataFile', 'LeadsController::savePlacementDataAndValidateMemberDataFile');
$routes->get('checkMemberDataFileValidationStatus', 'LeadsController::checkMemberDataFileValidationStatus');
}); });
$routes->post("policy_tranction/sendInstallmentRemainderMail","PolicyTransactionController::sendInstallmentRemainderMail"); $routes->post("policy_tranction/sendInstallmentRemainderMail","PolicyTransactionController::sendInstallmentRemainderMail");
@ -516,6 +527,7 @@ $routes->post("employeeRest/updateMpin", "RestAuthenticationController::updateMp
$routes->post("employeeRest/getPostEmployeeDataForAuth", "RestAuthenticationController::getPostEmployeeDataForAuth"); $routes->post("employeeRest/getPostEmployeeDataForAuth", "RestAuthenticationController::getPostEmployeeDataForAuth");
// $routes->post("logHrActivity", "RestAuthenticationController::logHrActivity"); // $routes->post("logHrActivity", "RestAuthenticationController::logHrActivity");
$routes->get("employeeRest/getClientDetails", "EmployeeRestController::getClientDetails");
$routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) { $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
@ -540,7 +552,7 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
$routes->get("deleteDependence", "EmployeeRestController::deleteDependence"); $routes->get("deleteDependence", "EmployeeRestController::deleteDependence");
$routes->get("getEmployeeAndDependenceByClientId", "EmployeeRestController::getEmployeeAndDependenceByClientId"); $routes->get("getEmployeeAndDependenceByClientId", "EmployeeRestController::getEmployeeAndDependenceByClientId");
$routes->get("getClientPolicy", "EmployeeRestController::getClientPolicy"); $routes->get("getClientPolicy", "EmployeeRestController::getClientPolicy");
$routes->get("getClientDetails", "EmployeeRestController::getClientDetails");
$routes->get("getAddOnPolicy", "EmployeeRestController::getAddOnPolicy"); $routes->get("getAddOnPolicy", "EmployeeRestController::getAddOnPolicy");
$routes->post("iAgreeForAddOn", "EmployeeRestController::iAgreeForAddOn"); $routes->post("iAgreeForAddOn", "EmployeeRestController::iAgreeForAddOn");
@ -674,6 +686,7 @@ $routes->post('claimStatusCheck','VidalApiController::claimStatusCheck');
$routes->post('newClaim','VidalApiController::newClaim'); $routes->post('newClaim','VidalApiController::newClaim');
$routes->post('enrollment','VidalApiController::enrollment'); $routes->post('enrollment','VidalApiController::enrollment');
// General Tickets
$routes->post("ticketSave", "ThzController::ticketSave"); $routes->post("ticketSave", "ThzController::ticketSave");
$routes->get("ticketList", "ThzController::ticketList"); $routes->get("ticketList", "ThzController::ticketList");
@ -692,6 +705,12 @@ $routes->group('test', function($routes) {
$routes->get('viewPDF', 'TestingController::viewPDF'); $routes->get('viewPDF', 'TestingController::viewPDF');
$routes->get('generate-pdf-view', 'TestingController::generatePDFWithView'); $routes->get('generate-pdf-view', 'TestingController::generatePDFWithView');
$routes->get('param/(:any)', 'TestingController::ptedfitdata/$1'); $routes->get('param/(:any)', 'TestingController::ptedfitdata/$1');
$routes->get('viewrfq', 'TestingController::viewRFQNonEb');
$routes->get('exportexcel', 'TestingController::exportExcel');
$routes->post('saverfq', 'TestingController::saverfq');
$routes->get('mapping_client_id_and_branch_id','TestingController::mapping_client_id_and_branch_id');
$routes->get('membervalidation', 'TestingController::membervalidation');
$routes->get('generateExcel', 'TestingController::generateExcel');
}); });
$routes->cli('cli/testcli', 'TestingController::testcli'); $routes->cli('cli/testcli', 'TestingController::testcli');

View File

@ -27,7 +27,8 @@ class AppContentManagementController extends AdminController
public function add_image_index() public function add_image_index()
{ {
$this->myLogger->logme('error','Addvertisement Image list function called'); $this->myLogger->logme('error','Addvertisement Image list function called');
$headerData['page_name'] = 'Addvertisement Image List'; $headerData['tab_name'] = 'Addvertisement Images';
$headerData['page_name'] = 'Addvertisement Images';
$data['addImageList'] = $this->addImgModel->findAll(); $data['addImageList'] = $this->addImgModel->findAll();
// dd($data); // dd($data);
@ -86,6 +87,7 @@ class AppContentManagementController extends AdminController
public function frontend_content(){ public function frontend_content(){
$data['test'] = $this->feContentModel->findAll(); $data['test'] = $this->feContentModel->findAll();
$headerData['tab_name'] = 'Front-End Content';
$headerData['page_name'] = 'Front-End Content'; $headerData['page_name'] = 'Front-End Content';
echo view('layout/header', $headerData); echo view('layout/header', $headerData);

View File

@ -180,6 +180,9 @@ class BDSReportController extends AdminController
'BAP-Insurer' => 'bapInsurer', 'BAP-Insurer' => 'bapInsurer',
'Client' => 'client' 'Client' => 'client'
]; ];
$data['page_name'] = "IRBA Report";
return $this->loadLayout('irba_report', $data); return $this->loadLayout('irba_report', $data);
} else { } else {
@ -914,6 +917,7 @@ class BDSReportController extends AdminController
$data['default_end'] = $default_start->format('d-m-Y'); $data['default_end'] = $default_start->format('d-m-Y');
$data['default_start'] = $default_start->modify('-60 days')->format('d-m-Y'); $data['default_start'] = $default_start->modify('-60 days')->format('d-m-Y');
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance']; $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
$data['tab_name'] = "Renewal Report";
$data['page_name'] = "Renewal Report"; $data['page_name'] = "Renewal Report";
return $this->loadLayout('renewal_search', $data); return $this->loadLayout('renewal_search', $data);
} else { } else {
@ -1013,6 +1017,7 @@ class BDSReportController extends AdminController
public function accountMangerStatusBDSReport() public function accountMangerStatusBDSReport()
{ {
$data['tab_name'] = "Account Manager BDS Report";
$data['page_name'] = "Account Manager BDS Report"; $data['page_name'] = "Account Manager BDS Report";
$sql = " $sql = "
@ -1130,6 +1135,7 @@ class BDSReportController extends AdminController
public function getMultiReport($report_type){ public function getMultiReport($report_type){
$data['tab_name'] = "BDS Report";
$data['page_name'] = "BDS Report"; $data['page_name'] = "BDS Report";
if ($report_type == 1){ if ($report_type == 1){

View File

@ -14,11 +14,63 @@ class EcardDownloadConversation extends Conversation
public function run() public function run()
{ {
$this->bot->types(); $this->bot->types();
sleep(0.5); // sleep(0.5);
$this->showEcardMenu(); $this->showEcardMenu();
} }
protected function showEcardMenu() protected function showEcardMenu()
{
// Log entry for debugging
log_message('error', 'showEcardMenu function called');
// Get chat session and policies
$chat_session_info = get_chatbot_session_info();
$policy_list = ChatbotHelper::getListOfPolicies($chat_session_info);
// If policies found, build an HTML list of links (and raw URLs as fallback)
if (is_array($policy_list) && count($policy_list)) {
$parts = [];
foreach ($policy_list as $policy) {
// Resolve rand string (defensive)
$randString = '';
if (isset($policy['rand_string']) && $policy['rand_string'] !== '') {
$randString = $policy['rand_string'];
} elseif (isset($policy['rand']) && $policy['rand'] !== '') {
$randString = $policy['rand'];
} elseif (isset($policy['emp_policy_id'])) {
// As a last resort, use emp_policy_id (not ideal but prevents broken links)
$randString = $policy['emp_policy_id'];
}
// Build link; make sure base_url produces correct path
$link = base_url('/download-e-card/' . $randString . '/1');
// Escape policy name to avoid HTML injection
$safeName = isset($policy['policy_name']) ? htmlspecialchars($policy['policy_name'], ENT_QUOTES, 'UTF-8') : 'Policy';
// Add to parts; include anchor and raw URL fallback
$parts[] = "🔹 <a href=\"{$link}\" target=\"_blank\">{$safeName}</a><br>";
}
$message = "Choose a policy to download (click the policy name below):<br><br>" . implode('<br><br>', $parts);
log_message('error', 'Ecard links displayed: ' . json_encode(array_column($policy_list, 'policy_name')));
$this->say($message);
} else {
log_message('error', 'No policies found for ecard download');
$this->say('No policy found.');
}
// After showing links, move to confirmation conversation (Do you want to continue?)
// This keeps the UX identical to previous flow where we asked the user if they want to continue.
$this->bot->startConversation(new doYouWantToContinueConversation());
}
protected function showEcardMenuOLD()
{ {
log_message('error', ('showEcardMenu function called')); log_message('error', ('showEcardMenu function called'));
@ -27,17 +79,13 @@ class EcardDownloadConversation extends Conversation
$buttons = []; $buttons = [];
$question = 'Choose Policy to Download Ecard:'; $question = 'Choose Policy to Download Ecard:';
// log_message('error', ('policy_list : ' . json_encode($policy_list))); log_message('error', ('policy_list : ' . json_encode($policy_list)));
if(is_array($policy_list) && count($policy_list)) if(is_array($policy_list) && count($policy_list))
{ {
foreach($policy_list as $policy) foreach($policy_list as $policy)
{ {
// $question = Question::create("Choose Policy to Download Ecard:")
// ->addButtons([
// Button::create("🔹 $policy['policy_name']")->value("$policy['emp_policy_id']"),
// Button::create("◀️ Go Back")->value("go_back"),
// ]);
$this->buttonsData[$policy['emp_policy_id'].'#'.$policy['rand_string']] = ['response_text' => "🔹 {$policy['policy_name']}"] ; $this->buttonsData[$policy['emp_policy_id'].'#'.$policy['rand_string']] = ['response_text' => "🔹 {$policy['policy_name']}"] ;
$buttons[] = Button::create("{$policy['policy_name']}")->value($policy['emp_policy_id'].'#'.$policy['rand_string']); $buttons[] = Button::create("{$policy['policy_name']}")->value($policy['emp_policy_id'].'#'.$policy['rand_string']);
} }
@ -63,10 +111,9 @@ class EcardDownloadConversation extends Conversation
case is_string($answer->getValue()) && is_array(explode('#',$answer->getValue())) && count((explode('#',$answer->getValue()))) == 2: case is_string($answer->getValue()) && is_array(explode('#',$answer->getValue())) && count((explode('#',$answer->getValue()))) == 2:
$link = base_url().'/download-e-card/' . explode('#',$answer->getValue())[1].'/1'; $link = base_url().'/download-e-card/' . explode('#',$answer->getValue())[1].'/1';
$this->say('Click here to downlad: <a href="'.$link.'" target="_blank">Ecard</a>'); log_message('error', $link);
$this->say('Click here to downlad: <a href="'.$link.'" target="_blank">GMC</a><br>Click here to downlad: <a href="'.$link.'" target="_blank">GMC Parent</a>');
$this->bot->startConversation(new doYouWantToContinueConversation()); // ✅ Restart the $this->bot->startConversation(new doYouWantToContinueConversation()); // ✅ Restart the
break; break;
default: default:
@ -76,4 +123,7 @@ class EcardDownloadConversation extends Conversation
} }
}); });
} }
} }

View File

@ -23,7 +23,7 @@ class MainMenuConversation extends Conversation
{ {
$this->bot->userStorage()->delete(); $this->bot->userStorage()->delete();
$this->bot->types(); // Typing indicator for the first message $this->bot->types(); // Typing indicator for the first message
sleep(0.5); // Delay // sleep(0.5); // Delay
$this->showMainMenu(); $this->showMainMenu();
} }

View File

@ -16,11 +16,11 @@ class NetworkHospitalConversation extends Conversation
public function run() public function run()
{ {
$this->bot->types(); // Typing indicator for the first message $this->bot->types(); // Typing indicator for the first message
sleep(0.5); // Delay // sleep(0.5); // Delay
$this->showHospitalMenu(); $this->showHospitalMenu();
} }
protected function showHospitalMenu() protected function showHospitalMenuOLD()
{ {
$chat_session_info = get_chatbot_session_info(); $chat_session_info = get_chatbot_session_info();
$policy_list = ChatbotHelper::getListOfPolicies($chat_session_info); $policy_list = ChatbotHelper::getListOfPolicies($chat_session_info);
@ -92,4 +92,54 @@ class NetworkHospitalConversation extends Conversation
}); });
} }
protected function showHospitalMenu()
{
log_message('error', 'showHospitalMenu function called');
// Get chat session and policies
$chat_session_info = get_chatbot_session_info();
$policy_list = ChatbotHelper::getListOfPolicies($chat_session_info);
if (is_array($policy_list) && count($policy_list)) {
$parts = [];
foreach ($policy_list as $policy) {
// Resolve rand string (defensive)
$randString = '';
if (isset($policy['rand_string']) && $policy['rand_string'] !== '') {
$randString = $policy['rand_string'];
} elseif (isset($policy['rand']) && $policy['rand'] !== '') {
$randString = $policy['rand'];
} elseif (isset($policy['emp_policy_id'])) {
$randString = $policy['emp_policy_id'];
}
$emp_policy_id = isset($policy['emp_policy_id']) ? $policy['emp_policy_id'] : '';
$hospital_link = ChatbotHelper::getHospitalLink($emp_policy_id);
$safeName = isset($policy['policy_name']) ? htmlspecialchars($policy['policy_name'], ENT_QUOTES, 'UTF-8') : 'Policy';
if ($hospital_link) {
$parts[] = "🔹 <a href=\"{$hospital_link}\" target=\"_blank\">{$safeName}</a><br>";
} else {
$parts[] = "🔹 {$safeName} — No Data found, please contact support team";
}
log_message('error', 'Hospital link for policy ' . $emp_policy_id . ': ' . $hospital_link);
}
$message = "Access hospital details for your policies below:<br><br>" . implode('<br><br>', $parts);
$this->say($message);
} else {
log_message('error', 'No policies found for hospital menu');
$this->say('No policy found.');
}
// After showing links, move to confirmation conversation
$this->bot->startConversation(new doYouWantToContinueConversation());
}
} }

View File

@ -111,7 +111,7 @@ class ChatbotControllerNew extends BaseController
log_message("error","Inside Bot Type Function"); log_message("error","Inside Bot Type Function");
$bot->types(); // Typing indicator for the first message $bot->types(); // Typing indicator for the first message
sleep(0.1); // Delay // sleep(0.5); // Delay
}); });
// Start the Main Menu when user says "hi" or "start" // Start the Main Menu when user says "hi" or "start"
$this->botman->hears('start|hi|hello|help|help me', function (BotMan $bot) { $this->botman->hears('start|hi|hello|help|help me', function (BotMan $bot) {

View File

@ -132,6 +132,15 @@ class ClientController extends AdminController
//-------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------
public function validateDuplicateByClientBranch()
{
$value = $this->request->getPost('value');
$clientId = $this->request->getPost('client_id');
$branchId = $this->request->getPost('branch_id');
$field = $this->request->getPost('field');
$isDuplicate = $this->clientModel->isDuplicateByClientBranch($value, $field, $clientId, $branchId);
return $this->response->setJSON(['isDuplicate' => $isDuplicate]);
}
public function checkDuplicateTableFieldValue() public function checkDuplicateTableFieldValue()
{ {
$table = $this->request->getPost('table'); $table = $this->request->getPost('table');
@ -218,7 +227,6 @@ class ClientController extends AdminController
$client_policy_ids2 = array_column($client_policy_ids, 'client_policy_id'); $client_policy_ids2 = array_column($client_policy_ids, 'client_policy_id');
$client_policy_id = array_unique($client_policy_ids2); $client_policy_id = array_unique($client_policy_ids2);
} else { } else {
$client_policy_id = json_decode($policy_id, true); $client_policy_id = json_decode($policy_id, true);
} }
@ -233,8 +241,7 @@ class ClientController extends AdminController
$mail_send_return1 = ''; $mail_send_return1 = '';
$mail_send_return2 = ''; $mail_send_return2 = '';
if (!is_null($client_policy_id) && is_array($client_policy_id)) if (!is_null($client_policy_id) && is_array($client_policy_id)) {
{
$empData = $this->employeeModel->where('emp_code', $emp_code)->where('client_id', $client_id)->where('is_active', 1)->findAll(); $empData = $this->employeeModel->where('emp_code', $emp_code)->where('client_id', $client_id)->where('is_active', 1)->findAll();
// dd($empData); // dd($empData);
@ -243,8 +250,7 @@ class ClientController extends AdminController
// dd($filteredEmpData); // dd($filteredEmpData);
$array_list = []; $array_list = [];
foreach ($client_policy_id as $key => $value) foreach ($client_policy_id as $key => $value) {
{
$find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $value, emp_code: $emp_code, client_id: $client_id, emp_status: ['draft', 'enrolled'], policy_status: ['draft', 'enrolled']); $find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $value, emp_code: $emp_code, client_id: $client_id, emp_status: ['draft', 'enrolled'], policy_status: ['draft', 'enrolled']);
if (count($find) > 0) { if (count($find) > 0) {
$array_list[] = $find; $array_list[] = $find;
@ -325,7 +331,6 @@ class ClientController extends AdminController
} else { } else {
$this->myLogger->logme("error", 'Member Review Mail Configuration not Enable for this client'); $this->myLogger->logme("error", 'Member Review Mail Configuration not Enable for this client');
} }
} }
print_r($wholeData); print_r($wholeData);
@ -359,7 +364,6 @@ class ClientController extends AdminController
$client_policy_ids2 = array_column($client_policy_ids, 'client_policy_id'); $client_policy_ids2 = array_column($client_policy_ids, 'client_policy_id');
$client_policy_id = array_unique($client_policy_ids2); $client_policy_id = array_unique($client_policy_ids2);
} else { } else {
$client_policy_id = json_decode($policy_id, true); $client_policy_id = json_decode($policy_id, true);
} }
@ -474,8 +478,9 @@ class ClientController extends AdminController
public function index() public function index()
{ {
$this->myLogger->logme('error', 'Client list function called'); $this->myLogger->logme('error', 'Client list function called');
$headerData['page_name'] = 'Client List'; $headerData['tab_name'] = 'Client List';
$data['clientList'] = $this->clientModel->getCreatedByUserName(); $headerData['page_name'] = 'Clients'; // Both Browser Tab name And Page name are same.
$data['clientList'] = $this->clientModel->getCreatedByUserName(1); // passing client_type
$data['client_rm'] = $this->clientRMModel->getAllClientRM(); $data['client_rm'] = $this->clientRMModel->getAllClientRM();
$data['lead_data'] = $this->leadsModel->getLeadForInsertClientList(); $data['lead_data'] = $this->leadsModel->getLeadForInsertClientList();
@ -488,6 +493,29 @@ class ClientController extends AdminController
// $this->loadLayout('client_onboarding', $data); // $this->loadLayout('client_onboarding', $data);
} }
public function typeList($id = null)
{
try {
$data = $this->clientModel->getCreatedByUserName($id); // passing client_type
if (empty($data)) {
return $this->response
->setJSON(['status' => 'error', 'message' => 'No Records found'])
->setStatusCode(404);
}
return $this->response
->setJSON(['status' => 'success', 'data' => $data])
->setStatusCode(200);
} catch (\Throwable $e) {
return $this->response
->setJSON(['status' => 'error', 'message' => $e->getMessage()])
->setStatusCode(500);
}
}
public function updateEmpAndPolicyStatus() public function updateEmpAndPolicyStatus()
{ {
@ -599,7 +627,8 @@ class ClientController extends AdminController
public function clientOnboarding() public function clientOnboarding()
{ {
$this->myLogger->logme('error', 'Client Onboarding function called'); $this->myLogger->logme('error', 'Client Onboarding function called');
$headerData['page_name'] = 'Client Onboarding'; $headerData['tab_name'] = 'Client Onboarding';
$headerData['page_name'] = 'Clients';
$data['entity'] = $this->kycEntityTypeModel->findAll(); $data['entity'] = $this->kycEntityTypeModel->findAll();
$data['kyc_docs'] = $this->kycDocsModel->findAll(); $data['kyc_docs'] = $this->kycDocsModel->findAll();
@ -621,6 +650,10 @@ class ClientController extends AdminController
// dd($data['placeHolders']); // dd($data['placeHolders']);
// auto fetch client list and branch list from pre
$data['auto_fetch_client_list'] = $this->getClientListFromPre();
echo view('layout/header', $headerData); echo view('layout/header', $headerData);
echo view('client_onboarding', $data); echo view('client_onboarding', $data);
echo view('layout/footer'); echo view('layout/footer');
@ -629,8 +662,8 @@ class ClientController extends AdminController
// In your controller // In your controller
public function deposit($id = null, $requestFrom = null, $policyId = null) public function deposit($id = null, $requestFrom = null, $policyId = null)
{ {
$headerData['tab_name'] = 'Client Deposit';
$headerData['page_name'] = 'Client Deposit'; $headerData['page_name'] = 'Clients';
$data['clientName'] = $this->clientModel->where('id', $id)->find(); $data['clientName'] = $this->clientModel->where('id', $id)->find();
$data['clientData'] = $this->clientPolicyModel->getinsurerswithclientid($id, $policyId); $data['clientData'] = $this->clientPolicyModel->getinsurerswithclientid($id, $policyId);
@ -642,7 +675,9 @@ class ClientController extends AdminController
$data['balances'] = $balances; $data['balances'] = $balances;
// dd($data); // dd($data);
if($requestFrom == 'rest'){ return $data; } if ($requestFrom == 'rest') {
return $data;
}
echo view('layout/header', $headerData); echo view('layout/header', $headerData);
echo view('client_deposit_list', $data); echo view('client_deposit_list', $data);
@ -671,11 +706,11 @@ class ClientController extends AdminController
]; ];
$data['subTypeOptions'] = $subTypeOptions; $data['subTypeOptions'] = $subTypeOptions;
$headerData['page_name'] = 'Client Deposit'; $headerData['tab_name'] = 'Client Deposit';
$headerData['page_name'] = 'Clients';
$loggedInUserID = get_session_userid(); $loggedInUserID = get_session_userid();
// $data['clientData']= $this->clientPolicyModel->getinsurerswithinsurenceid($insurerId); // $data['clientData']= $this->clientPolicyModel->getinsurerswithinsurenceid($insurerId);
if($requestFrom == 'rest') if ($requestFrom == 'rest') {
{
$clientId = $param['client_id']; $clientId = $param['client_id'];
$cd_ac_pk = $param['cd_ac_pk']; $cd_ac_pk = $param['cd_ac_pk'];
} else { } else {
@ -689,7 +724,9 @@ class ClientController extends AdminController
$data['deposiamount'] = $this->clientPolicyModel->getDepositSummary($clientId, $insurerId, $cd_ac_pk); $data['deposiamount'] = $this->clientPolicyModel->getDepositSummary($clientId, $insurerId, $cd_ac_pk);
$data['cd_ac_pk'] = $cd_ac_pk; $data['cd_ac_pk'] = $cd_ac_pk;
if($requestFrom == 'rest'){ return $data; } if ($requestFrom == 'rest') {
return $data;
}
// Load the view for the new list page; // Load the view for the new list page;
echo view('layout/header', $headerData); echo view('layout/header', $headerData);
@ -751,7 +788,8 @@ class ClientController extends AdminController
{ {
$this->myLogger->logme('error', 'Edit Client Onboarding function called'); $this->myLogger->logme('error', 'Edit Client Onboarding function called');
$headerData['page_name'] = 'Edit Client Onboarding'; $headerData['tab_name'] = 'Edit Client Onboarding';
$headerData['page_name'] = 'Clients';
$editData['RM'] = $this->userModel->where('is_active', 1)->findAll(); $editData['RM'] = $this->userModel->where('is_active', 1)->findAll();
$editData['tpa'] = $this->tpaBranchModel->getTpaBranchesWithTpaNames(); $editData['tpa'] = $this->tpaBranchModel->getTpaBranchesWithTpaNames();
@ -794,6 +832,12 @@ class ClientController extends AdminController
$editData['placeHolders'] = ['member_name', 'member_mobile', 'nhance_logo', 'tpa_id', 'ecard_download_link', 'client_logo', 'policy_no', 'member_summary', 'app_link', 'post_enrollment_app_link', 'client_name']; $editData['placeHolders'] = ['member_name', 'member_mobile', 'nhance_logo', 'tpa_id', 'ecard_download_link', 'client_logo', 'policy_no', 'member_summary', 'app_link', 'post_enrollment_app_link', 'client_name'];
$editData['api_data'] = $this->clientApi->where("client_id", $id)->where("is_active", 1)->first(); $editData['api_data'] = $this->clientApi->where("client_id", $id)->where("is_active", 1)->first();
// dd($editData); // dd($editData);
$edit['pre_branch_id'] = $this->clientBranchModel->select('pre_branch_id')->where('client_id',$id)->get()->getResultArray()[0]['pre_branch_id']??"";
$editData['auto_fetch_client_list'] = $this->getClientListFromPre();
echo view('layout/header', $headerData); echo view('layout/header', $headerData);
echo view('client_onboarding', $editData); echo view('client_onboarding', $editData);
echo view('layout/footer'); echo view('layout/footer');
@ -1070,7 +1114,7 @@ class ClientController extends AdminController
$this->myLogger->logme('error', 'Client branch CREATE function called'); $this->myLogger->logme('error', 'Client branch CREATE function called');
$data = $this->request->getPost(); $data = $this->request->getPost();
// var_dump($data); die;
if (!isset($data['sez'])) { if (!isset($data['sez'])) {
$data['sez'] = 0; $data['sez'] = 0;
} elseif ($data['sez']) { } elseif ($data['sez']) {
@ -1086,14 +1130,47 @@ class ClientController extends AdminController
} }
$data['created_by'] = get_session_userid(); $data['created_by'] = get_session_userid();
// before updating check if pre_branch_id is already existing in the current db
if(isset($data['pre_branch_id']) && !empty($data['pre_branch_id']))
{
$existing_pre_branch = $this->clientBranchModel
->where('pre_branch_id',$data['pre_branch_id'])
//->where('id !=',$post_branch_id)
->first();
if($existing_pre_branch)
{
return $this->respond([
'status' => false,
'code' => 409,
'message' => 'The branch is already mapped with another branch. Please check.',
], 409);
}
}
$insert = $this->clientBranchModel->insert($data); $insert = $this->clientBranchModel->insert($data);
$post_branch_id = $insert;
if ($insert) { if ($insert) {
$level_contact_data = $this->request->getPost('level_contect_data'); $level_contact_data = $this->request->getPost('level_contect_data');
$level_contact_data = !empty($level_contact_data) ? json_decode($level_contact_data, true) : null; $level_contact_data = !empty($level_contact_data) ? json_decode($level_contact_data, true) : null;
$this->saveLevelContacts($level_contact_data, $insert); $this->saveLevelContacts($level_contact_data, $insert);
} }
if($post_branch_id && isset($data['pre_branch_id']) && !empty($data['pre_branch_id']))
{
// need to update the client_branch in the pre
$result = $this->updatePreClientBranch($data['pre_branch_id'],$post_branch_id , "create");
log_message('error','Pre client_branch update result for pre_branch_id '.$data['pre_branch_id'].' and post_branch_id '.$post_branch_id.' is '.json_encode($result));
}
if ($insert) { if ($insert) {
$branchData = $this->clientBranchModel->where('client_id', $this->request->getPost('client_id'))->findAll(); $branchData = $this->clientBranchModel->where('client_id', $this->request->getPost('client_id'))->findAll();
$branchData['role'] = get_role_id(); $branchData['role'] = get_role_id();
@ -1118,7 +1195,11 @@ class ClientController extends AdminController
$this->myLogger->logme('error', 'Client branch EDIT function called'); $this->myLogger->logme('error', 'Client branch EDIT function called');
$id = $this->request->getPost('branch_id_primarykey'); $id = $this->request->getPost('branch_id_primarykey');
$client_id = $this->request->getPost('client_id'); $client_id = $this->request->getPost('client_id');
$pre_branch_id = $this->request->getPost('pre_branch_id') ?? '';
$data = $this->request->getPost(); $data = $this->request->getPost();
$data['pre_branch_id'] = $pre_branch_id;
$units = $this->request->getPost('units'); $units = $this->request->getPost('units');
$emp_unit_count = 0; $emp_unit_count = 0;
@ -1177,7 +1258,41 @@ class ClientController extends AdminController
} }
$data['updated_by'] = get_session_userid(); $data['updated_by'] = get_session_userid();
$post_branch_id = $id;
// before updating check if pre_branch_id is already existing in the current db
if(isset($data['pre_branch_id']) && !empty($data['pre_branch_id']))
{
$existing_pre_branch = $this->clientBranchModel
->where('pre_branch_id',$data['pre_branch_id'])
->where('id !=',$post_branch_id)
->first();
if($existing_pre_branch)
{
return $this->respond([
'status' => false,
'code' => 409,
'message' => 'The branch is already mapped with another branch. Please check.',
], 409);
}
}
$insert = $this->clientBranchModel->update($id, $data); $insert = $this->clientBranchModel->update($id, $data);
if($post_branch_id && isset($data['pre_branch_id']) && !empty($data['pre_branch_id']))
{
// need to update the client_branch in the pre
$result = $this->updatePreClientBranch($data['pre_branch_id'],$post_branch_id , "update");
log_message('error','Pre client_branch update result for pre_branch_id '.$data['pre_branch_id'].' and post_branch_id '.$post_branch_id.' is '.json_encode($result));
}
$this->myLogger->logme('error', 'Client branch EDITED by {data}', ['data' => get_session_userid()]); $this->myLogger->logme('error', 'Client branch EDITED by {data}', ['data' => get_session_userid()]);
@ -1504,7 +1619,6 @@ class ClientController extends AdminController
} else { } else {
return $this->respond(['status' => false, 'code' => 404, 'message' => 'Failed to remove policy'], 200); return $this->respond(['status' => false, 'code' => 404, 'message' => 'Failed to remove policy'], 200);
} }
} else { } else {
return $this->respond(['status' => false, 'code' => 404, 'message' => 'The policy has active employees'], 200); return $this->respond(['status' => false, 'code' => 404, 'message' => 'The policy has active employees'], 200);
@ -1990,8 +2104,15 @@ class ClientController extends AdminController
// Check differences and prepare update data // Check differences and prepare update data
$fields_to_check = [ $fields_to_check = [
'client_branch_id', 'policy_type', 'insurer_id', 'insurer_branch_id', 'client_branch_id',
'cd_ac_pk', 'policy_end_date', 'policy_start_date', 'tpa_id', 'tpa_branch_id' 'policy_type',
'insurer_id',
'insurer_branch_id',
'cd_ac_pk',
'policy_end_date',
'policy_start_date',
'tpa_id',
'tpa_branch_id'
]; ];
foreach ($fields_to_check as $field) { foreach ($fields_to_check as $field) {
@ -2045,12 +2166,10 @@ class ClientController extends AdminController
'message' => "Policy transaction(s) updated.", 'message' => "Policy transaction(s) updated.",
'updated_ids' => $updated_pt_ids 'updated_ids' => $updated_pt_ids
]; ];
} else { } else {
$this->myLogger->logme("error", "No active policy_transaction records found for update."); $this->myLogger->logme("error", "No active policy_transaction records found for update.");
return ['status' => "Failed", 'message' => "No active policy_transaction records found."]; return ['status' => "Failed", 'message' => "No active policy_transaction records found."];
} }
} catch (\Throwable $e) { } catch (\Throwable $e) {
$this->myLogger->logme("error", "Exception during policy_transaction update: " . $e->getMessage()); $this->myLogger->logme("error", "Exception during policy_transaction update: " . $e->getMessage());
return [ return [
@ -2096,7 +2215,6 @@ class ClientController extends AdminController
$errors[] = "No change or failed update for ID {$row['id']}"; $errors[] = "No change or failed update for ID {$row['id']}";
} }
} }
} catch (\Exception $e) { } catch (\Exception $e) {
$errors[] = "Error updating pt_id {$pt_id}: " . $e->getMessage(); $errors[] = "Error updating pt_id {$pt_id}: " . $e->getMessage();
} }
@ -2185,7 +2303,8 @@ class ClientController extends AdminController
} }
} }
public function generateKycPrimaryTable($client_id){ public function generateKycPrimaryTable($client_id)
{
$db = db_connect(); $db = db_connect();
$builder = $db->table('kyc_docs kd'); $builder = $db->table('kyc_docs kd');
@ -2210,7 +2329,8 @@ class ClientController extends AdminController
} }
public function generateKycOthersTable($client_id){ public function generateKycOthersTable($client_id)
{
$result['data'] = $this->clientKYCDocsModel $result['data'] = $this->clientKYCDocsModel
->where('is_active', 1) ->where('is_active', 1)
@ -3863,7 +3983,6 @@ class ClientController extends AdminController
$newKey = implode(' ', array_map('ucfirst', explode('_', $original_key))); $newKey = implode(' ', array_map('ucfirst', explode('_', $original_key)));
$data['enrollment_display_key'][$newKey] = $policy_terms[$original_key] ?? " "; $data['enrollment_display_key'][$newKey] = $policy_terms[$original_key] ?? " ";
} else { } else {
$data[$key] = $value; $data[$key] = $value;
@ -4530,7 +4649,6 @@ class ClientController extends AdminController
]; ];
$client_insert = $this->clientModel->insert($client_data); $client_insert = $this->clientModel->insert($client_data);
} else if ($client_type == 1) { } else if ($client_type == 1) {
$client_data = [ $client_data = [
@ -4551,11 +4669,11 @@ class ClientController extends AdminController
// Additional logic for non-individual clients (client_type != 2) // Additional logic for non-individual clients (client_type != 2)
$branch_insert = null; $branch_insert = null;
if ($client_type != 2) { if ($client_type != 2) {
$unit[] = $postData['short_name'] . '-' . 001; $unit[] = $postData['short_name'] . '-' . $postData['branch_code'] ?? 001;
$branch_data = [ $branch_data = [
'client_id' => $client_insert, 'client_id' => $client_insert,
'branch_name' => $postData['branch_name'], 'branch_name' => $postData['branch_name'],
'branch_code' => 001, 'branch_code' => $postData['branch_code'] ?? 001,
'gst' => $postData['gst'], 'gst' => $postData['gst'],
'units' => json_encode($unit) ?? null, 'units' => json_encode($unit) ?? null,
]; ];
@ -4567,6 +4685,7 @@ class ClientController extends AdminController
'contact_type' => 'client', 'contact_type' => 'client',
'name' => $postData['name'], 'name' => $postData['name'],
'email' => $postData['email'], 'email' => $postData['email'],
'mobile' => $postData['mobile'] ?? null,
]; ];
$this->levelContactModel->insert($contact_data); $this->levelContactModel->insert($contact_data);
} }
@ -4656,7 +4775,6 @@ class ClientController extends AdminController
]; ];
$client_insert = $this->clientModel->insert($client_data); $client_insert = $this->clientModel->insert($client_data);
} else if ($client_type == 1) { } else if ($client_type == 1) {
$client_data = [ $client_data = [
@ -4734,11 +4852,9 @@ class ClientController extends AdminController
'vehicles' => $vehicles, 'vehicles' => $vehicles,
'message' => 'Vehicle created successfully' 'message' => 'Vehicle created successfully'
], 200); ], 200);
} else { } else {
return $this->respond(['status' => false, 'message' => 'Failed to created vehicle'], 200); return $this->respond(['status' => false, 'message' => 'Failed to created vehicle'], 200);
} }
} else if (isset($data['owner']) && !empty($data['owner'])) { } else if (isset($data['owner']) && !empty($data['owner'])) {
$vehicle_data = [ $vehicle_data = [
@ -4780,7 +4896,6 @@ class ClientController extends AdminController
'vehicles' => $vehicles, 'vehicles' => $vehicles,
'message' => 'Vehicle created successfully' 'message' => 'Vehicle created successfully'
], 200); ], 200);
} else { } else {
return $this->respond(['status' => false, 'message' => 'Failed to created vehicle'], 200); return $this->respond(['status' => false, 'message' => 'Failed to created vehicle'], 200);
} }
@ -5039,11 +5154,9 @@ class ClientController extends AdminController
if (in_array($data[$i]['policy_type_id'], [2, 3]) && $is_addon == 1) { if (in_array($data[$i]['policy_type_id'], [2, 3]) && $is_addon == 1) {
$payable_arr = ["self" => 0, "spouse" => 0, "childern" => 0, "elders" => 0,]; $payable_arr = ["self" => 0, "spouse" => 0, "childern" => 0, "elders" => 0,];
} else if ($data[$i]['policy_type_id'] == 3 && $is_addon == 3) { } else if ($data[$i]['policy_type_id'] == 3 && $is_addon == 3) {
$payable_arr = ["self" => 1, "spouse" => 1, "childern" => 1, "elders" => 1,]; $payable_arr = ["self" => 1, "spouse" => 1, "childern" => 1, "elders" => 1,];
} else if (in_array($data[$i]['policy_type_id'], [4, 5])) { } else if (in_array($data[$i]['policy_type_id'], [4, 5])) {
$payable_arr = ["self" => 1, "spouse" => 1, "childern" => 1, "elders" => 1,]; $payable_arr = ["self" => 1, "spouse" => 1, "childern" => 1, "elders" => 1,];
@ -5106,7 +5219,6 @@ class ClientController extends AdminController
]; ];
} }
} }
} else { } else {
// add is_payable_employee for the GMC Policy // add is_payable_employee for the GMC Policy
@ -5133,7 +5245,6 @@ class ClientController extends AdminController
]; ];
} }
} }
} }
foreach ($orderedPolicyTerms as $term) { foreach ($orderedPolicyTerms as $term) {
@ -5204,7 +5315,6 @@ class ClientController extends AdminController
if (!isset($policyTerms['enrollment_display_key'])) { if (!isset($policyTerms['enrollment_display_key'])) {
$policyTerms['enrollment_display_key'] = $this->existingGMCDisplayValueTransform($policyTerms); $policyTerms['enrollment_display_key'] = $this->existingGMCDisplayValueTransform($policyTerms);
} }
} else if ($data[$i]['policy_type_id'] == 1) { } else if ($data[$i]['policy_type_id'] == 1) {
if (!isset($policyTerms['medical_expenses_medical_extension'])) { if (!isset($policyTerms['medical_expenses_medical_extension'])) {
@ -5250,7 +5360,6 @@ class ClientController extends AdminController
if (!isset($policyTerms['enrollment_display_key'])) { if (!isset($policyTerms['enrollment_display_key'])) {
$policyTerms['enrollment_display_key'] = $this->existingGPADisplayValueTransform($policyTerms); $policyTerms['enrollment_display_key'] = $this->existingGPADisplayValueTransform($policyTerms);
} }
} }
// dd($policyTerms); // dd($policyTerms);
@ -5839,11 +5948,7 @@ class ClientController extends AdminController
$base_policy_id = $client_policy_details['base_policy'] ?? 0; $base_policy_id = $client_policy_details['base_policy'] ?? 0;
if (!empty($base_policy_id)) { if (!empty($base_policy_id)) {
} }
} }
} }
} }
@ -6584,7 +6689,6 @@ class ClientController extends AdminController
$emptyKeyData[$key] = $value; $emptyKeyData[$key] = $value;
} else { } else {
$others[$key] = $value; $others[$key] = $value;
} }
} }
} }
@ -6766,7 +6870,6 @@ class ClientController extends AdminController
if (!empty($receivedData['id'])) { if (!empty($receivedData['id'])) {
$status = $this->clientApi->save($receivedData); $status = $this->clientApi->save($receivedData);
} else { } else {
$status = $this->clientApi->insert($receivedData); $status = $this->clientApi->insert($receivedData);
} }
@ -6777,7 +6880,6 @@ class ClientController extends AdminController
} else { } else {
return $this->respond(['status' => "Failed", 'message' => "Submission Faild"], 500); return $this->respond(['status' => "Failed", 'message' => "Submission Faild"], 500);
} }
} }
public function sendToken() public function sendToken()
@ -6817,7 +6919,8 @@ class ClientController extends AdminController
$post_client_data = $this->clientModel->where('id', $client_id)->where('is_active', 1)->first(); $post_client_data = $this->clientModel->where('id', $client_id)->where('is_active', 1)->first();
$hrAccessData['post_hr_data'] = $this->clientBranchModel $hrAccessData['post_hr_data'] = $this->clientBranchModel
->select('lc.id as post_hr_id, lc.name as hr_name, lc.mobile as hr_mobile, lc.email as hr_mail') ->select('lc.id as post_hr_id, lc.name as hr_name, lc.mobile as hr_mobile, lc.email as hr_mail ,
client_branch.id as post_branch_id , client_branch.branch_name as post_branch_name')
->join('level_contacts lc', 'client_branch.id = lc.ref_id') ->join('level_contacts lc', 'client_branch.id = lc.ref_id')
->where('client_branch.is_active', 1) ->where('client_branch.is_active', 1)
->where('lc.is_active', 1) ->where('lc.is_active', 1)
@ -6826,7 +6929,7 @@ class ClientController extends AdminController
->findAll(); ->findAll();
$hrAccessData['post_policy_data'] = $this->clientPolicyModel $hrAccessData['post_policy_data'] = $this->clientPolicyModel
->select('client_policy.id as client_policy_id, client_policy.policy_no as policy_no, policy_type.policy_type, client_policy.policy_status') ->select('client_policy.id as client_policy_id, client_policy.policy_no as policy_no, policy_type.policy_type, client_policy.policy_status , client_policy.client_branch_id as branch_id')
->join('policy_type', 'client_policy.policy_type_id = policy_type.id') ->join('policy_type', 'client_policy.policy_type_id = policy_type.id')
->where('client_policy.is_active', 1) ->where('client_policy.is_active', 1)
->where('client_policy.client_id', $client_id) ->where('client_policy.client_id', $client_id)
@ -6855,22 +6958,31 @@ class ClientController extends AdminController
$hrAccessData['pre_hr_data'] = []; $hrAccessData['pre_hr_data'] = [];
$hrAccessData['pre_policy_data'] = []; $hrAccessData['pre_policy_data'] = [];
$combinedHrAccessData = $this->constructHrAccessData($hrAccessData, $client_id); $combinedHrAccessData = $this->constructHrAccessData($hrAccessData, $client_id , $pre_client_data['id']??'');
return $combinedHrAccessData; return $combinedHrAccessData;
} }
$pre_client_data = $db2->table('clients')->where('is_active', 1)->where('short_name', $post_client_data['short_name'])->get()->getRowArray(); $post_branch = $this->clientBranchModel->select('pre_branch_id')->where('client_id',$client_id)->get()->getResultArray()[0]??[];
$pre_client_data = $db2->table('client_branch cb')
->join('clients c', "c.id = cb.client_id")
->where('c.is_active',1)
->where('cb.is_active', 1)
->where('cb.id', $post_branch['pre_branch_id']??'')
->get()->getRowArray();
if (empty($pre_client_data)) { if (empty($pre_client_data)) {
$hrAccessData['pre_hr_data'] = []; $hrAccessData['pre_hr_data'] = [];
$hrAccessData['pre_policy_data'] = []; $hrAccessData['pre_policy_data'] = [];
$combinedHrAccessData = $this->constructHrAccessData($hrAccessData, $client_id); $combinedHrAccessData = $this->constructHrAccessData($hrAccessData, $client_id , $pre_client_data['id']??'');
return $combinedHrAccessData; return $combinedHrAccessData;
} }
$hrAccessData['pre_hr_data'] = $db2->table('client_branch') $hrAccessData['pre_hr_data'] = $db2->table('client_branch')
->select('lc.id as pre_hr_id, lc.name as hr_name, lc.mobile as hr_mobile, lc.email as hr_mail') ->select('lc.id as pre_hr_id, lc.name as hr_name, lc.mobile as hr_mobile, lc.email as hr_mail
, client_branch.id as pre_branch_id , client_branch.branch_name as pre_branch_name ' )
->join('level_contacts lc', 'client_branch.id = lc.ref_id') ->join('level_contacts lc', 'client_branch.id = lc.ref_id')
->where('client_branch.is_active', 1) ->where('client_branch.is_active', 1)
->where('lc.is_active', 1) ->where('lc.is_active', 1)
@ -6880,7 +6992,7 @@ class ClientController extends AdminController
->getResultArray(); ->getResultArray();
$hrAccessData['pre_policy_data'] = $db2->table('client_policy') $hrAccessData['pre_policy_data'] = $db2->table('client_policy')
->select('client_policy.id as client_policy_id, client_policy.policy_no as policy_no, policy_type.policy_type, client_policy.policy_status') ->select('client_policy.id as client_policy_id, client_policy.policy_no as policy_no, policy_type.policy_type, client_policy.policy_status , client_policy.client_branch_id as branch_id')
->join('policy_type', 'client_policy.policy_type_id = policy_type.id') ->join('policy_type', 'client_policy.policy_type_id = policy_type.id')
->where('client_policy.is_active', 1) ->where('client_policy.is_active', 1)
->where('client_policy.client_id', $pre_client_data['id']) ->where('client_policy.client_id', $pre_client_data['id'])
@ -6888,16 +7000,16 @@ class ClientController extends AdminController
->orderBy('client_policy.policy_status', 'desc') ->orderBy('client_policy.policy_status', 'desc')
->get() ->get()
->getResultArray(); ->getResultArray();
// dd($hrAccessData); // dd($hrAccessData);
$combinedHrAccessData = $this->constructHrAccessData($hrAccessData, $client_id); $combinedHrAccessData = $this->constructHrAccessData($hrAccessData, $client_id ,$pre_client_data['id']);
return $combinedHrAccessData; return $combinedHrAccessData;
} }
public function constructHrAccessData($data, $client_id) public function constructHrAccessData($data, $client_id , $pre_client_id)
{ {
// dd($data); // print_rr($data);die;
$preHrs = $data['pre_hr_data']; $preHrs = $data['pre_hr_data'];
$postHrs = $data['post_hr_data']; $postHrs = $data['post_hr_data'];
$hrAccessTableData = $data['hr_access_table_data']; $hrAccessTableData = $data['hr_access_table_data'];
@ -6907,13 +7019,18 @@ class ClientController extends AdminController
foreach ($postHrs as $post) { foreach ($postHrs as $post) {
$found = false; $found = false;
foreach ($preHrs as $index => $pre) { foreach ($preHrs as $index => $pre) {
if ($post['hr_mobile'] === $pre['hr_mobile'] && $post['hr_mail'] === $pre['hr_mail']) {
if ( trim($post['hr_mobile']) == trim($pre['hr_mobile']) && trim($post['hr_mail']) == trim($pre['hr_mail']) ) {
$merged[] = [ $merged[] = [
'pre_hr_id' => $pre['pre_hr_id'], 'pre_hr_id' => $pre['pre_hr_id'],
'post_hr_id' => $post['post_hr_id'], 'post_hr_id' => $post['post_hr_id'],
'hr_name' => $post['hr_name'], 'hr_name' => $post['hr_name'],
'hr_mobile' => $post['hr_mobile'], 'hr_mobile' => $post['hr_mobile'],
'hr_mail' => $post['hr_mail'] 'hr_mail' => $post['hr_mail'],
'pre_branch_id' => $pre['pre_branch_id'] ?? null,
'post_branch_id' => $post['post_branch_id'] ?? null,
'post_branch_name' => $post['post_branch_name'] ?? null
]; ];
unset($preHrs[$index]); // remove matched pre_hr unset($preHrs[$index]); // remove matched pre_hr
$found = true; $found = true;
@ -6927,19 +7044,32 @@ class ClientController extends AdminController
'post_hr_id' => $post['post_hr_id'], 'post_hr_id' => $post['post_hr_id'],
'hr_name' => $post['hr_name'], 'hr_name' => $post['hr_name'],
'hr_mobile' => $post['hr_mobile'], 'hr_mobile' => $post['hr_mobile'],
'hr_mail' => $post['hr_mail'] 'hr_mail' => $post['hr_mail'],
'pre_branch_id' => $pre['pre_branch_id'] ?? null,
'post_branch_id' => $post['post_branch_id'] ?? null ,
'post_branch_name' => $post['post_branch_name'] ?? null
]; ];
} }
} }
// Remaining preHrs (not matched) // Remaining preHrs (not matched)
foreach ($preHrs as $pre) { foreach ($preHrs as $pre) {
foreach ($merged as $value) {
if ( trim($pre['hr_mobile']) == trim($value['hr_mobile']) && trim($pre['hr_mail']) == trim($value['hr_mail']) ) {
continue 2; // Skip adding this pre_hr as it's already matched
}
}
$merged[] = [ $merged[] = [
'pre_hr_id' => $pre['pre_hr_id'], 'pre_hr_id' => $pre['pre_hr_id'],
'post_hr_id' => null, 'post_hr_id' => null,
'hr_name' => $pre['hr_name'], 'hr_name' => $pre['hr_name'],
'hr_mobile' => $pre['hr_mobile'], 'hr_mobile' => $pre['hr_mobile'],
'hr_mail' => $pre['hr_mail'] 'hr_mail' => $pre['hr_mail'],
'pre_branch_id' => $pre['pre_branch_id'] ?? null,
'post_branch_id' => $post['post_branch_id'] ?? null ,
'post_branch_name' => $post['post_branch_name'] ?? null
]; ];
} }
@ -6964,9 +7094,12 @@ class ClientController extends AdminController
'hr_name' => $hr['hr_name'] ?? null, 'hr_name' => $hr['hr_name'] ?? null,
'hr_mobile' => $hr['hr_mobile'] ?? null, 'hr_mobile' => $hr['hr_mobile'] ?? null,
'hr_mail' => $hr['hr_mail'] ?? null, 'hr_mail' => $hr['hr_mail'] ?? null,
'pre_branch_id' => $hr['pre_branch_id'] ?? null,
'post_branch_id' => $hr['post_branch_id'] ?? null ,
'post_branch_name' => $hr['post_branch_name'] ?? null ,
'pre_client_id' => $pre_client_id ?? null
]; ];
} }
} else { } else {
// First create a map of HR data by post_hr_id for quick lookup // First create a map of HR data by post_hr_id for quick lookup
$hrMap = []; $hrMap = [];
@ -7000,7 +7133,11 @@ class ClientController extends AdminController
'allowed_cd' => json_decode($access['allowed_cd'], true) ?? [], 'allowed_cd' => json_decode($access['allowed_cd'], true) ?? [],
'hr_name' => $hr['hr_name'], 'hr_name' => $hr['hr_name'],
'hr_mobile' => $hr['hr_mobile'], 'hr_mobile' => $hr['hr_mobile'],
'hr_mail' => $hr['hr_mail'] 'hr_mail' => $hr['hr_mail'],
'pre_branch_id' => $hr['pre_branch_id'] ?? null,
'post_branch_id' => $hr['post_branch_id'] ?? null ,
'post_branch_name' => $hr['post_branch_name'] ?? null ,
'pre_client_id' => $pre_client_id ?? null
]; ];
// Remove from map so we know it's been processed // Remove from map so we know it's been processed
@ -7025,6 +7162,10 @@ class ClientController extends AdminController
'hr_name' => $hr['hr_name'] ?? null, 'hr_name' => $hr['hr_name'] ?? null,
'hr_mobile' => $hr['hr_mobile'] ?? null, 'hr_mobile' => $hr['hr_mobile'] ?? null,
'hr_mail' => $hr['hr_mail'] ?? null, 'hr_mail' => $hr['hr_mail'] ?? null,
'pre_branch_id' => $hr['pre_branch_id'] ?? null,
'post_branch_id' => $hr['post_branch_id'] ?? null ,
'post_branch_name' => $hr['post_branch_name'] ?? null ,
'pre_client_id' => $pre_client_id ?? null
]; ];
} }
} }
@ -7034,8 +7175,6 @@ class ClientController extends AdminController
$resultData['pre_policy_data'] = $data['pre_policy_data']; $resultData['pre_policy_data'] = $data['pre_policy_data'];
$resultData['post_policy_data'] = $data['post_policy_data']; $resultData['post_policy_data'] = $data['post_policy_data'];
$resultData['post_cd_data'] = $data['post_cd_data']; $resultData['post_cd_data'] = $data['post_cd_data'];
// echo '**********************************************';
// print_rr($resultData);die();
return $resultData; return $resultData;
} }
@ -7076,8 +7215,23 @@ class ClientController extends AdminController
$post = array_values(array_filter($allowed_modules, fn($v) => $v !== 1)); $post = array_values(array_filter($allowed_modules, fn($v) => $v !== 1));
$value['allowed_modules'] = json_encode(['pre' => $pre, 'post' => $post]); $value['allowed_modules'] = json_encode(['pre' => $pre, 'post' => $post]);
$post_client_id = $value['post_client_id'];
$post_branch_id = $value['post_branch_id'];
$post_hr_id = $value['post_hr_id'];
$preBranchId = $this->getPreBranchIdByPostBranchId($post_branch_id);
if (!empty($preBranchId)) {
$value['pre_branch_id'] = $preBranchId;
$value['pre_client_id'] = $this->getPreClientIdByPreBranchId($preBranchId);
$value["pre_hr_id"] = $this->getPreHrIdByPreBranchId($preBranchId);
}
// INSERT or UPDATE // INSERT or UPDATE
if (empty($value['pk']) || (int)$value['pk'] === 0) { if (empty($value['pk']) || (int)$value['pk'] === 0) {
unset($value['pk']); // Prevent insert error unset($value['pk']); // Prevent insert error
$insertedId = $this->HRAccessControlModel->insert($value); $insertedId = $this->HRAccessControlModel->insert($value);
if ($insertedId === false) { if ($insertedId === false) {
@ -7086,6 +7240,7 @@ class ClientController extends AdminController
$success[] = "Inserted row at index {$index} with ID {$insertedId}."; $success[] = "Inserted row at index {$index} with ID {$insertedId}.";
} else { } else {
$update = $this->HRAccessControlModel->update($value['pk'], $value); $update = $this->HRAccessControlModel->update($value['pk'], $value);
if ($update === false) { if ($update === false) {
throw new \Exception('Update failed for ID ' . $value['pk'] . ': ' . json_encode($this->HRAccessControlModel->errors())); throw new \Exception('Update failed for ID ' . $value['pk'] . ': ' . json_encode($this->HRAccessControlModel->errors()));
} }
@ -7119,7 +7274,6 @@ class ClientController extends AdminController
'details' => $success, 'details' => $success,
'data' => $html, 'data' => $html,
], 200); ], 200);
} else { } else {
return $this->respond([ return $this->respond([
'status' => false, 'status' => false,
@ -7140,6 +7294,28 @@ class ClientController extends AdminController
} }
} }
private function getPreClientIdByPreBranchId($pre_branch_id){
$db2 = \Config\Database::connect('preDB');
$pre_client_id = $db2->table('client_branch')->where('id',$pre_branch_id)->where('is_Active',1)->get()->getResultArray()[0]['client_id']??"";
return $pre_client_id;
}
private function getPreHrIdByPreBranchId($pre_branch_id){
$db2 = \Config\Database::connect('preDB');
$pre_hr_id = $db2->table('client_branch cb')
->select('lc.id')
->join('level_contacts lc','lc.ref_id = cb.id')
->where('cb.id',$pre_branch_id)->where('cb.is_Active',1)->where('lc.is_Active',1)->get()->getResultArray()[0]['id']??"";
return $pre_hr_id;
}
private function getPreBranchIdByPostBranchId($post_branch_id){
$db = \Config\Database::connect();
$pre_branch_id = $db->table('client_branch')->where('id',$post_branch_id)->where('is_Active',1)->get()->getResultArray()[0]['pre_branch_id']??"";
return $pre_branch_id;
}
// ------------------- DEMO CLIENT FUNCTION -------------------------------------------------------------------------------- // ------------------- DEMO CLIENT FUNCTION --------------------------------------------------------------------------------
public function wipeDemoClient() public function wipeDemoClient()
@ -7457,6 +7633,104 @@ class ClientController extends AdminController
return $this->respond(['status' => true, 'message' => 'Demo client data wiped successfully'], 200); return $this->respond(['status' => true, 'message' => 'Demo client data wiped successfully'], 200);
} }
private function getClientlistFromPre (){
$db2 = \Config\Database::connect('preDB');
$auto_fetch_client_list = $db2->table('clients')
->select('id,client_name')
->where('is_active',1)
->get()->getResultArray()??[];
return $auto_fetch_client_list;
}
public function auto_fetch_branch(){
$data = $this->request->getPost();
$db2 = \Config\Database::connect('preDB');
$auto_fetch_branch_list = $db2->table('client_branch')
->select('id,branch_name')
->where('client_id',$data['client_id'])
->where('is_active',1)
->get()->getResultArray()??[];
return
empty($auto_fetch_branch_list)
? $this->response->setJSON([
'status' => false,
'message' => 'branch list is empty',
'data' => []
])->setStatusCode(400)
: $this->response->setJSON([
'status' => true,
'message' => 'branch list is found' ,
'data' => $auto_fetch_branch_list
])->setStatusCode(200);
}
public function auto_fetch_branch_details(){
$data = $this->request->getPost();
$db2 = \Config\Database::connect('preDB');
$auto_fetch_branch_details = $db2->table('client_branch')
->where('client_id',$data['client_id'])
->where('id',$data['branch_id'])
->where('is_active',1)
->get()->getResultArray()??[];
return empty($auto_fetch_branch_details)
? $this->response->setJSON([
'status' => false,
'message' => 'branch details is empty',
'data' => []
])->setStatusCode(400)
: $this->response->setJSON([
'status' => true,
'message' => 'branch details found' ,
'data' => $auto_fetch_branch_details
])->setStatusCode(200);
} }
private function updatePreClientBranch($pre_branch_id,$post_branch_id ,$operation)
{
$preDB = \Config\Database::connect('preDB');
if($operation != 'create'){
$builder = $preDB->table('client_branch');
$builder->where('post_branch_id', $post_branch_id);
$builder->update(['post_branch_id' => null]);
}
$builder = $preDB->table('client_branch');
$builder->where('id', $pre_branch_id);
$builder->update(['post_branch_id' => $post_branch_id]);
return true;
}
}

View File

@ -259,7 +259,7 @@ class DashboardController extends AdminController
// dd(get_role_id(),user_team()); // dd(get_role_id(),user_team());
// dd($data); // dd($data);
$data['tab_name'] = 'Dashboard';
$data['page_name'] = 'Dashboard'; $data['page_name'] = 'Dashboard';
echo view('layout/header', $data); echo view('layout/header', $data);

View File

@ -135,6 +135,9 @@ class EmployeeController extends AdminController
// dd($this->request->getGet()); // dd($this->request->getGet());
$this->myLogger->logme('error', 'list called'); $this->myLogger->logme('error', 'list called');
$data['page_name'] = "Members";
$this->loadLayout('employee_list', $data); $this->loadLayout('employee_list', $data);
} }
@ -307,6 +310,7 @@ class EmployeeController extends AdminController
return $this->respond(['dataStatus' => true, 'code' => 200, 'data' => 'file upload success'], 200); return $this->respond(['dataStatus' => true, 'code' => 200, 'data' => 'file upload success'], 200);
} }
$data['tab_name'] = 'View Inception';
$data['page_name'] = 'View Inception'; $data['page_name'] = 'View Inception';
//for TPA/insurer upload //for TPA/insurer upload
@ -786,6 +790,9 @@ class EmployeeController extends AdminController
} }
$this->myLogger->logme('error', 'list called'); $this->myLogger->logme('error', 'list called');
$data['page_name'] = "Endorsement";
$this->loadLayout('endorsement_list', $data); $this->loadLayout('endorsement_list', $data);
} }
@ -830,6 +837,9 @@ class EmployeeController extends AdminController
// dd($data); // dd($data);
$this->myLogger->logme('error', 'list called'); $this->myLogger->logme('error', 'list called');
$data['page_name'] = "Enrollment";
return $this->loadLayout('enrollment_list', $data); return $this->loadLayout('enrollment_list', $data);
} }
@ -3039,6 +3049,8 @@ class EmployeeController extends AdminController
// print_r($data); die; // print_r($data); die;
// } // }
$data['page_name'] = "Retail Endorsement";
$this->loadLayout('retail_endorsement_list', $data); $this->loadLayout('retail_endorsement_list', $data);
} }

View File

@ -2868,14 +2868,14 @@ class EmployeeRestController extends AdminController
}else if($ClientPolicyValue['policy_type_id'] == 6) }else if($ClientPolicyValue['policy_type_id'] == 6)
{ {
$policyGroup = 'gpa'; $policyGroup = 'other';
$data['ticket_type_id'] = 3; $data['ticket_type_id'] = 3;
$data['claim_subject'] = "Claim EDLI"; $data['claim_subject'] = "Claim EDLI";
$data['sum_insured_label'] = "Sum Assured"; $data['sum_insured_label'] = "Sum Assured";
}else if($ClientPolicyValue['policy_type_id'] == 7) }else if($ClientPolicyValue['policy_type_id'] == 7)
{ {
$policyGroup = 'gpa'; $policyGroup = 'other';
$data['ticket_type_id'] = 4; $data['ticket_type_id'] = 4;
$data['claim_subject'] = "Claim GTLI"; $data['claim_subject'] = "Claim GTLI";
$data['sum_insured_label'] = "Sum Assured"; $data['sum_insured_label'] = "Sum Assured";
@ -2969,9 +2969,6 @@ class EmployeeRestController extends AdminController
function policyTermsFiter($terms , $type) function policyTermsFiter($terms , $type)
{ {
$gpa = [ $gpa = [
"sumInsured2" => "Sum Insured", "sumInsured2" => "Sum Insured",
"totalSumInsured" => "Total Sum Assured", "totalSumInsured" => "Total Sum Assured",
@ -3021,8 +3018,6 @@ class EmployeeRestController extends AdminController
"moderntreatmentsasperirdai" => "Modern Treatment " "moderntreatmentsasperirdai" => "Modern Treatment "
]; ];
$finalarray = []; $finalarray = [];
if($type == 'gpa'){ if($type == 'gpa'){
foreach ($gpa as $key => $value) { foreach ($gpa as $key => $value) {
@ -3046,6 +3041,18 @@ class EmployeeRestController extends AdminController
$finalarray[$terms->gpa_special_condition_label[$i]] = $terms->gpa_special_condition_input[$i]; $finalarray[$terms->gpa_special_condition_label[$i]] = $terms->gpa_special_condition_input[$i];
} }
} }
}else if($type == 'other'){
foreach ($terms as $key => $value) {
if($key != "multiple_sum_insured" && $value != ""){
$result = ucwords(str_replace('_', ' ', $key));
$finalarray[$result] = $value;
}
}
if(isset(($terms->gpa_special_condition_label)) && is_array($terms->gpa_special_condition_label) && is_array($terms->gpa_special_condition_input)){
for ($i=0; $i < count($terms->gpa_special_condition_label); $i++) {
$finalarray[$terms->gpa_special_condition_label[$i]] = $terms->gpa_special_condition_input[$i];
}
}
}else{ }else{
foreach ($gmc as $key => $value) { foreach ($gmc as $key => $value) {
if(isset($terms->$key)) if(isset($terms->$key))
@ -3070,9 +3077,7 @@ class EmployeeRestController extends AdminController
} }
} }
return $finalarray; return $finalarray;
} }

View File

@ -67,24 +67,57 @@ class ICICILombardController extends AdminController
//Prepare body data //Prepare body data
$db = \Config\Database::connect(); // $db = \Config\Database::connect();
$data = $db->table('employee_polices ep') // $data = $db->table('employee_polices ep')
->select('cp.policy_no as policyNumber, cp.cd_ac_no as CDBGAccountNumber, // ->select('cp.policy_no as policyNumber, cp.cd_ac_no as CDBGAccountNumber,
e.id,e.emp_code as MemberEmpId, e.doj as DOJ, e.name as InsuredName, e.dob as DOB, e.relationship as Relationship, // e.id,e.emp_code as MemberEmpId, e.doj as DOJ, e.name as InsuredName, e.dob as DOB, e.relationship as Relationship,
e.gender as Gender, ep.date_coverage as DOC,ep.basic_cover_si as SumInsured, e.email_corporate as EmailId // e.gender as Gender, ep.date_coverage as DOC,ep.basic_cover_si as SumInsured, e.email_corporate as EmailId
') // ')
->join('employees e', 'e.id = ep.employee_id') // ->join('employees e', 'e.id = ep.employee_id')
->join('client_policy cp', 'ep.client_policy_id = cp.id') // ->join('client_policy cp', 'ep.client_policy_id = cp.id')
->where('ep.client_policy_id', $policy_id) // ->where('ep.client_policy_id', $policy_id)
->where('ep.status', 'active') // ->where('ep.status', 'active')
->where('ep.is_active', 1) // ->where('ep.is_active', 1)
// ->where('ep.uhid', null) // // ->where('ep.uhid', null)
->get() // ->get()
->getResultArray(); // ->getResultArray();
$body = $this->formatPolicyData($data); // $body = $this->formatPolicyData($data);
// dd($body); // dd($body);
$body = [
"PolicyNumber" => "4016/A/O/53130557/00/000",
"CDBGAccountNumber" => "CD-MUM-0026",
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440010",
"MemberDetails" => [
[
"MemberEmpId" => "EMPID3625557",
"DOJ" => "21-MAR-2019",
"InsuredName" => "Kumar",
"DOB" => "7-JUL-1983",
"Relationship" => "SELF",
"Gender" => "MALE",
"DOC" => "05-SEP-2025",
"SumInsured" => "400000",
"EmailId" => "KUMAR@GMAIL.COM",
"FlagStatus" => "A"
],
[
"MemberEmpId" => "EMPID3625557",
"DOJ" => "21-MAR-2019",
"InsuredName" => "Saranya",
"DOB" => "8-AUG-1970",
"Relationship" => "MOTHER",
"Gender" => "FEMALE",
"DOC" => "05-SEP-2025",
"SumInsured" => "400000",
"EmailId" => "Saranya@GMAIL.COM",
"FlagStatus" => "A"
],
]
];
$response = call_third_party_api($url, 'POST', $headers, $body, true); // true = raw body mode $response = call_third_party_api($url, 'POST', $headers, $body, true); // true = raw body mode
// print_rr(json_encode($response));die(); // print_rr(json_encode($response));die();
return $this->response->setJSON($response); return $this->response->setJSON($response);
@ -115,9 +148,9 @@ class ICICILombardController extends AdminController
// dd($headers); // dd($headers);
$body = [ $body = [
"PolicyNumber" => "4016/A/O/53077718/00/000", "PolicyNumber" => "4016/A/O/53130557/00/000",
"BatchId" => "3646145", "BatchId" => "3658147",
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440001" "CorrelationId" => "550e8400-e29b-41d4-a716-446655440010"
]; ];
$response = call_third_party_api($url, 'POST', $headers, $body, true); $response = call_third_party_api($url, 'POST', $headers, $body, true);

View File

@ -167,6 +167,10 @@ class JobWorker extends AdminController
'type' => 'CC', // Handler Category 'type' => 'CC', // Handler Category
'handler' => 'App\Controllers\EmployeeMultiEventServiceController', 'handler' => 'App\Controllers\EmployeeMultiEventServiceController',
], ],
'memberDataListExcelFileFormatValidation' => [
'type' => 'CC', // Handler Category
'handler' => 'App\Controllers\LeadsController',
],
]; ];

File diff suppressed because it is too large Load Diff

View File

@ -107,7 +107,8 @@ class MasterController extends AdminController
public function insurerList() public function insurerList()
{ {
$this->myLogger->logme('error','Insurer list function called'); $this->myLogger->logme('error','Insurer list function called');
$headerData['page_name'] = 'Insurer List'; $headerData['tab_name'] = 'Insurer List';
$headerData['page_name'] = 'Insurers';
$data['insurerList'] = $this->insurerModel->where('is_active',1)->findAll(); $data['insurerList'] = $this->insurerModel->where('is_active',1)->findAll();
$data['insurer_rm'] = $this->insurerRMModel->getAllClientRM(); $data['insurer_rm'] = $this->insurerRMModel->getAllClientRM();
// echo '<pre>'; // echo '<pre>';
@ -154,7 +155,8 @@ class MasterController extends AdminController
{ {
$this->myLogger->logme('error','Edit Insurer Onboarding function called'); $this->myLogger->logme('error','Edit Insurer Onboarding function called');
$headerData['page_name'] = 'Edit Insurer Master'; $headerData['tab_name'] = 'Edit Insurer Master';
$headerData['page_name'] = 'Insurers';
$types = array( $types = array(
(object) array('id' => 'pvt', 'name' => 'PVT'), (object) array('id' => 'pvt', 'name' => 'PVT'),
@ -245,7 +247,8 @@ class MasterController extends AdminController
{ {
$this->myLogger->logme('error','Insurer Onboarding function called'); $this->myLogger->logme('error','Insurer Onboarding function called');
$headerData['page_name'] = 'Insurer Master'; $headerData['tab_name'] = 'Insurer Master';
$headerData['page_name'] = 'Insurers';
$types = array( $types = array(
(object) array('id' => 'pvt', 'name' => 'PVT'), (object) array('id' => 'pvt', 'name' => 'PVT'),
@ -504,7 +507,8 @@ class MasterController extends AdminController
public function tpaList() public function tpaList()
{ {
$this->myLogger->logme('error','TPA list function called'); $this->myLogger->logme('error','TPA list function called');
$headerData['page_name'] = 'TPA List'; $headerData['tab_name'] = 'TPA List';
$headerData['page_name'] = 'TPA';
$data['tpaList'] = $this->tpaModel->where('is_active',1)->findAll(); $data['tpaList'] = $this->tpaModel->where('is_active',1)->findAll();
// $data['insurer_rm'] = $this->insurerRMModel->getAllClientRM(); // $data['insurer_rm'] = $this->insurerRMModel->getAllClientRM();
// echo '<pre>'; // echo '<pre>';
@ -550,7 +554,8 @@ class MasterController extends AdminController
{ {
$this->myLogger->logme('error','TPA Onboarding function called'); $this->myLogger->logme('error','TPA Onboarding function called');
$headerData['page_name'] = 'TPA Master'; $headerData['tab_name'] = 'TPA Master';
$headerData['page_name'] = 'TPA';
// print_r($data['types']);die(); // print_r($data['types']);die();
@ -664,7 +669,8 @@ class MasterController extends AdminController
{ {
$this->myLogger->logme('error','Edit TPA Onboarding function called'); $this->myLogger->logme('error','Edit TPA Onboarding function called');
$headerData['page_name'] = 'Edit TPA Master'; $headerData['tab_name'] = 'Edit TPA Master';
$headerData['page_name'] = 'TPA';
$tpa_data = $this->tpaModel->where(['id' => $id, 'is_active' => 1])->first(); $tpa_data = $this->tpaModel->where(['id' => $id, 'is_active' => 1])->first();
@ -833,7 +839,8 @@ class MasterController extends AdminController
public function kycList() public function kycList()
{ {
$this->myLogger->logme('error','KYC list function called'); $this->myLogger->logme('error','KYC list function called');
$headerData['page_name'] = 'KYC List'; $headerData['tab_name'] = 'KYC List';
$headerData['page_name'] = 'KYC';
$data['kycList'] = $this->kycEntityTypeModel->where('is_active',1)->findAll(); $data['kycList'] = $this->kycEntityTypeModel->where('is_active',1)->findAll();
// $data['insurer_rm'] = $this->insurerRMModel->getAllClientRM(); // $data['insurer_rm'] = $this->insurerRMModel->getAllClientRM();
// echo '<pre>'; // echo '<pre>';
@ -879,7 +886,8 @@ class MasterController extends AdminController
{ {
$this->myLogger->logme('error','KYC Onboarding function called'); $this->myLogger->logme('error','KYC Onboarding function called');
$headerData['page_name'] = 'KYC Master'; $headerData['tab_name'] = 'KYC Master';
$headerData['page_name'] = 'KYC';
// print_r($data['types']);die(); // print_r($data['types']);die();
@ -944,7 +952,8 @@ class MasterController extends AdminController
{ {
$this->myLogger->logme('error','Edit KYC Onboarding function called'); $this->myLogger->logme('error','Edit KYC Onboarding function called');
$headerData['page_name'] = 'Edit KYC Master'; $headerData['tab_name'] = 'Edit KYC Master';
$headerData['page_name'] = 'KYC';
$editData['kyc'] = $this->kycEntityTypeModel->where(['id' => $id, 'is_active' => 1])->first(); $editData['kyc'] = $this->kycEntityTypeModel->where(['id' => $id, 'is_active' => 1])->first();
$editData['kyc_docs'] = $this->kycDocsModel->where(['kyc_type_id' => $id, 'is_active' => 1])->findAll(); $editData['kyc_docs'] = $this->kycDocsModel->where(['kyc_type_id' => $id, 'is_active' => 1])->findAll();
@ -1022,7 +1031,8 @@ class MasterController extends AdminController
public function policyTypeList() public function policyTypeList()
{ {
$this->myLogger->logme('error','Policy Type list function called'); $this->myLogger->logme('error','Policy Type list function called');
$headerData['page_name'] = 'Policy Type List'; $headerData['tab_name'] = 'Policy Type List';
$headerData['page_name'] = 'Policy Type';
$data['policyList'] = $this->policyTypeModel->where('is_active',1)->findAll(); $data['policyList'] = $this->policyTypeModel->where('is_active',1)->findAll();
// $data['insurer_rm'] = $this->insurerRMModel->getAllClientRM(); // $data['insurer_rm'] = $this->insurerRMModel->getAllClientRM();
// echo '<pre>'; // echo '<pre>';
@ -1068,7 +1078,8 @@ class MasterController extends AdminController
{ {
$this->myLogger->logme('error','Policy Type Onboarding function called'); $this->myLogger->logme('error','Policy Type Onboarding function called');
$headerData['page_name'] = 'Policy Type Master'; $headerData['tab_name'] = 'Policy Type Master';
$headerData['page_name'] = 'Policy Type';
// print_r($data['types']);die(); // print_r($data['types']);die();
@ -1130,7 +1141,8 @@ class MasterController extends AdminController
{ {
$this->myLogger->logme('error','Edit KYC Onboarding function called'); $this->myLogger->logme('error','Edit KYC Onboarding function called');
$headerData['page_name'] = 'Edit Policy Type'; $headerData['tab_name'] = 'Edit Policy Type';
$headerData['page_name'] = 'Policy Type';
$editData['policytype'] = $this->policyTypeModel->where(['id' => $id, 'is_active' => 1])->first(); $editData['policytype'] = $this->policyTypeModel->where(['id' => $id, 'is_active' => 1])->first();
$editData['policies'] = $this->policesModel->select('policies.*, insurers.name as insurer_name') $editData['policies'] = $this->policesModel->select('policies.*, insurers.name as insurer_name')
@ -1222,7 +1234,8 @@ class MasterController extends AdminController
//start CD Master list //start CD Master list
public function CDMasterList() public function CDMasterList()
{ {
$data['page_name'] = 'CD Master List'; $data['tab_name'] = 'CD Master List';
$data['page_name'] = 'CD Master';
$data['CD_Master_Data'] = $this->CDMasterModel->getCDMasterList(); $data['CD_Master_Data'] = $this->CDMasterModel->getCDMasterList();
$data['insurers'] = $this->insurerModel->where('is_active', 1)->findAll(); $data['insurers'] = $this->insurerModel->where('is_active', 1)->findAll();
$data['insurer_branch'] = $this->insurerBranchModel->where('is_active', 1)->findAll(); $data['insurer_branch'] = $this->insurerBranchModel->where('is_active', 1)->findAll();
@ -1605,8 +1618,8 @@ class MasterController extends AdminController
//Vehicle Master data Function //Vehicle Master data Function
public function VehicleMasterList() public function VehicleMasterList()
{ { $data['tab_name'] = 'Vehicle Master';
$data['page_name'] = 'Vehicle Master List'; $data['page_name'] = 'Vehicles';
$data['vehicle_type'] = [ $data['vehicle_type'] = [
'two_wheeler' => 'Two Wheeler', 'two_wheeler' => 'Two Wheeler',
'four_wheeler' => 'Four Wheeler', 'four_wheeler' => 'Four Wheeler',

View File

@ -114,6 +114,7 @@ class PolicyTransactionController extends BaseController
// Policy Transaction Inception // Policy Transaction Inception
public function viewInception() public function viewInception()
{ {
$data['tab_name'] = 'Policy';
$data['page_name'] = 'Policy'; $data['page_name'] = 'Policy';
// Static arrays for dropdowns // Static arrays for dropdowns
@ -1075,6 +1076,7 @@ class PolicyTransactionController extends BaseController
// echo '<pre>'; // echo '<pre>';
// !dd($this->getEndorsementDataForEdit(17)); // !dd($this->getEndorsementDataForEdit(17));
$data['tab_name'] = 'Endorsement';
$data['page_name'] = 'Endorsement'; $data['page_name'] = 'Endorsement';
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance']; $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
$data['issuer_branch'] = $this->nhanceBranchModel->where('is_active', 1)->findAll(); $data['issuer_branch'] = $this->nhanceBranchModel->where('is_active', 1)->findAll();
@ -1241,7 +1243,8 @@ class PolicyTransactionController extends BaseController
$issue_type = $this->policyTransactionModel $issue_type = $this->policyTransactionModel
->where('action_type', 'inception') ->where('action_type', 'inception')
->where('client_id', $this->request->getPost('client_id')) ->where('client_id', $this->request->getPost('client_id'))
->where('client_policy_id', $this->request->getPost('client_policy_id')) // ->where('client_policy_id', $this->request->getPost('client_policy_id'))
->where('id', $this->request->getPost('client_policy_id'))
->where('policy_transaction.is_active', 1) ->where('policy_transaction.is_active', 1)
->first(); ->first();
@ -1770,7 +1773,7 @@ class PolicyTransactionController extends BaseController
//get BDS Reports data old function //get BDS Reports data old function
public function reportBDSOld() public function reportBDSOld()
{ {
$data['tab_name'] = 'BDS Report';
$data['page_name'] = 'BDS Report'; $data['page_name'] = 'BDS Report';
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance']; $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
@ -1832,6 +1835,7 @@ class PolicyTransactionController extends BaseController
public function reportBDS() public function reportBDS()
{ {
$data['tab_name'] = 'BDS Report';
$data['page_name'] = 'BDS Report'; $data['page_name'] = 'BDS Report';
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance']; $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
@ -1925,6 +1929,7 @@ class PolicyTransactionController extends BaseController
public function reportVarience() public function reportVarience()
{ {
$data['tab_name'] = 'Variance Report';
$data['page_name'] = 'Variance Report'; $data['page_name'] = 'Variance Report';
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance']; $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
@ -1974,6 +1979,7 @@ class PolicyTransactionController extends BaseController
public function reportBusinessList() public function reportBusinessList()
{ {
$data['tab_name'] = 'Business Report';
$data['page_name'] = 'Business Report'; $data['page_name'] = 'Business Report';
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance']; $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
@ -2014,6 +2020,7 @@ class PolicyTransactionController extends BaseController
public function reportFinanceList() public function reportFinanceList()
{ {
$data['tab_name'] = 'Finance Report';
$data['page_name'] = 'Finance Report'; $data['page_name'] = 'Finance Report';
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance']; $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
@ -2054,6 +2061,7 @@ class PolicyTransactionController extends BaseController
public function reportOutstanding() public function reportOutstanding()
{ {
$data['tab_name'] = 'Outstanding Report';
$data['page_name'] = 'Outstanding Report'; $data['page_name'] = 'Outstanding Report';
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance']; $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
@ -2132,6 +2140,7 @@ class PolicyTransactionController extends BaseController
->findAll(); ->findAll();
// dd( $this->insurerStatements->getLastQuery()); // dd( $this->insurerStatements->getLastQuery());
$data['tab_name'] = 'Statement Upload';
$data['page_name'] = 'Statement Upload'; $data['page_name'] = 'Statement Upload';
$this->loadLayout('insurer_statement_list', $data); $this->loadLayout('insurer_statement_list', $data);
@ -2709,8 +2718,8 @@ class PolicyTransactionController extends BaseController
$data['files'] = array_merge($pt_files, $kyc_files, $batch_files, $files); $data['files'] = array_merge($pt_files, $kyc_files, $batch_files, $files);
// dd($data['files']); // dd($data['files']);
} }
$data['tab_name'] = 'Documents Search';
$data['page_name'] = 'Documents Search'; $data['page_name'] = 'Documents';
$data['customers'] = $this->clientModel->select('id,client_name,short_name as display_value')->where('is_active', 1)->get()->getResultarray(); $data['customers'] = $this->clientModel->select('id,client_name,short_name as display_value')->where('is_active', 1)->get()->getResultarray();
$data['policies'] = $this->clientPolicyModel->select("client_policy.id,client_policy.policy_no,policy_type.policy_type,concat(policy_type.policy_type,' - ',client_policy.policy_no) as display_value") $data['policies'] = $this->clientPolicyModel->select("client_policy.id,client_policy.policy_no,policy_type.policy_type,concat(policy_type.policy_type,' - ',client_policy.policy_no) as display_value")
@ -3054,9 +3063,28 @@ class PolicyTransactionController extends BaseController
$clientIds = array_column($clients, 'id'); $clientIds = array_column($clients, 'id');
$policies = $this->clientPolicyModel // $policies = $this->clientPolicyModel
// ->select("
// client_policy.*,
// policy_type.policy_type,
// policy_type.ebp,
// policy_type.etp,
// policy_type.iep,
// policy_type.itp,
// policy_type.bap,
// policy_type.allocg,
// DATE_FORMAT(client_policy.policy_start_date, '%d/%m/%Y') as policy_start_date,
// DATE_FORMAT(client_policy.policy_end_date, '%d/%m/%Y') as policy_end_date
// ")
// ->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
// ->join('policy_transaction pt', 'pt.client_policy_id = client_policy.id and pt.action_type = "inception" and pt.is_active = 1 and pt.client_policy_id is not null')
// ->whereIn('client_policy.client_id', $clientIds)
// ->where('client_policy.is_active', 1)
// ->findAll();
$policies = $this->policyTransactionModel
->select(" ->select("
client_policy.*, policy_transaction.*,
policy_type.policy_type, policy_type.policy_type,
policy_type.ebp, policy_type.ebp,
policy_type.etp, policy_type.etp,
@ -3064,13 +3092,13 @@ class PolicyTransactionController extends BaseController
policy_type.itp, policy_type.itp,
policy_type.bap, policy_type.bap,
policy_type.allocg, policy_type.allocg,
DATE_FORMAT(client_policy.policy_start_date, '%d/%m/%Y') as policy_start_date, DATE_FORMAT(policy_transaction.policy_start_date, '%d/%m/%Y') as policy_start_date,
DATE_FORMAT(client_policy.policy_end_date, '%d/%m/%Y') as policy_end_date DATE_FORMAT(policy_transaction.policy_end_date, '%d/%m/%Y') as policy_end_date
") ")
->join('policy_type', 'policy_type.id = client_policy.policy_type_id') ->join('policy_type', 'policy_type.id = policy_transaction.policy_type_id')
->join('policy_transaction pt', 'pt.client_policy_id = client_policy.id and pt.action_type = "inception" and pt.is_active = 1 and pt.client_policy_id is not null') ->whereIn('policy_transaction.client_id', $clientIds)
->whereIn('client_policy.client_id', $clientIds) ->where('policy_transaction.is_active', 1)
->where('client_policy.is_active', 1) ->where('policy_transaction.action_type', "inception")
->findAll(); ->findAll();
foreach ($policies as $policy) { foreach ($policies as $policy) {

View File

@ -79,10 +79,6 @@ class RestAuthenticationController extends AdminController
public function verifyEmployeeWithMobileNumber() public function verifyEmployeeWithMobileNumber()
{ {
log_message('error', ' '); log_message('error', ' ');
@ -93,6 +89,7 @@ class RestAuthenticationController extends AdminController
try { try {
$mobile_number = $this->request->getJSON()->mobile_number; $mobile_number = $this->request->getJSON()->mobile_number;
$otp = $this->request->getJSON()->otp;
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Received mobile_number = " . $mobile_number); $this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Received mobile_number = " . $mobile_number);
@ -112,12 +109,49 @@ class RestAuthenticationController extends AdminController
if (isset($employeeData['employee_id'])) if (isset($employeeData['employee_id']))
{ {
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Employee found: employee_id = " . $employeeData['employee_id']); $this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Employee verified with ID = " . $employeeData['employee_id']);
log_message('error', ' ');
log_message('error', ' ************************************* POST END **************************************** ');
log_message('error', ' '); log_message('error', ' ');
log_message('error', '************************ POST END ********************************');
$sql = "
UPDATE employees
INNER JOIN employee_polices ON employee_polices.employee_id = employees.id
SET employees.otp = ?
WHERE employees.id = ?
AND employees.relationship = 'self'
AND employees.is_active = 1
AND employee_polices.is_active = 1
AND employee_polices.status IN ('active')
";
$db = db_connect();
$update = $db->query($sql, [$otp, $employeeData['employee_id']]);
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: OTP update query executed. SQL = " . $db->getLastQuery());
if($update)
{
//send sms
$SMSResult = sendOtpSms($mobile_number, $otp);
if ($SMSResult['status'] == 'success')
{
$result = ['user_verification' => true ,'message' => "Verified Successfully" ]; $result = ['user_verification' => true ,'message' => "Verified Successfully" ];
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200); return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
}else{
$result = ['user_verification' => false, 'message' => "SMS sending failed , try again"];
return $this->respond(['status' => 'failed', 'code' => 404, 'data' => $result], 200);
}
}else{
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: OTP update query Failed. SQL = " . $db->getLastQuery());
$result = ['user_verification' => false, 'message' => "Try again. , try again"];
return $this->respond(['status' => 'failed', 'code' => 404, 'data' => $result], 200);
}
} else { } else {
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: No matching employee found"); $this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: No matching employee found");
log_message('error', ' '); log_message('error', ' ');
@ -148,6 +182,7 @@ class RestAuthenticationController extends AdminController
try { try {
$email = $this->request->getJSON()->email; $email = $this->request->getJSON()->email;
$otp = $this->request->getJSON()->otp;
$client_id = $this->request->getJSON()->client_id ?? null; $client_id = $this->request->getJSON()->client_id ?? null;
@ -181,11 +216,6 @@ class RestAuthenticationController extends AdminController
if (isset($employeeData['employee_id'])) { if (isset($employeeData['employee_id'])) {
$otp = random_int(100000, 999999);
// $update = $this->employeeModel->where('email_corporate', $email)->where('relationship', 'Self')
// ->where('is_active', 1)->set(array('otp' => $otp))
// ->update();
$builder = $this->employeeModel $builder = $this->employeeModel
->where('email_corporate', $email) ->where('email_corporate', $email)
@ -265,24 +295,23 @@ class RestAuthenticationController extends AdminController
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateEmpOTP: Received payload = " . json_encode($this->request->getJSON() ?? [])); $this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateEmpOTP: Received payload = " . json_encode($this->request->getJSON() ?? []));
$email = $this->request->getJSON()->email; $email = $this->request->getJSON()->email ?? null;
$mobile_number = $this->request->getJSON()->mobile_number ?? null;
$otp = $this->request->getJSON()->otp; $otp = $this->request->getJSON()->otp;
$client_id = $this->request->getJSON()->client_id ?? null; $client_id = $this->request->getJSON()->client_id ?? null;
$employee_id = $this->request->getJSON()->employee_id ?? null; $employee_id = $this->request->getJSON()->employee_id ?? null;
$builder = $this->employeeModel $builder = $this->employeeModel
->where('email_corporate', $email)
->where('relationship', 'Self') ->where('relationship', 'Self')
->where('is_active', 1); ->where('is_active', 1);
// $builder = $this->employeeModel if (!empty($email)) {
// ->join('employee_polices EP', 'EP.employee_id = employees.id', 'inner') $builder->where('email_corporate', $email);
// ->where('employees.email_corporate', $email) }
// ->where('employees.relationship', 'Self')
// ->where('employees.is_active', 1) if (!empty($mobile_number)) {
// ->whereIn('employees.emp_status', ['active', 'expired']) $builder->where('mobile', $mobile_number);
// ->where('EP.is_active', 1) }
// ->whereIn('EP.status', ['active', 'expired']);
if (!empty($client_id)) { if (!empty($client_id)) {
@ -306,57 +335,6 @@ class RestAuthenticationController extends AdminController
} }
// public function updateEmpMPIN()
// {
// $requestData = $this->request->getJSON();
// print_r($requestData); die;
// $mobile_number = $requestData->mobile_number ?? null;
// $email_id = $requestData->email_id ?? null;
// $new_mpin = $requestData->new_mpin ?? $requestData->mpin ?? null;
// $old_mpin = $requestData->old_mpin ?? null;
// $is_mpin_skipped = $requestData->is_mpin_skipped ?? null;
// $is_biometric_enabled = $requestData->is_biometric_enabled ?? null;
// if (!$new_mpin) {
// return $this->response->setJSON(['status' => false, 'message' => 'MPIN is required.']);
// }
// $query = $this->employeeModel->where('relationship', 'self');
// if ($mobile_number) {
// $query->where('mobile', $mobile_number);
// } elseif ($email_id) {
// $query->where('email_corporate', $email_id);
// } else {
// return $this->response->setJSON(['status' => false, 'message' => 'Mobile number or Email ID is required.']);
// }
// if (!empty($old_mpin)) {
// $query->where('mpin', $old_mpin);
// }
// // Fetch employee data
// $employeeData = $query->first();
// if (!$employeeData) {
// return $this->response->setJSON(['status' => false, 'message' => 'Employee not found or invalid MPIN.']);
// }
// if(!empty($is_mpin_skipped) && !empty($is_biometric_enabled)){
// $mpin_data_to_updata = [
// 'mpin' => $new_mpin,
// 'is_mpin_skipped' => $is_mpin_skipped,
// 'is_biometric_enabled' => $is_biometric_enabled
// ];
// }else{
// $mpin_data_to_updata = ['mpin' => $new_mpin];
// }
// // Update MPIN
// $updated = $this->employeeModel->update($employeeData['id'], $mpin_data_to_updata);
// return true;
// }
public function updateEmpMPIN() public function updateEmpMPIN()
{ {
@ -415,17 +393,11 @@ class RestAuthenticationController extends AdminController
try { try {
$otp_verification = isset($this->request->getJSON()->otp_verification) ? $this->request->getJSON()->otp_verification : null;
$mobile_number = isset($this->request->getJSON()->mobile_number) ? $this->request->getJSON()->mobile_number : null; $mobile_number = isset($this->request->getJSON()->mobile_number) ? $this->request->getJSON()->mobile_number : null;
$otp = isset($this->request->getJSON()->otp) ? $this->request->getJSON()->otp : null;
$email_id = isset($this->request->getJSON()->email_id) ? $this->request->getJSON()->email_id : null; $email_id = isset($this->request->getJSON()->email_id) ? $this->request->getJSON()->email_id : null;
$otp = isset($this->request->getJSON()->otp) ? $this->request->getJSON()->otp : null;
$client_id = $this->request->getJSON()->client_id ?? null; $client_id = $this->request->getJSON()->client_id ?? null;
if (isset($this->request->getJSON()->login_by_hr))
{
$employeeData = $this->employeeModel->where('id', $this->request->getJSON()->employee_id)->where('relationship', 'self')->where('emp_status !=', 'truncated')->where('is_active', 1)->first();
}else{
if (isset($mobile_number)) if (isset($mobile_number))
{ {
// $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->where('emp_status !=', 'truncated')->where('is_active', 1)->first(); // $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->where('emp_status !=', 'truncated')->where('is_active', 1)->first();
@ -437,7 +409,8 @@ class RestAuthenticationController extends AdminController
->where('employee_polices.is_active', 1) ->where('employee_polices.is_active', 1)
->whereIn('employee_polices.status', ['active', 'expired']) ->whereIn('employee_polices.status', ['active', 'expired'])
->where('employees.is_active', 1) ->where('employees.is_active', 1)
->whereIn('employees.emp_status', ['active', 'expired']); ->whereIn('employees.emp_status', ['active', 'expired'])
->where('otp', $otp);
if (!empty($client_id)) { if (!empty($client_id)) {
$builder->where('employees.client_id', $client_id); $builder->where('employees.client_id', $client_id);
@ -464,14 +437,15 @@ class RestAuthenticationController extends AdminController
$employeeData = $builder->orderBy('employees.id', 'desc')->first(); $employeeData = $builder->orderBy('employees.id', 'desc')->first();
} }
}
$lastQuery = $this->employeeModel->db->getLastQuery(); $lastQuery = $this->employeeModel->db->getLastQuery();
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: Last Executed Query: " . $lastQuery); $this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: Last Executed Query: " . $lastQuery);
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: employeeData: " . json_encode($employeeData ?? [])); $this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: employeeData: " . json_encode($employeeData ?? []));
if ($employeeData && $otp_verification == true || $employeeData && isset($this->request->getJSON()->login_by_hr) || $employeeData && isset($this->request->getJSON()->otp) ) { if ($employeeData && isset($this->request->getJSON()->otp) )
{
$auth = HttpRequestHelper::getRequestInfo(); $auth = HttpRequestHelper::getRequestInfo();
if ($auth) { if ($auth) {
$data = [ $data = [
@ -503,14 +477,14 @@ class RestAuthenticationController extends AdminController
log_message('error', ' '); log_message('error', ' ');
log_message('error', '************************ POST END ********************************'); log_message('error', '************************ POST END ********************************');
log_message('error', ' '); log_message('error', ' ');
return $this->respond(['status' => 'failed','code' => 404,'data' => []],200); return $this->respond(['status' => 'failed','code' => 404,'data' => "", 'message' => 'Invalid OTP'],200);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString()); $this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString());
log_message('error', ' '); log_message('error', ' ');
log_message('error', ' ************************************* POST END **************************************** '); log_message('error', ' ************************************* POST END **************************************** ');
log_message('error', ' '); log_message('error', ' ');
return $this->respond(['status' => 'failed','code' => 500,'data' =>[], 'error' => $e->getMessage()],500); return $this->respond(['status' => 'failed','code' => 500,'data' => "", 'message' => "Invalid OTP", 'error' => $e->getMessage()],500);
} }
} }
@ -524,17 +498,43 @@ class RestAuthenticationController extends AdminController
public function verifyHrWithMobileNumber() public function verifyHrWithMobileNumber()
{ {
try { try {
$mobile_number = $this->request->getJSON()->mobile_number; $data = $this->request->getJSON();
$mobile_number = $data->mobile_number;
$otp = $data->otp;
$HrData = $this->hrModel->where('mobile', $mobile_number) $HrData = $this->hrModel->where('mobile', $mobile_number)
->where('contact_type', 'client') ->where('contact_type', 'client')
->where('is_active', 1) ->where('is_active', 1)
->first(); ->first();
if ($HrData) { if ($HrData) {
$sql = "UPDATE level_contacts SET otp = ? WHERE mobile = ? AND contact_type = 'client' AND is_active = 1";
$db = db_connect();
$update = $db->query($sql, [$otp, $mobile_number]);
if($update)
{
//send sms
$SMSResult = sendOtpSms($mobile_number, $otp);
if ($SMSResult['status'] == 'success')
{
$result = ['user_verification' => true, 'message' => "Verified Successfully"]; $result = ['user_verification' => true, 'message' => "Verified Successfully"];
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $result], 200); return $this->respond(['status' => 'success', 'code' => 200, 'data' => $result], 200);
} else {
$result = ['user_verification' => false, 'message' => "SMS sending failed , try again"];
return $this->respond(['status' => 'failed', 'code' => 404, 'data' => $result], 200);
}
}else {
$result = ['user_verification' => false, 'message' => "SMS sending failed , try again"];
return $this->respond(['status' => 'failed', 'code' => 404, 'data' => $result], 200);
}
} else { } else {
$result = ['user_verification' => false , 'message' => "User not found"]; $result = ['user_verification' => false , 'message' => "User not found"];
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200); return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
@ -552,6 +552,7 @@ class RestAuthenticationController extends AdminController
$data = $this->request->getJSON(); $data = $this->request->getJSON();
$email = $data->email; $email = $data->email;
$otp = $data->otp;
$HrData = $this->hrModel->where('email', $email) $HrData = $this->hrModel->where('email', $email)
->where('contact_type', 'client') ->where('contact_type', 'client')
@ -560,8 +561,6 @@ class RestAuthenticationController extends AdminController
if ($HrData) { if ($HrData) {
$otp = random_int(100000, 999999);
$sql = " $sql = "
UPDATE level_contacts UPDATE level_contacts
SET otp = ? SET otp = ?
@ -575,7 +574,7 @@ class RestAuthenticationController extends AdminController
if($update) if($update)
{ {
$data->otp = $otp;
$common = [ $common = [
'login_type' => 'HR login', 'login_type' => 'HR login',
@ -612,35 +611,49 @@ class RestAuthenticationController extends AdminController
public function updateHROTP() public function updateHROTP()
{ {
$email = $this->request->getJSON()->email; $email = $this->request->getJSON()->email ?? null;
$otp = $this->request->getJSON()->otp; $mobile_number = $this->request->getJSON()->mobile_number ?? null;
$otp = $this->request->getJSON()->otp ?? null;
$this->hrModel->where('email', $email) ->where('contact_type', 'client')
->where('is_active', 1)->set(array('otp' => $otp))
->update();
$builder = $this->hrModel
->where('contact_type', 'client')
->where('is_active', 1);
if (!empty($email)) {
$builder->where('email', $email);
} elseif (!empty($mobile_number)) {
$builder->where('mobile', $mobile_number);
}
$builder->set(['otp' => $otp])->update();
if ($this->hrModel->db->affectedRows() > 0) {
return true; return true;
}
} }
public function getVerifiedHrData() public function getVerifiedHrData()
{ {
try { try {
// mobile number
$otp_verification = isset($this->request->getJSON()->otp_verification) ? $this->request->getJSON()->otp_verification : null;
$mobile_number = isset($this->request->getJSON()->mobile_no) ? $this->request->getJSON()->mobile_no : null;
// email id
$otp = isset($this->request->getJSON()->otp) ? $this->request->getJSON()->otp : null; $otp = isset($this->request->getJSON()->otp) ? $this->request->getJSON()->otp : null;
$email = isset($this->request->getJSON()->email) ? $this->request->getJSON()->email : null; $email = isset($this->request->getJSON()->email) ? $this->request->getJSON()->email : null;
$mobile_number = isset($this->request->getJSON()->mobile_no) ? $this->request->getJSON()->mobile_no : null;
if (isset($mobile_number)) if (isset($mobile_number))
{ {
$hrData = $this->hrModel->where('mobile', $mobile_number)->where('contact_type', 'client')->first(); $hrData = $this->hrModel->where('mobile', $mobile_number)->where('contact_type', 'client')->where('otp', $otp)->first();
}else{ }else{
$hrData = $this->hrModel->where('email', $email)->where('contact_type', 'client')->where('otp', $otp)->first(); $hrData = $this->hrModel->where('email', $email)->where('contact_type', 'client')->where('otp', $otp)->first();
} }
if ($hrData && $otp_verification == true || $hrData && isset($this->request->getJSON()->otp) ) if ($hrData)
{ {
$auth = HttpRequestHelper::getRequestInfo(); $auth = HttpRequestHelper::getRequestInfo();
@ -660,37 +673,69 @@ class RestAuthenticationController extends AdminController
if(isset($this->request->getJSON()->mobile_no)){ if(isset($this->request->getJSON()->mobile_no)){
$hrData = $this->hrModel ->select('level_contacts.* , client_branch.client_id as client_id') $getAllhrData = $this->hrModel->select('level_contacts.id ,level_contacts.mobile , level_contacts.email , clients.id as client_id, clients.client_name, clients.short_name , client_branch.id as client_branch_id,client_branch.branch_name , client_branch.pre_branch_id')
->join('client_branch', 'level_contacts.ref_id = client_branch.id', 'left') ->join('client_branch', 'level_contacts.ref_id = client_branch.id', 'left')
->join('clients', 'client_branch.client_id = clients.id', 'left')
->where('level_contacts.mobile', $mobile_number ) ->where('level_contacts.mobile', $mobile_number )
->where('level_contacts.contact_type', 'client') ->where('level_contacts.contact_type', 'client')
->find(); ->findAll();
//set otp value null
$this->hrModel->where('mobile', $mobile_number)->where('otp', $otp)->where('contact_type', 'client')->set(['otp'=>null])->update();
}else if(isset($this->request->getJSON()->otp)){ }else if(isset($this->request->getJSON()->email)){
$this->hrModel->where('email', $email)->where('otp', $otp)->where('contact_type', 'client')->set(['otp'=>null])->update(); $getAllhrData = $this->hrModel->select('level_contacts.id ,level_contacts.mobile , level_contacts.email , clients.id as client_id, clients.client_name, clients.short_name , client_branch.id as client_branch_id,client_branch.branch_name , client_branch.pre_branch_id')
$hrData = $this->hrModel ->select('level_contacts.* , client_branch.client_id as client_id')
->join('client_branch', 'level_contacts.ref_id = client_branch.id', 'left') ->join('client_branch', 'level_contacts.ref_id = client_branch.id', 'left')
->join('clients', 'client_branch.client_id = clients.id', 'left')
->where('level_contacts.email', $email ) ->where('level_contacts.email', $email )
->where('level_contacts.contact_type', 'client') ->where('level_contacts.contact_type', 'client')
->find(); ->findAll();
//set otp value null
$this->hrModel->where('email', $email)->where('otp', $otp)->where('contact_type', 'client')->set(['otp'=>null])->update();
} }
$HRAccessData = $this->getHRAccessData( $hrData['0']['id'] , 'post_enrollment'); if(count($getAllhrData))
{
foreach ($getAllhrData as $key => $value) {
$HRAccessData = $this->hrAccessControlModel
->where('post_client_id',$value['client_id'])
->where('post_branch_id', $value['client_branch_id'])
->where('post_hr_id', $value['id'])
->get()->getRowArray();
if (!empty($HRAccessData) && isset($HRAccessData['allowed_modules'])) {
$decoded = json_decode($HRAccessData['allowed_modules'], true);
$getAllhrData[$key]['allowed_modules'] = $decoded;
$token = JWTToken::encode($HRAccessData);
$getAllhrData[$key]['token'] = $token;
} else {
$getAllhrData[$key]['allowed_modules'] = [];
$getAllhrData[$key]['token'] = "";
}
}
return $this->respond(['status' => 'success','code' => 200,'data' => $getAllhrData ],200);
}else {
return $this->respond(['status' => 'failed','code' => 404,'data' => "" , 'message' => 'User not found' ],200);
}
if(isset($HRAccessData['allowed_modules'])){ $hrData['0']['allowed_modules'] = json_decode($HRAccessData['allowed_modules'],true)['post']; }else{ $hrData['0']['allowed_modules'] = []; }
$hrData['0']['token_type'] = 'post';
$result = JWTToken::encode($hrData['0']);
return $this->respond(['status' => 'success','code' => 200,'data' => $result ],200);
} else { } else {
return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP" ],200); return $this->respond(['status' => 'failed','code' => 404,'data' => "" , 'message' => 'User not found' ],200);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500); return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
@ -829,7 +874,7 @@ class RestAuthenticationController extends AdminController
log_message('error', ' '); log_message('error', ' ');
log_message('error', ' ************************************* POST END **************************************** '); log_message('error', ' ************************************* POST END **************************************** ');
log_message('error', ' '); log_message('error', ' ');
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500); return $this->respond(['status' => 'failed','code' => 500,'data' => "", 'message' => $th],500);
} }
} }
@ -933,7 +978,7 @@ class RestAuthenticationController extends AdminController
log_message('error', ' '); log_message('error', ' ');
log_message('error', ' ************************************* POST END **************************************** '); log_message('error', ' ************************************* POST END **************************************** ');
log_message('error', ' '); log_message('error', ' ');
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500); return $this->respond(['status' => 'failed','code' => 500,'data' => "", 'message' => $th],500);
} }
} }
@ -991,7 +1036,7 @@ class RestAuthenticationController extends AdminController
// // $result = $employeeData; // // $result = $employeeData;
// return $this->respond(['status' => 'success','code' => 200,'data' => $result],200); // return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
// } else { // } else {
// return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP"],200); // return $this->respond(['status' => 'failed','code' => 404,'data' => ""],200);
// } // }
// } catch (\Exception $e) { // } catch (\Exception $e) {
// return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500); // return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
@ -1016,7 +1061,7 @@ class RestAuthenticationController extends AdminController
// print_r($mpin); // print_r($mpin);
if (!$mpin) { if (!$mpin) {
return $this->respond(['status' => 'failed', 'code' => 400, 'data' => 'MPIN is required'], 400); return $this->respond(['status' => 'failed', 'code' => 400, 'data' => "", 'message' => 'MPIN is required'], 400);
} }
if ($mobile_number) { if ($mobile_number) {
@ -1057,7 +1102,7 @@ class RestAuthenticationController extends AdminController
$employeeData = $builder->orderBy('employees.id', 'desc')->first(); $employeeData = $builder->orderBy('employees.id', 'desc')->first();
} else { } else {
return $this->respond(['status' => 'failed', 'code' => 400, 'data' => 'Mobile number or Email ID is required'], 400); return $this->respond(['status' => 'failed', 'code' => 400, 'data' => "", 'message' => 'Mobile number or Email ID is required'], 400);
} }
$lastQuery = $this->employeeModel->db->getLastQuery(); $lastQuery = $this->employeeModel->db->getLastQuery();
@ -1095,14 +1140,14 @@ class RestAuthenticationController extends AdminController
log_message('error', ' ************************************* POST END **************************************** '); log_message('error', ' ************************************* POST END **************************************** ');
log_message('error', ' '); log_message('error', ' ');
return $this->respond(['status' => 'failed','code' => 404,'data' => 'Invalid MPIN'], 200); return $this->respond(['status' => 'failed','code' => 404, 'data' => "", 'message' => 'Invalid MPIN'], 200);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyMpin: Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString()); $this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyMpin: Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString());
log_message('error', ' '); log_message('error', ' ');
log_message('error', ' ************************************* POST END **************************************** '); log_message('error', ' ************************************* POST END **************************************** ');
log_message('error', ' '); log_message('error', ' ');
return $this->respond(['status' => 'failed','code' => 500, 'data' => $e->getMessage()], 500); return $this->respond(['status' => 'failed','code' => 500, 'data' => "", 'message' => $e->getMessage()], 500);
} }
} }
@ -1167,13 +1212,13 @@ class RestAuthenticationController extends AdminController
log_message('error', ' '); log_message('error', ' ');
log_message('error', ' ************************************* POST END **************************************** '); log_message('error', ' ************************************* POST END **************************************** ');
log_message('error', ' '); log_message('error', ' ');
return $this->respond(['status' => 'success','code' => 200,'data' => "Mpin - exist" , 'Mpin' =>$employeeData["mpin"], 'is_mpin_skipped' => $employeeData['is_mpin_skipped'], 'is_biometric_enabled' => $employeeData['is_biometric_enabled']],200); return $this->respond(['status' => 'success','code' => 200,'data' => "", 'message' => "Mpin - exist" , 'Mpin' =>$employeeData["mpin"], 'is_mpin_skipped' => $employeeData['is_mpin_skipped'], 'is_biometric_enabled' => $employeeData['is_biometric_enabled']],200);
} else { } else {
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - checkMpin: Mpin - not found"); $this->myLogger->logme("error", "REST-AUTH-CONTROLLER - checkMpin: Mpin - not found");
log_message('error', ' '); log_message('error', ' ');
log_message('error', ' ************************************* POST END **************************************** '); log_message('error', ' ************************************* POST END **************************************** ');
log_message('error', ' '); log_message('error', ' ');
return $this->respond(['status' => 'failed','code' => 404,'data' => "Mpin - not found", 'Mpin' =>null],200); return $this->respond(['status' => 'failed','code' => 404,'data' => "", 'message' => "Mpin - not found", 'Mpin' =>null],200);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
@ -1182,7 +1227,7 @@ class RestAuthenticationController extends AdminController
log_message('error', ' ************************************* POST END **************************************** '); log_message('error', ' ************************************* POST END **************************************** ');
log_message('error', ' '); log_message('error', ' ');
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500); return $this->respond(['status' => 'failed','code' => 500,'data' => "", 'message' => $e->getMessage()],500);
} }
} }
@ -1362,6 +1407,10 @@ class RestAuthenticationController extends AdminController
->where('EP.is_active', 1) ->where('EP.is_active', 1)
->whereIn('EP.status', ['active', 'expired']); ->whereIn('EP.status', ['active', 'expired']);
if (!empty($otp)) {
$builder->where('employees.otp', $otp);
}
if (!empty($old_mpin)) { if (!empty($old_mpin)) {
$builder->where('employees.mpin', $old_mpin); $builder->where('employees.mpin', $old_mpin);
} }

View File

@ -5,11 +5,18 @@ namespace App\Controllers;
use App\Controllers\BaseController; use App\Controllers\BaseController;
use App\Models\EmployeePolicyModel; use App\Models\EmployeePolicyModel;
use App\Models\InsurerBranchModel; use App\Models\InsurerBranchModel;
use App\Models\RFQModel;
use CodeIgniter\HTTP\ResponseInterface; use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\API\ResponseTrait; use CodeIgniter\API\ResponseTrait;
use Dompdf\Dompdf; use Dompdf\Dompdf;
use Dompdf\Options; use Dompdf\Options;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use PhpOffice\PhpSpreadsheet\Style\Alignment;
use PhpOffice\PhpSpreadsheet\Style\Fill;
use PhpOffice\PhpSpreadsheet\Style\Border;
class TestingController extends BaseController class TestingController extends BaseController
{ {
use ResponseTrait; use ResponseTrait;
@ -235,10 +242,10 @@ class TestingController extends BaseController
->where('employees.emp_code', $emp_code) ->where('employees.emp_code', $emp_code)
->groupBy('employee_polices.client_policy_id') ->groupBy('employee_polices.client_policy_id')
->findAll(); ->findAll();
} }
public function ptedfitdata($id){ public function ptedfitdata($id)
{
$policy_transaction = new PolicyTransactionController(); $policy_transaction = new PolicyTransactionController();
$data = $policy_transaction->getInceptionDataForEdit($id); $data = $policy_transaction->getInceptionDataForEdit($id);
// dd($data); // dd($data);
@ -313,4 +320,357 @@ class TestingController extends BaseController
return $html; return $html;
} }
public function viewRFQNonEb()
{
$insurerBranchModel = new InsurerBranchModel();
$data['page_name'] = "RFQ NON EB";
$data['insurer'] = $insurerBranchModel->getInsurerBranchesWithInsurerNames();
// dd($data);
return $this->loadLayout('view_rfq_non_eb_new', $data);
}
public function saverfq()
{
$json = $this->request->getPost('json');
$json = json_encode($json);
print_r($json);
// $data['lead_id'] = 10000;
// $data['json'] = $json;
// $rfq = new RFQModel();
// $rfq->insert($data);
}
public function exportExcel()
{
$rfq = new RFQModel();
$policy_data = $rfq->where('lead_id', 10000)->first();
// print_rr($policy_data['json']); die;
$policy_data = json_decode($policy_data['json'], true);
$policy_data = array_slice($policy_data, 0, -2);
print_rr($policy_data);
die;
dd($policy_data);
}
public function mapping_client_id_and_branch_id()
{
$post_clients_list = $this->getNonDuplicatePostClients();
$pre_clients_list = $this->getNonDuplicatePreClients();
if (
!empty($pre_clients_list) &&
!empty($post_clients_list)
) {
$postDB = \Config\Database::connect();
$preDB = \Config\Database::connect('preDB');
foreach ($post_clients_list as $post_client) {
foreach ($pre_clients_list as $pre_client) {
if (trim($post_client['short_name']) == trim($pre_client['short_name'])) {
$postDB->table('clients')->where('id', $post_client['id'])->update(['pre_client_id' => $pre_client['id']]);
$preDB->table('clients')->where('id', $pre_client['id'])->update(['post_client_id' => $post_client['id']]);
// upto here we updated client_id in both dbs.
$post_branches = $postDB->table('client_branch')
->where('client_id', $post_client['id'])
->get()
->getResultArray() ?? [];
$pre_branches = $preDB->table('client_branch')
->where('client_id', $pre_client['id'])
->get()
->getResultArray() ?? [];
if (!empty($post_branches) && !empty($pre_branches)) {
foreach ($post_branches as $post_branch) {
$pre_branch = $preDB->table('client_branch')
->where('client_id', $pre_client['id'])
->where('branch_code', $post_branch['branch_code'])
->get()
->getRowArray() ?? [];
if (!empty($pre_branch)) {
$postDB->table('client_branch')->where('id', $post_branch['id'])->update(['pre_branch_id' => $pre_branch['id']]);
}
}
foreach ($pre_branches as $pre_branch) {
$post_branch = $postDB->table('client_branch')
->where('client_id', $post_client['id'])
->where('branch_code', $pre_branch['branch_code'])
->get()
->getRowArray() ?? [];
if (!empty($post_branch)) {
$preDB->table('client_branch')->where('id', $pre_branch['id'])->update(['post_branch_id' => $post_branch['id']]);
}
}
}
}
}
}
}
}
private function getNonDuplicatePostClients()
{
$postDB = \Config\Database::connect();
$sql = "SELECT *
FROM clients AS post_clients
WHERE post_clients.client_type = 1
AND post_clients.is_active = 1
AND (post_clients.short_name NOT IN
(
SELECT ir_post_clients.short_name
FROM clients as ir_post_clients
WHERE ir_post_clients.client_type = 1
AND ir_post_clients.short_name IS NOT NULL
AND TRIM(ir_post_clients.short_name) <> ''
AND ir_post_clients.is_active = 1
GROUP BY ir_post_clients.short_name
HAVING COUNT(*) > 1)
)
ORDER BY post_clients.short_name";
$binds = [];
$query = $postDB->query($sql, $binds);
$results = $query->getResultArray() ?? [];
return $results;
}
private function getNonDuplicatePreClients()
{
$preDB = \Config\Database::connect('preDB');
$sql = "SELECT *
FROM clients AS pre_clients
WHERE pre_clients.client_type = 1
AND pre_clients.is_active = 1
AND (pre_clients.short_name NOT IN
(
SELECT ir_pre_clients.short_name
FROM clients as ir_pre_clients
WHERE ir_pre_clients.client_type = 1
AND ir_pre_clients.short_name IS NOT NULL
AND TRIM(ir_pre_clients.short_name) <> ''
AND ir_pre_clients.is_active = 1
GROUP BY ir_pre_clients.short_name
HAVING COUNT(*) > 1)
)
ORDER BY pre_clients.short_name";
$binds = [];
$query = $preDB->query($sql, $binds);
$results = $query->getResultArray() ?? [];
return $results;
}
public function membervalidation($lead_id = 329)
{
$lead_controll = new LeadsController();
// $lead_controll->getMemberDataExcelFileErrors();
$res = $lead_controll->memberDataListExcelFileFormatValidation(['lead_id' => $lead_id]);
dd($res);
}
private $firstNames = [
'Rajesh', 'Priya', 'Amit', 'Sneha', 'Vikram', 'Anjali', 'Rahul', 'Deepika',
'Sanjay', 'Kavita', 'Arun', 'Pooja', 'Manoj', 'Nisha', 'Suresh', 'Meera',
'Karthik', 'Divya', 'Ravi', 'Lakshmi', 'Anand', 'Swathi', 'Vijay', 'Rekha',
'Ashok', 'Sangeetha', 'Prakash', 'Uma', 'Ramesh', 'Vani', 'Kumar', 'Radha',
'Dinesh', 'Shanti', 'Ganesh', 'Parvati', 'Mohan', 'Sita', 'Arjun', 'Geetha'
];
private $lastNames = [
'Kumar', 'Sharma', 'Singh', 'Patel', 'Reddy', 'Nair', 'Iyer', 'Krishnan',
'Rao', 'Gupta', 'Verma', 'Agarwal', 'Joshi', 'Mehta', 'Desai', 'Pillai',
'Menon', 'Bhat', 'Naidu', 'Varma', 'Malhotra', 'Kapoor', 'Chopra', 'Saxena',
'Pandey', 'Mishra', 'Tiwari', 'Dubey', 'Sinha', 'Jain', 'Shah', 'Thakur'
];
private $relationships = ['Self', 'Spouse', 'Son', 'Daughter', 'Father', 'Mother'];
private $genders = ['M', 'F'];
private $domains = ['gmail.com', 'yahoo.com', 'outlook.com', 'company.com', 'example.com'];
public function generateExcel()
{
// Increase execution time and memory for large files
ini_set('max_execution_time', 600);
ini_set('memory_limit', '1024M');
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
// Define headers
$headers = [
'Sl no',
'Emp Code',
'Name',
'Relationship',
'Gender',
'DOB',
'Age',
'Email',
'Mobile',
'SI',
'SI Enhancement',
'Proposed Sum Insured 1',
'Proposed Sum Insured 2',
'Proposed Sum Insured 3',
'Proposed Sum Insured 4'
];
// Set headers in row 1
$col = 'A';
foreach ($headers as $header) {
$sheet->setCellValue($col . '1', $header);
$col++;
}
// Style the header row
$headerStyle = [
'font' => ['bold' => true, 'color' => ['rgb' => 'FFFFFF']],
'fill' => ['fillType' => Fill::FILL_SOLID, 'startColor' => ['rgb' => '4472C4']],
'alignment' => ['horizontal' => Alignment::HORIZONTAL_CENTER, 'vertical' => Alignment::VERTICAL_CENTER],
'borders' => ['allBorders' => ['borderStyle' => Border::BORDER_THIN]]
];
$sheet->getStyle('A1:O1')->applyFromArray($headerStyle);
// Generate 70,000 sample records
$totalRecords = 1000;
$batchSize = 1000;
for ($i = 1; $i <= $totalRecords; $i++) {
$row = $i + 1; // Start from row 2 (row 1 is header)
$record = $this->generateSampleRecord($i);
$sheet->setCellValue('A' . $row, $record['sl_no']);
$sheet->setCellValue('B' . $row, $record['emp_code']);
$sheet->setCellValue('C' . $row, $record['name']);
$sheet->setCellValue('D' . $row, $record['relationship']);
$sheet->setCellValue('E' . $row, $record['gender']);
$sheet->setCellValue('F' . $row, $record['dob']);
$sheet->setCellValue('G' . $row, $record['age']);
$sheet->setCellValue('H' . $row, $record['email']);
$sheet->setCellValue('I' . $row, $record['mobile']);
$sheet->setCellValue('J' . $row, $record['si']);
$sheet->setCellValue('K' . $row, $record['si_enhancement']);
$sheet->setCellValue('L' . $row, $record['proposed_si_1']);
$sheet->setCellValue('M' . $row, $record['proposed_si_2']);
$sheet->setCellValue('N' . $row, $record['proposed_si_3']);
$sheet->setCellValue('O' . $row, $record['proposed_si_4']);
// Clear memory every batch
if ($i % $batchSize == 0) {
$sheet->garbageCollect();
}
}
// Auto-size columns
foreach (range('A', 'O') as $col) {
$sheet->getColumnDimension($col)->setAutoSize(true);
}
// Generate filename
$filename = 'employee_data_70k_' . date('Y-m-d_His') . '.xlsx';
// Set headers for download
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="' . $filename . '"');
header('Cache-Control: max-age=0');
// Write file to output
$writer = new Xlsx($spreadsheet);
$writer->save('php://output');
// Clean up
$spreadsheet->disconnectWorksheets();
unset($spreadsheet);
exit;
}
private function generateSampleRecord($index)
{
$firstName = $this->firstNames[array_rand($this->firstNames)];
$lastName = $this->lastNames[array_rand($this->lastNames)];
$name = $firstName . ' ' . $lastName;
$relationship = $this->relationships[array_rand($this->relationships)];
$gender = $this->genders[array_rand($this->genders)];
// Generate random age between 18 and 65
$age = rand(18, 65);
// Calculate DOB based on age
$year = date('Y') - $age;
$month = str_pad(rand(1, 12), 2, '0', STR_PAD_LEFT);
$day = str_pad(rand(1, 28), 2, '0', STR_PAD_LEFT);
$dob = "{$day}-{$month}-{$year}";
// Generate employee code
$empCode = 'EMP' . str_pad($index, 6, '0', STR_PAD_LEFT);
// Generate email
$email = strtolower($firstName . '.' . $lastName . $index) . '@' . $this->domains[array_rand($this->domains)];
// Generate mobile number (Indian format)
$mobile = '+91' . rand(7000000000, 9999999999);
// Generate insurance amounts
$siOptions = [100000, 200000, 300000, 500000, 1000000];
$si = $siOptions[array_rand($siOptions)];
$si_enhancement = rand(0, 1) ? rand(50000, 200000) : 0;
$proposed_si_1 = $si + rand(100000, 500000);
$proposed_si_2 = $proposed_si_1 + rand(100000, 500000);
$proposed_si_3 = $proposed_si_2 + rand(100000, 500000);
$proposed_si_4 = $proposed_si_3 + rand(100000, 500000);
return [
'sl_no' => $index,
'emp_code' => $empCode,
'name' => $name,
'relationship' => $relationship,
'gender' => $gender,
'dob' => $dob,
'age' => $age,
'email' => $email,
'mobile' => $mobile,
'si' => $si,
'si_enhancement' => $si_enhancement,
'proposed_si_1' => $proposed_si_1,
'proposed_si_2' => $proposed_si_2,
'proposed_si_3' => $proposed_si_3,
'proposed_si_4' => $proposed_si_4
];
}
} }

View File

@ -362,6 +362,7 @@ class TicketController extends BaseController
$data['modeOFIntimate'] = $this->modeOFIntimate; $data['modeOFIntimate'] = $this->modeOFIntimate;
$data['priorityType'] = $this->priorityType; $data['priorityType'] = $this->priorityType;
$data['claimType'] = $this->claimType; $data['claimType'] = $this->claimType;
$data['tab_name'] = "Claims";
if ($this->request->is('get')) { if ($this->request->is('get')) {
$data['page_name'] = "Claims"; $data['page_name'] = "Claims";
$data['claim_status'] = $this->claimStatus->select('id,ticket_type,claim_status')->where('is_active', 1)->findAll(); $data['claim_status'] = $this->claimStatus->select('id,ticket_type,claim_status')->where('is_active', 1)->findAll();
@ -1123,6 +1124,9 @@ class TicketController extends BaseController
// dd($data['ticket_data']); // dd($data['ticket_data']);
$data['ticket_type'] = $this->ticketType; $data['ticket_type'] = $this->ticketType;
$data['trigger_type'] = $this->triggerType; $data['trigger_type'] = $this->triggerType;
$data['page_name'] = "Claims";
return $this->loadLayout('ticket_mail_template', $data); return $this->loadLayout('ticket_mail_template', $data);
} }
@ -1744,6 +1748,8 @@ class TicketController extends BaseController
'tat_band_wise' => 'TAT Wise Status Report' 'tat_band_wise' => 'TAT Wise Status Report'
]; ];
// //
$data['tab_name'] = "Claim Reports";
$data['page_name'] = "Claims";
$this->loadLayout('ticket_reports', $data); $this->loadLayout('ticket_reports', $data);
} else { } else {
$received_data = $this->request->getPost(); $received_data = $this->request->getPost();
@ -2187,6 +2193,8 @@ class TicketController extends BaseController
$data['viewer'] = !empty($empView) ? $empView : 0; $data['viewer'] = !empty($empView) ? $empView : 0;
// dd($data); // dd($data);
return view('ticket_feedback_form', $data); return view('ticket_feedback_form', $data);
}else{ }else{
@ -2217,7 +2225,7 @@ class TicketController extends BaseController
public function feedbackList(){ public function feedbackList(){
$data['feedback_data'] = $this->ticketMasterModel->select("ticket_master.*,clients.client_name")->join("clients","clients.id = ticket_master.client_id")->where("ticket_master.is_active",1)->where("ticket_master.feedback_json IS NOT NULL", null, false)->where("ticket_master.feedback_json !=", "")->findAll(); $data['feedback_data'] = $this->ticketMasterModel->select("ticket_master.*,clients.client_name")->join("clients","clients.id = ticket_master.client_id")->where("ticket_master.is_active",1)->where("ticket_master.feedback_json IS NOT NULL", null, false)->where("ticket_master.feedback_json !=", "")->findAll();
$data['page_name'] = "Claims";
// dd($data); // dd($data);
$this->loadLayout("ticket_feedback_list",$data); $this->loadLayout("ticket_feedback_list",$data);
} }
@ -2610,7 +2618,8 @@ class TicketController extends BaseController
public function claimDumpUpload() public function claimDumpUpload()
{ {
$data['page_name'] = "Claim Dupm Upload"; $data['tab_name'] = "Claim Dupm Upload";
$data['page_name'] = "Claims";
if($this->request->is('get')){ if($this->request->is('get')){

View File

@ -55,7 +55,8 @@ class UserController extends AdminController
public function list() public function list()
{ {
$data['page_name'] = 'User'; $data['tab_name'] = 'Users';
$data['page_name'] = 'Users';
$this->myLogger->logme('error','User list function called'); $this->myLogger->logme('error','User list function called');
$data['UserList'] = $this->userModel->getUserList(); $data['UserList'] = $this->userModel->getUserList();
// echo '<pre>'; // echo '<pre>';
@ -588,6 +589,7 @@ class UserController extends AdminController
$data = $this->request->getPost(); $data = $this->request->getPost();
if (!empty($data['id'])) { if (!empty($data['id'])) {
$text = "update"; $text = "update";
$data['updated_by'] = get_session_userid();
$result = $this->partnerStaffModel->update($data['id'], $data); $result = $this->partnerStaffModel->update($data['id'], $data);
$updateID = $data['id']; $updateID = $data['id'];
} else { } else {
@ -595,6 +597,11 @@ class UserController extends AdminController
$data['role_id'] = 1; $data['role_id'] = 1;
$data['created_by'] = get_session_userid(); $data['created_by'] = get_session_userid();
$insertID = $this->partnerStaffModel->insert($data); $insertID = $this->partnerStaffModel->insert($data);
if($insertID){
$details['manager_id'] = $insertID;
$details['updated_by'] = get_session_userid();
$this->partnerStaffModel->update($insertID, $details);
}
$result = true; $result = true;
} }
@ -620,17 +627,24 @@ class UserController extends AdminController
if (!$staff) { if (!$staff) {
return $this->response->setJSON(['status' => 'error','message' => 'Staff not found'])->setStatusCode(404); return $this->response->setJSON(['status' => 'error','message' => 'Staff not found'])->setStatusCode(404);
} }
$role = $staff['role_id'];
$text = $role == 1 ? "Manager" : "Staff";
if ($staff['is_active'] == 1) { if ($staff['is_active'] == 1) {
if($role == 1){ // manager
$result = $this->partnerStaffModel->updateByKey($id);
$message = $result;
}else{ // staff
$result = $this->partnerStaffModel->update($id, ['is_active' => 0]); $result = $this->partnerStaffModel->update($id, ['is_active' => 0]);
$message = "Staff deleted successfully"; $message = $text." deleted successfully";
}
} else { } else {
return $this->response->setJSON(['status' => 'error','message' => 'Staff already deleted'])->setStatusCode(400); return $this->response->setJSON(['status' => 'error','message' => $text.' already deleted'])->setStatusCode(400);
} }
return $this->response->setJSON([ return $this->response->setJSON([
'status' => $result ? 'success' : 'error', 'status' => $result ? 'success' : 'error',
'message' => $result ? $message : "Unable to delete staff. Please try again.", 'message' => $result ? $message : "Unable to delete ".$text.". Please try again.",
'id' => $id 'id' => $id
])->setStatusCode($result ? 200 : 400); ])->setStatusCode($result ? 200 : 400);
} }

View File

@ -32,7 +32,7 @@ class ChatbotHelper
$client_branch_id = $chat_session_info['client_branch_id']; $client_branch_id = $chat_session_info['client_branch_id'];
$relationship ='Self'; $relationship ='Self';
$EmployeeModel = new EmployeeModel(); $EmployeeModel = new EmployeeModel();
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]; 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],policy_type_id:[2,3,4,5]);//,relationship:[$relationship];
} }
public static function getHospitalLink($emp_policy_id){ public static function getHospitalLink($emp_policy_id){

View File

@ -666,12 +666,12 @@ if(!function_exists('generate_insurer_based_excel')){
foreach ($excel_header_array as $header) { foreach ($excel_header_array as $header) {
$fieldName = $header['db_column_name']; $fieldName = $header['db_column_name'];
$defaultValue = isset($header['default_value']) ? $header['default_value'] : null; $defaultValue = isset($header['default_value']) ? $header['default_value'] : "";
if ($fieldName === 'index') { if ($fieldName === 'index') {
$value = $serialNumber; $value = $serialNumber;
} else { } else {
if(empty($fieldName) && !empty($defaultValue)){ if(empty($fieldName) && $defaultValue != ""){
$value = $defaultValue; $value = $defaultValue;
}else{ }else{
$value = $row->$fieldName ?? ''; $value = $row->$fieldName ?? '';

View File

@ -1993,7 +1993,6 @@ if (!function_exists('group_slab_rates_basedon_name')) {
} }
} }
//this key generating mandantory for display employee info in enrolment app w/o error //this key generating mandantory for display employee info in enrolment app w/o error
if (!function_exists('generate_family_floater_key')) { if (!function_exists('generate_family_floater_key')) {
function generate_family_floater_key($relationship) function generate_family_floater_key($relationship)
@ -2002,7 +2001,7 @@ if (!function_exists('generate_family_floater_key')) {
$relation = 'parent'; $relation = 'parent';
} else if (strtolower(trim($relationship)) === 'son' || strtolower(trim($relationship)) === 'daughter') { } else if (strtolower(trim($relationship)) === 'son' || strtolower(trim($relationship)) === 'daughter') {
$relation = 'child'; $relation = 'child';
} else if ((strtolower(trim($relationship)) === 'father in Law' || strtolower(trim($relationship)) === 'mother in Law') || (strtolower(trim($relationship)) === 'father-in-Law' || strtolower(trim($relationship)) === 'mother-in-Law')) { } else if ((strtolower(trim($relationship)) === 'father in law' || strtolower(trim($relationship)) === 'mother in law') || (strtolower(trim($relationship)) === 'father-in-law' || strtolower(trim($relationship)) === 'mother-in-law')) {
$relation = 'parent_in_law'; $relation = 'parent_in_law';
} else if (strtolower(trim($relationship)) === 'spouse') { } else if (strtolower(trim($relationship)) === 'spouse') {
$relation = 'spouse'; $relation = 'spouse';
@ -2041,3 +2040,331 @@ if (!function_exists('formatIndianCurrency')) {
return $formatted . $decimal; return $formatted . $decimal;
} }
} }
// ------------- FUNCTION FOR LEAD MEMBER DATA LIST VALIDATIONS --------------------------------------
if (!function_exists('check_columns_name_exist')) {
function check_columns_name_exist($definedColumns, $excelColumns)
{
$mismatchedColumns = [];
foreach ($definedColumns as $colKey => $definedCol) {
$definedColName = strtolower(trim($definedCol['col_name']));
// Normalize excel columns to lowercase for comparison
$excelColsLower = array_map('strtolower', array_map('trim', $excelColumns));
if (!in_array($definedColName, $excelColsLower)) {
$mismatchedColumns[] = "Missing column: <strong>" . $definedCol['col_name'] . "</strong> in Excel file.<br/>";
}
}
return $mismatchedColumns;
}
}
if (!function_exists('update_excel_column_indexes')) {
function update_excel_column_indexes($definedColumns, $excelColumns)
{
// $excelColumns is the first row of the Excel file (header row)
// Example: ['Emp Code', 'Name', 'Gender', 'DOB', 'SI']
foreach ($definedColumns as $key => &$definedCol) {
$definedColName = strtolower(trim($definedCol['col_name']));
$excelColsLower = array_map('strtolower', array_map('trim', $excelColumns));
// Find column index in Excel
$colIndex = array_search($definedColName, $excelColsLower);
if ($colIndex !== false) {
$definedCol['col_idx'] = $colIndex;
$definedCol['col_cell_name'] = chr(65 + $colIndex); // A=65, B=66...
} else {
// If column missing in Excel
$definedCol['col_idx'] = null;
$definedCol['col_cell_name'] = null;
}
}
return $definedColumns;
}
}
if (!function_exists('check_duplicate_rows_and_contacts')) {
function check_duplicate_rows_and_contacts($excel_data, $columns_to_check, $err_data)
{
$exl_col = $columns_to_check;
$keys = array_keys($columns_to_check);
unset($columns_to_check['sno'], $columns_to_check['si'], $columns_to_check['email'], $columns_to_check['mobile'], $columns_to_check['age']);
$seenRows = [];
$emailSeen = [];
$mobileSeen = [];
$duplicateRows = [];
foreach ($excel_data as $rowIndex => $row) {
// Build unique key from selected columns
$values = [];
foreach ($columns_to_check as $colIdx) {
$values[] = isset($row[$colIdx['col_idx']]) ? trim($row[$colIdx['col_idx']]) : '';
}
$rowKey = json_encode($values);
// =============== STEP 1: Main duplicate check ===============
if (!isset($seenRows[$rowKey])) {
$seenRows[$rowKey] = [$rowIndex];
} else {
// First duplicate occurrence — mark all related rows
$seenRows[$rowKey][] = $rowIndex;
$indexes = $seenRows[$rowKey];
$rows_str = implode(', ', array_map(fn($i) => $i + 1, $indexes));
$error_message = "Duplicate found in selected columns: Rows {$rows_str} are identical";
foreach ($indexes as $i) {
// Avoid re-adding duplicate errors
if (!in_array($i, $duplicateRows)) {
array_push($err_data['error_summary'], 1);
$err_data['error_data'][$i][$keys[0]]['col_name'] = 'Sl no';
$err_data['error_data'][$i][$keys[0]]['col_idx'] = 0;
$err_data['error_data'][$i][$keys[0]]['error'][] = $error_message;
$duplicateRows[] = $i;
}
}
// Skip email/mobile check for this duplicate row
continue;
}
// =============== STEP 2: Email & Mobile check (only if not duplicate) ===============
$email = isset($row[$exl_col['email']['col_idx']]) ? trim($row[$exl_col['email']['col_idx']]) : '';
$mobile = isset($row[$exl_col['mobile']['col_idx']]) ? trim($row[$exl_col['mobile']['col_idx']]) : '';
// Check email duplicates
if ($email !== '') {
if (isset($emailSeen[$email])) {
$firstIndex = $emailSeen[$email] + 1;
$currentRow = $rowIndex + 1;
$error_message = "Duplicate email found: Row {$currentRow} and Row {$firstIndex} have the same email '$email'";
array_push($err_data['error_summary'], 1);
$err_data['error_data'][$rowIndex][$keys[$exl_col['email']['col_idx']]]['col_name'] = $exl_col['email']['col_name'];
$err_data['error_data'][$rowIndex][$keys[$exl_col['email']['col_idx']]]['col_idx'] = $exl_col['email']['col_idx'];
$err_data['error_data'][$rowIndex][$keys[$exl_col['email']['col_idx']]]['error'][] = $error_message;
} else {
$emailSeen[$email] = $rowIndex;
}
}
// Check mobile duplicates
if ($mobile !== '') {
if (isset($mobileSeen[$mobile])) {
$firstIndex = $mobileSeen[$mobile] + 1;
$currentRow = $rowIndex + 1;
$error_message = "Duplicate mobile number found: Row {$currentRow} and Row {$firstIndex} have the same mobile '$mobile'";
array_push($err_data['error_summary'], 1);
$err_data['error_data'][$rowIndex][$keys[$exl_col['mobile']['col_idx']]]['col_name'] = $exl_col['mobile']['col_name'];
$err_data['error_data'][$rowIndex][$keys[$exl_col['mobile']['col_idx']]]['col_idx'] = $exl_col['mobile']['col_idx'];
$err_data['error_data'][$rowIndex][$keys[$exl_col['mobile']['col_idx']]]['error'][] = $error_message;
} else {
$mobileSeen[$mobile] = $rowIndex;
}
}
}
return $err_data;
}
}
if (!function_exists('check_relationship_for_member_data')) {
function check_relationship_for_member_data($row, $relationship, $columns_to_check)
{
$relation_col_idx = $columns_to_check['relationship']['col_idx'] ?? null;
$gender_col_idx = $columns_to_check['gender']['col_idx'] ?? null;
if ($relation_col_idx !== null && $gender_col_idx !== null && !empty($row[$relation_col_idx]) && !empty($row[$gender_col_idx])) { //$row[5] = relationship $row[4] = Gender
$slug = \Config\Services::slug();
$col = $slug->slugify($row[$relation_col_idx]);
if ($col != 'self' && $col != 'spouse') {
if (!isset($relationship[$col])) {
return array('status' => false, 'error' => 'Rule Conflict: Unknown Relationship');
}
if (isset($relationship[$col]) && $relationship[$col]['gender'] != $row[$gender_col_idx]) {
$error = "Gender relationship conflict: Expected " . $relationship[$col]['gender'] . ", received $row[$gender_col_idx]";
return array('status' => false, 'error' => $error);
}
}
return array('status' => true);
} else {
return array('status' => false, 'error' => 'Rule Conflict: Both Relationship and Gender required for check relationship conflict');
}
}
}
if (!function_exists('member_data_group_by_family')) {
function member_data_group_by_family($member_data, $columns_to_check)
{
$result = [];
// Kint::dump($member_data);
foreach ($member_data as $rowIndex => $row) {
if (!check_row_is_empty_or_null($row)) {
$row['row_index'] = $rowIndex;
$relation_idx = $columns_to_check['relationship']['col_idx'];
$emp_code_idx = $columns_to_check['emp_code']['col_idx'];
if (isset($row[$relation_idx]) && strtolower($row[$relation_idx]) == 'self' && isset($result[$row[$emp_code_idx]])) {
array_unshift($result[$row[$emp_code_idx]], $row);
} else {
$result[$row[$emp_code_idx]][] = $row;
}
}
}
return $result;
}
}
if (!function_exists('validateFamily')) {
function validateFamily($familyData, $columns_to_check, $errors) {
$keys = array_keys($columns_to_check);
foreach ($familyData as $familyId => $members) {
$selfMember = null;
$spouseMember = null;
$selfCount = 0;
$row_index = null;
// Find Self and Spouse members
foreach ($members as $member) {
$relation = trim($member[3]); // Relationship field
if (strtolower($relation) == 'self') {
$selfCount++;
$selfMember = $member;
}
if (strtolower($relation) == 'spouse') {
$spouseMember = $member;
}
if($row_index == null){
if(strtolower($relation) == 'self'){
$row_index = $member['row_index'];
}else if(strtolower($relation) == 'spouse'){
$row_index = $member['row_index'];
}else{
$row_index = $member['row_index'];
}
}
}
// Validation 1: Check if Self exists
if ($selfCount === 0) {
$message = "Emp ID - {$familyId}: Missing 'Self' member";
array_push($errors['error_summary'], 4);
$errors['error_data'][$row_index][$keys[$columns_to_check['emp_code']['col_idx']]]['col_name'] = $columns_to_check['emp_code']['col_name'];
$errors['error_data'][$row_index][$keys[$columns_to_check['emp_code']['col_idx']]]['col_idx'] = $columns_to_check['emp_code']['col_idx'];
$errors['error_data'][$row_index][$keys[$columns_to_check['emp_code']['col_idx']]]['error'][] = $message;
continue;
}
// Validation 2: Check if there's exactly one Self
if ($selfCount > 1) {
$message = "Emp ID - {$familyId}: Multiple 'Self' members found. Only one 'Self' is allowed per family";
array_push($errors['error_summary'], 5);
$errors['error_data'][$row_index][$keys[$columns_to_check['emp_code']['col_idx']]]['col_name'] = $columns_to_check['emp_code']['col_name'];
$errors['error_data'][$row_index][$keys[$columns_to_check['emp_code']['col_idx']]]['col_idx'] = $columns_to_check['emp_code']['col_idx'];
$errors['error_data'][$row_index][$keys[$columns_to_check['emp_code']['col_idx']]]['error'][] = $message;
continue;
}
// Validation 3: Validate spouse gender if spouse exists
if ($spouseMember !== null) {
$selfGender = strtoupper(trim($selfMember[4])); // Gender field
$spouseGender = strtoupper(trim($spouseMember[4]));
$selfName = $selfMember[2]; // Name field
$spouseName = $spouseMember[2];
// Check gender compatibility
$message = '';
if ($selfGender === 'M' && $spouseGender !== 'F') {
$message = "Emp ID - {$familyId}: Self ('{$selfName}') is Male (M); spouse must be Female (F). Found spouse ('{$spouseName}') with gender '({$spouseGender})'.";
} elseif ($selfGender === 'F' && $spouseGender !== 'M') {
$message = "Emp ID - {$familyId}: Self ('{$selfName}') is Female (F); spouse must be Male (M). Found spouse ('{$spouseName}') with gender '({$spouseGender})'.";
} elseif (!in_array($selfGender, ['M', 'F'])) {
$message = "Emp ID - {$familyId}: Invalid gender for Self member ('{$selfName}'). Expected 'M' or 'F', found '({$selfGender})'.";
}
if(isset($message) && !empty($message)){
array_push($errors['error_summary'], 6);
$errors['error_data'][$row_index][$keys[$columns_to_check['emp_code']['col_idx']]]['col_name'] = $columns_to_check['emp_code']['col_name'];
$errors['error_data'][$row_index][$keys[$columns_to_check['emp_code']['col_idx']]]['col_idx'] = $columns_to_check['emp_code']['col_idx'];
$errors['error_data'][$row_index][$keys[$columns_to_check['emp_code']['col_idx']]]['error'][] = $message;
}
}
}
return $errors;
}
}
if (!function_exists('check_age_validation')) {
function check_age_validation($row, $family_composition)
{
if ($row[5] != null) {
$dateString = convert_string_to_date($row[5]);
if ($dateString === false) {
return array('status' => false, 'error' => 'Not a valid Date');
}
$relationships = $family_composition['age_ratio'];
$dob = $dateString;
$currentDateTime = new DateTime();
$passedDateTime = new DateTime($dob);
$interval = $currentDateTime->diff($passedDateTime);
$slug = \Config\Services::slug();
$relationship = $slug->slugify($row[3]);
if($relationship == 'son' || $relationship == 'daughter'){
$relationship = 'child';
}
if($relationship == 'father' || $relationship == 'mother' || $relationship == 'mother-in-law'|| $relationship == 'father-in-law' ){
$relationship = 'elders';
}
$age_min = isset($relationships[$relationship]['min']) ? $relationships[$relationship]['min'] : NULL;
$age_max = isset($relationships[$relationship]['max']) ? $relationships[$relationship]['max'] : NULL;
// Kint::dump($dob,$currentDateTime,$passedDateTime, $interval->y, $age_min, $age_max, $relationship, $relationships);
if ($age_min !== null && $age_min > $interval->y) {
return array('status' => false, 'error' => "Age conflict : minimum $age_min yrs allowed, received $interval->y");
}
if ($age_max !== null && $age_max < $interval->y) {
return array('status' => false, 'error' => "Age conflict : maximum $age_max yrs allowed, received $interval->y");
}
return array('status' => true);
} else {
return array('status' => false, 'error' => 'Rule Conflict: Both DOB and Relationship required for age check');
}
}
}
// ------------- END OF LEAD MEMBER DATA LIST VALIDATIONS --------------------------------------

View File

@ -0,0 +1,44 @@
<?php
use CodeIgniter\Database\BaseConnection;
if (!function_exists('sendOtpSms')) {
function sendOtpSms(string $mobile, string $otp)
{
$apiKey = env('SMS_API_KEY');
$senderId = env('SMS_SENDER_ID');
$templateId = env('SMS_TEMPLATE_ID');
$serviceName = env('SMS_SERVICE_NAME');
$appName = env('SMS_APP_NAME');
// Replace variables {#var#}
$message = "Hi, Your One Time Code for logging into Nhance {$appName} App is {$otp}. Valid for 3 minutes. Please do not share this with anyone. -NHANCE";
log_message('info' , 'SMS - Message '.$message);
// Build the API URL
$url = "https://smsapi.24x7sms.com/api_2.0/SendSMS.aspx?" . http_build_query([
'APIKEY' => $apiKey,
'MobileNo' => $mobile,
'SenderID' => $senderId,
'Message' => $message,
'ServiceName' => $serviceName,
'DLTTemplateID' => $templateId,
]);
// Send request
$response = @file_get_contents($url);
log_message('info' , 'SMS - Response '.$response);
// If response failed
if ($response === FALSE) {
return ['status' => 'failed', 'message' => 'Failed to send SMS.'];
}
return ['status' => 'success', 'message' => 'OTP sent successfully', 'api_response' => $response];
}
}

View File

@ -25,6 +25,7 @@ class ClientBranchModel extends Model
"gst", "gst",
"sez", "sez",
"units", "units",
"pre_branch_id"
]; ];
public function getBranchAndContactByBranchId($branch_id){ public function getBranchAndContactByBranchId($branch_id){

View File

@ -108,7 +108,7 @@ class ClientModel extends Model
} }
public function getCreatedByUserName(){ public function getCreatedByUserName($client_type = null){
$role_id = get_role_id(); $role_id = get_role_id();
$user_id = get_session_userid(); $user_id = get_session_userid();
@ -118,6 +118,10 @@ class ClientModel extends Model
->join('client_rm', 'client_rm.client_id = clients.id','left') ->join('client_rm', 'client_rm.client_id = clients.id','left')
->where('clients.is_active', 1); ->where('clients.is_active', 1);
if (!empty($client_type)) {
$query->where('clients.client_type', $client_type);
}
if (in_array($role_id, [2, 3])) { if (in_array($role_id, [2, 3])) {
// If the user is a Account Manager or Manager, filter by user_id // If the user is a Account Manager or Manager, filter by user_id
@ -222,5 +226,18 @@ class ClientModel extends Model
return $result; return $result;
} }
public function isDuplicateByClientBranch($value, $field, $clientId, $branchId)
{
$builder = $this->db->table('level_contacts lc')
->select('lc.id')
->join('client_branch cb', 'lc.ref_id = cb.id', 'left')
->where('lc.'.$field, $value)
->where('lc.contact_type', 'client')
->where('cb.client_id', $clientId)
->where('lc.ref_id', $branchId)
->get();
return $builder->getNumRows() > 0 ? true : false;
}
} }

View File

@ -106,9 +106,9 @@ class EmployeeModel extends Model
} }
public function getEmpFamilybyEmpCode(string $client_policy_id = null,string $emp_code = null,string $client_id = null,array $emp_status = [],array $policy_status = [],array $relationship = [],array $client_branch_id = []) public function getEmpFamilybyEmpCode(string $client_policy_id = null,string $emp_code = null,string $client_id = null,array $emp_status = [],array $policy_status = [],array $relationship = [],array $client_branch_id = [],array $policy_type_id = [])
{ {
$result = $this->select(['employees.id as emp_id', 'employees.client_id','employees.client_branch_id', 'employees.relationship', 'employees.relationship_code', 'employees.change_event', 'employees.emp_code', 'employees.name', 'employees.email_personal', 'employees.email_corporate', 'employees.mobile', 'employees.gender', 'employees.dob', 'employees.doj', 'employees.basic_pay', 'employees.band', 'employees.designation', 'employees.emp_status','employees.unit','employees.file_id','employee_polices.id as emp_policy_id', 'employee_polices.employee_id', 'employee_polices.client_policy_id', 'employee_polices.tpa_id', 'employee_polices.uhid', 'employee_polices.batch_code', 'employee_polices.status', 'employee_polices.pre_existing_alignments', 'employee_polices.basic_cover_si', 'employee_polices.date_coverage', 'employee_polices.policy_end_date', 'employee_polices.days', 'employee_polices.premium', 'employee_polices.rata_premimum', 'employee_polices.gst', 'employee_polices.date_of_exit', 'employee_polices.reason_for_exit','policy_type.long_name as policy_name','client_policy.is_addon', 'employee_polices.payable_employee','employee_polices.rand_string','employee_polices.claim_status']) $result = $this->select(['employees.id as emp_id', 'employees.client_id','employees.client_branch_id', 'employees.relationship', 'employees.relationship_code', 'employees.change_event', 'employees.emp_code', 'employees.name', 'employees.email_personal', 'employees.email_corporate', 'employees.mobile', 'employees.gender', 'employees.dob', 'employees.doj', 'employees.basic_pay', 'employees.band', 'employees.designation', 'employees.emp_status','employees.unit','employees.file_id','employee_polices.id as emp_policy_id', 'employee_polices.employee_id', 'employee_polices.client_policy_id', 'employee_polices.tpa_id', 'employee_polices.uhid', 'employee_polices.batch_code', 'employee_polices.status', 'employee_polices.pre_existing_alignments', 'employee_polices.basic_cover_si', 'employee_polices.date_coverage', 'employee_polices.policy_end_date', 'employee_polices.days', 'employee_polices.premium', 'employee_polices.rata_premimum', 'employee_polices.gst', 'employee_polices.date_of_exit', 'employee_polices.reason_for_exit','policy_type.long_name as policy_name','client_policy.policy_type_id','client_policy.is_addon', 'employee_polices.payable_employee','employee_polices.rand_string','employee_polices.claim_status'])
->join('employee_polices', 'employee_polices.employee_id = employees.id') ->join('employee_polices', 'employee_polices.employee_id = employees.id')
->join('client_policy', 'client_policy.id = employee_polices.client_policy_id') ->join('client_policy', 'client_policy.id = employee_polices.client_policy_id')
->join('policy_type', 'policy_type.id = client_policy.policy_type_id','left') ->join('policy_type', 'policy_type.id = client_policy.policy_type_id','left')
@ -135,6 +135,9 @@ class EmployeeModel extends Model
}) })
->when(count($policy_status), function($query) use ($policy_status){ ->when(count($policy_status), function($query) use ($policy_status){
return $query->whereIn('employee_polices.status', $policy_status); return $query->whereIn('employee_polices.status', $policy_status);
})
->when(count($policy_type_id), function($query) use ($policy_type_id){
return $query->whereIn('client_policy.policy_type_id', $policy_type_id);
}) })
->when($client_id, function($query) use ($client_id){ ->when($client_id, function($query) use ($client_id){
return $query->where('employees.client_id',$client_id); return $query->where('employees.client_id',$client_id);

View File

@ -13,6 +13,9 @@ class HRAccessControlModel extends Model
'pre_hr_id', 'pre_hr_id',
'post_hr_id', 'post_hr_id',
'post_client_id', 'post_client_id',
'pre_client_id',
'pre_branch_id',
'post_branch_id',
'allowed_modules', 'allowed_modules',
'allowed_pre_policies', 'allowed_pre_policies',
'allowed_active_policies', 'allowed_active_policies',

View File

@ -17,7 +17,10 @@ class LeadFilesModel extends Model
'updated_by', 'updated_by',
'created_at', 'created_at',
'updated_at', 'updated_at',
'is_active' 'is_active',
'error_data',
'status',
'type',
]; ];
// Callbacks // Callbacks

View File

@ -105,6 +105,7 @@ class LeadsModel extends Model
'next_reminder_date', 'next_reminder_date',
'is_insurer_auto_mail', 'is_insurer_auto_mail',
'quote_received_insurer', 'quote_received_insurer',
'acm_id',
]; ];
@ -146,6 +147,7 @@ class LeadsModel extends Model
$data = $this->select(' $data = $this->select('
leads.*, leads.*,
lead_files.status as demography_file_status,
kyc_entity_type.name as entity_type, kyc_entity_type.name as entity_type,
policy_type.policy_type, policy_type.policy_type,
user_profiles.first_name as salse_person_name, user_profiles.first_name as salse_person_name,
@ -168,6 +170,7 @@ class LeadsModel extends Model
->join('kyc_entity_type', 'leads.entity_type_id = kyc_entity_type.id', 'left') ->join('kyc_entity_type', 'leads.entity_type_id = kyc_entity_type.id', 'left')
->join('user_profiles', 'leads.salse_person_id = user_profiles.id', 'left') ->join('user_profiles', 'leads.salse_person_id = user_profiles.id', 'left')
->join('policy_type', 'leads.policy_type_id = policy_type.id', 'left') ->join('policy_type', 'leads.policy_type_id = policy_type.id', 'left')
->join('lead_files', 'leads.id = lead_files.lead_id AND lead_files.type = 2 AND lead_files.is_active = 1', 'left')
->where('leads.is_active', 1); ->where('leads.is_active', 1);
if (!empty($where)) { if (!empty($where)) {

View File

@ -47,4 +47,55 @@ class PartnerStaffModel extends Model
// ]; // ];
// protected $skipValidation = false; // protected $skipValidation = false;
public function updateByKey($key)
{
$db = \Config\Database::connect();
$message = "";
// Start transaction
$db->transStart();
try {
// 1. Update manager
$db->table('partner_staff')
->where('id', $key)
->set('is_active', 0)
->update();
$managerRows = $db->affectedRows();
$message = "{$managerRows} manager(s), ";
// 2. Update agents under manager
$db->table('partner_agent')
->where('manager_id', $key)
->set('is_active', 0)
->update();
$agentRows = $db->affectedRows();
$message .= "{$agentRows} agent(s), ";
// 3. Update staff under manager
$db->table('partner_staff')
->where('manager_id', $key)
->set('is_active', 0)
->update();
$staffRows = $db->affectedRows();
$message .= "{$staffRows} staff(s)";
// Complete transaction
$db->transComplete();
// Check transaction status
if ($db->transStatus() === false) {
return "Transaction failed. No updates were applied.";
}
return $message . " are deleted successfully";
} catch (\Exception $e) {
// Rollback in case of exception
$db->transRollback();
return "Error: " . $e->getMessage();
}
}
} }

View File

@ -182,21 +182,20 @@
</style> </style>
<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()))) { ?> <?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()))) { ?>
<div class="row" id="client_add" style="margin-top: -32px;"> <div class="row" id="client_add" >
<div class="col-12"> <div class="col-12">
<!-- <div class="card"> --> <!-- <div class="card"> -->
<div class="card-body"> <div class="card-body">
<ul class="nav nav-pills navtab-bg"> <ul class="nav nav-pills navtab-bg nav-dash" >
<?php if(in_array(get_role_id(), [1,2,3,5])) { ?> <?php if(in_array(get_role_id(), [1,2,3,5])) { ?>
<li class="nav-item d-flex justify-content-center align-items-center"> <li class="nav-item d-flex justify-content-center align-items-center">
<a href="#pending-actions-dash-tab" data-toggle="tab" aria-expanded="false" <a href="#pending-actions-dash-tab" data-toggle="tab" aria-expanded="false"
class="nav-link px-3 py-1 dash-anchor" id="pending_actions_tab"> class="nav-link px-3 py-1 dash-anchor nav-dash" id="pending_actions_tab">
<img src="<?= base_url() . "public"; ?>/assets/images/inactive_pending_actions.png" alt="Logo" height="14" class="inactive_pending" > <img src="<?= base_url() . "public"; ?>/assets/images/inactive_pending_actions.png" alt="Logo" height="14" class="inactive_pending" >
<img src="<?= base_url() . "public"; ?>/assets/images/active_pending_actions.png" alt="Logo" height="14" <img src="<?= base_url() . "public"; ?>/assets/images/active_pending_actions.png" alt="Logo" height="14"
class="active_pending" style="display:none;"> class="active_pending" style="display:none;">
@ -210,7 +209,7 @@
<?php if(in_array(get_role_id(), [1,2,3,5]) || (get_role_id() == 4 && in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()))) { ?> <?php if(in_array(get_role_id(), [1,2,3,5]) || (get_role_id() == 4 && in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()))) { ?>
<li class="nav-item d-flex justify-content-center align-items-center"> <li class="nav-item d-flex justify-content-center align-items-center">
<a href="#bds-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-1 dash-anchor" id="bds_tab"> <a href="#bds-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-1 dash-anchor nav-dash" id="bds_tab">
<img src="<?= base_url() . "public"; ?>/assets/images/inactive_bds.png" alt="Logo" height="14" class="inactive_bds"> <img src="<?= base_url() . "public"; ?>/assets/images/inactive_bds.png" alt="Logo" height="14" class="inactive_bds">
<img src="<?= base_url() . "public"; ?>/assets/images/active_bds.png" alt="Logo" height="14" <img src="<?= base_url() . "public"; ?>/assets/images/active_bds.png" alt="Logo" height="14"
class="active_bds " style="display:none;"> class="active_bds " style="display:none;">
@ -226,7 +225,7 @@
$isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team()) ? 'active show' : ''; $isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team()) ? 'active show' : '';
?> ?>
<li class="nav-item d-flex justify-content-center align-items-center"> <li class="nav-item d-flex justify-content-center align-items-center">
<a href="#claims-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-1 dash-anchor" id="claims_tab"> <a href="#claims-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-1 dash-anchor nav-dash" id="claims_tab">
<img src="<?= base_url() . "public"; ?>/assets/images/inactive_claims.png" alt="Logo" height="14" class="inactive_claims"> <img src="<?= base_url() . "public"; ?>/assets/images/inactive_claims.png" alt="Logo" height="14" class="inactive_claims">
<img src="<?= base_url() . "public"; ?>/assets/images/active_claims.png" alt="Logo" height="14" <img src="<?= base_url() . "public"; ?>/assets/images/active_claims.png" alt="Logo" height="14"
class="active_claims " style="display:none;"> class="active_claims " style="display:none;">
@ -241,7 +240,7 @@
$isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID,user_team()) ? 'active show' : ''; $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID,user_team()) ? 'active show' : '';
?> ?>
<li class="nav-item d-flex justify-content-center align-items-center "> <li class="nav-item d-flex justify-content-center align-items-center ">
<a href="#leads-dash-tab " data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-1 dash-anchor" id="leads_tab" > <a href="#leads-dash-tab " data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-1 dash-anchor nav-dash" id="leads_tab" >
<img src="<?= base_url() . "public"; ?>/assets/images/inactive_leads_and_bds_renewal.png" alt="Logo" height="14" class="inactive_leads"> <img src="<?= base_url() . "public"; ?>/assets/images/inactive_leads_and_bds_renewal.png" alt="Logo" height="14" class="inactive_leads">
<img src="<?= base_url() . "public"; ?>/assets/images/active_leads_and_bds_renewal.png" alt="Logo" height="14" <img src="<?= base_url() . "public"; ?>/assets/images/active_leads_and_bds_renewal.png" alt="Logo" height="14"
class="active_leads " style="display:none;"> class="active_leads " style="display:none;">

View File

@ -37,10 +37,10 @@ table.dataTable tbody td {
</style> --> </style> -->
<style> <style>
body { /* body {
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
padding: 20px; padding: 20px;
} } */
#mobile::placeholder, #mobile::placeholder,
#mobile_no::placeholder { #mobile_no::placeholder {
@ -348,12 +348,12 @@ table.dataTable tbody td {
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body maincard"> <div class="card-body maincard">
<div class="row" style="margin-bottom:1rem;"> <!-- <div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Users</h4> <h4 style="position: relative;">Users</h4>
</div> </div>
</div> </div> -->
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="1" id="user-table"> <table data-custom-table-css="table" class="table table-sm m-0 table-centered dt-responsive nowrap w-100" cellspacing="a" id="user-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">Name</th> <th class="font-weight-medium">Name</th>
@ -391,15 +391,15 @@ table.dataTable tbody td {
</table> </table>
<!-- <table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap text-custom-black text-custom 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"> <thead class="bg-light">
<tr> <tr>
<th>Ticket ID</th> <th>Ticket ID</th>
<th class="app-text-left">Name</th> <th class="text-left">Name</th>
<th>Policy Number</th> <th>Policy Number</th>
<th>Ticket Type</th> <th>Ticket Type</th>
<th>Subject</th> <th>Subject</th>
<th>Status</th> <th>Status</th>
<th class="app-text-left">Assign To</th> <th class="text-left">Assign To</th>
<th>Created At</th> <th>Created At</th>
<th>Updated At</th> <th>Updated At</th>
</tr> </tr>
@ -409,18 +409,18 @@ table.dataTable tbody td {
<?php foreach($ticket_data as $index => $row){ ?> <?php foreach($ticket_data as $index => $row){ ?>
<tr data-id="<?= $row['thz_id']; ?>" style="cursor: pointer;"> <tr data-id="<?= $row['thz_id']; ?>" style="cursor: pointer;">
<td class="app-text-right"><?php echo $row['thz_id']; ?></td> <td class="text-right"><?php echo $row['thz_id']; ?></td>
<td class="app-text-left"> <td class="text-left">
<?php echo $row['name']; ?> <?php echo $row['name']; ?>
<span class="text-custom-grey"><?php if (!empty($row['empcode'])): echo '('.$row['empcode'].')'; endif; ?></span><br> <span class="text-custom-grey"><?php if (!empty($row['empcode'])): echo '('.$row['empcode'].')'; endif; ?></span><br>
<span class="text-custom-grey"><?php if (!empty($row['mobile'])): echo $row['mobile']; endif; ?></span> <span class="text-custom-grey"><?php if (!empty($row['mobile'])): echo $row['mobile']; endif; ?></span>
</td> </td>
<td class="app-text-center"><?php echo (!empty($row['policy_no']) && strtolower($row['policy_no']) !== 'null') <td class="text-center"><?php echo (!empty($row['policy_no']) && strtolower($row['policy_no']) !== 'null')
? $row['policy_no'] ? $row['policy_no']
: 'N/A'; ?> : 'N/A'; ?>
</td> </td>
<td class="app-text-center"><?php echo $row['ticket_type'] ? $row['ticket_type'] : '-'; ?></td> <td class="text-center"><?php echo $row['ticket_type'] ? $row['ticket_type'] : '-'; ?></td>
<td class="app-text-center wrap" title="<?php echo htmlspecialchars($row['subject']); ?>"> <td class="text-center wrap" title="<?php echo htmlspecialchars($row['subject']); ?>">
<?php <?php
$subject = $row['subject'] ? $row['subject'] : 'N/A'; $subject = $row['subject'] ? $row['subject'] : 'N/A';
echo (strlen($subject) > 50) echo (strlen($subject) > 50)
@ -428,9 +428,9 @@ table.dataTable tbody td {
: htmlspecialchars($subject); : htmlspecialchars($subject);
?> ?>
</td> </td>
<td class="app-text-center"><?php echo $row['status'] ? $row['status'] : '-' ; ?></td> <td class="text-center"><?php echo $row['status'] ? $row['status'] : '-' ; ?></td>
<td class="app-text-left"><?php echo $row['assignee_name'] ? $row['assignee_name'] : '-'; ?></td> <td class="text-left"><?php echo $row['assignee_name'] ? $row['assignee_name'] : '-'; ?></td>
<td class="app-text-left"> <td class="text-left">
<?php if (!empty($row['created_at'])): <?php if (!empty($row['created_at'])):
$cd = date("j F Y", strtotime($row['created_at'])); $cd = date("j F Y", strtotime($row['created_at']));
$ct = date("h:i a", strtotime($row['created_at'])); $ct = date("h:i a", strtotime($row['created_at']));
@ -438,7 +438,7 @@ table.dataTable tbody td {
endif; endif;
?> ?>
</td> </td>
<td class="app-text-left"> <td class="text-left">
<?php if (!empty($row['updated_at'])): <?php if (!empty($row['updated_at'])):
$ud = date("j F Y", strtotime($row['updated_at'])); $ud = date("j F Y", strtotime($row['updated_at']));
$ut = date("h:i a", strtotime($row['updated_at'])); $ut = date("h:i a", strtotime($row['updated_at']));
@ -873,22 +873,32 @@ table.dataTable tbody td {
{ {
extend: 'csv', extend: 'csv',
text: '<i class="mdi mdi-file-delimited"></i><span class="btn-custom"> CSV </span>', text: '<i class="mdi mdi-file-delimited"></i><span class="btn-custom"> CSV </span>',
className: 'app-btn-primary' className: 'app-btn-primary',
exportOptions: {
columns: ':not(:last-child)'
}
}, },
{ {
extend: 'excel', extend: 'excel',
text: '<i class="mdi mdi-file-excel"></i><span class="btn-custom"> EXCEL </span>', text: '<i class="mdi mdi-file-excel"></i><span class="btn-custom"> EXCEL </span>',
exportOptions: { orthogonal: 'sort' }, exportOptions: { orthogonal: 'sort' },
className: 'app-btn-primary' className: 'app-btn-primary',
exportOptions: {
columns: ':not(:last-child)'
}
} }
] ]
} }
], ],
paging: true, paging: true,
pageLength: 25, pageLength: 10,
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
initComplete: function () { initComplete: function () {
$(".dt-buttons").prepend(` $(".dt-buttons").prepend(`
@ -1022,9 +1032,17 @@ table.dataTable tbody td {
}); });
$('body').on('click', '.btnPartnerDelete', function () { $('body').on('click', '.btnPartnerDelete', function () {
var partner_role = $(this).attr('data-role');
var alertText = "You need to remove this user";
if (partner_role == 2) {
alertText = "You need to remove this Staff";
} else if (partner_role == 1) {
alertText = "You need to remove this Manager and related agent and staff are also delete";
}
Swal.fire({ Swal.fire({
title: "Are you sure?", title: "Are you sure?",
text: "You need to remove this user", text: alertText,
icon: "info", icon: "info",
showCancelButton: true, showCancelButton: true,
confirmButtonColor: "#3085d6", confirmButtonColor: "#3085d6",
@ -1160,6 +1178,9 @@ table.dataTable tbody td {
complete: function() { complete: function() {
btn.disabled = false; btn.disabled = false;
btn.innerText = "Submit"; btn.innerText = "Submit";
$('#nhance-partner-modal').removeClass('show').hide();
$('.modal-backdrop').remove();
loadPartner();
} }
}); });
} }
@ -1258,7 +1279,7 @@ table.dataTable tbody td {
row.name, row.name,
row.email, row.email,
row.mobile, row.mobile,
'Staff', row.role_id == 1 ? "Manager" : "Staff",
`<span class="badge ${statusClass}">${statusText}</span>`, `<span class="badge ${statusClass}">${statusText}</span>`,
`<div class="btn-group dropdown"> `<div class="btn-group dropdown">
<a href="javascript:void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"> <a href="javascript:void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown">
@ -1268,8 +1289,8 @@ table.dataTable tbody td {
<a data-toggle="modal" data-target="#nhance-partner-modal" class="dropdown-item btnPartnerEdit" data-obj='${JSON.stringify(row)}'> <a data-toggle="modal" data-target="#nhance-partner-modal" class="dropdown-item btnPartnerEdit" data-obj='${JSON.stringify(row)}'>
<i data-obj='${JSON.stringify(row)}' class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle btnPartnerEdit"></i>Edit <i data-obj='${JSON.stringify(row)}' class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle btnPartnerEdit"></i>Edit
</a> </a>
<a class="dropdown-item btnPartnerDelete" data-id="${row.id}"> <a class="dropdown-item btnPartnerDelete" data-id="${row.id}" data-role="${row.role_id}">
<i data-id="${row.id}" class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle btnPartnerDelete"></i>Delete <i data-id="${row.id}" data-role="${row.role_id}" class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle btnPartnerDelete"></i>Delete
</a> </a>
<a class="dropdown-item btnPartnerPerformance" data-id="${row.id}"> <a class="dropdown-item btnPartnerPerformance" data-id="${row.id}">
<i data-id="${row.id}" class="mdi mdi-speedometer mr-2 text-muted font-18 vertical-middle btnPartnerPerformance"></i>View Performance <i data-id="${row.id}" class="mdi mdi-speedometer mr-2 text-muted font-18 vertical-middle btnPartnerPerformance"></i>View Performance
@ -1439,7 +1460,7 @@ table.dataTable tbody td {
hour12: false hour12: false
}; };
let uploaded = date.toLocaleString('en-GB', options).replace(',', ''); let uploaded = date.toLocaleString('en-GB', options).replace(',', '');
let color = file.incentive_file_name ? "app-text-success" : "app-text-black"; let color = file.incentive_file_name ? "app-text-success" : "font-color-black";
let download_url = "<?= base_url('user/download-incentive-file/') ?>" + encodeURIComponent(file.id); let download_url = "<?= base_url('user/download-incentive-file/') ?>" + encodeURIComponent(file.id);
let im = file.incentive_month; let im = file.incentive_month;
@ -1450,10 +1471,10 @@ table.dataTable tbody td {
<div class="d-flex align-items-center justify-content-between border rounded p-2 bg-white"> <div class="d-flex align-items-center justify-content-between border rounded p-2 bg-white">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="file-icon-box d-flex align-items-center justify-content-center"> <div class="file-icon-box d-flex align-items-center justify-content-center">
<i class="mdi mdi-file-document-outline app-text-black" style="font-size: 24px;"></i> <i class="mdi mdi-file-document-outline font-color-black" style="font-size: 24px;"></i>
</div> </div>
<div class="ml-2"> <div class="ml-2">
<div class="font-weight-bold app-text-black small text-truncate" <div class="font-weight-bold font-color-black small text-truncate"
title="${file.incentive_file_name}" title="${file.incentive_file_name}"
style="max-width: 265px;"> style="max-width: 265px;">
${file.incentive_file_name} ${file.incentive_file_name}
@ -1694,10 +1715,11 @@ table.dataTable tbody td {
}); });
$(document).on('click', '#btnNhancePartnerAdd', function(){ $(document).on('click', '#btnNhancePartnerAdd', function(){
$('#partner_name').val(''); $('#partner_name').val('');
$('#email').val(''); $('#email_addr').val('');
$('#partner_id').val(''); $('#partner_id').val('');
$('#mobile_no').val(''); $('#mobile_no').val('');
$('#locn').val(''); $('#locn').val('');
$('.modal-title').html('Add Nhance Partner');
$('#PartnerForm').attr('action', '<?php echo base_url('/user/partner');?>'); $('#PartnerForm').attr('action', '<?php echo base_url('/user/partner');?>');
let myModal = new bootstrap.Modal(document.getElementById('nhance-partner-modal')); let myModal = new bootstrap.Modal(document.getElementById('nhance-partner-modal'));
myModal.show(); // open modal myModal.show(); // open modal

View File

@ -24,7 +24,7 @@ table.dataTable thead th {
<div class="card-body"> <div class="card-body">
<div class="row" style="margin-bottom:1rem;"> <div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Advertisement Image List</h4> <h4 style="position: relative;">Advertisement Images</h4>
</div> </div>
<div class="col-6" style="text-align: right; position: relative;top: 5px;"> <div class="col-6" style="text-align: right; position: relative;top: 5px;">
<a data-toggle="modal" data-target="#bike_make_login-modal" href="#" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a> <a data-toggle="modal" data-target="#bike_make_login-modal" href="#" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a>
@ -75,18 +75,23 @@ table.dataTable thead th {
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-body"> <div class="modal-body">
<div class="text-center mt-2 mb-4"> <div class="mt-2 mb-4">
<h4 id="advertise_add_edit">Add Advertise Image </h4> <h4 id="advertise_add_edit">Add Advertise Image </h4>
</div> </div>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form id="model_form_data" class="px-4"> <form id="model_form_data" class="px-4">
<input type="text" name="add_image_id" id="add_image_id" value="0" hidden> <input type="text" name="add_image_id" id="add_image_id" value="0" hidden>
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-12">
<div class="form-group"> <div class="form-group">
<label for="branchname">Image</label> <label for="branchname">Upload Image</label>
<input class="form-control" name="advertise_image" id="advertise_image" type="file" accept="image/*" onchange="PreviewImage();" required=""> <div class="input-icon">
<input type="file" class="form-control" name="advertise_image" id="advertise_image"
accept="image/*" onchange="PreviewImage();" required="">
<i class="mdi mdi-upload additional-icon"></i>
</div>
</div> </div>
<div class="form-group col-md-6 float-left" style="position: relative;top: 0px;"> <div class="form-group col-md-6 float-left" style="position: relative;top: 0px;">
<img src=" " width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar"/> <img src=" " width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar"/>

View File

@ -28,20 +28,20 @@
<table data-custom-table-css="table" id="datatable-buttons" class="table table-hover m-0 table-centered dt-responsive w-100"> <table data-custom-table-css="table" id="datatable-buttons" class="table table-hover m-0 table-centered dt-responsive w-100">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">SNO</th> <th class="font-weight-medium">S.No&nbsp;</th>
<th class="font-weight-medium">Batch Code</th> <th class="font-weight-medium">Batch Code&nbsp;</th>
<th class="font-weight-medium">File Name</th> <th class="font-weight-medium">File Name&nbsp;</th>
<th class="font-weight-medium">Client</th> <th class="font-weight-medium">Client&nbsp;</th>
<th class="font-weight-medium">Client Branch</th> <th class="font-weight-medium">Client Branch&nbsp;</th>
<th class="font-weight-medium">Client Policy</th> <th class="font-weight-medium">Client Policy&nbsp;</th>
<th class="font-weight-medium">Event Type</th> <th class="font-weight-medium">Event Type&nbsp;</th>
<th class="font-weight-medium">Insurer/ TPA</th> <th class="font-weight-medium">Insurer/ TPA&nbsp;</th>
<th class="font-weight-medium">Action</th> <th class="font-weight-medium">Action&nbsp;</th>
<th class="font-weight-medium">Count</th> <th class="font-weight-medium">Count&nbsp;</th>
<th class="font-weight-medium">()Amount</th> <th class="font-weight-medium">()Amount&nbsp;</th>
<th class="font-weight-medium">User/Time</th> <th class="font-weight-medium">User/Time&nbsp;</th>
<th class="font-weight-medium">Status</th> <th class="font-weight-medium">Status&nbsp;</th>
<th class="font-weight-medium">Action</th> <th class="font-weight-medium">Action&nbsp;</th>
</tr> </tr>
</thead> </thead>
@ -52,7 +52,7 @@
?> ?>
<tr> <tr>
<td><b><?php echo ($key + 1) ?></b></td> <td class="text-center"><b><?php echo ($key + 1) ?></b></td>
<td><?php echo $file['batch_code'] ?></td> <td><?php echo $file['batch_code'] ?></td>
<td style="overflow: hidden;" class="reload truncate" data-toggle="tooltip" data-placement="top" title="<?php echo $file['file_name'] ?>"> <td style="overflow: hidden;" class="reload truncate" data-toggle="tooltip" data-placement="top" title="<?php echo $file['file_name'] ?>">
<?php echo $file['file_name']?> <?php echo $file['file_name']?>
@ -215,24 +215,42 @@
$(document).ready(function() { $(document).ready(function() {
$('#datatable-buttons').DataTable({ $('#datatable-buttons').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" + dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" +
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
// buttons: [{
// extend: 'csv',
// text: 'CSV',
// title: 'Batch List',
// className: 'my_class',
// }],
// initComplete: function(settings, json) {
// $('.my_class').css({
// position: "relative",
// left: "50px"
// });
// },
buttons: [{ buttons: [{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [
{
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
title: 'Batch List', title: 'Batch List',
className: 'my_class', className: 'app-btn-primary ',
}], }
initComplete: function(settings, json) { ]
$('.my_class').css({ }
position: "relative", ],
left: "50px"
});
},
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true paging: true
}); });

View File

@ -162,7 +162,7 @@
<div class="row d-flex align-items-center"> <div class="row d-flex align-items-center">
<div class="StatusTileHide" style="padding-left: 25px;"> <div class="StatusTileHide" style="padding-left: 25px;">
<a href="#" onclick="hide_status_show_pending_tile()" ><b><i class="mdi mdi-chevron-left mdi-36px"></i></b> </a> <a href="#" onclick="hide_status_show_pending_tile()" ><b><i class="mdi mdi-chevron-left mdi-36px chevron-left-dash"></i></b> </a>
</div> </div>
<div class="StatusTileHide" style="display: none;padding-left: 15px;"> <div class="StatusTileHide" style="display: none;padding-left: 15px;">
<a href="#" id="mainMenuTiles">Current Tile : </a> <a href="#" id="mainMenuTiles">Current Tile : </a>

View File

@ -22,7 +22,6 @@
</style> </style>
<div class="row">
<div class="col-12" id="second_page"> <div class="col-12" id="second_page">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
@ -82,7 +81,6 @@
</div> <!-- end card-body --> </div> <!-- end card-body -->
</div> <!-- end card --> </div> <!-- end card -->
</div> <!-- end col-12 --> </div> <!-- end col-12 -->
</div> <!-- end row -->
<script> <script>
$(document).ready(function() { $(document).ready(function() {
@ -94,22 +92,32 @@
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [ buttons: [
{ {
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
title: 'BDS TAT BAND WISE DATA', title: 'BDS TAT BAND WISE DATA',
}, },
{ {
extend: 'excel', extend: 'excel',
text: 'Excel', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
title: 'BDS TAT BAND WISE DATA', title: 'BDS TAT BAND WISE DATA',
}, },
]
}
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, paging: true,
pageLength: 10, pageLength: 10,

View File

@ -9,8 +9,7 @@ table.dataTable tbody td {
} }
</style> </style>
<div class="row" id="inception_list"> <div class="col-12" id="inception_list">
<div class="col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="margin-bottom:1rem;"> <div class="row" style="margin-bottom:1rem;">
@ -24,7 +23,7 @@ table.dataTable tbody td {
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th> <th>
<div class="column-header">S.No.</div> <div class="column-header">S.No&nbsp;</div>
</th> </th>
<th> <th>
<div class="column-header">Renewal Month</div> <div class="column-header">Renewal Month</div>
@ -100,7 +99,6 @@ table.dataTable tbody td {
</div> </div>
</div> </div>
</div> </div>
</div><!-- end col -->
</div> </div>
<script> <script>
@ -115,24 +113,34 @@ $(document).ready(function() {
dom: "<'row'<'col-sm-2'f><'col-sm-10 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-2'f><'col-sm-10 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [{ buttons: [{
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
title: 'Renewal-List', title: 'Renewal-List',
}, },
{ {
extend: 'excel', extend: 'excel',
text: 'Excel', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
title: 'Renewal-List', title: 'Renewal-List',
exportOptions: { exportOptions: {
orthogonal: 'sort' orthogonal: 'sort'
}, },
} }
]
}
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, // Enable pagination paging: true, // Enable pagination
pageLength: 20, // Set default number of rows per page (optional) pageLength: 20, // Set default number of rows per page (optional)
@ -142,4 +150,39 @@ $(document).ready(function() {
console.error("Table atet found."); console.error("Table atet found.");
} }
}); });
// Global DataTables defaults
$.extend(true, $.fn.dataTable.defaults, {
language: {
search: "", // remove "Search:" label
searchPlaceholder: "Search"
},
paging: true,
pageLength: 10,
ordering: false
});
// Global init hook
$(document).on('init.dt', function (e, settings) {
let $filter = $(settings.nTableWrapper).find('.dataTables_filter');
let $input = $filter.find('input');
if (!$filter.hasClass('custom-search')) {
// Wrap in Bootstrap input-group
$input
.addClass('form-control')
.wrap('<div class="input-group"></div>');
// Append icon
$input.after(`
<span class="input-group-text bg-white border-0">
<i class="mdi mdi-magnify"></i>
</span>
`);
// Align to right
$filter.addClass('text-right custom-search');
}
});
</script> </script>

View File

@ -73,24 +73,37 @@ table.dataTable tbody td {
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [ buttons: [
{ {
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'Insurer-Wise-Report-List', title: 'Insurer-Wise-Report-List',
}, },
{ {
extend: 'excel', extend: 'excel',
text: 'Excel', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
title: 'Insurer-Wise-Report-List', title: 'Insurer-Wise-Report-List',
exportOptions: { exportOptions: {
orthogonal: 'sort' orthogonal: 'sort'
}, },
className: 'app-btn-primary ',
}
]
} }
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, // Enable pagination paging: true, // Enable pagination
pageLength: 10, // Set default number of rows per page (optional) pageLength: 10, // Set default number of rows per page (optional)

View File

@ -73,24 +73,37 @@ table.dataTable tbody td {
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [ buttons: [
{ {
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'Bap-Wise-Report-List', title: 'Bap-Wise-Report-List',
}, },
{ {
extend: 'excel', extend: 'excel',
text: 'Excel', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
title: 'Bap-Wise-Report-List',
exportOptions: { exportOptions: {
orthogonal: 'sort' orthogonal: 'sort'
}, },
className: 'app-btn-primary ',
title: 'Bap-Wise-Report-List',
}
]
} }
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, // Enable pagination paging: true, // Enable pagination
pageLength: 10, // Set default number of rows per page (optional) pageLength: 10, // Set default number of rows per page (optional)

View File

@ -94,22 +94,54 @@
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
// buttons: [
// {
// extend: 'csv',
// text: 'CSV',
// title: 'BDS TAT BAND WISE DATA',
// },
// {
// extend: 'excel',
// text: 'Excel',
// title: 'BDS TAT BAND WISE DATA',
// },
// ],
buttons: [
{
text: '<i class="mdi mdi-plus" ></i><span class=" btn-custom"> Add </span>',
className: 'btn app-btn-primary mr-2',
action: function(e, dt, node, config) {
openTicket();
}
},
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [ buttons: [
{ {
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'BDS TAT BAND WISE DATA', title: 'BDS TAT BAND WISE DATA',
}, },
{ {
extend: 'excel', extend: 'excel',
text: 'Excel', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
title: 'BDS TAT BAND WISE DATA', title: 'BDS TAT BAND WISE DATA',
}, className: 'app-btn-primary ',
}
]
}
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, paging: true,
pageLength: 10, pageLength: 10,

View File

@ -16,6 +16,7 @@ table.dataTable tbody td {
.dataTables_filter { .dataTables_filter {
position: absolute; position: absolute;
} }
.custom-dropdown-menu { .custom-dropdown-menu {
display: none; display: none;
position: absolute; position: absolute;
@ -44,16 +45,18 @@ table.dataTable tbody td {
} }
</style> </style>
<div class="row">
<div class="col-12" style="margin-top: -12px;"> <div class="col-12">
<div class="card-body">
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h5 class="m-1"> <h4 class="m-1">
<span>Filter</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
aria-expanded="true"> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> <i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h5> </h4>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body">
<div class="form-group"> <div class="form-group">
@ -135,16 +138,16 @@ table.dataTable tbody td {
<div class="form-group col-md-3" style="display: none;" id="date_div"> <div class="form-group col-md-3" style="display: none;" id="date_div">
<label>Date<span class="text-danger"></span></label> <label>Date<span class="text-danger"></span></label>
<div id="reportrange" class="form-control" <div class="input-icon">
style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%"> <input type="text" id="reportrange" class="form-control" readonly style="caret-color: transparent;">
<i class="mdi mdi-calendar-blank"></i>&nbsp; <i class="mdi mdi-calendar-blank-outline additional-icon"></i>
<span></span> <i class="mdi mdi-menu-down"></i>
</div> </div>
<input type="hidden" id="startDate"> <input type="hidden" id="startDate">
<input type="hidden" id="endDate"> <input type="hidden" id="endDate">
</div> </div>
</div>
<div class="form-group col-md-3 text-right m-b-0" style="margin-top: 29px;"> <div class="form-group text-right m-b-0">
<a href="<?= base_url("/policy_tranction/report/report-business-list"); ?>" <a href="<?= base_url("/policy_tranction/report/report-business-list"); ?>"
class="btn btn-secondary" id="clear-filters">Clear</a> class="btn btn-secondary" id="clear-filters">Clear</a>
<a href="<?= base_url("/policy_tranction/report/report-business-list"); ?>" <a href="<?= base_url("/policy_tranction/report/report-business-list"); ?>"
@ -152,7 +155,7 @@ table.dataTable tbody td {
onclick="fetchEmpolyeeList(event);">Submit</a> onclick="fetchEmpolyeeList(event);">Submit</a>
</div> </div>
</div>
<!-- <div class="form-group text-right m-b-0"> <!-- <div class="form-group text-right m-b-0">
<button type="button" class="btn btn-secondary" id="clear-filters">Clear</button> <button type="button" class="btn btn-secondary" id="clear-filters">Clear</button>
@ -167,8 +170,10 @@ table.dataTable tbody td {
</div> </div>
</div> </div>
</div> </div>
<div class="col-12" id="second_page"> <div class="col-12" id="second_page">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
@ -182,13 +187,13 @@ table.dataTable tbody td {
<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">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th>S.No</th> <th>S.No&nbsp;</th>
<th>Client Name</th> <th>Client Name&nbsp;</th>
<th>Insurer</th> <th>Insurer&nbsp;</th>
<th>Policy</th> <th>Policy&nbsp;</th>
<th>Policy No</th> <th>Policy No&nbsp;</th>
<th>Endorsement No</th> <th>Endorsement No&nbsp;</th>
<th>Event Type</th> <th>Event Type&nbsp;</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
</thead> </thead>
@ -196,7 +201,7 @@ table.dataTable tbody td {
<?php if (isset($business_list)) { ?> <?php if (isset($business_list)) { ?>
<?php foreach($business_list as $index => $row){ ?> <?php foreach($business_list as $index => $row){ ?>
<tr> <tr>
<td><?= $index + 1 ?></td> <td class="text-center"><?= $index + 1 ?></td>
<td><?php echo $row['client_name']; ?></td> <td><?php echo $row['client_name']; ?></td>
<td><?php echo $row['insurer_name']; ?></td> <td><?php echo $row['insurer_name']; ?></td>
<td><?php echo $row['policy_type']; ?></td> <td><?php echo $row['policy_type']; ?></td>
@ -329,7 +334,6 @@ document.addEventListener("DOMContentLoaded", function () {
<script> <script>
// Datatable document ready // Datatable document ready
$(document).ready(function() { $(document).ready(function() {
var ticketsTable = $('#scroll-horizontal-datatable'); var ticketsTable = $('#scroll-horizontal-datatable');
if (ticketsTable.length) { if (ticketsTable.length) {
@ -337,58 +341,186 @@ $(document).ready(function() {
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [{ buttons: [
{
extend: 'collection',
text: '<span class="btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary',
buttons: [
{
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited"></i><span class="btn-custom"> CSV </span>',
title: 'Policy-Tranction-BDS-List', title: 'Policy-Tranction-BDS-List'
}, },
{ {
extend: 'excel', extend: 'excel',
text: 'Excel', text: '<i class="mdi mdi-file-excel"></i><span class="btn-custom"> EXCEL </span>',
title: 'Policy-Tranction-BDS-List', title: 'Policy-Tranction-BDS-List',
customize: function(xlsx) { customize: function(xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml']; var sheet = xlsx.xl.worksheets['sheet1.xml'];
var total = 0; var total = 0;
// Find cells in column AB (28th column in Excel) // Sum values in column AB (28th column)
$('row c[r^="AB"]', sheet).each(function() { $('row c[r^="AB"]', sheet).each(function() {
var value = parseFloat($('v', this) var value = parseFloat($('v', this).text());
.text()); // Get the value inside the cell
if (!isNaN(value)) { if (!isNaN(value)) {
total += value; total += value;
} }
}); });
// Get the last row index and append the total row // Get last row index and append total row
var lastRow = $('row:last', sheet); var lastRow = $('row:last', sheet);
var rowIndex = parseInt(lastRow.attr('r')) + var rowIndex = parseInt(lastRow.attr('r')) + 2;
2; // Find the next row index
var totalRow = '<row r="' + rowIndex + '">' + var totalRow =
'<c t="inlineStr" r="AA' + rowIndex + '<row r="' + rowIndex + '">' +
'"><is><t>Total</t></is></c>' + // Insert "Total" in AA '<c t="inlineStr" r="AA' + rowIndex + '"><is><t>Total</t></is></c>' +
'<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '</v></c>' +
'</v></c>' + // Insert sum in AB
'</row>'; '</row>';
// Append the new total row to the sheet
$(sheet).find('sheetData').append(totalRow); $(sheet).find('sheetData').append(totalRow);
} }
} }
]
}
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, // Enable pagination paging: true,
pageLength: 25, // Set default number of rows per page (optional) pageLength: 10,
ordering: false, ordering: false
}); });
} else { } else {
console.error("Table not found."); console.error("Table not found.");
} }
}); });
$(document).ready(function() {
getURLParams()
$('#client_id').select2();
$('#insurer_id').select2();
$('#policy_type_id').select2();
})
function fetchEmpolyeeList(event) {
event.preventDefault(); // Prevent default action
var start_date = $('#startDate').val();
var end_date = $('#endDate').val();
var client_id = $('#client_id').val();
var insurer_id = $('#insurer_id').val();
var policy_type_id = $('#policy_type_id').val();
var date_type = $('#date_type').val();
var issuer = $('#issuer').val();
console.log(start_date + '-' + end_date);
var queryParams = {
start_date: start_date,
end_date: end_date,
client_id: client_id,
insurer_id: insurer_id,
policy_type_id: policy_type_id,
date_type: date_type,
issuer: issuer,
};
const queryString = objectToQueryString(queryParams);
const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
console.log(apiURL);
window.location.href = apiURL;
}
function objectToQueryString(obj) {
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
}
function getURLParams() {
const url = new URL(window.location.href);
const params = new URLSearchParams(url.search);
const startDate = params.get('start_date') || 0; // Default to 0 if not found
const endDate = params.get('end_date') || 0; // Default to 0 if not found
const client_id = params.get('client_id') || 0; // Default to 0 if not found
const insurer_id = params.get('insurer_id') || 0; // Default to 0 if not found
const policy_type_id = params.get('policy_type_id') || 0; // Default to 0 if not found
const date_type = params.get('date_type') || 0; // Default to 0 if not found
const issuer = params.get('issuer') || 0; // Default to 0 if not found
hideDateField(date_type)
console.log('startDate', startDate)
console.log('endDate', endDate)
console.log('client_id', client_id)
console.log('insurer_id', insurer_id)
console.log('policy_type_id', policy_type_id)
console.log('date_type', date_type)
console.log('issuer', issuer)
// Log the values or use them as needed
console.log('Start Date:', startDate);
console.log('End Date:', endDate);
if (startDate != 0 && endDate != 0) {
setTimeout(function() {
$('#start_date').val(startDate)
$('#end_date').val(endDate)
$('#client_id').val(client_id).change()
$('#insurer_id').val(insurer_id).change()
$('#policy_type_id').val(policy_type_id).change()
$('#date_type').val(date_type)
$('#issuer').val(issuer)
}, 1000)
}
}
$(function() {
const url = new URL(window.location.href);
const params = new URLSearchParams(url.search);
// Get start and end dates from URL parameters, or use default values
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');
// Parse the dates to moment objects
var start = moment(startDateParam, 'DD-MM-YYYY');
var end = moment(endDateParam, 'DD-MM-YYYY');
// var start = moment().subtract(29, 'days');
// var end = moment();
function cb(start, end) {
$('#reportrange').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,
locale: { format: 'DD-MM-YYYY' },
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')
]
}
});
$(document).ready(function() { $(document).ready(function() {
getURLParams() getURLParams()
$('#client_id').select2(); $('#client_id').select2();
@ -487,7 +619,7 @@ $(function() {
// var end = moment(); // var end = moment();
function cb(start, end) { function cb(start, end) {
$('#reportrange span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY')); $('#reportrange').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
$('#startDate').val(start.format('DD-MM-YYYY')); $('#startDate').val(start.format('DD-MM-YYYY'));
$('#endDate').val(end.format('DD-MM-YYYY')); $('#endDate').val(end.format('DD-MM-YYYY'));
} }
@ -495,6 +627,9 @@ $(function() {
$('#reportrange').daterangepicker({ $('#reportrange').daterangepicker({
startDate: start, startDate: start,
endDate: end, endDate: end,
locale: {
format: 'DD-MM-YYYY'
},
ranges: { ranges: {
'Today': [moment(), moment()], 'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],

View File

@ -56,41 +56,42 @@ table.dataTable thead th {
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body maincard"> <div class="card-body maincard">
<div class="row" style="margin-bottom:1rem;"> <!-- <div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">CD Master</h4> <h4 style="position: relative;">CD Master</h4>
</div> </div>
<div class="col-6" style="text-align: right; position: relative;top: 56px;"> <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" <!- <button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light"
data-toggle="modal" data-target="#con-close-modal" data-placement="top" title="Add" data-toggle="modal" data-target="#con-close-modal" data-placement="top" title="Add"
data-trigger="hover">ADD</button> --> data-trigger="hover">ADD</button> ->
</div> </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 text-custom-black text-custom app-datatable">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">S.No.</th> <th class="font-weight-medium">S.No&nbsp;</th>
<th class="font-weight-medium">Client Name</th> <th class="font-weight-medium">Client Name&nbsp;</th>
<th class="font-weight-medium">Insurer Name</th> <th class="font-weight-medium">Insurer Name&nbsp;</th>
<th class="font-weight-medium">Insurer Branch Name</th> <th class="font-weight-medium">Insurer Branch Name&nbsp;</th>
<th class="font-weight-medium">Opening Date</th> <th class="font-weight-medium">Opening Date&nbsp;</th>
<th class="font-weight-medium">CD Account No</th> <th class="font-weight-medium">CD Account No&nbsp;</th>
<th class="font-weight-medium">Opening Amount</th> <th class="font-weight-medium">Opening Amount&nbsp;</th>
<th class="font-weight-medium">Date/User</th> <th class="font-weight-medium">Date/User&nbsp;</th>
<th class="font-weight-medium">Action</th> <th class="font-weight-medium">Action&nbsp;</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody class="app-table-body">
<?php foreach($CD_Master_Data as $index => $row){ ?> <?php foreach($CD_Master_Data as $index => $row){ ?>
<tr> <tr>
<td><?= $index + 1; ?></td> <td class="text-center"><?= $index + 1; ?></td>
<td><?php echo $row['client_name']; ?>( <?= $row['short_name'] ?> )</td> <td><?php echo $row['client_name']; ?>( <?= $row['short_name'] ?> )</td>
<td><?php echo $row['insurer_name']; ?></td> <td><?php echo $row['insurer_name']; ?></td>
<td><?php echo $row['insurer_branch_name']; ?></td> <td><?php echo $row['insurer_branch_name']; ?></td>
<td><?php echo date('d-m-Y', strtotime($row['opening_date'])); ?></td> <td><?php echo date('d-m-Y', strtotime($row['opening_date'])); ?></td>
<td><?php echo $row['cd_ac_no']; ?></td> <td><?php echo $row['cd_ac_no']; ?></td>
<td><?php echo $row['opening_bal']; ?></td> <td><?php echo $row['opening_bal']; ?></td>
<td><?php echo date('d-M-Y h:i A', strtotime($row['created_at'])) ?> by <?php echo $row['user_name']; ?></td> <td><?php echo date('d-M-Y h:i A', strtotime($row['created_at'])) ?> <br>by <?php echo $row['user_name']; ?></td>
<td> <td>
<div class="btn-group dropdown"> <div class="btn-group dropdown">
<a href="javascript: void(0);"class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a> <a href="javascript: void(0);"class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
@ -214,34 +215,81 @@ table.dataTable thead th {
$('#scroll-horizontal-datatable').DataTable({ $('#scroll-horizontal-datatable').DataTable({
scrollX: true, scrollX: true,
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + dom: "<'row'<'col-sm-2'f><'col-sm-10 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [
{
text: '<i class="mdi mdi-plus" ></i><span class=" btn-custom"> Add </span>',
className: 'btn app-btn-primary mr-2',
action: function (e, dt, node, config) {
showCdMasterAddModal();
}
},
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [ buttons: [
{ {
extend: 'csv', extend: 'csv',
text: 'CSV',
title: 'CD-Master-List', title: 'CD-Master-List',
className: 'my_class', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary my_class',
exportOptions: { exportOptions: {
columns: ':not(:last-child)' columns: ':not(:last-child)'
}, },
}, },
{ {
text: 'Add', extend: 'excel',
className: 'buttons-html5 ', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
action: function (e, dt, node, config) { exportOptions: {
showCdMasterAddModal(); orthogonal: 'sort'
},
className: 'app-btn-primary ',
} }
]
} }
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, paging: true,
pageLength: 10,
order: [[0, 'desc']]
// scrollX: true,
// dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" +
// "<'row'<'col-sm-12'tr>>" +
// "<'row'<'col-sm-5'i><'col-sm-7'p>>",
// buttons: [
// {
// extend: 'csv',
// text: 'CSV',
// title: 'CD-Master-List',
// className: 'my_class',
// exportOptions: {
// columns: ':not(:last-child)'
// },
// },
// {
// text: 'Add',
// className: 'buttons-html5 ',
// action: function (e, dt, node, config) {
// showCdMasterAddModal();
// }
// }
// ],
// language: {
// search: "_INPUT_",
// searchPlaceholder: "Search..."
// },
// paging: true,
}); });
}) })
$(document).ready(function(){ $(document).ready(function(){

View File

@ -64,14 +64,14 @@
<div class="card-body"> <div class="card-body">
<div class="row" style="padding-bottom: 10px;"> <div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Files</h4> <h4 style="position: relative;">Claim Dump Upload</h4>
</div> </div>
</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"> <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"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">SNO</th> <th class="font-weight-medium">S.No&nbsp;</th>
<th class="font-weight-medium">File name</th> <th class="font-weight-medium">File name</th>
<th class="font-weight-medium">User/Time</th> <th class="font-weight-medium">User/Time</th>
<th class="font-weight-medium">Status</th> <th class="font-weight-medium">Status</th>
@ -86,21 +86,25 @@
?> ?>
<tr> <tr>
<td><b><?php echo ($key + 1) ?></b></td> <td class="text-center"><b><?php echo ($key + 1) ?></b></td>
<td style="overflow: hidden;" class="reload truncate" data-toggle="tooltip" data-placement="top" title="<?php echo $file['file_name'] ?>"> <td style="overflow: hidden;" class="reload truncate" data-toggle="tooltip" data-placement="top" title="<?php echo $file['file_name'] ?>">
<?php echo $file['file_name'] ?> <?php echo $file['file_name'] ?>
</td> </td>
<td><?php echo change_date_format($file['created_at'], 'Y-m-d H:i:s', 'd M Y h:i a') . ' by <strong>' . $file['user_name'] . '</strong>' ?> </td> <td><?php echo change_date_format($file['created_at'], 'Y-m-d H:i:s', 'd M Y h:i a') . ' by <strong>' . $file['user_name'] . '</strong>' ?> </td>
<td> <td>
<?php if ($file['status'] == "failed") { ?> <?php if ($file['status'] == "failed") { ?>
<?= $file['status'] ?> <span class='col-xl-3 col-lg-4 col-sm-6'> <span style="color : #BD0707 ;"> <?= $file['status'] ?> </span>
<span class='col-xl-3 col-lg-4 col-sm-6'>
<!-- <a href="<?= base_url('util/claim_dump_excel_error/') . $file['file_id'] ?>" target="_blank" class='fe-alert-circle' data-err="<?= $file['file_id'] ?>"></a> --> <!-- <a href="<?= base_url('util/claim_dump_excel_error/') . $file['file_id'] ?>" target="_blank" class='fe-alert-circle' data-err="<?= $file['file_id'] ?>"></a> -->
<a href="#" class='fe-alert-circle' onclick="fetchFileError(<?= $file['file_id'] ?>)"></a> <a href="#" class='fe-alert-circle' onclick="fetchFileError(<?= $file['file_id'] ?>)"></a>
</span> </span>
<?php } else if ($file['status'] == "inprogress") { ?> <?php } else if ($file['status'] == "inprogress") { ?>
<a data-id="<?= $file['status'] ?>" class="reload" href="#"><?= $file['status'] ?></a> <a data-id="<?= $file['status'] ?>" class="reload" href="#"
<?php } else { ?> style="color : #938e04ff ;">
<?= $file['status'] ?> <?= $file['status'] ?>
</a>
<?php } else { ?>
<span style="color : #34A853 ;"> <?= $file['status'] ?> </span>
<?php } ?> <?php } ?>
</td> </td>
<td> <td>
@ -156,7 +160,7 @@
<!-- &nbsp;[ <a href="#" id="excel_download" data-toggle="tooltip" data-placement="top" title="Download Sample Excel">Sample Excel</a> ] --> <!-- &nbsp;[ <a href="#" id="excel_download" data-toggle="tooltip" data-placement="top" title="Download Sample Excel">Sample Excel</a> ] -->
<input type="file" name="claim_dump_list" id="claim_dump_list" accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet" required> <input type="file" name="claim_dump_list" id="claim_dump_list" accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet" required>
</div> </div>
<div class="form-group col-md-3" style="margin-top: 18px;"> <div class="form-group col-md-3" style="margin-top: 40px;">
<button id="claim_form_submit_button" type="submit" class="btn btn-primary waves-effect waves-light justify-content-end">Upload</button> <button id="claim_form_submit_button" type="submit" class="btn btn-primary waves-effect waves-light justify-content-end">Upload</button>
</div> </div>
</div> </div>
@ -293,8 +297,12 @@
} }
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, // Enable pagination paging: true, // Enable pagination
pageLength: 15, // Set default number of rows per page (optional) pageLength: 15, // Set default number of rows per page (optional)

View File

@ -19,7 +19,15 @@
<div class="form-group"> <div class="form-group">
<div id="dynamic-form-container"></div> <div id="dynamic-form-container">
<div align="right">
<a class="btn btn-primary waves-effect waves-light mr-1"
onclick="addHTMLInput(this)">
+ Add
</a>
</div>
</div>
<div class="form-group text-right m-b-0"> <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"
@ -48,10 +56,10 @@
<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">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th>S.No</th> <th>S.No&nbsp;</th>
<th>Docs Name</th> <th>Docs Name&nbsp;</th>
<th>File Name</th> <th>File Name&nbsp;</th>
<th>Action</th> <th>Action&nbsp;</th>
</tr> </tr>
</thead> </thead>
<tbody id="table_bd"> <tbody id="table_bd">
@ -191,8 +199,9 @@ function addHTMLInput()
> >
</div> </div>
<div class="form-group col-md-2" style="position: relative;top: 28px;"> <div class="form-group col-md-2" style="position: relative;top: 28px;">
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this)">x</a> <a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this)" style="background-color: #BD0707;">
<a class="btn btn-primary waves-effect waves-light mr-1" onclick="addHTMLInput(this)">+</a> <i class="mdi mdi-delete" ></i>
</a>
</div> </div>
`; `;
container.appendChild(newRow); container.appendChild(newRow);
@ -265,7 +274,7 @@ function create_url_list(data) {
data.forEach((item, index) => { data.forEach((item, index) => {
html += ` html += `
<tr> <tr>
<td>${index + 1}</td> <td class="text-center">${index + 1}</td>
<td>${item.doc_name}</td> <td>${item.doc_name}</td>
<td><a href="${item.url}" target="_blank">${item.url}</a></td> <td><a href="${item.url}" target="_blank">${item.url}</a></td>
<td> <td>

View File

@ -202,7 +202,7 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team(
<div class="row d-flex align-items-center"> <div class="row d-flex align-items-center">
<div class="goBack" style="padding-left: 25px;"> <div class="goBack" style="padding-left: 25px;">
<a href="#" onclick="hideAndShowTile('2')" ><b><i class="mdi mdi-chevron-left mdi-36px"></i></b> </a> <a href="#" onclick="hideAndShowTile('2')" ><b><i class="mdi mdi-chevron-left mdi-36px chevron-left-dash"></i></b> </a>
</div> </div>
<div class="goBack" style="display: none;padding-left: 15px;"> <div class="goBack" style="display: none;padding-left: 15px;">
<a href="#" id="current_tile">Current Tile : </a> <a href="#" id="current_tile">Current Tile : </a>

View File

@ -7,10 +7,6 @@
padding: 4px 4px !important; padding: 4px 4px !important;
} }
.col-12 {
max-width: 98% !important;
}
.dataTables_filter { .dataTables_filter {
position: absolute; position: absolute;
} }
@ -92,10 +88,24 @@
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [ buttons: [
{ extend: 'csv', text: 'CSV', title: 'Insurer-Wise-Report-List' }, {
{ extend: 'excel', text: 'Excel', title: 'Insurer-Wise-Report-List', exportOptions: { orthogonal: 'sort' } } extend: 'collection',
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=" btn-custom"> CSV </span>', title: 'Insurer-Wise-Report-List', className: 'app-btn-primary ' },
{ extend: 'excel', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>', title: 'Insurer-Wise-Report-List', className: 'app-btn-primary ', exportOptions: { orthogonal: 'sort' } }
], ],
language: { search: "_INPUT_", searchPlaceholder: "Search..." }, }
],
language: {
search: `
<div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
},
paging: true, paging: true,
pageLength: 10, pageLength: 10,
ordering: false ordering: false

View File

@ -7,9 +7,6 @@
padding: 4px 4px !important; padding: 4px 4px !important;
} }
.col-12 {
max-width: 98% !important;
}
.dataTables_filter { .dataTables_filter {
position: absolute; position: absolute;
@ -33,7 +30,8 @@
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th style="text-align: center;" colspan="8">OPEN</th> <th style="text-align: center;" colspan="8">OPEN</th>
<th style="text-align: center;" colspan="5" >CLEARED</th> &nbsp;
<th style="text-align: center;" colspan="7" >CLEARED</th>
</tr> </tr>
<tr> <tr>
<?php foreach ($column_order as $col_name): ?> <?php foreach ($column_order as $col_name): ?>
@ -88,10 +86,24 @@
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [ buttons: [
{ extend: 'csv', text: 'CSV', title: 'Insurer-Wise-Report-List' }, {
{ extend: 'excel', text: 'Excel', title: 'Insurer-Wise-Report-List', exportOptions: { orthogonal: 'sort' } } extend: 'collection',
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=" btn-custom"> CSV </span>', title: 'Insurer-Wise-Report-List',className: 'app-btn-primary ' },
{ extend: 'excel', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>', title: 'Insurer-Wise-Report-List',className: 'app-btn-primary ', exportOptions: { orthogonal: 'sort' } }
]
}
], ],
language: { search: "_INPUT_", searchPlaceholder: "Search..." }, language: {
search: `
<div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
},
paging: true, paging: true,
pageLength: 10, pageLength: 10,
ordering: false ordering: false

View File

@ -110,13 +110,14 @@ input:checked + .slider:before {
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="client_name">Client Name<span <label for="client_name">Client Name<span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input type="text" class="form-control" id="client_name" <input type="text" class="form-control" id="client_name" data-old-name="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>"
placeholder="Enter Client Name" value="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>" name="client_name" required> placeholder="Enter Client Name" value="<?= isset($client['client_name']) ? $client['client_name'] : '' ?>" name="client_name" required>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="short_name">Client Short Name<span <label for="short_name">Client Short Name<span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input type="text" class="form-control" id="short_name" <input type="text" class="form-control" id="short_name"
data-old-short="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>"
placeholder="Enter Short Name" value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>" name="short_name" onkeyup="validateInput(this, 'clients', 'short_name', 'clientBtnSubmit')" required> placeholder="Enter Short Name" value="<?= isset($client['short_name']) ? $client['short_name'] : '' ?>" name="short_name" onkeyup="validateInput(this, 'clients', 'short_name', 'clientBtnSubmit')" required>
</div> </div>
</div> </div>

View File

@ -70,6 +70,13 @@
<div class="row" id="add_branch"> <div class="row" id="add_branch">
<div class="col-12"> <div class="col-12">
<div class="card-body"> <div class="card-body">
<div class="row float-left" style="position: relative; bottom: 20px; left: 13px;">
<button type="button" id="btnAutoBranchFetch"
class="btn btn-primary waves-effect waves-light btn-sm ">Fetch Client Branch (Pre-Enrolment)</button>
</div>
<div class="row float-right" style="position: relative; bottom: 20px; right: 13px;"> <div class="row float-right" style="position: relative; bottom: 20px; right: 13px;">
<button type="button" id="btnBranchBack" <button type="button" id="btnBranchBack"
class="btn btn-primary waves-effect waves-light btn-sm btnBack"><span class="mdi mdi-format-list-bulleted" class="btn btn-primary waves-effect waves-light btn-sm btnBack"><span class="mdi mdi-format-list-bulleted"
@ -79,10 +86,20 @@
<hr> <hr>
<form role="form" class="parsley-examples" method="post" id="branch_form" enctype="multipart/form-data"> <form role="form" class="parsley-examples" method="post" id="branch_form" enctype="multipart/form-data">
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" /> <input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
<!-- post_client_id as client_id -->
<input type="hidden" name="client_id" id="client_id_branch" <input type="hidden" name="client_id" id="client_id_branch"
value="<?= isset($client['id']) ? $client['id'] : '' ?>" /> value="<?= isset($client['id']) ? $client['id'] : '' ?>" />
<!-- pre_branch_id -->
<input type="hidden" name="pre_branch_id" id="pre_branch_id"
value="<?= isset($pre_branch_id) ? $pre_branch_id : '' ?>" />
<!-- post_branch_id as branch_id_primarykey -->
<input type="hidden" name="branch_id_primarykey" id="branch_id_primarykey" /> <input type="hidden" name="branch_id_primarykey" id="branch_id_primarykey" />
<div class="form-group"> <div class="form-group">
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
@ -181,12 +198,13 @@
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="last_name">Email<span class="text-danger">*</span></label> <label for="last_name">Email<span class="text-danger">*</span></label>
<input value="" type="text" class="form-control" placeholder="Enter Contact Email" <input value="" type="text" class="form-control" placeholder="Enter Contact Email"
name="email[]" id="email" data-parsley-trigger="change" data-parsley-type="email" onkeyup="validateInput(this, 'level_contacts', 'email', 'branchBtnSubmit')" required> name="email[]" id="email" data-parsley-trigger="change" data-parsley-type="email" onchange="validateDuplicateByClientBranch(this, 'email','branchBtnSubmit')" required>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="mobile">Mobile<span class="text-danger">*</span></label> <label for="mobile">Mobile<span class="text-danger">*</span></label>
<input value="" type="text" class="form-control" placeholder="Enter Contact Mobile" <input value="" type="text" class="form-control" placeholder="Enter Contact Mobile"
name="mobile[]" id="mobile" onkeyup="validateInput(this, 'level_contacts', 'mobile', 'branchBtnSubmit')" name="mobile[]" id="mobile"
onchange="validateDuplicateByClientBranch(this, 'mobile','branchBtnSubmit')"
onkeypress="return onlyNumbers(event)" maxlength="10" minlength="10" onkeypress="return onlyNumbers(event)" maxlength="10" minlength="10"
data-parsley-type-message="Please enter a valid 10-digit mobile number." data-parsley-type-message="Please enter a valid 10-digit mobile number."
data-parsley-required-message="Please enter a valid 10-digit mobile number." data-parsley-required-message="Please enter a valid 10-digit mobile number."
@ -285,6 +303,10 @@ $('#btnBranchAdd').click(function() {
$('#district').val(''); $('#district').val('');
$('#branch_city').val(''); $('#branch_city').val('');
$('#branch_form')[0].reset(); $('#branch_form')[0].reset();
$('#branch_form').parsley().reset();
$('#pre_branch_id').val('');
$('#branch_id_primarykey').val('');
$('.ac').css('display', 'block'); $('.ac').css('display', 'block');
contactCount = 1 contactCount = 1
@ -351,13 +373,14 @@ $("#branch_form").submit(function(event) {
var selectedValues = $("#selected").val(); var selectedValues = $("#selected").val();
console.log(selectedValues, selectedValues); console.log(selectedValues, selectedValues);
console.log("branch_id_primarykey", $('#branch_id_primarykey').val());
let level_contect_data = getContactsData(); let level_contect_data = getContactsData();
console.log('level_contect_data', level_contect_data); console.log('level_contect_data', level_contect_data);
event.preventDefault(); event.preventDefault();
branch_PrimaryKey = $('#client_id_branch').val(); branch_PrimaryKey = $('#client_id_branch').val();
console.log('branch_PrimaryKey', branch_PrimaryKey) console.log('branch_PrimaryKey', branch_PrimaryKey)
if (branch_PrimaryKey === '') { if (branch_PrimaryKey === '') {
@ -377,6 +400,7 @@ $("#branch_form").submit(function(event) {
var formData = new FormData($('#branch_form')[0]); var formData = new FormData($('#branch_form')[0]);
const jsonString = JSON.stringify(selectedValues); const jsonString = JSON.stringify(selectedValues);
const level_contect_data_json_string = JSON.stringify(level_contect_data); const level_contect_data_json_string = JSON.stringify(level_contect_data);
console.log('jsonString', jsonString); console.log('jsonString', jsonString);
@ -467,6 +491,9 @@ $("#branch_form").submit(function(event) {
$('.loader').fadeOut(); $('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow'); $('.loader-mask').delay(350).fadeOut('slow');
console.log('Something Wrong!', 'warning'); console.log('Something Wrong!', 'warning');
if(xhr.status === 409){
alert('The Current Branch is Already Existing..!!');
}
}, 300); }, 300);
}, },
complete: function() { complete: function() {
@ -534,6 +561,7 @@ $('body').on('click', '.btnBranchEdit', function() {
$('#district').val(res.data.district); $('#district').val(res.data.district);
$('#branch_city').val(res.data.city); $('#branch_city').val(res.data.city);
$('#branch_PrimaryKey').val(res.data.id); $('#branch_PrimaryKey').val(res.data.id);
$('#pre_branch_id').val(res.data.pre_branch_id??'')
if(res.data.sez == 1){ if(res.data.sez == 1){
$('#sez').prop('checked', true); $('#sez').prop('checked', true);
@ -625,11 +653,11 @@ function appendContactHtml(contact = false, reset = false) {
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label> <label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
<input value="${contact !== undefined && contact !== false ? contact.email : ''}" type="text" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" data-parsley-trigger="change" data-parsley-type="email" onkeyup="validateInput(this, 'level_contacts', 'email', 'branchBtnSubmit')" required> <input value="${contact !== undefined && contact !== false ? contact.email : ''}" type="text" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" data-parsley-trigger="change" data-parsley-type="email" onchange="validateDuplicateByClientBranch(this, 'email', 'branchBtnSubmit')" required>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label> <label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
<input value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" onkeyup="validateInput(this, 'level_contacts', 'mobile', 'branchBtnSubmit')" onkeypress = "return onlyNumbers(event)" maxlength="10" min="10" data-parsley-type-message="Please enter a valid 10-digit mobile number." data-parsley-required-message="Please enter a valid 10-digit mobile number." required> <input value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" onchange="validateDuplicateByClientBranch(this, 'mobile', 'branchBtnSubmit')" onkeypress = "return onlyNumbers(event)" maxlength="10" min="10" data-parsley-type-message="Please enter a valid 10-digit mobile number." data-parsley-required-message="Please enter a valid 10-digit mobile number." required>
</div> </div>
</div> </div>
<div class="form-group" style="display: flex;"> <div class="form-group" style="display: flex;">
@ -849,6 +877,83 @@ function checkMobileNumber(input) {
} }
// function generateShortName() {
// let clientName = $("#client_name").val().trim();
// if (clientName.length > 0) {
// let shortName = clientName.substring(0, 10).replace(/\s+/g, '').toUpperCase(); // Take first 10 chars , space removed, converted caps
// $("#short_name").val(shortName);
// makeUniqueShortName(shortName);
// }else{
// $("#short_name").val('');
// }
// }
let shortNameTimer;
$("#client_name").on("input change keyup", function() {
clearTimeout(shortNameTimer); // cancel previous call
shortNameTimer = setTimeout(() => {
generateShortName(); // only runs after 200ms pause
}, 200); // adjust debounce delay as needed
});
function generateShortName() {
let clientInput = $("#client_name");
let shortInput = $("#short_name");
let oldClientName = clientInput.data("old-name"); // from DB
let oldShortName = shortInput.data("old-short"); // from DB
let newClientName = clientInput.val().trim();
console.log(`LN 882 : NEW - ${newClientName} | OLD - ${oldClientName} | OLD SN - ${oldShortName}`);
if (newClientName.toUpperCase() === (oldClientName || '').toUpperCase()) {
shortInput.val(oldShortName);
return;
}
if (newClientName.length == 0) {
shortInput.val('');
return;
}
if (newClientName.length > 0) {
let shortName = newClientName.substring(0, 10).replace(/\s+/g, '').toUpperCase();
shortInput.val(shortName);
makeUniqueShortName(shortName);
}
}
function makeUniqueShortName(baseName) {
let input = $("#short_name")[0]; // input element
checkDuplicateTableFieldValue("clients", "short_name", baseName, function(isDuplicate) {
if (isDuplicate) {
// Append sequence until unique
let counter = 1;
function tryNext() {
let padded = String(counter).padStart(3, '0'); // 001, 002, 003
let newName = baseName + padded;
checkDuplicateTableFieldValue("clients", "short_name", newName, function(exists) {
if (exists) {
counter++;
tryNext(); // keep checking
} else {
$("#short_name").val(newName);
validateInput(input, "clients", "short_name", "clientBtnSubmit");
}
});
}
tryNext();
} else {
$("#short_name").val(baseName);
validateInput(input, "clients", "short_name", "clientBtnSubmit");
}
});
}
function validateInput(input, table, field, submitButId){ function validateInput(input, table, field, submitButId){
let value = $(input).val(); let value = $(input).val();
@ -871,6 +976,68 @@ function validateInput(input, table, field, submitButId){
} }
function validateDuplicateByClientBranch(input, field, submitButId) {
let value = $(input).val().trim();
let clientId = $('#client_id_branch').val();
let branchId = $('#branch_id_primarykey').val();
let label = $(input).closest('.form-group').find('label').text().replace('*', '').trim();
let message = label ? label + " is duplicate!" : "Value is duplicate!";
console.log(`cId: ${clientId} | bId: ${branchId}`);
// Don't forgot be careful
// 1 Local duplication check (User entered)
let isLocalDuplicate = false;
$('input[name="' + field + '[]"]').each(function(index) {
console.log(`Entered value: ${value} | Contact ${index+1} value: ${$(this).val()}`);
if (this !== input && $(this).val().trim() === value) {
isLocalDuplicate = true;
return false; // break loop
}
});
if (isLocalDuplicate) {
console.log(`r u n Local`);
console.log(`btn Dis - true`);
toastr.warning(message, 'WARNING');
$('#' + submitButId).prop('disabled', true);
return; // dont call server if duplicate in UI
}
// Don't forgot be careful
// 2 Server-side duplicate check (DB)
if (!isLocalDuplicate && value !== '') {
$.ajax({
url: '<?= base_url("client/others/check-duplicate") ?>',
type: 'POST',
data: {
client_id: clientId,
branch_id: branchId,
value: value,
field: field
},
dataType: 'json',
success: function(response) {
if (response.isDuplicate) {
console.log(`r u n Server`);
console.log(`btn Dis - true`);
toastr.warning(message, 'WARNING');
$('#' + submitButId).prop('disabled', true);
} else {
console.log(`btn Dis - false`);
$('#' + submitButId).prop('disabled', false);
}
},
error: function(xhr, status, error) {
console.error('AJAX Error:', error);
}
});
}
}
function getContactsData() { function getContactsData() {
const contacts = []; const contacts = [];

View File

@ -16,14 +16,13 @@
<a href="<?= base_url("client/client_deposit"); ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a> <a href="<?= base_url("client/client_deposit"); ?>" 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> </div>
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0" <table data-custom-table-css="table" class="table mb-0 nowrap w-100 table-centered" cellspacing="0" id="tickets-table">
id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">Insurer Name</th> <th class="font-weight-medium">Insurer Name&nbsp;</th>
<th class="font-weight-medium">Insurer Branch Name</th> <th class="font-weight-medium">Insurer Branch Name&nbsp;</th>
<th class="font-weight-medium">CD Account Number</th> <th class="font-weight-medium">CD Account Number&nbsp;</th>
<th class="font-weight-medium">Current Balance</th> <th class="font-weight-medium">Current Balance&nbsp;</th>
<th class="font-weight-medium">Action</th> <th class="font-weight-medium">Action</th>
</tr> </tr>
</thead> </thead>
@ -70,30 +69,42 @@
$(document).ready(function() { $(document).ready(function() {
$('#tickets-table').DataTable({ $('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>", // dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>",
buttons: [{ dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>",
buttons: [
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [
{
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
title: 'Client Deposit Details - ' + ' <?php echo $clientName[0]['client_name'];?>', title: 'Client Deposit Details - ' + ' <?php echo $clientName[0]['client_name'];?>',
className: 'my_class', className: 'app-btn-primary ',
exportOptions: { exportOptions: {
columns: ':not(:last-child)' columns: ':not(:last-child)'
}, },
}, },
{ {
extend: 'pdf', extend: 'pdf',
text: 'PDF', text: '<i class="mdi mdi-file-pdf " ></i><span class=" btn-custom"> PDF </span>',
title: 'Client Deposit Details - ' + ' <?php echo $clientName[0]['client_name'];?>', title: 'Client Deposit Details - ' + ' <?php echo $clientName[0]['client_name'];?>',
exportOptions: { exportOptions: {
columns: ':not(:last-child)' columns: ':not(:last-child)'
}, },
className: 'app-btn-primary ',
}
]
} }
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
}); });

View File

@ -21,8 +21,18 @@
<div class="row" style="padding-top: 20px;margin-bottom: 18px;"> <div class="row" style="padding-top: 20px;margin-bottom: 18px;">
<div class="col-6"> <div class="col-6">
<h4 style="position: relative;left: 18px;top: 2px;">Client Basic Info - <strong> <?= $client['client_name'] ?> (
<?= $client['short_name'] ?> ) </strong></h4> <h4 style="position: relative; left: 18px; top: 2px;">
<span class="client_info_close fs-6" id="close_btn">
<i class="mdi mdi-chevron-left" style="font-size: 28px;cursor:pointer;"></i>
</span>
<span>
Client Basic Info -
<strong> <?= $client['client_name'] ?> ( <?= $client['short_name'] ?> ) </strong>
</span>
</h4>
</div> </div>
<div class="col-6"> <div class="col-6">
@ -30,8 +40,6 @@
<div class="row"> <div class="row">
<div class="col-6" style="position: relative;left: 455px;"> <div class="col-6" style="position: relative;left: 455px;">
<button id="close_btn"
class="btn btn-primary waves-effect waves-light client_info_close">Close</button>
</div> </div>
<div class="col-1 float-right" style="position: relative;left: 255px;"> <div class="col-1 float-right" style="position: relative;left: 255px;">
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse"
@ -125,28 +133,36 @@
<?php if($value['open_for_enrollment'] == 'Open' ) { ?> <?php if($value['open_for_enrollment'] == 'Open' ) { ?>
<span <span
class="badge badge-success"><?= $value['open_for_enrollment'] ?></span> class="px-2 py-1"
style="background-color: #F9F8CD; color: #000 !important; border-radius:10px !important; "
><?= $value['open_for_enrollment'] ?></span>
<?php } else if($value['open_for_enrollment'] == 'Closed') { ?> <?php } else if($value['open_for_enrollment'] == 'Closed') { ?>
<span <span
class="badge badge-warning"><?= $value['open_for_enrollment'] ?></span> class="px-2 py-1"
style="background-color: #C2C2C2; color: #000 !important; border-radius:10px !important;"><?= $value['open_for_enrollment'] ?></span>
<?php } else { ?> <?php } else { ?>
<span <span
class="badge badge-secondary"><?= $value['open_for_enrollment'] ?></span> style="background-color: #E26728; color: #000 !important; border-radius:10px !important;"
class="px-2 py-1"><?= $value['open_for_enrollment'] ?></span>
<?php } ?> <?php } ?>
</td> </td>
<td> <td>
<?php if($value['policy_status'] == 'Active' ) { ?> <?php if($value['policy_status'] == 'Active' ) { ?>
<span class="badge badge-success"><?= $value['policy_status'] ?></span> <span
style="background-color: #D1F8E7; color: #000 !important; border-radius:10px !important;"
class="px-2 py-1"><?= $value['policy_status'] ?></span>
<?php } else { ?> <?php } else { ?>
<span class="badge badge-danger"><?= $value['policy_status'] ?></span> <span
style="background-color: #BD0707; color: #000 !important; border-radius:10px !important;"
class="px-2 py-1 "><?= $value['policy_status'] ?></span>
<?php } ?> <?php } ?>
</td> </td>

View File

@ -1,49 +1,15 @@
<style> <style> .card-body{ margin-top: 0px !important; } </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>
<div class="tab-pane fade" id="KYC-DOC-tab"> <div class="tab-pane fade" id="KYC-DOC-tab">
<div class="col-lg-12"> <div class="col-lg-12">
<div class="card"> <div class="card" id="collapseOne">
<div class="card-body"> <div class="card-body">
<div class="table-responsive"> <div class="table-responsive">
<table data-custom-table-css="table" id="kyc_table" class="table table-sm mb-0"> <table data-custom-table-css="second-table" id="kyc_table" class="table table-sm mb-0">
<thead> <thead>
<tr> <tr>
<th>S.no</th> <th>S. No</th>
<th>Document Name</th> <th>Document Name</th>
<th>Status</th> <th>Status</th>
<th>Action</th> <th>Action</th>
@ -63,7 +29,7 @@
<div class="row" id="others"> <div class="row" id="others">
<div class="col-12"> <div class="col-12">
<div class="card" style="margin-left: 12px;margin-right: -12px;"> <div class="card" id="collapseOne" style="margin-left: 12px;margin-right: -12px;">
<div class="card-body"> <div class="card-body">
<h3>Additional Documents</h3> <h3>Additional Documents</h3>
<form role="form" class="parsley-examples" method="post" id="kyc_form" <form role="form" class="parsley-examples" method="post" id="kyc_form"
@ -101,10 +67,10 @@
</div> <!-- end row --> </div> <!-- end row -->
<div class="col-lg-12" id="other_docs_table"> <div class="col-lg-12" id="other_docs_table">
<div class="card"> <div class="card" id="collapseOne">
<div class="card-body"> <div class="card-body">
<div class="table-responsive"> <div class="table-responsive">
<table data-custom-table-css="table" id="kyc_table" class="table table-sm mb-0"> <table data-custom-table-css="second-table" id="kyc_table" class="table table-sm mb-0">
<thead> <thead>
<tr> <tr>
<th>Document Name</th> <th>Document Name</th>

View File

@ -1,6 +1,6 @@
<style> <style>
.table th, /* .table th,
.table td { .table td {
padding: 8px; padding: 8px;
} }
@ -11,7 +11,7 @@ table.dataTable tbody td {
table.dataTable thead th { table.dataTable thead th {
padding: 4px 4px !important; padding: 4px 4px !important;
} } */
.col-12{ .col-12{
@ -74,32 +74,31 @@ table.dataTable thead th {
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="margin-bottom:1rem;"> <!-- <div class="row" style="margin-bottom:1rem;">-->
<div class="col-6" style="align-self: center;"> <!-- <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Client List</h4> <h4 style="position: relative;">Client</h4>
</div> </div> -->
<!-- <div class="col-2" style="text-align: right; position: relative;top: 56px; left: 303px;"> <!-- <div class="col-2" style="text-align: right; position: relative;top: 56px; left: 303px;">
<a class="btn btn-primary waves-effect waves-light" onclick="showModal()">Add From Lead</a> <a class="btn btn-primary waves-effect waves-light" onclick="showModal()">Add From Lead</a>
</div> </div>
<div class="col-1" style="text-align: right; position: relative;top: 56px; left: 294px;"> <div class="col-1" style="text-align: right; position: relative;top: 56px; left: 294px;">
<a href="<?= base_url("client/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> <a href="<?= base_url("client/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> <!-- </div>-->
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0" <table data-custom-table-css="table" class="table mb-0 nowrap" cellspacing="0" id="tickets-table">
id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">S.No</th> <th class="font-weight-medium">S.No&nbsp;</th>
<th class="font-weight-medium">Client Name</th> <th class="font-weight-medium">Client Name&nbsp;</th>
<th class="font-weight-medium">Account Manager</th> <th class="font-weight-medium">Account Manager&nbsp;</th>
<th class="font-weight-medium">Action</th> <th class="font-weight-medium">Action&nbsp;</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach($clientList as $index => $row){ ?> <?php foreach($clientList as $index => $row){ ?>
<tr > <tr >
<td><?=$index+1?></td> <td class="text-center"><?=$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 class="client_info" data-id="<?php echo $row->id; ?>"><?php echo $row->client_name; ?> ( <?php echo $row->short_name; ?> ) </td>
<td> <td>
<?php $account_managers = ''; ?> <?php $account_managers = ''; ?>
@ -108,7 +107,9 @@ table.dataTable thead th {
<?php $account_managers .= $client->account_manager . ', '; ?> <?php $account_managers .= $client->account_manager . ', '; ?>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php echo rtrim($account_managers, ', '); ?> <?php
$account_managers = rtrim($account_managers, ', ');
echo $account_managers !== '' ? $account_managers : 'N/A'; ?>
</td> </td>
<td> <td>
<div class="btn-group dropdown"> <div class="btn-group dropdown">
@ -166,7 +167,8 @@ table.dataTable thead th {
</div> </div>
</div><!-- /.modal-content --> </div><!-- /.modal-content -->
</div> </div>
</div><!-- /.modal --> </div>
<!-- /.modal -->
<script> <script>
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
@ -292,15 +294,15 @@ table.dataTable thead th {
$(document).ready(function(){ $(document).ready(function(){
$('#lead_id').select2(); $('#lead_id').select2();
}) })
var table;
$(document).ready(function() $(document).ready(function()
{ {
$('#tickets-table').DataTable({ table = $('#tickets-table').DataTable({
dom: "<'row'<'col-sm-2'f><'col-sm-10 text-right'B>>" + dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" +
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [
buttons: [
{ {
text: 'Add From Lead', text: 'Add From Lead',
className: 'btn-filter add-from-lead', // custom class className: 'btn-filter add-from-lead', // custom class
@ -309,37 +311,138 @@ $(document).ready(function()
} }
}, },
{ {
text: '+ create New Client', text: '<i class="mdi mdi-plus" ></i><span class=" btn-custom"> Add </span>',
className: 'btn-filter buttons-html5', // custom class className: 'btn app-btn-primary mr-2',
action: function(e, dt, node, config) { action: function(e, dt, node, config) {
addClient(); addClient();
} }
}, },
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [
{ {
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
title: 'ClientList', title: 'Client-List',
className: 'my_class', // title: function() {
// return $('#toggleButtons').is(':checked')
// ? 'GC-Client-List'
// : 'RC-Client-List';
// },
className: 'app-btn-primary ',
exportOptions: { exportOptions: {
columns: ':not(:last-child)' columns: ':not(:last-child)'
}, },
} }
]
}
], ],
initComplete: function() {
$('.btn-filter')
.removeClass('btn-secondary')
.addClass('btn btn-primary');
},
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search",
emptyTable: '<div class="text-center text-muted">No Data found</div>'
}, },
paging: true , paging: true ,
// pagingType: 'full_numbers' // pagingType: 'full_numbers'
}); });
// $(".datatable-buttons").prepend(`
// <label class="switch">
// <input type="checkbox" id="toggleButtons">
// <span">Group</span>
// </label>
// `);
$(".datatable-buttons").prepend(`
<span id="statusSwitchWrapper" class="dt-switch-wrapper">
<span class="custom-switch" style="text-align: left;">
<input type="checkbox" class="custom-control-input" id="toggleButtons" checked>
<label class="custom-control-label" for="toggleButtons" style="vertical-align: middle !important;">Group Client</label>
</span>
</span>
`);
$('#toggleButtons').on('change', function() {
let type = $(this).is(':checked') ? 1 : 2;
// $('div.col-6 h4').text(
// $(this).is(':checked')
// ? "GC Client List"
// : "RC Client List"
// );
let url = '<?= base_url('client/typeList/') ?>' + type;
$.ajax({
url: url,
method: 'GET',
success: function(response) {
if (response.status === "success" && Array.isArray(response.data)) {
renderRows(response.data);
} else {
renderRows([]);
}
},
error: function(xhr, status, error) {
console.error("Error loading:", error);
renderRows([]);
}
});
});
}) })
function renderRows(data) {
table.clear();
if (Array.isArray(data) && data.length) {
data.forEach((row, index) => {
let clientrm = <?= json_encode($client_rm) ?>;
let account_managers = "";
clientrm.forEach(client => {
if (client.client_id == row.id) {
account_managers += client.account_manager + ", ";
}
});
account_managers = account_managers.replace(/,\s*$/, "");
if (account_managers === "") account_managers = "N/A";
let rowData = [
index + 1,
`<span class="client_info" data-id="${row.id}">${row.client_name} (${row.short_name})</span>`,
account_managers,
`<div class="btn-group dropdown">
<a href="javascript:void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown">
<i class="mdi mdi-dots-horizontal"></i>
</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="<?= base_url("client/list/") ?>${row.id}">
<i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit
</a>
<a class="dropdown-item" href="<?= base_url("client/deposit/") ?>${row.id}">
<i class="mdi mdi-cash mr-2 text-muted font-18 vertical-middle"></i>CD Transactions
</a>
<?php if(in_array(get_role_id(), [1, 5])) { ?>
<a class="dropdown-item" data-id="${row.id}" onclick="removeClient(this)">
<i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete
</a>
<?php } ?>
</div>
</div>`
];
let newRow = table.row.add(rowData);
$(newRow.node()).find('td:eq(0)').addClass('text-center');
$(newRow.node()).find('td:eq(1)').addClass('client_info').attr('data-id', row.id);
});
}
table.draw();
}
//DO NOT REMOVE THIS FUNCTION >>> THI FUNCTION FOR CLIENT SOFT DELETE //DO NOT REMOVE THIS FUNCTION >>> THI FUNCTION FOR CLIENT SOFT DELETE
// function removeClient(element) // function removeClient(element)
// { // {

View File

@ -1,8 +1,8 @@
<style> <style>
body { body {
.multiselect-native-select { .multiselect-native-select {
position: relative; position: relative;
/* bottom: 32px; */ /* bottom: 32px; */
select { select {
border: 0 !important; border: 0 !important;
@ -28,17 +28,12 @@ body {
} }
.navtab-bg .nav-link {
margin: 0 5px 10px!important;
}
.readonly-select { .readonly-select {
pointer-events: none; pointer-events: none;
/* background-color: #f0f0f0; */ /* background-color: #f0f0f0; */
background-color: #e0e0e0; background-color: #e0e0e0;
color: #666; color: #666;
} }
</style> </style>
<style> <style>
@ -47,10 +42,6 @@ body {
font-size: 14px; font-size: 14px;
} }
.container-fluid {
padding: 12px;
}
.user-card { .user-card {
background: white; background: white;
border-radius: 8px; border-radius: 8px;
@ -259,33 +250,6 @@ body {
border: 1px solid #dee2e6; 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 { #hr_activity_history_append_area {
padding-top: 0; padding-top: 0;
@ -299,8 +263,6 @@ body {
#hr_activity_history_append_area tbody tr { #hr_activity_history_append_area tbody tr {
background-color: white !important; background-color: white !important;
} }
</style> </style>
@ -311,7 +273,9 @@ body {
<div class="card-body"> <div class="card-body">
<div class="row" style="padding-bottom: 10px;"> <div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Client Onboarding <?php if(isset($client)) {echo ' - ' . $client['client_name']; } ?></h4> <h4 style="position: relative;">Client Onboarding <?php if (isset($client)) {
echo ' - ' . $client['client_name'];
} ?></h4>
</div> </div>
<div class="col-6" style="text-align: right;"> <div class="col-6" style="text-align: right;">
<a href="<?= base_url("client/list"); ?>"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a> <a href="<?= base_url("client/list"); ?>"><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i></a>
@ -320,7 +284,14 @@ body {
<br> <br>
<ul class="nav nav-pills navtab-bg" > <div class="tab-wrapper position-relative">
<!-- Left Arrow -->
<ul class="nav nav-pills navtab-bg" id="myTab">
<li class="nav-item ">
<button class="scroll-btn left-btn" type="button">&#9664;</button>
</li>
<li class="nav-item"> <li class="nav-item">
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false" <a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
class="nav-link px-3 py-2 active" id="general_tab"> class="nav-link px-3 py-2 active" id="general_tab">
@ -361,7 +332,8 @@ body {
<li class="nav-item"> <li class="nav-item">
<a href="#hr-access-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="hr_access_tab" onclick="appendHrAccessControllHtml(this)"> <a href="#hr-access-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="hr_access_tab" onclick="appendHrAccessControllHtml(this)">
<span class="mr-1"><i class="mdi mdi-book-open-page-variant"></i></span> <span class="mr-1"><i class="mdi mdi-book-open-page-variant"></i></span>
<span class="d-none d-sm-inline-block">HR Access Control</span> <span class="d-none d-sm-inline-block">Client Access Control</span>
<!-- Name Changed "HR Access Controll" into "Client Access Control" -->
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
@ -382,7 +354,14 @@ body {
<span class="d-none d-sm-inline-block">Others</span> <span class="d-none d-sm-inline-block">Others</span>
</a> </a>
</li> --> </li> -->
<li class="nav-item">
<button class="scroll-btn right-btn" type="button">&#9654;</button>
</li>
</ul> </ul>
</div>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane fade" id="hr-access-tab"> <div class="tab-pane fade" id="hr-access-tab">
@ -408,7 +387,8 @@ body {
</div> </div>
<?php include("client_api.php"); ?> <?php include("client_api.php"); ?>
<?php // include('client_others_tab.php'); ?> <?php // include('client_others_tab.php');
?>
<?php include('notification.php'); ?> <?php include('notification.php'); ?>
<?php include('client_basic_info.php'); ?> <?php include('client_basic_info.php'); ?>
<?php include('client_kyc.php'); ?> <?php include('client_kyc.php'); ?>
@ -422,8 +402,58 @@ body {
</div> </div>
<script> <div class="modal fade" id="autoFetchBranchModal" tabindex="-1" role="dialog" aria-labelledby="autoFetchBranchModalLabel" accesskey=""
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" style="margin-left: 400px !important;">
<div class="modal-content modal-lg">
<div class="modal-header">
<h5 class="modal-title" id="autoFetchBranchModalLabel">Fetch Client Branch (Pre-Enrolment)</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" style="min-height:auto !important;">
<div class="row">
<div class="col-md-6">
<div class="form-group col-md-12">
<label for="auto_fetch_client">Client List<span class="text-danger">*</span></label>
<select class="form-control select2" id="auto_fetch_client" name="auto_fetch_client" required>
<option value="">Select Client</option>
<?php if (!empty($auto_fetch_client_list)): ?>
<?php foreach ($auto_fetch_client_list as $client_list): ?>
<option value="<?= esc($client_list['id']) ?>">
<?= esc($client_list['client_name']) ?>
</option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group col-md-12">
<label for="auto_fetch_branch">Branch List<span class="text-danger">*</span></label>
<select class="form-control select2" id="auto_fetch_branch" name="auto_fetch_branch" required>
<option value="">Select Branch</option>
</select>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn cancel-btn" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary submit-btn" id="submitAutoFetch">Submit</button>
</div>
</div>
</div>
</div>
</div>
<script>
let hrAccessControlHtmlAppended = false; let hrAccessControlHtmlAppended = false;
let hrActivityHistoryHtmlAppended = false; let hrActivityHistoryHtmlAppended = false;
@ -433,7 +463,9 @@ body {
if (check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0) { if (check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0) {
$('#btnBranchAdd').hide(); $('#btnBranchAdd').hide();
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000}); toastr.warning('Please Add the Client!', 'warning', {
timeOut: 2000
});
} else { } else {
if ($('#btnBranchBack')[0].style.display == 'none') { if ($('#btnBranchBack')[0].style.display == 'none') {
$('#btnBranchAdd').show(); $('#btnBranchAdd').show();
@ -448,7 +480,9 @@ body {
if (check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0) { if (check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0) {
$('#relation_form').hide(); $('#relation_form').hide();
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000}); toastr.warning('Please Add the Client!', 'warning', {
timeOut: 2000
});
} else { } else {
$('#relation_form').show(); $('#relation_form').show();
} }
@ -460,7 +494,9 @@ body {
if (check_client_id == '' || check_client_id == null || check_client_id == 0) { if (check_client_id == '' || check_client_id == null || check_client_id == 0) {
$('#BtnAdd').hide(); $('#BtnAdd').hide();
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000}); toastr.warning('Please Add the Client!', 'warning', {
timeOut: 2000
});
} else { } else {
if ($('#btnPolicyBack')[0].style.display == 'none') { if ($('#btnPolicyBack')[0].style.display == 'none') {
$('#BtnAdd').show(); $('#BtnAdd').show();
@ -475,7 +511,9 @@ body {
if (check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0) { if (check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0) {
$('#btnBranchAdd').hide(); $('#btnBranchAdd').hide();
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000}); toastr.warning('Please Add the Client!', 'warning', {
timeOut: 2000
});
} else { } else {
if ($('#btnBranchBack')[0].style.display == 'none') { if ($('#btnBranchBack')[0].style.display == 'none') {
$('#btnBranchAdd').show(); $('#btnBranchAdd').show();
@ -490,7 +528,9 @@ body {
if (check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0) { if (check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0) {
$('#notification-tab').hide(); $('#notification-tab').hide();
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000}); toastr.warning('Please Add the Client!', 'warning', {
timeOut: 2000
});
} else { } else {
if ($('#notification-tab')[0].style.display == 'none') { if ($('#notification-tab')[0].style.display == 'none') {
$('#notification-tab').show(); $('#notification-tab').show();
@ -524,14 +564,16 @@ body {
client_notification(); client_notification();
}); });
//HR Access Controll //HR Access Controll also know as "Client Access Control"
function appendHrAccessControllHtml(input) { function appendHrAccessControllHtml(input) {
console.log(input.id); console.log(input.id);
let client_id = $('#general_PrimaryKey').val(); let client_id = $('#general_PrimaryKey').val();
console.log('client_id ', client_id); console.log('client_id ', client_id);
let url = '<?= base_url('util/viewHrAccessData') ?>'; let url = '<?= base_url('util/viewHrAccessData') ?>';
let requestData = {client_id : client_id}; let requestData = {
client_id: client_id
};
if (hrAccessControlHtmlAppended == false) { if (hrAccessControlHtmlAppended == false) {
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) { sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
@ -570,7 +612,11 @@ body {
} }
let url = '<?= base_url('user/getUserActivityHistory') ?>'; let url = '<?= base_url('user/getUserActivityHistory') ?>';
let requestData = {client_id : client_id, startDate : startDate, endDate : endDate}; let requestData = {
client_id: client_id,
startDate: startDate,
endDate: endDate
};
if (hrActivityHistoryHtmlAppended == false) { if (hrActivityHistoryHtmlAppended == false) {
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) { sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
@ -593,11 +639,9 @@ body {
console.log('Already HTML appended'); console.log('Already HTML appended');
} }
} }
</script> </script>
<script> <script>
function toggleAccordion(header) { function toggleAccordion(header) {
if (event.target.classList.contains('fa-info-circle') || if (event.target.classList.contains('fa-info-circle') ||
event.target.parentElement.classList.contains('fa-info-circle')) { event.target.parentElement.classList.contains('fa-info-circle')) {
@ -650,8 +694,7 @@ body {
return Array.from(checkboxes).map(cb => parseInt(cb.value)); return Array.from(checkboxes).map(cb => parseInt(cb.value));
} }
function getHrActivityHistory() function getHrActivityHistory() {
{
console.log(event.target.dataset.id); //return; console.log(event.target.dataset.id); //return;
let ids = event.target.dataset.id.split('-'); let ids = event.target.dataset.id.split('-');
console.log('ids', ids) console.log('ids', ids)
@ -661,7 +704,12 @@ body {
console.log(url); console.log(url);
let user_type = "hr"; let user_type = "hr";
let requestData = {user_id : ids[1], pre_hr_id : ids[0], user_type : user_type, client_id : client_id}; let requestData = {
user_id: ids[1],
pre_hr_id: ids[0],
user_type: user_type,
client_id: client_id
};
console.log('requestData', requestData); console.log('requestData', requestData);
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) { sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
@ -703,7 +751,10 @@ body {
allowed_pre_policies: getCheckedValues(`${userId}_pre_policies`), allowed_pre_policies: getCheckedValues(`${userId}_pre_policies`),
allowed_active_policies: getCheckedValues(`${userId}_active_policies`), allowed_active_policies: getCheckedValues(`${userId}_active_policies`),
allowed_cd: getCheckedValues(`${userId}_cd`), allowed_cd: getCheckedValues(`${userId}_cd`),
allowed_claims: getCheckedValues(`${userId}_claims`) allowed_claims: getCheckedValues(`${userId}_claims`),
pre_branch_id: formData.get(`${userId}_pre_branch_id`),
post_branch_id: formData.get(`${userId}_post_branch_id`),
pre_client_id: formData.get(`${userId}_pre_client_id`)
}; };
users.push(user); users.push(user);
@ -721,7 +772,10 @@ body {
allowed_pre_policies: user.allowed_pre_policies.length ? `[${user.allowed_pre_policies.join(',')}]` : '[]', allowed_pre_policies: user.allowed_pre_policies.length ? `[${user.allowed_pre_policies.join(',')}]` : '[]',
allowed_active_policies: user.allowed_active_policies.length ? `[${user.allowed_active_policies.join(',')}]` : '[]', allowed_active_policies: user.allowed_active_policies.length ? `[${user.allowed_active_policies.join(',')}]` : '[]',
allowed_cd: user.allowed_cd.length ? `[${user.allowed_cd.join(',')}]` : '[]', allowed_cd: user.allowed_cd.length ? `[${user.allowed_cd.join(',')}]` : '[]',
allowed_claims: user.allowed_claims.length ? `[${user.allowed_claims.join(',')}]` : '[]' allowed_claims: user.allowed_claims.length ? `[${user.allowed_claims.join(',')}]` : '[]',
pre_client_id: user.pre_client_id || "",
pre_branch_id: user.pre_branch_id || "",
post_branch_id: user.post_branch_id || ""
}; };
}); });
@ -745,7 +799,10 @@ body {
console.log(output); console.log(output);
let url = '<?= base_url('util/saveHrAccessData') ?>'; let url = '<?= base_url('util/saveHrAccessData') ?>';
let requestData = {json : output, client_id : client_id}; let requestData = {
json: output,
client_id: client_id
};
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) { sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
console.log('Data fetched successfully:', response); console.log('Data fetched successfully:', response);
@ -972,19 +1029,148 @@ body {
// console.log('--- END ---'); // console.log('--- END ---');
// }); // });
</script>
<script>
$('#btnAutoBranchFetch').click(function() {
var myModal = new bootstrap.Modal(document.getElementById('autoFetchBranchModal'));
myModal.show();
})
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('#client_add .nav-link').click(function(){
// change bg color of tab $('#auto_fetch_client').select2();
$('#client_add .nav-link').removeClass('active-tab'); $('#auto_fetch_branch').select2();
$(this).addClass('active-tab');
$('#auto_fetch_client').change(function() {
$('#auto_fetch_branch').html(`<option value="">Select Branch</option>`);
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
$.ajax({
url: "<?php echo base_url('client/branch/auto_fetch_branch'); ?>",
type: "POST",
data: {
client_id: $('#auto_fetch_client').val()
},
dataType: "json",
success: function(response, textStatus, xhr) {
if (xhr.status === 200) {
let options = `<option value="">Select Branch</option>`;
response.data.forEach((data) => {
options += `<option value="${data.id}">${data.branch_name}</option>`;
});
$('#auto_fetch_branch').html(options);
} else {
$('#auto_fetch_branch').html('<option value="">No Branch Found</option>');
}
},
error: function(xhr, status, error) {
console.error("Error occurred:", status, error);
},
complete: function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
console.log("auto_fetch_client call is completed..!!");
}
}); });
}); });
});
</script>
<script>
$('#submitAutoFetch').click(function() {
let client_id = $('#auto_fetch_client').val();
let branch_id = $('#auto_fetch_branch').val();
if (client_id == "" || branch_id == "") {
Swal.fire({
icon: 'warning',
title: 'Missing Data',
text: 'Please select both Client and its Branch!',
confirmButtonText: 'OK'
});
return;
}
$.ajax({
url: "<?php echo base_url('client/branch/auto_fetch_branch_details'); ?>",
type: "POST",
data: {
client_id,
branch_id
},
dataType: "json",
success: function(response, textStatus, xhr) {
if (xhr.status === 200) {
let result = response.data[0]??[];
if(response.data[0] == []){
console.log("Empty array ..!!!");
return;
}
let units = JSON.parse(result['units']);
let $select = $('#selected');
$select.empty();
units.forEach(unit => {
// If you want to mark them as selected, set 'selected' attribute
$select.append(`<option value="${unit}" selected>${unit}</option>`);
});
$('#pre_branch_id').val(branch_id);
$('#branch_name').val(result['branch_name']??'');
$('#branch_code').val(result['branch_code']??'');
$('#address1').val(result['address1']??'');
$('#address2').val(result['address2']??'');
$('#state').val(result['state']??'');
$('#district').val(result['district']??'');
$('#branch_city').val(result['city']??'');
$('#pincode').val(result['pincode']??'');
$('#gst').val(result['gst']??'');
$('#sez').val(result['sez']??'');
} else {
console.log("User Error thrown");
console.log("status" + xhr.status);
}
closeModalById('autoFetchBranchModal');
},
error: function(xhr, status, error) {
console.error("Error occurred:", status, error);
},
complete: function() {
console.log("auto_fetch_branch_details call is completed..!!");
}
})
})
</script> </script>

View File

@ -200,7 +200,8 @@
<span class="slider round" style="height: 27px;"></span> <span class="slider round" style="height: 27px;"></span>
</label> </label>
<label for="policy_visibility" style="position: relative;bottom: 5px;left: 85px;">Policy Visibilty in Enrollment App</label> <!-- <label for="policy_visibility" style="position: relative;bottom: 5px;left: 85px;">Policy Visibilty in Enrollment App</label> -->
<label for="policy_visibility" style="position: relative;bottom: 5px;left: 85px;">Policy Visibilty in Employee App</label>
</div> </div>
<div class="form-group col-md-4 EB"> <div class="form-group col-md-4 EB">

View File

@ -13,33 +13,36 @@
width: inherit; width: inherit;
z-index: 1; z-index: 1;
} }
.autocomplete-suggestion { .autocomplete-suggestion {
padding: 8px; padding: 8px;
cursor: pointer; cursor: pointer;
} }
.autocomplete-suggestion:hover { .autocomplete-suggestion:hover {
background-color: #e9e9e9; background-color: #e9e9e9;
} }
</style> </style>
<div class="row"> <div class="row">
<div class="col-12" style="margin-top: -12px;"> <div class="col-12" style="margin-top: -12px;">
<div class="card-body">
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h5 class="m-1"> <h4 class="m-1">
<span>Filter</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
aria-expanded="true"> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> <i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h5> </h4>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body" style="margin-top: 0px;">
<div class="form-group"> <div class="form-group">
<form method="post" action="<?= base_url("/dmsSearch"); ?>" id='dms_search_form'> <form method="post" action="<?= base_url("/dmsSearch"); ?>" id='dms_search_form'>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-2"> <div class="form-group col-md-4">
<label for="customer">Customer</label> <label for="customer">Customer</label>
<!-- <div style="position:relative;"> --> <!-- <div style="position:relative;"> -->
<input type="text" class="form-control" id="customer" placeholder="Enter customer name"> <input type="text" class="form-control" id="customer" placeholder="Enter customer name">
@ -48,16 +51,20 @@
<!-- </div> --> <!-- </div> -->
</div> </div>
<div class="form-group col-md-2"> <div class="form-group col-md-4">
<label for="customer">Customer document name</label> <label for="customer">Customer document name</label>
<!-- <div style="position:relative;"> --> <!-- <div style="position:relative;"> -->
<input type="text" name="cus_doc_name" class="form-control" id="cus_doc_name" placeholder="Enter customer doc name "> <input type="text" name="cus_doc_name" class="form-control" id="cus_doc_name" placeholder="Enter customer doc name ">
<!-- </div> --> <!-- </div> -->
</div> </div>
<div class="form-group col-md-1" style="text-align: center;"> <div class="form-group col-md-4"></div>
<div class="form-group col-md-8" style="text-align: center; font-size: small;">
OR OR
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4"></div>
<div class="form-group col-md-4">
<label for="customer">Policy</label> <label for="customer">Policy</label>
<!-- <div style="position:relative;"> --> <!-- <div style="position:relative;"> -->
<input type="text" class="form-control" id="policy" placeholder="Enter policy no"> <input type="text" class="form-control" id="policy" placeholder="Enter policy no">
@ -66,17 +73,19 @@
<!-- </div> --> <!-- </div> -->
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="customer">Policy document name</label> <label for="customer">Policy document name</label>
<!-- <div style="position:relative;"> --> <!-- <div style="position:relative;"> -->
<input type="text" name="policy_doc_name" class="form-control" id="policy_doc_name" placeholder="Enter policy doc name "> <input type="text" name="policy_doc_name" class="form-control" id="policy_doc_name" placeholder="Enter policy doc name ">
<!-- </div> --> <!-- </div> -->
</div> </div>
<div class="form-group col-md-4 d-flex justify-content-end align-items-end">
<button type="button" class="btn app-btn-outline-secondary mr-2" id="clear-filters">Clear</button>
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="get-emp-list" onclick="fetchFileList(event);">Submit</button>
<!-- <input type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="get-emp-list" onclick="fetchFileList(event);" value="submit"> -->
</div> </div>
<div class="form-group text-right m-b-0">
<button type="button" class="btn btn-secondary" id="clear-filters">Clear</button>
<input type="submit" class="btn btn-primary waves-effect waves-light" id="get-emp-list" onclick="fetchFileList(event);" value="submit">
</div> </div>
</form> </form>
</div> </div>
@ -86,6 +95,8 @@
</div> </div>
</div> </div>
</div>
</div> </div>
<!-- end page title --> <!-- end page title -->
@ -94,7 +105,8 @@
<div class="card-body"> <div class="card-body">
<div class="row" style="padding-bottom: 10px;"> <div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">File search result</h4> <h4 style="position: relative;">Files</h4>
<!-- <h4 style="position: relative;">File search result</h4> -->
</div> </div>
</div> </div>
@ -102,17 +114,17 @@
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100"> <table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th>S.No</th> <th>S.No&nbsp;</th>
<th>Doc name</th> <th>Doc name&nbsp;</th>
<th>File name</th> <th>File name&nbsp;</th>
<th>Action</th> <th>Action&nbsp;</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php if (isset($files)) { ?> <?php if (isset($files)) { ?>
<?php foreach($files as $index => $row){ ?> <?php foreach($files as $index => $row){ ?>
<tr> <tr>
<td><?= $index + 1 ?></td> <td class="text-center"><?= $index + 1 ?></td>
<td><?php echo $row['doc_name']; ?></td> <td><?php echo $row['doc_name']; ?></td>
<td><?php echo $row['file_name']; ?></td> <td><?php echo $row['file_name']; ?></td>
<td> <td>
@ -125,6 +137,8 @@
</a> </a>
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>
@ -140,7 +154,6 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
// $('#client_id').select2(); // $('#client_id').select2();
// $('#insurer_id').select2(); // $('#insurer_id').select2();
@ -160,12 +173,33 @@ var ticketsTable = $('#scroll-horizontal-datatable');
if (ticketsTable.length) { if (ticketsTable.length) {
ticketsTable.DataTable({ ticketsTable.DataTable({
scrollX: true, scrollX: true,
language: { dom: "<'row'<'col-sm-2'f><'col-sm-10 text-right'B>>" +
search: "_INPUT_", "<'row'<'col-sm-12'tr>>" +
searchPlaceholder: "Search..." "<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [{
extend: 'collection',
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=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
}, },
paging: true, // Enable pagination {
pageLength: 25, // Set default number of rows per page (optional) extend: 'excel',
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
exportOptions: {
orthogonal: 'sort'
},
className: 'app-btn-primary ',
}
]
}],
paging: true,
pageLength: 10,
order: [
[0, 'desc']
]
}); });
} else { } else {
console.error("Table not found."); console.error("Table not found.");
@ -209,8 +243,7 @@ function showSuggestions(inputID, suggestionBoxID,hiddenInputID,suggestions) {
} }
function fetchFileList(event) function fetchFileList(event) {
{
event.preventDefault(); event.preventDefault();
var customer = document.getElementById('customer').value; var customer = document.getElementById('customer').value;
@ -220,26 +253,25 @@ function fetchFileList(event)
var cus_doc_name = document.getElementById('cus_doc_name').value; var cus_doc_name = document.getElementById('cus_doc_name').value;
var policy_doc_name = document.getElementById('policy_doc_name').value; var policy_doc_name = document.getElementById('policy_doc_name').value;
if(customer == '' && cus_doc_name != '') if (policy == '' && customer == '') {
{ alert('choose customer or policy');
alert('choose customer');return false; return false;
} }
if(policy == '' && policy_doc_name != '') if (customer == '' && cus_doc_name != '') {
{ alert('choose customer');
alert('choose policy');return false; return false;
} }
if(policy == '' && customer == '') if (policy == '' && policy_doc_name != '') {
{ alert('choose policy');
alert('choose customer or policy');return false; return false;
} }
console.log('called'); console.log('called');
let customEvent = new CustomEvent('fetchFileListCustomEvent'); let customEvent = new CustomEvent('fetchFileListCustomEvent');
$('#dms_search_form').submit(); $('#dms_search_form').submit();
} }
</script> </script>

View File

@ -36,6 +36,7 @@
</div> </div>
</div> </div>
<div id="collapseOne">
<div id="file_table" class="card"> <div id="file_table" class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="padding-bottom: 10px;"> <div class="row" style="padding-bottom: 10px;">
@ -45,13 +46,13 @@
</div> </div>
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap"> <table data-custom-table-css="second-table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th>S.No</th> <th>S.No&nbsp;</th>
<th>Docs Name</th> <th>Docs Name&nbsp;</th>
<th>File Name</th> <th>File Name&nbsp;</th>
<th>Action</th> <th>Action&nbsp;</th>
</tr> </tr>
</thead> </thead>
<tbody id="table_bd"> <tbody id="table_bd">
@ -63,6 +64,7 @@
</div><!-- end col --> </div><!-- end col -->
</div> </div>
</div> </div>
</div>
<script> <script>

View File

@ -92,33 +92,33 @@
<table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table"> <table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">SNO</th> <th class="font-weight-medium">S.No&nbsp;</th>
<?php if (isset($getData)) { <?php if (isset($getData)) {
if ($getData['client_id'] == '0' && $getData['policy_id'] == '0' && $getData['branch_id'] == '0' && ($getData['emp_code'] != "" || $getData['emp_name'] != "" || $getData['status'] != "")) { ?> if ($getData['client_id'] == '0' && $getData['policy_id'] == '0' && $getData['branch_id'] == '0' && ($getData['emp_code'] != "" || $getData['emp_name'] != "" || $getData['status'] != "")) { ?>
<th class="font-weight-medium">Client/Branch</th> <th class="font-weight-medium">Client/Branch&nbsp;</th>
<?php } <?php }
if ($getData['client_id'] != '0' && $getData['branch_id'] == '0') { ?> if ($getData['client_id'] != '0' && $getData['branch_id'] == '0') { ?>
<th class="font-weight-medium">Branch</th> <th class="font-weight-medium">Branch&nbsp;</th>
<?php } } ?> <?php } } ?>
<th class="font-weight-medium">Name</th> <th class="font-weight-medium">Name&nbsp;</th>
<th class="font-weight-medium">EMP Code</th> <th class="font-weight-medium">EMP Code&nbsp;</th>
<th class="font-weight-medium">Relationship</th> <th class="font-weight-medium">Relationship&nbsp;</th>
<th class="font-weight-medium">Gender</th> <th class="font-weight-medium">Gender&nbsp;</th>
<th class="font-weight-medium">Email</th> <th class="font-weight-medium">Email&nbsp;</th>
<th class="font-weight-medium">Mobile</th> <th class="font-weight-medium">Mobile&nbsp;</th>
<th class="font-weight-medium">Date of Birth</th> <th class="font-weight-medium">Date of Birth&nbsp;</th>
<th class="font-weight-medium">Policy name</th> <th class="font-weight-medium">Policy name&nbsp;</th>
<th class="font-weight-medium">Insurer name</th> <th class="font-weight-medium">Insurer name&nbsp;</th>
<th class="font-weight-medium">TPA ID</th> <th class="font-weight-medium">TPA ID&nbsp;</th>
<th class="font-weight-medium">Risk ID</th> <th class="font-weight-medium">Risk ID&nbsp;</th>
<th class="font-weight-medium">Policy status</th> <th class="font-weight-medium">Policy status&nbsp;</th>
<th class="font-weight-medium">()Sum Insured</th> <th class="font-weight-medium">()Sum Insured&nbsp;</th>
<th class="font-weight-medium">()Premium</th> <th class="font-weight-medium">()Premium&nbsp;</th>
<th class="font-weight-medium" id="rata_premium" data-toggle="tooltip" data-placement="top">()Pro Rata <br> Premium</th> <th class="font-weight-medium" id="rata_premium" data-toggle="tooltip" data-placement="top">()Pro Rata <br> Premium&nbsp;</th>
<th class="font-weight-medium" id="gst" data-toggle="tooltip" data-placement="top">()GST</th> <th class="font-weight-medium" id="gst" data-toggle="tooltip" data-placement="top">()GST&nbsp;</th>
<th class="font-weight-medium" > Action </th> <th class="font-weight-medium" > Action &nbsp;</th>
</tr> </tr>
</thead> </thead>
@ -129,7 +129,7 @@
$gst_total = 0; $gst_total = 0;
foreach ($employees as $key => $employee) { ?> foreach ($employees as $key => $employee) { ?>
<tr> <tr>
<td><b><?php echo ($key + 1); ?></b></td> <td class="text-center"><b><?php echo ($key + 1); ?></b></td>
<?php if (isset($getData)) { <?php if (isset($getData)) {
if ($getData['client_id'] == '0' && $getData['policy_id'] == '0' && $getData['branch_id'] == '0' && ($getData['emp_code'] != "" || $getData['emp_name'] != "" || $getData['status'] != "")) { ?> if ($getData['client_id'] == '0' && $getData['policy_id'] == '0' && $getData['branch_id'] == '0' && ($getData['emp_code'] != "" || $getData['emp_name'] != "" || $getData['status'] != "")) { ?>
@ -343,18 +343,34 @@
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [{ buttons: [
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [
{
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'Member-List', title: 'Member-List',
},{ },
{
extend: 'excel', extend: 'excel',
text: 'Excel', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
className: 'app-btn-primary ',
title: 'Member-List', title: 'Member-List',
}], }
]
}
],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, // Enable pagination paging: true, // Enable pagination
pageLength: 25 // Set default number of rows per page (optional) pageLength: 25 // Set default number of rows per page (optional)

View File

@ -45,25 +45,20 @@ table.dataTable tbody td {
color: #16181b !important; color: #16181b !important;
cursor: pointer !important; cursor: pointer !important;
} }
.row{
margin-right:20px !important;
margin-left:30px !important;
}
</style> </style>
<div class="row"> <div class="row">
<div class="col-xl-12"> <div class="col-xl-12">
<div class="card-body">
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h3 class="m-1"> <h4>
<span>Members</span> Filter
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
aria-expanded="true"> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> <i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h3> </h4>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body">
<!-- <div class="text-center"> --> <!-- <div class="text-center"> -->
@ -140,11 +135,14 @@ table.dataTable tbody td {
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
<?php // include('employee_data_list.php');?> <?php // include('employee_data_list.php');
?>
<div id="employee_table_list"></div> <div id="employee_table_list"></div>
@ -337,10 +335,8 @@ function init() {
} }
} }
} }
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
// Initialize select2 // Initialize select2
$("#clients").select2(); $("#clients").select2();
@ -655,8 +651,7 @@ document.getElementById('toggleIcon').addEventListener('click', function() {
}); });
function sendManualEcard(input) function sendManualEcard(input) {
{
console.log('sendManualEcard function called'); console.log('sendManualEcard function called');
var client_id = $('#clients').val() var client_id = $('#clients').val()
@ -667,8 +662,7 @@ function sendManualEcard(input)
console.log('client_id', client_id); console.log('client_id', client_id);
console.log('client_branch_id', client_branch_id); console.log('client_branch_id', client_branch_id);
if(client_id == 0 || client_branch_id == 0 || policy_id == 0) if (client_id == 0 || client_branch_id == 0 || policy_id == 0) {
{
Swal.fire({ Swal.fire({
title: "warning!", title: "warning!",
text: 'Please select the Client, Client Branch and Policy.', text: 'Please select the Client, Client Branch and Policy.',
@ -718,5 +712,4 @@ function sendManualEcard(input)
}); });
} }
</script> </script>

View File

@ -11,12 +11,23 @@ option:disabled {
<div class="col-xl-12"> <div class="col-xl-12">
<div id="accordion1" class="mb-3"> <div id="accordion1" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h5 class="m-1">
<h4 class="m-1">
<span>Filters</span>
<a id="toggleIcon1" class="text-dark float-right" data-toggle="collapse" href="#collapseTwo" <a id="toggleIcon1" class="text-dark float-right" data-toggle="collapse" href="#collapseTwo"
aria-expanded="true"> aria-expanded="true">
<i id="icon1" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> <i id="icon1" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h5> </h4>
<!-- <label id="filterAccordion" class="m-1 d-flex justify-content-between align-items-center">
<span class="font-color-black">Filters</span>
<a id="toggleIcon1" class="text-dark float-right" data-toggle="collapse" href="#collapseTwo"
aria-expanded="true">
<i id="icon1" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a>
</label> -->
<div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion1"> <div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion1">
<div class="card-body"> <div class="card-body">
<!-- <div class="text-center"> --> <!-- <div class="text-center"> -->
@ -86,7 +97,7 @@ option:disabled {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button id="emp_form_submit_button" type="submit" <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> class=" nav-link-btn px-3 py-2 btn btn-primary waves-effect waves-light justify-content-end">Upload</button>
&nbsp;&nbsp; &nbsp;&nbsp;
@ -94,7 +105,7 @@ option:disabled {
&nbsp;&nbsp; &nbsp;&nbsp;
<a class=" nav-link-btn px-3 py-1 btn btn-primary waves-effect waves-light justify-content-end" <a class=" nav-link-btn px-3 py-2 btn btn-primary waves-effect waves-light justify-content-end"
id="fetch_enrolled_data" data-toggle="modal" id="fetch_enrolled_data" data-toggle="modal"
data-target="#full-width-modal" title="Download Sample Excel">Fetch data-target="#full-width-modal" title="Download Sample Excel">Fetch
Enrolled Data</a> Enrolled Data</a>

View File

@ -14,17 +14,19 @@
} }
</style> </style>
<div class="container-fluid"> <div class="container-fluid-min">
<h2>Endorsement</h2>
<div class="row"> <div class="row">
<div class="col-xl-12"> <div class="col-xl-12">
<div class="card-body">
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h5 class="m-1"> <h4>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true"> Filter
<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> <i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h5> </h4>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body">
<!-- <div class="text-center"> --> <!-- <div class="text-center"> -->
@ -75,6 +77,8 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
<div class="row" id="client_list"> <div class="row" id="client_list">
@ -90,7 +94,7 @@
<table data-custom-table-css="table" class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" id="tickets-table"> <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"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">SNO</th> <th class="font-weight-medium">S.No&nbsp;</th>
<th class="font-weight-medium">Name/code</th> <th class="font-weight-medium">Name/code</th>
<th class="font-weight-medium">Policy name</th> <th class="font-weight-medium">Policy name</th>
<th class="font-weight-medium">Endorsement ID</th> <th class="font-weight-medium">Endorsement ID</th>
@ -108,7 +112,7 @@
foreach ($employees as $key => $employee) { ?> foreach ($employees as $key => $employee) { ?>
<tr> <tr>
<td><b><?php echo ($key + 1) ?></b></td> <td class="text-center"><b><?php echo ($key + 1) ?></b></td>
<td><?php echo $employee['name'] ?>( <?php echo $employee['emp_code'] ?> )</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_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 isset($employee['policy_type']) ? $employee['policy_type'] : '' ?> - <?php echo isset($employee['policy_no']) ? $employee['policy_no'] : '' ?></td>
@ -590,27 +594,54 @@
$(document).ready(function() { $(document).ready(function() {
$('#tickets-table').DataTable({ $('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" + dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" +
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [{
text: '<i class="mdi mdi-plus" ></i><span class=" btn-custom"> Add </span>',
className: 'btn app-btn-primary mr-2',
action: function(e, dt, node, config) {
openTicket();
}
},
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [{ buttons: [{
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
title: 'Endorsement-List', className: 'app-btn-primary ',
className: 'my_class', },
{
extend: 'excel',
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
exportOptions: { exportOptions: {
columns: ':not(:last-child)', orthogonal: 'sort'
format: { },
body: function (data, row, column, node) { className: 'app-btn-primary ',
// 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 ]
} }
} ],
} // buttons: [{
}], // extend: 'csv',
// text: 'CSV',
// title: '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) { initComplete: function(settings, json) {
$('.my_class').css({ $('.my_class').css({
"position": "relative", "position": "relative",
@ -618,13 +649,19 @@
}); });
}, },
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, paging: true,
// pagingType: 'full_numbers' // pagingType: 'full_numbers'
columnDefs: [ columnDefs: [{
{ type: 'scientific', targets: 0 } // Apply custom sorting type to the first column type: 'scientific',
targets: 0
} // Apply custom sorting type to the first column
], ],
}); });

View File

@ -31,12 +31,15 @@
box-shadow: 6px 5px 8px 0 #00000036; box-shadow: 6px 5px 8px 0 #00000036;
cursor: pointer; cursor: pointer;
} }
.click_hover .text-muted { .click_hover .text-muted {
color: #fff !important; color: #fff !important;
} }
.click_hover span { .click_hover span {
color: #fff !important; color: #fff !important;
} }
.card { .card {
border-radius: 10px; border-radius: 10px;
} }
@ -61,8 +64,7 @@
#categoryFilter_12 a, #categoryFilter_12 a,
#categoryFilter_13 a, #categoryFilter_13 a,
#categoryFilter_14 a #categoryFilter_14 a {
{
background-color: #00999E; background-color: #00999E;
box-shadow: 0px 2px 4px 0px #00000040; box-shadow: 0px 2px 4px 0px #00000040;
@ -94,14 +96,13 @@
border-radius: 10px; border-radius: 10px;
box-shadow: 0px 2px 4px 0px #00000024 !important; box-shadow: 0px 2px 4px 0px #00000024 !important;
} }
</style> </style>
<div class="container-fluid"> <div class="container-fluid-min">
<h2>Enrollment</h2>
<div class="row visa_status_count_view"> <div class="row visa_status_count_view">
<div class="col-12"> <div class="col-12">
<div class="card-body">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<div class="row"> <div class="row">
@ -211,6 +212,8 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
<div class="row" id="client_list"> <div class="row" id="client_list">
@ -220,7 +223,7 @@
<table data-custom-table-css="table" class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" id="tickets-table"> <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"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">SNO</th> <th class="font-weight-medium">S.No&nbsp;</th>
<th class="font-weight-medium">Name</th> <th class="font-weight-medium">Name</th>
<th class="font-weight-medium">Emp Code</th> <th class="font-weight-medium">Emp Code</th>
<th class="font-weight-medium">Relationship</th> <th class="font-weight-medium">Relationship</th>
@ -278,9 +281,7 @@
</div><!-- /.modal --> </div><!-- /.modal -->
<script> <script>
function populateBranches() {
function populateBranches()
{
var clientId = document.getElementById('clients').value; var clientId = document.getElementById('clients').value;
var branchDropdown = document.getElementById('branch_id'); var branchDropdown = document.getElementById('branch_id');
@ -302,8 +303,7 @@
}); });
} }
function populatePolicies() function populatePolicies() {
{
console.log('populatePolicies function called'); console.log('populatePolicies function called');
var clientId = document.getElementById('clients').value; var clientId = document.getElementById('clients').value;
@ -334,8 +334,7 @@
}); });
} }
function filterTable(columnIndex, filterValue) function filterTable(columnIndex, filterValue) {
{
var table = $('#tickets-table').DataTable(); var table = $('#tickets-table').DataTable();
// Reset the search filter for all columns // Reset the search filter for all columns
@ -345,8 +344,7 @@
table.column(columnIndex).search(filterValue).draw(); table.column(columnIndex).search(filterValue).draw();
} }
function fetchEmpolyeeList(event) function fetchEmpolyeeList(event) {
{
event.preventDefault(); event.preventDefault();
var client_id = $('#clients').val(); var client_id = $('#clients').val();
@ -444,8 +442,7 @@
}); });
} }
$(document).ready(function() $(document).ready(function() {
{
function getUrlParameter(name) { function getUrlParameter(name) {
var params = new URLSearchParams(window.location.search); var params = new URLSearchParams(window.location.search);
@ -472,7 +469,9 @@
} }
if (history.pushState) { if (history.pushState) {
var newUrl = window.location.protocol + "//" + window.location.host + window.location.pathname; var newUrl = window.location.protocol + "//" + window.location.host + window.location.pathname;
window.history.pushState({path: newUrl}, '', newUrl); window.history.pushState({
path: newUrl
}, '', newUrl);
} }
setTimeout(() => { setTimeout(() => {
@ -488,32 +487,66 @@
$('#client_policy_id').select2(); $('#client_policy_id').select2();
var table = $('#tickets-table').DataTable({ var table = $('#tickets-table').DataTable({
dom: 'fBrtip', dom: 'fBrtip',
buttons: [ // buttons: [
{ // {
// extend: 'copy',
// text: '<i class="mdi mdi-content-copy"></i>',
// titleAttr: 'Copy',
// filename: 'Enrolment List'
// },
// {
// extend: 'print',
// text: '<i class="mdi mdi-printer"></i>',
// titleAttr: 'Print',
// filename: 'Enrolment List'
// },
// {
// extend: 'pdf',
// text: '<i class="mdi mdi-file-pdf"></i>',
// titleAttr: 'PDF',
// filename: 'Enrolment List'
// },
// {
// extend: 'csv',
// text: '<i class="mdi mdi-file-document"></i>',
// titleAttr: 'CSV',
// filename: 'Enrolment List'
// }
// ],
buttons: [{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [{
extend: 'copy', extend: 'copy',
text: '<i class="mdi mdi-content-copy"></i>', text: '<i class="mdi mdi-content-copy"></i>',
titleAttr: 'Copy', titleAttr: 'Copy',
filename: 'Enrolment List' filename: 'Enrolment List'
}, className: 'app-btn-primary ',
{
extend: 'print',
text: '<i class="mdi mdi-printer"></i>',
titleAttr: 'Print',
filename: 'Enrolment List'
},
{
extend: 'pdf',
text: '<i class="mdi mdi-file-pdf"></i>',
titleAttr: 'PDF',
filename: 'Enrolment List'
}, },
{ {
extend: 'csv', extend: 'csv',
text: '<i class="mdi mdi-file-document"></i>', text: '<i class="mdi mdi-file-document"></i>',
titleAttr: 'CSV', titleAttr: 'CSV',
filename: 'Enrolment List' filename: 'Enrolment List'
className: 'app-btn-primary ',
},
{
extend: 'print',
text: '<i class="mdi mdi-printer"></i>',
titleAttr: 'Print',
filename: 'Enrolment List'
className: 'app-btn-primary ',
},
{
extend: 'pdf',
text: '<i class="mdi mdi-file-pdf"></i>',
titleAttr: 'PDF',
filename: 'Enrolment List'
className: 'app-btn-primary ',
} }
], ]
}],
initComplete: function() { initComplete: function() {
// Add custom class to the print button // Add custom class to the print button
$('.buttons-print').addClass('buttons-html5'); $('.buttons-print').addClass('buttons-html5');
@ -604,8 +637,7 @@
toggleContent(); toggleContent();
}); });
function toggleContent() function toggleContent() {
{
var content = document.getElementById("statusContent"); var content = document.getElementById("statusContent");
var toggleIcon = document.getElementById("toggleIcon"); var toggleIcon = document.getElementById("toggleIcon");
if (content.style.display === "none") { if (content.style.display === "none") {
@ -622,8 +654,7 @@
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
function uploadEnrollmentFile(input) function uploadEnrollmentFile(input) {
{
console.log('uploadEnrollmentFile called'); console.log('uploadEnrollmentFile called');
var client_id = $('#clients').val() var client_id = $('#clients').val()
@ -679,8 +710,7 @@
} }
function appendpolicy(data) function appendpolicy(data) {
{
$('#policy_id').empty(); $('#policy_id').empty();
$('#policy_id').append($('<option>', { $('#policy_id').append($('<option>', {
@ -776,8 +806,7 @@
}); });
function sendManualReminder(input) function sendManualReminder(input) {
{
console.log('sendManualReminder function called'); console.log('sendManualReminder function called');
var client_id = $('#clients').val() var client_id = $('#clients').val()

View File

@ -110,7 +110,18 @@ table.dataTable tbody td {
<!-- Include DataTables Buttons HTML5 export extension --> <!-- Include DataTables Buttons HTML5 export extension -->
<script src="https://cdn.datatables.net/buttons/2.3.0/js/buttons.html5.min.js"></script> <script src="https://cdn.datatables.net/buttons/2.3.0/js/buttons.html5.min.js"></script>
<?php
if (isset($lead_id)) {
$url = base_url("util/downloadFullMemberDataExcelErrorFile/") . $lead_id;
} else {
$url = base_url("util/full-excel-error-file/") . $file_id;
}
?>
<script> <script>
let url = "<?= $url ?>";
$(document).ready(function() { $(document).ready(function() {
$('#tickets-table').DataTable({ $('#tickets-table').DataTable({
dom: 'Bfrtip', dom: 'Bfrtip',
@ -123,7 +134,7 @@ $(document).ready(function() {
{ {
text: 'Excel Error', // Set the text for the custom button text: 'Excel Error', // Set the text for the custom button
action: function (e, dt, node, config) { action: function (e, dt, node, config) {
window.location.href = '<?= base_url("util/full-excel-error-file/") . $file_id ?>'; window.location.href = url;
} }
} }
], ],

View File

@ -19,19 +19,18 @@
</div> </div>
</div> </div>
<table data-custom-table-css="table" class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" <table data-custom-table-css="table" class="table mb-0 nowrap w-100 table-centered" cellspacing="0" id="tickets-table">
id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">SNO</th> <th class="font-weight-medium">S.No&nbsp;</th>
<th class="font-weight-medium">File name</th> <th class="font-weight-medium">File name&nbsp;</th>
<th class="font-weight-medium">Client</th> <th class="font-weight-medium">Client&nbsp;</th>
<th class="font-weight-medium">Client Branch</th> <th class="font-weight-medium">Client Branch&nbsp;</th>
<th class="font-weight-medium">Policy</th> <th class="font-weight-medium">Policy&nbsp;</th>
<th class="font-weight-medium">Event</th> <th class="font-weight-medium">Event&nbsp;</th>
<th class="font-weight-medium">User/Time</th> <th class="font-weight-medium">User/Time&nbsp;</th>
<th class="font-weight-medium">Status</th> <th class="font-weight-medium">Status&nbsp;</th>
<th class="font-weight-medium">Action</th> <th class="font-weight-medium">Action&nbsp;</th>
</tr> </tr>
</thead> </thead>
@ -45,7 +44,7 @@
?> ?>
<tr> <tr>
<td><b><?php echo ($key + 1) ?></b></td> <td class="text-center"><b><?php echo ($key + 1) ?></b></td>
<td style="overflow: hidden;" class="reload truncate" data-toggle="tooltip" data-placement="top" title="<?php echo $file['file_name'] ?>"> <td style="overflow: hidden;" class="reload truncate" data-toggle="tooltip" data-placement="top" title="<?php echo $file['file_name'] ?>">
<?php echo $file['file_name']?> <?php echo $file['file_name']?>
</td> </td>
@ -461,28 +460,57 @@ $('body').on('click', '.reload', function() {
$(document).ready(function() { $(document).ready(function() {
$('#tickets-table').DataTable({ $('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" +
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
"buttons": [{ buttons: [{
"extend": 'csv', extend: 'collection',
"text": 'CSV', text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
"title": 'Employee-Upload-List', className: 'btn app-btn-secondary ',
"className": 'my_class', buttons: [
"exportOptions": { {
"columns": ':not(:last-child)' extend: 'csv',
}, text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
}], title: 'Employee-Upload-List',
"initComplete": function(settings, json) { className: 'app-btn-primary ',
$('.my_class').css({ exportOptions: {
"position": "relative", columns: ':not(:last-child)'
"left": "79px"
});
}, },
}
]
}
],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
// "buttons": [{
// "extend": 'csv',
// "text": 'CSV',
// "title": 'Employee-Upload-List',
// "className": 'my_class',
// "exportOptions": {
// "columns": ':not(:last-child)'
// },
// }],
// "initComplete": function(settings, json) {
// $('.my_class').css({
// "position": "relative",
// "left": "79px"
// });
// },
// language: {
// search: "_INPUT_",
// searchPlaceholder: "Search..."
// },
paging: true, paging: true,
}); });

View File

@ -16,6 +16,7 @@ table.dataTable tbody td {
.dataTables_filter { .dataTables_filter {
position: absolute; position: absolute;
} }
.custom-dropdown-menu { .custom-dropdown-menu {
display: none; display: none;
position: absolute; position: absolute;
@ -44,16 +45,18 @@ table.dataTable tbody td {
} }
</style> </style>
<div class="row" id="finance_filter">
<div class="col-12" style="margin-top: -12px;"> <div class="col-12" id="finance_filter">
<div class="card-body">
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h5 class="m-1"> <h4 class="m-1">
<span>Filter</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
aria-expanded="true"> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> <i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h5> </h4>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body">
<div class="form-group"> <div class="form-group">
@ -135,16 +138,15 @@ table.dataTable tbody td {
<div class="form-group col-md-3" style="display: none;" id="date_div"> <div class="form-group col-md-3" style="display: none;" id="date_div">
<label>Date<span class="text-danger"></span></label> <label>Date<span class="text-danger"></span></label>
<div id="reportrange" class="form-control" <div class="input-icon">
style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%"> <input type="text" id="reportrange" class="form-control" readonly style="caret-color: transparent;">
<i class="mdi mdi-calendar-blank"></i>&nbsp; <i class="mdi mdi-calendar-blank-outline additional-icon"></i>
<span></span> <i class="mdi mdi-menu-down"></i>
</div> </div>
<input type="hidden" id="startDate"> <input type="hidden" id="startDate">
<input type="hidden" id="endDate"> <input type="hidden" id="endDate">
</div> </div>
</div>
<div class="form-group col-md-3 text-right m-b-0" style="margin-top: 29px;"> <div class="form-group text-right m-b-0">
<a href="<?= base_url("/policy_tranction/report/report-finance-list"); ?>" <a href="<?= base_url("/policy_tranction/report/report-finance-list"); ?>"
class="btn btn-secondary" id="clear-filters">Clear</a> class="btn btn-secondary" id="clear-filters">Clear</a>
<a href="<?= base_url("/policy_tranction/report/report-finance-list"); ?>" <a href="<?= base_url("/policy_tranction/report/report-finance-list"); ?>"
@ -152,7 +154,7 @@ table.dataTable tbody td {
onclick="fetchEmpolyeeList(event);">Submit</a> onclick="fetchEmpolyeeList(event);">Submit</a>
</div> </div>
</div>
<!-- <div class="form-group text-right m-b-0"> <!-- <div class="form-group text-right m-b-0">
<button type="button" class="btn btn-secondary" id="clear-filters">Clear</button> <button type="button" class="btn btn-secondary" id="clear-filters">Clear</button>
@ -182,14 +184,14 @@ table.dataTable tbody td {
<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">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th>S.No</th> <th>S.No&nbsp;</th>
<th>Client Name</th> <th>Client Name&nbsp;</th>
<th>Insurer</th> <th>Insurer&nbsp;</th>
<th>Policy</th> <th>Policy&nbsp;</th>
<th>Policy No</th> <th>Policy No&nbsp;</th>
<th>Endorsement No</th> <th>Endorsement No&nbsp;</th>
<th>Event Type</th> <th>Event Type&nbsp;</th>
<th>Action</th> <th>Action&nbsp;</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -330,22 +332,28 @@ document.addEventListener("DOMContentLoaded", function () {
<script> <script>
// Datatable document ready // Datatable document ready
$(document).ready(function () { $(document).ready(function () {
var ticketsTable = $('#scroll-horizontal-datatable'); var ticketsTable = $('#scroll-horizontal-datatable');
if (ticketsTable.length) { if (ticketsTable.length) {
ticketsTable.DataTable({ ticketsTable.DataTable({
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right dom:
"<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [{ buttons: [
{
extend: 'collection',
text: '<span class="btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary',
buttons: [
{
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited"></i><span class="btn-custom"> CSV </span>',
title: 'Policy-Tranction-BDS-List', title: 'Policy-Tranction-BDS-List'
}, },
{ {
extend: 'excel', extend: 'excel',
text: 'Excel', text: '<i class="mdi mdi-file-excel"></i><span class="btn-custom"> EXCEL </span>',
title: 'Policy-Tranction-BDS-List', title: 'Policy-Tranction-BDS-List',
customize: function (xlsx) { customize: function (xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml']; var sheet = xlsx.xl.worksheets['sheet1.xml'];
@ -353,8 +361,7 @@ $(document).ready(function() {
// Find cells in column AB (28th column in Excel) // Find cells in column AB (28th column in Excel)
$('row c[r^="AB"]', sheet).each(function () { $('row c[r^="AB"]', sheet).each(function () {
var value = parseFloat($('v', this) var value = parseFloat($('v', this).text());
.text()); // Get the value inside the cell
if (!isNaN(value)) { if (!isNaN(value)) {
total += value; total += value;
} }
@ -362,34 +369,158 @@ $(document).ready(function() {
// Get the last row index and append the total row // Get the last row index and append the total row
var lastRow = $('row:last', sheet); var lastRow = $('row:last', sheet);
var rowIndex = parseInt(lastRow.attr('r')) + var rowIndex = parseInt(lastRow.attr('r')) + 2;
2; // Find the next row index
var totalRow = '<row r="' + rowIndex + '">' + var totalRow =
'<c t="inlineStr" r="AA' + rowIndex + '<row r="' + rowIndex + '">' +
'"><is><t>Total</t></is></c>' + // Insert "Total" in AA '<c t="inlineStr" r="AA' + rowIndex + '"><is><t>Total</t></is></c>' +
'<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '</v></c>' +
'</v></c>' + // Insert sum in AB
'</row>'; '</row>';
// Append the new total row to the sheet // Append the new total row to the sheet
$(sheet).find('sheetData').append(totalRow); $(sheet).find('sheetData').append(totalRow);
} }
} }
]
}
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, // Enable pagination paging: true,
pageLength: 25, // Set default number of rows per page (optional) pageLength: 10,
ordering: false, ordering: false
}); });
} else { } else {
console.error("Table not found."); console.error("Table not found.");
} }
}); });
$(document).ready(function() {
getURLParams()
$('#client_id').select2();
$('#insurer_id').select2();
$('#policy_type_id').select2();
})
function fetchEmpolyeeList(event) {
event.preventDefault(); // Prevent default action
var start_date = $('#startDate').val();
var end_date = $('#endDate').val();
var client_id = $('#client_id').val();
var insurer_id = $('#insurer_id').val();
var policy_type_id = $('#policy_type_id').val();
var date_type = $('#date_type').val();
var issuer = $('#issuer').val();
console.log(start_date + '-' + end_date);
var queryParams = {
start_date: start_date,
end_date: end_date,
client_id: client_id,
insurer_id: insurer_id,
policy_type_id: policy_type_id,
date_type: date_type,
issuer: issuer,
};
const queryString = objectToQueryString(queryParams);
const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
console.log(apiURL);
window.location.href = apiURL;
}
function objectToQueryString(obj) {
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
}
function getURLParams() {
const url = new URL(window.location.href);
const params = new URLSearchParams(url.search);
const startDate = params.get('start_date') || 0; // Default to 0 if not found
const endDate = params.get('end_date') || 0; // Default to 0 if not found
const client_id = params.get('client_id') || 0; // Default to 0 if not found
const insurer_id = params.get('insurer_id') || 0; // Default to 0 if not found
const policy_type_id = params.get('policy_type_id') || 0; // Default to 0 if not found
const date_type = params.get('date_type') || 0; // Default to 0 if not found
const issuer = params.get('issuer') || 0; // Default to 0 if not found
hideDateField(date_type)
console.log('startDate', startDate)
console.log('endDate', endDate)
console.log('client_id', client_id)
console.log('insurer_id', insurer_id)
console.log('policy_type_id', policy_type_id)
console.log('date_type', date_type)
console.log('issuer', issuer)
// Log the values or use them as needed
console.log('Start Date:', startDate);
console.log('End Date:', endDate);
if (startDate != 0 && endDate != 0) {
setTimeout(function() {
$('#start_date').val(startDate)
$('#end_date').val(endDate)
$('#client_id').val(client_id).change()
$('#insurer_id').val(insurer_id).change()
$('#policy_type_id').val(policy_type_id).change()
$('#date_type').val(date_type)
$('#issuer').val(issuer)
}, 1000)
}
}
$(function() {
const url = new URL(window.location.href);
const params = new URLSearchParams(url.search);
// Get start and end dates from URL parameters, or use default values
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');
// Parse the dates to moment objects
var start = moment(startDateParam, 'DD-MM-YYYY');
var end = moment(endDateParam, 'DD-MM-YYYY');
// var start = moment().subtract(29, 'days');
// var end = moment();
function cb(start, end) {
$('#reportrange').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,
locale: { format: 'DD-MM-YYYY' },
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')
]
}
});
$(document).ready(function() { $(document).ready(function() {
getURLParams() getURLParams()
$('#client_id').select2(); $('#client_id').select2();
@ -488,7 +619,7 @@ $(function() {
// var end = moment(); // var end = moment();
function cb(start, end) { function cb(start, end) {
$('#reportrange span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY')); $('#reportrange').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
$('#startDate').val(start.format('DD-MM-YYYY')); $('#startDate').val(start.format('DD-MM-YYYY'));
$('#endDate').val(end.format('DD-MM-YYYY')); $('#endDate').val(end.format('DD-MM-YYYY'));
} }
@ -496,6 +627,9 @@ $(function() {
$('#reportrange').daterangepicker({ $('#reportrange').daterangepicker({
startDate: start, startDate: start,
endDate: end, endDate: end,
locale: {
format: 'DD-MM-YYYY'
},
ranges: { ranges: {
'Today': [moment(), moment()], 'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],

View File

@ -61,11 +61,14 @@
</style> </style>
<div class="container-fluid"> <div class="container-fluid-min">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<?php if (isset($hr_access_data) && !empty($hr_access_data)) { ?> <?php if (isset($hr_access_data) && !empty($hr_access_data)) {
$listed_pre = [];
$listed_post = [];
?>
<form id="insuranceForm" onsubmit="submitForm(event)"> <form id="insuranceForm" onsubmit="submitForm(event)">
<?php foreach ($hr_access_data as $key => $value) { <?php foreach ($hr_access_data as $key => $value) {
@ -79,13 +82,17 @@
<input type="hidden" name="<?= 'user' . $key ?>_pre_hr_id" value="<?= $value['pre_hr_id'] ?>"> <input type="hidden" name="<?= 'user' . $key ?>_pre_hr_id" value="<?= $value['pre_hr_id'] ?>">
<input type="hidden" name="<?= 'user' . $key ?>_post_hr_id" value="<?= $value['post_hr_id'] ?>"> <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'] ?>"> <input type="hidden" name="<?= 'user' . $key ?>_post_client_id" value="<?= $value['post_client_id'] ?>">
<input type="hidden" name="<?= 'user' . $key ?>_pre_branch_id" value="<?= $value['pre_branch_id'] ?>">
<input type="hidden" name="<?= 'user' . $key ?>_post_branch_id" value="<?= $value['post_branch_id'] ?>">
<input type="hidden" name="<?= 'user' . $key ?>_pre_client_id" value="<?= $value['pre_client_id'] ?>">
<div class="card-header" onclick="toggleAccordion(this)" style="background-color: #F5FFFF;"> <div class="card-header" onclick="toggleAccordion(this)" style="background-color: #F5FFFF;">
<div class="user-info"> <div class="user-info">
<h5 class="mb-0"><?= $value['hr_name'] ?> <h5 class="mb-0"> Name -<?= $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> --> <!-- <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> </h5>
<p class="user-email"><?= $value['hr_mail'] ?></p> <p style="color: black;"> <b>branch - <?= $value['post_branch_name']?></b></p>
<p class="user-email"> Mail - <?= $value['hr_mail'] ?></p>
</div> </div>
<div class="accordion-icon"> <div class="accordion-icon">
<i class="mdi mdi-chevron-down"></i> <i class="mdi mdi-chevron-down"></i>
@ -128,6 +135,15 @@
<?php foreach ($pre_policy_data as $key1 => $policies) { <?php foreach ($pre_policy_data as $key1 => $policies) {
$statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active'; $statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active';
$statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive'; $statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive';
if (
in_array($policies['branch_id'].'-'.$policies['policy_no'], $listed_pre)
&&
$value['pre_branch_id'] != $policies['branch_id']
) {
continue;
} else {
$listed_pre[] = $policies['branch_id'].'-'.$policies['policy_no'];
}
?> ?>
<div class="checkbox-item"> <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'] ?>" <input type="checkbox" class="policy-checkbox <?= $statusClass ?>" name="<?= 'user' . $key ?>_pre_policies" data-user="<?= $key ?>" data-group="pre" value="<?= $policies['client_policy_id'] ?>"
@ -180,12 +196,26 @@
<?php foreach ($post_policy_data as $key2 => $policies) { <?php foreach ($post_policy_data as $key2 => $policies) {
$statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active'; $statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active';
$statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive'; $statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive';
if(
in_array($policies['branch_id'].'-'.$policies['policy_no'] , $listed_post)
&&
$value['post_branch_id'] != $policies['branch_id']
)
{
continue;
}
else
{
$listed_post[] = $policies['branch_id'].'-'.$policies['policy_no'];
}
?> ?>
<div class="checkbox-item"> <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" <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'])) { value="<?= $policies['client_policy_id'] ?>" <?php if (in_array($policies['client_policy_id'], $value['allowed_active_policies'])) {
echo 'checked'; echo 'checked';
} ?>> } ?>>
&nbsp;&nbsp;
<label for="<?= 'user' . $key ?>-gmc2" style="<?php if ($policies['policy_status'] == 0) { <label for="<?= 'user' . $key ?>-gmc2" style="<?php if ($policies['policy_status'] == 0) {
echo 'color:#ff5757'; echo 'color:#ff5757';
} ?>"> } ?>">

View File

@ -44,6 +44,10 @@ table.dataTable tbody td {
box-shadow: 0px 2px 4px 0px #00000024 !important; box-shadow: 0px 2px 4px 0px #00000024 !important;
} }
#hr_activity_history_append_area tbody tr {
background-color: transparent !important;
}
</style> </style>
<!-- <div class="row" style="position: relative;left: 250px;top: 55px;"> <!-- <div class="row" style="position: relative;left: 250px;top: 55px;">
@ -60,7 +64,7 @@ table.dataTable tbody td {
</div> </div>
</div> --> </div> -->
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap flex-grow"> <table data-custom-table-css="second-table" id="scroll-horizontal-datatable" class="table w-100 nowrap flex-grow">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th>S. No</th> <th>S. No</th>
@ -93,15 +97,16 @@ $(document).ready(function () {
if (ticketsTable.length) { if (ticketsTable.length) {
var table = ticketsTable.DataTable({ var table = ticketsTable.DataTable({
scrollX: true, scrollX: true,
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // search left, buttons right
dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" +
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-3'i><'col-sm-2'l><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
language: { language: {
search: "_INPUT_", search: "_INPUT_",
searchPlaceholder: "Search..." searchPlaceholder: "Search..."
}, },
paging: true, paging: true,
pageLength: 25, pageLength: 10,
ordering: false, ordering: false,
buttons: [ buttons: [
{ {
@ -120,6 +125,17 @@ $(document).ready(function () {
] ]
}); });
// run after DataTable is ready
$('.dataTables_filter input').css({
'background': '#F0F0F0',
'border': 'none',
'border-radius': '8px',
'padding-right': '35px'
}).wrap('<div style="position:relative; display:inline-block;"></div>')
.after('<i class="mdi mdi-magnify" ' +
'style="position:absolute; right:10px; top:50%; transform:translateY(-50%); color:#666;"></i>');
// Attach submit handler separately so it works // Attach submit handler separately so it works
$(document).on("click", "#submitBtn", function () { $(document).on("click", "#submitBtn", function () {
appendHrActivityHistoryHtml(this, true); appendHrActivityHistoryHtml(this, true);

View File

@ -10,11 +10,26 @@
<div class="col-xl-12"> <div class="col-xl-12">
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h5 class="m-1">
<h4 class="m-1">
<span>Filters</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>
</h4>
<!-- <h5 class="m-1">
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true"> <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> <i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h5> </h5>
<label id="filterAccordion" class="m-1 d-flex justify-content-between align-items-center">
<span class="font-color-black">Filters</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>
</label> -->
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body">
<!-- <div class="text-center"> --> <!-- <div class="text-center"> -->
@ -103,15 +118,15 @@
id="hr_tickets_table"> id="hr_tickets_table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">SNO</th> <th class="font-weight-medium">S.No&nbsp;</th>
<th class="font-weight-medium">File name</th> <th class="font-weight-medium">File name&nbsp;</th>
<th class="font-weight-medium">Client</th> <th class="font-weight-medium">Client&nbsp;</th>
<th class="font-weight-medium">Client Branch</th> <th class="font-weight-medium">Client Branch&nbsp;</th>
<th class="font-weight-medium">Policy</th> <th class="font-weight-medium">Policy&nbsp;</th>
<th class="font-weight-medium">Event</th> <th class="font-weight-medium">Event&nbsp;</th>
<th class="font-weight-medium">User/Time</th> <th class="font-weight-medium">User/Time&nbsp;</th>
<th class="font-weight-medium">Status</th> <th class="font-weight-medium">Status&nbsp;</th>
<th class="font-weight-medium">Action</th> <th class="font-weight-medium">Action&nbsp;</th>
</tr> </tr>
</thead> </thead>
@ -341,27 +356,33 @@
// for datatable // for datatable
$(document).ready(function() { $(document).ready(function() {
$('#hr_tickets_table').DataTable({ $('#hr_tickets_table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" + dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" +
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
"buttons": [{ buttons: [{
"extend": 'csv', extend: 'collection',
"text": 'CSV', text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
"title": 'Employee-Upload-List', className: 'btn app-btn-secondary ',
"className": 'my_class', buttons: [
"exportOptions": { {
"columns": ':not(:last-child)' extend: 'csv',
}, text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
}], title: 'Employee-Upload-List',
"initComplete": function(settings, json) { className: 'app-btn-primary ',
$('.my_class').css({ exportOptions: {
"position": "relative", columns: ':not(:last-child)'
"left": "79px"
});
}, },
}
]
}
],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, paging: true,
}); });

View File

@ -10,7 +10,6 @@
</style> </style>
<script> <script>
var client_list = ''; // local variable for storing the client branch list var client_list = ''; // local variable for storing the client branch list
var branch_list = ''; // local variable for storing the client branch list var branch_list = ''; // local variable for storing the client branch list
var policy_list = ''; // local variable for storing the client policy list var policy_list = ''; // local variable for storing the client policy list
@ -21,8 +20,7 @@
}) })
//featch client and branch and policy //featch client and branch and policy
function getClientAndBranchAndPolicy() function getClientAndBranchAndPolicy() {
{
$.ajax({ $.ajax({
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>', url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
type: "GET", type: "GET",
@ -51,35 +49,42 @@
} }
}); });
} }
</script> </script>
<div class="row" id="client_add" style="position: relative; bottom: 25px;"> <div class="row" id="client_add" style="position: relative; bottom: 25px;">
<div class="col-12"> <div class="col-12">
<div class="card-body"> <div class="card-body">
<h3>Inception</h3> <div class="tab-wrapper position-relative">
<br> <ul class="nav nav-pills navtab-bg " id="myTab">
<ul class="nav nav-pills navtab-bg">
<li class="nav-item d-flex justify-content-center align-items-center"> <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"> <button class="scroll-btn left-btn" type="button">&#9664;</button>
</li>
<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-2 active-tab " id="general_tab">
<span class="mr-1"><i class="mdi mdi-contacts"></i></span> <span class="mr-1"><i class="mdi mdi-contacts"></i></span>
<span class="d-none d-sm-inline-block dash-tab-font">Data From Client</span> <span class="d-none d-sm-inline-block ">Data From Client</span>
</a> </a>
</li> </li>
<li class="nav-item d-flex justify-content-center align-items-center"> <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"> <a href="#KYC-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="kyc_tab">
<span class="mr-1"><i class="mdi mdi-file"></i></span> <span class="mr-1"><i class="mdi mdi-file"></i></span>
<span class="d-none d-sm-inline-block dash-tab-font">Insurer or TPA Data</span> <span class="d-none d-sm-inline-block ">Insurer or TPA Data</span>
</a> </a>
</li> </li>
<li class="nav-item d-flex justify-content-center align-items-center"> <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"> <a href="#HR-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="hr_tab">
<span class="mr-1"><i class="mdi mdi-file"></i></span> <span class="mr-1"><i class="mdi mdi-file"></i></span>
<span class="d-none d-sm-inline-block dash-tab-font">HR Uploaded Files</span> <span class="d-none d-sm-inline-block ">HR Uploaded Files</span>
</a> </a>
</li> </li>
<li class="nav-item d-flex justify-content-center align-items-center">
<!-- Right Arrow -->
<button class="scroll-btn right-btn" type="button">&#9654;</button>
</li>
</ul> </ul>
</div>
<div class="tab-content"> <div class="tab-content">
<?php include('employee_upload.php'); ?> <?php include('employee_upload.php'); ?>
<?php include('insurer_or_tpa_data.php'); ?> <?php include('insurer_or_tpa_data.php'); ?>

View File

@ -80,19 +80,19 @@
<thead class=""> <thead class="">
<tr> <tr>
<th>S.NO</th> <th>S.NO&nbsp;</th>
<th>Policy Type</th> <th>Policy Type&nbsp;</th>
<th>Event Type</th> <th>Event Type&nbsp;</th>
<th>Upload/Download</th> <th>Upload/Download&nbsp;</th>
<th>Template</th> <th>Template&nbsp;</th>
<th>Action</th> <th>Action&nbsp;</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php if(isset($insurer_templete_list)){ ?> <?php if(isset($insurer_templete_list)){ ?>
<?php foreach($insurer_templete_list as $key => $value ){ ?> <?php foreach($insurer_templete_list as $key => $value ){ ?>
<tr> <tr>
<td><?= $key+1; ?></td> <td class="text-center"><?= $key+1; ?></td>
<td><?= $value['policy_type']; ?></td> <td><?= $value['policy_type']; ?></td>
<td><?= $events[$value['event_name']]; ?></td> <td><?= $events[$value['event_name']]; ?></td>
<td><?= $value['type_name'] == 'import' ? 'Upload' : 'Download'; ?></td> <td><?= $value['type_name'] == 'import' ? 'Upload' : 'Download'; ?></td>

View File

@ -1,5 +1,4 @@
<style> <style>
.custom-dropdown-menu { .custom-dropdown-menu {
display: none; display: none;
position: absolute; position: absolute;
@ -38,17 +37,18 @@
color: white; color: white;
border: 1px solid rgba(41, 139, 142, 1); border: 1px solid rgba(41, 139, 142, 1);
} }
</style> </style>
<div class="container-fluid-min">
<div class="row" id="insurer_list"> <div class="row" id="insurer_list">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body maincard"> <div class="card-body maincard">
<div class="row" style="margin-bottom:1rem;"> <!-- <div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Insurers</h4> <h4 style="position: relative;">Insurers</h4>
</div> </div>
</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" <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"> id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
@ -60,7 +60,8 @@
</thead> </thead>
<tbody> <tbody>
<?php if(is_array($insurerList)) {foreach($insurerList as $row){ ?> <?php if (is_array($insurerList)) {
foreach ($insurerList as $row) { ?>
<tr> <tr>
<td><?php echo $row['name']; ?> ( <?php echo $row['short_name']; ?> ) </td> <td><?php echo $row['name']; ?> ( <?php echo $row['short_name']; ?> ) </td>
<td><?php echo $row['type']; ?></td> <td><?php echo $row['type']; ?></td>
@ -74,7 +75,8 @@
</div> </div>
</td> </td>
</tr> </tr>
<?php }}?> <?php }
} ?>
</tbody> </tbody>
</table> </table>
@ -82,10 +84,11 @@
</div> </div>
</div><!-- end col --> </div><!-- end col -->
</div> </div>
</div>
<!-- end row --> <!-- end row -->
<script> <script>
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
const table = document.getElementById("tickets-table"); const table = document.getElementById("tickets-table");
@ -173,39 +176,47 @@ document.addEventListener("DOMContentLoaded", function () {
} }
}); });
}); });
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('#tickets-table').DataTable({ $('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" + dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" +
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [
{
text: '<i class="mdi mdi-plus" ></i><span class=" btn-custom"> Add </span>',
className: 'btn app-btn-primary mr-2',
action: function() {
window.location.href = "<?= base_url("master/insurer/create"); ?>";
}
},
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [ buttons: [
{ {
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'InsurerList', title: 'InsurerList',
exportOptions: { exportOptions: {
columns: ':not(:last-child)' columns: ':not(:last-child)'
} }
},
{
text: 'ADD',
className: 'btn btn-color',
action: function () {
window.location.href = "<?= base_url("master/insurer/create"); ?>";
} }
]
} }
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, paging: true,
}); });
@ -218,7 +229,9 @@ const tableElement = document.querySelector("#tickets-table");
btnExport.addEventListener("click", () => { btnExport.addEventListener("click", () => {
const obj = new csvExport(tableElement); const obj = new csvExport(tableElement);
const csvData = obj.exportCsv(); const csvData = obj.exportCsv();
const blob = new Blob([csvData], { type: "text/csv" }); const blob = new Blob([csvData], {
type: "text/csv"
});
const url = URL.createObjectURL(blob); const url = URL.createObjectURL(blob);
const a = document.createElement("a"); const a = document.createElement("a");
a.href = url; a.href = url;
@ -315,6 +328,4 @@ class csvExport {
}); });
} }
</script> </script>

View File

@ -20,7 +20,12 @@
<span class="title-text ">Insurer</span> <span class="title-text ">Insurer</span>
</h4> </h4>
</div> </div>
<ul class="nav nav-pills navtab-bg">
<div class="tab-wrapper position-relative">
<ul class="nav nav-pills navtab-bg" id="myTab">
<li class="nav-item d-flex justify-content-center align-items-center">
<button class="scroll-btn left-btn" type="button">&#9664;</button>
</li>
<li class="nav-item"> <li class="nav-item">
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false" <a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
class="nav-link px-3 py-2 active-tab active"> class="nav-link px-3 py-2 active-tab active">
@ -46,8 +51,13 @@
<?php } ?> <?php } ?>
<li class="nav-item d-flex justify-content-center align-items-center">
<!-- Right Arrow -->
<button class="scroll-btn right-btn" type="button">&#9654;</button>
</li>
</ul> </ul>
</div>
<div class="tab-content"> <div class="tab-content">
<?php include('insurer_basic_info.php'); ?> <?php include('insurer_basic_info.php'); ?>
<?php include('insurer_branch.php'); ?> <?php include('insurer_branch.php'); ?>
@ -60,13 +70,14 @@
<script> <script>
function insurer_branch_contact() { function insurer_branch_contact() {
var check_insurer_id = $('#insurer_General_PrimaryKey'); var check_insurer_id = $('#insurer_General_PrimaryKey');
if (check_insurer_id[0].value == '' || check_insurer_id[0].value == null || check_insurer_id[0].value == 0) { if (check_insurer_id[0].value == '' || check_insurer_id[0].value == null || check_insurer_id[0].value == 0) {
$('#btnBranchAdd').hide(); $('#btnBranchAdd').hide();
toastr.warning('First Add the Insurer!', 'warning',{timeOut: 2000}); toastr.warning('First Add the Insurer!', 'warning', {
timeOut: 2000
});
} else { } else {
// if ($('#btnBranchBack')[0].style.display == 'none') { // if ($('#btnBranchBack')[0].style.display == 'none') {
$('#btnBranchAdd').show(); $('#btnBranchAdd').show();
@ -80,5 +91,3 @@
insurer_branch_contact(); insurer_branch_contact();
}); });
</script> </script>

View File

@ -10,11 +10,21 @@
<div class="col-xl-12"> <div class="col-xl-12">
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h5 class="m-1">
<h4 class="m-1">
<span>Filters</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true"> <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> <i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h5> </h4>
<!-- <label id="filterAccordion" class="m-1 d-flex justify-content-between align-items-center">
<span class="font-color-black">Filters</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>
</label> -->
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body">
<!-- <div class="text-center"> --> <!-- <div class="text-center"> -->

View File

@ -12,10 +12,7 @@ table.dataTable tbody td {
padding: 4px 4px !important; padding: 4px 4px !important;
} */ } */
.col-12 {
max-width: 98% !important;
}
.dataTables_filter { .dataTables_filter {
position: absolute; position: absolute;
@ -27,7 +24,8 @@ table.dataTable tbody td {
} }
.column-header { .column-header {
margin-right: 10px; /* Adjust this value as needed */ margin-right: 10px;
/* Adjust this value as needed */
} }
.form-section { .form-section {
@ -135,14 +133,46 @@ table.dataTable tbody td {
cursor: pointer !important; cursor: pointer !important;
} }
</style> </style>
<style>
.payment-card {
width: 100%;
background: #F7F7F7;
box-shadow: 0px 2px 2px 0px #00000040;
border-radius: 6px;
padding: 15px;
margin-bottom: 15px;
}
.payment-card .row {
align-items: flex-end;
}
.payment-card label {
font-size: 13px;
font-weight: 500;
margin-bottom: 4px;
display: block;
}
.payment-card .form-control {
border-radius: 6px;
height: 35px;
font-size: 14px;
}
.payment-card .btn {
margin-left: 5px;
border-radius: 6px;
}
</style>
<div class="container-fluid-min">
<div class="row" id="inception_list"> <div class="row" id="inception_list">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="margin-bottom:1rem;"> <div class="row" style="margin-bottom:1rem;">
<div class="col-9" style="align-self: center;"> <div class="col-8" style="align-self: center;">
<h4 style="position: relative;">Insurer Statement List</h4> <h4 style="position: relative;">Insurer Statements</h4>
<!-- <div id="statusSwitchWrapper" class="dt-switch-wrapper"> <!-- <div id="statusSwitchWrapper" class="dt-switch-wrapper">
<div class="custom-control custom-switch"> <div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="statusSwitch"> <input type="checkbox" class="custom-control-input" id="statusSwitch">
@ -157,9 +187,9 @@ table.dataTable tbody td {
</div> </div>
</div> --> </div> -->
<div class="col-3" style="text-align: right;"> <div class="col-4" style="text-align: right;">
<div class="row align-items-center"> <div class="row align-items-center">
<div class="col-8"> <div class="offset-3 col-5">
<div id="statusSwitchWrapper" class="dt-switch-wrapper"> <div id="statusSwitchWrapper" class="dt-switch-wrapper">
<div class="custom-control custom-switch" style="text-align: left;"> <div class="custom-control custom-switch" style="text-align: left;">
<input type="checkbox" class="custom-control-input" id="statusSwitch"> <input type="checkbox" class="custom-control-input" id="statusSwitch">
@ -168,26 +198,45 @@ table.dataTable tbody td {
</div> </div>
</div> </div>
<div class="col-4"> <div class="col-4">
<button type="button" id="btnAdd" onclick="showFileUploadModal()" class="btn btn-primary waves-effect waves-light">Upload</button> <button type="button" id="btnAdd" onclick="showFileUploadModal()" class="btn btn-primary waves-effect waves-light">Upload <i class="mdi mdi-upload"></i></button>
</div> </div>
</div> </div>
</div> </div>
</div><div class="dataTables_length d-flex align-items-center"> </div>
<div class="dataTables_length d-flex align-items-center">
</div> </div>
<div> <div>
<table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table"> <table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th></th> <th></th>
<th><div class="column-header">Insurer</div></th> <th>
<th><div class="column-header">Month</div></th> <div class="column-header">Insurer</div>
<th><div class="column-header">Statement<br>sno</div></th> </th>
<th><div class="column-header">Filename</div></th> <th>
<th><div class="column-header">Line<br>items</div></th> <div class="column-header">Month</div>
<th><div class="column-header">File<br>status</div></th> </th>
<th><div class="column-header">Invoice<br>status</div></th> <th>
<th><div class="column-header">User/Time</div></th> <div class="column-header">Statement<br>sno</div>
<th><div class="column-header">Action</div></th> </th>
<th>
<div class="column-header">Filename</div>
</th>
<th>
<div class="column-header">Line<br>items</div>
</th>
<th>
<div class="column-header">File<br>status</div>
</th>
<th>
<div class="column-header">Invoice<br>status</div>
</th>
<th>
<div class="column-header">User/Time</div>
</th>
<th>
<div class="column-header">Action</div>
</th>
</tr> </tr>
</thead> </thead>
@ -201,8 +250,7 @@ table.dataTable tbody td {
<td><?php echo $row['file_name'] ?> </td> <td><?php echo $row['file_name'] ?> </td>
<td><?php echo $row['line_items'] ?></td> <td><?php echo $row['line_items'] ?></td>
<td><?php echo $row['file_status']; <td><?php echo $row['file_status'];
if($row['file_status'] == 'failed') if ($row['file_status'] == 'failed') {
{
echo " <span class='col-xl-3 col-lg-4 col-sm-6'> <i class='fe-alert-circle' data-toggle='modal' data-target='#file-err-modal' data-err=" . $row['id'] . "></i></span>"; echo " <span class='col-xl-3 col-lg-4 col-sm-6'> <i class='fe-alert-circle' data-toggle='modal' data-target='#file-err-modal' data-err=" . $row['id'] . "></i></span>";
} }
?> ?>
@ -221,7 +269,7 @@ table.dataTable tbody td {
</span> </span>
</td> </td>
<td><?php echo change_date_format($row['created_at'],'Y-m-d H:i:s','d M Y h:i a').' by <br>'.$row['first_name'] ?></td> <td><?php echo change_date_format($row['created_at'], 'Y-m-d H:i:s', 'd M Y h:i a') . ' <br> by ' . $row['first_name'] ?></td>
<td> <td>
<?php if ($row['file_status'] != 'failed') { ?> <?php if ($row['file_status'] != 'failed') { ?>
<div class="btn-group dropdown"> <div class="btn-group dropdown">
@ -247,6 +295,8 @@ table.dataTable tbody td {
</div> </div>
</div><!-- end col --> </div><!-- end col -->
</div> </div>
</div>
<!-- end table row --> <!-- end table row -->
<div class="modal fade" id="file_upload" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal fade" id="file_upload" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
@ -263,8 +313,13 @@ table.dataTable tbody td {
<form role="form" class="parsley-examples" method="post" id="insurer_statement_upload_form" enctype="multipart/form-data" action="upload"> <form role="form" class="parsley-examples" method="post" id="insurer_statement_upload_form" enctype="multipart/form-data" action="upload">
<div class="form-group"> <div class="form-group">
<div class="row">
<div class="form-group col-md-10"> <div class="form-group float-right-end offset-8 col-4">
<span><a href="downloadSampleInsurerStatement" id="download_sample_file" style="font-size: small; color:red !important;">Download sample file</a></span>
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label for="insurer"> Insurer <spanclass="text-danger">*</spanclass=></label> <label for="insurer"> Insurer <spanclass="text-danger">*</spanclass=></label>
<select class="form-control" id="insurer" name="insurer" required> <select class="form-control" id="insurer" name="insurer" required>
<option value="" selected>Select Insurer</option> <option value="" selected>Select Insurer</option>
@ -277,12 +332,13 @@ table.dataTable tbody td {
?> ?>
</select> </select>
</div> </div>
<div class="form-group col-md-10"> <div class="form-group col-md-6">
<label for="statement_month">Statement month</label> <label for="statement_month">Statement month</label>
<input type="text" class="form-control" id="statement_month" name="statement_month" placeholder="" required readonly onchange="getStatementNo()"> <input type="text" class="form-control" id="statement_month" name="statement_month" placeholder="" required readonly onchange="getStatementNo()">
</div> </div>
</div>
<div class="form-group col-md-10"> <div class="row">
<div class="form-group col-md-6">
<label for="statement_no">Statement no</label> <label for="statement_no">Statement no</label>
<select class="form-control" id="statement_no" name="statement_no" required> <select class="form-control" id="statement_no" name="statement_no" required>
<option value="" selected>Select statement no</option> <option value="" selected>Select statement no</option>
@ -296,17 +352,20 @@ table.dataTable tbody td {
?> ?>
</select> </select>
</div> </div>
<div class="form-group col-md-6">
<div class="form-group col-md-10" > <label for="statment">Statement </label>
<label for="statment">Statement </label> <span><a href="downloadSampleInsurerStatement" id="download_sample_file" style="font-size: small;">Download sample file</a></span> <div class="input-icon">
<input type="file" class="form-control" name="statement" required accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet"> <input type="file" class="form-control" name="statement" required accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet">
<i class="mdi mdi-upload additional-icon"></i>
</div>
</div>
</div> </div>
</div> </div>
<div class="form-group text-right m-b-0"> <div class="form-group text-right m-b-0">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" <button type="button" class="btn app-btn-outline-secondary mr-2" data-dismiss="modal" aria-hidden="true">Cancel</button>
id="btnSubmit">Submit</button> <button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
</div> </div>
</form> </form>
</div> </div>
@ -365,6 +424,7 @@ table.dataTable tbody td {
</div> --> </div> -->
</div> </div>
<hr>
<!-- Invoice Number and Invoice Date in same row --> <!-- Invoice Number and Invoice Date in same row -->
<!-- <div id="invoice_no_div_modal" style="display: none;"> --> <!-- <div id="invoice_no_div_modal" style="display: none;"> -->
@ -422,10 +482,7 @@ table.dataTable tbody td {
<!-- Payment Received Table --> <!-- Payment Received Table -->
<div class="form-group col-md-12" style="display: none;" id="payment_table_div_modal" style="max-width: 800px;"> <div class="form-group col-md-12" style="display: none;" id="payment_table_div_modal" style="max-width: 800px;">
<button type="button" id="add_row_btn" class="btn btn-secondary float-right"><i class="fa fa-plus"></i></button> <!-- <table data-custom-table-css="table" class="table table-bordered" id="payment_table_modal">
<table data-custom-table-css="table" class="table table-bordered" id="payment_table_modal">
<thead> <thead>
<tr> <tr>
<th style="display: none;">pk</th> <th style="display: none;">pk</th>
@ -448,14 +505,51 @@ table.dataTable tbody td {
<td><i class="mdi mdi-delete mr-2 font-18 vertical-middle text-danger remove-row" style="text-align: center;"></i></td> <td><i class="mdi mdi-delete mr-2 font-18 vertical-middle text-danger remove-row" style="text-align: center;"></i></td>
</tr> </tr>
</tbody> </tbody>
</table> </table> -->
<!-- <button type="button" id="add_row_btn" class="btn btn-secondary float-right mt-2"><i class="fa fa-plus"></i></button> --> <!-- <button type="button" id="add_row_btn" class="btn btn-secondary float-right mt-2"><i class="fa fa-plus"></i></button> -->
<div class="payment-card">
<input type="hidden" class="form-control" name="pk[]" placeholder="Enter Amount">
<div class="row">
<div class="col">
<label>Invoice value</label>
<input type="number" class="form-control" name="received_amount[]" placeholder="Enter Amount" required step="0.01" onchange="checkInvAmont(event)">
</div>
<div class="col">
<label>GST</label>
<input type="number" class="form-control" name="gst_amount[]" placeholder="Enter GST" required step="0.01" onchange="checkInvAmont(event)">
</div>
<div class="col">
<label>TDS</label>
<input type="number" class="form-control" name="tds[]" placeholder="Enter TDS" onchange="checkInvAmont(event)" required>
</div>
<div class="col">
<label>UTR Number</label>
<input type="text" class="form-control" name="utr_no[]" placeholder="Enter UTR No" required>
</div>
<div class="col">
<label>Date</label>
<input type="text" class="form-control payment_date" name="payment_date[]" value="<?php echo date('d/m/Y'); ?>" placeholder="dd/mm/yyyy" required readonly>
</div>
<div class="col-auto d-flex align-items-end">
<button type="button" class="btn btn-danger btn-sm remove-row">
<i class="mdi mdi-delete"></i>
</button>
</div>
</div>
</div>
<div id="payment_card_container"></div>
<div class="form-group text-right m-b-0">
<button type="button" id="add_row_btn" class=" ml-2 btn app-btn-primary"><i class="mdi mdi-plus"></i></button>
</div>
</div> </div>
<div class="form-group text-right m-b-0"> <div class="form-group text-right m-b-0">
<!-- <button type="button" id="add_row_btn" class="btn btn-primary waves-effect waves-light mr-1">Add payment</button> --> <!-- <button type="button" id="add_row_btn" class="btn btn-primary waves-effect waves-light mr-1">Add payment</button> -->
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Save</button> <button type="button" class="btn app-btn-outline-secondary mr-2" data-dismiss="modal" aria-hidden="true">Cancel</button>
<button type="submit" class="btn btn-primary waves-effect waves-light" id="btnSubmit">Save</button>
</div> </div>
</form> </form>
</div> </div>
@ -464,7 +558,6 @@ table.dataTable tbody td {
</div> </div>
</div> </div>
<script> <script>
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
const table = document.getElementById("tickets-table"); const table = document.getElementById("tickets-table");
@ -543,7 +636,6 @@ document.addEventListener("DOMContentLoaded", function () {
} }
}); });
}); });
</script> </script>
<script> <script>
@ -595,8 +687,7 @@ document.addEventListener("DOMContentLoaded", function () {
switchRequired('gst_amount', true, 'name'); switchRequired('gst_amount', true, 'name');
switchRequired('payment_date', true, 'name'); switchRequired('payment_date', true, 'name');
switchRequired('pk', true, 'name'); switchRequired('pk', true, 'name');
}else if(invoiceStatus === 'pending') } else if (invoiceStatus === 'pending') {
{
invoiceNoDiv.style.display = 'none'; invoiceNoDiv.style.display = 'none';
invoiceNoDiv2.style.display = 'none'; invoiceNoDiv2.style.display = 'none';
paymentTableDiv.style.display = 'none'; paymentTableDiv.style.display = 'none';
@ -640,23 +731,20 @@ document.addEventListener("DOMContentLoaded", function () {
e.preventDefault(); // Prevent default form submission e.preventDefault(); // Prevent default form submission
var res = checkInvAmont(); var res = checkInvAmont();
if(!res) if (!res) {
{
return false; return false;
} }
var form = document.getElementById('invoiceForm'); var form = document.getElementById('invoiceForm');
// alert(form.checkValidity()); // alert(form.checkValidity());
// alert($('#invoice_date_modal').val()); // alert($('#invoice_date_modal').val());
if((!form.checkValidity())) if ((!form.checkValidity())) {
{
console.log('error2'); console.log('error2');
console.log(form.checkValidity()); console.log(form.checkValidity());
return false; return false;
} }
if($('#invoice_date_modal').val().trim() === '' && $('#invoice_status').val() != 'pending') if ($('#invoice_date_modal').val().trim() === '' && $('#invoice_status').val() != 'pending') {
{
// console.log('error1'); // console.log('error1');
return false; return false;
} }
@ -717,48 +805,125 @@ document.addEventListener("DOMContentLoaded", function () {
// Add/Delete rows in the payment table // Add/Delete rows in the payment table
document.getElementById('add_row_btn').addEventListener('click', function () { // document.getElementById('add_row_btn').addEventListener('click', function () {
const tableBody = document.querySelector('#payment_table_modal tbody'); // const tableBody = document.querySelector('#payment_table_modal tbody');
const newRow = document.createElement('tr'); // const newRow = document.createElement('tr');
newRow.innerHTML = ` // newRow.innerHTML = `
<td style="display: none;"><input type="hidden" class="form-control" name="pk[]" placeholder="Enter Amount"></td> // <td style="display: none;"><input type="hidden" class="form-control" name="pk[]" placeholder="Enter Amount"></td>
<td><input type="number" class="form-control" name="received_amount[]" placeholder="Enter Amount" onchange="checkInvAmont(event)" required step="0.01"></td> // <td><input type="number" class="form-control" name="received_amount[]" placeholder="Enter Amount" onchange="checkInvAmont(event)" required step="0.01"></td>
<td><input type="number" class="form-control" name="gst_amount[]" placeholder="Enter GST" onchange="checkInvAmont(event)" required step="0.01"></td> // <td><input type="number" class="form-control" name="gst_amount[]" placeholder="Enter GST" onchange="checkInvAmont(event)" required step="0.01"></td>
<td><input type="number" class="form-control" name="tds[]" placeholder="Enter TDS" onchange="checkInvAmont(event)" required></td> // <td><input type="number" class="form-control" name="tds[]" placeholder="Enter TDS" onchange="checkInvAmont(event)" required></td>
<td><input type="text" class="form-control" name="utr_no[]" placeholder="Enter UTR No" required></td> // <td><input type="text" class="form-control" name="utr_no[]" placeholder="Enter UTR No" required></td>
<td><input type="text" class="form-control payment_date" value="<?php echo date('d/m/Y'); ?>" name="payment_date[]" placeholder="dd/mm/yyyy" required readonly></td> // <td><input type="text" class="form-control payment_date" value="<?php echo date('d/m/Y'); ?>" name="payment_date[]" placeholder="dd/mm/yyyy" required readonly></td>
<td><i class="mdi mdi-delete mr-2 font-18 vertical-middle text-danger remove-row" style="text-align: center;"></i></td> // <td><i class="mdi mdi-delete mr-2 font-18 vertical-middle text-danger remove-row" style="text-align: center;"></i></td>
// `;
// tableBody.appendChild(newRow);
// $('.payment_date').datepicker({
// format: 'dd/mm/yyyy',
// autoclose: true
// });
// });
// Remove row
// document.getElementById('payment_table_modal').addEventListener('click', function (e) {
// if (e.target && e.target.classList.contains('remove-row')) {
// if (confirm("Do you want to delete this entry?")) {
// var row = e.target.closest('tr');
// var pk = row.querySelector('input[name="pk[]"]').value;
// if (pk === "") {
// // If pk is empty, remove the row
// row.remove();
// } else {
// // If pk is non-empty, send AJAX request to remove it from the backend
// $.ajax({
// url: 'deletePaymentEntry/'+pk, // Your backend URL here
// type: 'GET',
// // data: { pk: pk }, // Send the pk value to delete on server-side
// success: function (response) {
// // On success, remove the row
// console.log(response);
// if (response.dataStatus) {
// row.remove();
// alert('Payment deleted successfully.');
// } else {
// alert('Failed to delete the entry.');
// }
// },
// error: function () {
// alert('Error occurred while deleting the entry.');
// }
// });
// }
// }
// }
// });
document.getElementById('add_row_btn').addEventListener('click', function() {
const container = document.getElementById('payment_card_container'); // wrapper div for cards
const newCard = document.createElement('div');
newCard.classList.add('payment-card');
newCard.innerHTML = `
<input type="hidden" class="form-control" name="pk[]" placeholder="Enter Amount">
<div class="row">
<div class="col">
<label>Invoice value</label>
<input type="number" class="form-control" name="received_amount[]" placeholder="Enter Amount" onchange="checkInvAmont(event)" required step="0.01">
</div>
<div class="col">
<label>GST</label>
<input type="number" class="form-control" name="gst_amount[]" placeholder="Enter GST" onchange="checkInvAmont(event)" required step="0.01">
</div>
<div class="col">
<label>TDS</label>
<input type="number" class="form-control" name="tds[]" placeholder="Enter TDS" onchange="checkInvAmont(event)" required>
</div>
<div class="col">
<label>UTR Number</label>
<input type="text" class="form-control" name="utr_no[]" placeholder="Enter UTR No" required>
</div>
<div class="col">
<label>Date</label>
<input type="text" class="form-control payment_date" value="<?php echo date('d/m/Y'); ?>" name="payment_date[]" placeholder="dd/mm/yyyy" required readonly>
</div>
<div class="col-auto d-flex align-items-end">
<button type="button" class="btn btn-danger btn-sm remove-row" style="text-align: center;">
<i class="mdi mdi-delete"></i>
</button>
</div>
</div>
`; `;
tableBody.appendChild(newRow); container.appendChild(newCard);
// Reinit datepicker
$('.payment_date').datepicker({ $('.payment_date').datepicker({
format: 'dd/mm/yyyy', format: 'dd/mm/yyyy',
autoclose: true autoclose: true
}); });
}); });
// Remove row // Remove row (card)
document.getElementById('payment_table_modal').addEventListener('click', function (e) { document.getElementById('payment_card_container').addEventListener('click', function(e) {
if (e.target && e.target.classList.contains('remove-row')) { if (e.target.closest('.remove-row')) {
const card = e.target.closest('.payment-card');
if (confirm("Do you want to delete this entry?")) { if (confirm("Do you want to delete this entry?")) {
var row = e.target.closest('tr'); const pk = card.querySelector('input[name="pk[]"]').value;
var pk = row.querySelector('input[name="pk[]"]').value;
if (pk === "") { if (pk === "") {
// If pk is empty, remove the row // frontend only remove
row.remove(); card.remove();
} else { } else {
// If pk is non-empty, send AJAX request to remove it from the backend // AJAX delete request
$.ajax({ $.ajax({
url: 'deletePaymentEntry/'+pk, // Your backend URL here url: 'deletePaymentEntry/' + pk,
type: 'GET', type: 'GET',
// data: { pk: pk }, // Send the pk value to delete on server-side
success: function(response) { success: function(response) {
// On success, remove the row
console.log(response);
if (response.dataStatus) { if (response.dataStatus) {
row.remove(); card.remove();
alert('Payment deleted successfully.'); alert('Payment deleted successfully.');
} else { } else {
alert('Failed to delete the entry.'); alert('Failed to delete the entry.');
@ -772,16 +937,10 @@ document.addEventListener("DOMContentLoaded", function () {
} }
} }
}); });
</script> </script>
<script> <script>
function showFileUploadModal(input) {
function showFileUploadModal(input)
{
var myModal = new bootstrap.Modal(document.getElementById('file_upload')); var myModal = new bootstrap.Modal(document.getElementById('file_upload'));
myModal.show(); myModal.show();
// $(input).val(''); // $(input).val('');
@ -793,13 +952,14 @@ function formatDate(date) {
var year = date.getFullYear(); var year = date.getFullYear();
return day + "/" + month + "/" + year; return day + "/" + month + "/" + year;
} }
function formatDateToDMY(dateStr) { function formatDateToDMY(dateStr) {
// Split the date string by the hyphen // Split the date string by the hyphen
var parts = dateStr.split('-'); var parts = dateStr.split('-');
return parts[2] + '/' + parts[1] + '/' + parts[0]; // Rearrange to DD-MM-YYYY return parts[2] + '/' + parts[1] + '/' + parts[0]; // Rearrange to DD-MM-YYYY
} }
function showInvoiceStatusModal(event)
{ function showInvoiceStatusModal(event) {
console.log('############ showInvoiceStatusModal function called ##################'); console.log('############ showInvoiceStatusModal function called ##################');
var modal_received_amt_div = document.getElementById('modal_received_amt_div'); var modal_received_amt_div = document.getElementById('modal_received_amt_div');
modal_received_amt_div.style.display = 'none'; modal_received_amt_div.style.display = 'none';
@ -828,8 +988,7 @@ function showInvoiceStatusModal(event)
// Assuming response contains the necessary data // Assuming response contains the necessary data
if (response.dataStatus === true && response.code === 200) { if (response.dataStatus === true && response.code === 200) {
// Populate modal fields // Populate modal fields
if(response.data.invoice_status !== null) if (response.data.invoice_status !== null) {
{
var inv_status_element = document.getElementById('invoice_status'); var inv_status_element = document.getElementById('invoice_status');
inv_status_element.value = response.data.invoice_status; inv_status_element.value = response.data.invoice_status;
var event = new Event('change'); var event = new Event('change');
@ -844,8 +1003,7 @@ function showInvoiceStatusModal(event)
document.getElementById('gst_per_modal').value = response.data.gst_per; document.getElementById('gst_per_modal').value = response.data.gst_per;
document.getElementById('gst_value_modal').value = response.data.gst_value; document.getElementById('gst_value_modal').value = response.data.gst_value;
console.log('response.data.gst_value - ' + response.data.gst_value); console.log('response.data.gst_value - ' + response.data.gst_value);
if(response.data.gst_value == 0 || response.data.gst_value == '' || response.data.gst_value == null) if (response.data.gst_value == 0 || response.data.gst_value == '' || response.data.gst_value == null) {
{
calcGSTValue(); calcGSTValue();
} }
@ -859,8 +1017,7 @@ function showInvoiceStatusModal(event)
console.log('response.data.payments.length', response.data.payments.length) console.log('response.data.payments.length', response.data.payments.length)
// Populate payment table rows // Populate payment table rows
if(response.data.payments.length) if (response.data.payments.length) {
{
paymentTableBody.innerHTML = ''; paymentTableBody.innerHTML = '';
response.data.payments.forEach(function(payment) { response.data.payments.forEach(function(payment) {
var row = paymentTableBody.insertRow(); var row = paymentTableBody.insertRow();
@ -875,7 +1032,10 @@ function showInvoiceStatusModal(event)
`; `;
}); });
} }
$('.payment_date').datepicker({ format: 'dd/mm/yyyy',autoclose: true}); $('.payment_date').datepicker({
format: 'dd/mm/yyyy',
autoclose: true
});
// Show the modal // Show the modal
var myModal = new bootstrap.Modal(document.getElementById('invoice_modal')); var myModal = new bootstrap.Modal(document.getElementById('invoice_modal'));
myModal.show(); myModal.show();
@ -1083,8 +1243,7 @@ function checkInvAmont(event = null) {
// Check if the total exceeds the expected amount // Check if the total exceeds the expected amount
if (exp_amt < total) { if (exp_amt < total) {
alert('Exceeds Invoice amount...Plz adjust numbers'); alert('Exceeds Invoice amount...Plz adjust numbers');
if(event != null) if (event != null) {
{
event.target.value = ''; event.target.value = '';
} }
@ -1105,8 +1264,7 @@ function switchRequired(elementId, isRequired, type = 'id') {
} else { } else {
element.removeAttribute('required'); element.removeAttribute('required');
} }
} } else //name attribute
else //name attribute
{ {
var name_attribute = elementId + '[]'; var name_attribute = elementId + '[]';
// Select all elements with the name 'invoice_amt[]' // Select all elements with the name 'invoice_amt[]'
@ -1123,14 +1281,12 @@ function switchRequired(elementId, isRequired, type = 'id') {
} }
} }
function getStatementNo() function getStatementNo() {
{
var insurer_id = $('#insurer').val(); var insurer_id = $('#insurer').val();
var statement_month = $('#statement_month').val(); var statement_month = $('#statement_month').val();
console.log(insurer_id + ' / ' + statement_month); console.log(insurer_id + ' / ' + statement_month);
if(insurer_id == "") if (insurer_id == "") {
{
alert('Choose insurer...!'); alert('Choose insurer...!');
$('#statement_month').val(''); $('#statement_month').val('');
} }
@ -1192,14 +1348,12 @@ function getStatementNo()
} }
function calcGSTValue() function calcGSTValue() {
{
// alert('calcGSTValue'); // alert('calcGSTValue');
console.log('calcGSTValue called'); console.log('calcGSTValue called');
var inv_status_element = document.getElementById('invoice_status'); var inv_status_element = document.getElementById('invoice_status');
if(inv_status_element.value == 'generated' || inv_status_element.value == 'send' || inv_status_element.value == 'payment_received') if (inv_status_element.value == 'generated' || inv_status_element.value == 'send' || inv_status_element.value == 'payment_received') {
{
var gst_per = document.getElementById('gst_per_modal').value; var gst_per = document.getElementById('gst_per_modal').value;
console.log('gst_per - ' + gst_per); console.log('gst_per - ' + gst_per);
@ -1218,8 +1372,7 @@ function calcGSTValue()
gst_value_dom_obj.value = Math.round((parseFloat(gst_per) / 100) * invoice_value); gst_value_dom_obj.value = Math.round((parseFloat(gst_per) / 100) * invoice_value);
// gst_value_dom_obj.value = ((parseFloat(gst_per) / 100 ) * invoice_value); // gst_value_dom_obj.value = ((parseFloat(gst_per) / 100 ) * invoice_value);
invoice_amount_dom_obj.value = parseFloat(invoice_value_dom_obj.value) + parseFloat(gst_value_dom_obj.value); invoice_amount_dom_obj.value = parseFloat(invoice_value_dom_obj.value) + parseFloat(gst_value_dom_obj.value);
if(inv_status_element.value == 'payment_received') if (inv_status_element.value == 'payment_received') {
{
checkInvAmont(); checkInvAmont();
} }
} }
@ -1227,8 +1380,7 @@ function calcGSTValue()
} }
function disableStatementNo(arr) function disableStatementNo(arr) {
{
// JavaScript array with values to disable // JavaScript array with values to disable
// const disableValues = arr; // const disableValues = arr;
const disableIds = arr.map(item => item.stmt_sno); const disableIds = arr.map(item => item.stmt_sno);
@ -1247,8 +1399,7 @@ function disableStatementNo(arr)
if (disableIds.includes((option.value))) { if (disableIds.includes((option.value))) {
option.disabled = true; option.disabled = true;
option.style.backgroundColor = "lightgray"; option.style.backgroundColor = "lightgray";
} } else if (!firstEnabledOptionSelected && option.value !== "") {
else if (!firstEnabledOptionSelected && option.value !== "") {
// Automatically select the first enabled option // Automatically select the first enabled option
option.selected = true; option.selected = true;
firstEnabledOptionSelected = true; firstEnabledOptionSelected = true;
@ -1256,8 +1407,7 @@ function disableStatementNo(arr)
}); });
} }
function deleteStatement(id) function deleteStatement(id) {
{
//alert(id); //alert(id);
Swal.fire({ Swal.fire({
title: "Do you want to delete statement & it's invoice data if any?", title: "Do you want to delete statement & it's invoice data if any?",
@ -1421,8 +1571,6 @@ function deleteStatement(id)
// stateSave: true, // Saves the table's state // stateSave: true, // Saves the table's state
// }); // });
// }); // });
</script> </script>
<script> <script>

View File

@ -1,22 +1,26 @@
<div class="row">
<div class="col-xl-12">
<div class="container-fluid-min">
<div class="col-xl-12" id="outstanding_filter">
<div class="card-body">
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h5 class="m-1"> <h4 class="m-1">
<span>Filter</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
aria-expanded="true"> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> <i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h5> </h4>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body">
<!-- <div class="text-center"> --> <!-- <div class="text-center"> -->
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4" id="date_div"> <div class="form-group col-md-4" id="date_div">
<label>Date<span class="text-danger"></span></label> <label>Date<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%"> <div class="input-icon">
<i class="mdi mdi-calendar-blank"></i>&nbsp; <input type="text" id="reportrange" class="form-control" readonly style="caret-color: transparent;">
<span></span> <i class="mdi mdi-menu-down"></i> <i class="mdi mdi-calendar-blank-outline additional-icon"></i>
</div> </div>
<input type="hidden" id="startDate" value=<?= $default_start ?>> <input type="hidden" id="startDate" value=<?= $default_start ?>>
<input type="hidden" id="endDate" value=<?= $default_end ?>> <input type="hidden" id="endDate" value=<?= $default_end ?>>
@ -58,11 +62,13 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="card mb-1">
</div>
<div id="report"></div> <div id="report"></div>
</div> </div>
<script> <script>
$(function() { $(function() {
@ -73,7 +79,7 @@
var end = moment(end, 'DD/MM/YYYY'); var end = moment(end, 'DD/MM/YYYY');
function cb(start, end) { function cb(start, end) {
$('#reportrange span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY')); $('#reportrange').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
$('#startDate').val(start.format('DD-MM-YYYY')); $('#startDate').val(start.format('DD-MM-YYYY'));
$('#endDate').val(end.format('DD-MM-YYYY')); $('#endDate').val(end.format('DD-MM-YYYY'));
} }
@ -81,6 +87,9 @@
$('#reportrange').daterangepicker({ $('#reportrange').daterangepicker({
startDate: start, startDate: start,
endDate: end, endDate: end,
locale: {
format: 'DD-MM-YYYY'
},
ranges: { ranges: {
'Today': [moment(), moment()], 'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],

View File

@ -205,24 +205,37 @@ $(document).ready(function() {
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [{ buttons: [
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [
{
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'IRDA-BAP-CLIENT-List', title: 'IRDA-BAP-CLIENT-List',
}, },
{ {
extend: 'excel', extend: 'excel',
text: 'Excel', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
title: 'IRDA-BAP-CLIENT-List', title: 'IRDA-BAP-CLIENT-List',
exportOptions: { exportOptions: {
orthogonal: 'sort' orthogonal: 'sort'
}, },
className: 'app-btn-primary ',
}
]
} }
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, // Enable pagination paging: true, // Enable pagination
pageLength: 20, // Set default number of rows per page (optional) pageLength: 20, // Set default number of rows per page (optional)

View File

@ -238,14 +238,75 @@ $(document).ready(function() {
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [{ // buttons: [{
// extend: 'csv',
// text: 'CSV',
// title: 'IRDA-BAP-INSURER-List',
// },
// {
// extend: 'excel',
// text: 'Excel',
// title: 'IRDA-BAP-INSURER-List',
// 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;
// }
// });
// // 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)
// if (j === 9) {
// data.body[i][j] = '\u200C' + data.body[i][j];
// }
// }
// }
// }
// }
// ],
buttons: [
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [
{
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'IRDA-BAP-INSURER-List', title: 'IRDA-BAP-INSURER-List',
}, },
{ {
extend: 'excel', extend: 'excel',
text: 'Excel', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
className: 'app-btn-primary ',
title: 'IRDA-BAP-INSURER-List', title: 'IRDA-BAP-INSURER-List',
customize: function(xlsx) { customize: function(xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml']; var sheet = xlsx.xl.worksheets['sheet1.xml'];
@ -289,11 +350,16 @@ $(document).ready(function() {
} }
} }
]
}
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, // Enable pagination paging: true, // Enable pagination
pageLength: 20, // Set default number of rows per page (optional) pageLength: 20, // Set default number of rows per page (optional)

View File

@ -78,15 +78,76 @@ $(document).ready(function() {
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [{ // buttons: [{
// extend: 'csv',
// text: 'CSV',
// title: 'IRDA-BAP-CLIENT-List',
// },
// {
// extend: 'excel',
// text: 'Excel',
// title: 'IRDA-BAP-CLIENT-List',
// 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;
// }
// });
// // 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)
// if (j === 9) {
// data.body[i][j] = '\u200C' + data.body[i][j];
// }
// }
// }
// }
// }
// ],
buttons: [
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [
{
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'IRDA-BAP-CLIENT-List', title: 'IRDA-BAP-CLIENT-List',
}, },
{ {
extend: 'excel', extend: 'excel',
text: 'Excel', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
title: 'IRDA-BAP-CLIENT-List', title: 'IRDA-BAP-CLIENT-List',
className: 'app-btn-primary ',
customize: function(xlsx) { customize: function(xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml']; var sheet = xlsx.xl.worksheets['sheet1.xml'];
var total = 0; var total = 0;
@ -129,11 +190,16 @@ $(document).ready(function() {
} }
} }
]
}
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, // Enable pagination paging: true, // Enable pagination
pageLength: 10, // Set default number of rows per page (optional) pageLength: 10, // Set default number of rows per page (optional)

View File

@ -44,11 +44,11 @@
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body maincard"> <div class="card-body maincard">
<div class="row" style="margin-bottom:1rem;"> <!-- <div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">KYC</h4> <h4 style="position: relative;">KYC</h4>
</div> </div>
</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" <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"> id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
@ -175,31 +175,44 @@
$(document).ready(function(){ $(document).ready(function(){
$('#tickets-table').DataTable({ $('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" +
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>" , "<'row'<'col-sm-5'i><'col-sm-7'p>>" ,
buttons: [
{
text: '<i class="mdi mdi-plus" ></i><span class=" btn-custom"> Add </span>',
className: 'btn app-btn-primary mr-2',
action: function(e, dt, node, config) {
window.location.href = "<?= base_url("master/kyc/create"); ?>";
}
},
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [ buttons: [
{ {
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'KYCList', title: 'KYCList',
exportOptions: { exportOptions: {
columns: ':not(:last-child)' columns: ':not(:last-child)'
} }
},
{
text: 'ADD',
className: 'btn btn-color',
action: function () {
window.location.href = "<?= base_url("master/kyc/create"); ?>";
} }
]
} }
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true , paging: true ,
}); });

View File

@ -1,8 +1,8 @@
<style> <style>
body { body {
.multiselect-native-select { .multiselect-native-select {
position: relative; position: relative;
/* bottom: 32px; */ /* bottom: 32px; */
select { select {
border: 0 !important; border: 0 !important;
@ -27,7 +27,6 @@ body {
} }
} }
</style> </style>
<div class="row" id="insurer_add"> <div class="row" id="insurer_add">
@ -50,7 +49,11 @@ body {
<a href="<?= base_url("master/kyc/list"); ?>" ><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i> </a> <a href="<?= base_url("master/kyc/list"); ?>" ><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i> </a>
</div> </div>
</div> --> </div> -->
<ul class="nav nav-pills navtab-bg"> <div class="tab-wrapper position-relative">
<ul class="nav nav-pills navtab-bg" id="myTab">
<li class="nav-item d-flex justify-content-center align-items-center">
<button class="scroll-btn left-btn" type="button">&#9664;</button>
</li>
<li class="nav-item"> <li class="nav-item">
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false" <a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
class="nav-link px-3 py-2 active-tab active"> class="nav-link px-3 py-2 active-tab active">
@ -64,7 +67,13 @@ body {
<span class="d-none d-sm-inline-block">KYC Docs</span> <span class="d-none d-sm-inline-block">KYC Docs</span>
</a> </a>
</li> </li>
<li class="nav-item d-flex justify-content-center align-items-center">
<!-- Right Arrow -->
<button class="scroll-btn right-btn" type="button">&#9654;</button>
</li>
</ul> </ul>
</div>
<div class="tab-content"> <div class="tab-content">
<?php include('kyc_entity_type_basic_info.php'); ?> <?php include('kyc_entity_type_basic_info.php'); ?>
<?php include('kyc_docs.php'); ?> <?php include('kyc_docs.php'); ?>
@ -83,7 +92,9 @@ body {
console.log(check_policy_type_id.val()); console.log(check_policy_type_id.val());
if (check_policy_type_id[0].value == '' || check_policy_type_id[0].value == null || check_policy_type_id[0].value == 0) { if (check_policy_type_id[0].value == '' || check_policy_type_id[0].value == null || check_policy_type_id[0].value == 0) {
$('#btnBranchAdd').hide(); $('#btnBranchAdd').hide();
toastr.warning('First Add the KYC Entity Type!', 'warning',{timeOut: 2000}); toastr.warning('First Add the KYC Entity Type!', 'warning', {
timeOut: 2000
});
} else { } else {
if ($('#btnBranchBack')[0].style.display == 'none') { if ($('#btnBranchBack')[0].style.display == 'none') {
$('#btnBranchAdd').show(); $('#btnBranchAdd').show();

View File

@ -4,11 +4,16 @@
<?php include(__DIR__ . '/../ticket_type_modal.php'); ?> <?php include(__DIR__ . '/../ticket_type_modal.php'); ?>
</div>
<!-- ============================================================== -->
<!-- End Page content -->
<!-- ============================================================== -->
<!-- Footer Start --> <!-- Footer Start -->
<div style="display: block;"> <div style="background-color: white !important;">
<footer class="footer"> <footer class="footer" style="background-color: white !important;">
<div class="container-fluid"> <div class="">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<script> <script>
@ -26,15 +31,8 @@
</div> </div>
</footer> </footer>
</div> </div>
<!-- end Footer --> <!-- end Footer -->
</div>
<!-- ============================================================== -->
<!-- End Page content -->
<!-- ============================================================== -->
</div> </div>
<!-- END wrapper --> <!-- END wrapper -->
@ -157,8 +155,43 @@
"closeButton": true, "closeButton": true,
}; };
</script> </script>
<script>
$(document).ready(function() {
var pageName = "<?= esc($page_name ?? '') ?>";
var titleHtml = (pageName && pageName !== "Dashboard") ?
`<h3 style="margin-right:5px !important;">${pageName}</h3>` :
" ";
if (pageName && pageName == "Dashboard") {
titleHtml = `<h6 style="margin-right:5px !important;">Welcome <?= esc(get_session_userdata()->first_name ?? 'NOT SET') ?></h6>
<h3>Dashboard</h3>`;
}
$(".top-navbar-title").html(titleHtml);
$('#collapseOne').on('show.bs.collapse', function() {
// When open
$('#icon').removeClass('mdi-chevron-down').addClass('mdi-chevron-up');
// $('#filterAccordion').removeAttr("style"); // remove bg/border when open
});
$('#collapseOne').on('hide.bs.collapse', function() {
// When closed
$('#icon').removeClass('mdi-chevron-up').addClass('mdi-chevron-down');
// $('#filterAccordion').css({
// "background-color": "#F5FFFF",
// "border": "2px solid #F5FFFF",
// "border-radius": "10px",
// "box-shadow": "0px 4px 4px 0px #00000040"
// });
});
});
</script>
<script> <script>
var pullNotificationCount = 0; var pullNotificationCount = 0;
var pendingActionCount = 0; var pendingActionCount = 0;
@ -332,8 +365,7 @@
// console.log(response[key].length) // console.log(response[key].length)
// console.log('type', typeof response[key].length) // console.log('type', typeof response[key].length)
// console.log('key', response[key]) // console.log('key', response[key])
if(response[key].length != 'undefined' && response[key].length != undefined) if (response[key].length != 'undefined' && response[key].length != undefined) {
{
pendingActionCount = pendingActionCount + response[key].length; pendingActionCount = pendingActionCount + response[key].length;
} }
} }
@ -826,9 +858,7 @@
<script> <script>
function formatDate(dateString) {
function formatDate(dateString)
{
// Parse the input date string // Parse the input date string
let date = new Date(dateString); let date = new Date(dateString);
@ -856,8 +886,7 @@
return formattedDate; return formattedDate;
} }
function printCurrentTime() function printCurrentTime() {
{
var now = new Date(); var now = new Date();
var hours = now.getHours().toString().padStart(2, '0'); var hours = now.getHours().toString().padStart(2, '0');
var minutes = now.getMinutes().toString().padStart(2, '0'); var minutes = now.getMinutes().toString().padStart(2, '0');
@ -867,11 +896,9 @@
return currentTime; return currentTime;
} }
</script> </script>
<script> <script>
function checkDuplicateTableFieldValue(tableName, fieldName, value, callback) { function checkDuplicateTableFieldValue(tableName, fieldName, value, callback) {
$.ajax({ $.ajax({
url: '<?= base_url('util/checkDuplicateTableFieldValue') ?>', // Adjust this to your endpoint in CodeIgniter url: '<?= base_url('util/checkDuplicateTableFieldValue') ?>', // Adjust this to your endpoint in CodeIgniter
@ -929,8 +956,6 @@ function confirmActionSweertAlert(message = "Are you sure?", confirmText = "Yes,
return result.isConfirmed; // Returns true if confirmed, false otherwise return result.isConfirmed; // Returns true if confirmed, false otherwise
}); });
} }
</script> </script>
<script> <script>
@ -978,20 +1003,29 @@ function confirmActionSweertAlert(message = "Are you sure?", confirmText = "Yes,
// slight delay ensures DOM/tab loads completely // slight delay ensures DOM/tab loads completely
setTimeout(restoreDashboardHistoryIfNeeded, 100); setTimeout(restoreDashboardHistoryIfNeeded, 100);
}); });
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('.img-inactive').on('click', function() { const activeItem = localStorage.getItem("activeLi");
if (activeItem) {
$('.li-seperate a').removeClass('img-active').addClass('img-inactive');
$('#' + activeItem).children('a').first().removeClass('img-inactive').addClass('img-active');
}
$('.img-c').addClass('img-inactive'); $('.li-seperate').on('click', function() {
$(this).removeClass('.img-inactive'); // reset all anchors
$(this).addClass('.img-active'); $('.li-seperate a').removeClass('img-active').addClass('img-inactive');
// only the immediate <a> inside this <li>
$(this).children('a').first().removeClass('img-inactive').addClass('img-active');
localStorage.setItem("activeLi", $(this).attr("id"));
}); });
}); });
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('.nav-link').click(function() { $('.nav-link').click(function() {
@ -1005,19 +1039,108 @@ $(document).ready(function(){
}); });
}); });
function openModal(modalId) { $(document).ready(function() {
var modalEl = document.getElementById(modalId); // find all nav anchors
let $nav = $("ul.nav.nav-pills.navtab-bg");
if (typeof bootstrap !== "undefined" && bootstrap.Modal) { // check if no anchor has active classes
// Bootstrap 5 if ($nav.find("a.active.active-tab").length === 0) {
var modal = bootstrap.Modal.getOrCreateInstance(modalEl); // add classes to the first anchor
modal.show(); $nav.find("li:first-child a").addClass("active active-tab");
} else if (typeof $ !== "undefined" && typeof $.fn.modal === "function") {
// Bootstrap 4 // also need to find the tab name and show only active image
$('#' + modalId).modal('show'); let tab_name = $nav.find("li:first-child a").attr('href').split('-')[0];
} else { tab_name = tab_name.replace('#', '');
console.error("No compatible Bootstrap modal found.");
switch (tab_name) {
case "leads":
$('.active_leads').show();
$('.inactive_leads').hide();
break;
case "bds":
$('.active_bds').show();
$('.inactive_bds').hide();
break;
case "claims":
$('.active_claims').show();
$('.inactive_claims').hide();
break;
case "pending":
$('.active_pending').show();
$('.inactive_pending').hide();
break;
default:
break;
} }
}
});
$(function(){
let $nav = $("#myTab");
$(".left-btn").on("click", function(){
$nav.stop().animate({ scrollLeft: $nav.scrollLeft() - 150 }, 200);
});
$(".right-btn").on("click", function(){
$nav.stop().animate({ scrollLeft: $nav.scrollLeft() + 150 }, 200);
});
});
// function openModal(modalId) {
// console.log('openModal called with ID:', modalId);
// var modalEl = document.getElementById(modalId);
// if (typeof bootstrap !== "undefined" && bootstrap.Modal && typeof bootstrap.Modal.getOrCreateInstance === "function") {
// // ✅ 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>
<script>
$(document).ready(function(){
$('.nav-link').click(function(){
// change bg color of tab
$('.nav-link').removeClass('active-tab');
$(this).addClass('active-tab');
});
});
</script>
<script>
function closeModalById(modalId) {
// Get the modal element
var modal = document.getElementById(modalId);
if (!modal) return; // Exit if no modal found
// Hide it by removing "show" or "in" classes and setting display:none
modal.style.display = 'none';
modal.classList.remove('in', 'show'); // 'in' for BS3, 'show' for BS4/5
modal.setAttribute('aria-hidden', 'true');
modal.removeAttribute('aria-modal'); // optional
modal.removeAttribute('role'); // optional
// Remove backdrop if present
var backdrop = document.querySelector('.modal-backdrop');
if (backdrop) backdrop.remove();
// Allow page scrolling again
document.body.classList.remove('modal-open');
} }
</script> </script>
@ -1026,4 +1149,3 @@ function openModal(modalId) {
</body> </body>
</html> </html>

View File

@ -4,7 +4,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title><?= isset($page_name) ? $page_name : 'NHance'; ?></title> <title><?= isset($tab_name) ? $tab_name : 'NHance'; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="" name="description" /> <meta content="" name="description" />
<meta content="NHANCE" name="NHANCE" /> <meta content="NHANCE" name="NHANCE" />
@ -129,31 +129,51 @@
} }
.container-fluid { .container-fluid {
padding: 0px 20px 0px 20px !important;
}
.container-fluid-top {
padding: 0px 40px 0px 40px !important; padding: 0px 40px 0px 40px !important;
} }
body[data-sidebar-size=condensed]:not([data-layout=compact]):not(.auth-fluid-pages) body[data-sidebar-size=condensed]:not([data-layout=compact]):not(.auth-fluid-pages) {
{
min-height: 100vh !important; min-height: 100vh !important;
} }
body .content-page {
margin-top: 90px !important;
}
</style> </style>
<!-- navbar --> <!-- navbar -->
<style> <style>
.nav-bar {
position: fixed !important;
z-index: 2;
width: 90%;
margin-left: 120px !important;
background: #fff;
}
.top-navbar-div {
display: flex;
flex-flow: row;
flex-shrink: 1 !important;
justify-content: space-between;
margin-top: 20px;
margin-left: 15px;
}
.ul-flex { .ul-flex {
display: flex; display: flex;
flex-flow: column nowrap; flex-flow: column nowrap;
justify-content: center; justify-content: center;
align-content: space-evenly; align-content: space-evenly;
flex-shrink: 1;
} }
.top-navbar-div {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
margin-top: 20px;
}
.nav-flex { .nav-flex {
display: flex; display: flex;
@ -165,6 +185,60 @@
} }
</style> </style>
<!-- tab-switch -->
<style>
.nav-pills,
.nav-link {
background-color: #F5FFFF !important;
color: #00999E !important;
border-radius: 10px;
}
.nav-pills {
background-color: #F5FFFF !important;
color: #00999E !important;
box-shadow: 0px 2px 4px 0px #00000040;
padding-top: 5px;
}
.nav-pills.nav-dash {
background-color: white !important;
box-shadow: none !important;
}
.nav-pills .nav-dash {
background-color: #D4F5F6 !important;
border-radius: 10px;
color: black !important;
}
.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;
}
.nav-link-btn {
color: white !important;
background-color: #00999E !important;
font-size: small !important;
padding: 8px 16px;
border-radius: 10px !important;
}
.navtab-bg .nav-link {
margin: 5px !important;
}
</style>
<!-- sidebar --> <!-- sidebar -->
<style> <style>
#side-menu .menu-logo a:hover { #side-menu .menu-logo a:hover {
@ -187,8 +261,47 @@
border-radius: 25px; border-radius: 25px;
background-color: #D4F5F6; background-color: #D4F5F6;
z-index: 700; z-index: 700;
padding: 0px !important; padding: 0 !important;
height: 90% !important; height: 90% !important;
display: flex;
flex-flow: column wrap;
}
/* every <li> inside should be allowed to shrink */
.left-side-menu li {
flex-shrink: 1 !important;
min-height: 0 !important;
/* prevents flex bugs */
}
.left-side-menu ul li:hover>ul {
position: relative;
z-index: 99999 !important;
}
.img-inactive {
background-color: white;
margin: 0px 12px;
border-radius: 5px;
border: 1px solid white;
padding: 8px !important;
min-height: 43px !important;
}
.li-seperate {
margin: 10px 0px;
}
.img-active {
background-color: #B7F0F2;
margin: 0px 12px;
border-radius: 5px;
border: 2px solid #00999E;
padding: 8px !important;
min-height: 43px !important;
} }
</style> </style>
@ -228,36 +341,6 @@
font-weight: 600 !important; font-weight: 600 !important;
} }
.nav-link {
color: black !important;
background-color: #D4F5F6 !important;
font-size: small !important;
padding: 8px;
border-radius: 10px !important;
padding: 8px 16px;
}
.nav-link-btn {
color: white !important;
background-color: #00999E !important;
font-size: small !important;
padding: 8px 16px;
border-radius: 10px !important;
}
.nav-link.active-tab {
color: white !important;
background-color: #00999E !important;
font-size: small !important;
padding: 8px 16px;
border-radius: 10px !important;
}
.navtab-bg .nav-link {
margin: 0 5px 10px !important;
}
.navbar-custom { .navbar-custom {
@ -336,18 +419,7 @@
/* end of loaders */ /* end of loaders */
</style> </style>
<!-- parsley-examples section starts -->
<style>
/* .parsley-examples
{
background-color: #F5FFFF;
padding: 25px;
border: 2px solid #F5FFFF;
border-radius: 10px;
box-shadow: 0px 1px 1px 0px #00000040;
}
*/
</style>
<!-- ticket list specific code --> <!-- ticket list specific code -->
<style> <style>
@ -386,49 +458,29 @@
font-size: 12px; font-size: 12px;
} }
.secondary-title {
.title-text { margin-left: 26px;
font-weight: 500; display: flex;
font-style: normal; align-items: center;
font-size: 30px;
line-height: 1;
letter-spacing: 0;
color: black;
} }
.sub-title-text { .secondary-title i {
font-weight: 500; font-size: 43px;
font-style: normal; }
font-size: 18px;
line-height: 1; .secondary-title span {
letter-spacing: 0; position: relative;
color: black;
} }
.font-color-black { .font-color-black {
color: black; color: black;
} }
.app-text-left {
text-align: left !important;
}
.app-text-right {
text-align: right !important;
}
.app-text-center {
text-align: center !important;
}
.app-text-white { .app-text-white {
color: #ffffff !important; color: #ffffff !important;
} }
.app-text-black {
color: #000000 !important;
}
.app-text-grey { .app-text-grey {
color: #5D5D5D !important; color: #5D5D5D !important;
} }
@ -672,30 +724,10 @@
} }
</style> </style>
<!-- img active inactive -->
<style>
.img-inactive {
background-color: white;
margin: 10px 12px;
border-radius: 5px;
border: 4px solid white;
padding: 8px !important;
min-height: 43px !important;
}
.img-active {
background-color: #B7F0F2;
margin: 10px 12px;
border-radius: 5px;
border: 4px solid #00999E;
padding: 8px !important;
min-height: 43px !important;
}
</style>
<!-- table section starts --> <!-- table section starts -->
<style> <style>
table[data-custom-table-css="table"] thead th { table[data-custom-table-css="table"] thead th,
table[data-custom-table-css="second-table"] thead th {
background-color: #00999E; background-color: #00999E;
color: #fff !important; color: #fff !important;
border-top: 0px solid #fff !important; border-top: 0px solid #fff !important;
@ -713,31 +745,37 @@
font-weight: 400 !important; font-weight: 400 !important;
} }
table[data-custom-table-css="table"] thead th:first-child { table[data-custom-table-css="table"] thead th:first-child,
table[data-custom-table-css="second-table"] thead th:first-child {
border-top-left-radius: 15px !important; border-top-left-radius: 15px !important;
border-bottom-left-radius: 15px !important; border-bottom-left-radius: 15px !important;
} }
table[data-custom-table-css="table"] thead th:last-child { table[data-custom-table-css="table"] thead th:last-child,
table[data-custom-table-css="second-table"] thead th:last-child {
border-top-right-radius: 15px !important; border-top-right-radius: 15px !important;
border-bottom-right-radius: 15px !important; border-bottom-right-radius: 15px !important;
} }
table[data-custom-table-css="table"] tbody tr td:first-child { table[data-custom-table-css="table"] tbody tr td:first-child,
table[data-custom-table-css="second-table"] tbody tr td:first-child {
border-top-left-radius: 15px !important; border-top-left-radius: 15px !important;
border-bottom-left-radius: 15px !important; border-bottom-left-radius: 15px !important;
} }
table[data-custom-table-css="table"] tbody tr td:last-child { table[data-custom-table-css="table"] tbody tr td:last-child,
table[data-custom-table-css="second-table"] tbody tr td:last-child {
border-top-right-radius: 15px !important; border-top-right-radius: 15px !important;
border-bottom-right-radius: 15px !important; border-bottom-right-radius: 15px !important;
} }
table[data-custom-table-css="table"] tbody tr:hover td { table[data-custom-table-css="table"] tbody tr:hover td,
table[data-custom-table-css="second-table"] tbody tr:hover td {
background-color: #e0e0e0; background-color: #e0e0e0;
} }
table[data-custom-table-css="table"] { table[data-custom-table-css="table"],
table[data-custom-table-css="second-table"] {
border-collapse: separate !important; border-collapse: separate !important;
border-spacing: 0 8px !important; border-spacing: 0 8px !important;
width: 100% !important; width: 100% !important;
@ -746,6 +784,20 @@
table[data-custom-table-css="table"].dataTable thead th { table[data-custom-table-css="table"].dataTable thead th {
padding: 15px !important; padding: 15px !important;
} }
table[data-custom-table-css="table"] thead.bg-light {
background-color: transparent !important;
}
/* ========== SECOND TABLE (white rows) ========== */
table[data-custom-table-css="second-table"] tbody td {
background: #FFFFFF !important;
padding: 12px;
border-top: 0px solid #fff !important;
border-bottom: 2px solid #F0F0F0 !important;
font-weight: 400 !important;
}
</style> </style>
<!-- Datatable section starts --> <!-- Datatable section starts -->
@ -824,6 +876,87 @@
.buttons-html5 { .buttons-html5 {
margin-right: 10px !important; margin-right: 10px !important;
} }
.dataTables_scrollBody thead.bg-light tr,
.dataTables_scrollBody thead tr {
visibility: collapse !important;
/* hides + removes row space */
height: 0 !important;
}
.dataTables_scrollBody thead.bg-light th {
padding: 0 !important;
margin: 0 !important;
border: none !important;
height: 0 !important;
line-height: 0 !important;
overflow: hidden !important;
}
/* Wrapper around the search input */
.datatable-search-wrapper {
position: relative;
display: inline-block;
width: 100%;
}
/* The search input itself */
.dataTables_filter input {
background: #F0F0F0 !important;
color: #707070 !important;
font-weight: 400 !important;
box-shadow: 0px 2px 4px 0px #00000024 !important;
border-color: #F0F0F0 !important;
margin-left: 1px !important;
}
/* Placeholder styling */
.dataTables_filter input::placeholder {
color: #707070 !important;
font-weight: 400 !important;
}
/* The magnify icon */
.datatable-search-icon {
position: absolute !important;
right: 12px !important;
top: 50% !important;
transform: translateY(-50%) !important;
color: #707070 !important;
font-size: 18px !important;
pointer-events: none;
/* prevents blocking typing */
}
.datatable-search {
margin-right: auto;
}
.datatable-buttons {
margin-left: auto;
}
/* Fix DataTables buttons alignment inside card-body */
.card-body .card-body .dt-buttons,
.card-body .card-body .datatable-buttons {
margin-right: 0 !important;
padding-right: 2.25rem !important;
/* match card-body padding */
}
/* Applies only to tables with data-custom-table-css="table" */
table[data-custom-table-css="table"] tbody tr td {
padding: 8px 10px !important;
/* spacing */
line-height: 20px;
/* consistent spacing for text */
min-height: 40px;
/* makes sense here if you use display:block */
vertical-align: middle;
/* aligns text properly */
}
</style> </style>
@ -981,10 +1114,84 @@
<!-- jodit section --> <!-- jodit section -->
<style> <style>
/********************************************************************* jodit section starts ***********************************************************************************************************/ /* ✅ Whole editor box */
.jodit {
border-radius: 10px;
box-shadow: 0px 2px 2px 0px #00000040;
overflow: hidden;
background-color: #F5FFFF !important;
/* fallback */
}
.jodit-wysiwyg { /* ✅ Toolbar (header) */
color: black; .jodit .jodit-toolbar__box,
.jodit .jodit-toolbar-editor-collection {
background-color: #F5FFFF !important;
border: none !important;
}
/* ✅ Footer / status bar */
.jodit .jodit-status-bar {
background-color: #F5FFFF !important;
border-top: 1px solid #ddd;
/* optional: keep a light separator */
}
/* ✅ Editable content (div mode) */
.jodit .jodit-wysiwyg {
background-color: #F5FFFF !important;
color: black !important;
padding: 10px;
}
/* ✅ Editable content (iframe mode) */
.jodit iframe {
background-color: #F5FFFF !important;
border-radius: 0 0 10px 10px;
}
</style>
<!-- jodit section inside modal -->
<style>
/* ✅ Whole editor box */
.modal .jodit {
border-radius: 10px;
box-shadow: 0px 2px 2px 0px #00000040;
overflow: hidden;
background-color: #ECECEC !important;
/* fallback */
}
.modal .jodit p {
background-color: #ECECEC !important;
/* fallback */
}
/* ✅ Toolbar (header) */
.modal .jodit .jodit-toolbar__box,
.modal .jodit .jodit-toolbar-editor-collection {
background-color: #ECECEC !important;
border: none !important;
}
/* ✅ Footer / status bar */
.modal .jodit .jodit-status-bar {
background-color: #ECECEC !important;
border-top: 1px solid #ddd;
/* optional: keep a light separator */
}
/* ✅ Editable content (div mode) */
.modal .jodit .jodit-wysiwyg {
background-color: #ECECEC !important;
color: black !important;
padding: 10px;
}
/* ✅ Editable content (iframe mode) */
.modal .jodit iframe {
background-color: #ECECEC !important;
border-radius: 0 0 10px 10px;
} }
</style> </style>
@ -1023,6 +1230,10 @@
border-color: #F5FFFF !important; border-color: #F5FFFF !important;
} }
.select2 textarea {
box-shadow: none !important;
}
/* Chrome, Edge, Safari */ /* Chrome, Edge, Safari */
@ -1044,10 +1255,14 @@
/* Cancel Bootstrap's .form-control for file inputs */ /* Cancel Bootstrap's .form-control for file inputs */
input[type="file"].form-control { input[type="file"].form-control {
height: auto !important; /* remove forced height */ height: auto !important;
padding: initial !important; /* reset padding */ /* remove forced height */
font-size: inherit !important; /* reset font size */ padding: initial !important;
line-height: normal !important; /* reset line height */ /* reset padding */
font-size: inherit !important;
/* reset font size */
line-height: normal !important;
/* reset line height */
} }
@ -1084,7 +1299,8 @@
button[type="submit"], button[type="submit"],
.buttons-collection, .buttons-collection,
input[type="submit"], input[type="submit"],
#get-emp-list { #get-emp-list,
.submit-btn {
color: #fff !important; color: #fff !important;
background-color: #E26728 !important; background-color: #E26728 !important;
border-color: #E26728 !important; border-color: #E26728 !important;
@ -1098,13 +1314,22 @@
cursor: pointer; cursor: pointer;
/* optional */ /* optional */
} }
.cancel-btn,
.modal-footer .cancel-btn {
color: #000000 !important;
background-color: #ffffff !important;
border-color: #E26728 !important;
}
</style> </style>
<!-- accordian --> <!-- accordian -->
<style> <style>
.card #collapseOne .card-body, .card #collapseOne .card-body,
#collapseOne .card-body,
.card #collapseTwo .card-body, .card #collapseTwo .card-body,
.card #collapseThree .card-body { .card #collapseThree .card-body,
.card #collapseFour .card-body {
background-color: #F5FFFF !important; background-color: #F5FFFF !important;
border: 2px solid #F5FFFF; border: 2px solid #F5FFFF;
border-radius: 10px; border-radius: 10px;
@ -1122,7 +1347,11 @@
.card #collapseThree .card-body input, .card #collapseThree .card-body input,
.card #collapseThree .card-body select, .card #collapseThree .card-body select,
.card #collapseThree .card-body textarea { .card #collapseThree .card-body textarea,
.card #collapseFour .card-body input,
.card #collapseFour .card-body select,
.card #collapseFour .card-body textarea {
background-color: #ffff !important; background-color: #ffff !important;
border-radius: 10px !important; border-radius: 10px !important;
box-shadow: 0px 2px 4px 0px #00000024 !important; box-shadow: 0px 2px 4px 0px #00000024 !important;
@ -1131,7 +1360,8 @@
.card #collapseOne .card-body input[type='file'], .card #collapseOne .card-body input[type='file'],
.card #collapseTwo .card-body input[type='file'], .card #collapseTwo .card-body input[type='file'],
.card #collapseThree .card-body input[type='file'] { .card #collapseThree .card-body input[type='file'],
.card #collapseFour .card-body input[type='file'] {
padding: 10px !important; padding: 10px !important;
background-color: white !important; background-color: white !important;
color: black !important; color: black !important;
@ -1140,7 +1370,8 @@
/* Apply to Select2 (single select) */ /* Apply to Select2 (single select) */
.card #collapseOne .card-body .select2-container .select2-selection--single, .card #collapseOne .card-body .select2-container .select2-selection--single,
.card #collapseTwo .card-body .select2-container .select2-selection--single, .card #collapseTwo .card-body .select2-container .select2-selection--single,
.card #collapseThree .card-body .select2-container .select2-selection--single { .card #collapseThree .card-body .select2-container .select2-selection--single,
.card #collapseFour .card-body .select2-container .select2-selection--single {
background-color: #ffff !important; background-color: #ffff !important;
border-radius: 10px !important; border-radius: 10px !important;
box-shadow: 0px 2px 4px 0px #00000024 !important; box-shadow: 0px 2px 4px 0px #00000024 !important;
@ -1154,7 +1385,8 @@
/* Apply to Select2 (multiple select) */ /* Apply to Select2 (multiple select) */
.card #collapseOne .card-body .select2-container .select2-selection--multiple, .card #collapseOne .card-body .select2-container .select2-selection--multiple,
.card #collapseTwo .card-body .select2-container .select2-selection--multiple, .card #collapseTwo .card-body .select2-container .select2-selection--multiple,
.card #collapseThree .card-body .select2-container .select2-selection--multiple { .card #collapseThree .card-body .select2-container .select2-selection--multiple,
.card #collapseFour .card-body .select2-container .select2-selection--multiple {
background-color: #ffff !important; background-color: #ffff !important;
border-radius: 10px !important; border-radius: 10px !important;
box-shadow: 0px 2px 4px 0px #00000024 !important; box-shadow: 0px 2px 4px 0px #00000024 !important;
@ -1195,7 +1427,6 @@
.fixed-header { .fixed-header {
position: relative; position: relative;
top: 0; top: 0;
z-index: 1000;
background-color: #f8f9fa !important; background-color: #f8f9fa !important;
} }
@ -1267,7 +1498,6 @@
</style> </style>
<style> <style>
.custom-form .parsley-examples { .custom-form .parsley-examples {
background-color: transparent !important; background-color: transparent !important;
@ -1327,6 +1557,7 @@
text-align: center; text-align: center;
} }
</style> </style>
<style> <style>
/* Common wrapper (works for text/file inputs) */ /* Common wrapper (works for text/file inputs) */
.input-icon { .input-icon {
@ -1372,6 +1603,67 @@
} }
</style> </style>
<!-- tab swich scrollable -->
<style>
.tab-wrapper {
display: flex;
align-items: center;
position: relative;
}
/* Make the UL a scrollable flex row */
#myTab {
display: flex;
white-space: nowrap;
flex-wrap: nowrap;
/* prevent wrapping */
overflow-x: auto;
/* enable horizontal scroll */
overflow-y: hidden;
white-space: nowrap;
/* keep items on one line */
margin: 0;
padding: 0 40px;
/* leave space for arrows */
flex-grow: 1;
}
/* Hide scrollbars */
#myTab::-webkit-scrollbar {
display: none;
}
#myTab {
-ms-overflow-style: none;
scrollbar-width: none;
}
.scroll-btn {
background-color: #F4FFFF;
height: 55px;
border: none;
cursor: pointer;
font-size: 18px;
padding: 5px 10px;
position: absolute;
top: 50%;
transform: translateY(-50%);
z-index: 1;
color: #00999E;
}
.left-btn {
left: 0;
}
.right-btn {
right: 0;
}
</style>
</head> </head>
<body class="loading" data-layout-mode="" data-layout='{"mode": "light", "width": "fluid", "menuPosition": "fixed", "sidebar": { "color": "light", "size": "condensed", "showuser": false}, "topbar": {"color": "dark"}, "showRightSidebarOnPageLoad": false}'></body> <body class="loading" data-layout-mode="" data-layout='{"mode": "light", "width": "fluid", "menuPosition": "fixed", "sidebar": { "color": "light", "size": "condensed", "showuser": false}, "topbar": {"color": "dark"}, "showRightSidebarOnPageLoad": false}'></body>
@ -1392,7 +1684,7 @@
<div class="left-side-menu"> <div class="left-side-menu">
<div class="h-100" data-simplebar> <div data-simplebar>
<!--- Sidemenu --> <!--- Sidemenu -->
<div id="sidebar-menu"> <div id="sidebar-menu">
@ -1400,23 +1692,23 @@
<li class="menu-logo"> <li class="menu-logo">
<a href="<?= base_url('/dashboard/view') ?>"> <a href="<?= base_url('/dashboard/view') ?>">
<img src="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi.png" alt="Logo" height="24"> <img src="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi.png" alt="Logo">
</a> </a>
</li> </li>
<li> <li class="li-seperate" id="dashboard-li">
<a href="<?= base_url('/dashboard/view') ?>" class="img-inactive-not-working"> <a href="<?= base_url('/dashboard/view') ?>" class="img-inactive">
<i class="ri-dashboard-line" style="color:black;"></i> <i class="ri-dashboard-line" style="color:black;"></i>
<span> Dashboard </span> <span style="color: #02a8b5;"> Dashboard </span>
</a> </a>
</li> </li>
<!-- client --> <!-- client -->
<?php if (in_array(get_role_id(), [1, 2, 3, 5])) { ?> <?php if (in_array(get_role_id(), [1, 2, 3, 5])) { ?>
<li> <li class="li-seperate" id="clients-li">
<a href="<?= base_url('/client/list') ?>" class="img-inactive-not-working"> <a href="<?= base_url('/client/list') ?>" class="img-inactive">
<img style="border-radius: 5px;" <img style="border-radius: 5px;"
src="<?= base_url() . "public"; ?>/assets/images/clients_sb.png" alt="Logo" height="24"> src="<?= base_url() . "public"; ?>/assets/images/clients_sb.png" alt="Logo" height="24">
<span> Clients </span> <span> Clients </span>
@ -1427,8 +1719,8 @@
<!-- Enrollment process --> <!-- Enrollment process -->
<?php if (in_array(get_role_id(), [1, 2, 3, 5]) || in_array(ENROLLMENT_TEAM_ID, user_team())) { ?> <?php if (in_array(get_role_id(), [1, 2, 3, 5]) || in_array(ENROLLMENT_TEAM_ID, user_team())) { ?>
<li> <li class="li-seperate" id="action-on-policies-li">
<a href="#sidebarDashboards" data-toggle="collapse" class="waves-effect img-inactive-not-working" > <a href="#sidebarDashboards" data-toggle="collapse" class="waves-effect img-inactive">
<img style="border-radius: 5px;" <img style="border-radius: 5px;"
src="<?= base_url() . "public"; ?>/assets/images/action_on_policies_sb.png" alt="Logo" height="20"> src="<?= base_url() . "public"; ?>/assets/images/action_on_policies_sb.png" alt="Logo" height="20">
<span> Action on Policies </span> <span> Action on Policies </span>
@ -1460,19 +1752,28 @@
<?php } ?> <?php } ?>
<!-- Masters --> <!-- Masters -->
<?php if (get_role_id() == 1 || get_role_id() == 5) { ?> <?php if (get_role_id() == 1 || get_role_id() == 5 || get_role_id() == 4) { ?>
<li> <li class="li-seperate" id="masters-li">
<a href="#sidebarDashboards" data-toggle="collapse" class=" img-inactive-not-working"> <a href="#sidebarPolicies" data-toggle="collapse" class=" img-inactive">
<img <img
src="<?= base_url() . "public"; ?>/assets/images/masters_sb.png" alt="Logo" height="20"> src="<?= base_url() . "public"; ?>/assets/images/masters_sb.png" alt="Logo" height="20">
<span> Masters </span> <span> Masters </span>
</a> </a>
<div class="collapse" id="sidebarDashboards"> <div class="collapse" id="sidebarDashboards">
<ul class="nav-second-level"> <ul class="nav-second-level">
<?php if (get_role_id() == 1 || get_role_id() == 5 || ( get_role_id() == 4 && (in_array(BUSINESS_SUPPORT_TEAM_ID, user_team()) || in_array(SALES_TEAM_ID, user_team())))) { ?>
<li> <li>
<a href="<?= base_url('/master/insurer/list') ?>">Insurer</a> <a href="<?= base_url('/master/insurer/list') ?>">Insurer</a>
</li> </li>
<?php } ?>
<?php if (get_role_id() == 1 || get_role_id() == 5) { ?>
<li> <li>
<a href="<?= base_url('/master/tpa/list') ?>">TPA</a> <a href="<?= base_url('/master/tpa/list') ?>">TPA</a>
</li> </li>
@ -1491,6 +1792,9 @@
<li> <li>
<a href="<?= base_url('/user/list') ?>"> Users </a> <a href="<?= base_url('/user/list') ?>"> Users </a>
</li> </li>
<?php } ?>
</ul> </ul>
</div> </div>
</li> </li>
@ -1514,8 +1818,8 @@
<!-- Claims --> <!-- Claims -->
<?php if (in_array(get_role_id(), [1, 2, 3, 5]) || in_array(CLAIMS_TEAM_ID, user_team())) { ?> <?php if (in_array(get_role_id(), [1, 2, 3, 5]) || in_array(CLAIMS_TEAM_ID, user_team())) { ?>
<li> <li class="li-seperate" id="claims-li">
<a href="#sidebarDashboardsTicket" data-toggle="collapse" class="waves-effect img-inactive-not-working"> <a href="#sidebarDashboardsTicket" data-toggle="collapse" class="waves-effect img-inactive">
<img <img
src="<?= base_url() . "public"; ?>/assets/images/claims_sb.png" alt="Logo" height="20"> src="<?= base_url() . "public"; ?>/assets/images/claims_sb.png" alt="Logo" height="20">
<span> Claims </span> <span> Claims </span>
@ -1550,8 +1854,8 @@
<!-- leads --> <!-- leads -->
<?php if (in_array(get_role_id(), [1, 2, 3, 5]) || in_array(BUSINESS_SUPPORT_TEAM_ID, user_team()) || in_array(SALES_TEAM_ID, user_team())) { ?> <?php if (in_array(get_role_id(), [1, 2, 3, 5]) || in_array(BUSINESS_SUPPORT_TEAM_ID, user_team()) || in_array(SALES_TEAM_ID, user_team())) { ?>
<li> <li class="li-seperate" id="leads-li">
<a href="<?= base_url('/leads/list') ?>" class="img-inactive-not-working"> <a href="<?= base_url('/leads/list') ?>" class="img-inactive">
<img <img
src="<?= base_url() . "public"; ?>/assets/images/leads_sb.png" alt="Logo" height="20"> src="<?= base_url() . "public"; ?>/assets/images/leads_sb.png" alt="Logo" height="20">
<span> Leads </span> <span> Leads </span>
@ -1560,8 +1864,8 @@
<?php } ?> <?php } ?>
<!-- Tickets --> <!-- Tickets -->
<?php if (in_array(get_role_id(), [1, 2, 3, 4, 5]) || in_array(CLAIMS_TEAM_ID, user_team())) { ?> <?php if (in_array(get_role_id(), [1, 2, 3, 4, 5]) || in_array(CLAIMS_TEAM_ID, user_team())) { ?>
<li> <li class="li-seperate" id="tickets-li">
<a id="tickets" href="<?= base_url('/ticketList?return_type=web') ?>" class="waves-effect img-inactive-not-working"> <a id="tickets" href="<?= base_url('/ticketList?return_type=web') ?>" class="waves-effect img-inactive">
<img src="<?= base_url() . "public"; ?>/assets/images/ticket.png" alt="Logo" height="20"> <img src="<?= base_url() . "public"; ?>/assets/images/ticket.png" alt="Logo" height="20">
<span>Tickets</span> <span>Tickets</span>
</a> </a>
@ -1569,8 +1873,8 @@
<?php } ?> <?php } ?>
<!-- BDS --> <!-- BDS -->
<?php if ((get_role_id() == 1 || get_role_id() == 5) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team()))) { ?> <?php if ((get_role_id() == 1 || get_role_id() == 5) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team()))) { ?>
<li> <li class="li-seperate" id="policy-transactions-li">
<a href="#policyTransactions" data-toggle="collapse" class="waves-effect img-inactive-not-working"> <a href="#policyTransactions" data-toggle="collapse" class="waves-effect img-inactive">
<img <img
src="<?= base_url() . "public"; ?>/assets/images/policy_transactions_sb.png" alt="Logo" height="20"> src="<?= base_url() . "public"; ?>/assets/images/policy_transactions_sb.png" alt="Logo" height="20">
<span> Policy Transactions </span> <span> Policy Transactions </span>
@ -1718,11 +2022,11 @@
<!-- Ad --> <!-- Ad -->
<?php if (in_array(get_role_id(), [1, 2, 3, 5])) { ?> <?php if (in_array(get_role_id(), [1, 2, 3, 5])) { ?>
<li> <li class="li-seperate" id="app-content-mng-li">
<a id="app_content_management" href="#sidebarDashboardsmenu" data-toggle="collapse" class="waves-effect img-inactive-not-working" style="color: grey;"> <a id="app_content_management" href="#sidebarDashboardsmenu" data-toggle="collapse" class="waves-effect img-inactive" style="color: grey;">
<img <img
src="<?= base_url() . "public"; ?>/assets/images/app_content_mng_sb.png" alt="Logo" height="20"> src="<?= base_url() . "public"; ?>/assets/images/app_content_mng_sb.png" alt="Logo" height="20">
<span>App Content Mgmt</span> <span style="color: #02a8b5;">App Content Mgmt</span>
</a> </a>
<div class="collapse" id="sidebarDashboardsmenu"> <div class="collapse" id="sidebarDashboardsmenu">
<ul class="nav-second-level"> <ul class="nav-second-level">
@ -1736,8 +2040,8 @@
</div> </div>
</li> </li>
<?php } ?> <?php } ?>
<li> <li class="li-seperate" id="user-manual-li">
<a id="user_manual" href="<?= base_url("autobookstackLogin") ?>" class="waves-effect img-inactive-not-working" target="_blank" rel="noopener noreferrer"> <a id="user_manual" href="<?= base_url("autobookstackLogin") ?>" class="waves-effect img-inactive" target="_blank" rel="noopener noreferrer">
<img <img
src="<?= base_url() . "public"; ?>/assets/images/user_manual_sb.png" alt="Logo" height="20"> src="<?= base_url() . "public"; ?>/assets/images/user_manual_sb.png" alt="Logo" height="20">
<span>User Manual</span> <span>User Manual</span>
@ -1752,12 +2056,10 @@
</div> </div>
<!-- Left Sidebar End --> <!-- Left Sidebar End -->
<!-- ========== Top Bar Start ========== -->
<div class="nav-bar">
<div class="top-navbar-div">
<!-- Top Bar --> <div class="top-navbar-title">
<div class="top-navbar-div" style="margin-left:130px;">
<div>
<h5>Welcome <?= (isset(get_session_userdata()->first_name) ? get_session_userdata()->first_name : 'NOT SET') ?> </h5> <h5>Welcome <?= (isset(get_session_userdata()->first_name) ? get_session_userdata()->first_name : 'NOT SET') ?> </h5>
</div> </div>
<div class="nav-flex"> <div class="nav-flex">
@ -1801,9 +2103,13 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- End of Top Bar --> <!-- End of Top Bar -->
<br> <!-- <br> -->
<!-- ============================================================== --> <!-- ============================================================== -->
@ -1814,4 +2120,4 @@
<div class="content"> <div class="content">
<!-- Start Content--> <!-- Start Content-->
<div class="container-fluid"> <div class="container-fluid-top">

View File

@ -4,24 +4,20 @@
} }
</style> </style>
<div class="container-fluid-min">
<div class="row" id="lead_filter_div"> <div class="row" id="lead_filter_div">
<div class="col-12" style="margin-top: -12px;"> <div class="col-12" style="margin-top: -12px;">
<div class="card-body">
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h5 class="m-1"> <h4 class="m-1">
<div class="row"> <span>Filter</span>
<div class="col-md-6" style="position: relative;left: 17px;"> <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
<h4 style="text-align: left; margin-left:30px;">Lead Filter</h4> aria-expanded="true">
</div> <i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
<div class="col-md-6">
<a style="text-align: right;" 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> </a>
</div> </h4>
</div>
</h5>
<div id="collapseOne" class="collapse hide" aria-labelledby="headingOne" data-parent="#accordion"> <div id="collapseOne" class="collapse hide" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body">
<div class="form-group"> <div class="form-group">
@ -131,12 +127,16 @@
</div> </div>
</div> </div>
</div>
</div> </div>
<!-- end page title --> <!-- end page title -->
<div id="lead_list_div"> <div id="lead_list_div">
<?php include('leads_list.php'); ?> <?php include('leads_list.php'); ?>
</div> </div>
</div>
<script> <script>
@ -365,5 +365,4 @@ function additionalDropdown() {
} }
}); });
} }
</script> </script>

View File

@ -193,7 +193,7 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID, user_
<div class="row d-flex align-items-center"> <div class="row d-flex align-items-center">
<div class="status_tile" style="padding-left: 25px;"> <div class="status_tile" style="padding-left: 25px;">
<a href="#" onclick="hide_and_show_tile('2')" ><b><i class="mdi mdi-chevron-left mdi-36px"></i></b> </a> <a href="#" onclick="hide_and_show_tile('2')" ><b><i class="mdi mdi-chevron-left mdi-36px chevron-left-dash"></i></b> </a>
</div> </div>
<div class="status_tile" style="padding-left: 15px;"> <div class="status_tile" style="padding-left: 15px;">
<a href="#" id="main_tile">Current Tile : </a> <a href="#" id="main_tile">Current Tile : </a>

View File

@ -34,6 +34,10 @@
color: white !important; color: white !important;
margin-right: 5px; margin-right: 5px;
} }
hr {
display: none !important;
}
</style> </style>
<style> <style>
@ -58,7 +62,8 @@
border-radius: 6px; border-radius: 6px;
position: absolute; position: absolute;
z-index: 999; z-index: 999;
bottom: 125%; /* Show above icon */ bottom: 125%;
/* Show above icon */
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
font-size: 12px; font-size: 12px;
@ -69,7 +74,8 @@
.info-tooltip::after { .info-tooltip::after {
content: ""; content: "";
position: absolute; position: absolute;
top: 100%; /* Arrow below tooltip */ top: 100%;
/* Arrow below tooltip */
left: 50%; left: 50%;
margin-left: -5px; margin-left: -5px;
border-width: 5px; border-width: 5px;
@ -81,33 +87,56 @@
visibility: visible; visibility: visible;
opacity: 1; opacity: 1;
} }
/* dont forgot it keep it safe card and card body space remover */
/* bcoz in design */
.card-body {
margin-top: 0px !important;
}
/* this css as per design so not declare in golbal */
/* bcoz in design */
#collapseOne {
border: 1px solid #BFF3F5 !important;
border-radius: 10px !important;
border-width: 1px !important;
}
</style> </style>
<div class="container-fluid-min">
<div class="row" id="leads_form"> <div class="row" id="leads_form">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="margin-bottom:1rem;"> <div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;"> <!-- <div class="col-6" style="align-self: center;">
<h4 id="page_title" style="position: relative;">Add Lead</h4> <h4 id="page_title" style="position: relative;">Add Lead</h4>
</div> </div>
<div class="col-3" style="text-align: right; position: relative; left: 211px;"> <div class="col-3" style="text-align: right; position: relative; left: 211px;">
<!-- <button class="btn btn-primary waves-effect waves-light" onclick="fileupload(this)">file upload</button> --> <!-- <button class="btn btn-primary waves-effect waves-light" onclick="fileupload(this)">file upload</button> ->
</div> </div>
<div class="col-1" style="text-align: right; position: relative; left: 193px;"> <div class="col-1" style="text-align: right; position: relative; left: 193px;">
<a href="<?= base_url('leads/list') ?>" type="button" id="btnAdd" <a href="<?= base_url('leads/list') ?>" type="button" id="btnAdd"
class="btn btn-primary waves-effect waves-light">Back</a> class="btn btn-primary waves-effect waves-light">Back</a>
</div> </div> -->
<h4 class="d-flex align-items-center" style="gap: 8px;">
<a href="<?= base_url('leads/list') ?>" style="cursor: pointer;">
<i class="mdi mdi-chevron-left" style="font-size: 43px;"></i>
</a>
<span class="title-text" id="page_title" style="position: relative;">Add Lead</span>
</h4>
</div> </div>
<form role="form" class="parsley-examples" method="post" id="leads_form_id" <form role="form" class="parsley-examples" method="post" id="leads_form_id"
enctype="multipart/form-data"> enctype="multipart/form-data">
<input type="hidden" name="id" id="leads_primarykey"> <input type="hidden" name="id" id="leads_primarykey">
<div class="card" id="collapseOne">
<div class="card-body">
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="lead_type">Lead Type<span class="text-danger">*</span></label> <label for="lead_type">Lead Type<span class="text-danger">*</span></label>
<select class="form-control" id="lead_type" name="lead_type" required> <select class="form-control" id="lead_type" name="lead_type" required>
<option value="">Select Lead Type</option> <option value="">Select Lead Type</option>
@ -125,7 +154,7 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="issuer">Issuer<span class="text-danger">*</span></label> <label for="issuer">Issuer<span class="text-danger">*</span></label>
<select class="form-control" id="issuer" name="issuer" required> <select class="form-control" id="issuer" name="issuer" required>
<option value="">Select Issuer</option> <option value="">Select Issuer</option>
@ -140,29 +169,36 @@
</div> </div>
</div> </div>
</div>
</div>
<hr> <!-- <hr> --> <!-- bcoz removed in design -->
<!-- client row --> <!-- client row -->
<div class="card" id="collapseOne">
<div class="card-body">
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-3 freshFields"> <div class="form-group offset-md-10 col-md-2 freshFields" style="float:right;">
<label class="switch" style="position: relative;top: 33px;left: 0px;"> <label class="switch">
<input id="exixting_client" type="checkbox" name="exixting_client"> <input id="exixting_client" type="checkbox" name="exixting_client">
<span class="slider round" style="height: 27px;"></span> <span class="slider round" style="height: 27px;"></span>
</label> </label>
<label for="exixting_client" style="position: relative;top: 39px;left: 20px;">Existing Client</label> <label for="exixting_client" style="position: relative;top: 2px;">Existing Client</label>
</div> </div>
<div class="form-group col-md-3 renewalFields" style="display: none;"> </div>
<div class="form-row">
<div class="form-group col-md-4 renewalFields" style="display: none;">
<label for="client_id">Client<span class="text-danger">*</span></label> <label for="client_id">Client<span class="text-danger">*</span></label>
<select class="form-control" id="client_id" name="client_id"> <select class="form-control" id="client_id" name="client_id">
<option value="">Select Client</option> <option value="">Select Client</option>
</select> </select>
</div> </div>
<div class="form-group col-md-3 renewalFields" style="display: none;"> <div class="form-group col-md-4 renewalFields" style="display: none;">
<label for="client_branch_id">Branch<span class="text-danger">*</span></label> <label for="client_branch_id">Branch<span class="text-danger">*</span></label>
<select class="form-control" id="client_branch_id" name="client_branch_id" <select class="form-control" id="client_branch_id" name="client_branch_id"
onchange="getBranchData(this,1)"> onchange="getBranchData(this,1)">
@ -184,7 +220,7 @@
</select> </select>
</div> --> </div> -->
<div class="form-group col-md-3 freshFields"> <div class="form-group col-md-4 freshFields">
<label for="entity_type_id">Entity Type<span class="text-danger">*</span></label> <label for="entity_type_id">Entity Type<span class="text-danger">*</span></label>
<select class="form-control" id="entity_type_id" name="entity_type_id" required> <select class="form-control" id="entity_type_id" name="entity_type_id" required>
<option value="" selected>Select Entity</option> <option value="" selected>Select Entity</option>
@ -198,13 +234,13 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3 freshFields"> <div class="form-group col-md-4 freshFields">
<label for="client_name">Client Name<span class="text-danger">*</span></label> <label for="client_name">Client Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="client_name" name="client_name" <input type="text" class="form-control" id="client_name" name="client_name"
placeholder="Enter Client Name" required> placeholder="Enter Client Name" required>
</div> </div>
<div class="form-group col-md-3 freshFields"> <div class="form-group col-md-4 freshFields">
<label for="client_short_name">Client Short Name<span class="text-danger">*</span></label> <label for="client_short_name">Client Short Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="client_short_name" name="client_short_name" <input type="text" class="form-control" id="client_short_name" name="client_short_name"
placeholder="Enter Client Short Name" onkeyup="validateInput(this, 'clients', 'short_name')" required> placeholder="Enter Client Short Name" onkeyup="validateInput(this, 'clients', 'short_name')" required>
@ -236,14 +272,18 @@
</div> --> </div> -->
</div> </div>
</div>
</div>
<!-- end client row --> <!-- end client row -->
<hr> <!-- <hr> --> <!-- bcoz removed in design -->
<!-- branch row--> <!-- branch row-->
<div class="card" id="collapseOne">
<div class="card-body">
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="gst">GST<span class="text-danger">*</span></label> <label for="gst">GST<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="gst" placeholder="Enter GST Number" <input type="text" class="form-control" id="gst" placeholder="Enter GST Number"
data-parsley-error-message="Invalid GST Number. Example: 12ABCDE1234F5Z6" name="gst" data-parsley-error-message="Invalid GST Number. Example: 12ABCDE1234F5Z6" name="gst"
@ -251,39 +291,39 @@
data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required> data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="client_branch">Branch Name<span class="text-danger">*</span></label> <label for="client_branch">Branch Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_name" name="branch_name" <input type="text" class="form-control" id="branch_name" name="branch_name"
placeholder="Enter Branch Name" required> placeholder="Enter Branch Name" required>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="client_branch">Branch Code<span class="text-danger">*</span></label> <label for="client_branch">Branch Code<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_code" name="branch_code" <input type="text" class="form-control" id="branch_code" name="branch_code"
placeholder="Enter Branch Code" required> placeholder="Enter Branch Code" required>
</div> </div>
<div class="form-group col-md-3 renewalFields"> <div class="form-group col-md-4 renewalFields">
<label for="contact_person_summary">Contact Person</label> <label for="contact_person_summary">Contact Person</label>
<select class="form-control" name="contact_person_summary" id="contact_person_summary"> <select class="form-control" name="contact_person_summary" id="contact_person_summary">
<option value="">Select a Contact</option> <option value="">Select a Contact</option>
</select> </select>
</div> </div>
<div class="form-group col-md-3 freshFields"> <div class="form-group col-md-4 freshFields">
<label for="client_branch">Contact Person Name<span class="text-danger">*</span></label> <label for="client_branch">Contact Person Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="contact_person_name" name="contact_person_name" <input type="text" class="form-control" id="contact_person_name" name="contact_person_name"
placeholder="Enter Contact Name" required> placeholder="Enter Contact Name" required>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="contact_person_mobile">Contact Person Mobile<span <label for="contact_person_mobile">Contact Person Mobile<span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input type="text" class="form-control" id="contact_person_mobile" <input type="text" class="form-control" id="contact_person_mobile"
name="contact_person_mobile" placeholder="Enter Contact Mobile" required> name="contact_person_mobile" placeholder="Enter Contact Mobile" required>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="contact_person_email">Contact Person Email<span <label for="contact_person_email">Contact Person Email<span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input type="text" class="form-control" id="contact_person_email" <input type="text" class="form-control" id="contact_person_email"
@ -291,16 +331,34 @@
</div> </div>
</div> </div>
</div>
</div>
<!-- policy row --> <!-- policy row -->
<div class="card" id="collapseOne">
<div class="card-body">
<div id="dynamic-form-container"></div> <div id="dynamic-form-container"></div>
</div>
<hr> </div>
<!-- <hr> --> <!-- bcoz removed in design -->
<!-- other row --> <!-- other row -->
<div class="card" id="collapseOne">
<div class="card-body">
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-3"> <div class="form-group offset-md-9 col-md-3" style="float:right;">
<label class="switch">
<input id="is_insurer_auto_mail" type="checkbox" name="is_insurer_auto_mail">
<span class="slider round" style="height: 27px;"></span>
</label>
<label for="is_insurer_auto_mail" style="position: relative;top: 2px;">Insurer Auto Mail</label>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="salse_person_id">Sales Person<span class="text-danger">*</span></label> <label for="salse_person_id">Sales Person<span class="text-danger">*</span></label>
<select class="form-control" id="salse_person_id" name="salse_person_id" multiple required> <select class="form-control" id="salse_person_id" name="salse_person_id" multiple required>
<option value="">Select Sales Person</option> <option value="">Select Sales Person</option>
@ -314,7 +372,7 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="status"> Status <span id="base_danger" class="text-danger">*</span></label> <label for="status"> Status <span id="base_danger" class="text-danger">*</span></label>
<select class="form-control" id="lead_status" name="status" required> <select class="form-control" id="lead_status" name="status" required>
<option value="" selected>Select Status</option> <option value="" selected>Select Status</option>
@ -332,28 +390,23 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="">Next Reminder Date<span class="text-danger"></span></label> <label for="">Next Reminder Date<span class="text-danger"></span></label>
<div class="input-icon">
<input type="text" class="form-control" id="next_reminder_date" name="next_reminder_date" placeholder="DD/MM/YYYY"> <input type="text" class="form-control" id="next_reminder_date" name="next_reminder_date" placeholder="DD/MM/YYYY">
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
</div> </div>
<div class="form-group col-md-3">
<label class="switch" style="position: relative;top: 33px;left: 0px;">
<input id="is_insurer_auto_mail" type="checkbox" name="is_insurer_auto_mail">
<span class="slider round" style="height: 27px;"></span>
</label>
<label for="is_insurer_auto_mail" style="position: relative;top: 35px;left: 20px;">Insurer Auto Mail</label>
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="notes">Remarks</label> <label for="notes">Remarks</label>
<textarea class="form-control" id="notes" name="notes" rows="4"></textarea> <textarea class="form-control" id="notes" name="notes" rows="4"></textarea>
</div> </div>
</div> </div>
</div>
</div>
<div class="form-group text-right m-b-0" id="submitButton"> <div class="form-group text-right m-b-0" id="submitButton">
<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"
@ -367,6 +420,9 @@
</div><!-- end form row --> </div><!-- end form row -->
<?php include("newClientModal.php") ?> <?php include("newClientModal.php") ?>
</div>
<script> <script>
@ -1073,13 +1129,14 @@
const newRow = document.createElement('div'); const newRow = document.createElement('div');
newRow.className = 'form-row dynamic-form-row'; newRow.className = 'form-row dynamic-form-row';
if (increment > 1) {
const hrElement = document.createElement('hr'); const hrElement = document.createElement('hr');
container.appendChild(hrElement); container.appendChild(hrElement);
}
// Main div // Main div
newRow.innerHTML += ` newRow.innerHTML += `
<div class="form-group col-md-4 renewalFields" style="display: none;">
<div class="form-group col-md-3 renewalFields" style="display: none;">
<label for="source_policy_id"> Source Policy <span id="base_danger" <label for="source_policy_id"> Source Policy <span id="base_danger"
class="text-danger">* </span></label> class="text-danger">* </span></label>
<select class="form-control" id="source_policy_id" name="source_policy_id"> <select class="form-control" id="source_policy_id" name="source_policy_id">
@ -1087,17 +1144,17 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3 renewalFields" style="display: none;"> <div class="form-group col-md-4 renewalFields" style="display: none;">
<label for="source_policy_start_date">Source Policy Start Date<span class="text-danger"></span></label> <label for="source_policy_start_date">Source Policy Start Date<span class="text-danger"></span></label>
<input type="text" class="form-control readonly-select" id="source_policy_start_date" name="source_policy_start_date" readonly> <input type="text" class="form-control readonly-select" id="source_policy_start_date" name="source_policy_start_date" readonly>
</div> </div>
<div class="form-group col-md-3 renewalFields" style="display: none;"> <div class="form-group col-md-4 renewalFields" style="display: none;">
<label for="source_policy_end_date">Source Policy End Date<span class="text-danger"></span></label> <label for="source_policy_end_date">Source Policy End Date<span class="text-danger"></span></label>
<input type="text" class="form-control" id="source_policy_end_date" name="source_policy_end_date" readonly> <input type="text" class="form-control" id="source_policy_end_date" name="source_policy_end_date" readonly>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="policy_type_id">Policy Type <span class="text-danger">*</span></label> <label for="policy_type_id">Policy Type <span class="text-danger">*</span></label>
<select class="form-control" id="policy_type_id_${increment}" name="policy_type_id[]" onchange="getCustomFields(this, ${increment})" required> <select class="form-control" id="policy_type_id_${increment}" name="policy_type_id[]" onchange="getCustomFields(this, ${increment})" required>
<option value="">Select Policy Type</option> <option value="">Select Policy Type</option>
@ -1113,7 +1170,7 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3 proposed_div"> <div class="form-group col-md-4 proposed_div">
<label for="insurer">Insurer <span class="text-danger"></span></label> <label for="insurer">Insurer <span class="text-danger"></span></label>
<select class="form-control" id="insurer_${increment}" name="insurer[]" onchange="insurerChange(this, ${increment})"> <select class="form-control" id="insurer_${increment}" name="insurer[]" onchange="insurerChange(this, ${increment})">
<option value="">Select Insurer</option> <option value="">Select Insurer</option>
@ -1127,7 +1184,7 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3 proposed_div"> <div class="form-group col-md-4 proposed_div">
<label for="tpa">TPA <span class="text-danger"></span></label> <label for="tpa">TPA <span class="text-danger"></span></label>
<select class="form-control" id="tpa_${increment}" name="tpa[]" onchange="tpaChange(this, ${increment})"> <select class="form-control" id="tpa_${increment}" name="tpa[]" onchange="tpaChange(this, ${increment})">
<option value="">Select TPA</option> <option value="">Select TPA</option>
@ -1141,19 +1198,31 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="">Date of Commencement <span class="text-danger"></span></label> <label for="">Date of Commencement <span class="text-danger"></span></label>
<div class="input-icon">
<input type="text" class="form-control policy_start_date" id="policy_start_date_${increment}" name="policy_start_date[]" placeholder="Enter DOC" onchange="calculatePolicyMetrics(this)"> <input type="text" class="form-control policy_start_date" id="policy_start_date_${increment}" name="policy_start_date[]" placeholder="Enter DOC" onchange="calculatePolicyMetrics(this)">
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
</div> </div>
<div class="form-group col-md-3">
<label for="">Date of Expiry <span class="text-danger"></span></label>
<input type="text" class="form-control policy_end_date" id="policy_end_date_${increment}" name="policy_end_date[]" placeholder="Enter DOE">
</div> </div>
<div class="form-group col-md-4">
<label for="">Date of Expiry <span class="text-danger"></span></label>
<div class="input-icon">
<input type="text" class="form-control policy_end_date" id="policy_end_date_${increment}" name="policy_end_date[]" placeholder="Enter DOE">
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
</div>
</div>
<div id="appendArea_${increment}" class = "form-group col-md-12 appendArea"></div> <div id="appendArea_${increment}" class = "form-group col-md-12 appendArea"></div>
<div class="card" style="width:100%; background-color: transparent;">
<div class="card-body" style="background-color: #fff !important; border: 0px !important;">
<div id="multiFileAppendArea_${increment}"></div> <div id="multiFileAppendArea_${increment}"></div>
</div>
</div>
<div class="form-group col-md-12 btnDiv" style="position: relative;top: 28px;float: right;text-align: end;"> <div class="form-group col-md-12 btnDiv" style="position: relative;top: 28px;float: right;text-align: end;">
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this)">x</a> <a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this)">x</a>
@ -1471,9 +1540,9 @@
let premium_as_on_date = Number($('#premium_date').val()) || 0; let premium_as_on_date = Number($('#premium_date').val()) || 0;
console.log('Premium as on Date:', premium_as_on_date); console.log('Premium as on Date:', premium_as_on_date);
let incurred_claim_ratio = (incurred_claims > 0 && premium_as_on_date > 0) let incurred_claim_ratio = (incurred_claims > 0 && premium_as_on_date > 0) ?
? (incurred_claims / premium_as_on_date) * 100 (incurred_claims / premium_as_on_date) * 100 :
: 0; 0;
let incurred_claim_ratio_roundoff = isFinite(incurred_claim_ratio) ? incurred_claim_ratio.toFixed(2) : 0; let incurred_claim_ratio_roundoff = isFinite(incurred_claim_ratio) ? incurred_claim_ratio.toFixed(2) : 0;
console.log('Incurred Claim Ratio:', incurred_claim_ratio); console.log('Incurred Claim Ratio:', incurred_claim_ratio);
console.log('Incurred Claim Ratio (Rounded):', incurred_claim_ratio_roundoff); console.log('Incurred Claim Ratio (Rounded):', incurred_claim_ratio_roundoff);
@ -1793,6 +1862,7 @@
let claimData = []; let claimData = [];
$(".claim-row").each(function() { $(".claim-row").each(function() {
let year = $(this).find("[name='first_year[]']").val(); let year = $(this).find("[name='first_year[]']").val();
let claimAmount = $(this).find("[name='first_claim_amount[]']").val(); let claimAmount = $(this).find("[name='first_claim_amount[]']").val();
let claimStatus = $(this).find("[name='first_claim_status[]']").val(); let claimStatus = $(this).find("[name='first_claim_status[]']").val();
@ -1800,13 +1870,22 @@
let causeOfDeath = $(this).find("[name='first_cause_of_death[]']").val(); let causeOfDeath = $(this).find("[name='first_cause_of_death[]']").val();
let deathDate = $(this).find("[name='first_death_date[]']").val(); let deathDate = $(this).find("[name='first_death_date[]']").val();
let emp_id = $(this).find("[name='emp_id[]']").val();
let emp_name = $(this).find("[name='emp_name[]']").val();
let gender = $(this).find("[name='gender[]']").val();
let designation = $(this).find("[name='designation[]']").val();
let sum_insured = $(this).find("[name='sum_insured[]']").val();
claimData.push({ claimData.push({
"year": year, "year": year,
"claim_amount": claimAmount, "emp_id": emp_id,
"status": claimStatus, "emp_name": emp_name,
"claim_type": claimType, "gender": gender,
"designation": designation,
"sum_insured": sum_insured,
"death_date": deathDate,
"cause_of_death": causeOfDeath, "cause_of_death": causeOfDeath,
"death_date": deathDate "settled": claimAmount,
}); });
}); });
@ -1824,6 +1903,93 @@
//----------------------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------------------
// do not remove this
// function appendThreeYearsClaims(count) {
// // let count = $('#appendAreaForClaim').data('count');
// console.log("count", count);
// let policy_type_id = $('#policy_type_id_' + count).val()
// console.log('policy_type_id', policy_type_id);
// console.log('claimIndex from parent', claimIndex);
// let increment = claimIndex;
// let claimsFields = `
// <div class="row claim-row">
// <div class="form-group col-md-2">
// <label for="first_year_${increment}">Year<span class="text-danger">*</span></label>
// <select class="form-control first_year_" id="first_year_${increment}" name="first_year[]">
// <option value="">Select Year</option>
// <?php foreach ($lastFiveYears as $year) {echo "<option value='$year'>$year</option>";} ?>
// </select>
// </div>
// <div class="form-group col-md-2">
// <label for="first_claim_amount_${increment}">Claim/Settled Amount<span class="text-danger">*</span></label>
// <input type="text" class="form-control" id="first_claim_amount_${increment}" name="first_claim_amount[]">
// </div>
// <div class="form-group col-md-2">
// <label for="first_claim_status_${increment}">Claim Status<span class="text-danger">*</span></label>
// <input type="text" class="form-control" id="first_claim_status_${increment}" name="first_claim_status[]">
// </div>
// <div class="form-group col-md-2 lifeClaimFields" style="display:none;">
// <label for="first_cause_of_death_${increment}">Nature/Cause Of Death <span class="text-danger">*</span></label>
// <select class="form-control" id="first_cause_of_death_${increment}" name="first_cause_of_death[]">
// <option value="">Select Cause of Death</option>
// <?php foreach ($causeOfDeath as $cause => $death_value) {echo "<option value='$cause'>$death_value</option>";} ?>
// </select>
// </div>
// <div class="form-group col-md-2 lifeClaimFields" style="display:none;">
// <label for="first_death_date_${increment}">Date of Death<span class="text-danger">*</span></label>
// <input type="text" class="form-control" id="first_death_date_${increment}" name="first_death_date[]">
// </div>
// <div class="form-group col-md-2 gpaClaimFileds" style="display:none;">
// <label for="claim_type_${increment}">Claim Type<span class="text-danger">*</span></label>
// <select class="form-control" id="claim_type_${increment}" name="claim_type[]">
// <option value="">Select Claim Type</option>
// <?php foreach ($gpaClaimType as $claimType => $claim_value) {echo "<option value='$claimType'>$claim_value</option>";} ?>
// </select>
// </div>
// <div class="form-group col-md-2">
// <div class="" style="position: relative; top: 28px; float: right; text-align: end;">
// <a class="btn btn-danger waves-effect waves-light" onclick="removeClaim(this, ${count})">x</a>
// <a class="btn btn-primary waves-effect waves-light mr-1" onclick="appendThreeYearsClaims(${count})">+</a>
// </div>
// </div>
// </div>
// `;
// // Append new claim fields
// let referenceDiv = document.getElementById('appendAreaForClaim_' + count);
// if (referenceDiv) {
// referenceDiv.insertAdjacentHTML('beforeend', claimsFields);
// } else {
// console.error('Element not found: appendAreaForClaim_' + count);
// }
// // Increment claim index
// console.log("claim index " + claimIndex);
// claimIndex++;
// console.log("after claim index " + claimIndex);
// if (policy_type_id == 1) {
// $('.gpaClaimFileds').show();
// $('.lifeClaimFields').hide();
// } else if (policy_type_id == 6 || policy_type_id == 7) {
// $('.gpaClaimFileds').hide();
// $('.lifeClaimFields').show();
// }
// // Initialize Select2 for the newly added fields
// $("#first_year_" + increment).select2();
// $("#claim_type_" + increment).select2();
// $("#first_cause_of_death_" + increment).select2();
// toggleRequiredFields();
// }
function appendThreeYearsClaims(count) { function appendThreeYearsClaims(count) {
// let count = $('#appendAreaForClaim').data('count'); // let count = $('#appendAreaForClaim').data('count');
@ -1847,15 +2013,46 @@
} ?> } ?>
</select> </select>
</div> </div>
<div class="form-group col-md-2"> <div class="form-group col-md-2">
<label for="first_claim_amount_${increment}">Claim/Settled Amount<span class="text-danger">*</span></label> <label for="emp_id_${increment}">Emp ID<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_claim_amount_${increment}" name="first_claim_amount[]"> <input type="text" class="form-control" id="emp_id_${increment}" name="emp_id[]">
</div> </div>
<div class="form-group col-md-2"> <div class="form-group col-md-2">
<label for="first_claim_status_${increment}">Claim Status<span class="text-danger">*</span></label> <label for="emp_name_${increment}">Employee Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_claim_status_${increment}" name="first_claim_status[]"> <input type="text" class="form-control" id="emp_name_${increment}" name="emp_name[]">
</div> </div>
<div class="form-group col-md-2 lifeClaimFields" style="display:none;">
<div class="form-group col-md-2">
<label for="gender_${increment}">Gender<span class="text-danger">*</span></label>
<select class="form-control" id="gender_${increment}" name="gender[]">
<option value="">Select Gender</option>
<option value="Female">Female</option>
<option value="Male">Male</option>
</select>
</div>
<div class="form-group col-md-2">
<label for="designation_${increment}">Designation <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="designation_${increment}" name="designation[]">
</div>
<div class="form-group col-md-2">
<label for="sum_insured_${increment}">Sum Insured <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="sum_insured_${increment}" name="sum_insured[]">
</div>
<div class="form-group col-md-2">
<label for="first_death_date_${increment}">Date of Death<span class="text-danger">*</span></label>
<div class="input-icon">
<input type="text" class="form-control death_date flatpickr-date" id="first_death_date_${increment}" name="first_death_date[]" autocomplete="off">
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
</div>
</div>
<div class="form-group col-md-2">
<label for="first_cause_of_death_${increment}">Nature/Cause Of Death <span class="text-danger">*</span></label> <label for="first_cause_of_death_${increment}">Nature/Cause Of Death <span class="text-danger">*</span></label>
<select class="form-control" id="first_cause_of_death_${increment}" name="first_cause_of_death[]"> <select class="form-control" id="first_cause_of_death_${increment}" name="first_cause_of_death[]">
<option value="">Select Cause of Death</option> <option value="">Select Cause of Death</option>
@ -1864,11 +2061,18 @@
} ?> } ?>
</select> </select>
</div> </div>
<div class="form-group col-md-2 lifeClaimFields" style="display:none;">
<label for="first_death_date_${increment}">Date of Death<span class="text-danger">*</span></label> <div class="form-group col-md-2">
<input type="text" class="form-control" id="first_death_date_${increment}" name="first_death_date[]"> <label for="first_claim_amount_${increment}">Claim/Settled Amount<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_claim_amount_${increment}" name="first_claim_amount[]">
</div> </div>
<div class="form-group col-md-2 gpaClaimFileds" style="display:none;">
<!-- <div class="form-group col-md-2">
<label for="first_claim_status_${increment}">Claim Status<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_claim_status_${increment}" name="first_claim_status[]">
</div> -->
<!-- <div class="form-group col-md-2 gpaClaimFileds" style="display:none;">
<label for="claim_type_${increment}">Claim Type<span class="text-danger">*</span></label> <label for="claim_type_${increment}">Claim Type<span class="text-danger">*</span></label>
<select class="form-control" id="claim_type_${increment}" name="claim_type[]"> <select class="form-control" id="claim_type_${increment}" name="claim_type[]">
<option value="">Select Claim Type</option> <option value="">Select Claim Type</option>
@ -1876,7 +2080,8 @@
echo "<option value='$claimType'>$claim_value</option>"; echo "<option value='$claimType'>$claim_value</option>";
} ?> } ?>
</select> </select>
</div> </div> -->
<div class="form-group col-md-2"> <div class="form-group col-md-2">
<div class="" style="position: relative; top: 28px; float: right; text-align: end;"> <div class="" style="position: relative; top: 28px; float: right; text-align: end;">
<a class="btn btn-danger waves-effect waves-light" onclick="removeClaim(this, ${count})">x</a> <a class="btn btn-danger waves-effect waves-light" onclick="removeClaim(this, ${count})">x</a>
@ -1912,10 +2117,18 @@
$("#first_year_" + increment).select2(); $("#first_year_" + increment).select2();
$("#claim_type_" + increment).select2(); $("#claim_type_" + increment).select2();
$("#first_cause_of_death_" + increment).select2(); $("#first_cause_of_death_" + increment).select2();
$("#gender_" + increment).select2();
flatpickr('.flatpickr-date', {
dateFormat: 'd-m-Y', // Example format: 11-10-2025
allowInput: true, // Allow manual typing
maxDate: 'today', // Optional: disable future dates
});
toggleRequiredFields(); toggleRequiredFields();
} }
function removeClaim(btn, count) { function removeClaim(btn, count) {
const container = document.getElementById('appendAreaForClaim_' + count); const container = document.getElementById('appendAreaForClaim_' + count);
const rows = container.querySelectorAll('.claim-row'); const rows = container.querySelectorAll('.claim-row');
@ -2039,6 +2252,10 @@
$(this).find('.form-group').each(function() { $(this).find('.form-group').each(function() {
var input = $(this).find('input, select'); var input = $(this).find('input, select');
if (input.attr('name') === "gender[]") {
return;
}
if (input.length === 0) { if (input.length === 0) {
console.warn('No input/select fields found in:', this); console.warn('No input/select fields found in:', this);
return; return;
@ -2142,6 +2359,4 @@
//----------------------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------------------
</script> </script>

View File

@ -189,7 +189,7 @@ if (isset($selected_lead_type)) {
$('#leads_form').hide() $('#leads_form').hide()
} }
function getClientAndBranchAndPolicy() { function getClientAndBranchAndPolicy(append = true) {
console.log('getClientAndBranchAndPolicy function called') console.log('getClientAndBranchAndPolicy function called')
@ -204,7 +204,9 @@ if (isset($selected_lead_type)) {
client_list = res.client_data; client_list = res.client_data;
branch_list = res.branch_data; branch_list = res.branch_data;
policy_list = res.policy_data; policy_list = res.policy_data;
if(append == true){
appendClients(res.client_data); appendClients(res.client_data);
}
} else { } else {
console.log('No data found'); console.log('No data found');
} }
@ -217,7 +219,7 @@ if (isset($selected_lead_type)) {
}); });
} }
function appendClients(data) { function appendClients(data, client_id = null) {
// console.log("lead_type",lead_type.value); // console.log("lead_type",lead_type.value);
$('#client_id').empty(); $('#client_id').empty();
@ -238,6 +240,7 @@ if (isset($selected_lead_type)) {
})); }));
$.each(data, function(index, item) { $.each(data, function(index, item) {
if(item.client_type == 1){
var option = $('<option>', { var option = $('<option>', {
value: item.id, value: item.id,
text: item.client_name, text: item.client_name,
@ -248,12 +251,17 @@ if (isset($selected_lead_type)) {
class: (item.client_type == 1) ? 'group' : (item.client_type == 2) ? 'individual' : '' class: (item.client_type == 1) ? 'group' : (item.client_type == 2) ? 'individual' : ''
}); });
if (client_id == item.id) {
option.attr('selected', true);
}
$('#client_id').append(option); $('#client_id').append(option);
}
}); });
} }
function appendBranch(data) { function appendBranch(data, branch_id = null) {
$('#client_branch_id').empty(); $('#client_branch_id').empty();
@ -268,6 +276,11 @@ if (isset($selected_lead_type)) {
value: item.id, value: item.id,
text: item.branch_name text: item.branch_name
}); });
if (branch_id == item.id) {
option.attr('selected', true);
}
$('#client_branch_id').append(option); $('#client_branch_id').append(option);
}); });
} }
@ -334,6 +347,8 @@ if (isset($selected_lead_type)) {
$("#client_short_name").val(shortName); $("#client_short_name").val(shortName);
if (client_id == 'add_client') { if (client_id == 'add_client') {
$(this).val("").select2();
// alert("Hello"); // alert("Hello");
var myModal = new bootstrap.Modal(document.getElementById('upload_enrollment_model')); var myModal = new bootstrap.Modal(document.getElementById('upload_enrollment_model'));
myModal.show(); myModal.show();
@ -378,7 +393,6 @@ if (isset($selected_lead_type)) {
} }
}); });
$('#client_branch_id').change(function() { $('#client_branch_id').change(function() {
let client_branch_id = $(this).val(); let client_branch_id = $(this).val();
@ -474,7 +488,7 @@ if (isset($selected_lead_type)) {
// -------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------
function addFileField(increment) { function addFileFieldold(increment) {
console.log('addFileField function called'); console.log('addFileField function called');
@ -519,6 +533,80 @@ if (isset($selected_lead_type)) {
fileIndex++; fileIndex++;
} }
function addFileField(increment) {
console.log('addFileField function called');
const container = document.getElementById(`multiFileAppendArea_${increment}`);
if (!container) return;
// Remove previous "+" buttons if any
// const prevAddBtns = container.querySelectorAll('.add-file-btn');
// prevAddBtns.forEach(btn => btn.remove());
const div = document.createElement("div");
div.className = "form-row d-flex align-items-end";
div.setAttribute("id", `fileField_${fileIndex}`);
let isFirstField = container.childElementCount === 0; // Check if it's the first field
let placeholder = isFirstField ? 'First file must be Demography.' : '';
let accept = isFirstField ? '.xls,.xlsx' : '';
if(selected_lead_form_type != 1){
placeholder = '';
accept = '';
}
let sample_dwn_btn = "";
if(selected_lead_form_type == 1 && isFirstField == 1){
sample_dwn_btn = `<button type="button"
class="btn app-btn-secondary float-end"
id="excel_download"
data-toggle="tooltip"
data-placement="top"
title="Download Sample Excel"
onclick="window.location.href='<?= base_url("util/download-excel/member_data"); ?>'">
Sample Excel
</button>`;
}
let add_btn = `<button type="button" class="btn app-btn-secondary mr-1 add-file-btn" onclick="addFileField(${increment})">+</button>`;
div.innerHTML = `
<div class="form-group row" id="fileField_${fileIndex}" style="width: 100%;">
<div class="col-auto" style="align-content: center;">
<label class="col-form-label">Document Name</label>
</div>
<div class="col-md-3">
<input type="text" class="form-control" name="docs_name_${increment}[]" placeholder="${placeholder}" style="background: #F5FFFF !important;">
</div>
<div class="col-auto" style="align-content: center;">
<label>File Upload </label>
</div>
<div class="col-md-3">
<div class="input-icon">
<input type="file" class="form-control" id="file_name_${fileIndex}" name="file_name_${increment}[]" accept="${accept}" style="background: #F5FFFF !important;">
<i class="mdi mdi-upload additional-icon"></i>
</div>
</div>
<div class="col-auto">
<button type="button" class="btn btn-danger mr-1" onclick="removeFileField(${fileIndex})"><span class="mdi mdi-trash-can"></span></button>
${add_btn}
${sample_dwn_btn}
</div>
</div>`;
container.appendChild(div);
fileIndex++;
}
function removeFileField(index, lead_file_id = null) { function removeFileField(index, lead_file_id = null) {
if(index == 1){ if(index == 1){

View File

@ -160,23 +160,23 @@ table.dataTable tbody td {
</div> </div>
<div> <div>
<div class="table-responsive"> <div class="table-responsive">
<table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table"> <table data-custom-table-css="table" class="table mb-0 nowrap w-100 table-centered" cellspacing="0" id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th><div class="column-header">S.No.</div></th> <th><div class="column-header">S.No&nbsp;</div></th>
<th><div class="column-header">Lead Type</div></th> <th><div class="column-header">Lead Type &nbsp;</div></th>
<th><div class="column-header">Issuer</div></th> <th><div class="column-header">Issuer &nbsp;</div></th>
<th><div class="column-header">Client Type</div></th> <th><div class="column-header">Client Type &nbsp;</div></th>
<th><div class="column-header">Client / Branch</div></th> <th><div class="column-header">Client / Branch &nbsp;</div></th>
<th><div class="column-header">Entity Type</div></th> <th><div class="column-header">Entity Type &nbsp;</div></th>
<th><div class="column-header">Branch Name</div></th> <th><div class="column-header">Branch Name &nbsp;</div></th>
<th><div class="column-header">Branch Code</div></th> <th><div class="column-header">Branch Code &nbsp;</div></th>
<th><div class="column-header">Contact Person Name</div></th> <th><div class="column-header">Contact Person Name &nbsp;</div></th>
<th><div class="column-header">Contact Person Mobile</div></th> <th><div class="column-header">Contact Person Mobile &nbsp;</div></th>
<th><div class="column-header">Policy Type</div></th> <th><div class="column-header">Policy Type &nbsp;</div></th>
<th><div class="column-header">Status</div></th> <th><div class="column-header">Status &nbsp;</div></th>
<th><div class="column-header">Action</div></th> <th><div class="column-header">Action &nbsp;</div></th>
</tr> </tr>
</thead> </thead>
@ -184,7 +184,18 @@ table.dataTable tbody td {
<?php if(isset($lead_data_list)) { ?> <?php if(isset($lead_data_list)) { ?>
<?php foreach($lead_data_list as $index => $row){ ?> <?php foreach($lead_data_list as $index => $row){ ?>
<tr> <tr>
<td><?php echo $index + 1; ?></td> <td class="text-center">
<?php echo $index + 1; ?>
<?php if($row['demography_file_status'] == "failed") { ?>
<a href="<?= base_url('util/getMemberDataExcelFileErrors?lead_id=').$row['id'] ?>"
class="mdi mdi-information-outline text-danger"
style="cursor: pointer; font-size: 16px"
data-toggle="tooltip"
data-placement="top"
title="Click to view the Demography File Error data" target="_blank">
</a>
<?php } ?>
</td>
<td><?php echo $lead_type[$row['lead_type']] ?? '-'; ?></td> <td><?php echo $lead_type[$row['lead_type']] ?? '-'; ?></td>
<td><?php echo $issuer[$row['issuer']] ?? '-'; ?></td> <td><?php echo $issuer[$row['issuer']] ?? '-'; ?></td>
<td><?php echo $client_type[$row['client_type']] ?? '-'; ?></td> <td><?php echo $client_type[$row['client_type']] ?? '-'; ?></td>
@ -215,7 +226,7 @@ table.dataTable tbody td {
</a> </a>
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>
<a class="dropdown-item btnHistory app-text-black" <a class="dropdown-item btnHistory font-color-black"
data-id="<?= $row['id']; ?>" data-id="<?= $row['id']; ?>"
title="Click to view Mail History"> title="Click to view Mail History">
<i class="mdi mdi-history mr-2 text-muted font-18 vertical-middle"></i>Email History <i class="mdi mdi-history mr-2 text-muted font-18 vertical-middle"></i>Email History
@ -244,7 +255,7 @@ table.dataTable tbody td {
<div class="modal-dialog modal-dialog-centered"> <div class="modal-dialog modal-dialog-centered">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title" id="myCenterModalLabel">Select Leaad Type</h4> <h4 class="modal-title" id="myCenterModalLabel">Select Lead Type</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
@ -421,28 +432,40 @@ document.addEventListener("DOMContentLoaded", function () {
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [ buttons: [
{
extend: 'csv',
text: 'CSV',
title: 'Policy-Tranction-Inception-List',
exportOptions: {
columns: ':not(:last-child)'
},
},
{ {
text: 'Add', text: 'Add',
className: 'buttons-html5 addbtnStyle', className: 'btn app-btn-primary mr-2',
action: function(e, dt, node, config) { action: function(e, dt, node, config) {
openLeadTypeAskModal(); openLeadTypeAskModal();
} }
},
{
extend: 'collection',
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=" btn-custom"> CSV </span>',
title: 'Policy-Tranction-Inception-List',
className: 'app-btn-primary ',
exportOptions: {
columns: ':not(:last-child)'
},
}
]
} }
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, // Enable pagination paging: true, // Enable pagination
pageLength: 25, // Set default number of rows per page (optional) pageLength: 10, // Set default number of rows per page (optional)
// ordering: false, // ordering: false,
}); });
} else { } else {
@ -501,14 +524,14 @@ document.addEventListener("DOMContentLoaded", function () {
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th><div class="column-header">S.No.</div></th> <th><div class="column-header">S.No&nbsp;</div></th>
<th><div class="column-header">From Mail</div></th> <th><div class="column-header">From Mail&nbsp;</div></th>
<th><div class="column-header">To Mail</div></th> <th><div class="column-header">To Mail&nbsp;</div></th>
<th><div class="column-header">BCC</div></th> <th><div class="column-header">BCC&nbsp;</div></th>
<th><div class="column-header">CC</div></th> <th><div class="column-header">CC&nbsp;</div></th>
<th><div class="column-header">Type</div></th> <th><div class="column-header">Type&nbsp;</div></th>
<th><div class="column-header">Status</div></th> <th><div class="column-header">Status&nbsp;</div></th>
<th><div class="column-header">Date/Time</div></th> <th><div class="column-header">Date/Time&nbsp;</div></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -36,6 +36,16 @@
color: white !important; color: white !important;
margin-right: 5px; margin-right: 5px;
} }
/* dont forgot it keep it safe card and card body space remover */ /* bcoz in design */
.card-body{ margin-top: 0px !important; }
/* this css as per design so not declare in golbal */ /* bcoz in design */
#collapseOne{
border: 1px solid #BFF3F5 !important;
border-radius: 10px !important;
border-width: 1px !important;
}
</style> </style>
@ -45,13 +55,19 @@
<div class="card-body"> <div class="card-body">
<div class="row" style="margin-bottom:1rem;"> <div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;"> <!-- <div class="col-6" style="align-self: center;">
<h4 id="page_title" style="position: relative;">Add Lead</h4> <h4 id="page_title" style="position: relative;">Add Lead</h4>
</div> </div>
<div class="col-6" style="text-align: right; position: relative;"> <div class="col-6" style="text-align: right; position: relative;">
<a href="<?= base_url('leads/list') ?>" type="button" id="btnAdd" <a href="<?= base_url('leads/list') ?>" type="button" id="btnAdd"
class="btn btn-primary waves-effect waves-light">Back</a> class="btn btn-primary waves-effect waves-light">Back</a>
</div> </div> -->
<h4 class="d-flex align-items-center" style="gap: 8px;">
<a href="<?= base_url('leads/list') ?>" style="cursor: pointer;" type="button" id="btnAdd">
<i class="mdi mdi-chevron-left" style="font-size: 43px;"></i>
</a>
<span class="title-text" id="page_title" style="position: relative;">Add Lead</span>
</h4>
</div> </div>
<form role="form" class="parsley-examples" method="post" id="leads_non_eb_form_id" <form role="form" class="parsley-examples" method="post" id="leads_non_eb_form_id"
enctype="multipart/form-data"> enctype="multipart/form-data">
@ -59,9 +75,11 @@
<input type="hidden" name="id" id="leads_primarykey"> <input type="hidden" name="id" id="leads_primarykey">
<input type="hidden" name="lead_form_type" id="lead_form_type_id" value="2"> <input type="hidden" name="lead_form_type" id="lead_form_type_id" value="2">
<div class="card" id="collapseOne">
<div class="card-body">
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="lead_type">Lead Type<span class="text-danger">*</span></label> <label for="lead_type">Lead Type<span class="text-danger">*</span></label>
<select class="form-control" id="lead_type" name="lead_type" required> <select class="form-control" id="lead_type" name="lead_type" required>
<option value="">Select Lead Type</option> <option value="">Select Lead Type</option>
@ -79,7 +97,7 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="issuer">Issuer<span class="text-danger">*</span></label> <label for="issuer">Issuer<span class="text-danger">*</span></label>
<select class="form-control" id="issuer" name="issuer" required> <select class="form-control" id="issuer" name="issuer" required>
<option value="">Select Issuer</option> <option value="">Select Issuer</option>
@ -94,29 +112,36 @@
</div> </div>
</div> </div>
</div>
</div>
<hr> <!-- <hr> --> <!-- bcoz removed in design -->
<!-- client row --> <!-- client row -->
<div class="card" id="collapseOne">
<div class="card-body">
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-3 freshFields"> <div class="form-group offset-md-10 col-md-2 freshFields" style="float:right;">
<label class="switch" style="position: relative;top: 33px;left: 0px;"> <label class="switch">
<input id="exixting_client" type="checkbox" name="exixting_client"> <input id="exixting_client" type="checkbox" name="exixting_client">
<span class="slider round" style="height: 27px;"></span> <span class="slider round" style="height: 27px;"></span>
</label> </label>
<label for="exixting_client" style="position: relative;top: 39px;left: 20px;">Existing Client</label> <label for="exixting_client" style="position: relative;top: 2px;">Existing Client</label>
</div> </div>
<div class="form-group col-md-3 renewalFields" style="display: none;"> </div>
<div class="form-row">
<div class="form-group col-md-4 renewalFields" style="display: none;">
<label for="client_id">Client<span class="text-danger">*</span></label> <label for="client_id">Client<span class="text-danger">*</span></label>
<select class="form-control" id="client_id" name="client_id"> <select class="form-control" id="client_id" name="client_id">
<option value="">Select Client</option> <option value="">Select Client</option>
</select> </select>
</div> </div>
<div class="form-group col-md-3 renewalFields" style="display: none;"> <div class="form-group col-md-4 renewalFields" style="display: none;">
<label for="client_branch_id">Branch<span class="text-danger">*</span></label> <label for="client_branch_id">Branch<span class="text-danger">*</span></label>
<select class="form-control" id="client_branch_id" name="client_branch_id" <select class="form-control" id="client_branch_id" name="client_branch_id"
onchange="getBranchData(this,1)"> onchange="getBranchData(this,1)">
@ -124,7 +149,7 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3 freshFields"> <div class="form-group col-md-4 freshFields">
<label for="client_type">Client Type<span class="text-danger">*</span></label> <label for="client_type">Client Type<span class="text-danger">*</span></label>
<select class="form-control" id="client_type" name="client_type" required> <select class="form-control" id="client_type" name="client_type" required>
<option value="">Select Client type</option> <option value="">Select Client type</option>
@ -138,7 +163,7 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3 freshFields"> <div class="form-group col-md-4 freshFields">
<label for="entity_type_id">Entity Type<span class="text-danger">*</span></label> <label for="entity_type_id">Entity Type<span class="text-danger">*</span></label>
<select class="form-control" id="entity_type_id" name="entity_type_id" required> <select class="form-control" id="entity_type_id" name="entity_type_id" required>
<option value="" selected>Select Entity</option> <option value="" selected>Select Entity</option>
@ -152,19 +177,19 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3 freshFields"> <div class="form-group col-md-4 freshFields">
<label for="client_name">Client Name<span class="text-danger">*</span></label> <label for="client_name">Client Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="client_name" name="client_name" <input type="text" class="form-control" id="client_name" name="client_name"
placeholder="Enter Client Name" required> placeholder="Enter Client Name" required>
</div> </div>
<div class="form-group col-md-3 freshFields"> <div class="form-group col-md-4 freshFields">
<label for="client_short_name">Client Short Name<span class="text-danger">*</span></label> <label for="client_short_name">Client Short Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="client_short_name" name="client_short_name" <input type="text" class="form-control" id="client_short_name" name="client_short_name"
placeholder="Enter Client Short Name" onkeyup="validateInput(this, 'clients', 'short_name')" required> placeholder="Enter Client Short Name" onkeyup="validateInput(this, 'clients', 'short_name')" required>
</div> </div>
<div class="form-group col-md-3 renewalFields" style="display: none;"> <div class="form-group col-md-4 renewalFields" style="display: none;">
<label for="source_policy_id"> Source Policy <span id="base_danger" <label for="source_policy_id"> Source Policy <span id="base_danger"
class="text-danger">*</span></label> class="text-danger">*</span></label>
<select class="form-control" id="source_policy_id" name="source_policy_id" onchange="getPolicyData(this)"> <select class="form-control" id="source_policy_id" name="source_policy_id" onchange="getPolicyData(this)">
@ -172,7 +197,7 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="pan">PAN<span class="text-danger"></span></label> <label for="pan">PAN<span class="text-danger"></span></label>
<input type="text" class="form-control" id="pan" placeholder="Enter PAN Number" <input type="text" class="form-control" id="pan" placeholder="Enter PAN Number"
data-parsley-error-message="Invalid PAN Number. Example: ABCDE1234F" name="pan" data-parsley-error-message="Invalid PAN Number. Example: ABCDE1234F" name="pan"
@ -180,14 +205,17 @@
</div> </div>
</div> </div>
</div>
</div>
<!-- end client row --> <!-- end client row -->
<!-- <hr> --> <!-- bcoz removed in design -->
<hr>
<!-- branch row--> <!-- branch row-->
<div class="card" id="collapseOne">
<div class="card-body">
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="gst">GST<span class="text-danger">*</span></label> <label for="gst">GST<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="gst" placeholder="Enter GST Number" <input type="text" class="form-control" id="gst" placeholder="Enter GST Number"
data-parsley-error-message="Invalid GST Number. Example: 12ABCDE1234F5Z6" name="gst" data-parsley-error-message="Invalid GST Number. Example: 12ABCDE1234F5Z6" name="gst"
@ -195,19 +223,19 @@
data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required> data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="client_branch">Branch Name<span class="text-danger">*</span></label> <label for="client_branch">Branch Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_name" name="branch_name" <input type="text" class="form-control" id="branch_name" name="branch_name"
placeholder="Enter Branch Name" required> placeholder="Enter Branch Name" required>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="client_branch">Branch Code<span class="text-danger">*</span></label> <label for="client_branch">Branch Code<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_code" name="branch_code" <input type="text" class="form-control" id="branch_code" name="branch_code"
placeholder="Enter Branch Code" required> placeholder="Enter Branch Code" required>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="contact_person_summary">Contact Person's</label> <label for="contact_person_summary">Contact Person's</label>
<select class="form-control" name="contact_person_summary" id="contact_person_summary"> <select class="form-control" name="contact_person_summary" id="contact_person_summary">
<option value="">Select a Person</option> <option value="">Select a Person</option>
@ -215,20 +243,20 @@
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="client_branch">Contact Person Name<span class="text-danger">*</span></label> <label for="client_branch">Contact Person Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="contact_person_name" name="contact_person_name" <input type="text" class="form-control" id="contact_person_name" name="contact_person_name"
placeholder="Enter Contact Name" required> placeholder="Enter Contact Name" required>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="contact_person_mobile">Contact Person Mobile<span <label for="contact_person_mobile">Contact Person Mobile<span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input type="text" class="form-control" id="contact_person_mobile" <input type="text" class="form-control" id="contact_person_mobile"
name="contact_person_mobile" placeholder="Enter Contact Mobile" required> name="contact_person_mobile" placeholder="Enter Contact Mobile" required>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="contact_person_email">Contact Person Email<span <label for="contact_person_email">Contact Person Email<span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input type="text" class="form-control" id="contact_person_email" <input type="text" class="form-control" id="contact_person_email"
@ -236,13 +264,17 @@
</div> </div>
</div> </div>
</div>
</div>
<hr> <!-- <hr> --> <!-- bcoz removed in design -->
<!-- policy row --> <!-- policy row -->
<div class="card" id="collapseOne">
<div class="card-body">
<div class="form-row" id="dynamic-form-container"> <div class="form-row" id="dynamic-form-container">
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="policy_type_id">Policy Type <span class="text-danger">*</span></label> <label for="policy_type_id">Policy Type <span class="text-danger">*</span></label>
<select class="form-control" id="policy_type_id" name="policy_type_id" <select class="form-control" id="policy_type_id" name="policy_type_id"
onchange="getPolicyTypeFields(this)" required> onchange="getPolicyTypeFields(this)" required>
@ -259,7 +291,7 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="insurer">Insurer <span class="text-danger"></span></label> <label for="insurer">Insurer <span class="text-danger"></span></label>
<select class="form-control" id="insurer" name="insurer"> <select class="form-control" id="insurer" name="insurer">
<option value="">Select Insurer</option> <option value="">Select Insurer</option>
@ -293,32 +325,48 @@
</select> </select>
</div> --> </div> -->
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="">Date of Commencement <span class="text-danger">*</span></label> <label for="">Date of Commencement <span class="text-danger">*</span></label>
<div class="input-icon">
<input type="text" class="form-control policy_start_date" id="policy_start_date" name="policy_start_date" <input type="text" class="form-control policy_start_date" id="policy_start_date" name="policy_start_date"
placeholder="Enter DOC" required> placeholder="Enter DOC" required>
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
</div> </div>
<div class="form-group col-md-3"> </div>
<div class="form-group col-md-4">
<label for="">Date of Expiry <span class="text-danger">*</span></label> <label for="">Date of Expiry <span class="text-danger">*</span></label>
<div class="input-icon">
<input type="text" class="form-control policy_end_date" id="policy_end_date" name="policy_end_date" <input type="text" class="form-control policy_end_date" id="policy_end_date" name="policy_end_date"
placeholder="Enter DOE" required> placeholder="Enter DOE" required>
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
</div>
</div> </div>
</div> </div>
<div id="appendArea"></div> <div id="appendArea"></div>
<div id="appendAreaForClaim"> <div id="appendAreaForClaim">
</div> </div>
<hr> <!-- <hr> --> <!-- bcoz removed in design -->
<div class="card" style="width:100%; background-color: transparent;">
<div class="card-body" style="background-color: #fff !important; border: 0px !important;">
<div id="multiFileAppendArea_1"></div> <div id="multiFileAppendArea_1"></div>
</div>
</div>
<hr> </div>
</div>
<!-- <hr> --> <!-- bcoz removed in design -->
<!-- other row --> <!-- other row -->
<div class="card" id="collapseOne">
<div class="card-body">
<div class="form-row"> <div class="form-row">
<!-- <div class="form-group col-md-3"> <!-- <div class="form-group col-md-3">
@ -327,7 +375,7 @@
<span class="text-danger" id="file_name_display"></span> <span class="text-danger" id="file_name_display"></span>
</div> --> </div> -->
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="salse_person_id">Sales Person<span class="text-danger">*</span></label> <label for="salse_person_id">Sales Person<span class="text-danger">*</span></label>
<select class="form-control" id="salse_person_id" name="salse_person_id" multiple required> <select class="form-control" id="salse_person_id" name="salse_person_id" multiple required>
<option value="">Select Sales Person</option> <option value="">Select Sales Person</option>
@ -341,7 +389,7 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="status"> Status <span id="base_danger" class="text-danger">*</span></label> <label for="status"> Status <span id="base_danger" class="text-danger">*</span></label>
<select class="form-control" id="lead_status" name="status" required> <select class="form-control" id="lead_status" name="status" required>
<option value="" selected>Select Status</option> <option value="" selected>Select Status</option>
@ -367,6 +415,8 @@
<textarea class="form-control" id="notes" name="notes" rows="4"></textarea> <textarea class="form-control" id="notes" name="notes" rows="4"></textarea>
</div> </div>
</div> </div>
</div>
</div>
<div class="form-group text-right m-b-0"> <div class="form-group text-right m-b-0">
<button type="submit" id="lead_form_submit_btn" class="btn btn-primary waves-effect waves-light mr-1">Submit</button> <button type="submit" id="lead_form_submit_btn" class="btn btn-primary waves-effect waves-light mr-1">Submit</button>

View File

@ -23,16 +23,16 @@ table.dataTable tbody td {
<table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table"> <table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th>S.No.</th> <th>S.No&nbsp;</th>
<th>Log File</th> <th>Log File&nbsp;</th>
<th>Actions</th> <th>Actions&nbsp;</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php if (!empty($logs)): ?> <?php if (!empty($logs)): ?>
<?php foreach ($logs as $index => $log): ?> <?php foreach ($logs as $index => $log): ?>
<tr> <tr>
<td><?= $index + 1 . '.' ?></td> <td class="text-center"><?= $index + 1 . '.' ?></td>
<td><?= esc($log) ?></td> <td><?= esc($log) ?></td>
<td> <td>
<a href="<?= base_url('util/view_log/' . urlencode($log)) ?>">View</a> | <a href="<?= base_url('util/view_log/' . urlencode($log)) ?>">View</a> |

View File

@ -162,3 +162,27 @@
</body> </body>
</html> </html>
<script>
document.addEventListener("DOMContentLoaded", function() {
<?php
$isLoggedIn = check_session();
$hasCookie = check_cookie();
?>
// Safely inject PHP boolean into JavaScript
let alreadyLogin = <?= ($isLoggedIn && $hasCookie) ? 'true' : 'false' ?>;
console.log(typeof alreadyLogin);
console.log(alreadyLogin);
if (!alreadyLogin) {
localStorage.clear();
console.log("Local storage cleared (no session/cookie).");
} else {
console.log("Session & cookie found, local storage kept.");
}
});
</script>

View File

@ -0,0 +1,312 @@
<!-- Client form content modal-->
<div class="modal fade" id="upload_enrollment_model" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" data-backdrop="static">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myCenterModalLabel">Add New Client</h4>
<button type="button" id="close_btn" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body" style="overflow-y: auto;height: 90vh;">
<form class="parsley-examples" method="post" id="client_form" enctype="multipart/form-data">
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-12">
<label for="client_name">Client Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="client_name" name="client_name" required>
</div>
<div class="form-group col-md-12">
<label for="short_name">Client Short name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="short_name" name="short_name" onkeyup="validateInputForClient(this, 'clients', 'short_name')" required>
</div>
<div class="form-group col-md-12">
<label for="cost_center">PAN</label>
<input type="text" class="form-control" id="pan" placeholder="Enter PAN No" name="pan" onchange="validateInputForClient(this, 'clients', 'pan')">
</div>
</div>
<hr>
<!-- Client Type -->
<div class="form-row clienttypediv" style="display: none;">
<div class="form-group col-md-6">
<label for="dob">Date of Birth<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="dob" placeholder="DD/MM/YYYY" name="dob" >
</div>
<div class="form-group col-md-6">
<label for="cost_center">Mobile<span class="text-danger"></span></label>
<input type="text" class="form-control" id="phone" placeholder="Enter Mobile Number" maxlength="10" name="phone"
onkeypress="return onlyNumbers(event)" onchange="validateInputForClient(this, 'clients', 'phone')">
</div>
<div class="form-group col-md-12">
<label for="email2">Email<span class="text-danger">*</span></label>
<input type="email" class="form-control" id="email2" placeholder="Enter Email" name="email2">
</div>
<div class="form-group col-md-12">
<label for="aadhar">Aadhar</label>
<input type="text" class="form-control" id="aadhar" placeholder="Enter Aadher No" name="aadhar" maxlength="12" onchange="validateInputForClient(this, 'clients', 'aadhar')">
</div>
</div>
<!-- branch -->
<div class="form-row branchdiv">
<div class="form-group col-md-12">
<label for="short_name">Entity Type<span class="text-danger"></span></label>
<select class="form-control" id="entity_type_id_for_client" name="entity_type_id">
<option value="" selected>Select Entity</option>
<?php
if (isset($entity) && count($entity)) {
foreach ($entity as $key => $value) {
echo "<option value=" . $value['id'] . ">" . $value['name'] . "</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-6">
<label for="client_name">Branch Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="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" name="branch_code" required>
</div>
<div class="form-group col-md-6">
<label for="branch_code">Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="name" name="name" required>
</div>
<div class="form-group col-md-6">
<label for="branch_code">Mobile<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="mobile" maxlength="10" name="mobile" onkeypress="return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-12">
<label for="email">Email<span class="text-danger">*</span></label>
<input type="email" class="form-control" id="email" placeholder="Enter Email" name="email" required>
</div>
<div class="form-group col-md-12">
<label for="gst">GST<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="gst" placeholder="Enter GST Number" oninput="validateInputForClient(this, 'client_branch', 'gst')"
data-parsley-error-message="Invalid GST Number. Example: 12ABCDE1234F5Z6" name="gst" data-parsley-trigger="change" data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required>
</div>
</div>
</div>
<div class="form-group text-right m-b-0" id="hide_smbt_btn">
<button type="submit" id="client_add_modal_submit_btn" class="btn btn-primary waves-effect waves-light mr-1 your">Submit</button>
</div>
</form>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<script>
let isGSTValidating = false;
let isGSTValid = false;
function validateInputForClient(input, table, field) {
let owner_type = $('#Owner_type').val();
let client_type = $('#client_type').val();
console.log('owner_type', owner_type);
console.log('client_type', client_type);
if((client_type == 2 || owner_type == 2) && field == 'short_name'){
return;
}
let value = $(input).val();
if (!value) return;
let label = $(input).closest('.form-group').find('label').text().replace('*', '').trim();
let message = label ? label + " already exists!" : "Value is duplicate!";
// Set validating state
isGSTValidating = true;
isGSTValid = false;
$('#hide_smbt_btn button').prop('disabled', true);
checkDuplicateTableFieldValue(table, field, value, function(isDuplicate) {
isGSTValidating = false;
if (isDuplicate) {
toastr.warning(message, 'WARNING');
// $(input).val('');
isGSTValid = false;
$('#client_add_modal_submit_btn').prop('disabled', true);
} else {
isGSTValid = true;
$('#client_add_modal_submit_btn').prop('disabled', false);
}
});
$('#hide_smbt_btn button').prop('disabled', false);
}
$("#client_form").submit(function(event) {
event.preventDefault();
// If GST is currently validating, wait for it to complete
if (isGSTValidating) {
if($('#Owner_type').val() == 1){
toastr.info('Please wait while we validate your GST number...', 'Validating');
return;
}else if ($('#client_type').val() == 1){
toastr.info('Please wait while we validate your GST number...', 'Validating');
return;
}
}
// If GST validation failed, prevent submission
if ($('#gst').val() && !isGSTValid) {
toastr.warning('Please fix the GST number before submitting', 'Validation Error');
return;
}
let form_type = $(this).data('id') || 0;
console.log('onsubmit event', this);
console.log('onsubmit event get data value',form_type);
console.log('client_type', $('#client_type').val());
event.preventDefault();
$('#aadhar').attr('data-parsley-required', 'false');
$('#aadhar').removeAttr('required');
if($('#Owner_type').val() == 2){
$('#gst').removeAttr('required');
}
var isValid = $('#client_form').parsley().validate();
if (!isValid) {
var emptyFieldIds = [];
$('#client_form').parsley().fields.forEach(function(field) {
if (!field.isValid()) {
var elem = field.$element;
var id = elem.attr('id') || elem.attr('name');
emptyFieldIds.push(id);
}
});
console.log('Empty/Invalid Fields:', emptyFieldIds);
return;
}
isClientFormSubmitting = true;
form_action = '<?= base_url("util/createClientWithMinimalData"); ?>';
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
var client_type = $('#client_type').val() || $('#Owner_type').val() || 1;
console.log('client_type:', client_type);
//FORM Data
var formData = new FormData($('#client_form')[0]);
formData.append('client_type', client_type);
console.log("formData : ",formData);
// return
$.ajax({
data:formData,
url: form_action,
type: "POST",
dataType: 'json',
processData: false,
contentType: false,
success: function(res) {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
console.log('create_Client_With_Minimal_Data', res)
if(res.status == true){
getClientAndBranchAndPolicy(res.client_id, res.branch_id);
if(form_type != 1){
setTimeout(function(){
$('#client_id').val(res.client_id).change();
$('#client_id').prepend($('<option>', {
value: 'add_client',
text: '+ Add Client'
}));
setTimeout(function(){
$('#client_branch_id').val(res.branch_id).change();
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000)
}, 3000)
}else{
console.log("Couldn't Add Client","Error");
}
toastr.success(res.message, 'Success');
}else{
toastr.error(res.message, 'Error');
}
$('#client_form')[0].reset();
$('.close').click();
if(form_type == 1){
var myModal = new bootstrap.Modal(document.getElementById('vehicle_modal'));
myModal.show();
$('#client_form').removeAttr('data-id');
// Load form data into #vehicle_form from localStorage
setFormDataFromLocalStorage("#vehicle_form", "vehicleFormData", res.client_id);
setTimeout(function(){
$('#owner').val(res.client_id).change();
$('#owner_branch').val(res.branch_id).change();
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 2000)
}
isClientFormSubmitting = false;
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
isClientFormSubmitting = false;
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}
});
});
</script>

View File

@ -57,7 +57,7 @@
<div class="form-row branchdiv"> <div class="form-row branchdiv">
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="short_name">Entity Type<span class="text-danger">*</span></label> <label for="short_name">Entity Type<span class="text-danger"></span></label>
<select class="form-control" id="entity_type_id_for_client" name="entity_type_id"> <select class="form-control" id="entity_type_id_for_client" name="entity_type_id">
<option value="" selected>Select Entity</option> <option value="" selected>Select Entity</option>
<?php <?php
@ -72,22 +72,22 @@
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="client_name">Branch Name<span class="text-danger">*</span></label> <label for="client_name">Branch Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_name" name="branch_name"> <input type="text" class="form-control" id="branch_name" name="branch_name" required>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="branch_code">Branch Code<span class="text-danger">*</span></label> <label for="branch_code">Branch Code<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_code" name="branch_code"> <input type="text" class="form-control" id="branch_code" name="branch_code" required>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="branch_code">Name<span class="text-danger">*</span></label> <label for="branch_code">Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="name" name="name"> <input type="text" class="form-control" id="name" name="name" required>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="branch_code">Mobile<span class="text-danger"></span></label> <label for="branch_code">Mobile<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="mobile" maxlength="10" name="mobile" onkeypress="return onlyNumbers(event)"> <input type="text" class="form-control" id="mobile" maxlength="10" name="mobile" onkeypress="return onlyNumbers(event)" required>
</div> </div>
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="email">Email<span class="text-danger">*</span></label> <label for="email">Email<span class="text-danger">*</span></label>
@ -113,6 +113,7 @@
</div> </div>
<script> <script>
let isGSTValidating = false; let isGSTValidating = false;
let isGSTValid = false; let isGSTValid = false;
@ -155,8 +156,6 @@
$('#hide_smbt_btn button').prop('disabled', false); $('#hide_smbt_btn button').prop('disabled', false);
} }
$("#client_form").submit(function(event) { $("#client_form").submit(function(event) {
event.preventDefault(); event.preventDefault();
@ -224,7 +223,7 @@
//FORM Data //FORM Data
var formData = new FormData($('#client_form')[0]); var formData = new FormData($('#client_form')[0]);
formData.append('client_type', client_type); formData.append('client_type', client_type);
console.log("formData : ",formData);
// return // return
$.ajax({ $.ajax({
data:formData, data:formData,
@ -235,37 +234,38 @@
contentType: false, contentType: false,
success: function(res) { success: function(res) {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
console.log('create_Client_With_Minimal_Data', res) console.log('create_Client_With_Minimal_Data', res)
if(res.status == true){ if(res.status == true){
getClientAndBranchAndPolicy(res.client_id, res.branch_id);
if(form_type != 1){ getClientAndBranchAndPolicy(false);
setTimeout(function(){ appendClients(res.clients, res.client_id);
appendBranch(res.branches, res.branch_id);
$('#client_id').val(res.client_id).change(); $('#gst').val(res.data.gst);
$('#client_id').prepend($('<option>', { $('#branch_name').val(res.data.branch_name);
value: 'add_client', $('#branch_code').val(res.data.branch_code);
text: '+ Add Client' $('#contact_person_mobile').val(res.data.mobile);
$('#contact_person_email').val(res.data.email);
$('#contact_person_summary').empty();
$('#contact_person_summary').append($('<option>', {
value: "",
text: "Select a Contact"
})); }));
setTimeout(function(){ if (res.data.name && res.data.email) {
$('#client_branch_id').val(res.branch_id).change(); // let display_value = `${res.data.name} - ${res.data.email} - ${res.data.mobile}`;
$('.loader').fadeOut(); let display_value = res.data.name;
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000) $('#contact_person_summary').append($('<option>', {
value: 0, // index or key in array/object
text: display_value,
selected: true
}));
}, 3000)
}else{
console.log("Couldn't Add Client","Error");
} }
toastr.success(res.message, 'Success'); toastr.success(res.message, 'Success');
@ -277,26 +277,9 @@
$('#client_form')[0].reset(); $('#client_form')[0].reset();
$('.close').click(); $('.close').click();
if(form_type == 1){
var myModal = new bootstrap.Modal(document.getElementById('vehicle_modal'));
myModal.show();
$('#client_form').removeAttr('data-id');
// Load form data into #vehicle_form from localStorage
setFormDataFromLocalStorage("#vehicle_form", "vehicleFormData", res.client_id);
setTimeout(function(){
$('#owner').val(res.client_id).change();
$('#owner_branch').val(res.branch_id).change();
$('.loader').fadeOut(); $('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow'); $('.loader-mask').delay(350).fadeOut('slow');
}, 2000)
}
isClientFormSubmitting = false; isClientFormSubmitting = false;
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {

View File

@ -8,10 +8,7 @@ table.dataTable tbody td {
padding: 4px 4px !important; padding: 4px 4px !important;
} }
.col-12 {
max-width: 98% !important;
}
.dataTables_filter { .dataTables_filter {
position: absolute; position: absolute;
@ -26,16 +23,18 @@ table.dataTable tbody td {
} }
</style> </style>
<div class="row" id="outstanding_filter"> <div class="container-fluid-min">
<div class="col-12" style="margin-top: -12px;"> <div class="col-12" id="outstanding_filter">
<div class="card-body">
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h5 class="m-1"> <h4 class="m-1">
<span>Filter</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
aria-expanded="true"> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> <i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h5> </h4>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body">
<div class="form-group"> <div class="form-group">
@ -55,7 +54,7 @@ table.dataTable tbody td {
</select> </select>
</div> --> </div> -->
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="addon_policy"> Insurer <span id="base_danger" <label for="addon_policy"> Insurer <span id="base_danger"
class="text-danger"></span></label> class="text-danger"></span></label>
<select class="form-control" id="insurer_id" name="insurer_id"> <select class="form-control" id="insurer_id" name="insurer_id">
@ -68,11 +67,11 @@ table.dataTable tbody td {
</select> </select>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="addon_policy"> Insurer Branch<span id="base_danger" <label for="addon_policy"> Insurer Branch<span id="base_danger"
class="text-danger"></span></label> class="text-danger"></span></label>
<select class="form-control" id="insurer_id" name="insurer_id"> <select class="form-control" id="insurer_id" name="insurer_id">
<option value="0" selected>Select Insurer</option> <option value="0" selected>Select Insurer Branch</option>
<?php if (isset($insurer) && count($insurer)) { ?> <?php if (isset($insurer) && count($insurer)) { ?>
<?php foreach ($insurer as $value) { ?> <?php foreach ($insurer as $value) { ?>
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option> <option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
@ -128,13 +127,20 @@ table.dataTable tbody td {
</select> </select>
</div> --> </div> -->
<div class="form-group col-md-3" style="display: true;" id="date_div"> <div class="form-group col-md-4" style="display: true;" id="date_div">
<label>Statement Month<span class="text-danger"></span></label> <label>Statement Month<span class="text-danger"></span></label>
<div class="input-icon">
<input type="text" id="reportrange" class="form-control" readonly style="caret-color: transparent;">
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
</div>
<!--
codeword : ***1***
if you cross check means also uncomment "star2star" (***2***)
<div id="reportrange" class="form-control" <div id="reportrange" class="form-control"
style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%"> style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
<i class="mdi mdi-calendar-blank"></i>&nbsp; <i class="mdi mdi-calendar-blank"></i>&nbsp;
<span></span> <i class="mdi mdi-menu-down"></i> <span></span> <i class="mdi mdi-menu-down"></i>
</div> </div> -->
<input type="hidden" id="startDate"> <input type="hidden" id="startDate">
<input type="hidden" id="endDate"> <input type="hidden" id="endDate">
</div> </div>
@ -152,7 +158,6 @@ table.dataTable tbody td {
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -166,22 +171,24 @@ table.dataTable tbody td {
</div> </div>
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
<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">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th>S.No</th> <th>S.No&nbsp;</th>
<!-- <th>Client Name</th> --> <!-- <th>Client Name</th> -->
<th>Insurer</th> <th>Insurer&nbsp;</th>
<th>Insurer<br> Branch</th> <th>Insurer<br> Branch&nbsp;</th>
<th>Statement<br> Month</th> <th>Statement<br> Month&nbsp;</th>
<th>Statement<br> No</th> <th>Statement<br> No&nbsp;</th>
<th>Invoice No</th> <th>Invoice No&nbsp;</th>
<th>Invoice Status</th> <th>Invoice Status&nbsp;</th>
<th>Invoice Date</th> <th>Invoice Date&nbsp;</th>
<th>Invoice Amount</th> <th>Invoice Amount&nbsp;</th>
<th>Realization <br>Amount</th> <th>Realization <br>Amount&nbsp;</th>
<th>Outstanding <br>Amount</th> <th>Outstanding <br>Amount&nbsp;</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -191,7 +198,7 @@ table.dataTable tbody td {
if (isset($outstanting_list)) { ?> if (isset($outstanting_list)) { ?>
<?php foreach ($outstanting_list as $index => $row) { ?> <?php foreach ($outstanting_list as $index => $row) { ?>
<tr> <tr>
<td><?= $index + 1 ?></td> <td class="text-center"><?= $index + 1 ?></td>
<td><?php echo $row['short_name']; ?></td> <td><?php echo $row['short_name']; ?></td>
<td><?php echo $row['branch_name']; ?></td> <td><?php echo $row['branch_name']; ?></td>
<td><?php echo change_date_format($row['month'],'Y-m-d','Y-m') ?></td> <td><?php echo change_date_format($row['month'],'Y-m-d','Y-m') ?></td>
@ -214,9 +221,10 @@ table.dataTable tbody td {
</div><!-- end col --> </div><!-- end col -->
</div> </div>
</div> </div>
</div>
<script> <script>
// Datatable document ready
$(document).ready(function() { $(document).ready(function() {
var ticketsTable = $('#scroll-horizontal-datatable'); var ticketsTable = $('#scroll-horizontal-datatable');
@ -227,14 +235,18 @@ $(document).ready(function() {
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [{ buttons: [{
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
title: 'Policy-Tranction-BDS-List', title: 'Policy-Tranction-BDS-List',
}, },
{ {
extend: 'excel', extend: 'excel',
text: 'Excel', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
title: 'Policy-Tranction-BDS-List', title: 'Policy-Tranction-BDS-List',
customize: function(xlsx) { customize: function(xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml']; var sheet = xlsx.xl.worksheets['sheet1.xml'];
@ -264,8 +276,8 @@ $(document).ready(function() {
$(sheet).find('sheetData').append(totalRow); $(sheet).find('sheetData').append(totalRow);
} }
} }
]
], }],
language: { language: {
search: "_INPUT_", search: "_INPUT_",
searchPlaceholder: "Search..." searchPlaceholder: "Search..."
@ -376,7 +388,10 @@ $(function() {
// var end = moment(); // var end = moment();
function cb(start, end) { function cb(start, end) {
$('#reportrange span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY')); // codeword : ***2***
// if you cross check means also uncomment "star1star" (***1***)
// $('#reportrange span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
$('#reportrange').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
$('#startDate').val(start.format('DD-MM-YYYY')); $('#startDate').val(start.format('DD-MM-YYYY'));
$('#endDate').val(end.format('DD-MM-YYYY')); $('#endDate').val(end.format('DD-MM-YYYY'));
} }
@ -384,11 +399,13 @@ $(function() {
$('#reportrange').daterangepicker({ $('#reportrange').daterangepicker({
startDate: start, startDate: start,
endDate: end, endDate: end,
// autoUpdateInput: false,
locale: {
format: 'DD-MM-YYYY' // 👈 force input format
},
ranges: { ranges: {
'This Month': [moment().startOf('month'), moment().endOf('month')], 'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month') 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
.endOf('month')
]
} }
}, cb); }, cb);

View File

@ -98,6 +98,22 @@
color: #000; color: #000;
} }
/** newly implemented */
#insurerTable thead th:first-child {
border-top: 0px solid #fff !important;
border-bottom: 0px solid #fff !important;
background-color: transparent !important;
}
#insurerTable tbody td {
border-top: 0px solid #fff !important;
border-bottom: 0px solid #fff !important;
background-color: transparent !important;
}
#insurerTable th{
color: black !important;
background-color: transparent !important;
}
</style> </style>
<div class="row" id="endorsement_form" style="display: none;"> <div class="row" id="endorsement_form" style="display: none;">
@ -129,15 +145,18 @@
<div class="row"> <div class="row">
<!-- Section 1 --> <!-- Section 1 -->
<div class="col-md-12"> <div class="col-md-12">
<div class="form-section"> <!-- <div class="form-section"> -->
<div id="accordion_0" class="mb-0"> <div id="accordion_0" class="mb-0">
<div class="card mb-0"> <label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
<h4 class="m-1">Client Details <span class="font-color-black">Client Details</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true"> <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h4> </label>
<div class="card mb-1">
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_0"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_0">
<div class="card-body">
<div class="row"> <div class="row">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
@ -176,6 +195,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- </div> -->
</div> </div>
</div> </div>
@ -327,15 +347,167 @@
<!-- Premium Details --> <!-- Premium Details -->
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-section"> <div id="accordion_2" class="mb-0">
<div id="accordion_3" class="mb-0"> <label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
<div class="card mb-0"> <span class="font-color-black">Endorsement</span>
<h4 class="m-1">Premium Details <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseThree"
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseFour" aria-expanded="true"> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> <i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h4> </label>
<div id="collapseFour" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_3"> <div class="card mb-1">
<div id="collapseThree" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_2">
<div class="card-body">
<div class="row">
<div class="form-group col-md-3" id="tpa_endorse_div">
<label for="tpa"> TPA <span id="tpa_danger"class="text-danger"></span></label>
<select class="form-control readonly-select" id="tpa" name="tpa" >
<option value="" selected>Select TPA</option>
<?php foreach ($tpa as $value) { ?>
<option value="<?= $value['id'] . '-' . $value['tpa_id'] ?>">
<?= $value['tpa_short_name'] . '-' . $value['branch_code'] ?>
</option>
<?php } ?>
</select>
</div>
<div class="form-group col-md-3">
<label for="addon_policy">Policy No<span id="base_danger"class="text-danger"></span></label>
<input type="text" class="form-control" id="policy_no" name="policy_no"placeholder="Enter Policy No" readonly>
</div>
<div class="form-group col-md-3">
<label for="bp_cgst">D.O.C <span id="base_danger" class="text-danger"></span></label>
<input id="policy_start_date" type="text" class="form-control" placeholder="DD/MM/YYYY" readonly>
</div>
<div class="form-group col-md-3">
<label for="bp_igst">D.O.E <span id="base_danger" class="text-danger"></span></label>
<input id="policy_end_date" type="text" class="form-control" placeholder="DD/MM/YYYY" readonly>
</div>
<div class="form-group col-md-3">
<label for="addon_policy">Policy Issue Month<span id="base_danger" class="text-danger">*</span></label>
<input type="text" class="form-control" id="month" name="month" placeholder="MM/YYYY" >
</div>
<div class="form-group col-md-3">
<label for="addon_policy"> Endorsement Type <span id="base_danger" class="text-danger">*</span></label>
<select class="form-control" id="action_type" name="action_type" required>
<option value="" selected>Select Endorsement Type</option>
<?php
if (isset($action_type) && count($action_type)) {
foreach ($action_type as $key => $value) {
echo "<option value=" . $key . ">" . $value . "</option>";
}
}
?>
</select>
</div>
<div class="form-group col-md-3">
<label for="addon_policy">Endorsement No<span id="base_danger" class="text-danger"></span></label>
<input type="text" class="form-control" id="endorsement_no" name="endorsement_no" placeholder="Enter Endorsement No" onchange="validateInput(this, 'policy_transaction', 'endorsement_no')">
</div>
<div class="form-group col-md-3">
<label for="addon_policy">Data Received Date<span id="base_danger" class="text-danger">*</span></label>
<input type="text" class="form-control" id="data_received_date" name="data_received_date" placeholder="DD/MM/YYYY" required>
</div>
<div class="form-group col-md-3">
<label for="policy_issue_date">Date of Issue<span id="base_danger" class="text-danger">*</span></label>
<input type="text" class="form-control" id="policy_issue_date" name="policy_issue_date" placeholder="DD/MM/YYYY" required>
</div>
<div class="form-group col-md-3">
<label for="endorse_eff_date">Endorsement Effective Date<span id="base_danger" class="text-danger"></span></label>
<input type="text" class="form-control" id="endorse_eff_date" name="endorse_eff_date" placeholder="DD/MM/YYYY" >
</div>
<div class="form-group col-md-3" id="no_of_insured_endorse_div">
<label for="addon_policy">No of Insured<span id="base_danger"class="text-danger"></span></label>
<input type="text" class="form-control" id="emp_count" name="emp_count" placeholder="Enter Employeee" onkeypress="return onlyNumbers(event)">
</div>
<div class="form-group col-md-3" id="no_of_dependents_endorse_div">
<label for="addon_policy">No of Dependents<span id="base_danger" class="text-danger"></span></label>
<input type="text" class="form-control" id="dependent_count" name="dependent_count" placeholder="Enter Dependent" onkeypress="return onlyNumbers(event)">
</div>
</div>
<hr>
<div class="row">
<div class="form-group col-md-3">
<label for="addon_policy"> Status <span id="base_danger"class="text-danger">*</span></label>
<select class="form-control" id="policy_status" name="status" required>
<option value="" selected>Select Status</option>
<?php
if (isset($policy_status) && count($policy_status)) {
foreach ($policy_status as $key => $value) {
if($key == 'pending'){
echo "<option value=" . $key . " selected>" . $value . "</option>";
}else{
echo "<option value=" . $key . ">" . $value . "</option>";
}
}
}
?>
</select>
</div>
<div class="form-group col-md-3">
<label for="last_action_date">Latest Action Date</label>
<input id="last_action_date" type="text" class="form-control" name="last_action_date" placeholder="DD/MM/YYYY">
</div>
<div class="form-group col-md-3 install_due_date_div" style="display: none;">
<label for="install_due_date">Installment due Date</label>
<input id="install_due_date" type="text" class="form-control" name="install_due_date" placeholder="DD/MM/YYYY">
</div>
<!-- <div class="form-group col-md-3">
<label class="switch" style="position: relative;top: 32px;left: 20px;">
<input id="policy_with_corr" type="checkbox" name="policy_with_corr">
<span class="slider round" style="height: 27px;"></span>
</label>
<label for="policy_with_corr" style="position: relative;top: 33px;left: 25px;"> Policy with Correction</label>
</div> -->
<!-- <div class="form-group col-md-3">
<label class="switch" style="position: relative;top: 32px;left: 20px;">
<input id="is_cd_reduce_from_bds" type="checkbox" name="is_cd_reduce_from_bds">
<span class="slider round" style="height: 27px;"></span>
</label>
<label for="is_cd_reduce_from_bds" style="position: relative;top: 33px;left: 25px;">Make Entry in CD &nbsp;&nbsp; <i class="mdi mdi-information-outline" data-toggle="tooltip" title="Enabling this will affect ( Credit/Debit ) the CD transaction. ( GMC, GPA, EDLI and GTLI, CD transaction from CRM )"></i></label>
</div> -->
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Premium Details -->
<div class="col-md-12">
<!-- <div class="form-section"> -->
<div id="accordion_3" class="mb-0">
<label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
<span class="font-color-black">Premium Details</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseTwo"
aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
</a>
</label>
<div class="card mb-0">
<div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_3">
<div class="card-body">
<div class="row d-none" id="add_more_row"> <div class="row d-none" id="add_more_row">
<div class="col-md-2"> <div class="col-md-2">
<input type="number" id="setInsurerCount" class="form-control" placeholder="Enter count"> <input type="number" id="setInsurerCount" class="form-control" placeholder="Enter count">
@ -349,10 +521,10 @@
</div> </div>
<div id="insurerTableContainer" style="overflow: auto;"> <div id="insurerTableContainer" style="overflow: auto;">
<table data-custom-table-css="table" class="table table-bordered co_share_table" id="insurerTable"> <table data-custom-table-css="table" class="table co_share_table" id="insurerTable">
<thead> <thead>
<tr> <tr>
<th>Premium Details</th> <th><span class="font-color-black">Premium Details</span></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -497,16 +669,13 @@
</div> </div>
</div> </div>
</div> </div>
</div> <!-- </div> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div> </div>
<div class="form-group text-right m-b-0" id="submitButton"> </div>
<div class="form-group text-right mt-3 m-b-0" id="submitButton">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button> <button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
</div> </div>
@ -1713,8 +1882,10 @@ function addInsurerColumn() {
// Update header // Update header
$('#insurerTable thead tr').append(` $('#insurerTable thead tr').append(`
<th> <th>
<span style="display:flex; justify-content:space-between; align-items:center;">
Insurer ${insurerCount} Insurer ${insurerCount}
${insurerCount > 1 ? `<a class="text-danger mdi mdi-delete delete-insurer" data-count="${insurerCount}" style="margin-left: 135px;"></a>` : ''} ${insurerCount > 1 ? `<a class="text-danger mdi mdi-delete delete-insurer" data-count="${insurerCount}" style="margin-left: 135px;"></a>` : ''}
</span>
</th> </th>
`); `);

View File

@ -7,22 +7,21 @@
table.dataTable tbody td { table.dataTable tbody td {
padding: 4px 4px !important; padding: 4px 4px !important;
} }
/* /*
table.dataTable thead th { table.dataTable thead th {
padding: 4px 4px !important; padding: 4px 4px !important;
} */ } */
.col-12 {
max-width: 98% !important;
}
.dataTables_filter { .dataTables_filter {
position: absolute; position: absolute;
} }
.column-header { .column-header {
margin-right: 10px; /* Adjust this value as needed */ margin-right: 10px;
/* Adjust this value as needed */
} }
.form-section { .form-section {
@ -36,7 +35,8 @@ table.dataTable thead th {
padding: 10px; padding: 10px;
margin-bottom: 10px; margin-bottom: 10px;
} }
custom-dropdown-menu {
.custom-dropdown-menu {
display: none; display: none;
position: fixed; position: fixed;
background-color: #ffffff !important; background-color: #ffffff !important;
@ -102,7 +102,6 @@ custom-dropdown-menu {
z-index: -2; z-index: -2;
pointer-events: none; pointer-events: none;
} }
</style> </style>
<style> <style>
@ -167,16 +166,18 @@ custom-dropdown-menu {
} }
</style> </style>
<div class="row" id="endorsement_filter"> <div class="container-fluid-min">
<div class="col-12" style="margin-top: -12px;"> <div class="col-12" id="endorsement_filter">
<div class="card-body">
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h5 class="m-1"> <h4 class="m-1">
<span>Filter</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
aria-expanded="true"> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> <i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h5> </h4>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body"> <div class="card-body">
<div class="form-group"> <div class="form-group">
@ -275,36 +276,34 @@ custom-dropdown-menu {
<input type="hidden" id="endDate"> <input type="hidden" id="endDate">
</div> </div>
</div>
<div class="form-group col-md-3 text-right m-b-0" style="margin-top: 29px;"> <div class="form-group text-right m-b-0">
<a href="<?= base_url("/policy_tranction/endorsement/list"); ?>" class="btn btn-secondary" id="clear-filters">Clear</a> <a href="<?= base_url("/policy_tranction/endorsement/list"); ?>" class="btn btn-secondary" id="clear-filters">Clear</a>
<a href="<?= base_url("/policy_tranction/endorsement/list"); ?>" class="btn btn-primary" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a> <a href="<?= base_url("/policy_tranction/endorsement/list"); ?>" class="btn btn-primary" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a>
</div> </div>
</div> </div>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="row" id="endorsement_list"> </div>
<div class="col-12"> </div>
</div>
<div class="col-12" id="endorsement_list">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row" style="margin-bottom:1rem;"> <!-- <div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Endorsement List</h4> <h4 style="position: relative;">Endorsement List</h4>
</div> </div>
<div class="col-3" id="status_change" style="text-align: right; position: relative;top: 56px; left: 291px;"> <div class="col-3">
<button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" onclick="hide_list_show_add()">Add</button> <button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" onclick="hide_list_show_add()">Add</button>
</div> </div>
</div> </div> -->
<div>
<table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table"> <table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
@ -327,37 +326,39 @@ custom-dropdown-menu {
<tbody> <tbody>
<?php foreach ($endorsement_data_list as $index => $row) { ?> <?php foreach ($endorsement_data_list as $index => $row) { ?>
<tr> <tr>
<td><?php echo $index+1; ?></td> <td class="text-center"><?php echo $index + 1; ?></td>
<td><?php echo $issuer[$row['issuer']] ?? ''; ?></td> <td><?php echo $issuer[$row['issuer']] ?: 'N/A'; ?></td><!-- Issuer -->
<td><?php echo $row['client_short_name']; ?></td> <td><?php echo $row['client_short_name'] ?: 'N/A'; ?></td><!-- Client -->
<td><?php echo $row['client_branch_name']; ?></td> <td><?php echo $row['client_branch_name'] ?: 'N/A'; ?></td><!-- Branch -->
<td><?php echo $row['insurer_short_name']; ?></td> <td><?php echo $row['insurer_short_name'] ?: 'N/A'; ?></td><!-- Insurer -->
<td><?php echo $row['policy_type']; ?></td> <td><?php echo $row['policy_type'] ?: 'N/A'; ?></td><!-- Policy -->
<td><?php echo $action_type[$row['action_type']]; ?></td> <td><?php echo $action_type[$row['action_type']] ?: 'N/A';?></td>
<td><?php echo $row['endorsement_no']; ?></td> <td><?php echo $row['endorsement_no'] ?: 'N/A'; ?></td>
<td><?php echo empty($row['data_received_date']) ? '' : date('d/m/Y', strtotime($row['data_received_date'])); ?></td> <td><?php echo empty($row['data_received_date']) ? 'N/A' : date('d/m/Y', strtotime($row['data_received_date'])); ?></td>
<td class="right-align-input"><?php echo $row['emp_count']; ?></td> <td class="right-align-input"><?php echo $row['emp_count'] ?: '0'; ?></td>
<td class="right-align-input"><?php echo $row['dependent_count']; ?></td> <td class="right-align-input"><?php echo $row['dependent_count'] ?: '0'; ?></td>
<td><?php echo empty($row['policy_issue_date']) ? '' : date('d/m/Y', strtotime($row['policy_issue_date'])); ?></td> <td><?php echo empty($row['policy_issue_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_issue_date'])); ?></td>
<td><?php echo $policy_status[$row['status']]; ?></td> <td><?php echo $policy_status[$row['status']] ?: 'N/A'; ?></td>
<td> <td>
<div class="btn-group dropdown"> <div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a> <a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right"> <div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item btnEdit" data-id="<?= $row['id'];?>" onclick="getPolicyTransactionDataForEndorsementEdit('<?= htmlspecialchars($row['id'], ENT_QUOTES) ?>')"> <i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a> <a class="dropdown-item btnEdit" data-id="<?= $row['id']; ?>" onclick="getPolicyTransactionDataForEndorsementEdit('<?= htmlspecialchars($row['id'], ENT_QUOTES) ?>')">
<i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit
</a>
</div> </div>
</div> </div>
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>
</tbody> </tbody>
</table> </table><!-- table -->
</div> </div><!-- card-body -->
</div> </div><!-- card -->
</div>
</div><!-- end col --> </div><!-- end col -->
</div> </div>
<!-- end table row --> <!-- end table row -->
<?php include('policy_transaction_endorsement_form.php'); ?> <?php include('policy_transaction_endorsement_form.php'); ?>
@ -441,10 +442,8 @@ document.addEventListener("DOMContentLoaded", function () {
} }
}); });
}); });
</script> </script>
<script> <script>
var client_list = ''; var client_list = '';
var branch_list = ''; var branch_list = '';
var policy_list = <?= json_encode($endorsementPolicies) ?>; var policy_list = <?= json_encode($endorsementPolicies) ?>;
@ -488,28 +487,50 @@ document.addEventListener("DOMContentLoaded", function () {
if (ticketsTable.length) { if (ticketsTable.length) {
ticketsTable.DataTable({ ticketsTable.DataTable({
scrollX: true, scrollX: true,
dom: "<'row'<'col-sm-6'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-1'f><'col-sm-11 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [{ buttons: [
{
text: '<i class="mdi mdi-plus" ></i><span class=" btn-custom"> Add </span>',
className: 'btn app-btn-primary mr-2',
action: function (e, dt, node, config) {
hide_list_show_add();
},
attr: { id: 'btnAdd' }
},
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [
{
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
title: 'Policy-Tranction-Endorsement-List', title: 'Policy-Tranction-Endorsement-List',
exportOptions: { exportOptions: {
columns: ':not(:last-child)' columns: ':not(:last-child)'
}, },
}], }
]
}
],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, // Enable pagination paging: true, // Enable pagination
pageLength: 25, // Set default number of rows per page (optional) pageLength: 10, // Set default number of rows per page (optional)
ordering: false, ordering: false,
}); });
} else { } else {
console.error("Table not found."); console.error("Table not found.");
} }
$('#btnAdd').wrap('<div id="status_change"></div>');
}); });
// Date document ready // Date document ready
@ -573,8 +594,7 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
function hide_list_show_add() function hide_list_show_add() {
{
removeAllColumnsExceptFirst('insurerTable'); removeAllColumnsExceptFirst('insurerTable');
$('.hideter').hide() $('.hideter').hide()
$('.hidetp').hide() $('.hidetp').hide()
@ -588,16 +608,14 @@ document.addEventListener("DOMContentLoaded", function () {
$('#invoice_no').attr('required', false) $('#invoice_no').attr('required', false)
} }
function show_list_hide_add() function show_list_hide_add() {
{
$('#endorsement_form').hide() $('#endorsement_form').hide()
$('#endorsement_list').show() $('#endorsement_list').show()
$('#endorsement_filter').show() $('#endorsement_filter').show()
} }
function getClientAndBranchAndPolicy() function getClientAndBranchAndPolicy() {
{
$.ajax({ $.ajax({
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>', url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
type: "GET", type: "GET",
@ -625,8 +643,7 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
} }
function appendClients(data) function appendClients(data) {
{
$('#client_id').empty(); $('#client_id').empty();
$('#client_id').append($('<option>', { $('#client_id').append($('<option>', {
@ -653,8 +670,7 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
} }
function appendBranch(data) function appendBranch(data) {
{
$('#client_branch_id').empty(); $('#client_branch_id').empty();
@ -673,8 +689,7 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
} }
function appendPolicies(data) function appendPolicies(data) {
{
if (!data) { if (!data) {
toastr.warning("There are no policies in Inception for the selected client and branch."); toastr.warning("There are no policies in Inception for the selected client and branch.");
@ -709,8 +724,7 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
} }
function logSelectedIds() function logSelectedIds() {
{
var selectedIds = []; var selectedIds = [];
$('.row-select:checked').each(function() { $('.row-select:checked').each(function() {
selectedIds.push($(this).data('id')); selectedIds.push($(this).data('id'));
@ -801,12 +815,10 @@ document.addEventListener("DOMContentLoaded", function () {
} }
}) })
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
getURLParams() getURLParams()
$('#client_id_for_search').select2(); $('#client_id_for_search').select2();
@ -814,8 +826,7 @@ $(document).ready(function() {
$('#policy_type_for_search').select2(); $('#policy_type_for_search').select2();
}) })
function fetchEmpolyeeList(event) function fetchEmpolyeeList(event) {
{
event.preventDefault(); // Prevent default action event.preventDefault(); // Prevent default action
var start_date = $('#startDate').val(); var start_date = $('#startDate').val();
@ -848,13 +859,11 @@ function fetchEmpolyeeList(event)
window.location.href = apiURL; window.location.href = apiURL;
} }
function objectToQueryString(obj) function objectToQueryString(obj) {
{
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&'); return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
} }
function getURLParams() function getURLParams() {
{
const url = new URL(window.location.href); const url = new URL(window.location.href);
const params = new URLSearchParams(url.search); const params = new URLSearchParams(url.search);
@ -923,6 +932,9 @@ $(function() {
$('#reportrange').daterangepicker({ $('#reportrange').daterangepicker({
startDate: start, startDate: start,
endDate: end, endDate: end,
locale: {
format: 'DD-MM-YYYY'
},
ranges: { ranges: {
'Today': [moment(), moment()], 'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
@ -953,8 +965,7 @@ $(function() {
}); });
function hideDateField(input = null) function hideDateField(input = null) {
{
let val = $('#date_type').val(); let val = $('#date_type').val();
if (input) { if (input) {
@ -967,5 +978,4 @@ function hideDateField(input = null)
$('#date_div').hide() $('#date_div').hide()
} }
} }
</script> </script>

View File

@ -141,6 +141,22 @@
font-size: 24px; font-size: 24px;
} }
/** newly implemented */
#insurerTable thead th:first-child {
border-top: 0px solid #fff !important;
border-bottom: 0px solid #fff !important;
background-color: transparent !important;
}
#insurerTable tbody td {
border-top: 0px solid #fff !important;
border-bottom: 0px solid #fff !important;
background-color: transparent !important;
}
#insurerTable th{
color: black !important;
background-color: transparent !important;
}
</style> </style>
<div class="tab-pane fade active show" id="form"> <div class="tab-pane fade active show" id="form">
@ -184,15 +200,18 @@
<div class="row"> <div class="row">
<!-- Section 1 --> <!-- Section 1 -->
<div class="col-md-12"> <div class="col-md-12">
<div class="form-section">
<div id="accordion_0" class="mb-0"> <div id="accordion_0" class="mb-0">
<div class="card mb-0"> <label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
<h4 class="m-1">Client Details <span class="font-color-black">Client Details</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true"> <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h4> </label>
<div class="card mb-1">
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_0"> <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_0">
<div class="card-body">
<div class="row"> <div class="row">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="email"> Policy Type <span class="text-danger">*</span></label> <label for="email"> Policy Type <span class="text-danger">*</span></label>
@ -284,12 +303,12 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row" id="vehicle_row_div"> <div class="row" id="vehicle_row_div">
</div> </div>
<!-- Client Section --> <!-- Client Section -->
<div class="row" id="client_row_div"> <div class="row" id="client_row_div">
</div> </div>
@ -297,16 +316,18 @@
<!-- Pre sales Row --> <!-- Pre sales Row -->
<div class="row" id="pre_sales_row"> <div class="row" id="pre_sales_row">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-section">
<div id="accordion_1" class="mb-0">
<div class="card mb-0">
<h4 class="m-1">Pre Sales
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseTwo" aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
</a>
</h4>
<div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_1">
<div id="accordion_1" class="mb-0">
<label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
<span class="font-color-black">Pre Sales</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseTwo"
aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
</a>
</label>
<div class="card mb-1">
<div id="collapseTwo" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_1">
<div class="card-body">
<div class="row" id="policyholdernamediv" style="display: none;"> <div class="row" id="policyholdernamediv" style="display: none;">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="bp_igst">Policyholder Name</label> <label for="bp_igst">Policyholder Name</label>
@ -498,21 +519,25 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- sales Row --> <!-- sales Row -->
<div class="row" id="sales_row" style="display: none;"> <div class="row" id="sales_row" style="display: none;">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-section">
<div id="accordion_2" class="mb-0"> <div id="accordion_2" class="mb-0">
<div class="card mb-0"> <label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
<h4 class="m-1">Sales <span class="font-color-black">Sales</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseThree" aria-expanded="true"> <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseThree"
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h4> </label>
<div class="card mb-1">
<div id="collapseThree" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_2"> <div id="collapseThree" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_2">
<div class="card-body">
<div class="row"> <div class="row">
<div class="form-group col-md-3" id="base_policy_id" style="display: none;"> <div class="form-group col-md-3" id="base_policy_id" style="display: none;">
@ -652,20 +677,27 @@
</div> </div>
</div> </div>
<hr> </div>
</div>
</div>
</div> <!-- accordion_2 div closed here -->
</div><!-- 1st col-md-12 div closed here -->
<!-- Premium Details --> <!-- Premium Details -->
<div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-section">
<div id="accordion_3" class="mb-0"> <div id="accordion_3" class="mb-0">
<div class="card mb-0"> <label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
<h4 class="m-1">Premium Details <span class="font-color-black">Premium Details</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseFour" aria-expanded="true"> <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseFour"
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
</a> </a>
</h4> </label>
<div class="card mb-0">
<div id="collapseFour" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_3"> <div id="collapseFour" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_3">
<div class="card-body">
<div class="row d-none" id="add_more_row"> <div class="row d-none" id="add_more_row">
<div class="col-md-2"> <div class="col-md-2">
<!-- <label for="setInsurerCount">Insurer Count : </label> --> <!-- <label for="setInsurerCount">Insurer Count : </label> -->
@ -681,7 +713,7 @@
</div> </div>
<div id="insurerTableContainer" style="overflow: auto;"> <div id="insurerTableContainer" style="overflow: auto;">
<table data-custom-table-css="table" class="table table-bordered co_share_table" id="insurerTable"> <table data-custom-table-css="table" class="table co_share_table" id="insurerTable">
<thead> <thead>
<tr> <tr>
<th>Premium Details</th> <th>Premium Details</th>
@ -821,22 +853,18 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div> <!-- insurerTableContainer div closed here-->
</div> </div>
</div> <!-- collapseFour div closed here -->
</div> </div>
</div> </div> <!-- accordion_3 div closed here -->
</div> </div> <!-- 2nd col-md-12 closed here -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="form-group text-right m-b-0" id="submitButton"> </div> <!-- sales_row div closed here -->
<div class="form-group text-right mt-1 m-b-0" id="submitButton">
<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> id="btnSubmit">Submit</button>
</div> </div>
@ -4089,8 +4117,10 @@
// Update header // Update header
$('#insurerTable thead tr').append(` $('#insurerTable thead tr').append(`
<th> <th>
<span style="display:flex; justify-content:space-between; align-items:center;">
Insurer ${insurerCount} Insurer ${insurerCount}
${insurerCount > 1 ? `<a data-count="${insurerCount}" class="text-danger mdi mdi-delete delete-insurer" style="margin-left: 135px;"></a>` : ''} ${insurerCount > 1 ? `<a data-count="${insurerCount}" class="text-danger mdi mdi-delete delete-insurer" style="margin-left: 135px;"></a>` : ''}
</span>
</th> </th>
`); `);

View File

@ -146,10 +146,11 @@ table.dataTable tbody td {
</style> </style>
<div class="row" id="inception_filter"> <div class="row" id="inception_filter">
<div class="col-12" style="margin-top: -12px;"> <div class="col-12">
<div id="accordion" class="mb-3"> <div id="accordion" class="mb-3">
<div class="card mb-1"> <div class="card mb-1">
<h4 class="m-1"> <h4 class="m-1">
<span>Filter</span>
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" <a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
aria-expanded="true"> aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i> <i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
@ -256,7 +257,11 @@ table.dataTable tbody td {
<input type="hidden" id="endDate"> <input type="hidden" id="endDate">
</div> </div>
<div class="form-group col-md-3 text-right m-b-0" style="margin-top: 29px;">
</div>
<div class="form-row">
<div class="form-group col-md-12 text-right m-b-0">
<a href="<?= base_url("/policy_tranction/inception/list"); ?>" class="btn btn-secondary" id="clear-filters">Clear</a> <a href="<?= base_url("/policy_tranction/inception/list"); ?>" class="btn btn-secondary" id="clear-filters">Clear</a>
<a href="<?= base_url("/policy_tranction/inception/list"); ?>" class="btn btn-primary" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a> <a href="<?= base_url("/policy_tranction/inception/list"); ?>" class="btn btn-primary" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a>
</div> </div>
@ -309,21 +314,21 @@ table.dataTable tbody td {
<tbody> <tbody>
<?php foreach($inception_data_list as $index => $row){ ?> <?php foreach($inception_data_list as $index => $row){ ?>
<tr> <tr>
<td><?php echo $index+1; ?></td> <td class="text-center"><?php echo $index+1; ?></td>
<td><?php echo $issuer[$row['issuer']]; ?></td> <td><?php echo $issuer[$row['issuer']]; ?></td>
<td><?php echo $issuing_type[$row['issue_type']]; ?></td> <td><?php echo $issuing_type[$row['issue_type']] ?: 'N/A'; ?></td>
<td><?php echo $client_type[$row['client_type']] ?? '-'; ?></td> <td><?php echo $client_type[$row['client_type']] ?? 'N/A'; ?></td>
<td><?php echo $row['client_type'] == 2 ? $row['client_name'] . " - " . (!empty($row['pan']) ? $row['pan'] : 'N/A') : $row['client_short_name'] . ' - ' . $row['client_branch_name']; ?></td> <td><?php echo $row['client_type'] == 2 ? $row['client_name'] . " - " . (!empty($row['pan']) ? $row['pan'] : 'N/A') : $row['client_short_name'] . ' - ' . $row['client_branch_name']; ?></td>
<td><?php echo $row['insurer_short_name']; ?></td> <td><?php echo $row['insurer_short_name'] ?: 'N/A'; ?></td>
<td><?php echo $row['policy_type']; ?></td> <td><?php echo $row['policy_type'] ?: 'N/A'; ?></td>
<td><?php echo $row['policy_no']; ?></td> <td><?php echo $row['policy_no'] ?: 'N/A'; ?></td>
<td><?php echo empty($row['policy_issue_date']) ? '' : date('d/m/Y', strtotime($row['policy_issue_date'])); ?></td> <td><?php echo empty($row['policy_issue_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_issue_date'])); ?></td>
<td><?php echo empty($row['policy_issue_date']) ? '' : date('d/m/Y', strtotime($row['policy_start_date'])); ?></td> <td><?php echo empty($row['policy_issue_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_start_date'])); ?></td>
<td><?php echo empty($row['policy_issue_date']) ? '' : date('d/m/Y', strtotime($row['policy_end_date'])); ?></td> <td><?php echo empty($row['policy_issue_date']) ? 'N/A' : date('d/m/Y', strtotime($row['policy_end_date'])); ?></td>
<td class="right-align-input"><?php echo $row['emp_count']; ?></td> <td class="right-align-input"><?php echo $row['emp_count'] ?: '0'; ?></td>
<td class="right-align-input"><?php echo $row['dependent_count']; ?></td> <td class="right-align-input"><?php echo $row['dependent_count'] ?: '0'; ?></td>
<td><?php echo $policy_status[$row['status']]; ?></td> <td><?php echo $policy_status[$row['status']] ?: 'N/A'; ?></td>
<td><?php echo $row['user_name']; ?></td> <td><?php echo $row['user_name'] ?: 'N/A'; ?></td>
<td> <td>
<div class="btn-group dropdown"> <div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a> <a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
@ -556,33 +561,44 @@ $(document).ready(function() {
if (ticketsTable.length) { if (ticketsTable.length) {
ticketsTable.DataTable({ ticketsTable.DataTable({
scrollX: true, scrollX: true,
dom: "<'row'<'col-sm-7'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-1'f><'col-sm-11 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [
{
text: '<i class="mdi mdi-plus" ></i><span class=" btn-custom"> Add </span>',
className: 'btn app-btn-primary mr-2',
action: function (e, dt, node, config) {
hide_list_show_add();
}
},
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [ buttons: [
{ {
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'Policy-Tranction-Inception-List', title: 'Policy-Tranction-Inception-List',
exportOptions: { exportOptions: {
columns: ':not(:last-child)' columns: ':not(:last-child)'
}, },
},
{
text: 'Add',
className: 'buttons-html5 addbtnStyle',
action: function (e, dt, node, config) {
hide_list_show_add();
} }
]
} }
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true, // Enable pagination paging: true, // Enable pagination
pageLength: 25, // Set default number of rows per page (optional) pageLength: 10, // Set default number of rows per page (optional)
// ordering: false, // ordering: false,
}); });
} else { } else {

View File

@ -66,6 +66,8 @@
pointer-events: none; pointer-events: none;
} }
</style> </style>
<div class="container-fluid-min">
<div class="row" id="policy_list"> <div class="row" id="policy_list">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
@ -78,11 +80,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> <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> --> </div> -->
<div class="row" style="margin-bottom:1rem;"> <!-- <div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;"> <div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Policy</h4> <h4 style="position: relative;">Policy</h4>
</div> </div>
</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" <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"> id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
@ -99,11 +101,11 @@
<tbody> <tbody>
<?php if(is_array($policyList)) {foreach($policyList as $row){ ?> <?php if(is_array($policyList)) {foreach($policyList as $row){ ?>
<tr> <tr>
<td><?php echo $row['policy_type']; ?> </td> <td><?php echo $row['policy_type'] ?: 'N/A'; ?> </td>
<td><?php echo $row['long_name']; ?> </td> <td><?php echo $row['long_name'] ?: 'N/A'; ?> </td>
<td><?php echo $row['bap']; ?></td> <td><?php echo $row['bap'] ?: 'N/A'; ?></td>
<td><?php echo $row['allocg']; ?></td> <td><?php echo $row['allocg'] ?: 'N/A'; ?></td>
<td><?php echo $row['alloci']; ?></td> <td><?php echo $row['alloci'] ?: 'N/A'; ?></td>
<td> <td>
<div class="btn-group dropdown"> <div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a> <a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
@ -122,6 +124,8 @@
</div> </div>
</div><!-- end col --> </div><!-- end col -->
</div> </div>
</div>
<!-- end row --> <!-- end row -->
<script> <script>
@ -210,30 +214,51 @@ document.addEventListener("DOMContentLoaded", function () {
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
$('#tickets-table').DataTable({ $('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" + dom: "<'row'<'col-12 d-flex justify-content-between align-items-center'<'datatable-search dataTables_filter'f><'datatable-buttons dt-buttons'B>>>" +
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
// buttons: [
// {
// extend: 'csv',
// text: 'CSV',
// title: 'PolicyTypeList',
// exportOptions: {
// columns: ':not(:last-child)'
// }
// }
// ],
buttons: [
{
extend: 'collection',
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
className: 'btn app-btn-secondary ',
buttons: [ buttons: [
{ {
extend: 'csv', extend: 'csv',
text: 'CSV', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
className: 'app-btn-primary ',
title: 'PolicyTypeList', title: 'PolicyTypeList',
exportOptions: { exportOptions: {
columns: ':not(:last-child)' columns: ':not(:last-child)'
} }
} }
]
}
], ],
language: { language: {
search: "_INPUT_", search: `
searchPlaceholder: "Search..." <div class="datatable-search-wrapper">
_INPUT_
<i class="mdi mdi-magnify datatable-search-icon"></i>
</div>`,
searchPlaceholder: "Search"
}, },
paging: true , paging: true ,
}); });
}) })
@ -244,7 +269,9 @@ const tableElement = document.querySelector("#tickets-table");
btnExport.addEventListener("click", () => { btnExport.addEventListener("click", () => {
const obj = new csvExport(tableElement); const obj = new csvExport(tableElement);
const csvData = obj.exportCsv(); const csvData = obj.exportCsv();
const blob = new Blob([csvData], { type: "text/csv" }); const blob = new Blob([csvData], {
type: "text/csv"
});
const url = URL.createObjectURL(blob); const url = URL.createObjectURL(blob);
const a = document.createElement("a"); const a = document.createElement("a");
a.href = url; a.href = url;
@ -341,7 +368,4 @@ function removePolciyType(element) {
}); });
} }
</script> </script>

Some files were not shown because too many files have changed in this diff Show More