MERGE_TEST_HR_MULTI_ENTITY_SUPPORT&SMS_OTP&LIVE_ISSUES
This commit is contained in:
commit
48a8f4eef3
@ -101,6 +101,6 @@ class Autoload extends AutoloadConfig
|
||||
* @phpstan-var list<string>
|
||||
*/
|
||||
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'
|
||||
];
|
||||
}
|
||||
|
||||
@ -90,11 +90,13 @@ $routes->group("/dashboard", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->group("/client", ["filter" => "authMVC"], function ($routes) {
|
||||
|
||||
$routes->get("list", "ClientController::index");
|
||||
$routes->get("type/(:any)", "ClientController::type/$1");
|
||||
$routes->get("create", "ClientController::clientOnboarding");
|
||||
$routes->get('deposit/(:num)', 'ClientController::deposit/$1');
|
||||
$routes->get('remove/(:num)', 'ClientController::removeClient/$1');
|
||||
$routes->get("list/(:any)", "ClientController::editClientOnboarding/$1");
|
||||
$routes->post('wipe', 'ClientController::wipeDemoClient');
|
||||
$routes->get("typeList/(:any)", "ClientController::typeList/$1");
|
||||
|
||||
// application/config/routes.php
|
||||
|
||||
@ -124,6 +126,8 @@ $routes->group("/client", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->post("edit", "ClientController::editClientBranch");
|
||||
$routes->get("list/(:any)", "ClientController::getSingleBranchDataById/$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) {
|
||||
@ -168,6 +172,7 @@ $routes->group("/client", ["filter" => "authMVC"], function ($routes) {
|
||||
|
||||
$routes->group("others", ["filter" => "authMVC"], function ($routes) {
|
||||
$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("claim_dump_excel_error/(:any)", "TicketController::getClaimDumpExcelFileErrors/$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");
|
||||
@ -516,6 +527,7 @@ $routes->post("employeeRest/updateMpin", "RestAuthenticationController::updateMp
|
||||
$routes->post("employeeRest/getPostEmployeeDataForAuth", "RestAuthenticationController::getPostEmployeeDataForAuth");
|
||||
// $routes->post("logHrActivity", "RestAuthenticationController::logHrActivity");
|
||||
|
||||
$routes->get("employeeRest/getClientDetails", "EmployeeRestController::getClientDetails");
|
||||
|
||||
$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("getEmployeeAndDependenceByClientId", "EmployeeRestController::getEmployeeAndDependenceByClientId");
|
||||
$routes->get("getClientPolicy", "EmployeeRestController::getClientPolicy");
|
||||
$routes->get("getClientDetails", "EmployeeRestController::getClientDetails");
|
||||
|
||||
$routes->get("getAddOnPolicy", "EmployeeRestController::getAddOnPolicy");
|
||||
$routes->post("iAgreeForAddOn", "EmployeeRestController::iAgreeForAddOn");
|
||||
|
||||
@ -674,6 +686,7 @@ $routes->post('claimStatusCheck','VidalApiController::claimStatusCheck');
|
||||
$routes->post('newClaim','VidalApiController::newClaim');
|
||||
$routes->post('enrollment','VidalApiController::enrollment');
|
||||
|
||||
// General Tickets
|
||||
|
||||
$routes->post("ticketSave", "ThzController::ticketSave");
|
||||
$routes->get("ticketList", "ThzController::ticketList");
|
||||
@ -692,6 +705,12 @@ $routes->group('test', function($routes) {
|
||||
$routes->get('viewPDF', 'TestingController::viewPDF');
|
||||
$routes->get('generate-pdf-view', 'TestingController::generatePDFWithView');
|
||||
$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');
|
||||
|
||||
|
||||
@ -27,7 +27,8 @@ class AppContentManagementController extends AdminController
|
||||
public function add_image_index()
|
||||
{
|
||||
$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();
|
||||
|
||||
// dd($data);
|
||||
@ -86,6 +87,7 @@ class AppContentManagementController extends AdminController
|
||||
public function frontend_content(){
|
||||
|
||||
$data['test'] = $this->feContentModel->findAll();
|
||||
$headerData['tab_name'] = 'Front-End Content';
|
||||
$headerData['page_name'] = 'Front-End Content';
|
||||
|
||||
echo view('layout/header', $headerData);
|
||||
|
||||
@ -180,6 +180,9 @@ class BDSReportController extends AdminController
|
||||
'BAP-Insurer' => 'bapInsurer',
|
||||
'Client' => 'client'
|
||||
];
|
||||
|
||||
$data['page_name'] = "IRBA Report";
|
||||
|
||||
return $this->loadLayout('irba_report', $data);
|
||||
} else {
|
||||
|
||||
@ -914,6 +917,7 @@ class BDSReportController extends AdminController
|
||||
$data['default_end'] = $default_start->format('d-m-Y');
|
||||
$data['default_start'] = $default_start->modify('-60 days')->format('d-m-Y');
|
||||
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
|
||||
$data['tab_name'] = "Renewal Report";
|
||||
$data['page_name'] = "Renewal Report";
|
||||
return $this->loadLayout('renewal_search', $data);
|
||||
} else {
|
||||
@ -1013,6 +1017,7 @@ class BDSReportController extends AdminController
|
||||
|
||||
public function accountMangerStatusBDSReport()
|
||||
{
|
||||
$data['tab_name'] = "Account Manager BDS Report";
|
||||
$data['page_name'] = "Account Manager BDS Report";
|
||||
|
||||
$sql = "
|
||||
@ -1130,6 +1135,7 @@ class BDSReportController extends AdminController
|
||||
|
||||
public function getMultiReport($report_type){
|
||||
|
||||
$data['tab_name'] = "BDS Report";
|
||||
$data['page_name'] = "BDS Report";
|
||||
|
||||
if ($report_type == 1){
|
||||
|
||||
@ -14,11 +14,63 @@ class EcardDownloadConversation extends Conversation
|
||||
public function run()
|
||||
{
|
||||
$this->bot->types();
|
||||
sleep(0.5);
|
||||
// sleep(0.5);
|
||||
$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'));
|
||||
|
||||
@ -27,17 +79,13 @@ class EcardDownloadConversation extends Conversation
|
||||
$buttons = [];
|
||||
|
||||
$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))
|
||||
{
|
||||
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']}"] ;
|
||||
$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:
|
||||
|
||||
$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
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -76,4 +123,7 @@ class EcardDownloadConversation extends Conversation
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class MainMenuConversation extends Conversation
|
||||
{
|
||||
$this->bot->userStorage()->delete();
|
||||
$this->bot->types(); // Typing indicator for the first message
|
||||
sleep(0.5); // Delay
|
||||
// sleep(0.5); // Delay
|
||||
$this->showMainMenu();
|
||||
}
|
||||
|
||||
|
||||
@ -16,11 +16,11 @@ class NetworkHospitalConversation extends Conversation
|
||||
public function run()
|
||||
{
|
||||
$this->bot->types(); // Typing indicator for the first message
|
||||
sleep(0.5); // Delay
|
||||
// sleep(0.5); // Delay
|
||||
$this->showHospitalMenu();
|
||||
}
|
||||
|
||||
protected function showHospitalMenu()
|
||||
protected function showHospitalMenuOLD()
|
||||
{
|
||||
$chat_session_info = get_chatbot_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());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ class ChatbotControllerNew extends BaseController
|
||||
log_message("error","Inside Bot Type Function");
|
||||
|
||||
$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"
|
||||
$this->botman->hears('start|hi|hello|help|help me', function (BotMan $bot) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -259,7 +259,7 @@ class DashboardController extends AdminController
|
||||
|
||||
// dd(get_role_id(),user_team());
|
||||
// dd($data);
|
||||
|
||||
$data['tab_name'] = 'Dashboard';
|
||||
$data['page_name'] = 'Dashboard';
|
||||
|
||||
echo view('layout/header', $data);
|
||||
|
||||
@ -135,6 +135,9 @@ class EmployeeController extends AdminController
|
||||
|
||||
// dd($this->request->getGet());
|
||||
$this->myLogger->logme('error', 'list called');
|
||||
|
||||
$data['page_name'] = "Members";
|
||||
|
||||
$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);
|
||||
}
|
||||
|
||||
$data['tab_name'] = 'View Inception';
|
||||
$data['page_name'] = 'View Inception';
|
||||
|
||||
//for TPA/insurer upload
|
||||
@ -786,6 +790,9 @@ class EmployeeController extends AdminController
|
||||
}
|
||||
|
||||
$this->myLogger->logme('error', 'list called');
|
||||
|
||||
$data['page_name'] = "Endorsement";
|
||||
|
||||
$this->loadLayout('endorsement_list', $data);
|
||||
}
|
||||
|
||||
@ -830,6 +837,9 @@ class EmployeeController extends AdminController
|
||||
// dd($data);
|
||||
|
||||
$this->myLogger->logme('error', 'list called');
|
||||
|
||||
$data['page_name'] = "Enrollment";
|
||||
|
||||
return $this->loadLayout('enrollment_list', $data);
|
||||
|
||||
}
|
||||
@ -3039,6 +3049,8 @@ class EmployeeController extends AdminController
|
||||
// print_r($data); die;
|
||||
// }
|
||||
|
||||
$data['page_name'] = "Retail Endorsement";
|
||||
|
||||
$this->loadLayout('retail_endorsement_list', $data);
|
||||
}
|
||||
|
||||
|
||||
@ -2868,14 +2868,14 @@ class EmployeeRestController extends AdminController
|
||||
|
||||
}else if($ClientPolicyValue['policy_type_id'] == 6)
|
||||
{
|
||||
$policyGroup = 'gpa';
|
||||
$policyGroup = 'other';
|
||||
$data['ticket_type_id'] = 3;
|
||||
$data['claim_subject'] = "Claim EDLI";
|
||||
$data['sum_insured_label'] = "Sum Assured";
|
||||
|
||||
}else if($ClientPolicyValue['policy_type_id'] == 7)
|
||||
{
|
||||
$policyGroup = 'gpa';
|
||||
$policyGroup = 'other';
|
||||
$data['ticket_type_id'] = 4;
|
||||
$data['claim_subject'] = "Claim GTLI";
|
||||
$data['sum_insured_label'] = "Sum Assured";
|
||||
@ -2969,9 +2969,6 @@ class EmployeeRestController extends AdminController
|
||||
|
||||
function policyTermsFiter($terms , $type)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$gpa = [
|
||||
"sumInsured2" => "Sum Insured",
|
||||
"totalSumInsured" => "Total Sum Assured",
|
||||
@ -3021,8 +3018,6 @@ class EmployeeRestController extends AdminController
|
||||
"moderntreatmentsasperirdai" => "Modern Treatment "
|
||||
];
|
||||
|
||||
|
||||
|
||||
$finalarray = [];
|
||||
if($type == 'gpa'){
|
||||
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];
|
||||
}
|
||||
}
|
||||
}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{
|
||||
foreach ($gmc as $key => $value) {
|
||||
if(isset($terms->$key))
|
||||
@ -3070,9 +3077,7 @@ class EmployeeRestController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $finalarray;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -67,24 +67,57 @@ class ICICILombardController extends AdminController
|
||||
|
||||
|
||||
//Prepare body data
|
||||
$db = \Config\Database::connect();
|
||||
$data = $db->table('employee_polices ep')
|
||||
->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.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('client_policy cp', 'ep.client_policy_id = cp.id')
|
||||
->where('ep.client_policy_id', $policy_id)
|
||||
->where('ep.status', 'active')
|
||||
->where('ep.is_active', 1)
|
||||
// ->where('ep.uhid', null)
|
||||
->get()
|
||||
->getResultArray();
|
||||
// $db = \Config\Database::connect();
|
||||
// $data = $db->table('employee_polices ep')
|
||||
// ->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.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('client_policy cp', 'ep.client_policy_id = cp.id')
|
||||
// ->where('ep.client_policy_id', $policy_id)
|
||||
// ->where('ep.status', 'active')
|
||||
// ->where('ep.is_active', 1)
|
||||
// // ->where('ep.uhid', null)
|
||||
// ->get()
|
||||
// ->getResultArray();
|
||||
|
||||
$body = $this->formatPolicyData($data);
|
||||
// $body = $this->formatPolicyData($data);
|
||||
// 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
|
||||
// print_rr(json_encode($response));die();
|
||||
return $this->response->setJSON($response);
|
||||
@ -115,9 +148,9 @@ class ICICILombardController extends AdminController
|
||||
// dd($headers);
|
||||
|
||||
$body = [
|
||||
"PolicyNumber" => "4016/A/O/53077718/00/000",
|
||||
"BatchId" => "3646145",
|
||||
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440001"
|
||||
"PolicyNumber" => "4016/A/O/53130557/00/000",
|
||||
"BatchId" => "3658147",
|
||||
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440010"
|
||||
];
|
||||
|
||||
$response = call_third_party_api($url, 'POST', $headers, $body, true);
|
||||
|
||||
@ -167,6 +167,10 @@ class JobWorker extends AdminController
|
||||
'type' => 'CC', // Handler Category
|
||||
'handler' => 'App\Controllers\EmployeeMultiEventServiceController',
|
||||
],
|
||||
'memberDataListExcelFileFormatValidation' => [
|
||||
'type' => 'CC', // Handler Category
|
||||
'handler' => 'App\Controllers\LeadsController',
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -107,7 +107,8 @@ class MasterController extends AdminController
|
||||
public function insurerList()
|
||||
{
|
||||
$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['insurer_rm'] = $this->insurerRMModel->getAllClientRM();
|
||||
// echo '<pre>';
|
||||
@ -154,7 +155,8 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$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(
|
||||
(object) array('id' => 'pvt', 'name' => 'PVT'),
|
||||
@ -245,7 +247,8 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','Insurer Onboarding function called');
|
||||
$headerData['page_name'] = 'Insurer Master';
|
||||
$headerData['tab_name'] = 'Insurer Master';
|
||||
$headerData['page_name'] = 'Insurers';
|
||||
|
||||
$types = array(
|
||||
(object) array('id' => 'pvt', 'name' => 'PVT'),
|
||||
@ -504,7 +507,8 @@ class MasterController extends AdminController
|
||||
public function tpaList()
|
||||
{
|
||||
$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['insurer_rm'] = $this->insurerRMModel->getAllClientRM();
|
||||
// echo '<pre>';
|
||||
@ -550,7 +554,8 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$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();
|
||||
@ -664,7 +669,8 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$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();
|
||||
|
||||
@ -833,7 +839,8 @@ class MasterController extends AdminController
|
||||
public function kycList()
|
||||
{
|
||||
$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['insurer_rm'] = $this->insurerRMModel->getAllClientRM();
|
||||
// echo '<pre>';
|
||||
@ -879,7 +886,8 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$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();
|
||||
@ -944,7 +952,8 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$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_docs'] = $this->kycDocsModel->where(['kyc_type_id' => $id, 'is_active' => 1])->findAll();
|
||||
@ -1022,7 +1031,8 @@ class MasterController extends AdminController
|
||||
public function policyTypeList()
|
||||
{
|
||||
$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['insurer_rm'] = $this->insurerRMModel->getAllClientRM();
|
||||
// echo '<pre>';
|
||||
@ -1068,7 +1078,8 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$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();
|
||||
@ -1130,7 +1141,8 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$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['policies'] = $this->policesModel->select('policies.*, insurers.name as insurer_name')
|
||||
@ -1222,7 +1234,8 @@ class MasterController extends AdminController
|
||||
//start CD Master list
|
||||
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['insurers'] = $this->insurerModel->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
|
||||
|
||||
public function VehicleMasterList()
|
||||
{
|
||||
$data['page_name'] = 'Vehicle Master List';
|
||||
{ $data['tab_name'] = 'Vehicle Master';
|
||||
$data['page_name'] = 'Vehicles';
|
||||
$data['vehicle_type'] = [
|
||||
'two_wheeler' => 'Two Wheeler',
|
||||
'four_wheeler' => 'Four Wheeler',
|
||||
|
||||
@ -114,6 +114,7 @@ class PolicyTransactionController extends BaseController
|
||||
// Policy Transaction Inception
|
||||
public function viewInception()
|
||||
{
|
||||
$data['tab_name'] = 'Policy';
|
||||
$data['page_name'] = 'Policy';
|
||||
|
||||
// Static arrays for dropdowns
|
||||
@ -1075,6 +1076,7 @@ class PolicyTransactionController extends BaseController
|
||||
// echo '<pre>';
|
||||
// !dd($this->getEndorsementDataForEdit(17));
|
||||
|
||||
$data['tab_name'] = 'Endorsement';
|
||||
$data['page_name'] = 'Endorsement';
|
||||
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
|
||||
$data['issuer_branch'] = $this->nhanceBranchModel->where('is_active', 1)->findAll();
|
||||
@ -1241,7 +1243,8 @@ class PolicyTransactionController extends BaseController
|
||||
$issue_type = $this->policyTransactionModel
|
||||
->where('action_type', 'inception')
|
||||
->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)
|
||||
->first();
|
||||
|
||||
@ -1770,7 +1773,7 @@ class PolicyTransactionController extends BaseController
|
||||
//get BDS Reports data old function
|
||||
public function reportBDSOld()
|
||||
{
|
||||
|
||||
$data['tab_name'] = 'BDS Report';
|
||||
$data['page_name'] = 'BDS Report';
|
||||
|
||||
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
|
||||
@ -1832,6 +1835,7 @@ class PolicyTransactionController extends BaseController
|
||||
public function reportBDS()
|
||||
{
|
||||
|
||||
$data['tab_name'] = 'BDS Report';
|
||||
$data['page_name'] = 'BDS Report';
|
||||
|
||||
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
|
||||
@ -1925,6 +1929,7 @@ class PolicyTransactionController extends BaseController
|
||||
|
||||
public function reportVarience()
|
||||
{
|
||||
$data['tab_name'] = 'Variance Report';
|
||||
$data['page_name'] = 'Variance Report';
|
||||
|
||||
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
|
||||
@ -1974,6 +1979,7 @@ class PolicyTransactionController extends BaseController
|
||||
|
||||
public function reportBusinessList()
|
||||
{
|
||||
$data['tab_name'] = 'Business Report';
|
||||
$data['page_name'] = 'Business Report';
|
||||
|
||||
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
|
||||
@ -2014,6 +2020,7 @@ class PolicyTransactionController extends BaseController
|
||||
|
||||
public function reportFinanceList()
|
||||
{
|
||||
$data['tab_name'] = 'Finance Report';
|
||||
$data['page_name'] = 'Finance Report';
|
||||
|
||||
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
|
||||
@ -2054,6 +2061,7 @@ class PolicyTransactionController extends BaseController
|
||||
|
||||
public function reportOutstanding()
|
||||
{
|
||||
$data['tab_name'] = 'Outstanding Report';
|
||||
$data['page_name'] = 'Outstanding Report';
|
||||
|
||||
$data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
|
||||
@ -2132,6 +2140,7 @@ class PolicyTransactionController extends BaseController
|
||||
->findAll();
|
||||
|
||||
// dd( $this->insurerStatements->getLastQuery());
|
||||
$data['tab_name'] = 'Statement Upload';
|
||||
$data['page_name'] = 'Statement Upload';
|
||||
|
||||
$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);
|
||||
// dd($data['files']);
|
||||
}
|
||||
|
||||
$data['page_name'] = 'Documents Search';
|
||||
$data['tab_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['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');
|
||||
|
||||
$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("
|
||||
client_policy.*,
|
||||
policy_transaction.*,
|
||||
policy_type.policy_type,
|
||||
policy_type.ebp,
|
||||
policy_type.etp,
|
||||
@ -3064,14 +3092,14 @@ class PolicyTransactionController extends BaseController
|
||||
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
|
||||
DATE_FORMAT(policy_transaction.policy_start_date, '%d/%m/%Y') as policy_start_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_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();
|
||||
->join('policy_type', 'policy_type.id = policy_transaction.policy_type_id')
|
||||
->whereIn('policy_transaction.client_id', $clientIds)
|
||||
->where('policy_transaction.is_active', 1)
|
||||
->where('policy_transaction.action_type', "inception")
|
||||
->findAll();
|
||||
|
||||
foreach ($policies as $policy) {
|
||||
$policyList[$policy['client_branch_id']][] = $policy;
|
||||
|
||||
@ -79,10 +79,6 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function verifyEmployeeWithMobileNumber()
|
||||
{
|
||||
log_message('error', ' ');
|
||||
@ -93,6 +89,7 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
try {
|
||||
$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);
|
||||
|
||||
|
||||
@ -112,12 +109,49 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
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', ' ');
|
||||
$result = ['user_verification' => true ,'message' => "Verified Successfully"];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
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" ];
|
||||
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 {
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: No matching employee found");
|
||||
log_message('error', ' ');
|
||||
@ -148,6 +182,7 @@ class RestAuthenticationController extends AdminController
|
||||
try {
|
||||
|
||||
$email = $this->request->getJSON()->email;
|
||||
$otp = $this->request->getJSON()->otp;
|
||||
$client_id = $this->request->getJSON()->client_id ?? null;
|
||||
|
||||
|
||||
@ -181,11 +216,6 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
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
|
||||
->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() ?? []));
|
||||
|
||||
|
||||
$email = $this->request->getJSON()->email;
|
||||
$email = $this->request->getJSON()->email ?? null;
|
||||
$mobile_number = $this->request->getJSON()->mobile_number ?? null;
|
||||
$otp = $this->request->getJSON()->otp;
|
||||
$client_id = $this->request->getJSON()->client_id ?? null;
|
||||
$employee_id = $this->request->getJSON()->employee_id ?? null;
|
||||
|
||||
$builder = $this->employeeModel
|
||||
->where('email_corporate', $email)
|
||||
->where('relationship', 'Self')
|
||||
->where('is_active', 1);
|
||||
|
||||
// $builder = $this->employeeModel
|
||||
// ->join('employee_polices EP', 'EP.employee_id = employees.id', 'inner')
|
||||
// ->where('employees.email_corporate', $email)
|
||||
// ->where('employees.relationship', 'Self')
|
||||
// ->where('employees.is_active', 1)
|
||||
// ->whereIn('employees.emp_status', ['active', 'expired'])
|
||||
// ->where('EP.is_active', 1)
|
||||
// ->whereIn('EP.status', ['active', 'expired']);
|
||||
if (!empty($email)) {
|
||||
$builder->where('email_corporate', $email);
|
||||
}
|
||||
|
||||
if (!empty($mobile_number)) {
|
||||
$builder->where('mobile', $mobile_number);
|
||||
}
|
||||
|
||||
|
||||
if (!empty($client_id)) {
|
||||
@ -306,58 +335,7 @@ 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()
|
||||
{
|
||||
try {
|
||||
@ -415,17 +393,11 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
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;
|
||||
|
||||
$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;
|
||||
$otp = isset($this->request->getJSON()->otp) ? $this->request->getJSON()->otp : 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))
|
||||
{
|
||||
// $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)
|
||||
->whereIn('employee_polices.status', ['active', 'expired'])
|
||||
->where('employees.is_active', 1)
|
||||
->whereIn('employees.emp_status', ['active', 'expired']);
|
||||
->whereIn('employees.emp_status', ['active', 'expired'])
|
||||
->where('otp', $otp);
|
||||
|
||||
if (!empty($client_id)) {
|
||||
$builder->where('employees.client_id', $client_id);
|
||||
@ -464,14 +437,15 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
$employeeData = $builder->orderBy('employees.id', 'desc')->first();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$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: 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();
|
||||
if ($auth) {
|
||||
$data = [
|
||||
@ -503,14 +477,14 @@ class RestAuthenticationController extends AdminController
|
||||
log_message('error', ' ');
|
||||
log_message('error', '************************ POST END ********************************');
|
||||
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) {
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString());
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
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()
|
||||
{
|
||||
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)
|
||||
->where('contact_type', 'client')
|
||||
->where('is_active', 1)
|
||||
->first();
|
||||
|
||||
|
||||
|
||||
if ($HrData) {
|
||||
|
||||
$result = ['user_verification' => true ,'message' => "Verified Successfully"];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
$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"];
|
||||
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 {
|
||||
$result = ['user_verification' => false , 'message' => "User not found"];
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
|
||||
@ -552,6 +552,7 @@ class RestAuthenticationController extends AdminController
|
||||
$data = $this->request->getJSON();
|
||||
|
||||
$email = $data->email;
|
||||
$otp = $data->otp;
|
||||
|
||||
$HrData = $this->hrModel->where('email', $email)
|
||||
->where('contact_type', 'client')
|
||||
@ -559,8 +560,6 @@ class RestAuthenticationController extends AdminController
|
||||
->first();
|
||||
|
||||
if ($HrData) {
|
||||
|
||||
$otp = random_int(100000, 999999);
|
||||
|
||||
$sql = "
|
||||
UPDATE level_contacts
|
||||
@ -575,7 +574,7 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
if($update)
|
||||
{
|
||||
$data->otp = $otp;
|
||||
|
||||
|
||||
$common = [
|
||||
'login_type' => 'HR login',
|
||||
@ -608,39 +607,53 @@ class RestAuthenticationController extends AdminController
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function updateHROTP()
|
||||
{
|
||||
|
||||
$email = $this->request->getJSON()->email;
|
||||
$otp = $this->request->getJSON()->otp;
|
||||
|
||||
$this->hrModel->where('email', $email) ->where('contact_type', 'client')
|
||||
->where('is_active', 1)->set(array('otp' => $otp))
|
||||
->update();
|
||||
|
||||
$email = $this->request->getJSON()->email ?? null;
|
||||
$mobile_number = $this->request->getJSON()->mobile_number ?? null;
|
||||
$otp = $this->request->getJSON()->otp ?? null;
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getVerifiedHrData()
|
||||
{
|
||||
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;
|
||||
$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))
|
||||
{
|
||||
$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{
|
||||
$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();
|
||||
@ -656,41 +669,73 @@ class RestAuthenticationController extends AdminController
|
||||
$this->authHistoryModel->insert($data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
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('clients', 'client_branch.client_id = clients.id', 'left')
|
||||
->where('level_contacts.mobile', $mobile_number )
|
||||
->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)){
|
||||
|
||||
$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('clients', 'client_branch.client_id = clients.id', 'left')
|
||||
->where('level_contacts.email', $email )
|
||||
->where('level_contacts.contact_type', 'client')
|
||||
->findAll();
|
||||
//set otp value null
|
||||
$this->hrModel->where('email', $email)->where('otp', $otp)->where('contact_type', 'client')->set(['otp'=>null])->update();
|
||||
|
||||
$hrData = $this->hrModel ->select('level_contacts.* , client_branch.client_id as client_id')
|
||||
->join('client_branch', 'level_contacts.ref_id = client_branch.id', 'left')
|
||||
->where('level_contacts.email', $email )
|
||||
->where('level_contacts.contact_type', 'client')
|
||||
->find();
|
||||
}
|
||||
|
||||
$HRAccessData = $this->getHRAccessData( $hrData['0']['id'] , 'post_enrollment');
|
||||
if(count($getAllhrData))
|
||||
{
|
||||
|
||||
foreach ($getAllhrData as $key => $value) {
|
||||
|
||||
if(isset($HRAccessData['allowed_modules'])){ $hrData['0']['allowed_modules'] = json_decode($HRAccessData['allowed_modules'],true)['post']; }else{ $hrData['0']['allowed_modules'] = []; }
|
||||
$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);
|
||||
}
|
||||
|
||||
$hrData['0']['token_type'] = 'post';
|
||||
$result = JWTToken::encode($hrData['0']);
|
||||
|
||||
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result ],200);
|
||||
|
||||
|
||||
|
||||
|
||||
} 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) {
|
||||
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', ' ************************************* POST END **************************************** ');
|
||||
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', ' ************************************* POST END **************************************** ');
|
||||
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;
|
||||
// return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
// } else {
|
||||
// return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP"],200);
|
||||
// return $this->respond(['status' => 'failed','code' => 404,'data' => ""],200);
|
||||
// }
|
||||
// } catch (\Exception $e) {
|
||||
// return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
|
||||
@ -1016,7 +1061,7 @@ class RestAuthenticationController extends AdminController
|
||||
// print_r($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) {
|
||||
@ -1057,7 +1102,7 @@ class RestAuthenticationController extends AdminController
|
||||
$employeeData = $builder->orderBy('employees.id', 'desc')->first();
|
||||
|
||||
} 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();
|
||||
@ -1095,14 +1140,14 @@ class RestAuthenticationController extends AdminController
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
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) {
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyMpin: Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString());
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
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', ' ************************************* POST END **************************************** ');
|
||||
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 {
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - checkMpin: Mpin - not found");
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
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) {
|
||||
@ -1182,7 +1227,7 @@ class RestAuthenticationController extends AdminController
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1361,6 +1406,10 @@ class RestAuthenticationController extends AdminController
|
||||
->where('employees.mobile', $mobile_number)
|
||||
->where('EP.is_active', 1)
|
||||
->whereIn('EP.status', ['active', 'expired']);
|
||||
|
||||
if (!empty($otp)) {
|
||||
$builder->where('employees.otp', $otp);
|
||||
}
|
||||
|
||||
if (!empty($old_mpin)) {
|
||||
$builder->where('employees.mpin', $old_mpin);
|
||||
|
||||
@ -5,11 +5,18 @@ namespace App\Controllers;
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\EmployeePolicyModel;
|
||||
use App\Models\InsurerBranchModel;
|
||||
use App\Models\RFQModel;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
use Dompdf\Dompdf;
|
||||
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
|
||||
{
|
||||
use ResponseTrait;
|
||||
@ -19,7 +26,7 @@ class TestingController extends BaseController
|
||||
{
|
||||
$this->myLogger = \Config\Services::mylogger();
|
||||
}
|
||||
|
||||
|
||||
public function saveForm()
|
||||
{
|
||||
// Get JSON input
|
||||
@ -34,7 +41,7 @@ class TestingController extends BaseController
|
||||
}
|
||||
|
||||
public function testcli()
|
||||
{
|
||||
{
|
||||
echo "hi";
|
||||
$this->myLogger->logme('error', "test log");
|
||||
echo "hi 2";
|
||||
@ -78,19 +85,19 @@ class TestingController extends BaseController
|
||||
$options->set('debugLayoutBlocks', false);
|
||||
$options->set('debugLayoutInline', false);
|
||||
$options->set('debugLayoutPaddingBox', false);
|
||||
|
||||
|
||||
// Initialize DomPDF
|
||||
$dompdf = new Dompdf($options);
|
||||
|
||||
|
||||
// Load HTML content
|
||||
$dompdf->loadHtml($html);
|
||||
|
||||
|
||||
// Set paper size and orientation
|
||||
$dompdf->setPaper('A4', 'landscape'); // or 'portrait'
|
||||
|
||||
|
||||
// Render PDF
|
||||
$dompdf->render();
|
||||
|
||||
|
||||
// Output PDF to browser
|
||||
$filename = 'ecard_' . date('Y-m-d_H-i-s') . '.pdf';
|
||||
$dompdf->stream($filename, ['Attachment' => true]); // Set to false for inline view
|
||||
@ -110,7 +117,7 @@ class TestingController extends BaseController
|
||||
'POLICY_DATE' => '31/12/2024',
|
||||
'INSURER_NAME' => 'ZURICH KOTAK GTNERAL INSURANCE COIIPANY lNDlA LIMITED',
|
||||
'TPA_NAME' => 'HealthIndia Insurance TPA Services Pvt. Ltd.',
|
||||
'FRONT_CARD' => base_url() .('public/uploads/template_bg/Nhance_Ecard_working_1_front_3.png'),
|
||||
'FRONT_CARD' => base_url() . ('public/uploads/template_bg/Nhance_Ecard_working_1_front_3.png'),
|
||||
'BACK_CARD' => base_url() . ('public/uploads/template_bg/Nhance_Ecard_working_1_Back_3.png'),
|
||||
'LEVELS' => 'Level 1: 1800-XXX-XXXX<br>Level 2: support@company.com'
|
||||
];
|
||||
@ -126,7 +133,7 @@ class TestingController extends BaseController
|
||||
'POLICY_DATE' => '31/12/2024',
|
||||
'INSURER_NAME' => 'ABC Insurance Co.',
|
||||
'TPA_NAME' => 'XYZ TPA Ltd.',
|
||||
'FRONT_CARD' => base_url() .('public/uploads/template_bg/Nhance_Ecard_working_1_front_3.png'),
|
||||
'FRONT_CARD' => base_url() . ('public/uploads/template_bg/Nhance_Ecard_working_1_front_3.png'),
|
||||
'BACK_CARD' => base_url() . ('public/uploads/template_bg/Nhance_Ecard_working_1_Back_3.png'),
|
||||
'LEVELS' => 'Level 1: 1800-XXX-XXXX<br>Level 2: support@company.com'
|
||||
];
|
||||
@ -156,12 +163,12 @@ class TestingController extends BaseController
|
||||
{
|
||||
// Load your HTML template
|
||||
$template = file_get_contents(WRITEPATH . 'e_card_template/common.html');
|
||||
|
||||
|
||||
// Replace placeholders with actual data
|
||||
foreach ($data as $key => $value) {
|
||||
$template = str_replace('{' . $key . '}', $value, $template);
|
||||
}
|
||||
|
||||
|
||||
return $template;
|
||||
}
|
||||
|
||||
@ -224,21 +231,21 @@ class TestingController extends BaseController
|
||||
$employeePolicy = new EmployeePolicyModel();
|
||||
|
||||
$data = $employeePolicy
|
||||
->select('client_policy.policy_type_id')
|
||||
->join('employees', 'employee_polices.employee_id = employees.id')
|
||||
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id')
|
||||
->where('employees.is_active', 1)
|
||||
->where('employees.emp_status', ['active', 'expired'])
|
||||
->where('employee_polices.is_active', 1)
|
||||
->where('employee_polices.status', ['active', 'expired'])
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->groupBy('employee_polices.client_policy_id')
|
||||
->findAll();
|
||||
|
||||
->select('client_policy.policy_type_id')
|
||||
->join('employees', 'employee_polices.employee_id = employees.id')
|
||||
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id')
|
||||
->where('employees.is_active', 1)
|
||||
->where('employees.emp_status', ['active', 'expired'])
|
||||
->where('employee_polices.is_active', 1)
|
||||
->where('employee_polices.status', ['active', 'expired'])
|
||||
->where('employees.client_id', $client_id)
|
||||
->where('employees.emp_code', $emp_code)
|
||||
->groupBy('employee_polices.client_policy_id')
|
||||
->findAll();
|
||||
}
|
||||
|
||||
public function ptedfitdata($id){
|
||||
public function ptedfitdata($id)
|
||||
{
|
||||
$policy_transaction = new PolicyTransactionController();
|
||||
$data = $policy_transaction->getInceptionDataForEdit($id);
|
||||
// dd($data);
|
||||
@ -248,7 +255,7 @@ class TestingController extends BaseController
|
||||
$dataArray = $data['pt_co_share_details']; // Example
|
||||
$cd_ac_pk = 'CD12345';
|
||||
$role_id = 1;
|
||||
$team_id = ['6'];
|
||||
$team_id = ['6'];
|
||||
$insurer_branch = $insurer_branch;
|
||||
|
||||
return view('pt_calc_table', [
|
||||
@ -313,4 +320,357 @@ class TestingController extends BaseController
|
||||
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
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -362,6 +362,7 @@ class TicketController extends BaseController
|
||||
$data['modeOFIntimate'] = $this->modeOFIntimate;
|
||||
$data['priorityType'] = $this->priorityType;
|
||||
$data['claimType'] = $this->claimType;
|
||||
$data['tab_name'] = "Claims";
|
||||
if ($this->request->is('get')) {
|
||||
$data['page_name'] = "Claims";
|
||||
$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']);
|
||||
$data['ticket_type'] = $this->ticketType;
|
||||
$data['trigger_type'] = $this->triggerType;
|
||||
|
||||
$data['page_name'] = "Claims";
|
||||
|
||||
return $this->loadLayout('ticket_mail_template', $data);
|
||||
}
|
||||
|
||||
@ -1744,6 +1748,8 @@ class TicketController extends BaseController
|
||||
'tat_band_wise' => 'TAT Wise Status Report'
|
||||
];
|
||||
//
|
||||
$data['tab_name'] = "Claim Reports";
|
||||
$data['page_name'] = "Claims";
|
||||
$this->loadLayout('ticket_reports', $data);
|
||||
} else {
|
||||
$received_data = $this->request->getPost();
|
||||
@ -2187,6 +2193,8 @@ class TicketController extends BaseController
|
||||
|
||||
|
||||
$data['viewer'] = !empty($empView) ? $empView : 0;
|
||||
|
||||
|
||||
// dd($data);
|
||||
return view('ticket_feedback_form', $data);
|
||||
}else{
|
||||
@ -2217,7 +2225,7 @@ class TicketController extends BaseController
|
||||
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['page_name'] = "Claims";
|
||||
// dd($data);
|
||||
$this->loadLayout("ticket_feedback_list",$data);
|
||||
}
|
||||
@ -2610,7 +2618,8 @@ class TicketController extends BaseController
|
||||
|
||||
public function claimDumpUpload()
|
||||
{
|
||||
$data['page_name'] = "Claim Dupm Upload";
|
||||
$data['tab_name'] = "Claim Dupm Upload";
|
||||
$data['page_name'] = "Claims";
|
||||
|
||||
if($this->request->is('get')){
|
||||
|
||||
|
||||
@ -55,7 +55,8 @@ class UserController extends AdminController
|
||||
|
||||
public function list()
|
||||
{
|
||||
$data['page_name'] = 'User';
|
||||
$data['tab_name'] = 'Users';
|
||||
$data['page_name'] = 'Users';
|
||||
$this->myLogger->logme('error','User list function called');
|
||||
$data['UserList'] = $this->userModel->getUserList();
|
||||
// echo '<pre>';
|
||||
@ -588,6 +589,7 @@ class UserController extends AdminController
|
||||
$data = $this->request->getPost();
|
||||
if (!empty($data['id'])) {
|
||||
$text = "update";
|
||||
$data['updated_by'] = get_session_userid();
|
||||
$result = $this->partnerStaffModel->update($data['id'], $data);
|
||||
$updateID = $data['id'];
|
||||
} else {
|
||||
@ -595,6 +597,11 @@ class UserController extends AdminController
|
||||
$data['role_id'] = 1;
|
||||
$data['created_by'] = get_session_userid();
|
||||
$insertID = $this->partnerStaffModel->insert($data);
|
||||
if($insertID){
|
||||
$details['manager_id'] = $insertID;
|
||||
$details['updated_by'] = get_session_userid();
|
||||
$this->partnerStaffModel->update($insertID, $details);
|
||||
}
|
||||
$result = true;
|
||||
}
|
||||
|
||||
@ -620,17 +627,24 @@ class UserController extends AdminController
|
||||
if (!$staff) {
|
||||
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($role == 1){ // manager
|
||||
$result = $this->partnerStaffModel->updateByKey($id);
|
||||
$message = $result;
|
||||
}else{ // staff
|
||||
$result = $this->partnerStaffModel->update($id, ['is_active' => 0]);
|
||||
$message = "Staff deleted successfully";
|
||||
$message = $text." deleted successfully";
|
||||
}
|
||||
} 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([
|
||||
'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
|
||||
])->setStatusCode($result ? 200 : 400);
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ class ChatbotHelper
|
||||
$client_branch_id = $chat_session_info['client_branch_id'];
|
||||
$relationship ='Self';
|
||||
$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){
|
||||
|
||||
@ -666,12 +666,12 @@ if(!function_exists('generate_insurer_based_excel')){
|
||||
foreach ($excel_header_array as $header) {
|
||||
|
||||
$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') {
|
||||
$value = $serialNumber;
|
||||
} else {
|
||||
if(empty($fieldName) && !empty($defaultValue)){
|
||||
if(empty($fieldName) && $defaultValue != ""){
|
||||
$value = $defaultValue;
|
||||
}else{
|
||||
$value = $row->$fieldName ?? '';
|
||||
|
||||
@ -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
|
||||
if (!function_exists('generate_family_floater_key')) {
|
||||
function generate_family_floater_key($relationship)
|
||||
@ -2002,7 +2001,7 @@ if (!function_exists('generate_family_floater_key')) {
|
||||
$relation = 'parent';
|
||||
} else if (strtolower(trim($relationship)) === 'son' || strtolower(trim($relationship)) === 'daughter') {
|
||||
$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';
|
||||
} else if (strtolower(trim($relationship)) === 'spouse') {
|
||||
$relation = 'spouse';
|
||||
@ -2041,3 +2040,331 @@ if (!function_exists('formatIndianCurrency')) {
|
||||
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 --------------------------------------
|
||||
|
||||
|
||||
|
||||
44
app/Helpers/sms_helper.php
Normal file
44
app/Helpers/sms_helper.php
Normal 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];
|
||||
}
|
||||
}
|
||||
@ -25,6 +25,7 @@ class ClientBranchModel extends Model
|
||||
"gst",
|
||||
"sez",
|
||||
"units",
|
||||
"pre_branch_id"
|
||||
];
|
||||
|
||||
public function getBranchAndContactByBranchId($branch_id){
|
||||
|
||||
@ -108,7 +108,7 @@ class ClientModel extends Model
|
||||
}
|
||||
|
||||
|
||||
public function getCreatedByUserName(){
|
||||
public function getCreatedByUserName($client_type = null){
|
||||
|
||||
$role_id = get_role_id();
|
||||
$user_id = get_session_userid();
|
||||
@ -118,6 +118,10 @@ class ClientModel extends Model
|
||||
->join('client_rm', 'client_rm.client_id = clients.id','left')
|
||||
->where('clients.is_active', 1);
|
||||
|
||||
if (!empty($client_type)) {
|
||||
$query->where('clients.client_type', $client_type);
|
||||
}
|
||||
|
||||
if (in_array($role_id, [2, 3])) {
|
||||
|
||||
// If the user is a Account Manager or Manager, filter by user_id
|
||||
@ -222,5 +226,18 @@ class ClientModel extends Model
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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('client_policy', 'client_policy.id = employee_polices.client_policy_id')
|
||||
->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){
|
||||
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){
|
||||
return $query->where('employees.client_id',$client_id);
|
||||
|
||||
@ -13,6 +13,9 @@ class HRAccessControlModel extends Model
|
||||
'pre_hr_id',
|
||||
'post_hr_id',
|
||||
'post_client_id',
|
||||
'pre_client_id',
|
||||
'pre_branch_id',
|
||||
'post_branch_id',
|
||||
'allowed_modules',
|
||||
'allowed_pre_policies',
|
||||
'allowed_active_policies',
|
||||
|
||||
@ -17,7 +17,10 @@ class LeadFilesModel extends Model
|
||||
'updated_by',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'is_active'
|
||||
'is_active',
|
||||
'error_data',
|
||||
'status',
|
||||
'type',
|
||||
];
|
||||
|
||||
// Callbacks
|
||||
|
||||
@ -105,6 +105,7 @@ class LeadsModel extends Model
|
||||
'next_reminder_date',
|
||||
'is_insurer_auto_mail',
|
||||
'quote_received_insurer',
|
||||
'acm_id',
|
||||
];
|
||||
|
||||
|
||||
@ -146,6 +147,7 @@ class LeadsModel extends Model
|
||||
|
||||
$data = $this->select('
|
||||
leads.*,
|
||||
lead_files.status as demography_file_status,
|
||||
kyc_entity_type.name as entity_type,
|
||||
policy_type.policy_type,
|
||||
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('user_profiles', 'leads.salse_person_id = user_profiles.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);
|
||||
|
||||
if (!empty($where)) {
|
||||
|
||||
@ -47,4 +47,55 @@ class PartnerStaffModel extends Model
|
||||
// ];
|
||||
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -182,21 +182,20 @@
|
||||
|
||||
</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()))) { ?>
|
||||
|
||||
<div class="row" id="client_add" style="margin-top: -32px;">
|
||||
<div class="row" id="client_add" >
|
||||
<div class="col-12">
|
||||
<!-- <div class="card"> -->
|
||||
<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])) { ?>
|
||||
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<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/active_pending_actions.png" alt="Logo" height="14"
|
||||
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()))) { ?>
|
||||
|
||||
<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/active_bds.png" alt="Logo" height="14"
|
||||
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' : '';
|
||||
?>
|
||||
<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/active_claims.png" alt="Logo" height="14"
|
||||
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' : '';
|
||||
?>
|
||||
<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/active_leads_and_bds_renewal.png" alt="Logo" height="14"
|
||||
class="active_leads " style="display:none;">
|
||||
|
||||
@ -37,10 +37,10 @@ table.dataTable tbody td {
|
||||
</style> -->
|
||||
|
||||
<style>
|
||||
body {
|
||||
/* body {
|
||||
font-family: Arial, sans-serif;
|
||||
padding: 20px;
|
||||
}
|
||||
} */
|
||||
|
||||
#mobile::placeholder,
|
||||
#mobile_no::placeholder {
|
||||
@ -348,12 +348,12 @@ table.dataTable tbody td {
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<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;">
|
||||
<h4 style="position: relative;">Users</h4>
|
||||
</div>
|
||||
</div>
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="1" id="user-table">
|
||||
</div> -->
|
||||
<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">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Name</th>
|
||||
@ -391,15 +391,15 @@ table.dataTable tbody td {
|
||||
|
||||
</table>
|
||||
<!-- <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>
|
||||
<th>Ticket ID</th>
|
||||
<th class="app-text-left">Name</th>
|
||||
<th class="text-left">Name</th>
|
||||
<th>Policy Number</th>
|
||||
<th>Ticket Type</th>
|
||||
<th>Subject</th>
|
||||
<th>Status</th>
|
||||
<th class="app-text-left">Assign To</th>
|
||||
<th class="text-left">Assign To</th>
|
||||
<th>Created At</th>
|
||||
<th>Updated At</th>
|
||||
</tr>
|
||||
@ -409,18 +409,18 @@ table.dataTable tbody td {
|
||||
<?php foreach($ticket_data as $index => $row){ ?>
|
||||
|
||||
<tr data-id="<?= $row['thz_id']; ?>" style="cursor: pointer;">
|
||||
<td class="app-text-right"><?php echo $row['thz_id']; ?></td>
|
||||
<td class="app-text-left">
|
||||
<td class="text-right"><?php echo $row['thz_id']; ?></td>
|
||||
<td class="text-left">
|
||||
<?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['mobile'])): echo $row['mobile']; endif; ?></span>
|
||||
</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']
|
||||
: 'N/A'; ?>
|
||||
</td>
|
||||
<td class="app-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"><?php echo $row['ticket_type'] ? $row['ticket_type'] : '-'; ?></td>
|
||||
<td class="text-center wrap" title="<?php echo htmlspecialchars($row['subject']); ?>">
|
||||
<?php
|
||||
$subject = $row['subject'] ? $row['subject'] : 'N/A';
|
||||
echo (strlen($subject) > 50)
|
||||
@ -428,9 +428,9 @@ table.dataTable tbody td {
|
||||
: htmlspecialchars($subject);
|
||||
?>
|
||||
</td>
|
||||
<td class="app-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="app-text-left">
|
||||
<td class="text-center"><?php echo $row['status'] ? $row['status'] : '-' ; ?></td>
|
||||
<td class="text-left"><?php echo $row['assignee_name'] ? $row['assignee_name'] : '-'; ?></td>
|
||||
<td class="text-left">
|
||||
<?php if (!empty($row['created_at'])):
|
||||
$cd = date("j F Y", strtotime($row['created_at']));
|
||||
$ct = date("h:i a", strtotime($row['created_at']));
|
||||
@ -438,7 +438,7 @@ table.dataTable tbody td {
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
<td class="app-text-left">
|
||||
<td class="text-left">
|
||||
<?php if (!empty($row['updated_at'])):
|
||||
$ud = date("j F Y", strtotime($row['updated_at']));
|
||||
$ut = date("h:i a", strtotime($row['updated_at']));
|
||||
@ -873,22 +873,32 @@ table.dataTable tbody td {
|
||||
{
|
||||
extend: 'csv',
|
||||
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',
|
||||
text: '<i class="mdi mdi-file-excel"></i><span class="btn-custom"> EXCEL </span>',
|
||||
exportOptions: { orthogonal: 'sort' },
|
||||
className: 'app-btn-primary'
|
||||
className: 'app-btn-primary',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
paging: true,
|
||||
pageLength: 25,
|
||||
pageLength: 10,
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
initComplete: function () {
|
||||
$(".dt-buttons").prepend(`
|
||||
@ -1022,9 +1032,17 @@ table.dataTable tbody td {
|
||||
});
|
||||
|
||||
$('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({
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this user",
|
||||
text: alertText,
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
@ -1160,6 +1178,9 @@ table.dataTable tbody td {
|
||||
complete: function() {
|
||||
btn.disabled = false;
|
||||
btn.innerText = "Submit";
|
||||
$('#nhance-partner-modal').removeClass('show').hide();
|
||||
$('.modal-backdrop').remove();
|
||||
loadPartner();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1258,7 +1279,7 @@ table.dataTable tbody td {
|
||||
row.name,
|
||||
row.email,
|
||||
row.mobile,
|
||||
'Staff',
|
||||
row.role_id == 1 ? "Manager" : "Staff",
|
||||
`<span class="badge ${statusClass}">${statusText}</span>`,
|
||||
`<div class="btn-group 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)}'>
|
||||
<i data-obj='${JSON.stringify(row)}' class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle btnPartnerEdit"></i>Edit
|
||||
</a>
|
||||
<a class="dropdown-item btnPartnerDelete" data-id="${row.id}">
|
||||
<i data-id="${row.id}" class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle btnPartnerDelete"></i>Delete
|
||||
<a class="dropdown-item btnPartnerDelete" data-id="${row.id}" data-role="${row.role_id}">
|
||||
<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 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
|
||||
@ -1439,7 +1460,7 @@ table.dataTable tbody td {
|
||||
hour12: false
|
||||
};
|
||||
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 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">
|
||||
<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 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}"
|
||||
style="max-width: 265px;">
|
||||
${file.incentive_file_name}
|
||||
@ -1694,10 +1715,11 @@ table.dataTable tbody td {
|
||||
});
|
||||
$(document).on('click', '#btnNhancePartnerAdd', function(){
|
||||
$('#partner_name').val('');
|
||||
$('#email').val('');
|
||||
$('#email_addr').val('');
|
||||
$('#partner_id').val('');
|
||||
$('#mobile_no').val('');
|
||||
$('#locn').val('');
|
||||
$('#locn').val('');
|
||||
$('.modal-title').html('Add Nhance Partner');
|
||||
$('#PartnerForm').attr('action', '<?php echo base_url('/user/partner');?>');
|
||||
let myModal = new bootstrap.Modal(document.getElementById('nhance-partner-modal'));
|
||||
myModal.show(); // open modal
|
||||
|
||||
@ -24,7 +24,7 @@ table.dataTable thead th {
|
||||
<div class="card-body">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Advertisement Image List</h4>
|
||||
<h4 style="position: relative;">Advertisement Images</h4>
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right; position: relative;top: 5px;">
|
||||
<a data-toggle="modal" data-target="#bike_make_login-modal" href="#" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" data-toggle="" data-placement="top" title="Add" data-trigger="hover">ADD</a>
|
||||
@ -75,20 +75,25 @@ table.dataTable thead th {
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<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>
|
||||
</div>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<form id="model_form_data" class="px-4">
|
||||
|
||||
<input type="text" name="add_image_id" id="add_image_id" value="0" hidden>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="branchname">Image</label>
|
||||
<input class="form-control" name="advertise_image" id="advertise_image" type="file" accept="image/*" onchange="PreviewImage();" required="">
|
||||
<label for="branchname">Upload Image</label>
|
||||
<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 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"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -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">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<th class="font-weight-medium">Batch Code</th>
|
||||
<th class="font-weight-medium">File Name</th>
|
||||
<th class="font-weight-medium">Client</th>
|
||||
<th class="font-weight-medium">Client Branch</th>
|
||||
<th class="font-weight-medium">Client Policy</th>
|
||||
<th class="font-weight-medium">Event Type</th>
|
||||
<th class="font-weight-medium">Insurer/ TPA</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
<th class="font-weight-medium">Count</th>
|
||||
<th class="font-weight-medium">(₹)Amount</th>
|
||||
<th class="font-weight-medium">User/Time</th>
|
||||
<th class="font-weight-medium">Status</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
<th class="font-weight-medium">S.No </th>
|
||||
<th class="font-weight-medium">Batch Code </th>
|
||||
<th class="font-weight-medium">File Name </th>
|
||||
<th class="font-weight-medium">Client </th>
|
||||
<th class="font-weight-medium">Client Branch </th>
|
||||
<th class="font-weight-medium">Client Policy </th>
|
||||
<th class="font-weight-medium">Event Type </th>
|
||||
<th class="font-weight-medium">Insurer/ TPA </th>
|
||||
<th class="font-weight-medium">Action </th>
|
||||
<th class="font-weight-medium">Count </th>
|
||||
<th class="font-weight-medium">(₹)Amount </th>
|
||||
<th class="font-weight-medium">User/Time </th>
|
||||
<th class="font-weight-medium">Status </th>
|
||||
<th class="font-weight-medium">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
?>
|
||||
|
||||
<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 style="overflow: hidden;" class="reload truncate" data-toggle="tooltip" data-placement="top" title="<?php echo $file['file_name'] ?>">
|
||||
<?php echo $file['file_name']?>
|
||||
@ -215,24 +215,42 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#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-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: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Batch List',
|
||||
className: 'my_class',
|
||||
}],
|
||||
initComplete: function(settings, json) {
|
||||
$('.my_class').css({
|
||||
position: "relative",
|
||||
left: "50px"
|
||||
});
|
||||
},
|
||||
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: 'Batch List',
|
||||
className: 'app-btn-primary ',
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true
|
||||
});
|
||||
|
||||
@ -162,7 +162,7 @@
|
||||
|
||||
<div class="row d-flex align-items-center">
|
||||
<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 class="StatusTileHide" style="display: none;padding-left: 15px;">
|
||||
<a href="#" id="mainMenuTiles">Current Tile : </a>
|
||||
|
||||
@ -22,7 +22,6 @@
|
||||
</style>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12" id="second_page">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
@ -82,7 +81,6 @@
|
||||
</div> <!-- end card-body -->
|
||||
</div> <!-- end card -->
|
||||
</div> <!-- end col-12 -->
|
||||
</div> <!-- end row -->
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
@ -94,22 +92,32 @@
|
||||
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: 'collection',
|
||||
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
|
||||
className: 'btn app-btn-secondary ',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
title: 'BDS TAT BAND WISE DATA',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
title: 'BDS TAT BAND WISE DATA',
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true,
|
||||
pageLength: 10,
|
||||
|
||||
@ -9,8 +9,7 @@ table.dataTable tbody td {
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row" id="inception_list">
|
||||
<div class="col-12">
|
||||
<div class="col-12" id="inception_list">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
@ -24,7 +23,7 @@ table.dataTable tbody td {
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>
|
||||
<div class="column-header">S.No.</div>
|
||||
<div class="column-header">S.No </div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="column-header">Renewal Month</div>
|
||||
@ -100,7 +99,6 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@ -115,24 +113,34 @@ $(document).ready(function() {
|
||||
dom: "<'row'<'col-sm-2'f><'col-sm-10 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [
|
||||
{
|
||||
extend: 'collection',
|
||||
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
|
||||
className: 'btn app-btn-secondary ',
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
title: 'Renewal-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
title: 'Renewal-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 20, // Set default number of rows per page (optional)
|
||||
@ -142,4 +150,39 @@ $(document).ready(function() {
|
||||
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>
|
||||
@ -75,22 +75,35 @@ table.dataTable tbody td {
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
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>',
|
||||
className: 'app-btn-primary ',
|
||||
title: 'Insurer-Wise-Report-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
title: 'Insurer-Wise-Report-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
className: 'app-btn-primary ',
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 10, // Set default number of rows per page (optional)
|
||||
|
||||
@ -75,22 +75,35 @@ table.dataTable tbody td {
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Bap-Wise-Report-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Bap-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>',
|
||||
className: 'app-btn-primary ',
|
||||
title: 'Bap-Wise-Report-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
className: 'app-btn-primary ',
|
||||
title: 'Bap-Wise-Report-List',
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 10, // Set default number of rows per page (optional)
|
||||
|
||||
@ -94,22 +94,54 @@
|
||||
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: 'BDS TAT BAND WISE DATA',
|
||||
// },
|
||||
// {
|
||||
// extend: 'excel',
|
||||
// text: 'Excel',
|
||||
// title: 'BDS TAT BAND WISE DATA',
|
||||
// },
|
||||
|
||||
// ],
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'BDS TAT BAND WISE DATA',
|
||||
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: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'BDS TAT BAND WISE DATA',
|
||||
},
|
||||
|
||||
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 ',
|
||||
title: 'BDS TAT BAND WISE DATA',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
title: 'BDS TAT BAND WISE DATA',
|
||||
className: 'app-btn-primary ',
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true,
|
||||
pageLength: 10,
|
||||
|
||||
@ -1,59 +1,62 @@
|
||||
<style>
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
.col-12 {
|
||||
|
||||
max-width: 98% !important;
|
||||
}
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
.custom-dropdown-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #ffffff !important;
|
||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||
border-radius: 0.25rem;
|
||||
padding: 0.5rem 0;
|
||||
min-width: 10rem;
|
||||
z-index: 9999;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
padding: 0.5rem 1rem !important;
|
||||
color: #212529 !important;
|
||||
text-decoration: none !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
.custom-dropdown-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #ffffff !important;
|
||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||
border-radius: 0.25rem;
|
||||
padding: 0.5rem 0;
|
||||
min-width: 10rem;
|
||||
z-index: 9999;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item:hover {
|
||||
background-color: #f8f9fa !important;
|
||||
color: #16181b !important;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
.custom-dropdown-menu .dropdown-item {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
padding: 0.5rem 1rem !important;
|
||||
color: #212529 !important;
|
||||
text-decoration: none !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item:hover {
|
||||
background-color: #f8f9fa !important;
|
||||
color: #16181b !important;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
</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 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"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
</h4>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
@ -64,11 +67,11 @@ table.dataTable tbody td {
|
||||
<select class="form-control" id="client_id" name="client_id">
|
||||
<option value="0">Select Client</option>
|
||||
<?php
|
||||
if (isset($clients) && count($clients)) {
|
||||
foreach ($clients as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['client_name'] . "</option>";
|
||||
}
|
||||
if (isset($clients) && count($clients)) {
|
||||
foreach ($clients as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['client_name'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
@ -79,9 +82,9 @@ table.dataTable tbody td {
|
||||
<select class="form-control" id="insurer_id" name="insurer_id">
|
||||
<option value="0" selected>Select Insurer</option>
|
||||
<?php if (isset($insurer) && count($insurer)) { ?>
|
||||
<?php foreach ($insurer as $value) { ?>
|
||||
<option value="<?= $value['id']?>"><?= $value['name']?></option>
|
||||
<?php } ?>
|
||||
<?php foreach ($insurer as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
@ -91,11 +94,11 @@ table.dataTable tbody td {
|
||||
<select class="form-control" id="policy_type_id" name="policy_type_id">
|
||||
<option value="0">Select Policy Type</option>
|
||||
<?php
|
||||
if (isset($policy_types) && count($policy_types)) {
|
||||
foreach ($policy_types as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
|
||||
}
|
||||
if (isset($policy_types) && count($policy_types)) {
|
||||
foreach ($policy_types as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
@ -105,11 +108,11 @@ table.dataTable tbody td {
|
||||
<select class="form-control" id="issuer" name="issuer" required>
|
||||
<option value="0">Select Issure</option>
|
||||
<?php
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
@ -124,36 +127,36 @@ table.dataTable tbody td {
|
||||
onchange="hideDateField()">
|
||||
<option value="0">Select Date Type</option>
|
||||
<?php
|
||||
if (isset($date_type) && count($date_type)) {
|
||||
foreach ($date_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
if (isset($date_type) && count($date_type)) {
|
||||
foreach ($date_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3" style="display: none;" id="date_div">
|
||||
<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%">
|
||||
<i class="mdi mdi-calendar-blank"></i>
|
||||
<span></span> <i class="mdi mdi-menu-down"></i>
|
||||
<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>
|
||||
<input type="hidden" id="startDate">
|
||||
<input type="hidden" id="endDate">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 text-right m-b-0" style="margin-top: 29px;">
|
||||
<a href="<?= base_url("/policy_tranction/report/report-business-list"); ?>"
|
||||
class="btn btn-secondary" id="clear-filters">Clear</a>
|
||||
<a href="<?= base_url("/policy_tranction/report/report-business-list"); ?>"
|
||||
class="btn btn-primary" id="get-emp-list"
|
||||
onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<a href="<?= base_url("/policy_tranction/report/report-business-list"); ?>"
|
||||
class="btn btn-secondary" id="clear-filters">Clear</a>
|
||||
<a href="<?= base_url("/policy_tranction/report/report-business-list"); ?>"
|
||||
class="btn btn-primary" id="get-emp-list"
|
||||
onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- <div class="form-group text-right m-b-0">
|
||||
<button type="button" class="btn btn-secondary" id="clear-filters">Clear</button>
|
||||
<a href="<?= base_url("/policy_tranction/report/list"); ?>"
|
||||
@ -167,8 +170,10 @@ table.dataTable tbody td {
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-12" id="second_page">
|
||||
<div class="card">
|
||||
<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">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S.No</th>
|
||||
<th>Client Name</th>
|
||||
<th>Insurer</th>
|
||||
<th>Policy</th>
|
||||
<th>Policy No</th>
|
||||
<th>Endorsement No</th>
|
||||
<th>Event Type</th>
|
||||
<th>S.No </th>
|
||||
<th>Client Name </th>
|
||||
<th>Insurer </th>
|
||||
<th>Policy </th>
|
||||
<th>Policy No </th>
|
||||
<th>Endorsement No </th>
|
||||
<th>Event Type </th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -196,7 +201,7 @@ table.dataTable tbody td {
|
||||
<?php if (isset($business_list)) { ?>
|
||||
<?php foreach($business_list as $index => $row){ ?>
|
||||
<tr>
|
||||
<td><?= $index + 1 ?></td>
|
||||
<td class="text-center"><?= $index + 1 ?></td>
|
||||
<td><?php echo $row['client_name']; ?></td>
|
||||
<td><?php echo $row['insurer_name']; ?></td>
|
||||
<td><?php echo $row['policy_type']; ?></td>
|
||||
@ -217,13 +222,13 @@ table.dataTable tbody td {
|
||||
echo base_url("/policy_tranction/endorsement/list") . '?pt_id=' . $row['policy_trns_id'];
|
||||
}
|
||||
?>" id="get-policy-list" class="dropdown-item btnEdit">
|
||||
<i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -236,159 +241,167 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const table = document.getElementById("scroll-horizontal-datatable");
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const table = document.getElementById("scroll-horizontal-datatable");
|
||||
|
||||
// Create custom dropdown
|
||||
function createCustomDropdown(row) {
|
||||
// Get the original dropdown items
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
|
||||
// Create new dropdown with proper background and spacing
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
|
||||
// Copy inner content while maintaining icon alignment
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
return customDropdown;
|
||||
}
|
||||
// Create custom dropdown
|
||||
function createCustomDropdown(row) {
|
||||
// Get the original dropdown items
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
|
||||
let activeDropdown = null;
|
||||
// Create new dropdown with proper background and spacing
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
|
||||
// Append the custom dropdown to the body
|
||||
document.body.appendChild(customDropdown);
|
||||
// Copy inner content while maintaining icon alignment
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the action column
|
||||
if (event.target.closest('td:last-child')) {
|
||||
return;
|
||||
}
|
||||
return customDropdown;
|
||||
}
|
||||
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
let activeDropdown = null;
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown with some offset
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
// Set as active dropdown
|
||||
activeDropdown = customDropdown;
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
// Append the custom dropdown to the body
|
||||
document.body.appendChild(customDropdown);
|
||||
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the action column
|
||||
if (event.target.closest('td:last-child')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Close the dropdown after handling the click
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown with some offset
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
// Set as active dropdown
|
||||
activeDropdown = customDropdown;
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
}
|
||||
|
||||
// Close the dropdown after handling the click
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function() {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function() {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
// Datatable document ready
|
||||
$(document).ready(function() {
|
||||
|
||||
// Datatable document ready
|
||||
$(document).ready(function() {
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
},
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
customize: function(xlsx) {
|
||||
var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
||||
var total = 0;
|
||||
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-BDS-List'
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel"></i><span class="btn-custom"> EXCEL </span>',
|
||||
title: 'Policy-Tranction-BDS-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;
|
||||
// Sum values in column AB (28th column)
|
||||
$('row c[r^="AB"]', sheet).each(function() {
|
||||
var value = parseFloat($('v', this).text());
|
||||
if (!isNaN(value)) {
|
||||
total += value;
|
||||
}
|
||||
});
|
||||
|
||||
// Get last row index and append total row
|
||||
var lastRow = $('row:last', sheet);
|
||||
var rowIndex = parseInt(lastRow.attr('r')) + 2;
|
||||
|
||||
var totalRow =
|
||||
'<row r="' + rowIndex + '">' +
|
||||
'<c t="inlineStr" r="AA' + rowIndex + '"><is><t>Total</t></is></c>' +
|
||||
'<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '</v></c>' +
|
||||
'</row>';
|
||||
|
||||
$(sheet).find('sheetData').append(totalRow);
|
||||
}
|
||||
});
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 25, // Set default number of rows per page (optional)
|
||||
ordering: false,
|
||||
paging: true,
|
||||
pageLength: 10,
|
||||
ordering: false
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
getURLParams()
|
||||
$('#client_id').select2();
|
||||
@ -487,7 +500,7 @@ $(function() {
|
||||
// var end = moment();
|
||||
|
||||
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'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
@ -495,6 +508,7 @@ $(function() {
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
locale: { format: 'DD-MM-YYYY' },
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
@ -505,53 +519,174 @@ $(function() {
|
||||
.endOf('month')
|
||||
]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
|
||||
$('#clear-filters').on('click', function() {
|
||||
// Reset all select dropdowns to the first option
|
||||
$('#client_id').val('0').change();
|
||||
$('#insurer_id').val('0').change();
|
||||
$('#policy_type_id').val('0').change();
|
||||
$('#date_type').val('0');
|
||||
$('#issuer').val('0');
|
||||
$('#date_div').hide()
|
||||
|
||||
// Reset the date range picker to default
|
||||
$('#reportrange').data('daterangepicker').setStartDate(moment().subtract(29, 'days'));
|
||||
$('#reportrange').data('daterangepicker').setEndDate(moment());
|
||||
cb(start, end); // Update the displayed date range
|
||||
});
|
||||
|
||||
});
|
||||
$(document).ready(function() {
|
||||
getURLParams()
|
||||
$('#client_id').select2();
|
||||
$('#insurer_id').select2();
|
||||
$('#policy_type_id').select2();
|
||||
})
|
||||
|
||||
function hideDateField(input = null) {
|
||||
let val = $('#date_type').val();
|
||||
function fetchEmpolyeeList(event) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
|
||||
if (input) {
|
||||
val = input;
|
||||
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;
|
||||
}
|
||||
|
||||
if (val != 0) {
|
||||
$('#date_div').show()
|
||||
} else {
|
||||
$('#date_div').hide()
|
||||
function objectToQueryString(obj) {
|
||||
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
|
||||
}
|
||||
}
|
||||
|
||||
function sendPolicyTransactionID(event, pt_id) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
function getURLParams() {
|
||||
const url = new URL(window.location.href);
|
||||
const params = new URLSearchParams(url.search);
|
||||
|
||||
console.log(pt_id);
|
||||
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
|
||||
|
||||
var queryParams = {
|
||||
pt_id: pt_id,
|
||||
};
|
||||
hideDateField(date_type)
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const apiURL = $('#get-policy-list').attr('href') + "?" + queryString;
|
||||
console.log(apiURL);
|
||||
window.location.href = apiURL;
|
||||
}
|
||||
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')
|
||||
]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
|
||||
$('#clear-filters').on('click', function() {
|
||||
// Reset all select dropdowns to the first option
|
||||
$('#client_id').val('0').change();
|
||||
$('#insurer_id').val('0').change();
|
||||
$('#policy_type_id').val('0').change();
|
||||
$('#date_type').val('0');
|
||||
$('#issuer').val('0');
|
||||
$('#date_div').hide()
|
||||
|
||||
// Reset the date range picker to default
|
||||
$('#reportrange').data('daterangepicker').setStartDate(moment().subtract(29, 'days'));
|
||||
$('#reportrange').data('daterangepicker').setEndDate(moment());
|
||||
cb(start, end); // Update the displayed date range
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function hideDateField(input = null) {
|
||||
let val = $('#date_type').val();
|
||||
|
||||
if (input) {
|
||||
val = input;
|
||||
}
|
||||
|
||||
if (val != 0) {
|
||||
$('#date_div').show()
|
||||
} else {
|
||||
$('#date_div').hide()
|
||||
}
|
||||
}
|
||||
|
||||
function sendPolicyTransactionID(event, pt_id) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
|
||||
console.log(pt_id);
|
||||
|
||||
var queryParams = {
|
||||
pt_id: pt_id,
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const apiURL = $('#get-policy-list').attr('href') + "?" + queryString;
|
||||
console.log(apiURL);
|
||||
window.location.href = apiURL;
|
||||
}
|
||||
</script>
|
||||
@ -56,41 +56,42 @@ table.dataTable thead th {
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<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;">
|
||||
<h4 style="position: relative;">CD Master</h4>
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right; position: relative;top: 56px;">
|
||||
<!-- <button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light"
|
||||
<!- <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-trigger="hover">ADD</button> -->
|
||||
data-trigger="hover">ADD</button> ->
|
||||
</div>
|
||||
</div>
|
||||
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap" >
|
||||
</div> -->
|
||||
|
||||
<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">
|
||||
<tr>
|
||||
<th class="font-weight-medium">S.No.</th>
|
||||
<th class="font-weight-medium">Client Name</th>
|
||||
<th class="font-weight-medium">Insurer Name</th>
|
||||
<th class="font-weight-medium">Insurer Branch Name</th>
|
||||
<th class="font-weight-medium">Opening Date</th>
|
||||
<th class="font-weight-medium">CD Account No</th>
|
||||
<th class="font-weight-medium">Opening Amount</th>
|
||||
<th class="font-weight-medium">Date/User</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
<th class="font-weight-medium">S.No </th>
|
||||
<th class="font-weight-medium">Client Name </th>
|
||||
<th class="font-weight-medium">Insurer Name </th>
|
||||
<th class="font-weight-medium">Insurer Branch Name </th>
|
||||
<th class="font-weight-medium">Opening Date </th>
|
||||
<th class="font-weight-medium">CD Account No </th>
|
||||
<th class="font-weight-medium">Opening Amount </th>
|
||||
<th class="font-weight-medium">Date/User </th>
|
||||
<th class="font-weight-medium">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="app-table-body">
|
||||
<?php foreach($CD_Master_Data as $index => $row){ ?>
|
||||
<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['insurer_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 $row['cd_ac_no']; ?></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>
|
||||
<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>
|
||||
@ -213,35 +214,82 @@ table.dataTable thead th {
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#scroll-horizontal-datatable').DataTable({
|
||||
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) {
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-2'f><'col-sm-10 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [
|
||||
{
|
||||
text: '<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();
|
||||
}
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'collection',
|
||||
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
|
||||
className: 'btn app-btn-secondary ',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
title: 'CD-Master-List',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
className: 'app-btn-primary my_class',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
className: 'app-btn-primary ',
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
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(){
|
||||
|
||||
@ -64,14 +64,14 @@
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Files</h4>
|
||||
<h4 style="position: relative;">Claim Dump Upload</h4>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<table data-custom-table-css="table" class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<th class="font-weight-medium">S.No </th>
|
||||
<th class="font-weight-medium">File name</th>
|
||||
<th class="font-weight-medium">User/Time</th>
|
||||
<th class="font-weight-medium">Status</th>
|
||||
@ -86,21 +86,25 @@
|
||||
?>
|
||||
|
||||
<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'] ?>">
|
||||
<?php echo $file['file_name'] ?>
|
||||
</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 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="#" class='fe-alert-circle' onclick="fetchFileError(<?= $file['file_id'] ?>)"></a>
|
||||
</span>
|
||||
<?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="#"
|
||||
style="color : #938e04ff ;">
|
||||
<?= $file['status'] ?>
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<?= $file['status'] ?>
|
||||
<span style="color : #34A853 ;"> <?= $file['status'] ?> </span>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td>
|
||||
@ -156,7 +160,7 @@
|
||||
<!-- [ <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>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
@ -293,8 +297,12 @@
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 15, // Set default number of rows per page (optional)
|
||||
|
||||
@ -19,7 +19,15 @@
|
||||
|
||||
<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">
|
||||
<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">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S.No</th>
|
||||
<th>Docs Name</th>
|
||||
<th>File Name</th>
|
||||
<th>Action</th>
|
||||
<th>S.No </th>
|
||||
<th>Docs Name </th>
|
||||
<th>File Name </th>
|
||||
<th>Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="table_bd">
|
||||
@ -191,8 +199,9 @@ function addHTMLInput()
|
||||
>
|
||||
</div>
|
||||
<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-primary waves-effect waves-light mr-1" onclick="addHTMLInput(this)">+</a>
|
||||
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInput(this)" style="background-color: #BD0707;">
|
||||
<i class="mdi mdi-delete" ></i>
|
||||
</a>
|
||||
</div>
|
||||
`;
|
||||
container.appendChild(newRow);
|
||||
@ -265,7 +274,7 @@ function create_url_list(data) {
|
||||
data.forEach((item, index) => {
|
||||
html += `
|
||||
<tr>
|
||||
<td>${index + 1}</td>
|
||||
<td class="text-center">${index + 1}</td>
|
||||
<td>${item.doc_name}</td>
|
||||
<td><a href="${item.url}" target="_blank">${item.url}</a></td>
|
||||
<td>
|
||||
|
||||
@ -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="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 class="goBack" style="display: none;padding-left: 15px;">
|
||||
<a href="#" id="current_tile">Current Tile : </a>
|
||||
|
||||
@ -7,10 +7,6 @@
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
@ -92,10 +88,24 @@
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
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,
|
||||
pageLength: 10,
|
||||
ordering: false
|
||||
|
||||
@ -7,9 +7,6 @@
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
@ -33,7 +30,8 @@
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th style="text-align: center;" colspan="8">OPEN</th>
|
||||
<th style="text-align: center;" colspan="5" >CLEARED</th>
|
||||
|
||||
<th style="text-align: center;" colspan="7" >CLEARED</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php foreach ($column_order as $col_name): ?>
|
||||
@ -88,10 +86,24 @@
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
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,
|
||||
pageLength: 10,
|
||||
ordering: false
|
||||
|
||||
@ -110,13 +110,14 @@ input:checked + .slider:before {
|
||||
<div class="form-group col-md-4">
|
||||
<label for="client_name">Client Name<span
|
||||
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>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="short_name">Client Short Name<span
|
||||
class="text-danger">*</span></label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -70,6 +70,13 @@
|
||||
<div class="row" id="add_branch">
|
||||
<div class="col-12">
|
||||
<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;">
|
||||
<button type="button" id="btnBranchBack"
|
||||
class="btn btn-primary waves-effect waves-light btn-sm btnBack"><span class="mdi mdi-format-list-bulleted"
|
||||
@ -79,10 +86,20 @@
|
||||
<hr>
|
||||
|
||||
<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() ?>" />
|
||||
|
||||
|
||||
<!-- post_client_id as client_id -->
|
||||
<input type="hidden" name="client_id" id="client_id_branch"
|
||||
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" />
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
@ -181,12 +198,13 @@
|
||||
<div class="form-group col-md-6">
|
||||
<label for="last_name">Email<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Email"
|
||||
name="email[]" id="email" data-parsley-trigger="change" data-parsley-type="email" 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 class="form-group col-md-6">
|
||||
<label for="mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Contact Mobile"
|
||||
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"
|
||||
data-parsley-type-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('');
|
||||
$('#branch_city').val('');
|
||||
$('#branch_form')[0].reset();
|
||||
$('#branch_form').parsley().reset();
|
||||
$('#pre_branch_id').val('');
|
||||
$('#branch_id_primarykey').val('');
|
||||
|
||||
$('.ac').css('display', 'block');
|
||||
contactCount = 1
|
||||
|
||||
@ -351,13 +373,14 @@ $("#branch_form").submit(function(event) {
|
||||
|
||||
var selectedValues = $("#selected").val();
|
||||
console.log(selectedValues, selectedValues);
|
||||
console.log("branch_id_primarykey", $('#branch_id_primarykey').val());
|
||||
|
||||
|
||||
let level_contect_data = getContactsData();
|
||||
console.log('level_contect_data', level_contect_data);
|
||||
|
||||
event.preventDefault();
|
||||
branch_PrimaryKey = $('#client_id_branch').val();
|
||||
|
||||
console.log('branch_PrimaryKey', branch_PrimaryKey)
|
||||
|
||||
if (branch_PrimaryKey === '') {
|
||||
@ -377,6 +400,7 @@ $("#branch_form").submit(function(event) {
|
||||
|
||||
var formData = new FormData($('#branch_form')[0]);
|
||||
|
||||
|
||||
const jsonString = JSON.stringify(selectedValues);
|
||||
const level_contect_data_json_string = JSON.stringify(level_contect_data);
|
||||
console.log('jsonString', jsonString);
|
||||
@ -467,6 +491,9 @@ $("#branch_form").submit(function(event) {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
console.log('Something Wrong!', 'warning');
|
||||
if(xhr.status === 409){
|
||||
alert('The Current Branch is Already Existing..!!');
|
||||
}
|
||||
}, 300);
|
||||
},
|
||||
complete: function() {
|
||||
@ -534,6 +561,7 @@ $('body').on('click', '.btnBranchEdit', function() {
|
||||
$('#district').val(res.data.district);
|
||||
$('#branch_city').val(res.data.city);
|
||||
$('#branch_PrimaryKey').val(res.data.id);
|
||||
$('#pre_branch_id').val(res.data.pre_branch_id??'')
|
||||
|
||||
if(res.data.sez == 1){
|
||||
$('#sez').prop('checked', true);
|
||||
@ -625,11 +653,11 @@ function appendContactHtml(contact = false, reset = false) {
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="${uniqueId}_last_name">Email<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.email : ''}" type="text" class="form-control" placeholder="Enter Contact Email" name="email[]" id="${uniqueId}_email" data-parsley-trigger="change" data-parsley-type="email" 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 class="form-group col-md-6">
|
||||
<label for="${uniqueId}_mobile">Mobile<span class="text-danger">*</span></label>
|
||||
<input value="${contact !== undefined && contact !== false ? contact.mobile : ''}" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="${uniqueId}_mobile" 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 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){
|
||||
|
||||
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; // don’t 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() {
|
||||
const contacts = [];
|
||||
|
||||
|
||||
@ -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>
|
||||
</div> -->
|
||||
</div>
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<table data-custom-table-css="table" class="table mb-0 nowrap w-100 table-centered" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Insurer Name</th>
|
||||
<th class="font-weight-medium">Insurer Branch Name</th>
|
||||
<th class="font-weight-medium">CD Account Number</th>
|
||||
<th class="font-weight-medium">Current Balance</th>
|
||||
<th class="font-weight-medium">Insurer Name </th>
|
||||
<th class="font-weight-medium">Insurer Branch Name </th>
|
||||
<th class="font-weight-medium">CD Account Number </th>
|
||||
<th class="font-weight-medium">Current Balance </th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -70,31 +69,43 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>",
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Client Deposit Details - ' + ' <?php echo $clientName[0]['client_name'];?>',
|
||||
className: 'my_class',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
},
|
||||
{
|
||||
extend: 'pdf',
|
||||
text: 'PDF',
|
||||
title: 'Client Deposit Details - ' + ' <?php echo $clientName[0]['client_name'];?>',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
// 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>>>",
|
||||
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>',
|
||||
title: 'Client Deposit Details - ' + ' <?php echo $clientName[0]['client_name'];?>',
|
||||
className: 'app-btn-primary ',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
},
|
||||
{
|
||||
extend: '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'];?>',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
className: 'app-btn-primary ',
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -21,8 +21,18 @@
|
||||
|
||||
<div class="row" style="padding-top: 20px;margin-bottom: 18px;">
|
||||
<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 class="col-6">
|
||||
@ -30,8 +40,6 @@
|
||||
<div class="row">
|
||||
|
||||
<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 class="col-1 float-right" style="position: relative;left: 255px;">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse"
|
||||
@ -125,28 +133,36 @@
|
||||
<?php if($value['open_for_enrollment'] == 'Open' ) { ?>
|
||||
|
||||
<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') { ?>
|
||||
|
||||
<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 { ?>
|
||||
|
||||
<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 } ?>
|
||||
</td>
|
||||
<td>
|
||||
<?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 { ?>
|
||||
|
||||
<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 } ?>
|
||||
</td>
|
||||
|
||||
@ -1,49 +1,15 @@
|
||||
<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>
|
||||
|
||||
<style> .card-body{ margin-top: 0px !important; } </style>
|
||||
|
||||
<div class="tab-pane fade" id="KYC-DOC-tab">
|
||||
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<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>
|
||||
<tr>
|
||||
<th>S.no</th>
|
||||
<th>S. No</th>
|
||||
<th>Document Name</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
@ -63,7 +29,7 @@
|
||||
|
||||
<div class="row" id="others">
|
||||
<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">
|
||||
<h3>Additional Documents</h3>
|
||||
<form role="form" class="parsley-examples" method="post" id="kyc_form"
|
||||
@ -101,10 +67,10 @@
|
||||
</div> <!-- end row -->
|
||||
|
||||
<div class="col-lg-12" id="other_docs_table">
|
||||
<div class="card">
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<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>
|
||||
<tr>
|
||||
<th>Document Name</th>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
|
||||
<style>
|
||||
.table th,
|
||||
/* .table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
@ -11,7 +11,7 @@ table.dataTable tbody td {
|
||||
|
||||
table.dataTable thead th {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
} */
|
||||
|
||||
.col-12{
|
||||
|
||||
@ -74,32 +74,31 @@ table.dataTable thead th {
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Client List</h4>
|
||||
</div>
|
||||
<!-- <div class="row" style="margin-bottom:1rem;">-->
|
||||
<!-- <div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Client</h4>
|
||||
</div> -->
|
||||
<!-- <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>
|
||||
</div>
|
||||
<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>
|
||||
</div> -->
|
||||
</div>
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<!-- </div>-->
|
||||
<table data-custom-table-css="table" class="table mb-0 nowrap" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">S.No</th>
|
||||
<th class="font-weight-medium">Client Name</th>
|
||||
<th class="font-weight-medium">Account Manager</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
<th class="font-weight-medium">S.No </th>
|
||||
<th class="font-weight-medium">Client Name </th>
|
||||
<th class="font-weight-medium">Account Manager </th>
|
||||
<th class="font-weight-medium">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php foreach($clientList as $index => $row){ ?>
|
||||
<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>
|
||||
<?php $account_managers = ''; ?>
|
||||
@ -108,7 +107,9 @@ table.dataTable thead th {
|
||||
<?php $account_managers .= $client->account_manager . ', '; ?>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php echo rtrim($account_managers, ', '); ?>
|
||||
<?php
|
||||
$account_managers = rtrim($account_managers, ', ');
|
||||
echo $account_managers !== '' ? $account_managers : 'N/A'; ?>
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
@ -166,7 +167,8 @@ table.dataTable thead th {
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div>
|
||||
</div><!-- /.modal -->
|
||||
</div>
|
||||
<!-- /.modal -->
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
@ -292,15 +294,15 @@ table.dataTable thead th {
|
||||
$(document).ready(function(){
|
||||
$('#lead_id').select2();
|
||||
})
|
||||
|
||||
var table;
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-2'f><'col-sm-10 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
table = $('#tickets-table').DataTable({
|
||||
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-5'i><'col-sm-7'p>>",
|
||||
|
||||
buttons: [
|
||||
|
||||
{
|
||||
text: 'Add From Lead',
|
||||
className: 'btn-filter add-from-lead', // custom class
|
||||
@ -309,37 +311,138 @@ $(document).ready(function()
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '+ create New Client',
|
||||
className: 'btn-filter buttons-html5', // custom class
|
||||
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) {
|
||||
addClient();
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'ClientList',
|
||||
className: 'my_class',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
}
|
||||
],
|
||||
|
||||
initComplete: function() {
|
||||
$('.btn-filter')
|
||||
.removeClass('btn-secondary')
|
||||
.addClass('btn btn-primary');
|
||||
},
|
||||
{
|
||||
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: 'Client-List',
|
||||
// title: function() {
|
||||
// return $('#toggleButtons').is(':checked')
|
||||
// ? 'GC-Client-List'
|
||||
// : 'RC-Client-List';
|
||||
// },
|
||||
className: 'app-btn-primary ',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
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 ,
|
||||
// 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
|
||||
// function removeClient(element)
|
||||
// {
|
||||
|
||||
@ -1,44 +1,39 @@
|
||||
<style>
|
||||
body {
|
||||
.multiselect-native-select {
|
||||
position: relative;
|
||||
|
||||
/* bottom: 32px; */
|
||||
select {
|
||||
border: 0 !important;
|
||||
clip: rect(0 0 0 0) !important;
|
||||
height: 1px !important;
|
||||
margin: -1px -1px -1px -3px !important;
|
||||
overflow: hidden !important;
|
||||
padding: 0 !important;
|
||||
position: absolute !important;
|
||||
width: 1px !important;
|
||||
left: 50%;
|
||||
top: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.multiselect-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.multiselect-selected-text {
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
body {
|
||||
.multiselect-native-select {
|
||||
position: relative;
|
||||
/* bottom: 32px; */
|
||||
select {
|
||||
border: 0 !important;
|
||||
clip: rect(0 0 0 0) !important;
|
||||
height: 1px !important;
|
||||
margin: -1px -1px -1px -3px !important;
|
||||
overflow: hidden !important;
|
||||
padding: 0 !important;
|
||||
position: absolute !important;
|
||||
width: 1px !important;
|
||||
left: 50%;
|
||||
top: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.multiselect-container{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.multiselect-selected-text{
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.navtab-bg .nav-link {
|
||||
margin: 0 5px 10px!important;
|
||||
}
|
||||
|
||||
.readonly-select {
|
||||
pointer-events: none;
|
||||
/* background-color: #f0f0f0; */
|
||||
background-color: #e0e0e0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.readonly-select {
|
||||
pointer-events: none;
|
||||
/* background-color: #f0f0f0; */
|
||||
background-color: #e0e0e0;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
@ -47,10 +42,6 @@ body {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.user-card {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
@ -90,7 +81,7 @@ body {
|
||||
font-size: 0.85em;
|
||||
opacity: 0.9;
|
||||
margin: 0;
|
||||
color:rgb(56, 55, 55);
|
||||
color: rgb(56, 55, 55);
|
||||
}
|
||||
|
||||
.accordion-icon {
|
||||
@ -259,48 +250,19 @@ body {
|
||||
border: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
#client_add .nav-pills ,
|
||||
#client_add .nav-link
|
||||
{
|
||||
background-color: #F5FFFF !important;
|
||||
color : #00999E !important;
|
||||
border-radius:10px;
|
||||
|
||||
}
|
||||
|
||||
#client_add .nav-pills
|
||||
{
|
||||
background-color: #F5FFFF !important;
|
||||
color : #00999E !important;
|
||||
box-shadow: 0px 2px 4px 0px #00000040;
|
||||
padding-top: 5px ;
|
||||
}
|
||||
|
||||
|
||||
#client_add .nav-link.active-tab {
|
||||
color: white !important;
|
||||
background-color: #00999E !important;
|
||||
font-size: small !important;
|
||||
padding:8px 16px;
|
||||
border-radius: 10px !important;
|
||||
box-shadow: 0px 2px 4px 0px #00000040;
|
||||
|
||||
}
|
||||
|
||||
#hr_activity_history_append_area{
|
||||
padding-top:0;
|
||||
margin-top:0;
|
||||
#hr_activity_history_append_area {
|
||||
padding-top: 0;
|
||||
margin-top: 0;
|
||||
background-color: #F5FFFF !important;
|
||||
border: 2px solid #F5FFFF;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 4px 4px 0px #00000040;
|
||||
}
|
||||
|
||||
#hr_activity_history_append_area tbody tr{
|
||||
#hr_activity_history_append_area tbody tr {
|
||||
background-color: white !important;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@ -311,78 +273,95 @@ body {
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<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 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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
<ul class="nav nav-pills navtab-bg" >
|
||||
<li class="nav-item">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-2 active" id="general_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
|
||||
<span class="d-none d-sm-inline-block">General</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#KYC-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="kyc_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-file"></i></span>
|
||||
<span class="d-none d-sm-inline-block">KYC Docs</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#RM-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="RM_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-account-switch"></i></span>
|
||||
<span class="d-none d-sm-inline-block"> Relationship Manager</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#branch-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="branch_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-source-branch"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Branch & Contacts</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#notification-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="notification_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-bell"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Notifications</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#police-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="policy_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-book-open-page-variant"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Policies</span>
|
||||
</a>
|
||||
</li>
|
||||
<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)">
|
||||
<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>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#hr-activity-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="hr_activity_tab" onclick="appendHrActivityHistoryHtml(this)">
|
||||
<span class="mr-1"><i class="mdi mdi-book-open-page-variant"></i></span>
|
||||
<span class="d-none d-sm-inline-block">HR Activity</span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- <li class="nav-item">
|
||||
<a href="#api-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="api_tab">
|
||||
<span class="mdi mdi-api"></span>
|
||||
<span class="d-none d-sm-inline-block">API</span>
|
||||
</a>
|
||||
</li> -->
|
||||
<!-- <li class="nav-item">
|
||||
<a href="#others-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="others_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-tag-text-outline"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Others</span>
|
||||
</a>
|
||||
</li> -->
|
||||
</ul>
|
||||
<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">◀</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-2 active" id="general_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
|
||||
<span class="d-none d-sm-inline-block">General</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#KYC-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="kyc_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-file"></i></span>
|
||||
<span class="d-none d-sm-inline-block">KYC Docs</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#RM-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="RM_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-account-switch"></i></span>
|
||||
<span class="d-none d-sm-inline-block"> Relationship Manager</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#branch-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="branch_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-source-branch"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Branch & Contacts</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#notification-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="notification_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-bell"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Notifications</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#police-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="policy_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-book-open-page-variant"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Policies</span>
|
||||
</a>
|
||||
</li>
|
||||
<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)">
|
||||
<span class="mr-1"><i class="mdi mdi-book-open-page-variant"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Client Access Control</span>
|
||||
<!-- Name Changed "HR Access Controll" into "Client Access Control" -->
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#hr-activity-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="hr_activity_tab" onclick="appendHrActivityHistoryHtml(this)">
|
||||
<span class="mr-1"><i class="mdi mdi-book-open-page-variant"></i></span>
|
||||
<span class="d-none d-sm-inline-block">HR Activity</span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- <li class="nav-item">
|
||||
<a href="#api-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="api_tab">
|
||||
<span class="mdi mdi-api"></span>
|
||||
<span class="d-none d-sm-inline-block">API</span>
|
||||
</a>
|
||||
</li> -->
|
||||
<!-- <li class="nav-item">
|
||||
<a href="#others-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="others_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-tag-text-outline"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Others</span>
|
||||
</a>
|
||||
</li> -->
|
||||
<li class="nav-item">
|
||||
<button class="scroll-btn right-btn" type="button">▶</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane fade" id="hr-access-tab">
|
||||
@ -408,7 +387,8 @@ body {
|
||||
</div>
|
||||
|
||||
<?php include("client_api.php"); ?>
|
||||
<?php // include('client_others_tab.php'); ?>
|
||||
<?php // include('client_others_tab.php');
|
||||
?>
|
||||
<?php include('notification.php'); ?>
|
||||
<?php include('client_basic_info.php'); ?>
|
||||
<?php include('client_kyc.php'); ?>
|
||||
@ -422,81 +402,141 @@ body {
|
||||
</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">×</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 hrActivityHistoryHtmlAppended = false;
|
||||
|
||||
function client_kyc_docs() {
|
||||
var check_client_id = $('#general_PrimaryKey');
|
||||
|
||||
|
||||
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();
|
||||
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
toastr.warning('Please Add the Client!', 'warning', {
|
||||
timeOut: 2000
|
||||
});
|
||||
} else {
|
||||
if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||
$('#btnBranchAdd').show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function client_relationship_manager() {
|
||||
var check_client_id = $('#general_PrimaryKey');
|
||||
|
||||
|
||||
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();
|
||||
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
toastr.warning('Please Add the Client!', 'warning', {
|
||||
timeOut: 2000
|
||||
});
|
||||
} else {
|
||||
$('#relation_form').show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function client_policies() {
|
||||
var check_client_id = $('#general_PrimaryKey').val();
|
||||
|
||||
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();
|
||||
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
toastr.warning('Please Add the Client!', 'warning', {
|
||||
timeOut: 2000
|
||||
});
|
||||
} else {
|
||||
if ($('#btnPolicyBack')[0].style.display == 'none') {
|
||||
$('#BtnAdd').show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function client_branch_contact() {
|
||||
var check_client_id = $('#general_PrimaryKey');
|
||||
|
||||
|
||||
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();
|
||||
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
toastr.warning('Please Add the Client!', 'warning', {
|
||||
timeOut: 2000
|
||||
});
|
||||
} else {
|
||||
if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||
$('#btnBranchAdd').show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function client_notification() {
|
||||
var check_client_id = $('#general_PrimaryKey');
|
||||
|
||||
|
||||
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();
|
||||
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
toastr.warning('Please Add the Client!', 'warning', {
|
||||
timeOut: 2000
|
||||
});
|
||||
} else {
|
||||
if ($('#notification-tab')[0].style.display == 'none') {
|
||||
$('#notification-tab').show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
document.getElementById("kyc_tab").addEventListener("click", function(event) {
|
||||
@ -513,7 +553,7 @@ body {
|
||||
event.preventDefault();
|
||||
client_policies();
|
||||
});
|
||||
|
||||
|
||||
document.getElementById("branch_tab").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
client_branch_contact();
|
||||
@ -524,16 +564,18 @@ body {
|
||||
client_notification();
|
||||
});
|
||||
|
||||
//HR Access Controll
|
||||
function appendHrAccessControllHtml(input){
|
||||
//HR Access Controll also know as "Client Access Control"
|
||||
function appendHrAccessControllHtml(input) {
|
||||
console.log(input.id);
|
||||
let client_id = $('#general_PrimaryKey').val();
|
||||
console.log('client_id ', client_id);
|
||||
|
||||
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) {
|
||||
console.log('Data fetched successfully:', response);
|
||||
|
||||
@ -550,13 +592,13 @@ body {
|
||||
console.error(xhr.responseText);
|
||||
hrAccessControlHtmlAppended = false;
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
console.log('Already HTML appended');
|
||||
}
|
||||
}
|
||||
|
||||
//HR Activity History
|
||||
function appendHrActivityHistoryHtml(input, submit = false){
|
||||
function appendHrActivityHistoryHtml(input, submit = false) {
|
||||
console.log(input.id);
|
||||
let client_id = $('#general_PrimaryKey').val();
|
||||
let startDate = $('#startDate').val();
|
||||
@ -565,14 +607,18 @@ body {
|
||||
console.log('startDate ', startDate);
|
||||
console.log('endDate ', endDate);
|
||||
|
||||
if(submit){
|
||||
hrActivityHistoryHtmlAppended = false;
|
||||
if (submit) {
|
||||
hrActivityHistoryHtmlAppended = false;
|
||||
}
|
||||
|
||||
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) {
|
||||
console.log('Data fetched successfully:', response);
|
||||
|
||||
@ -589,20 +635,18 @@ body {
|
||||
console.error(xhr.responseText);
|
||||
hrActivityHistoryHtmlAppended = false;
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
console.log('Already HTML appended');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function toggleAccordion(header) {
|
||||
if (event.target.classList.contains('fa-info-circle') ||
|
||||
event.target.parentElement.classList.contains('fa-info-circle')) {
|
||||
if (event.target.classList.contains('fa-info-circle') ||
|
||||
event.target.parentElement.classList.contains('fa-info-circle')) {
|
||||
getHrActivityHistory();
|
||||
return; // Do nothing if click was on the info icon
|
||||
return; // Do nothing if click was on the info icon
|
||||
}
|
||||
const card = header.parentElement;
|
||||
const content = card.querySelector('.card-content');
|
||||
@ -650,9 +694,8 @@ body {
|
||||
return Array.from(checkboxes).map(cb => parseInt(cb.value));
|
||||
}
|
||||
|
||||
function getHrActivityHistory()
|
||||
{
|
||||
console.log(event.target.dataset.id);//return;
|
||||
function getHrActivityHistory() {
|
||||
console.log(event.target.dataset.id); //return;
|
||||
let ids = event.target.dataset.id.split('-');
|
||||
console.log('ids', ids)
|
||||
let client_id = $('#general_PrimaryKey').val();
|
||||
@ -661,7 +704,12 @@ body {
|
||||
console.log(url);
|
||||
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);
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'GET', requestData, function(response) {
|
||||
@ -703,7 +751,10 @@ body {
|
||||
allowed_pre_policies: getCheckedValues(`${userId}_pre_policies`),
|
||||
allowed_active_policies: getCheckedValues(`${userId}_active_policies`),
|
||||
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);
|
||||
@ -721,7 +772,10 @@ body {
|
||||
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_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);
|
||||
|
||||
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) {
|
||||
console.log('Data fetched successfully:', response);
|
||||
@ -771,15 +828,15 @@ body {
|
||||
return Array.from(checkboxes).map(cb => cb.value);
|
||||
}
|
||||
|
||||
$(document).on('change', '.select-all', function () {
|
||||
$(document).on('change', '.select-all', function() {
|
||||
let $this = $(this);
|
||||
let type = $this.data('type');
|
||||
let user = $this.data('user');
|
||||
let group = $this.data('group');
|
||||
|
||||
console.log('--- SELECT-ALL CHANGED ---');
|
||||
console.log('Type:', type); // all / active / inactive
|
||||
console.log('User:', user); // user index
|
||||
console.log('Type:', type); // all / active / inactive
|
||||
console.log('User:', user); // user index
|
||||
console.log('Group:', group); // pre / post
|
||||
|
||||
// Step 1: Uncheck other "select-all" checkboxes in the same user/group
|
||||
@ -972,19 +1029,148 @@ body {
|
||||
|
||||
// console.log('--- END ---');
|
||||
// });
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
$('#btnAutoBranchFetch').click(function() {
|
||||
|
||||
var myModal = new bootstrap.Modal(document.getElementById('autoFetchBranchModal'));
|
||||
myModal.show();
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#auto_fetch_client').select2();
|
||||
$('#auto_fetch_branch').select2();
|
||||
|
||||
$('#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>
|
||||
$(document).ready(function(){
|
||||
$('#client_add .nav-link').click(function(){
|
||||
$('#submitAutoFetch').click(function() {
|
||||
|
||||
// change bg color of tab
|
||||
$('#client_add .nav-link').removeClass('active-tab');
|
||||
$(this).addClass('active-tab');
|
||||
|
||||
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>`);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
$('#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>
|
||||
@ -200,7 +200,8 @@
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</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 class="form-group col-md-4 EB">
|
||||
|
||||
@ -1,90 +1,101 @@
|
||||
<style>
|
||||
.col-12 {
|
||||
.col-12 {
|
||||
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.autocomplete-suggestions {
|
||||
border: 1px solid #d4d4d4;
|
||||
max-height: 150px;
|
||||
overflow-y: auto;
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
width: inherit;
|
||||
z-index: 1;
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.autocomplete-suggestions {
|
||||
border: 1px solid #d4d4d4;
|
||||
max-height: 150px;
|
||||
overflow-y: auto;
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
width: inherit;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.autocomplete-suggestion {
|
||||
padding: 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.autocomplete-suggestion:hover {
|
||||
background-color: #e9e9e9;
|
||||
padding: 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.autocomplete-suggestion:hover {
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12" style="margin-top: -12px;">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<form method="post" action="<?= base_url("/dmsSearch");?>" id='dms_search_form'>
|
||||
<div class="form-row">
|
||||
<div class="card-body">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h4 class="m-1">
|
||||
<span>Filter</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>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body" style="margin-top: 0px;">
|
||||
<div class="form-group">
|
||||
<form method="post" action="<?= base_url("/dmsSearch"); ?>" id='dms_search_form'>
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
<label for="customer">Customer</label>
|
||||
<!-- <div style="position:relative;"> -->
|
||||
<input type="text" class="form-control" id="customer" placeholder="Enter customer name">
|
||||
<input type="hidden" name="customer_id" class="form-control" id="customer_id" placeholder="Enter customer name">
|
||||
<div id="customer_suggestions" class="autocomplete-suggestions" style="display:none;"></div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="customer">Customer</label>
|
||||
<!-- <div style="position:relative;"> -->
|
||||
<input type="text" class="form-control" id="customer" placeholder="Enter customer name">
|
||||
<input type="hidden" name="customer_id" class="form-control" id="customer_id" placeholder="Enter customer name">
|
||||
<div id="customer_suggestions" class="autocomplete-suggestions" style="display:none;"></div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-2">
|
||||
<label for="customer">Customer document name</label>
|
||||
<!-- <div style="position:relative;"> -->
|
||||
<input type="text" name="cus_doc_name" class="form-control" id="cus_doc_name" placeholder="Enter customer doc name ">
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="form-group col-md-1" style="text-align: center;">
|
||||
OR
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="customer">Policy</label>
|
||||
<!-- <div style="position:relative;"> -->
|
||||
<input type="text" class="form-control" id="policy" placeholder="Enter policy no">
|
||||
<input type="hidden" name="policy_id" class="form-control" id="policy_id" placeholder="Enter policy no">
|
||||
<div id="policy_suggestions" class="autocomplete-suggestions" style="display:none;"></div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="customer">Customer document name</label>
|
||||
<!-- <div style="position:relative;"> -->
|
||||
<input type="text" name="cus_doc_name" class="form-control" id="cus_doc_name" placeholder="Enter customer doc name ">
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="form-group col-md-4"></div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="customer">Policy document name</label>
|
||||
<!-- <div style="position:relative;"> -->
|
||||
<input type="text" name="policy_doc_name" class="form-control" id="policy_doc_name" placeholder="Enter policy doc name ">
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="form-group col-md-8" style="text-align: center; font-size: small;">
|
||||
OR
|
||||
</div>
|
||||
<div class="form-group col-md-4"></div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="customer">Policy</label>
|
||||
<!-- <div style="position:relative;"> -->
|
||||
<input type="text" class="form-control" id="policy" placeholder="Enter policy no">
|
||||
<input type="hidden" name="policy_id" class="form-control" id="policy_id" placeholder="Enter policy no">
|
||||
<div id="policy_suggestions" class="autocomplete-suggestions" style="display:none;"></div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="customer">Policy document name</label>
|
||||
<!-- <div style="position:relative;"> -->
|
||||
<input type="text" name="policy_doc_name" class="form-control" id="policy_doc_name" placeholder="Enter policy doc name ">
|
||||
<!-- </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>
|
||||
</form>
|
||||
</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>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -94,7 +105,8 @@
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<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>
|
||||
@ -102,17 +114,17 @@
|
||||
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S.No</th>
|
||||
<th>Doc name</th>
|
||||
<th>File name</th>
|
||||
<th>Action</th>
|
||||
<th>S.No </th>
|
||||
<th>Doc name </th>
|
||||
<th>File name </th>
|
||||
<th>Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (isset($files)) { ?>
|
||||
<?php foreach($files as $index => $row){ ?>
|
||||
<tr>
|
||||
<td><?= $index + 1 ?></td>
|
||||
<td class="text-center"><?= $index + 1 ?></td>
|
||||
<td><?php echo $row['doc_name']; ?></td>
|
||||
<td><?php echo $row['file_name']; ?></td>
|
||||
<td>
|
||||
@ -125,11 +137,13 @@
|
||||
</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div>
|
||||
</div>
|
||||
@ -140,106 +154,124 @@
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
// $('#client_id').select2();
|
||||
// $('#insurer_id').select2();
|
||||
// $('#policy_type_id').select2();
|
||||
const customer_suggestions = <?php echo json_encode($customers); ?>;
|
||||
const policy_suggestions = <?php echo json_encode($policies); ?>;
|
||||
showSuggestions('customer','customer_suggestions','customer_id',customer_suggestions);
|
||||
showSuggestions('policy','policy_suggestions','policy_id',policy_suggestions);
|
||||
$(document).ready(function() {
|
||||
// $('#client_id').select2();
|
||||
// $('#insurer_id').select2();
|
||||
// $('#policy_type_id').select2();
|
||||
const customer_suggestions = <?php echo json_encode($customers); ?>;
|
||||
const policy_suggestions = <?php echo json_encode($policies); ?>;
|
||||
showSuggestions('customer', 'customer_suggestions', 'customer_id', customer_suggestions);
|
||||
showSuggestions('policy', 'policy_suggestions', 'policy_id', policy_suggestions);
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
// Datatable document ready
|
||||
$(document).ready(function() {
|
||||
// Datatable document ready
|
||||
$(document).ready(function() {
|
||||
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 25, // Set default number of rows per page (optional)
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
});
|
||||
|
||||
function showSuggestions(inputID, suggestionBoxID,hiddenInputID,suggestions) {
|
||||
|
||||
// console.log('showSuggestions');
|
||||
// console.log(suggestions);return;
|
||||
const input = document.getElementById(inputID);
|
||||
const suggestionBox = document.getElementById(suggestionBoxID);
|
||||
const hiddenInput = document.getElementById(hiddenInputID);
|
||||
|
||||
input.addEventListener('input', function() {
|
||||
const value = this.value.toLowerCase();
|
||||
suggestionBox.innerHTML = ''; // Clear previous suggestions
|
||||
|
||||
if (value) {
|
||||
const filteredSuggestions = suggestions.filter(item =>
|
||||
item.display_value.toLowerCase().includes(value)
|
||||
);
|
||||
// console.log(filteredSuggestions);
|
||||
filteredSuggestions.forEach(suggestion => {
|
||||
const suggestionItem = document.createElement('div');
|
||||
suggestionItem.textContent = suggestion.display_value;
|
||||
suggestionItem.classList.add('autocomplete-suggestion');
|
||||
|
||||
suggestionItem.addEventListener('click', function() {
|
||||
input.value = suggestion.display_value; // Display value in input
|
||||
hiddenInput.value = suggestion.id; // Store id in hidden input
|
||||
suggestionBox.innerHTML = ''; // Clear suggestions after selecting
|
||||
suggestionBox.style.display = 'none';
|
||||
});
|
||||
|
||||
suggestionBox.appendChild(suggestionItem);
|
||||
suggestionBox.style.display = 'block';
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-2'f><'col-sm-10 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
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 ',
|
||||
},
|
||||
{
|
||||
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 {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showSuggestions(inputID, suggestionBoxID, hiddenInputID, suggestions) {
|
||||
|
||||
function fetchFileList(event)
|
||||
{
|
||||
event.preventDefault();
|
||||
// console.log('showSuggestions');
|
||||
// console.log(suggestions);return;
|
||||
const input = document.getElementById(inputID);
|
||||
const suggestionBox = document.getElementById(suggestionBoxID);
|
||||
const hiddenInput = document.getElementById(hiddenInputID);
|
||||
|
||||
var customer = document.getElementById('customer').value;
|
||||
var customer_id = document.getElementById('customer_id').value;
|
||||
var policy = document.getElementById('policy').value;
|
||||
var policy_id = document.getElementById('policy_id').value;
|
||||
var cus_doc_name = document.getElementById('cus_doc_name').value;
|
||||
var policy_doc_name = document.getElementById('policy_doc_name').value;
|
||||
input.addEventListener('input', function() {
|
||||
const value = this.value.toLowerCase();
|
||||
suggestionBox.innerHTML = ''; // Clear previous suggestions
|
||||
|
||||
if(customer == '' && cus_doc_name != '')
|
||||
{
|
||||
alert('choose customer');return false;
|
||||
if (value) {
|
||||
const filteredSuggestions = suggestions.filter(item =>
|
||||
item.display_value.toLowerCase().includes(value)
|
||||
);
|
||||
// console.log(filteredSuggestions);
|
||||
filteredSuggestions.forEach(suggestion => {
|
||||
const suggestionItem = document.createElement('div');
|
||||
suggestionItem.textContent = suggestion.display_value;
|
||||
suggestionItem.classList.add('autocomplete-suggestion');
|
||||
|
||||
suggestionItem.addEventListener('click', function() {
|
||||
input.value = suggestion.display_value; // Display value in input
|
||||
hiddenInput.value = suggestion.id; // Store id in hidden input
|
||||
suggestionBox.innerHTML = ''; // Clear suggestions after selecting
|
||||
suggestionBox.style.display = 'none';
|
||||
});
|
||||
|
||||
suggestionBox.appendChild(suggestionItem);
|
||||
suggestionBox.style.display = 'block';
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(policy == '' && policy_doc_name != '')
|
||||
{
|
||||
alert('choose policy');return false;
|
||||
|
||||
function fetchFileList(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var customer = document.getElementById('customer').value;
|
||||
var customer_id = document.getElementById('customer_id').value;
|
||||
var policy = document.getElementById('policy').value;
|
||||
var policy_id = document.getElementById('policy_id').value;
|
||||
var cus_doc_name = document.getElementById('cus_doc_name').value;
|
||||
var policy_doc_name = document.getElementById('policy_doc_name').value;
|
||||
|
||||
if (policy == '' && customer == '') {
|
||||
alert('choose customer or policy');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (customer == '' && cus_doc_name != '') {
|
||||
alert('choose customer');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (policy == '' && policy_doc_name != '') {
|
||||
alert('choose policy');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
console.log('called');
|
||||
let customEvent = new CustomEvent('fetchFileListCustomEvent');
|
||||
$('#dms_search_form').submit();
|
||||
|
||||
}
|
||||
|
||||
if(policy == '' && customer == '')
|
||||
{
|
||||
alert('choose customer or policy');return false;
|
||||
}
|
||||
console.log('called');
|
||||
let customEvent = new CustomEvent('fetchFileListCustomEvent');
|
||||
$('#dms_search_form').submit();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@ -36,7 +36,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="file_table" class="card">
|
||||
<div id="collapseOne">
|
||||
<div id="file_table" class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
@ -45,13 +46,13 @@
|
||||
|
||||
</div>
|
||||
<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">
|
||||
<tr>
|
||||
<th>S.No</th>
|
||||
<th>Docs Name</th>
|
||||
<th>File Name</th>
|
||||
<th>Action</th>
|
||||
<th>S.No </th>
|
||||
<th>Docs Name </th>
|
||||
<th>File Name </th>
|
||||
<th>Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="table_bd">
|
||||
@ -62,6 +63,7 @@
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -92,33 +92,33 @@
|
||||
<table data-custom-table-css="table" class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<th class="font-weight-medium">S.No </th>
|
||||
|
||||
<?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'] != "")) { ?>
|
||||
<th class="font-weight-medium">Client/Branch</th>
|
||||
<th class="font-weight-medium">Client/Branch </th>
|
||||
<?php }
|
||||
if ($getData['client_id'] != '0' && $getData['branch_id'] == '0') { ?>
|
||||
<th class="font-weight-medium">Branch</th>
|
||||
<th class="font-weight-medium">Branch </th>
|
||||
<?php } } ?>
|
||||
|
||||
<th class="font-weight-medium">Name</th>
|
||||
<th class="font-weight-medium">EMP Code</th>
|
||||
<th class="font-weight-medium">Relationship</th>
|
||||
<th class="font-weight-medium">Gender</th>
|
||||
<th class="font-weight-medium">Email</th>
|
||||
<th class="font-weight-medium">Mobile</th>
|
||||
<th class="font-weight-medium">Date of Birth</th>
|
||||
<th class="font-weight-medium">Policy name</th>
|
||||
<th class="font-weight-medium">Insurer name</th>
|
||||
<th class="font-weight-medium">TPA ID</th>
|
||||
<th class="font-weight-medium">Risk ID</th>
|
||||
<th class="font-weight-medium">Policy status</th>
|
||||
<th class="font-weight-medium">(₹)Sum Insured</th>
|
||||
<th class="font-weight-medium">(₹)Premium</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="gst" data-toggle="tooltip" data-placement="top">(₹)GST</th>
|
||||
<th class="font-weight-medium" > Action </th>
|
||||
<th class="font-weight-medium">Name </th>
|
||||
<th class="font-weight-medium">EMP Code </th>
|
||||
<th class="font-weight-medium">Relationship </th>
|
||||
<th class="font-weight-medium">Gender </th>
|
||||
<th class="font-weight-medium">Email </th>
|
||||
<th class="font-weight-medium">Mobile </th>
|
||||
<th class="font-weight-medium">Date of Birth </th>
|
||||
<th class="font-weight-medium">Policy name </th>
|
||||
<th class="font-weight-medium">Insurer name </th>
|
||||
<th class="font-weight-medium">TPA ID </th>
|
||||
<th class="font-weight-medium">Risk ID </th>
|
||||
<th class="font-weight-medium">Policy status </th>
|
||||
<th class="font-weight-medium">(₹)Sum Insured </th>
|
||||
<th class="font-weight-medium">(₹)Premium </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="gst" data-toggle="tooltip" data-placement="top">(₹)GST </th>
|
||||
<th class="font-weight-medium" > Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -129,7 +129,7 @@
|
||||
$gst_total = 0;
|
||||
foreach ($employees as $key => $employee) { ?>
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1); ?></b></td>
|
||||
<td class="text-center"><b><?php echo ($key + 1); ?></b></td>
|
||||
|
||||
<?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'] != "")) { ?>
|
||||
@ -343,18 +343,34 @@
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Member-List',
|
||||
},{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Member-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: 'csv',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
className: 'app-btn-primary ',
|
||||
title: 'Member-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
className: 'app-btn-primary ',
|
||||
title: 'Member-List',
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 25 // Set default number of rows per page (optional)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -11,12 +11,23 @@ option:disabled {
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion1" class="mb-3">
|
||||
<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"
|
||||
aria-expanded="true">
|
||||
<i id="icon1" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</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 class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
@ -86,7 +97,7 @@ option:disabled {
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
@ -94,7 +105,7 @@ option:disabled {
|
||||
|
||||
|
||||
|
||||
<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"
|
||||
data-target="#full-width-modal" title="Download Sample Excel">Fetch
|
||||
Enrolled Data</a>
|
||||
|
||||
@ -14,66 +14,70 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="container-fluid">
|
||||
<h2>Endorsement</h2>
|
||||
<div class="container-fluid-min">
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label>Client</label> <br />
|
||||
<select class="form-control" id="clients">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
<div class="card-body">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h4>
|
||||
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>
|
||||
</a>
|
||||
</h4>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label>Client</label> <br />
|
||||
<select class="form-control" id="clients">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Branch</label> <br />
|
||||
<select name="branch_id" class="form-control" id="branch_id">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Policy</label> <br />
|
||||
<select class="form-control" id="policies">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Status</label> <br />
|
||||
<select class="form-control" id="status1">
|
||||
<option value="0">Select</option>
|
||||
<?php foreach ($status as $key => $value) { ?>
|
||||
<option value="<?= $key ?>" <?= (isset($getData) && $getData['status'] == $key) ? 'selected' : '' ?>>
|
||||
<?= $value ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Branch</label> <br />
|
||||
<select name="branch_id" class="form-control" id="branch_id">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
<div class="row">
|
||||
<div class="col-12" style="text-align: right;">
|
||||
<a href="<?= base_url("employee/endorsement-list"); ?>" class="btn btn-primary waves-effect waves-light" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Policy</label> <br />
|
||||
<select class="form-control" id="policies">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Status</label> <br />
|
||||
<select class="form-control" id="status1">
|
||||
<option value="0">Select</option>
|
||||
<?php foreach ($status as $key => $value) { ?>
|
||||
<option value="<?= $key ?>" <?= (isset($getData) && $getData['status'] == $key) ? 'selected' : '' ?>>
|
||||
<?= $value ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12" style="text-align: right;">
|
||||
<a href="<?= base_url("employee/endorsement-list"); ?>" class="btn btn-primary waves-effect waves-light" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -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">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<th class="font-weight-medium">S.No </th>
|
||||
<th class="font-weight-medium">Name/code</th>
|
||||
<th class="font-weight-medium">Policy name</th>
|
||||
<th class="font-weight-medium">Endorsement ID</th>
|
||||
@ -108,7 +112,7 @@
|
||||
foreach ($employees as $key => $employee) { ?>
|
||||
|
||||
<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 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>
|
||||
@ -332,7 +336,7 @@
|
||||
var option = $('<option>', {
|
||||
value: item.client_policy_id,
|
||||
// text: `${item.name ?? ''} - ${item.policy_no ?? ''} - ${item.policy_type ?? ''}`
|
||||
text:`${item.policy_type ?? ''} - ${item.policy_no ?? ''}`
|
||||
text: `${item.policy_type ?? ''} - ${item.policy_no ?? ''}`
|
||||
});
|
||||
if (PolicyID == item.client_policy_id) {
|
||||
option.attr('selected', true);
|
||||
@ -386,7 +390,7 @@
|
||||
toastr.warning('No policies found for the selected client branch.');
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
// console.log('foundPolicies', foundPolicies);
|
||||
appendPolicies(foundPolicies);
|
||||
}
|
||||
@ -590,27 +594,54 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#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-5'i><'col-sm-7'p>>",
|
||||
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
|
||||
}
|
||||
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: [{
|
||||
extend: 'csv',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
className: 'app-btn-primary ',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
className: 'app-btn-primary ',
|
||||
}
|
||||
]
|
||||
}
|
||||
}],
|
||||
],
|
||||
// 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) {
|
||||
$('.my_class').css({
|
||||
"position": "relative",
|
||||
@ -618,13 +649,19 @@
|
||||
});
|
||||
},
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true,
|
||||
// pagingType: 'full_numbers'
|
||||
columnDefs: [
|
||||
{ type: 'scientific', targets: 0 } // Apply custom sorting type to the first column
|
||||
columnDefs: [{
|
||||
type: 'scientific',
|
||||
targets: 0
|
||||
} // Apply custom sorting type to the first column
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
#tickets-table_filter {
|
||||
float: right;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.click_hover {
|
||||
@ -31,212 +31,215 @@
|
||||
box-shadow: 6px 5px 8px 0 #00000036;
|
||||
cursor: pointer;
|
||||
}
|
||||
.click_hover .text-muted{
|
||||
|
||||
.click_hover .text-muted {
|
||||
color: #fff !important;
|
||||
}
|
||||
.click_hover span{
|
||||
|
||||
.click_hover span {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.card {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.row.visa_status_count_view .card-header{
|
||||
background-color: #F5FFFF;
|
||||
padding: 25px;
|
||||
border: 2px solid #fff;
|
||||
border-radius: 10px;
|
||||
/* box-shadow: 2px 2px 2px; */
|
||||
box-shadow: 0px 1px 1px 0px #00000040;
|
||||
.row.visa_status_count_view .card-header {
|
||||
background-color: #F5FFFF;
|
||||
padding: 25px;
|
||||
border: 2px solid #fff;
|
||||
border-radius: 10px;
|
||||
/* box-shadow: 2px 2px 2px; */
|
||||
box-shadow: 0px 1px 1px 0px #00000040;
|
||||
}
|
||||
|
||||
.row.visa_status_count_view .card-header #categoryFilter_11 a{
|
||||
.row.visa_status_count_view .card-header #categoryFilter_11 a {
|
||||
background-color: #D4F5F6 !important;
|
||||
font-weight:800;
|
||||
color:#000 !important;
|
||||
border : 1px solid #D4F5F6 !important;
|
||||
font-weight: 800;
|
||||
color: #000 !important;
|
||||
border: 1px solid #D4F5F6 !important;
|
||||
border-radius: 15px;
|
||||
padding : 5px 10px;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
#categoryFilter_12 a ,
|
||||
#categoryFilter_13 a ,
|
||||
#categoryFilter_14 a
|
||||
{
|
||||
background-color: #00999E;
|
||||
box-shadow: 0px 2px 4px 0px #00000040;
|
||||
#categoryFilter_12 a,
|
||||
#categoryFilter_13 a,
|
||||
#categoryFilter_14 a {
|
||||
background-color: #00999E;
|
||||
box-shadow: 0px 2px 4px 0px #00000040;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#statusContent{
|
||||
background-color: #F5FFFF;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 1px 1px 0px #00000040;
|
||||
}
|
||||
#statusContent {
|
||||
background-color: #F5FFFF;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 1px 1px 0px #00000040;
|
||||
}
|
||||
|
||||
#statusContent .statusContent-flex{
|
||||
display:flex;
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
#statusContent .statusContent-flex {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
|
||||
.statusContent-flex .my-2{
|
||||
color:black !important;
|
||||
}
|
||||
|
||||
#statusContent .custom-card{
|
||||
min-width:300px;
|
||||
min-height: 50px;
|
||||
padding:15px;
|
||||
background-color: white;
|
||||
color:black;
|
||||
margin-right:15px;
|
||||
margin-top :10px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 2px 4px 0px #00000024 !important;
|
||||
}
|
||||
.statusContent-flex .my-2 {
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
#statusContent .custom-card {
|
||||
min-width: 300px;
|
||||
min-height: 50px;
|
||||
padding: 15px;
|
||||
background-color: white;
|
||||
color: black;
|
||||
margin-right: 15px;
|
||||
margin-top: 10px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 2px 4px 0px #00000024 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<h2>Enrollment</h2>
|
||||
<div class="row visa_status_count_view">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row" >
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter" >
|
||||
<label for="">Client</label>
|
||||
<select class="form-control" id="clients" onchange="populateBranches()">
|
||||
<option value="0">Select Client</option>
|
||||
<?php foreach ($client_list as $client) { ?>
|
||||
<option value="<?= $client['id'] ?>"><?= $client['client_name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter_11">
|
||||
<label for="">Branch</label>
|
||||
<select name="branch_id" class="form-control" id="branch_id" onchange="populatePolicies()">
|
||||
<option value="0">Select Branch</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter_14">
|
||||
<label for="">Policy</label>
|
||||
<select name="client_policy_id" class="form-control" id="client_policy_id">
|
||||
<option value="0">Select Policy</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter_11" >
|
||||
<a class="btn btn-primary waves-effect waves-light"
|
||||
style="margin-top:30px !important"
|
||||
onclick="fetchEmpolyeeList(event);"
|
||||
data-toggle="tooltip" data-placement="top" title="Search"
|
||||
id="get-emp-list"><i class="mdi mdi-magnify" aria-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6" style="margin-right: 15px; margin-top:30px; ">
|
||||
<span id="categoryFilter_12" style="margin-right: 15px;">
|
||||
<a class="btn btn-primary waves-effect waves-light" onclick="sendManualReminder(this)" data-toggle="tooltip" data-placement="top" title="Send Reminder"><span >Send Remainder</span></a>
|
||||
</span>
|
||||
|
||||
<span id="categoryFilter_13" style="margin-right: 15px;">
|
||||
<a class="btn btn-primary waves-effect waves-light" onclick="uploadEnrollmentFile(this)" data-toggle="tooltip" data-placement="top" title="Enrollment File Upload"><span >File Upload</span></a>
|
||||
</span>
|
||||
|
||||
<button id="categoryFilter_14" type="button" class="btn btn-link visa_status_button" onclick="toggleContent()" data-toggle="tooltip" data-placement="top" >
|
||||
<a class="btn btn-primary waves-effect waves-light" data-toggle="tooltip" data-placement="top" title="View Status"><span >View Status</span></a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-body status-option" id="statusContent" >
|
||||
<h4>Status</h4>
|
||||
<div class="text-center">
|
||||
|
||||
<div style="margin-left: 60px; margin-top: 0px;">
|
||||
<div class="statusContent-flex">
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_count_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Emp Count">Emp Count</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_count_view" >0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_enrolled_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Enrolled">Enroled</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_enrolled_view" >0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_not_enrolled_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Not Enrolled">Not Enroled</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_not_enrolled_view">0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_logged_in_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Logged-In">Logged-In</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_logged_in_view">0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_not_logged_in_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Not Logged-In">Not Logged-In</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_not_logged_in_view">0</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="client_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="container-fluid-min">
|
||||
<div class="row visa_status_count_view">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<table data-custom-table-css="table" class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<th class="font-weight-medium">Name</th>
|
||||
<th class="font-weight-medium">Emp Code</th>
|
||||
<th class="font-weight-medium">Relationship</th>
|
||||
<th class="font-weight-medium">Enroled</th>
|
||||
<th class="font-weight-medium">Logged-In</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="font-12">
|
||||
<!-- Table body -->
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter">
|
||||
<label for="">Client</label>
|
||||
<select class="form-control" id="clients" onchange="populateBranches()">
|
||||
<option value="0">Select Client</option>
|
||||
<?php foreach ($client_list as $client) { ?>
|
||||
<option value="<?= $client['id'] ?>"><?= $client['client_name'] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter_11">
|
||||
<label for="">Branch</label>
|
||||
<select name="branch_id" class="form-control" id="branch_id" onchange="populatePolicies()">
|
||||
<option value="0">Select Branch</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter_14">
|
||||
<label for="">Policy</label>
|
||||
<select name="client_policy_id" class="form-control" id="client_policy_id">
|
||||
<option value="0">Select Policy</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div id="categoryFilter_11">
|
||||
<a class="btn btn-primary waves-effect waves-light"
|
||||
style="margin-top:30px !important"
|
||||
onclick="fetchEmpolyeeList(event);"
|
||||
data-toggle="tooltip" data-placement="top" title="Search"
|
||||
id="get-emp-list"><i class="mdi mdi-magnify" aria-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6" style="margin-right: 15px; margin-top:30px; ">
|
||||
<span id="categoryFilter_12" style="margin-right: 15px;">
|
||||
<a class="btn btn-primary waves-effect waves-light" onclick="sendManualReminder(this)" data-toggle="tooltip" data-placement="top" title="Send Reminder"><span>Send Remainder</span></a>
|
||||
</span>
|
||||
|
||||
<span id="categoryFilter_13" style="margin-right: 15px;">
|
||||
<a class="btn btn-primary waves-effect waves-light" onclick="uploadEnrollmentFile(this)" data-toggle="tooltip" data-placement="top" title="Enrollment File Upload"><span>File Upload</span></a>
|
||||
</span>
|
||||
|
||||
<button id="categoryFilter_14" type="button" class="btn btn-link visa_status_button" onclick="toggleContent()" data-toggle="tooltip" data-placement="top">
|
||||
<a class="btn btn-primary waves-effect waves-light" data-toggle="tooltip" data-placement="top" title="View Status"><span>View Status</span></a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-body status-option" id="statusContent">
|
||||
<h4>Status</h4>
|
||||
<div class="text-center">
|
||||
|
||||
<div style="margin-left: 60px; margin-top: 0px;">
|
||||
<div class="statusContent-flex">
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_count_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Emp Count">Emp Count</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_count_view">0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_enrolled_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Enrolled">Enroled</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_enrolled_view">0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_not_enrolled_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Not Enrolled">Not Enroled</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_not_enrolled_view">0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_logged_in_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Logged-In">Logged-In</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_logged_in_view">0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-card d-flex justify-content-between" id="emp_not_logged_in_view_click">
|
||||
<div>
|
||||
<span class="text-muted font-weight-normal mt-0 text-truncate my-2" title="Not Logged-In">Not Logged-In</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="my-2"><span data-plugin="counterup" id="emp_not_logged_in_view">0</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="client_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<table data-custom-table-css="table" class="table table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">S.No </th>
|
||||
<th class="font-weight-medium">Name</th>
|
||||
<th class="font-weight-medium">Emp Code</th>
|
||||
<th class="font-weight-medium">Relationship</th>
|
||||
<th class="font-weight-medium">Enroled</th>
|
||||
<th class="font-weight-medium">Logged-In</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="font-12">
|
||||
<!-- Table body -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Center modal content -->
|
||||
<div class="modal fade" id="upload_enrollment_model" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="false">
|
||||
@ -247,7 +250,7 @@
|
||||
<button type="button" id="close_btn" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="parsley-examples" method="post" id="uploadForm" action="<?php echo base_url().'employee/upload'?>" enctype="multipart/form-data">
|
||||
<form class="parsley-examples" method="post" id="uploadForm" action="<?php echo base_url() . 'employee/upload' ?>" enctype="multipart/form-data">
|
||||
<input type="hidden" id="file_client_id" name="client_id">
|
||||
<input type="hidden" id="file_branch_id" name="branch_id">
|
||||
<input type="hidden" id="file_upload_actions" name="upload-action-type" value="enrollment">
|
||||
@ -256,7 +259,7 @@
|
||||
<div class="form-group col-md-12">
|
||||
<label for="policy_id">Client Policy<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="policy_id" name="policy_id" required>
|
||||
<option selected >Select Client Policy</option>
|
||||
<option selected>Select Client Policy</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@ -278,9 +281,7 @@
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<script>
|
||||
|
||||
function populateBranches()
|
||||
{
|
||||
function populateBranches() {
|
||||
var clientId = document.getElementById('clients').value;
|
||||
var branchDropdown = document.getElementById('branch_id');
|
||||
|
||||
@ -302,8 +303,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
function populatePolicies()
|
||||
{
|
||||
function populatePolicies() {
|
||||
console.log('populatePolicies function called');
|
||||
|
||||
var clientId = document.getElementById('clients').value;
|
||||
@ -334,19 +334,17 @@
|
||||
});
|
||||
}
|
||||
|
||||
function filterTable(columnIndex, filterValue)
|
||||
{
|
||||
function filterTable(columnIndex, filterValue) {
|
||||
var table = $('#tickets-table').DataTable();
|
||||
|
||||
|
||||
// Reset the search filter for all columns
|
||||
table.columns().search('').draw();
|
||||
|
||||
|
||||
// Apply the filter to the specified column
|
||||
table.column(columnIndex).search(filterValue).draw();
|
||||
}
|
||||
|
||||
function fetchEmpolyeeList(event)
|
||||
{
|
||||
function fetchEmpolyeeList(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var client_id = $('#clients').val();
|
||||
@ -372,7 +370,7 @@
|
||||
$('.loader-mask').fadeIn();
|
||||
},
|
||||
success: function(response) {
|
||||
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
@ -396,17 +394,17 @@
|
||||
var loggedIn_count = 0;
|
||||
data.forEach(function(employee, index) {
|
||||
|
||||
if(employee.emp_status !== 'draft'){
|
||||
if (employee.emp_status !== 'draft') {
|
||||
var enrolled = 'Yes';
|
||||
enrolled_count++;
|
||||
}else{
|
||||
} else {
|
||||
var enrolled = 'No';
|
||||
}
|
||||
|
||||
if(employee.user_type === 'employee'){
|
||||
if (employee.user_type === 'employee') {
|
||||
var loggedIn = 'Yes';
|
||||
loggedIn_count++;
|
||||
}else{
|
||||
} else {
|
||||
var loggedIn = 'No';
|
||||
}
|
||||
|
||||
@ -433,7 +431,7 @@
|
||||
var params = new URLSearchParams(window.location.search);
|
||||
return params.get(name);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
@ -444,8 +442,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$(document).ready(function() {
|
||||
|
||||
function getUrlParameter(name) {
|
||||
var params = new URLSearchParams(window.location.search);
|
||||
@ -464,22 +461,24 @@
|
||||
if (branch_id) {
|
||||
setTimeout(function() { // Ensure branches are populated before setting branch ID
|
||||
$('#branch_id').val(branch_id).trigger('change');
|
||||
if($('#branch_id').val() != 0){
|
||||
if ($('#branch_id').val() != 0) {
|
||||
$('#get-emp-list').click().trigger();
|
||||
}
|
||||
}, 500);
|
||||
|
||||
|
||||
}
|
||||
if (history.pushState) {
|
||||
var newUrl = window.location.protocol + "//" + window.location.host + window.location.pathname;
|
||||
window.history.pushState({path: newUrl}, '', newUrl);
|
||||
window.history.pushState({
|
||||
path: newUrl
|
||||
}, '', newUrl);
|
||||
}
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
// var type = getUrlParameter('type');
|
||||
console.log("------------------------");
|
||||
console.log(type);
|
||||
$('#' + type).click().trigger();
|
||||
console.log("------------------------");
|
||||
console.log(type);
|
||||
$('#' + type).click().trigger();
|
||||
}, 1000);
|
||||
|
||||
$('#clients').select2();
|
||||
@ -488,39 +487,73 @@
|
||||
$('#client_policy_id').select2();
|
||||
var table = $('#tickets-table').DataTable({
|
||||
dom: 'fBrtip',
|
||||
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: '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',
|
||||
text: '<i class="mdi mdi-content-copy"></i>',
|
||||
titleAttr: 'Copy',
|
||||
filename: 'Enrolment List'
|
||||
className: 'app-btn-primary ',
|
||||
},
|
||||
{
|
||||
extend: 'csv',
|
||||
text: '<i class="mdi mdi-file-document"></i>',
|
||||
titleAttr: 'CSV',
|
||||
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() {
|
||||
// Add custom class to the print button
|
||||
$('.buttons-print').addClass('buttons-html5');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#emp_enrolled_view_click').on('click', function() {
|
||||
if ($(this).hasClass('click_hover')) {
|
||||
// $(this).removeClass('click_hover');
|
||||
@ -528,7 +561,7 @@
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
table.columns().search('').draw(); // Clear all filters and show all data
|
||||
}else{
|
||||
} else {
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
@ -544,7 +577,7 @@
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
table.columns().search('').draw(); // Clear all filters and show all data
|
||||
}else{
|
||||
} else {
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
@ -560,7 +593,7 @@
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
table.columns().search('').draw(); // Clear all filters and show all data
|
||||
}else{
|
||||
} else {
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
@ -576,7 +609,7 @@
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
table.columns().search('').draw(); // Clear all filters and show all data
|
||||
}else{
|
||||
} else {
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
@ -592,7 +625,7 @@
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
table.columns().search('').draw(); // Clear all filters and show all data
|
||||
}else{
|
||||
} else {
|
||||
$('.click_hover').each(function() {
|
||||
$(this).removeClass('click_hover');
|
||||
});
|
||||
@ -604,8 +637,7 @@
|
||||
toggleContent();
|
||||
});
|
||||
|
||||
function toggleContent()
|
||||
{
|
||||
function toggleContent() {
|
||||
var content = document.getElementById("statusContent");
|
||||
var toggleIcon = document.getElementById("toggleIcon");
|
||||
if (content.style.display === "none") {
|
||||
@ -622,8 +654,7 @@
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
function uploadEnrollmentFile(input)
|
||||
{
|
||||
function uploadEnrollmentFile(input) {
|
||||
console.log('uploadEnrollmentFile called');
|
||||
|
||||
var client_id = $('#clients').val()
|
||||
@ -633,8 +664,8 @@
|
||||
console.log('client_id', client_id);
|
||||
console.log('client_branch_id', client_branch_id);
|
||||
|
||||
if(client_id == 0 && client_branch_id == 0){
|
||||
|
||||
if (client_id == 0 && client_branch_id == 0) {
|
||||
|
||||
Swal.fire({
|
||||
title: "warning!",
|
||||
text: 'Please select the Client and Client Branch.',
|
||||
@ -679,8 +710,7 @@
|
||||
|
||||
}
|
||||
|
||||
function appendpolicy(data)
|
||||
{
|
||||
function appendpolicy(data) {
|
||||
|
||||
$('#policy_id').empty();
|
||||
$('#policy_id').append($('<option>', {
|
||||
@ -692,7 +722,7 @@
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text:`${item.policy_name ?? ''} - ${item.policy_no ?? ''}`
|
||||
text: `${item.policy_name ?? ''} - ${item.policy_no ?? ''}`
|
||||
});
|
||||
$('#policy_id').append(option);
|
||||
});
|
||||
@ -712,7 +742,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if(client_id == 0 && client_branch_id == 0){
|
||||
if (client_id == 0 && client_branch_id == 0) {
|
||||
toastr.warning('Select Client and Client Branch');
|
||||
return false;
|
||||
}
|
||||
@ -776,8 +806,7 @@
|
||||
});
|
||||
|
||||
|
||||
function sendManualReminder(input)
|
||||
{
|
||||
function sendManualReminder(input) {
|
||||
console.log('sendManualReminder function called');
|
||||
|
||||
var client_id = $('#clients').val()
|
||||
@ -816,44 +845,44 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: "Do you want to send reminder mail?",
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: "Yes,Send",
|
||||
denyButtonText: "Don't Send"
|
||||
}).then((result) => {
|
||||
Swal.fire({
|
||||
title: "Do you want to send reminder mail?",
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: "Yes,Send",
|
||||
denyButtonText: "Don't Send"
|
||||
}).then((result) => {
|
||||
|
||||
if (result.isConfirmed) {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
$.ajax({
|
||||
url: '<?= base_url("util/send_manual_reminder/") ?>' + client_id + '/' + client_branch_id + '/' + client_policy_id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
$.ajax({
|
||||
url: '<?= base_url("util/send_manual_reminder/") ?>' + client_id + '/' + client_branch_id + '/' + client_policy_id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
console.log('send_manual_reminder', res)
|
||||
console.log('send_manual_reminder', res)
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
if(res.status == false){
|
||||
toastr.info(res.message, 'INFO');
|
||||
}else{
|
||||
toastr.success(res.message, 'SUCCESS');
|
||||
if (res.status == false) {
|
||||
toastr.info(res.message, 'INFO');
|
||||
} else {
|
||||
toastr.success(res.message, 'SUCCESS');
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}
|
||||
});
|
||||
// Swal.fire("Saved!", "", "success");
|
||||
}
|
||||
});
|
||||
});
|
||||
// Swal.fire("Saved!", "", "success");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@ -110,7 +110,18 @@ table.dataTable tbody td {
|
||||
<!-- Include DataTables Buttons HTML5 export extension -->
|
||||
<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>
|
||||
|
||||
let url = "<?= $url ?>";
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#tickets-table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
@ -123,7 +134,7 @@ $(document).ready(function() {
|
||||
{
|
||||
text: 'Excel Error', // Set the text for the custom button
|
||||
action: function (e, dt, node, config) {
|
||||
window.location.href = '<?= base_url("util/full-excel-error-file/") . $file_id ?>';
|
||||
window.location.href = url;
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -19,19 +19,18 @@
|
||||
</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 mb-0 nowrap w-100 table-centered" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<th class="font-weight-medium">File name</th>
|
||||
<th class="font-weight-medium">Client</th>
|
||||
<th class="font-weight-medium">Client Branch</th>
|
||||
<th class="font-weight-medium">Policy</th>
|
||||
<th class="font-weight-medium">Event</th>
|
||||
<th class="font-weight-medium">User/Time</th>
|
||||
<th class="font-weight-medium">Status</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
<th class="font-weight-medium">S.No </th>
|
||||
<th class="font-weight-medium">File name </th>
|
||||
<th class="font-weight-medium">Client </th>
|
||||
<th class="font-weight-medium">Client Branch </th>
|
||||
<th class="font-weight-medium">Policy </th>
|
||||
<th class="font-weight-medium">Event </th>
|
||||
<th class="font-weight-medium">User/Time </th>
|
||||
<th class="font-weight-medium">Status </th>
|
||||
<th class="font-weight-medium">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -45,7 +44,7 @@
|
||||
?>
|
||||
|
||||
<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'] ?>">
|
||||
<?php echo $file['file_name']?>
|
||||
</td>
|
||||
@ -461,28 +460,57 @@ $('body').on('click', '.reload', function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#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-5'i><'col-sm-7'p>>",
|
||||
"buttons": [{
|
||||
"extend": 'csv',
|
||||
"text": 'CSV',
|
||||
"title": 'Employee-Upload-List',
|
||||
"className": 'my_class',
|
||||
"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: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
title: 'Employee-Upload-List',
|
||||
className: 'app-btn-primary ',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
}],
|
||||
"initComplete": function(settings, json) {
|
||||
$('.my_class').css({
|
||||
"position": "relative",
|
||||
"left": "79px"
|
||||
});
|
||||
},
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
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,
|
||||
});
|
||||
|
||||
|
||||
@ -1,59 +1,62 @@
|
||||
<style>
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
.col-12 {
|
||||
|
||||
max-width: 98% !important;
|
||||
}
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
.custom-dropdown-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #ffffff !important;
|
||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||
border-radius: 0.25rem;
|
||||
padding: 0.5rem 0;
|
||||
min-width: 10rem;
|
||||
z-index: 9999;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
padding: 0.5rem 1rem !important;
|
||||
color: #212529 !important;
|
||||
text-decoration: none !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
.custom-dropdown-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #ffffff !important;
|
||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||
border-radius: 0.25rem;
|
||||
padding: 0.5rem 0;
|
||||
min-width: 10rem;
|
||||
z-index: 9999;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item:hover {
|
||||
background-color: #f8f9fa !important;
|
||||
color: #16181b !important;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
.custom-dropdown-menu .dropdown-item {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
padding: 0.5rem 1rem !important;
|
||||
color: #212529 !important;
|
||||
text-decoration: none !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item:hover {
|
||||
background-color: #f8f9fa !important;
|
||||
color: #16181b !important;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
</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 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"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
</h4>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
@ -64,11 +67,11 @@ table.dataTable tbody td {
|
||||
<select class="form-control" id="client_id" name="client_id">
|
||||
<option value="0">Select Client</option>
|
||||
<?php
|
||||
if (isset($clients) && count($clients)) {
|
||||
foreach ($clients as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['client_name'] . "</option>";
|
||||
}
|
||||
if (isset($clients) && count($clients)) {
|
||||
foreach ($clients as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['client_name'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
@ -79,9 +82,9 @@ table.dataTable tbody td {
|
||||
<select class="form-control" id="insurer_id" name="insurer_id">
|
||||
<option value="0" selected>Select Insurer</option>
|
||||
<?php if (isset($insurer) && count($insurer)) { ?>
|
||||
<?php foreach ($insurer as $value) { ?>
|
||||
<option value="<?= $value['id']?>"><?= $value['name']?></option>
|
||||
<?php } ?>
|
||||
<?php foreach ($insurer as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
@ -91,11 +94,11 @@ table.dataTable tbody td {
|
||||
<select class="form-control" id="policy_type_id" name="policy_type_id">
|
||||
<option value="0">Select Policy Type</option>
|
||||
<?php
|
||||
if (isset($policy_types) && count($policy_types)) {
|
||||
foreach ($policy_types as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
|
||||
}
|
||||
if (isset($policy_types) && count($policy_types)) {
|
||||
foreach ($policy_types as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
@ -105,11 +108,11 @@ table.dataTable tbody td {
|
||||
<select class="form-control" id="issuer" name="issuer" required>
|
||||
<option value="0">Select Issure</option>
|
||||
<?php
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
@ -124,35 +127,34 @@ table.dataTable tbody td {
|
||||
onchange="hideDateField()">
|
||||
<option value="0">Select Date Type</option>
|
||||
<?php
|
||||
if (isset($date_type) && count($date_type)) {
|
||||
foreach ($date_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
if (isset($date_type) && count($date_type)) {
|
||||
foreach ($date_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3" style="display: none;" id="date_div">
|
||||
<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%">
|
||||
<i class="mdi mdi-calendar-blank"></i>
|
||||
<span></span> <i class="mdi mdi-menu-down"></i>
|
||||
<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>
|
||||
<input type="hidden" id="startDate">
|
||||
<input type="hidden" id="endDate">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 text-right m-b-0" style="margin-top: 29px;">
|
||||
<a href="<?= base_url("/policy_tranction/report/report-finance-list"); ?>"
|
||||
class="btn btn-secondary" id="clear-filters">Clear</a>
|
||||
<a href="<?= base_url("/policy_tranction/report/report-finance-list"); ?>"
|
||||
class="btn btn-primary" id="get-emp-list"
|
||||
onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<a href="<?= base_url("/policy_tranction/report/report-finance-list"); ?>"
|
||||
class="btn btn-secondary" id="clear-filters">Clear</a>
|
||||
<a href="<?= base_url("/policy_tranction/report/report-finance-list"); ?>"
|
||||
class="btn btn-primary" id="get-emp-list"
|
||||
onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- <div class="form-group text-right m-b-0">
|
||||
<button type="button" class="btn btn-secondary" id="clear-filters">Clear</button>
|
||||
@ -182,48 +184,48 @@ table.dataTable tbody td {
|
||||
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S.No</th>
|
||||
<th>Client Name</th>
|
||||
<th>Insurer</th>
|
||||
<th>Policy</th>
|
||||
<th>Policy No</th>
|
||||
<th>Endorsement No</th>
|
||||
<th>Event Type</th>
|
||||
<th>Action</th>
|
||||
<th>S.No </th>
|
||||
<th>Client Name </th>
|
||||
<th>Insurer </th>
|
||||
<th>Policy </th>
|
||||
<th>Policy No </th>
|
||||
<th>Endorsement No </th>
|
||||
<th>Event Type </th>
|
||||
<th>Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (isset($finance_list)) { ?>
|
||||
<?php foreach($finance_list as $index => $row){ ?>
|
||||
<tr>
|
||||
<td><?= $index + 1 ?></td>
|
||||
<td><?php echo $row['client_name']; ?></td>
|
||||
<td><?php echo $row['insurer_name']; ?></td>
|
||||
<td><?php echo $row['policy_type']; ?></td>
|
||||
<td><?php echo $row['policy_no']; ?></td>
|
||||
<td><?php echo $row['endorsement_no']; ?></td>
|
||||
<td><?php echo $row['action_type_full']; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);"
|
||||
class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"
|
||||
aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a href="
|
||||
<?php
|
||||
if ($row['action_type'] == 'I') {
|
||||
echo base_url("/policy_tranction/inception/list") . '?pt_id=' . $row['id'];
|
||||
} else {
|
||||
echo base_url("/policy_tranction/endorsement/list") . '?pt_id=' . $row['id'];
|
||||
}
|
||||
<?php foreach ($finance_list as $index => $row) { ?>
|
||||
<tr>
|
||||
<td><?= $index + 1 ?></td>
|
||||
<td><?php echo $row['client_name']; ?></td>
|
||||
<td><?php echo $row['insurer_name']; ?></td>
|
||||
<td><?php echo $row['policy_type']; ?></td>
|
||||
<td><?php echo $row['policy_no']; ?></td>
|
||||
<td><?php echo $row['endorsement_no']; ?></td>
|
||||
<td><?php echo $row['action_type_full']; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);"
|
||||
class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"
|
||||
aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a href="
|
||||
<?php
|
||||
if ($row['action_type'] == 'I') {
|
||||
echo base_url("/policy_tranction/inception/list") . '?pt_id=' . $row['id'];
|
||||
} else {
|
||||
echo base_url("/policy_tranction/endorsement/list") . '?pt_id=' . $row['id'];
|
||||
}
|
||||
?>" id="get-policy-list" class="dropdown-item btnEdit">
|
||||
<i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -236,160 +238,170 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const table = document.getElementById("scroll-horizontal-datatable");
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const table = document.getElementById("scroll-horizontal-datatable");
|
||||
|
||||
// Create custom dropdown
|
||||
function createCustomDropdown(row) {
|
||||
// Get the original dropdown items
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
|
||||
// Create new dropdown with proper background and spacing
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
|
||||
// Copy inner content while maintaining icon alignment
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
return customDropdown;
|
||||
}
|
||||
// Create custom dropdown
|
||||
function createCustomDropdown(row) {
|
||||
// Get the original dropdown items
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
|
||||
let activeDropdown = null;
|
||||
// Create new dropdown with proper background and spacing
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
|
||||
// Append the custom dropdown to the body
|
||||
document.body.appendChild(customDropdown);
|
||||
// Copy inner content while maintaining icon alignment
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the action column
|
||||
if (event.target.closest('td:last-child')) {
|
||||
return;
|
||||
}
|
||||
return customDropdown;
|
||||
}
|
||||
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
let activeDropdown = null;
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown with some offset
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
// Set as active dropdown
|
||||
activeDropdown = customDropdown;
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
// Append the custom dropdown to the body
|
||||
document.body.appendChild(customDropdown);
|
||||
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the action column
|
||||
if (event.target.closest('td:last-child')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Close the dropdown after handling the click
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown with some offset
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
// Set as active dropdown
|
||||
activeDropdown = customDropdown;
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
}
|
||||
|
||||
// Close the dropdown after handling the click
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function() {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function() {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
// Datatable document ready
|
||||
$(document).ready(function() {
|
||||
|
||||
// Datatable document ready
|
||||
$(document).ready(function () {
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
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-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
},
|
||||
buttons: [
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
customize: function(xlsx) {
|
||||
var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
||||
var total = 0;
|
||||
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-BDS-List'
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel"></i><span class="btn-custom"> EXCEL </span>',
|
||||
title: 'Policy-Tranction-BDS-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;
|
||||
// Find cells in column AB (28th column in Excel)
|
||||
$('row c[r^="AB"]', sheet).each(function () {
|
||||
var value = parseFloat($('v', this).text());
|
||||
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;
|
||||
|
||||
var totalRow =
|
||||
'<row r="' + rowIndex + '">' +
|
||||
'<c t="inlineStr" r="AA' + rowIndex + '"><is><t>Total</t></is></c>' +
|
||||
'<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '</v></c>' +
|
||||
'</row>';
|
||||
|
||||
// Append the new total row to the sheet
|
||||
$(sheet).find('sheetData').append(totalRow);
|
||||
}
|
||||
});
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 25, // Set default number of rows per page (optional)
|
||||
ordering: false,
|
||||
paging: true,
|
||||
pageLength: 10,
|
||||
ordering: false
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
getURLParams()
|
||||
$('#client_id').select2();
|
||||
@ -488,7 +500,7 @@ $(function() {
|
||||
// var end = moment();
|
||||
|
||||
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'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
@ -496,6 +508,7 @@ $(function() {
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
locale: { format: 'DD-MM-YYYY' },
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
@ -506,53 +519,174 @@ $(function() {
|
||||
.endOf('month')
|
||||
]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
|
||||
$('#clear-filters').on('click', function() {
|
||||
// Reset all select dropdowns to the first option
|
||||
$('#client_id').val('0').change();
|
||||
$('#insurer_id').val('0').change();
|
||||
$('#policy_type_id').val('0').change();
|
||||
$('#date_type').val('0');
|
||||
$('#issuer').val('0');
|
||||
$('#date_div').hide()
|
||||
|
||||
// Reset the date range picker to default
|
||||
$('#reportrange').data('daterangepicker').setStartDate(moment().subtract(29, 'days'));
|
||||
$('#reportrange').data('daterangepicker').setEndDate(moment());
|
||||
cb(start, end); // Update the displayed date range
|
||||
});
|
||||
|
||||
});
|
||||
$(document).ready(function() {
|
||||
getURLParams()
|
||||
$('#client_id').select2();
|
||||
$('#insurer_id').select2();
|
||||
$('#policy_type_id').select2();
|
||||
})
|
||||
|
||||
function hideDateField(input = null) {
|
||||
let val = $('#date_type').val();
|
||||
function fetchEmpolyeeList(event) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
|
||||
if (input) {
|
||||
val = input;
|
||||
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;
|
||||
}
|
||||
|
||||
if (val != 0) {
|
||||
$('#date_div').show()
|
||||
} else {
|
||||
$('#date_div').hide()
|
||||
function objectToQueryString(obj) {
|
||||
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
|
||||
}
|
||||
}
|
||||
|
||||
function sendPolicyTransactionID(event, pt_id) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
function getURLParams() {
|
||||
const url = new URL(window.location.href);
|
||||
const params = new URLSearchParams(url.search);
|
||||
|
||||
console.log(pt_id);
|
||||
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
|
||||
|
||||
var queryParams = {
|
||||
pt_id: pt_id,
|
||||
};
|
||||
hideDateField(date_type)
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const apiURL = $('#get-policy-list').attr('href') + "?" + queryString;
|
||||
console.log(apiURL);
|
||||
window.location.href = apiURL;
|
||||
}
|
||||
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')
|
||||
]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
|
||||
$('#clear-filters').on('click', function() {
|
||||
// Reset all select dropdowns to the first option
|
||||
$('#client_id').val('0').change();
|
||||
$('#insurer_id').val('0').change();
|
||||
$('#policy_type_id').val('0').change();
|
||||
$('#date_type').val('0');
|
||||
$('#issuer').val('0');
|
||||
$('#date_div').hide()
|
||||
|
||||
// Reset the date range picker to default
|
||||
$('#reportrange').data('daterangepicker').setStartDate(moment().subtract(29, 'days'));
|
||||
$('#reportrange').data('daterangepicker').setEndDate(moment());
|
||||
cb(start, end); // Update the displayed date range
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function hideDateField(input = null) {
|
||||
let val = $('#date_type').val();
|
||||
|
||||
if (input) {
|
||||
val = input;
|
||||
}
|
||||
|
||||
if (val != 0) {
|
||||
$('#date_div').show()
|
||||
} else {
|
||||
$('#date_div').hide()
|
||||
}
|
||||
}
|
||||
|
||||
function sendPolicyTransactionID(event, pt_id) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
|
||||
console.log(pt_id);
|
||||
|
||||
var queryParams = {
|
||||
pt_id: pt_id,
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const apiURL = $('#get-policy-list').attr('href') + "?" + queryString;
|
||||
console.log(apiURL);
|
||||
window.location.href = apiURL;
|
||||
}
|
||||
</script>
|
||||
@ -61,11 +61,14 @@
|
||||
</style>
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid-min">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
<?php if (isset($hr_access_data) && !empty($hr_access_data)) { ?>
|
||||
<?php if (isset($hr_access_data) && !empty($hr_access_data)) {
|
||||
$listed_pre = [];
|
||||
$listed_post = [];
|
||||
?>
|
||||
<form id="insuranceForm" onsubmit="submitForm(event)">
|
||||
|
||||
<?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 ?>_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 ?>_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="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> -->
|
||||
</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 class="accordion-icon">
|
||||
<i class="mdi mdi-chevron-down"></i>
|
||||
@ -128,6 +135,15 @@
|
||||
<?php foreach ($pre_policy_data as $key1 => $policies) {
|
||||
$statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active';
|
||||
$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">
|
||||
<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) {
|
||||
$statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active';
|
||||
$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">
|
||||
<input type="checkbox" class="policy-checkbox <?= $statusClass ?>" id="<?= 'user' . $key ?>-gmc2" name="<?= 'user' . $key ?>_active_policies" data-user="<?= $key ?>" data-group="post"
|
||||
value="<?= $policies['client_policy_id'] ?>" <?php if (in_array($policies['client_policy_id'], $value['allowed_active_policies'])) {
|
||||
echo 'checked';
|
||||
} ?>>
|
||||
|
||||
<label for="<?= 'user' . $key ?>-gmc2" style="<?php if ($policies['policy_status'] == 0) {
|
||||
echo 'color:#ff5757';
|
||||
} ?>">
|
||||
|
||||
@ -44,6 +44,10 @@ table.dataTable tbody td {
|
||||
box-shadow: 0px 2px 4px 0px #00000024 !important;
|
||||
}
|
||||
|
||||
#hr_activity_history_append_area tbody tr {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<!-- <div class="row" style="position: relative;left: 250px;top: 55px;">
|
||||
@ -60,7 +64,7 @@ table.dataTable tbody td {
|
||||
</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">
|
||||
<tr>
|
||||
<th>S. No</th>
|
||||
@ -93,15 +97,16 @@ $(document).ready(function () {
|
||||
if (ticketsTable.length) {
|
||||
var table = ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // search left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-3'i><'col-sm-2'l><'col-sm-7'p>>",
|
||||
|
||||
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-5'i><'col-sm-7'p>>",
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true,
|
||||
pageLength: 25,
|
||||
pageLength: 10,
|
||||
ordering: false,
|
||||
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
|
||||
$(document).on("click", "#submitBtn", function () {
|
||||
appendHrActivityHistoryHtml(this, true);
|
||||
|
||||
@ -10,11 +10,26 @@
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<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>
|
||||
</h5>
|
||||
</h4>
|
||||
|
||||
<!-- <h5 class="m-1">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne" aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
<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 class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
@ -103,15 +118,15 @@
|
||||
id="hr_tickets_table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">SNO</th>
|
||||
<th class="font-weight-medium">File name</th>
|
||||
<th class="font-weight-medium">Client</th>
|
||||
<th class="font-weight-medium">Client Branch</th>
|
||||
<th class="font-weight-medium">Policy</th>
|
||||
<th class="font-weight-medium">Event</th>
|
||||
<th class="font-weight-medium">User/Time</th>
|
||||
<th class="font-weight-medium">Status</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
<th class="font-weight-medium">S.No </th>
|
||||
<th class="font-weight-medium">File name </th>
|
||||
<th class="font-weight-medium">Client </th>
|
||||
<th class="font-weight-medium">Client Branch </th>
|
||||
<th class="font-weight-medium">Policy </th>
|
||||
<th class="font-weight-medium">Event </th>
|
||||
<th class="font-weight-medium">User/Time </th>
|
||||
<th class="font-weight-medium">Status </th>
|
||||
<th class="font-weight-medium">Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -341,27 +356,33 @@
|
||||
// for datatable
|
||||
$(document).ready(function() {
|
||||
$('#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-5'i><'col-sm-7'p>>",
|
||||
"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"
|
||||
});
|
||||
},
|
||||
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>',
|
||||
title: 'Employee-Upload-List',
|
||||
className: 'app-btn-primary ',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true,
|
||||
});
|
||||
|
||||
@ -10,19 +10,17 @@
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
||||
var client_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 branch_policy = '';
|
||||
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function() {
|
||||
getClientAndBranchAndPolicy();
|
||||
})
|
||||
|
||||
//featch client and branch and policy
|
||||
function getClientAndBranchAndPolicy()
|
||||
{
|
||||
function getClientAndBranchAndPolicy() {
|
||||
$.ajax({
|
||||
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
|
||||
type: "GET",
|
||||
@ -30,7 +28,7 @@
|
||||
success: function(res) {
|
||||
|
||||
console.log('getClientAndBranchAndPolicy', res);
|
||||
if(res.status == true){
|
||||
if (res.status == true) {
|
||||
|
||||
client_list = res.client_data;
|
||||
branch_list = res.branch_data;
|
||||
@ -39,8 +37,8 @@
|
||||
appendClients(res.client_data);
|
||||
appendClients2(res.client_data);
|
||||
appendClients3(res.client_data);
|
||||
|
||||
}else{
|
||||
|
||||
} else {
|
||||
console.log('No data found');
|
||||
}
|
||||
|
||||
@ -51,35 +49,42 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="row" id="client_add" style="position: relative; bottom: 25px;">
|
||||
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<h3>Inception</h3>
|
||||
<br>
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-1 active-tab" id="general_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
|
||||
<span class="d-none d-sm-inline-block dash-tab-font">Data From Client</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<a href="#KYC-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-1" id="kyc_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-file"></i></span>
|
||||
<span class="d-none d-sm-inline-block dash-tab-font">Insurer or TPA Data</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<a href="#HR-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-1" id="hr_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-file"></i></span>
|
||||
<span class="d-none d-sm-inline-block dash-tab-font">HR Uploaded Files</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<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">◀</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="d-none d-sm-inline-block ">Data From Client</span>
|
||||
</a>
|
||||
</li>
|
||||
<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-2" id="kyc_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-file"></i></span>
|
||||
<span class="d-none d-sm-inline-block ">Insurer or TPA Data</span>
|
||||
</a>
|
||||
</li>
|
||||
<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-2" id="hr_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-file"></i></span>
|
||||
<span class="d-none d-sm-inline-block ">HR Uploaded Files</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<!-- Right Arrow -->
|
||||
<button class="scroll-btn right-btn" type="button">▶</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="tab-content">
|
||||
<?php include('employee_upload.php'); ?>
|
||||
<?php include('insurer_or_tpa_data.php'); ?>
|
||||
@ -107,7 +112,7 @@
|
||||
function formatTextToCamelCase(str) {
|
||||
return str
|
||||
.replace(/_/g, ' ') // replace underscores with spaces
|
||||
.toLowerCase() // convert everything to lowercase
|
||||
.toLowerCase() // convert everything to lowercase
|
||||
.replace(/\b\w/g, char => char.toUpperCase()); // capitalize each word
|
||||
}
|
||||
</script>
|
||||
@ -80,19 +80,19 @@
|
||||
<thead class="">
|
||||
|
||||
<tr>
|
||||
<th>S.NO</th>
|
||||
<th>Policy Type</th>
|
||||
<th>Event Type</th>
|
||||
<th>Upload/Download</th>
|
||||
<th>Template</th>
|
||||
<th>Action</th>
|
||||
<th>S.NO </th>
|
||||
<th>Policy Type </th>
|
||||
<th>Event Type </th>
|
||||
<th>Upload/Download </th>
|
||||
<th>Template </th>
|
||||
<th>Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if(isset($insurer_templete_list)){ ?>
|
||||
<?php foreach($insurer_templete_list as $key => $value ){ ?>
|
||||
<tr>
|
||||
<td><?= $key+1; ?></td>
|
||||
<td class="text-center"><?= $key+1; ?></td>
|
||||
<td><?= $value['policy_type']; ?></td>
|
||||
<td><?= $events[$value['event_name']]; ?></td>
|
||||
<td><?= $value['type_name'] == 'import' ? 'Upload' : 'Download'; ?></td>
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<style>
|
||||
|
||||
.custom-dropdown-menu {
|
||||
.custom-dropdown-menu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #ffffff !important;
|
||||
@ -10,311 +9,323 @@
|
||||
min-width: 10rem;
|
||||
z-index: 9999;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item {
|
||||
.custom-dropdown-menu .dropdown-item {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
padding: 0.5rem 1rem !important;
|
||||
color: #212529 !important;
|
||||
text-decoration: none !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
}
|
||||
|
||||
.custom-dropdown-menu .dropdown-item:hover {
|
||||
.custom-dropdown-menu .dropdown-item:hover {
|
||||
background-color: #f8f9fa !important;
|
||||
color: #16181b !important;
|
||||
cursor: pointer !important;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-color{
|
||||
background-color: rgba(52, 174, 178, 1);
|
||||
color: white;
|
||||
border:1px solid rgba(52, 174, 178, 1);
|
||||
}
|
||||
.btn-color {
|
||||
background-color: rgba(52, 174, 178, 1);
|
||||
color: white;
|
||||
border: 1px solid rgba(52, 174, 178, 1);
|
||||
}
|
||||
|
||||
.btn-color:hover{
|
||||
.btn-color:hover {
|
||||
background-color: rgba(41, 139, 142, 1);
|
||||
color: white;
|
||||
border:1px solid rgba(41, 139, 142, 1);
|
||||
}
|
||||
|
||||
border: 1px solid rgba(41, 139, 142, 1);
|
||||
}
|
||||
</style>
|
||||
<div class="row" id="insurer_list">
|
||||
|
||||
<div class="container-fluid-min">
|
||||
<div class="row" id="insurer_list">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body maincard">
|
||||
<div class="row" style="margin-bottom:1rem;">
|
||||
<div class="card">
|
||||
<div class="card-body maincard">
|
||||
<!-- <div class="row" style="margin-bottom:1rem;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Insurers</h4>
|
||||
</div>
|
||||
</div>
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Name</th>
|
||||
<th class="font-weight-medium">Type</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</div> -->
|
||||
<table data-custom-table-css="table" class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th class="font-weight-medium">Name</th>
|
||||
<th class="font-weight-medium">Type</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php if(is_array($insurerList)) {foreach($insurerList as $row){ ?>
|
||||
<tr>
|
||||
<td><?php echo $row['name']; ?> ( <?php echo $row['short_name']; ?> ) </td>
|
||||
<td><?php echo $row['type']; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="<?= base_url("master/insurer/list/"); ?><?= $row['id'];?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a class="dropdown-item" data-id="<?= $row['id'];?>" onclick="removeInsurer(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }}?>
|
||||
<tbody>
|
||||
<?php if (is_array($insurerList)) {
|
||||
foreach ($insurerList as $row) { ?>
|
||||
<tr>
|
||||
<td><?php echo $row['name']; ?> ( <?php echo $row['short_name']; ?> ) </td>
|
||||
<td><?php echo $row['type']; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item" href="<?= base_url("master/insurer/list/"); ?><?= $row['id']; ?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a class="dropdown-item" data-id="<?= $row['id']; ?>" onclick="removeInsurer(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- end row -->
|
||||
|
||||
<script>
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const table = document.getElementById("tickets-table");
|
||||
|
||||
|
||||
// Create custom dropdown
|
||||
function createCustomDropdown(row) {
|
||||
// Get the original dropdown items
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
|
||||
// Create new dropdown with proper background and spacing
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
|
||||
// Copy inner content while maintaining icon alignment
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
return customDropdown;
|
||||
// Get the original dropdown items
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return null;
|
||||
|
||||
// Create new dropdown with proper background and spacing
|
||||
const customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
|
||||
// Copy inner content while maintaining icon alignment
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
return customDropdown;
|
||||
}
|
||||
|
||||
let activeDropdown = null;
|
||||
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
|
||||
document.body.appendChild(customDropdown);
|
||||
const customDropdown = createCustomDropdown(row);
|
||||
if (!customDropdown) return;
|
||||
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the action column
|
||||
if (event.target.closest('td:last-child')) {
|
||||
return;
|
||||
}
|
||||
document.body.appendChild(customDropdown);
|
||||
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
row.addEventListener("click", function(event) {
|
||||
// Ignore clicks on the action column
|
||||
if (event.target.closest('td:last-child')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown with some offset
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
// Set as active dropdown
|
||||
activeDropdown = customDropdown;
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
event.preventDefault(e);
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
}
|
||||
|
||||
// Close the dropdown after handling the click
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown with some offset
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
// Set as active dropdown
|
||||
activeDropdown = customDropdown;
|
||||
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
event.preventDefault(e);
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) {
|
||||
eval(onclickAttr);
|
||||
}
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') {
|
||||
window.location.href = href;
|
||||
}
|
||||
|
||||
// Close the dropdown after handling the click
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function() {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>" ,
|
||||
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-5'i><'col-sm-7'p>>",
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'InsurerList',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'ADD',
|
||||
className: 'btn btn-color',
|
||||
action: function () {
|
||||
window.location.href = "<?= base_url("master/insurer/create"); ?>";
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
{
|
||||
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: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
className: 'app-btn-primary ',
|
||||
title: 'InsurerList',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true ,
|
||||
paging: true,
|
||||
});
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
const btnExport = document.querySelector("#btnExport");
|
||||
const tableElement = document.querySelector("#tickets-table");
|
||||
const btnExport = document.querySelector("#btnExport");
|
||||
const tableElement = document.querySelector("#tickets-table");
|
||||
|
||||
btnExport.addEventListener("click", () => {
|
||||
const obj = new csvExport(tableElement);
|
||||
const csvData = obj.exportCsv();
|
||||
const blob = new Blob([csvData], { type: "text/csv" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = "UserList.csv";
|
||||
a.click();
|
||||
btnExport.addEventListener("click", () => {
|
||||
const obj = new csvExport(tableElement);
|
||||
const csvData = obj.exportCsv();
|
||||
const blob = new Blob([csvData], {
|
||||
type: "text/csv"
|
||||
});
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = "UserList.csv";
|
||||
a.click();
|
||||
|
||||
setTimeout(() => {
|
||||
URL.revokeObjectURL(url);
|
||||
}, 500);
|
||||
});
|
||||
setTimeout(() => {
|
||||
URL.revokeObjectURL(url);
|
||||
}, 500);
|
||||
});
|
||||
|
||||
|
||||
class csvExport {
|
||||
constructor(table, header = true) {
|
||||
this.table = table;
|
||||
this.rows = Array.from(table.querySelectorAll("tr"));
|
||||
if (!header && this.rows[0].querySelectorAll("th").length) {
|
||||
this.rows.shift();
|
||||
}
|
||||
}
|
||||
|
||||
exportCsv() {
|
||||
const lines = [];
|
||||
const ncols = this._longestRow();
|
||||
for (const row of this.rows) {
|
||||
let line = "";
|
||||
for (let i = 0; i < ncols - 1; i++) { // Exclude the last column
|
||||
if (row.children[i] !== undefined) {
|
||||
line += csvExport.safeData(row.children[i]);
|
||||
}
|
||||
line += i !== ncols - 2 ? "," : ""; // Adjusted for the last column exclusion
|
||||
class csvExport {
|
||||
constructor(table, header = true) {
|
||||
this.table = table;
|
||||
this.rows = Array.from(table.querySelectorAll("tr"));
|
||||
if (!header && this.rows[0].querySelectorAll("th").length) {
|
||||
this.rows.shift();
|
||||
}
|
||||
lines.push(line);
|
||||
}
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
_longestRow() {
|
||||
return this.rows.reduce((length, row) => (row.childElementCount > length ? row.childElementCount : length), 0);
|
||||
}
|
||||
exportCsv() {
|
||||
const lines = [];
|
||||
const ncols = this._longestRow();
|
||||
for (const row of this.rows) {
|
||||
let line = "";
|
||||
for (let i = 0; i < ncols - 1; i++) { // Exclude the last column
|
||||
if (row.children[i] !== undefined) {
|
||||
line += csvExport.safeData(row.children[i]);
|
||||
}
|
||||
line += i !== ncols - 2 ? "," : ""; // Adjusted for the last column exclusion
|
||||
}
|
||||
lines.push(line);
|
||||
}
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
static safeData(td) {
|
||||
let data = td.textContent;
|
||||
//Replace all double quote to two double quotes
|
||||
data = data.replace(/"/g, `""`);
|
||||
//Replace , and \n to double quotes
|
||||
data = /[",\n"]/.test(data) ? `"${data}"` : data;
|
||||
return data;
|
||||
_longestRow() {
|
||||
return this.rows.reduce((length, row) => (row.childElementCount > length ? row.childElementCount : length), 0);
|
||||
}
|
||||
|
||||
static safeData(td) {
|
||||
let data = td.textContent;
|
||||
//Replace all double quote to two double quotes
|
||||
data = data.replace(/"/g, `""`);
|
||||
//Replace , and \n to double quotes
|
||||
data = /[",\n"]/.test(data) ? `"${data}"` : data;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function removeInsurer(element) {
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this insurer.",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
title: "Are you sure?",
|
||||
text: "You need to remove this insurer.",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
}).then((result) => {
|
||||
|
||||
if (result.isConfirmed) {
|
||||
var id = element.getAttribute('data-id');
|
||||
var form_action = '<?= base_url("master/insurer/remove/") ?>' + id;
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
// console.log(res.status == true);
|
||||
if(res){
|
||||
if (res.status == true) {
|
||||
toastr.success('Insurer removed successfully', 'success');
|
||||
location.reload();
|
||||
} else {
|
||||
toastr.warning('Failed to remove insurer', 'warning');
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Failed to remove insurer', 'warning');
|
||||
}
|
||||
});
|
||||
if (result.isConfirmed) {
|
||||
var id = element.getAttribute('data-id');
|
||||
var form_action = '<?= base_url("master/insurer/remove/") ?>' + id;
|
||||
$.ajax({
|
||||
url: form_action,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
// console.log(res.status == true);
|
||||
if (res) {
|
||||
if (res.status == true) {
|
||||
toastr.success('Insurer removed successfully', 'success');
|
||||
location.reload();
|
||||
} else {
|
||||
toastr.warning('Failed to remove insurer', 'warning');
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Failed to remove insurer', 'warning');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@ -20,34 +20,44 @@
|
||||
<span class="title-text ">Insurer</span>
|
||||
</h4>
|
||||
</div>
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-2 active-tab active">
|
||||
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
|
||||
<span class="d-none d-sm-inline-block">General</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#branch-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="insurer_branch_contacts_id">
|
||||
<span class="mr-1"><i class="mdi mdi-source-branch"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Branch & Contacts</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if(isset($insurer['id'])){ ?>
|
||||
|
||||
<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">◀</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#template-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="insurer_export_templete">
|
||||
<span class="mr-1"><i class="mdi mdi-file-export font-16"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Insurer Download Templete</span>
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-2 active-tab active">
|
||||
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
|
||||
<span class="d-none d-sm-inline-block">General</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#branch-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="insurer_branch_contacts_id">
|
||||
<span class="mr-1"><i class="mdi mdi-source-branch"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Branch & Contacts</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
<?php if (isset($insurer['id'])) { ?>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="#template-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="insurer_export_templete">
|
||||
<span class="mr-1"><i class="mdi mdi-file-export font-16"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Insurer Download Templete</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<!-- Right Arrow -->
|
||||
<button class="scroll-btn right-btn" type="button">▶</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<?php include('insurer_basic_info.php'); ?>
|
||||
<?php include('insurer_branch.php'); ?>
|
||||
@ -60,17 +70,18 @@
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function insurer_branch_contact() {
|
||||
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();
|
||||
toastr.warning('First Add the Insurer!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
// if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||
$('#btnBranchAdd').show();
|
||||
// }
|
||||
toastr.warning('First Add the Insurer!', 'warning', {
|
||||
timeOut: 2000
|
||||
});
|
||||
} else {
|
||||
// if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||
$('#btnBranchAdd').show();
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,6 +90,4 @@
|
||||
|
||||
insurer_branch_contact();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</script>
|
||||
@ -10,11 +10,21 @@
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<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>
|
||||
</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 class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
@ -48,7 +58,7 @@
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form- group col-md-4">
|
||||
<label>Insurer/TPA Data<span class="text-danger">*</span></label> <br />
|
||||
<select name="insurer_or_tpa" class="form-control" id="insurer_or_tpa" required>
|
||||
<option value="">Select</option>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,68 +1,74 @@
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4" id="date_div">
|
||||
<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%">
|
||||
<i class="mdi mdi-calendar-blank"></i>
|
||||
<span></span> <i class="mdi mdi-menu-down"></i>
|
||||
|
||||
|
||||
<div class="container-fluid-min">
|
||||
<div class="col-xl-12" id="outstanding_filter">
|
||||
<div class="card-body">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h4 class="m-1">
|
||||
<span>Filter</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>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<!-- <div class="text-center"> -->
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4" id="date_div">
|
||||
<label>Date<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>
|
||||
<input type="hidden" id="startDate" value=<?= $default_start ?>>
|
||||
<input type="hidden" id="endDate" value=<?= $default_end ?>>
|
||||
</div>
|
||||
<input type="hidden" id="startDate" value=<?= $default_start ?>>
|
||||
<input type="hidden" id="endDate" value=<?= $default_end ?>>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Category<span class="text-danger"> *</span></label> <br />
|
||||
<select name="category" class="form-control" id="category" required>
|
||||
<option value="">Select</option>
|
||||
<?php foreach ($categories as $category => $key) : ?>
|
||||
<option value="<?= $key ?>"><?= $category ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Report Type<span class="text-danger"> *</span></label> <br />
|
||||
<select class="form-control" id="report_type" required>
|
||||
<option value="0">Select</option>
|
||||
<?php foreach ($report_type as $reports => $key) : ?>
|
||||
<option value="<?= $key ?>"><?= $reports ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row justify-content-end">
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Category<span class="text-danger"> *</span></label> <br />
|
||||
<select name="category" class="form-control" id="category" required>
|
||||
<option value="">Select</option>
|
||||
<?php foreach ($categories as $category => $key) : ?>
|
||||
<option value="<?= $key ?>"><?= $category ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<div class="col-auto">
|
||||
<a href="#" class="btn btn-primary waves-effect waves-light" id="get-report-page" onclick="fetchReportPage(event);">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label>Report Type<span class="text-danger"> *</span></label> <br />
|
||||
<select class="form-control" id="report_type" required>
|
||||
<option value="0">Select</option>
|
||||
<?php foreach ($report_type as $reports => $key) : ?>
|
||||
<option value="<?= $key ?>"><?= $reports ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div class="row justify-content-end">
|
||||
|
||||
<div class="col-auto">
|
||||
<a href="#" class="btn btn-primary waves-effect waves-light" id="get-report-page" onclick="fetchReportPage(event);">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mb-1">
|
||||
|
||||
</div>
|
||||
<div id="report"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
@ -73,7 +79,7 @@
|
||||
var end = moment(end, 'DD/MM/YYYY');
|
||||
|
||||
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'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
@ -81,6 +87,9 @@
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
locale: {
|
||||
format: 'DD-MM-YYYY'
|
||||
},
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
@ -96,16 +105,16 @@
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$('#category').on('click', function(){
|
||||
$('#category').on('click', function() {
|
||||
|
||||
var choosed_option = $('#category').val();
|
||||
$("#report_type").val('0');
|
||||
if (choosed_option == 'life' ){
|
||||
$("#report_type option[value='insurer']").show();
|
||||
$("#report_type option[value='bap']").hide();
|
||||
$("#report_type option[value='bapClient']").hide();
|
||||
$("#report_type option[value='bapInsurer']").hide();
|
||||
$("#report_type option[value='client']").show();
|
||||
if (choosed_option == 'life') {
|
||||
$("#report_type option[value='insurer']").show();
|
||||
$("#report_type option[value='bap']").hide();
|
||||
$("#report_type option[value='bapClient']").hide();
|
||||
$("#report_type option[value='bapInsurer']").hide();
|
||||
$("#report_type option[value='client']").show();
|
||||
|
||||
} else if (choosed_option == 'nonLife') {
|
||||
$("#report_type option[value='insurer']").show();
|
||||
@ -138,11 +147,11 @@
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
}else{
|
||||
} else {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message,'ERROR');
|
||||
toastr.error(message, 'ERROR');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -205,24 +205,37 @@ $(document).ready(function() {
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'IRDA-BAP-CLIENT-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'IRDA-BAP-CLIENT-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
}
|
||||
|
||||
],
|
||||
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 ',
|
||||
title: 'IRDA-BAP-CLIENT-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
title: 'IRDA-BAP-CLIENT-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
className: 'app-btn-primary ',
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 20, // Set default number of rows per page (optional)
|
||||
|
||||
@ -238,62 +238,128 @@ $(document).ready(function() {
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: '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;
|
||||
// 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;
|
||||
}
|
||||
});
|
||||
// // 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>';
|
||||
// // 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];
|
||||
}
|
||||
}
|
||||
}
|
||||
// // 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',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
className: 'app-btn-primary ',
|
||||
title: 'IRDA-BAP-INSURER-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
className: 'app-btn-primary ',
|
||||
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
],
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 20, // Set default number of rows per page (optional)
|
||||
|
||||
@ -78,62 +78,128 @@ $(document).ready(function() {
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: '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;
|
||||
// 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;
|
||||
}
|
||||
});
|
||||
// // 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>';
|
||||
// // 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];
|
||||
}
|
||||
}
|
||||
}
|
||||
// // 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',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
className: 'app-btn-primary ',
|
||||
title: 'IRDA-BAP-CLIENT-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
title: 'IRDA-BAP-CLIENT-List',
|
||||
className: 'app-btn-primary ',
|
||||
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
],
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 10, // Set default number of rows per page (optional)
|
||||
|
||||
@ -44,11 +44,11 @@
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<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;">
|
||||
<h4 style="position: relative;">KYC</h4>
|
||||
</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"
|
||||
id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
@ -175,31 +175,44 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
$('#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-5'i><'col-sm-7'p>>" ,
|
||||
|
||||
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'KYCList',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'ADD',
|
||||
className: 'btn btn-color',
|
||||
action: function () {
|
||||
window.location.href = "<?= base_url("master/kyc/create"); ?>";
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
{
|
||||
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: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
className: 'app-btn-primary ',
|
||||
title: 'KYCList',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
paging: true ,
|
||||
});
|
||||
|
||||
@ -1,33 +1,32 @@
|
||||
<style>
|
||||
body {
|
||||
.multiselect-native-select {
|
||||
position: relative;
|
||||
|
||||
/* bottom: 32px; */
|
||||
select {
|
||||
border: 0 !important;
|
||||
clip: rect(0 0 0 0) !important;
|
||||
height: 1px !important;
|
||||
margin: -1px -1px -1px -3px !important;
|
||||
overflow: hidden !important;
|
||||
padding: 0 !important;
|
||||
position: absolute !important;
|
||||
width: 1px !important;
|
||||
left: 50%;
|
||||
top: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.multiselect-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.multiselect-selected-text {
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
body {
|
||||
.multiselect-native-select {
|
||||
position: relative;
|
||||
/* bottom: 32px; */
|
||||
select {
|
||||
border: 0 !important;
|
||||
clip: rect(0 0 0 0) !important;
|
||||
height: 1px !important;
|
||||
margin: -1px -1px -1px -3px !important;
|
||||
overflow: hidden !important;
|
||||
padding: 0 !important;
|
||||
position: absolute !important;
|
||||
width: 1px !important;
|
||||
left: 50%;
|
||||
top: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.multiselect-container{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.multiselect-selected-text{
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="row" id="insurer_add">
|
||||
@ -50,21 +49,31 @@ body {
|
||||
<a href="<?= base_url("master/kyc/list"); ?>" ><i class="mdi mdi-arrow-left" style="font-size: 17px;"></i> </a>
|
||||
</div>
|
||||
</div> -->
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
<li class="nav-item">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-2 active-tab active">
|
||||
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
|
||||
<span class="d-none d-sm-inline-block">General</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#branch-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="kyc_docs_id">
|
||||
<span class="mr-1"><i class="mdi mdi-source-branch"></i></span>
|
||||
<span class="d-none d-sm-inline-block">KYC Docs</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<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">◀</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#general-q-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-2 active-tab active">
|
||||
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
|
||||
<span class="d-none d-sm-inline-block">General</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#branch-tab" data-toggle="tab" aria-expanded="false" class="nav-link px-3 py-2" id="kyc_docs_id">
|
||||
<span class="mr-1"><i class="mdi mdi-source-branch"></i></span>
|
||||
<span class="d-none d-sm-inline-block">KYC Docs</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<!-- Right Arrow -->
|
||||
<button class="scroll-btn right-btn" type="button">▶</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="tab-content">
|
||||
<?php include('kyc_entity_type_basic_info.php'); ?>
|
||||
<?php include('kyc_docs.php'); ?>
|
||||
@ -79,21 +88,23 @@ body {
|
||||
<script>
|
||||
function policy_type_branch_contact() {
|
||||
var check_policy_type_id = $('#kyc_General_PrimaryKey');
|
||||
|
||||
|
||||
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();
|
||||
toastr.warning('First Add the KYC Entity Type!', 'warning',{timeOut: 2000});
|
||||
}else{
|
||||
toastr.warning('First Add the KYC Entity Type!', 'warning', {
|
||||
timeOut: 2000
|
||||
});
|
||||
} else {
|
||||
if ($('#btnBranchBack')[0].style.display == 'none') {
|
||||
$('#btnBranchAdd').show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
document.getElementById("kyc_docs_id").addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
policy_type_branch_contact();
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
@ -4,37 +4,35 @@
|
||||
|
||||
<?php include(__DIR__ . '/../ticket_type_modal.php'); ?>
|
||||
|
||||
|
||||
<!-- Footer Start -->
|
||||
<div style="display: block;">
|
||||
<footer class="footer">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<script>
|
||||
document.write(new Date().getFullYear())
|
||||
</script> © NHANCE
|
||||
</div>
|
||||
<!-- <div class="col-md-6">
|
||||
<div class="text-md-right footer-links d-none d-sm-block">
|
||||
<a href="javascript:void(0);">About Us</a>
|
||||
<a href="javascript:void(0);">Help</a>
|
||||
<a href="javascript:void(0);">Contact Us</a>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<!-- end Footer -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ============================================================== -->
|
||||
<!-- End Page content -->
|
||||
<!-- ============================================================== -->
|
||||
|
||||
<!-- Footer Start -->
|
||||
<div style="background-color: white !important;">
|
||||
<footer class="footer" style="background-color: white !important;">
|
||||
<div class="">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<script>
|
||||
document.write(new Date().getFullYear())
|
||||
</script> © NHANCE
|
||||
</div>
|
||||
<!-- <div class="col-md-6">
|
||||
<div class="text-md-right footer-links d-none d-sm-block">
|
||||
<a href="javascript:void(0);">About Us</a>
|
||||
<a href="javascript:void(0);">Help</a>
|
||||
<a href="javascript:void(0);">Contact Us</a>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<!-- end Footer -->
|
||||
|
||||
|
||||
</div>
|
||||
<!-- END wrapper -->
|
||||
@ -157,8 +155,43 @@
|
||||
"closeButton": true,
|
||||
};
|
||||
</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>
|
||||
var pullNotificationCount = 0;
|
||||
var pendingActionCount = 0;
|
||||
@ -175,7 +208,7 @@
|
||||
|
||||
// console.log('responce', response)
|
||||
|
||||
if(response.status == false){
|
||||
if (response.status == false) {
|
||||
$('#notification_count').html('0')
|
||||
console.log('The session is not set correctly. ')
|
||||
return;
|
||||
@ -188,7 +221,7 @@
|
||||
|
||||
pullNotificationCount = response.message.length
|
||||
|
||||
|
||||
|
||||
|
||||
localStorage.setItem('pullNotificationCount', pullNotificationCount)
|
||||
|
||||
@ -332,8 +365,7 @@
|
||||
// console.log(response[key].length)
|
||||
// console.log('type', typeof response[key].length)
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
@ -342,7 +374,7 @@
|
||||
|
||||
let messagesList = $('#messages-list-2');
|
||||
messagesList.empty();
|
||||
|
||||
|
||||
|
||||
if (response.inception) {
|
||||
$.each(response.inception, function(index, item) {
|
||||
@ -405,7 +437,7 @@
|
||||
} else {
|
||||
console.log('response.inception is undefined or null');
|
||||
}
|
||||
|
||||
|
||||
if (response.correction) {
|
||||
$.each(response.correction, function(index, item) {
|
||||
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
|
||||
@ -476,7 +508,7 @@
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
console.log('response.correction is undefined or null');
|
||||
}
|
||||
|
||||
@ -554,7 +586,7 @@
|
||||
}
|
||||
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
console.log('response.deletion is undefined or null');
|
||||
|
||||
}
|
||||
@ -564,46 +596,46 @@
|
||||
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
|
||||
|
||||
|
||||
var queryParams = {
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
client_branch_id: item.branch_id,
|
||||
event: 'si_enhancement',
|
||||
actions: 'export',
|
||||
insurer_or_tpa: 'tpa',
|
||||
};
|
||||
var queryParams = {
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
client_branch_id: item.branch_id,
|
||||
event: 'si_enhancement',
|
||||
actions: 'export',
|
||||
insurer_or_tpa: 'tpa',
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
////console.log(url)
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
////console.log(url)
|
||||
|
||||
|
||||
var toast_body_css = 'background : #bfd7eb !important;';
|
||||
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
|
||||
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
var title = 'SI Enhancement Pending';
|
||||
var toast_body_css = 'background : #bfd7eb !important;';
|
||||
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
|
||||
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
var title = 'SI Enhancement Pending';
|
||||
|
||||
|
||||
if (!item.branch_name.toLowerCase().includes('branch')) {
|
||||
if (!item.branch_name.toLowerCase().includes('branch')) {
|
||||
|
||||
//console.log(item.branch_name)
|
||||
item.branch_name += ' branch';
|
||||
//console.log(item.branch_name)
|
||||
item.branch_name += ' branch';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
////console.log(item.branch_name);
|
||||
////console.log(item.branch_name);
|
||||
|
||||
// if (item.batch_export_count > 0) {
|
||||
// if (item.batch_export_count > 0) {
|
||||
|
||||
// title = 'SI Enhancement Import Pending';
|
||||
// }
|
||||
// title = 'SI Enhancement Import Pending';
|
||||
// }
|
||||
|
||||
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
|
||||
////console.log(toast_body_data);
|
||||
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
|
||||
////console.log(toast_body_data);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
<div class="p-3">
|
||||
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
|
||||
<div class="toast-header " style="${toast_head_css}" >
|
||||
@ -625,12 +657,12 @@
|
||||
</li>`
|
||||
|
||||
|
||||
messagesList.append(html);
|
||||
messagesList.append(html);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}else{
|
||||
});
|
||||
} else {
|
||||
console.log('response.si_enhancement is undefined or null');
|
||||
|
||||
}
|
||||
@ -665,7 +697,7 @@
|
||||
|
||||
//console.log(item.branch_name)
|
||||
item.branch_name += ' branch';
|
||||
|
||||
|
||||
}
|
||||
|
||||
////console.log(item.branch_name);
|
||||
@ -704,7 +736,7 @@
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
console.log('response.tpa is undefined or null');
|
||||
|
||||
}
|
||||
@ -713,46 +745,46 @@
|
||||
$.each(response.uhid, function(index, item) {
|
||||
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
|
||||
|
||||
var queryParams = {
|
||||
var queryParams = {
|
||||
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
client_branch_id: item.branch_id,
|
||||
event: 'inception',
|
||||
insurer_or_tpa: 'insurer',
|
||||
actions: 'export',
|
||||
};
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
client_branch_id: item.branch_id,
|
||||
event: 'inception',
|
||||
insurer_or_tpa: 'insurer',
|
||||
actions: 'export',
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
//console.log(url)
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
//console.log(url)
|
||||
|
||||
var toast_body_css = 'background : #bfd7eb !important;';
|
||||
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
|
||||
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
var title = 'Insurer Pending';
|
||||
var toast_body_css = 'background : #bfd7eb !important;';
|
||||
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
|
||||
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
var title = 'Insurer Pending';
|
||||
|
||||
|
||||
if (!item.branch_name.toLowerCase().includes('branch')) {
|
||||
if (!item.branch_name.toLowerCase().includes('branch')) {
|
||||
|
||||
//console.log(item.branch_name)
|
||||
item.branch_name += ' branch';
|
||||
//console.log(item.branch_name)
|
||||
item.branch_name += ' branch';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
////console.log(item.branch_name);
|
||||
////console.log(item.branch_name);
|
||||
|
||||
// if (item.batch_export_count > 0) {
|
||||
// if (item.batch_export_count > 0) {
|
||||
|
||||
// title = 'Insurer Import Pending';
|
||||
// }
|
||||
// title = 'Insurer Import Pending';
|
||||
// }
|
||||
|
||||
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
|
||||
////console.log(toast_body_data);
|
||||
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
|
||||
////console.log(toast_body_data);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
<div class="p-3">
|
||||
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
|
||||
<div class="toast-header " style="${toast_head_css}" >
|
||||
@ -774,11 +806,11 @@
|
||||
</li>`
|
||||
|
||||
|
||||
messagesList.append(html);
|
||||
messagesList.append(html);
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
console.log('response.uhid is undefined or null');
|
||||
}
|
||||
localStorage.setItem('pendingActionCount', pendingActionCount)
|
||||
@ -826,9 +858,7 @@
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function formatDate(dateString)
|
||||
{
|
||||
function formatDate(dateString) {
|
||||
// Parse the input date string
|
||||
let date = new Date(dateString);
|
||||
|
||||
@ -856,8 +886,7 @@
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
function printCurrentTime()
|
||||
{
|
||||
function printCurrentTime() {
|
||||
var now = new Date();
|
||||
var hours = now.getHours().toString().padStart(2, '0');
|
||||
var minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
@ -867,163 +896,256 @@
|
||||
|
||||
return currentTime;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function checkDuplicateTableFieldValue(tableName, fieldName, value, callback) {
|
||||
$.ajax({
|
||||
url: '<?= base_url('util/checkDuplicateTableFieldValue') ?>', // Adjust this to your endpoint in CodeIgniter
|
||||
type: 'POST',
|
||||
data: {
|
||||
table: tableName,
|
||||
field: fieldName,
|
||||
value: value
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (typeof callback === 'function') {
|
||||
callback(response.isDuplicate); // Pass the result to the callback
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('AJAX Error:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function sendAjaxRequestForGlobal(url, method, data = {}, successCallback = null, errorCallback = null) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
method: method,
|
||||
data: data,
|
||||
dataType: 'json', // Expected response type
|
||||
success: function(response) {
|
||||
// If a success callback is provided, call it with the response
|
||||
if (successCallback) {
|
||||
successCallback(response);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Handle errors if provided error callback
|
||||
if (errorCallback) {
|
||||
errorCallback(xhr, status, error);
|
||||
} else {
|
||||
function checkDuplicateTableFieldValue(tableName, fieldName, value, callback) {
|
||||
$.ajax({
|
||||
url: '<?= base_url('util/checkDuplicateTableFieldValue') ?>', // Adjust this to your endpoint in CodeIgniter
|
||||
type: 'POST',
|
||||
data: {
|
||||
table: tableName,
|
||||
field: fieldName,
|
||||
value: value
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (typeof callback === 'function') {
|
||||
callback(response.isDuplicate); // Pass the result to the callback
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('AJAX Error:', error);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmActionSweertAlert(message = "Are you sure?", confirmText = "Yes, Proceed!", cancelText = "Cancel", icon = "warning") {
|
||||
return Swal.fire({
|
||||
title: message,
|
||||
icon: icon,
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: confirmText,
|
||||
cancelButtonText: cancelText
|
||||
}).then((result) => {
|
||||
return result.isConfirmed; // Returns true if confirmed, false otherwise
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function sendAjaxRequestForGlobal(url, method, data = {}, successCallback = null, errorCallback = null) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
method: method,
|
||||
data: data,
|
||||
dataType: 'json', // Expected response type
|
||||
success: function(response) {
|
||||
// If a success callback is provided, call it with the response
|
||||
if (successCallback) {
|
||||
successCallback(response);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Handle errors if provided error callback
|
||||
if (errorCallback) {
|
||||
errorCallback(xhr, status, error);
|
||||
} else {
|
||||
console.error('AJAX Error:', error);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmActionSweertAlert(message = "Are you sure?", confirmText = "Yes, Proceed!", cancelText = "Cancel", icon = "warning") {
|
||||
return Swal.fire({
|
||||
title: message,
|
||||
icon: icon,
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: confirmText,
|
||||
cancelButtonText: cancelText
|
||||
}).then((result) => {
|
||||
return result.isConfirmed; // Returns true if confirmed, false otherwise
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function restoreDashboardHistoryIfNeeded() {
|
||||
function restoreDashboardHistoryIfNeeded() {
|
||||
|
||||
const dashboardHistoryString = localStorage.getItem('dashboardHistory');
|
||||
const dashboardHistoryString = localStorage.getItem('dashboardHistory');
|
||||
|
||||
if (!dashboardHistoryString) {
|
||||
console.log("dashboardHistory not found");
|
||||
return;
|
||||
}
|
||||
|
||||
const dashboardHistory = JSON.parse(dashboardHistoryString);
|
||||
|
||||
if (window.location.href === dashboardHistory.dashboard_url) {
|
||||
const tabSelector = dashboardHistory.tab;
|
||||
if (tabSelector) {
|
||||
const tabElement = document.querySelector(`a[href="${tabSelector}"]`);
|
||||
if (tabElement) {
|
||||
tabElement.click();
|
||||
}
|
||||
}
|
||||
|
||||
const functionName = dashboardHistory.function_name;
|
||||
const params = dashboardHistory.tile_params;
|
||||
|
||||
if (functionName && typeof window[functionName] === 'function') {
|
||||
if(params.majorType == 0 && params.minorType == 0){
|
||||
window[functionName]();
|
||||
}else{
|
||||
window[functionName](params.majorType, params.minorType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
console.log("inside location match");
|
||||
}
|
||||
if (!dashboardHistoryString) {
|
||||
console.log("dashboardHistory not found");
|
||||
return;
|
||||
}
|
||||
|
||||
// Run on popstate (back/forward buttons)
|
||||
window.addEventListener('popstate', restoreDashboardHistoryIfNeeded);
|
||||
const dashboardHistory = JSON.parse(dashboardHistoryString);
|
||||
|
||||
// Run on page load (refresh)
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
// slight delay ensures DOM/tab loads completely
|
||||
setTimeout(restoreDashboardHistoryIfNeeded, 100);
|
||||
});
|
||||
if (window.location.href === dashboardHistory.dashboard_url) {
|
||||
const tabSelector = dashboardHistory.tab;
|
||||
if (tabSelector) {
|
||||
const tabElement = document.querySelector(`a[href="${tabSelector}"]`);
|
||||
if (tabElement) {
|
||||
tabElement.click();
|
||||
}
|
||||
}
|
||||
|
||||
const functionName = dashboardHistory.function_name;
|
||||
const params = dashboardHistory.tile_params;
|
||||
|
||||
if (functionName && typeof window[functionName] === 'function') {
|
||||
if (params.majorType == 0 && params.minorType == 0) {
|
||||
window[functionName]();
|
||||
} else {
|
||||
window[functionName](params.majorType, params.minorType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
console.log("inside location match");
|
||||
}
|
||||
}
|
||||
|
||||
// Run on popstate (back/forward buttons)
|
||||
window.addEventListener('popstate', restoreDashboardHistoryIfNeeded);
|
||||
|
||||
// Run on page load (refresh)
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
// slight delay ensures DOM/tab loads completely
|
||||
setTimeout(restoreDashboardHistoryIfNeeded, 100);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(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');
|
||||
}
|
||||
|
||||
$('.li-seperate').on('click', function() {
|
||||
// reset all anchors
|
||||
$('.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>
|
||||
$(document).ready(function() {
|
||||
$('.nav-link').click(function() {
|
||||
|
||||
// change bg color of tab
|
||||
$('.nav-link').removeClass('active-tab');
|
||||
$(this).addClass('active-tab');
|
||||
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
// find all nav anchors
|
||||
let $nav = $("ul.nav.nav-pills.navtab-bg");
|
||||
|
||||
// check if no anchor has active classes
|
||||
if ($nav.find("a.active.active-tab").length === 0) {
|
||||
// add classes to the first anchor
|
||||
$nav.find("li:first-child a").addClass("active active-tab");
|
||||
|
||||
// also need to find the tab name and show only active image
|
||||
let tab_name = $nav.find("li:first-child a").attr('href').split('-')[0];
|
||||
tab_name = tab_name.replace('#', '');
|
||||
|
||||
|
||||
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');
|
||||
|
||||
|
||||
|
||||
$('.img-c').addClass('img-inactive');
|
||||
$(this).removeClass('.img-inactive');
|
||||
$(this).addClass('.img-active');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('.nav-link').click(function(){
|
||||
function closeModalById(modalId) {
|
||||
// Get the modal element
|
||||
var modal = document.getElementById(modalId);
|
||||
if (!modal) return; // Exit if no modal found
|
||||
|
||||
// change bg color of tab
|
||||
$('.nav-link').removeClass('active-tab');
|
||||
$(this).addClass('active-tab');
|
||||
|
||||
// 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();
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function openModal(modalId) {
|
||||
var modalEl = document.getElementById(modalId);
|
||||
|
||||
if (typeof bootstrap !== "undefined" && bootstrap.Modal) {
|
||||
// Bootstrap 5
|
||||
var modal = bootstrap.Modal.getOrCreateInstance(modalEl);
|
||||
modal.show();
|
||||
} else if (typeof $ !== "undefined" && typeof $.fn.modal === "function") {
|
||||
// Bootstrap 4
|
||||
$('#' + modalId).modal('show');
|
||||
} else {
|
||||
console.error("No compatible Bootstrap modal found.");
|
||||
// Allow page scrolling again
|
||||
document.body.classList.remove('modal-open');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,369 +1,368 @@
|
||||
<style>
|
||||
.col-12 {
|
||||
max-width: 98% !important;
|
||||
}
|
||||
.col-12 {
|
||||
max-width: 98% !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row" id="lead_filter_div">
|
||||
<div class="col-12" style="margin-top: -12px;">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<div class="row">
|
||||
<div class="col-md-6" style="position: relative;left: 17px;">
|
||||
<h4 style="text-align: left; margin-left:30px;">Lead Filter</h4>
|
||||
</div>
|
||||
<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>
|
||||
<div class="container-fluid-min">
|
||||
<div class="row" id="lead_filter_div">
|
||||
<div class="col-12" style="margin-top: -12px;">
|
||||
<div class="card-body">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h4 class="m-1">
|
||||
<span>Filter</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>
|
||||
</div>
|
||||
</div>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse hide" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
</h4>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_issuer_type"> Issuer Type <span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_issuer_type" name="filter_issuer_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
<div id="collapseOne" class="collapse hide" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_issuer_type"> Issuer Type <span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_issuer_type" name="filter_issuer_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_lead_type"> Lead Type <span class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_lead_type" name="filter_lead_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($lead_type) && count($lead_type)) {
|
||||
foreach ($lead_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_lead_type"> Lead Type <span class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_lead_type" name="filter_lead_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($lead_type) && count($lead_type)) {
|
||||
foreach ($lead_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_client_type"> Client Type <span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_client_type" name="filter_client_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($client_type) && count($client_type)) {
|
||||
foreach ($client_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_client_type"> Client Type <span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_client_type" name="filter_client_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($client_type) && count($client_type)) {
|
||||
foreach ($client_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_policy_type"> Policy Type <span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_policy_type" name="filter_policy_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($policy_type) && count($policy_type)) {
|
||||
foreach ($policy_type as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_policy_type"> Policy Type <span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_policy_type" name="filter_policy_type">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($policy_type) && count($policy_type)) {
|
||||
foreach ($policy_type as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_client_id">Client<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_client_id" name="filter_client_id">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_client_id">Client<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_client_id" name="filter_client_id">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_client_branch_id">Client Branch<span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_client_branch_id"
|
||||
name="filter_client_branch_id">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_client_branch_id">Client Branch<span
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_client_branch_id"
|
||||
name="filter_client_branch_id">
|
||||
<option value="0">Select</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_lead_status">Status<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_lead_status" name="filter_lead_status">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($lead_status) && count($lead_status)) {
|
||||
foreach ($lead_status as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
<div class="form-group col-md-3">
|
||||
<label for="filter_lead_status">Status<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="filter_lead_status" name="filter_lead_status">
|
||||
<option value="0">Select</option>
|
||||
<?php
|
||||
if (isset($lead_status) && count($lead_status)) {
|
||||
foreach ($lead_status as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12 text-right m-b-0" style="margin-bottom: -15px;">
|
||||
<a href="<?= base_url("/leads/list"); ?>" class="btn btn-secondary"
|
||||
id="clear-filters">Clear</a>
|
||||
<a class="btn btn-primary" id="get-emp-list"
|
||||
onclick="fetchTicketListData();">Submit</a>
|
||||
</div>
|
||||
<div class="form-group col-md-12 text-right m-b-0" style="margin-bottom: -15px;">
|
||||
<a href="<?= base_url("/leads/list"); ?>" class="btn btn-secondary"
|
||||
id="clear-filters">Clear</a>
|
||||
<a class="btn btn-primary" id="get-emp-list"
|
||||
onclick="fetchTicketListData();">Submit</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- end page title -->
|
||||
<div id="lead_list_div">
|
||||
<?php include('leads_list.php'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- end page title -->
|
||||
<div id="lead_list_div">
|
||||
<?php include('leads_list.php'); ?>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var filter_client_list = [];
|
||||
var filter_branch_list = [];
|
||||
var filter_client_list = [];
|
||||
var filter_branch_list = [];
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#filter_client_id').select2();
|
||||
$('#filter_client_branch_id').select2();
|
||||
$('#filter_policy_type').select2();
|
||||
$(document).ready(function() {
|
||||
$('#filter_client_id').select2();
|
||||
$('#filter_client_branch_id').select2();
|
||||
$('#filter_policy_type').select2();
|
||||
|
||||
getfilterClientAndBranch()
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#filter_client_id').change(function() {
|
||||
|
||||
let client_id = $(this).val();
|
||||
if (filter_branch_list != '') {
|
||||
// console.log(branch_list[client_id]);
|
||||
let data = filter_branch_list[client_id];
|
||||
appendfilterBranch(data);
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
//----- AJAX FUNCTIONS --------------------------------------------------------------------------------
|
||||
|
||||
function fetchTicketListData() {
|
||||
|
||||
var issuer_type = $('#filter_issuer_type').val();
|
||||
var lead_type = $('#filter_lead_type').val();
|
||||
var policy_type = $('#filter_policy_type').val();
|
||||
var client_type = $('#filter_client_type').val();
|
||||
var status = $('#filter_lead_status').val();
|
||||
var client_id = $('#filter_client_id').val();
|
||||
var client_branch_id = $('#filter_client_branch_id').val();
|
||||
|
||||
var requestData = {
|
||||
issuer: issuer_type,
|
||||
lead_type: lead_type,
|
||||
policy_type_id: policy_type,
|
||||
client_type: client_type,
|
||||
status: status,
|
||||
client_id: client_id,
|
||||
client_branch_id: client_branch_id,
|
||||
};
|
||||
|
||||
console.log("requestData", requestData);
|
||||
|
||||
var url = '<?= base_url('/leads/list') ?>';
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
|
||||
console.log('Filter Responce', response);
|
||||
|
||||
if (response.status == true) {
|
||||
|
||||
$('#lead_list_div').empty();
|
||||
$('#lead_list_div').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
setTimeout(function(){
|
||||
additionalDropdown();
|
||||
}, 1000);
|
||||
|
||||
} else {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message, 'ERROR');
|
||||
}
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
toastr.error('An error occurred while fetching the data.', 'ERROR');
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
getfilterClientAndBranch()
|
||||
});
|
||||
}
|
||||
|
||||
//function for fetch client, branch
|
||||
function getfilterClientAndBranch() {
|
||||
$.ajax({
|
||||
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
$(document).ready(function() {
|
||||
$('#filter_client_id').change(function() {
|
||||
|
||||
console.log('getClientAndBranchAndPolicy', res);
|
||||
if (res.status == true) {
|
||||
filter_client_list = res.client_data;
|
||||
filter_branch_list = res.branch_data;
|
||||
appendfilterClients(res.client_data);
|
||||
} else {
|
||||
console.log('No data found');
|
||||
let client_id = $(this).val();
|
||||
if (filter_branch_list != '') {
|
||||
// console.log(branch_list[client_id]);
|
||||
let data = filter_branch_list[client_id];
|
||||
appendfilterBranch(data);
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
})
|
||||
});
|
||||
|
||||
//----- AJAX FUNCTIONS --------------------------------------------------------------------------------
|
||||
|
||||
function fetchTicketListData() {
|
||||
|
||||
var issuer_type = $('#filter_issuer_type').val();
|
||||
var lead_type = $('#filter_lead_type').val();
|
||||
var policy_type = $('#filter_policy_type').val();
|
||||
var client_type = $('#filter_client_type').val();
|
||||
var status = $('#filter_lead_status').val();
|
||||
var client_id = $('#filter_client_id').val();
|
||||
var client_branch_id = $('#filter_client_branch_id').val();
|
||||
|
||||
var requestData = {
|
||||
issuer: issuer_type,
|
||||
lead_type: lead_type,
|
||||
policy_type_id: policy_type,
|
||||
client_type: client_type,
|
||||
status: status,
|
||||
client_id: client_id,
|
||||
client_branch_id: client_branch_id,
|
||||
};
|
||||
|
||||
console.log("requestData", requestData);
|
||||
|
||||
var url = '<?= base_url('/leads/list') ?>';
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
|
||||
console.log('Filter Responce', response);
|
||||
|
||||
if (response.status == true) {
|
||||
|
||||
$('#lead_list_div').empty();
|
||||
$('#lead_list_div').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
setTimeout(function() {
|
||||
additionalDropdown();
|
||||
}, 1000);
|
||||
|
||||
} else {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message, 'ERROR');
|
||||
}
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
toastr.error('An error occurred while fetching the data.', 'ERROR');
|
||||
|
||||
//----- END AJAX FUNCTIONS --------------------------------------------------------------------------------
|
||||
|
||||
|
||||
function appendfilterClients(data) {
|
||||
|
||||
$('#filter_client_id').empty();
|
||||
|
||||
$('#filter_client_id').append($('<option>', {
|
||||
value: 0,
|
||||
text: 'Select'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.client_name,
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
});
|
||||
|
||||
$('#filter_client_id').append(option);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function appendfilterBranch(data) {
|
||||
|
||||
$('#filter_client_branch_id').empty();
|
||||
|
||||
$('#filter_client_branch_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.branch_name
|
||||
});
|
||||
$('#filter_client_branch_id').append(option);
|
||||
});
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
|
||||
function additionalDropdown() {
|
||||
const table = document.getElementById("tickets-table");
|
||||
if (!table) return; // Prevent errors if the table is not found
|
||||
let activeDropdown = null;
|
||||
|
||||
function handleDropdownClick(row, event) {
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
|
||||
let customDropdown = row.customDropdown;
|
||||
if (!customDropdown) {
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return;
|
||||
|
||||
customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
document.body.appendChild(customDropdown);
|
||||
row.customDropdown = customDropdown;
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function (e) {
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) eval(onclickAttr);
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') window.location.href = href;
|
||||
|
||||
customDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
activeDropdown = customDropdown;
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
row.addEventListener("click", function (event) {
|
||||
if (!event.target.closest('td:last-child')) {
|
||||
handleDropdownClick(row, event);
|
||||
//function for fetch client, branch
|
||||
function getfilterClientAndBranch() {
|
||||
$.ajax({
|
||||
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
console.log('getClientAndBranchAndPolicy', res);
|
||||
if (res.status == true) {
|
||||
filter_client_list = res.client_data;
|
||||
filter_branch_list = res.branch_data;
|
||||
appendfilterClients(res.client_data);
|
||||
} else {
|
||||
console.log('No data found');
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function () {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
//----- END AJAX FUNCTIONS --------------------------------------------------------------------------------
|
||||
|
||||
|
||||
function appendfilterClients(data) {
|
||||
|
||||
$('#filter_client_id').empty();
|
||||
|
||||
$('#filter_client_id').append($('<option>', {
|
||||
value: 0,
|
||||
text: 'Select'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.client_name,
|
||||
});
|
||||
|
||||
$('#filter_client_id').append(option);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function appendfilterBranch(data) {
|
||||
|
||||
$('#filter_client_branch_id').empty();
|
||||
|
||||
$('#filter_client_branch_id').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select'
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.branch_name
|
||||
});
|
||||
$('#filter_client_branch_id').append(option);
|
||||
});
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------
|
||||
|
||||
function additionalDropdown() {
|
||||
const table = document.getElementById("tickets-table");
|
||||
if (!table) return; // Prevent errors if the table is not found
|
||||
let activeDropdown = null;
|
||||
|
||||
function handleDropdownClick(row, event) {
|
||||
// Hide any active dropdown
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
}
|
||||
|
||||
let customDropdown = row.customDropdown;
|
||||
if (!customDropdown) {
|
||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||
if (!originalDropdown) return;
|
||||
|
||||
customDropdown = document.createElement('div');
|
||||
customDropdown.className = 'custom-dropdown-menu';
|
||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||
|
||||
document.body.appendChild(customDropdown);
|
||||
row.customDropdown = customDropdown;
|
||||
|
||||
// Preserve click handlers and add auto-close
|
||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||
item.addEventListener('click', function(e) {
|
||||
const onclickAttr = this.getAttribute('onclick');
|
||||
if (onclickAttr) eval(onclickAttr);
|
||||
|
||||
const href = this.getAttribute('href');
|
||||
if (href && href !== '#') window.location.href = href;
|
||||
|
||||
customDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Get click position
|
||||
const rect = event.target.getBoundingClientRect();
|
||||
|
||||
// Position the dropdown
|
||||
customDropdown.style.display = 'block';
|
||||
customDropdown.style.position = 'fixed';
|
||||
customDropdown.style.left = `${rect.left}px`;
|
||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||
|
||||
activeDropdown = customDropdown;
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Add click event listener to rows
|
||||
table.querySelectorAll("tbody tr").forEach(row => {
|
||||
row.addEventListener("click", function(event) {
|
||||
if (!event.target.closest('td:last-child')) {
|
||||
handleDropdownClick(row, event);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Close dropdown when clicking outside
|
||||
document.addEventListener("click", function() {
|
||||
if (activeDropdown) {
|
||||
activeDropdown.style.display = 'none';
|
||||
activeDropdown = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@ -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="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 class="status_tile" style="padding-left: 15px;">
|
||||
<a href="#" id="main_tile">Current Tile : </a>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -189,7 +189,7 @@ if (isset($selected_lead_type)) {
|
||||
$('#leads_form').hide()
|
||||
}
|
||||
|
||||
function getClientAndBranchAndPolicy() {
|
||||
function getClientAndBranchAndPolicy(append = true) {
|
||||
|
||||
console.log('getClientAndBranchAndPolicy function called')
|
||||
|
||||
@ -204,7 +204,9 @@ if (isset($selected_lead_type)) {
|
||||
client_list = res.client_data;
|
||||
branch_list = res.branch_data;
|
||||
policy_list = res.policy_data;
|
||||
appendClients(res.client_data);
|
||||
if(append == true){
|
||||
appendClients(res.client_data);
|
||||
}
|
||||
} else {
|
||||
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);
|
||||
|
||||
$('#client_id').empty();
|
||||
@ -238,22 +240,28 @@ if (isset($selected_lead_type)) {
|
||||
}));
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.client_name,
|
||||
'data-cn': item.client_name,
|
||||
'data-csn': item.short_name,
|
||||
'data-ct': item.client_type,
|
||||
'data-cet': item.entity_type_id,
|
||||
class: (item.client_type == 1) ? 'group' : (item.client_type == 2) ? 'individual' : ''
|
||||
});
|
||||
if(item.client_type == 1){
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.client_name,
|
||||
'data-cn': item.client_name,
|
||||
'data-csn': item.short_name,
|
||||
'data-ct': item.client_type,
|
||||
'data-cet': item.entity_type_id,
|
||||
class: (item.client_type == 1) ? 'group' : (item.client_type == 2) ? 'individual' : ''
|
||||
});
|
||||
|
||||
$('#client_id').append(option);
|
||||
if (client_id == item.id) {
|
||||
option.attr('selected', true);
|
||||
}
|
||||
|
||||
$('#client_id').append(option);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function appendBranch(data) {
|
||||
function appendBranch(data, branch_id = null) {
|
||||
|
||||
$('#client_branch_id').empty();
|
||||
|
||||
@ -268,6 +276,11 @@ if (isset($selected_lead_type)) {
|
||||
value: item.id,
|
||||
text: item.branch_name
|
||||
});
|
||||
|
||||
if (branch_id == item.id) {
|
||||
option.attr('selected', true);
|
||||
}
|
||||
|
||||
$('#client_branch_id').append(option);
|
||||
});
|
||||
}
|
||||
@ -334,6 +347,8 @@ if (isset($selected_lead_type)) {
|
||||
$("#client_short_name").val(shortName);
|
||||
|
||||
if (client_id == 'add_client') {
|
||||
|
||||
$(this).val("").select2();
|
||||
// alert("Hello");
|
||||
var myModal = new bootstrap.Modal(document.getElementById('upload_enrollment_model'));
|
||||
myModal.show();
|
||||
@ -378,7 +393,6 @@ if (isset($selected_lead_type)) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#client_branch_id').change(function() {
|
||||
|
||||
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');
|
||||
|
||||
@ -519,6 +533,80 @@ if (isset($selected_lead_type)) {
|
||||
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) {
|
||||
|
||||
if(index == 1){
|
||||
|
||||
@ -160,23 +160,23 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
<div>
|
||||
<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">
|
||||
<tr>
|
||||
<th><div class="column-header">S.No.</div></th>
|
||||
<th><div class="column-header">Lead Type</div></th>
|
||||
<th><div class="column-header">Issuer</div></th>
|
||||
<th><div class="column-header">Client Type</div></th>
|
||||
<th><div class="column-header">Client / Branch</div></th>
|
||||
<th><div class="column-header">Entity Type</div></th>
|
||||
<th><div class="column-header">Branch Name</div></th>
|
||||
<th><div class="column-header">Branch Code</div></th>
|
||||
<th><div class="column-header">Contact Person Name</div></th>
|
||||
<th><div class="column-header">Contact Person Mobile</div></th>
|
||||
<th><div class="column-header">Policy Type</div></th>
|
||||
<th><div class="column-header">Status</div></th>
|
||||
<th><div class="column-header">Action</div></th>
|
||||
<th><div class="column-header">S.No </div></th>
|
||||
<th><div class="column-header">Lead Type </div></th>
|
||||
<th><div class="column-header">Issuer </div></th>
|
||||
<th><div class="column-header">Client Type </div></th>
|
||||
<th><div class="column-header">Client / Branch </div></th>
|
||||
<th><div class="column-header">Entity Type </div></th>
|
||||
<th><div class="column-header">Branch Name </div></th>
|
||||
<th><div class="column-header">Branch Code </div></th>
|
||||
<th><div class="column-header">Contact Person Name </div></th>
|
||||
<th><div class="column-header">Contact Person Mobile </div></th>
|
||||
<th><div class="column-header">Policy Type </div></th>
|
||||
<th><div class="column-header">Status </div></th>
|
||||
<th><div class="column-header">Action </div></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -184,7 +184,18 @@ table.dataTable tbody td {
|
||||
<?php if(isset($lead_data_list)) { ?>
|
||||
<?php foreach($lead_data_list as $index => $row){ ?>
|
||||
<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 $issuer[$row['issuer']] ?? '-'; ?></td>
|
||||
<td><?php echo $client_type[$row['client_type']] ?? '-'; ?></td>
|
||||
@ -215,7 +226,7 @@ table.dataTable tbody td {
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<a class="dropdown-item btnHistory app-text-black"
|
||||
<a class="dropdown-item btnHistory font-color-black"
|
||||
data-id="<?= $row['id']; ?>"
|
||||
title="Click to view Mail History">
|
||||
<i class="mdi mdi-history mr-2 text-muted font-18 vertical-middle"></i>Email History
|
||||
@ -244,7 +255,7 @@ table.dataTable tbody td {
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<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>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@ -420,29 +431,41 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
dom: "<'row'<'col-sm-7'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Policy-Tranction-Inception-List',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
},
|
||||
text: 'Add',
|
||||
className: 'btn app-btn-primary mr-2',
|
||||
action: function(e, dt, node, config) {
|
||||
openLeadTypeAskModal();
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Add',
|
||||
className: 'buttons-html5 addbtnStyle',
|
||||
action: function (e, dt, node, config) {
|
||||
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: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
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,
|
||||
});
|
||||
} else {
|
||||
@ -501,14 +524,14 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th><div class="column-header">S.No.</div></th>
|
||||
<th><div class="column-header">From Mail</div></th>
|
||||
<th><div class="column-header">To Mail</div></th>
|
||||
<th><div class="column-header">BCC</div></th>
|
||||
<th><div class="column-header">CC</div></th>
|
||||
<th><div class="column-header">Type</div></th>
|
||||
<th><div class="column-header">Status</div></th>
|
||||
<th><div class="column-header">Date/Time</div></th>
|
||||
<th><div class="column-header">S.No </div></th>
|
||||
<th><div class="column-header">From Mail </div></th>
|
||||
<th><div class="column-header">To Mail </div></th>
|
||||
<th><div class="column-header">BCC </div></th>
|
||||
<th><div class="column-header">CC </div></th>
|
||||
<th><div class="column-header">Type </div></th>
|
||||
<th><div class="column-header">Status </div></th>
|
||||
<th><div class="column-header">Date/Time </div></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@ -36,6 +36,16 @@
|
||||
color: white !important;
|
||||
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>
|
||||
|
||||
|
||||
@ -45,13 +55,19 @@
|
||||
<div class="card-body">
|
||||
<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>
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right; position: relative;">
|
||||
<a href="<?= base_url('leads/list') ?>" type="button" id="btnAdd"
|
||||
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>
|
||||
<form role="form" class="parsley-examples" method="post" id="leads_non_eb_form_id"
|
||||
enctype="multipart/form-data">
|
||||
@ -59,135 +75,147 @@
|
||||
<input type="hidden" name="id" id="leads_primarykey">
|
||||
<input type="hidden" name="lead_form_type" id="lead_form_type_id" value="2">
|
||||
|
||||
<div class="form-row">
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="lead_type">Lead Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="lead_type" name="lead_type" required>
|
||||
<option value="">Select Lead Type</option>
|
||||
<?php
|
||||
if (isset($lead_type) && count($lead_type)) {
|
||||
foreach ($lead_type as $key => $value) {
|
||||
if ($key == 1) {
|
||||
echo "<option value=" . $key . " selected>" . $value . "</option>";
|
||||
} else {
|
||||
<div class="form-group col-md-4">
|
||||
<label for="lead_type">Lead Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="lead_type" name="lead_type" required>
|
||||
<option value="">Select Lead Type</option>
|
||||
<?php
|
||||
if (isset($lead_type) && count($lead_type)) {
|
||||
foreach ($lead_type as $key => $value) {
|
||||
if ($key == 1) {
|
||||
echo "<option value=" . $key . " selected>" . $value . "</option>";
|
||||
} else {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="issuer">Issuer<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="issuer" name="issuer" required>
|
||||
<option value="">Select Issuer</option>
|
||||
<?php
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="issuer">Issuer<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="issuer" name="issuer" required>
|
||||
<option value="">Select Issuer</option>
|
||||
<?php
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<!-- <hr> --> <!-- bcoz removed in design -->
|
||||
|
||||
<!-- client row -->
|
||||
<div class="form-row">
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-3 freshFields">
|
||||
<label class="switch" style="position: relative;top: 33px;left: 0px;">
|
||||
<input id="exixting_client" type="checkbox" name="exixting_client">
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
<div class="form-group offset-md-10 col-md-2 freshFields" style="float:right;">
|
||||
<label class="switch">
|
||||
<input id="exixting_client" type="checkbox" name="exixting_client">
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</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-row">
|
||||
|
||||
<div class="form-group col-md-4 renewalFields" style="display: none;">
|
||||
<label for="client_id">Client<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="client_id" name="client_id">
|
||||
<option value="">Select Client</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 renewalFields" style="display: none;">
|
||||
<label for="client_branch_id">Branch<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="client_branch_id" name="client_branch_id"
|
||||
onchange="getBranchData(this,1)">
|
||||
<option value="">Select Branch</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 freshFields">
|
||||
<label for="client_type">Client Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="client_type" name="client_type" required>
|
||||
<option value="">Select Client type</option>
|
||||
<?php
|
||||
if (isset($client_type) && count($client_type)) {
|
||||
foreach ($client_type as $key => $value) {
|
||||
echo "<option value='" . $key . "' >" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 freshFields">
|
||||
<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>
|
||||
<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-4 freshFields">
|
||||
<label for="client_name">Client Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="client_name" name="client_name"
|
||||
placeholder="Enter Client Name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 freshFields">
|
||||
<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"
|
||||
placeholder="Enter Client Short Name" onkeyup="validateInput(this, 'clients', 'short_name')" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 renewalFields" style="display: none;">
|
||||
<label for="source_policy_id"> Source Policy <span id="base_danger"
|
||||
class="text-danger">*</span></label>
|
||||
<select class="form-control" id="source_policy_id" name="source_policy_id" onchange="getPolicyData(this)">
|
||||
<option value="" selected>Select Source Policy</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="pan">PAN<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="pan" placeholder="Enter PAN Number"
|
||||
data-parsley-error-message="Invalid PAN Number. Example: ABCDE1234F" name="pan"
|
||||
data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 renewalFields" style="display: none;">
|
||||
<label for="client_id">Client<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="client_id" name="client_id">
|
||||
<option value="">Select Client</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 renewalFields" style="display: none;">
|
||||
<label for="client_branch_id">Branch<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="client_branch_id" name="client_branch_id"
|
||||
onchange="getBranchData(this,1)">
|
||||
<option value="">Select Branch</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 freshFields">
|
||||
<label for="client_type">Client Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="client_type" name="client_type" required>
|
||||
<option value="">Select Client type</option>
|
||||
<?php
|
||||
if (isset($client_type) && count($client_type)) {
|
||||
foreach ($client_type as $key => $value) {
|
||||
echo "<option value='" . $key . "' >" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 freshFields">
|
||||
<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>
|
||||
<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-3 freshFields">
|
||||
<label for="client_name">Client Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="client_name" name="client_name"
|
||||
placeholder="Enter Client Name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 freshFields">
|
||||
<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"
|
||||
placeholder="Enter Client Short Name" onkeyup="validateInput(this, 'clients', 'short_name')" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 renewalFields" style="display: none;">
|
||||
<label for="source_policy_id"> Source Policy <span id="base_danger"
|
||||
class="text-danger">*</span></label>
|
||||
<select class="form-control" id="source_policy_id" name="source_policy_id" onchange="getPolicyData(this)">
|
||||
<option value="" selected>Select Source Policy</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="pan">PAN<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="pan" placeholder="Enter PAN Number"
|
||||
data-parsley-error-message="Invalid PAN Number. Example: ABCDE1234F" name="pan"
|
||||
data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end client row -->
|
||||
|
||||
<hr>
|
||||
<!-- <hr> --> <!-- bcoz removed in design -->
|
||||
|
||||
<!-- branch row-->
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<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>
|
||||
<input type="text" class="form-control" id="gst" placeholder="Enter GST Number"
|
||||
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>
|
||||
</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>
|
||||
<input type="text" class="form-control" id="branch_name" name="branch_name"
|
||||
placeholder="Enter Branch Name" required>
|
||||
</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>
|
||||
<input type="text" class="form-control" id="branch_code" name="branch_code"
|
||||
placeholder="Enter Branch Code" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="contact_person_summary">Contact Person's</label>
|
||||
<select class="form-control" name="contact_person_summary" id="contact_person_summary">
|
||||
<option value="">Select a Person</option>
|
||||
@ -215,20 +243,20 @@
|
||||
|
||||
</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>
|
||||
<input type="text" class="form-control" id="contact_person_name" name="contact_person_name"
|
||||
placeholder="Enter Contact Name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="contact_person_mobile">Contact Person Mobile<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="contact_person_mobile"
|
||||
name="contact_person_mobile" placeholder="Enter Contact Mobile" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="contact_person_email">Contact Person Email<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="contact_person_email"
|
||||
@ -236,13 +264,17 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<!-- <hr> --> <!-- bcoz removed in design -->
|
||||
|
||||
<!-- policy row -->
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<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>
|
||||
<select class="form-control" id="policy_type_id" name="policy_type_id"
|
||||
onchange="getPolicyTypeFields(this)" required>
|
||||
@ -259,7 +291,7 @@
|
||||
</select>
|
||||
</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>
|
||||
<select class="form-control" id="insurer" name="insurer">
|
||||
<option value="">Select Insurer</option>
|
||||
@ -293,78 +325,96 @@
|
||||
</select>
|
||||
</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>
|
||||
<input type="text" class="form-control policy_start_date" id="policy_start_date" name="policy_start_date"
|
||||
placeholder="Enter DOC" required>
|
||||
<div class="input-icon">
|
||||
<input type="text" class="form-control policy_start_date" id="policy_start_date" name="policy_start_date"
|
||||
placeholder="Enter DOC" required>
|
||||
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="">Date of Expiry <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control policy_end_date" id="policy_end_date" name="policy_end_date"
|
||||
placeholder="Enter DOE" required>
|
||||
<div class="input-icon">
|
||||
<input type="text" class="form-control policy_end_date" id="policy_end_date" name="policy_end_date"
|
||||
placeholder="Enter DOE" required>
|
||||
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="appendArea"></div>
|
||||
|
||||
<div id="appendAreaForClaim">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<!-- <hr> --> <!-- bcoz removed in design -->
|
||||
|
||||
<div id="multiFileAppendArea_1"></div>
|
||||
|
||||
<hr>
|
||||
|
||||
<!-- other row -->
|
||||
<div class="form-row">
|
||||
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="file_upload">File Upload<span class="text-danger"></span></label>
|
||||
<input type="file" class="form-control" id="file_name" name="file_name" accept=".xls,.xlsx">
|
||||
<span class="text-danger" id="file_name_display"></span>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<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>
|
||||
<option value="">Select Sales Person</option>
|
||||
<?php if (isset($salse_team)) { ?>
|
||||
<?php foreach ($salse_team as $value) { ?>
|
||||
<option value="<?= $value['id']; ?>">
|
||||
<?= $value['first_name']; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<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>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="status"> Status <span id="base_danger" class="text-danger">*</span></label>
|
||||
<select class="form-control" id="lead_status" name="status" required>
|
||||
<option value="" selected>Select Status</option>
|
||||
<?php
|
||||
if (isset($lead_status) && count($lead_status)) {
|
||||
foreach ($lead_status as $key => $value) {
|
||||
if ($key == 'queued') {
|
||||
echo "<option value=" . $key . " selected>" . $value . "</option>";
|
||||
} else {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="notes">Remarks</label>
|
||||
<textarea class="form-control" id="notes" name="notes" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <hr> --> <!-- bcoz removed in design -->
|
||||
|
||||
<!-- other row -->
|
||||
<div class="card" id="collapseOne">
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="file_upload">File Upload<span class="text-danger"></span></label>
|
||||
<input type="file" class="form-control" id="file_name" name="file_name" accept=".xls,.xlsx">
|
||||
<span class="text-danger" id="file_name_display"></span>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<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>
|
||||
<option value="">Select Sales Person</option>
|
||||
<?php if (isset($salse_team)) { ?>
|
||||
<?php foreach ($salse_team as $value) { ?>
|
||||
<option value="<?= $value['id']; ?>">
|
||||
<?= $value['first_name']; ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="status"> Status <span id="base_danger" class="text-danger">*</span></label>
|
||||
<select class="form-control" id="lead_status" name="status" required>
|
||||
<option value="" selected>Select Status</option>
|
||||
<?php
|
||||
if (isset($lead_status) && count($lead_status)) {
|
||||
foreach ($lead_status as $key => $value) {
|
||||
if ($key == 'queued') {
|
||||
echo "<option value=" . $key . " selected>" . $value . "</option>";
|
||||
} else {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="notes">Remarks</label>
|
||||
<textarea class="form-control" id="notes" name="notes" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -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">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S.No.</th>
|
||||
<th>Log File</th>
|
||||
<th>Actions</th>
|
||||
<th>S.No </th>
|
||||
<th>Log File </th>
|
||||
<th>Actions </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (!empty($logs)): ?>
|
||||
<?php foreach ($logs as $index => $log): ?>
|
||||
<tr>
|
||||
<td><?= $index + 1 . '.' ?></td>
|
||||
<td class="text-center"><?= $index + 1 . '.' ?></td>
|
||||
<td><?= esc($log) ?></td>
|
||||
<td>
|
||||
<a href="<?= base_url('util/view_log/' . urlencode($log)) ?>">View</a> |
|
||||
|
||||
@ -161,4 +161,28 @@
|
||||
|
||||
</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>
|
||||
|
||||
312
app/Views/newClientModal-old.php
Normal file
312
app/Views/newClientModal-old.php
Normal 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>
|
||||
@ -57,7 +57,7 @@
|
||||
<div class="form-row branchdiv">
|
||||
|
||||
<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">
|
||||
<option value="" selected>Select Entity</option>
|
||||
<?php
|
||||
@ -72,22 +72,22 @@
|
||||
|
||||
<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">
|
||||
<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">
|
||||
<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">
|
||||
<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)">
|
||||
<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>
|
||||
@ -113,6 +113,7 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
let isGSTValidating = false;
|
||||
let isGSTValid = false;
|
||||
|
||||
@ -155,8 +156,6 @@
|
||||
$('#hide_smbt_btn button').prop('disabled', false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$("#client_form").submit(function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
@ -224,7 +223,7 @@
|
||||
//FORM Data
|
||||
var formData = new FormData($('#client_form')[0]);
|
||||
formData.append('client_type', client_type);
|
||||
console.log("formData : ",formData);
|
||||
|
||||
// return
|
||||
$.ajax({
|
||||
data:formData,
|
||||
@ -235,37 +234,38 @@
|
||||
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){
|
||||
getClientAndBranchAndPolicy(false);
|
||||
|
||||
setTimeout(function(){
|
||||
appendClients(res.clients, res.client_id);
|
||||
appendBranch(res.branches, res.branch_id);
|
||||
|
||||
$('#client_id').val(res.client_id).change();
|
||||
$('#client_id').prepend($('<option>', {
|
||||
value: 'add_client',
|
||||
text: '+ Add Client'
|
||||
}));
|
||||
$('#gst').val(res.data.gst);
|
||||
$('#branch_name').val(res.data.branch_name);
|
||||
$('#branch_code').val(res.data.branch_code);
|
||||
$('#contact_person_mobile').val(res.data.mobile);
|
||||
$('#contact_person_email').val(res.data.email);
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
$('#client_branch_id').val(res.branch_id).change();
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
$('#contact_person_summary').empty();
|
||||
$('#contact_person_summary').append($('<option>', {
|
||||
value: "",
|
||||
text: "Select a Contact"
|
||||
}));
|
||||
|
||||
}, 1000)
|
||||
|
||||
}, 3000)
|
||||
if (res.data.name && res.data.email) {
|
||||
|
||||
}else{
|
||||
// let display_value = `${res.data.name} - ${res.data.email} - ${res.data.mobile}`;
|
||||
let display_value = res.data.name;
|
||||
|
||||
$('#contact_person_summary').append($('<option>', {
|
||||
value: 0, // index or key in array/object
|
||||
text: display_value,
|
||||
selected: true
|
||||
}));
|
||||
|
||||
console.log("Couldn't Add Client","Error");
|
||||
}
|
||||
|
||||
toastr.success(res.message, 'Success');
|
||||
@ -277,25 +277,8 @@
|
||||
$('#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)
|
||||
}
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
isClientFormSubmitting = false;
|
||||
},
|
||||
|
||||
@ -1,443 +1,460 @@
|
||||
<style>
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
.table th,
|
||||
.table td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
table.dataTable tbody td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
.col-12 {
|
||||
|
||||
max-width: 98% !important;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.right-align-input {
|
||||
text-align: right;
|
||||
}
|
||||
.right-align-input {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.center-align-input {
|
||||
text-align: center;
|
||||
}
|
||||
.center-align-input {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row" id="outstanding_filter">
|
||||
<div class="col-12" style="margin-top: -12px;">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="container-fluid-min">
|
||||
<div class="col-12" id="outstanding_filter">
|
||||
<div class="card-body">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h4 class="m-1">
|
||||
<span>Filter</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>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="client_branch">Client<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="client_id" name="client_id">
|
||||
<option value="0">Select Client</option>
|
||||
<?php
|
||||
if (isset($clients) && count($clients)) {
|
||||
foreach ($clients as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['client_name'] . "</option>";
|
||||
}
|
||||
if (isset($clients) && count($clients)) {
|
||||
foreach ($clients as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['client_name'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="addon_policy"> Insurer <span id="base_danger"
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="insurer_id" name="insurer_id">
|
||||
<option value="0" selected>Select Insurer</option>
|
||||
<?php if(isset($insurer) && count($insurer)){ ?>
|
||||
<?php foreach ($insurer as $value) { ?>
|
||||
<option value="<?= $value['id']?>"><?= $value['name']?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="addon_policy"> Insurer <span id="base_danger"
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="insurer_id" name="insurer_id">
|
||||
<option value="0" selected>Select Insurer</option>
|
||||
<?php if (isset($insurer) && count($insurer)) { ?>
|
||||
<?php foreach ($insurer as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="addon_policy"> Insurer Branch<span id="base_danger"
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="insurer_id" name="insurer_id">
|
||||
<option value="0" selected>Select Insurer</option>
|
||||
<?php if(isset($insurer) && count($insurer)){ ?>
|
||||
<?php foreach ($insurer as $value) { ?>
|
||||
<option value="<?= $value['id']?>"><?= $value['name']?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="addon_policy"> Insurer Branch<span id="base_danger"
|
||||
class="text-danger"></span></label>
|
||||
<select class="form-control" id="insurer_id" name="insurer_id">
|
||||
<option value="0" selected>Select Insurer Branch</option>
|
||||
<?php if (isset($insurer) && count($insurer)) { ?>
|
||||
<?php foreach ($insurer as $value) { ?>
|
||||
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- <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>
|
||||
<select class="form-control" id="policy_type_id" name="policy_type_id">
|
||||
<option value="0">Select Policy Type</option>
|
||||
<?php
|
||||
if (isset($policy_types) && count($policy_types)) {
|
||||
foreach ($policy_types as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
|
||||
}
|
||||
if (isset($policy_types) && count($policy_types)) {
|
||||
foreach ($policy_types as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['policy_type'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div> -->
|
||||
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="client_branch">Issuer<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="issuer" name="issuer" required>
|
||||
<option value="0">Select Issure</option>
|
||||
<?php
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
if (isset($issuer) && count($issuer)) {
|
||||
foreach ($issuer as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div> -->
|
||||
|
||||
<!-- </div>
|
||||
<!-- </div>
|
||||
|
||||
<div class="form-row"> -->
|
||||
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label>Date Type<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="date_type" name="date_type"
|
||||
onchange="hideDateField()">
|
||||
<option value="0">Select Date Type</option>
|
||||
<?php
|
||||
if (isset($date_type) && count($date_type)) {
|
||||
foreach ($date_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
if (isset($date_type) && count($date_type)) {
|
||||
foreach ($date_type as $key => $value) {
|
||||
echo "<option value='" . $key . "'>" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-3" style="display: true;" id="date_div">
|
||||
<label>Statement Month<span class="text-danger"></span></label>
|
||||
<div class="form-group col-md-4" style="display: true;" id="date_div">
|
||||
<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"
|
||||
style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
|
||||
<i class="mdi mdi-calendar-blank"></i>
|
||||
<span></span> <i class="mdi mdi-menu-down"></i>
|
||||
</div> -->
|
||||
<input type="hidden" id="startDate">
|
||||
<input type="hidden" id="endDate">
|
||||
</div>
|
||||
<input type="hidden" id="startDate">
|
||||
<input type="hidden" id="endDate">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<a href="<?= base_url("/policy_tranction/report/report-outstanding-list"); ?>"
|
||||
class="btn btn-secondary" id="clear-filters">Clear</a>
|
||||
<a href="<?= base_url("/policy_tranction/report/report-outstanding-list"); ?>"
|
||||
class="btn btn-primary" id="get-emp-list"
|
||||
onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<a href="<?= base_url("/policy_tranction/report/report-outstanding-list"); ?>"
|
||||
class="btn btn-secondary" id="clear-filters">Clear</a>
|
||||
<a href="<?= base_url("/policy_tranction/report/report-outstanding-list"); ?>"
|
||||
class="btn btn-primary" id="get-emp-list"
|
||||
onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12" id="outstanding_list">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Outstanding Report</h4>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S.No </th>
|
||||
<!-- <th>Client Name</th> -->
|
||||
<th>Insurer </th>
|
||||
<th>Insurer<br> Branch </th>
|
||||
<th>Statement<br> Month </th>
|
||||
<th>Statement<br> No </th>
|
||||
<th>Invoice No </th>
|
||||
<th>Invoice Status </th>
|
||||
<th>Invoice Date </th>
|
||||
<th>Invoice Amount </th>
|
||||
<th>Realization <br>Amount </th>
|
||||
<th>Outstanding <br>Amount </th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
// dd($outstanting_list);
|
||||
if (isset($outstanting_list)) { ?>
|
||||
<?php foreach ($outstanting_list as $index => $row) { ?>
|
||||
<tr>
|
||||
<td class="text-center"><?= $index + 1 ?></td>
|
||||
<td><?php echo $row['short_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 $row['stmt_sno']; ?></td>
|
||||
<td><?php echo $row['invoice_no']; ?></td>
|
||||
<td class="center-align-input"><?php echo isset($row['invoice_status']) ? $row['invoice_status'] : ' - '; ?></td>
|
||||
<td><?php echo change_date_format($row['invoice_date'],'Y-m-d','d-M-Y'); ?></td>
|
||||
<td class="right-align-input"><?php echo isset($row['invoice_amount']) ? $row['invoice_amount'] : '0.00'; ?></td>
|
||||
<td class="right-align-input"><?php echo isset($row['total_paid']) ? $row['total_paid'] : '0.00'; ?></td>
|
||||
<td class="right-align-input"><?php echo isset($row['outstanding_amount']) ? $row['outstanding_amount'] : '0.00'; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12" id="outstanding_list">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Outstanding Report</h4>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S.No</th>
|
||||
<!-- <th>Client Name</th> -->
|
||||
<th>Insurer</th>
|
||||
<th>Insurer<br> Branch</th>
|
||||
<th>Statement<br> Month</th>
|
||||
<th>Statement<br> No</th>
|
||||
<th>Invoice No</th>
|
||||
<th>Invoice Status</th>
|
||||
<th>Invoice Date</th>
|
||||
<th>Invoice Amount</th>
|
||||
<th>Realization <br>Amount</th>
|
||||
<th>Outstanding <br>Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
// dd($outstanting_list);
|
||||
if (isset($outstanting_list)) { ?>
|
||||
<?php foreach($outstanting_list as $index => $row){ ?>
|
||||
<tr>
|
||||
<td><?= $index + 1 ?></td>
|
||||
<td><?php echo $row['short_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 $row['stmt_sno']; ?></td>
|
||||
<td><?php echo $row['invoice_no']; ?></td>
|
||||
<td class="center-align-input"><?php echo isset($row['invoice_status']) ? $row['invoice_status'] : ' - '; ?></td>
|
||||
<td><?php echo change_date_format($row['invoice_date'],'Y-m-d','d-M-Y'); ?></td>
|
||||
<td class="right-align-input"><?php echo isset($row['invoice_amount']) ? $row['invoice_amount'] : '0.00'; ?></td>
|
||||
<td class="right-align-input"><?php echo isset($row['total_paid']) ? $row['total_paid'] : '0.00'; ?></td>
|
||||
<td class="right-align-input"><?php echo isset($row['outstanding_amount']) ? $row['outstanding_amount'] : '0.00'; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Datatable document ready
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
customize: function(xlsx) {
|
||||
var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
||||
var total = 0;
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: '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-BDS-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
|
||||
title: 'Policy-Tranction-BDS-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;
|
||||
// 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);
|
||||
}
|
||||
});
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 25 // Set default number of rows per page (optional)
|
||||
});
|
||||
} else {
|
||||
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 span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
||||
$('#startDate').val(start.format('DD-MM-YYYY'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
ranges: {
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month')
|
||||
.endOf('month')
|
||||
]
|
||||
}
|
||||
]
|
||||
}],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 25 // Set default number of rows per page (optional)
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
|
||||
$('#clear-filters').on('click', function() {
|
||||
// Reset all select dropdowns to the first option
|
||||
$('#client_id').val('0').change();
|
||||
$('#insurer_id').val('0').change();
|
||||
$('#policy_type_id').val('0').change();
|
||||
$('#date_type').val('0');
|
||||
$('#issuer').val('0');
|
||||
$('#date_div').hide()
|
||||
|
||||
// Reset the date range picker to default
|
||||
$('#reportrange').data('daterangepicker').setStartDate(moment().subtract(29, 'days'));
|
||||
$('#reportrange').data('daterangepicker').setEndDate(moment());
|
||||
cb(start, end); // Update the displayed date range
|
||||
});
|
||||
|
||||
});
|
||||
$(document).ready(function() {
|
||||
getURLParams()
|
||||
$('#client_id').select2();
|
||||
$('#insurer_id').select2();
|
||||
$('#policy_type_id').select2();
|
||||
})
|
||||
|
||||
function hideDateField(input = null) {
|
||||
let val = $('#date_type').val();
|
||||
function fetchEmpolyeeList(event) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
|
||||
if (input) {
|
||||
val = input;
|
||||
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;
|
||||
}
|
||||
|
||||
if (val != 0) {
|
||||
$('#date_div').show()
|
||||
} else {
|
||||
$('#date_div').hide()
|
||||
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) {
|
||||
// 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'));
|
||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
||||
}
|
||||
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
// autoUpdateInput: false,
|
||||
locale: {
|
||||
format: 'DD-MM-YYYY' // 👈 force input format
|
||||
},
|
||||
ranges: {
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
|
||||
$('#clear-filters').on('click', function() {
|
||||
// Reset all select dropdowns to the first option
|
||||
$('#client_id').val('0').change();
|
||||
$('#insurer_id').val('0').change();
|
||||
$('#policy_type_id').val('0').change();
|
||||
$('#date_type').val('0');
|
||||
$('#issuer').val('0');
|
||||
$('#date_div').hide()
|
||||
|
||||
// Reset the date range picker to default
|
||||
$('#reportrange').data('daterangepicker').setStartDate(moment().subtract(29, 'days'));
|
||||
$('#reportrange').data('daterangepicker').setEndDate(moment());
|
||||
cb(start, end); // Update the displayed date range
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function hideDateField(input = null) {
|
||||
let val = $('#date_type').val();
|
||||
|
||||
if (input) {
|
||||
val = input;
|
||||
}
|
||||
|
||||
if (val != 0) {
|
||||
$('#date_div').show()
|
||||
} else {
|
||||
$('#date_div').hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function sendPolicyTransactionID(event, pt_id) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
function sendPolicyTransactionID(event, pt_id) {
|
||||
event.preventDefault(); // Prevent default action
|
||||
|
||||
console.log(pt_id);
|
||||
console.log(pt_id);
|
||||
|
||||
var queryParams = {
|
||||
pt_id: pt_id,
|
||||
};
|
||||
var queryParams = {
|
||||
pt_id: pt_id,
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const apiURL = $('#get-policy-list').attr('href') + "?" + queryString;
|
||||
console.log(apiURL);
|
||||
window.location.href = apiURL;
|
||||
}
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
const apiURL = $('#get-policy-list').attr('href') + "?" + queryString;
|
||||
console.log(apiURL);
|
||||
window.location.href = apiURL;
|
||||
}
|
||||
</script>
|
||||
@ -98,6 +98,22 @@
|
||||
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>
|
||||
|
||||
<div class="row" id="endorsement_form" style="display: none;">
|
||||
@ -129,15 +145,18 @@
|
||||
<div class="row">
|
||||
<!-- Section 1 -->
|
||||
<div class="col-md-12">
|
||||
<div class="form-section">
|
||||
<!-- <div class="form-section"> -->
|
||||
<div id="accordion_0" class="mb-0">
|
||||
<div class="card mb-0">
|
||||
<h4 class="m-1">Client Details
|
||||
<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>
|
||||
<label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
|
||||
<span class="font-color-black">Client Details</span>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
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="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_0">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
@ -172,10 +191,11 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -327,15 +347,167 @@
|
||||
<!-- Premium Details -->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-section">
|
||||
<div id="accordion_2" class="mb-0">
|
||||
<label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
|
||||
<span class="font-color-black">Endorsement</span>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseThree"
|
||||
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="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 <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">
|
||||
<h4 class="m-1">Premium Details
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseFour" aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h4>
|
||||
<div id="collapseFour" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_3">
|
||||
<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="col-md-2">
|
||||
<input type="number" id="setInsurerCount" class="form-control" placeholder="Enter count">
|
||||
@ -349,10 +521,10 @@
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<tr>
|
||||
<th>Premium Details</th>
|
||||
<th><span class="font-color-black">Premium Details</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -494,19 +666,16 @@
|
||||
</table>
|
||||
</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 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>
|
||||
</div>
|
||||
|
||||
@ -1713,8 +1882,10 @@ function addInsurerColumn() {
|
||||
// Update header
|
||||
$('#insurerTable thead tr').append(`
|
||||
<th>
|
||||
<span style="display:flex; justify-content:space-between; align-items:center;">
|
||||
Insurer ${insurerCount}
|
||||
${insurerCount > 1 ? `<a class="text-danger mdi mdi-delete delete-insurer" data-count="${insurerCount}" style="margin-left: 135px;"></a>` : ''}
|
||||
</span>
|
||||
</th>
|
||||
`);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -141,6 +141,22 @@
|
||||
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>
|
||||
|
||||
<div class="tab-pane fade active show" id="form">
|
||||
@ -184,15 +200,18 @@
|
||||
<div class="row">
|
||||
<!-- Section 1 -->
|
||||
<div class="col-md-12">
|
||||
<div class="form-section">
|
||||
|
||||
<div id="accordion_0" class="mb-0">
|
||||
<div class="card mb-0">
|
||||
<h4 class="m-1">Client Details
|
||||
<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>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_0">
|
||||
<label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
|
||||
<span class="font-color-black">Client Details</span>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
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="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_0">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="email"> Policy Type <span class="text-danger">*</span></label>
|
||||
@ -281,15 +300,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="vehicle_row_div">
|
||||
</div>
|
||||
|
||||
<!-- Client Section -->
|
||||
<div class="row" id="client_row_div">
|
||||
</div>
|
||||
@ -297,16 +316,18 @@
|
||||
<!-- Pre sales Row -->
|
||||
<div class="row" id="pre_sales_row">
|
||||
<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">
|
||||
|
||||
<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="form-group col-md-3">
|
||||
<label for="bp_igst">Policyholder Name</label>
|
||||
@ -495,24 +516,28 @@
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- sales Row -->
|
||||
<div class="row" id="sales_row" style="display: none;">
|
||||
<div class="col-md-12">
|
||||
<div class="form-section">
|
||||
|
||||
<div id="accordion_2" class="mb-0">
|
||||
<div class="card mb-0">
|
||||
<h4 class="m-1">Sales
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseThree" aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h4>
|
||||
<div id="collapseThree" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_2">
|
||||
<label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
|
||||
<span class="font-color-black">Sales</span>
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseThree"
|
||||
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="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="base_policy_id" style="display: none;">
|
||||
@ -652,20 +677,27 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- accordion_2 div closed here -->
|
||||
|
||||
</div><!-- 1st col-md-12 div closed here -->
|
||||
|
||||
|
||||
<!-- Premium Details -->
|
||||
<div class="row">
|
||||
<!-- 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="#collapseFour"
|
||||
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">
|
||||
<h4 class="m-1">Premium Details
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseFour" aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h4>
|
||||
<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="col-md-2">
|
||||
<!-- <label for="setInsurerCount">Insurer Count : </label> -->
|
||||
@ -681,7 +713,7 @@
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<tr>
|
||||
<th>Premium Details</th>
|
||||
@ -821,22 +853,18 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- insurerTableContainer div closed here-->
|
||||
|
||||
</div>
|
||||
</div> <!-- collapseFour div closed here -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- accordion_3 div closed here -->
|
||||
</div> <!-- 2nd col-md-12 closed here -->
|
||||
|
||||
</div> <!-- sales_row div closed here -->
|
||||
|
||||
|
||||
<div class="form-group text-right m-b-0" id="submitButton">
|
||||
<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"
|
||||
id="btnSubmit">Submit</button>
|
||||
</div>
|
||||
@ -4089,8 +4117,10 @@
|
||||
// Update header
|
||||
$('#insurerTable thead tr').append(`
|
||||
<th>
|
||||
<span style="display:flex; justify-content:space-between; align-items:center;">
|
||||
Insurer ${insurerCount}
|
||||
${insurerCount > 1 ? `<a data-count="${insurerCount}" class="text-danger mdi mdi-delete delete-insurer" style="margin-left: 135px;"></a>` : ''}
|
||||
</span>
|
||||
</th>
|
||||
`);
|
||||
|
||||
|
||||
@ -146,15 +146,16 @@ table.dataTable tbody td {
|
||||
</style>
|
||||
|
||||
<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 class="card mb-1">
|
||||
<h4 class="m-1">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h4>
|
||||
<h4 class="m-1">
|
||||
<span>Filter</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>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
@ -256,7 +257,11 @@ table.dataTable tbody td {
|
||||
<input type="hidden" id="endDate">
|
||||
</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-primary" id="get-emp-list" onclick="fetchEmpolyeeList(event);">Submit</a>
|
||||
</div>
|
||||
@ -309,21 +314,21 @@ table.dataTable tbody td {
|
||||
<tbody>
|
||||
<?php foreach($inception_data_list as $index => $row){ ?>
|
||||
<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 $issuing_type[$row['issue_type']]; ?></td>
|
||||
<td><?php echo $client_type[$row['client_type']] ?? '-'; ?></td>
|
||||
<td><?php echo $issuing_type[$row['issue_type']] ?: 'N/A'; ?></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['insurer_short_name']; ?></td>
|
||||
<td><?php echo $row['policy_type']; ?></td>
|
||||
<td><?php echo $row['policy_no']; ?></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']) ? '' : 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 class="right-align-input"><?php echo $row['emp_count']; ?></td>
|
||||
<td class="right-align-input"><?php echo $row['dependent_count']; ?></td>
|
||||
<td><?php echo $policy_status[$row['status']]; ?></td>
|
||||
<td><?php echo $row['user_name']; ?></td>
|
||||
<td><?php echo $row['insurer_short_name'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['policy_type'] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['policy_no'] ?: 'N/A'; ?></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']) ? 'N/A' : 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_end_date'])); ?></td>
|
||||
<td class="right-align-input"><?php echo $row['emp_count'] ?: '0'; ?></td>
|
||||
<td class="right-align-input"><?php echo $row['dependent_count'] ?: '0'; ?></td>
|
||||
<td><?php echo $policy_status[$row['status']] ?: 'N/A'; ?></td>
|
||||
<td><?php echo $row['user_name'] ?: 'N/A'; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
@ -556,33 +561,44 @@ $(document).ready(function() {
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-7'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Policy-Tranction-Inception-List',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
dom: "<'row'<'col-sm-1'f><'col-sm-11 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [
|
||||
{
|
||||
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();
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
text: 'Add',
|
||||
className: 'buttons-html5 addbtnStyle',
|
||||
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: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>',
|
||||
className: 'app-btn-primary ',
|
||||
title: 'Policy-Tranction-Inception-List',
|
||||
exportOptions: {
|
||||
columns: ':not(:last-child)'
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
search: `
|
||||
<div class="datatable-search-wrapper">
|
||||
_INPUT_
|
||||
<i class="mdi mdi-magnify datatable-search-icon"></i>
|
||||
</div>`,
|
||||
searchPlaceholder: "Search"
|
||||
},
|
||||
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,
|
||||
});
|
||||
} else {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user