Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
velz 2025-08-02 11:22:14 +05:30
commit 4933b1540c
24 changed files with 1830 additions and 644 deletions

View File

@ -635,6 +635,7 @@ class ClientController extends AdminController
$balances = $this->clientPolicyModel->getBalances($id); $balances = $this->clientPolicyModel->getBalances($id);
$data['balances'] = $balances; $data['balances'] = $balances;
// dd($data);
if($requestFrom == 'rest'){ return $data; } if($requestFrom == 'rest'){ return $data; }
echo view('layout/header', $headerData); echo view('layout/header', $headerData);
@ -752,6 +753,9 @@ class ClientController extends AdminController
$editData['police'] = $this->policesModel->findAll(); $editData['police'] = $this->policesModel->findAll();
$editData['entity'] = $this->kycEntityTypeModel->findAll(); $editData['entity'] = $this->kycEntityTypeModel->findAll();
$editData['insurer'] = $this->insurerBranchModel->getInsurerBranchesWithInsurerNames(); $editData['insurer'] = $this->insurerBranchModel->getInsurerBranchesWithInsurerNames();
$editData['insurers'] = $this->insurerModel->where('is_active', 1)->findAll();
$editData['insurer_branch'] = $this->insurerBranchModel->where('is_active', 1)->findAll();
$editData['clients'] = $this->clientModel->where('is_active', 1)->findAll();
$editData['kyc_docs'] = $this->kycDocsModel->findAll(); $editData['kyc_docs'] = $this->kycDocsModel->findAll();
$editData['policyGridData'] = $this->policyGridModel->findAll(); $editData['policyGridData'] = $this->policyGridModel->findAll();
$editData['policy_types'] = $this->policyTypeModel->findAll(); $editData['policy_types'] = $this->policyTypeModel->findAll();
@ -3551,12 +3555,13 @@ class ClientController extends AdminController
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Additionaly Rack Rate Data Remove Successfully'], 200); return $this->respond(['status' => true, 'code' => 200, 'message' => 'Additionaly Rack Rate Data Remove Successfully'], 200);
} }
public function get_cd_ac($client_id, $insurer_id) public function get_cd_ac($client_id, $insurer_id, $insurer_branch_id)
{ {
$cd_data = $this->CDMasterModel $cd_data = $this->CDMasterModel
->where('client_id', $client_id) ->where('client_id', $client_id)
->where('insurer_id', $insurer_id) ->where('insurer_id', $insurer_id)
->where('insurer_branch_id', $insurer_branch_id)
->where('is_active', 1) ->where('is_active', 1)
->findAll(); ->findAll();
@ -4096,11 +4101,12 @@ class ClientController extends AdminController
public function getCDAccNoByClientAndInsurer($client, $insurer) public function getCDAccNoByClientAndInsurer($client, $insurer, $insurer_branch_id)
{ {
$cdmData = $this->CDMasterModel $cdmData = $this->CDMasterModel
->where('client_id', $client) ->where('client_id', $client)
->where('insurer_id', $insurer) ->where('insurer_id', $insurer)
->where('insurer_branch_id', $insurer_branch_id)
->where('is_active', 1) ->where('is_active', 1)
->findAll(); ->findAll();
@ -6208,6 +6214,14 @@ class ClientController extends AdminController
$pre_client_data = $db2->table('clients')->where('is_active', 1)->where('short_name', $post_client_data['short_name'])->get()->getRowArray(); $pre_client_data = $db2->table('clients')->where('is_active', 1)->where('short_name', $post_client_data['short_name'])->get()->getRowArray();
if(empty($pre_client_data)){
$hrAccessData['pre_hr_data'] = [];
$hrAccessData['pre_policy_data'] = [];
$combinedHrAccessData = $this->constructHrAccessData($hrAccessData, $client_id);
return $combinedHrAccessData;
}
$hrAccessData['pre_hr_data'] = $db2->table('client_branch') $hrAccessData['pre_hr_data'] = $db2->table('client_branch')
->select('lc.id as pre_hr_id, lc.name as hr_name, lc.mobile as hr_mobile, lc.email as hr_mail') ->select('lc.id as pre_hr_id, lc.name as hr_name, lc.mobile as hr_mobile, lc.email as hr_mail')
->join('level_contacts lc', 'client_branch.id = lc.ref_id') ->join('level_contacts lc', 'client_branch.id = lc.ref_id')

View File

@ -394,7 +394,7 @@ class EmployeeServiceController extends AdminController
'is_mandatory' => true, 'is_mandatory' => true,
'data_type' => 'str', 'data_type' => 'str',
'format' => null, 'format' => null,
'allowed_values' => ['name', 'dob', 'relationship'] 'allowed_values' => ['name', 'dob', 'relationship', 'email_corporate']
], ],
'value' => [ 'value' => [
'col_idx' => 4, 'col_idx' => 4,

View File

@ -207,6 +207,8 @@ class LeadsController extends BaseController
private function prepareLeadData() private function prepareLeadData()
{ {
$data = $this->request->getPost(); $data = $this->request->getPost();
$data['client_type'] = 1;
$data['pan'] = "";
if ($data['lead_type'] != 1) { if ($data['lead_type'] != 1) {
$client_data = $this->clientModel->where('id', $data['client_id'])->where('is_active', 1)->first(); $client_data = $this->clientModel->where('id', $data['client_id'])->where('is_active', 1)->first();
@ -1273,8 +1275,8 @@ class LeadsController extends BaseController
'Total Lives' => $rfq_data['incept_no_of_lives'], 'Total Lives' => $rfq_data['incept_no_of_lives'],
'Period of Insurance ' => !empty($rfq_data['policy_start_date']) && !empty($rfq_data['policy_end_date']) ? date('d-m-Y', strtotime($rfq_data['policy_start_date'])) . ' to ' . date('d-m-Y', strtotime($rfq_data['policy_end_date'])) : "To be decided", 'Period of Insurance ' => !empty($rfq_data['policy_start_date']) && !empty($rfq_data['policy_end_date']) ? date('d-m-Y', strtotime($rfq_data['policy_start_date'])) . ' to ' . date('d-m-Y', strtotime($rfq_data['policy_end_date'])) : "To be decided",
'Insurer' => $rfq_data['insurer_name'] ?? " - ", // 'Insurer' => $rfq_data['insurer_name'] ?? " - ",
'TPA' => $rfq_data['tpa_name'] ?? " - ", // 'TPA' => $rfq_data['tpa_name'] ?? " - ",
// 'Policy Run Days' => $rfq_data['policy_run_days'], // 'Policy Run Days' => $rfq_data['policy_run_days'],
]; ];
} else if (in_array($rfq_data['policy_type_id'], [1, 6, 7])) { } else if (in_array($rfq_data['policy_type_id'], [1, 6, 7])) {
@ -1344,6 +1346,7 @@ class LeadsController extends BaseController
$sheetName = 'Worksheet'; $sheetName = 'Worksheet';
if ($type == 2) { if ($type == 2) {
$sheetName = 'QCR'; $sheetName = 'QCR';
// $propsal_and_insurer = "Proposal 1-ICICIPRU-ICICI001";
$data = $this->convertJsonForQCR($data, $type); $data = $this->convertJsonForQCR($data, $type);
if ($propsal_and_insurer !== null) { if ($propsal_and_insurer !== null) {
list($proposal_key, $insurer_key) = explode('-', $propsal_and_insurer, 2); list($proposal_key, $insurer_key) = explode('-', $propsal_and_insurer, 2);
@ -1485,9 +1488,16 @@ class LeadsController extends BaseController
$columnLetter = 'A'; $columnLetter = 'A';
$header_actual_count = 0; $header_actual_count = 0;
$headerIndex = 0;
foreach ($headers as $header) { foreach ($headers as $header) {
// Kint::dump($header); // Kint::dump($header);
if($is_placement == true){
//for placement proposal only
$nxt_ro = $rowNumber + 1;
$sheet->mergeCells("C{$rowNumber}:C{$nxt_ro}");
}
if (in_array($header['parentHeader'], ['Item Key', 'Action'])) { if (in_array($header['parentHeader'], ['Item Key', 'Action'])) {
continue; continue;
} }
@ -1499,10 +1509,18 @@ class LeadsController extends BaseController
if ($header['parentHeader'] === 'Sno') { if ($header['parentHeader'] === 'Sno') {
$header['parentHeader'] = 'S.No.'; $header['parentHeader'] = 'S.No.';
$sheet->getColumnDimension('A')->setWidth(10); $sheet->getColumnDimension('A')->setWidth(10);
//merge the 2 row cells of the S.No.
$nxt_ro = $rowNumber + 1;
$sheet->mergeCells("{$columnLetter}{$rowNumber}:{$columnLetter}{$nxt_ro}");
} }
if ($header['parentHeader'] === 'Particulars') { if ($header['parentHeader'] === 'Particulars') {
$sheet->getColumnDimension('B')->setWidth(35); $sheet->getColumnDimension('B')->setWidth(35);
//merge the 2 row cells of the particulars
$nxt_ro = $rowNumber + 1;
$sheet->mergeCells("{$columnLetter}{$rowNumber}:{$columnLetter}{$nxt_ro}");
} }
$startColumn = $columnLetter; // Start of the current header range $startColumn = $columnLetter; // Start of the current header range
@ -1512,9 +1530,12 @@ class LeadsController extends BaseController
$sheet->setCellValue("{$startColumn}{$rowNumber}", "Terms"); $sheet->setCellValue("{$startColumn}{$rowNumber}", "Terms");
} else { } else {
if(in_array($header['parentHeader'], ["Existing Renewal", "Existing Rollover"])){ if(in_array($header['parentHeader'], ["Existing Renewal", "Existing Rollover"])){
$sheet->setCellValue("{$startColumn}{$rowNumber}", "Terms"); $sheet->setCellValue("{$startColumn}{$rowNumber}", "Existing Terms");
}else{ }else if(in_array($header['parentHeader'], ["Particulars", "S.No."])){
$sheet->setCellValue("{$startColumn}{$rowNumber}", $header['parentHeader']); $sheet->setCellValue("{$startColumn}{$rowNumber}", $header['parentHeader']);
}else{
$headerIndex = $headerIndex + 1;
$sheet->setCellValue("{$startColumn}{$rowNumber}", "Proposal Terms " . $headerIndex);
} }
} }
$sheet->getStyle("{$startColumn}{$rowNumber}")->applyFromArray([ $sheet->getStyle("{$startColumn}{$rowNumber}")->applyFromArray([
@ -1585,9 +1606,9 @@ class LeadsController extends BaseController
$sheet->getRowDimension($subHeaderRow)->setRowHeight(20); // Subheader row height $sheet->getRowDimension($subHeaderRow)->setRowHeight(20); // Subheader row height
if ($is_placement == true) { if ($is_placement == true) {
$rowNumber = $subHeaderRow; $rowNumber = $subHeaderRow + 1;
} else { } else {
$rowNumber = $subHeaderRow + 2; $rowNumber = $subHeaderRow + 1;
} }
// dd($rowNumber); // dd($rowNumber);
@ -1629,6 +1650,7 @@ class LeadsController extends BaseController
//premium data //premium data
if ($type == 2) { if ($type == 2) {
if($is_placement == true){$columnLetterForPremium = "B";}else{$columnLetterForPremium = "C";}
$rowNumber += 2; $rowNumber += 2;
// Add premium data // Add premium data
@ -1636,19 +1658,26 @@ class LeadsController extends BaseController
// $labelArray = ["Premium", "GST (%)", "GST Amount (₹)", "Total"]; // $labelArray = ["Premium", "GST (%)", "GST Amount (₹)", "Total"];
$labelArray = ["Premium", "GST Amount (₹)", "Total"]; $labelArray = ["Premium", "GST Amount (₹)", "Total"];
$premiumData = $data['premium_data']['data']; $premiumData = $data['premium_data']['data'];
// dd($premiumData);
// $premium = [$labelArray[0]]; // $premium = [$labelArray[0]];
// $gst = [$labelArray[1]]; // $gst = [$labelArray[1]];
// $gstAmt = [$labelArray[1]]; // $gstAmt = [$labelArray[1]];
// $total = [$labelArray[2]]; // $total = [$labelArray[2]];
if($is_placement == true){
$premium[] = $labelArray[0];
$gstAmt[] = $labelArray[1];
$total[] = $labelArray[2];
}
foreach ($premiumData as $proposal => $insurers) { foreach ($premiumData as $proposal => $insurers) {
if ($proposal != 'Particulars') { if ($proposal != 'Particulars') {
foreach ($insurers as $insurer => $values) { foreach ($insurers as $insurer => $values) {
if($insurer == 'Quote Asked'){ if($insurer == 'Quote Asked'){
$premium[] = $labelArray[0]; $premium[] = count($insurers ?? []) > 1 ? $labelArray[0] : "";
// $gst[] = ""; // $gst[] = "";
$gstAmt[] = $labelArray[1]; $gstAmt[] = count($insurers ?? []) > 1 ? $labelArray[1] : "";
$total[] = $labelArray[2]; $total[] = count($insurers ?? []) > 1 ? $labelArray[2] : "";
}else{ }else{
$premium[] = formatIndianCurrency($values[$labelArray[0]]); $premium[] = formatIndianCurrency($values[$labelArray[0]]);
// $gst[] = $values[$labelArray[1]]; // $gst[] = $values[$labelArray[1]];
@ -1659,8 +1688,10 @@ class LeadsController extends BaseController
} }
} }
// dd([$premium, $gstAmt, $total]); die;
foreach ([$premium, $gstAmt, $total] as $index => $rowData) { foreach ([$premium, $gstAmt, $total] as $index => $rowData) {
$columnLetter = 'C'; $columnLetter = $columnLetterForPremium;
foreach ($rowData as $key => $value) { foreach ($rowData as $key => $value) {
$sheet->setCellValue("{$columnLetter}{$rowNumber}", $value); $sheet->setCellValue("{$columnLetter}{$rowNumber}", $value);
if (in_array($value, $labelArray)) { if (in_array($value, $labelArray)) {
@ -1677,8 +1708,8 @@ class LeadsController extends BaseController
$prevColumn3 = $this->getPreviousColumn($columnLetter, 2); $prevColumn3 = $this->getPreviousColumn($columnLetter, 2);
} }
$premiumRange = "C" . ($rowNumber - 3) . ":" . "{$prevColumn3}" . ($rowNumber - 1); $premiumRange = $columnLetterForPremium . ($rowNumber - 3) . ":" . "{$prevColumn3}" . ($rowNumber - 1);
// dd($premiumRange); // dd($prevColumn3, $premiumRange, $this->getPreviousColumn($columnLetter, 2), $columnLetter, $rowNumber);
$sheet->getStyle($premiumRange)->applyFromArray([ $sheet->getStyle($premiumRange)->applyFromArray([
'borders' => [ 'borders' => [

View File

@ -1225,18 +1225,121 @@ class MasterController extends AdminController
$data['page_name'] = 'CD Master List'; $data['page_name'] = 'CD Master List';
$data['CD_Master_Data'] = $this->CDMasterModel->getCDMasterList(); $data['CD_Master_Data'] = $this->CDMasterModel->getCDMasterList();
$data['insurers'] = $this->insurerModel->where('is_active', 1)->findAll(); $data['insurers'] = $this->insurerModel->where('is_active', 1)->findAll();
$data['insurer_branch'] = $this->insurerBranchModel->where('is_active', 1)->findAll();
$data['clients'] = $this->clientModel->where('is_active', 1)->findAll(); $data['clients'] = $this->clientModel->where('is_active', 1)->findAll();
$this->loadLayout('cd_master_list', $data); $this->loadLayout('cd_master_list', $data);
} }
// public function createCDMasterData()
// {
// $data = $this->request->getPost();
// $id = $data['PrimaryKey'];
// $date = (string) $this->request->getPost('opening_date');
// $data['opening_date'] = date('Y-m-d', strtotime($date));
// // print_rr($data);die();
// $loggedInUserID = get_session_userid();
// if (empty($id)) {
// if ($data) {
// $insert = $this->CDMasterModel->insert($data);
// if ($insert) {
// // Prepare the array with data
// $cd_tranction_data = [
// 'amount' => $data['opening_bal'],
// 'sub_type_id' => 7,
// 'client_id' => $data['client_id'],
// 'client_policy_id' => null,
// 'cd_ac_no' => $data['cd_ac_no'],
// 'endorsement_no' => null,
// 'insurer_id' => $data['insurer_id'],
// 'description' => 'opening Amount',
// 'transaction_type' => 'Credit',
// 'event_name' => null,
// 'updated_by' => 1,
// ];
// $cd_tranction_data['cd_ac_pk'] = $this->CDMasterModel->insertID();
// $response = DepositHelper::saveDeposit($cd_tranction_data, $loggedInUserID);
// session()->setFlashdata('success', "Cash Deposite Master Added Successfully");
// return redirect()->to(base_url('/master/cash_deposite/list'));
// } else {
// session()->setFlashdata('error', "Cash Deposite Master Added Failed");
// return redirect()->to(base_url('/master/cash_deposite/list'));
// }
// } else {
// session()->setFlashdata('error', "Cash Deposite Master Added Failed. Data Not Found");
// return redirect()->to(base_url('/master/cash_deposite/list'));
// }
// } else {
// if ($data) {
// $insert = $this->CDMasterModel->where('id', $id)->set($data)->update();
// $data = $this->CDMasterModel->where('id', $id)->first();
// $cd_transaction_updated_data = [
// 'balance' => $data['opening_bal'],
// 'amount' => $data['opening_bal']
// ];
// $cd_tranction = $this->clientDepositModel
// ->where('client_id', $data['client_id'])
// ->where('insurer_id', $data['insurer_id'])
// ->where('cd_ac_no', $data['cd_ac_no'])
// ->where('sub_type', 7)
// ->set($cd_transaction_updated_data)->update();
// if ($insert) {
// session()->setFlashdata('success', "Cash Deposite Master Updated Successfully");
// return redirect()->to(base_url('/master/cash_deposite/list'));
// } else {
// session()->setFlashdata('error', "Cash Deposite Master Update Failed");
// return redirect()->to(base_url('/master/cash_deposite/list'));
// }
// } else {
// session()->setFlashdata('error', "Cash Deposite Master Update Failed. Data Not Found");
// return redirect()->to(base_url('/master/cash_deposite/list'));
// }
// }
// }
public function createCDMasterData() public function createCDMasterData()
{ {
$this->myLogger->logme("error", 'Create CD Master Data API called.');
$data = $this->request->getPost(); $data = $this->request->getPost();
$date = (string) $this->request->getPost('opening_date'); $this->myLogger->logme("error", 'Received POST data: ' . json_encode($data));
$id = $data['PrimaryKey'] ?? null;
$date = (string) ($data['opening_date'] ?? '');
$data['opening_date'] = date('Y-m-d', strtotime($date)); $data['opening_date'] = date('Y-m-d', strtotime($date));
// print_rr($data);die(); $this->myLogger->logme("error", 'Formatted opening_date: ' . $data['opening_date']);
// Prepare the array with data
$loggedInUserID = get_session_userid();
$this->myLogger->logme("error", 'Logged in user ID: ' . $loggedInUserID);
// === INSERT ===
if (empty($id)) {
$this->myLogger->logme("error", 'Performing INSERT operation.');
$insert = $this->CDMasterModel->insert($data);
$this->myLogger->logme("error", 'Insert result: ' . json_encode($insert));
if ($insert) {
$cd_tranction_data = [ $cd_tranction_data = [
'amount' => $data['opening_bal'], 'amount' => $data['opening_bal'],
'sub_type_id' => 7, 'sub_type_id' => 7,
@ -1245,33 +1348,81 @@ class MasterController extends AdminController
'cd_ac_no' => $data['cd_ac_no'], 'cd_ac_no' => $data['cd_ac_no'],
'endorsement_no' => null, 'endorsement_no' => null,
'insurer_id' => $data['insurer_id'], 'insurer_id' => $data['insurer_id'],
'description' => 'opening Amount', 'description' => 'Opening Amount',
'transaction_type' => 'Credit', 'transaction_type' => 'Credit',
'event_name' => null, 'event_name' => null,
'updated_by' => 1, 'updated_by' => 1,
'cd_ac_pk' => $insert,
]; ];
$loggedInUserID = get_session_userid(); $this->myLogger->logme("error", 'Saving initial deposit with data: ' . json_encode($cd_tranction_data));
if ($data) {
$insert = $this->CDMasterModel->insert($data);
if ($insert) {
$cd_tranction_data['cd_ac_pk'] = $this->CDMasterModel->insertID();
$response = DepositHelper::saveDeposit($cd_tranction_data, $loggedInUserID); $response = DepositHelper::saveDeposit($cd_tranction_data, $loggedInUserID);
$this->myLogger->logme("error", 'Deposit save response: ' . json_encode($response));
$cd_master_data = $this->CDMasterModel->where('is_active', 1)->where('id', $insert)->first();
$this->myLogger->logme("error", 'Inserted CD Master data: ' . json_encode($cd_master_data));
$cd_master_full_data = $this->CDMasterModel->where('is_active', 1)
->where('client_id', $data['client_id'])
->where('insurer_id', $data['insurer_id'])
->where('insurer_branch_id', $data['insurer_branch_id'])
->findAll();
return $this->respond([
'status' => true,
'code' => 500,
'message' => "CD Master Added Successfully",
'cd_master_data' => $cd_master_data,
'data' => $cd_master_full_data
]);
session()->setFlashdata('success', "Cash Deposite Master Added Successfully");
return redirect()->to(base_url('/master/cash_deposite/list'));
} else { } else {
session()->setFlashdata('error', "Cash Deposite Master Added Failed"); $this->myLogger->logme('error', 'CD Master Insert Failed.');
return redirect()->to(base_url('/master/cash_deposite/list')); return $this->respond([
'status' => true,
'code' => 500,
'message' => "CD Master Add Failed",
], 200);
}
} }
} else {
session()->setFlashdata('error', "Cash Deposite Master Added Failed. Data Not Found"); // === UPDATE ===
return redirect()->to(base_url('/master/cash_deposite/list')); $this->myLogger->logme("error", 'Performing UPDATE operation for ID: ' . $id);
$updated = $this->CDMasterModel->where('id', $id)->set($data)->update();
$this->myLogger->logme("error", 'Update result: ' . json_encode($updated));
$existingData = $this->CDMasterModel->where('is_active', 1)->where('id', $id)->first();
$this->myLogger->logme("error", 'Existing data after update: ' . json_encode($existingData));
$cd_transaction_updated_data = [
'balance' => $existingData['opening_bal'],
'amount' => $existingData['opening_bal']
];
$updateDeposit =$this->clientDepositModel
->where('client_id', $existingData['client_id'])
->where('insurer_id', $existingData['insurer_id'])
->where('cd_ac_no', $existingData['cd_ac_no'])
->where('sub_type', 7)
->set($cd_transaction_updated_data)
->update();
$this->myLogger->logme("error", 'Client Deposit Update result: ' . json_encode($updateDeposit));
if ($updated) {
$this->myLogger->logme("error", 'CD Master Updated Successfully.');
return $this->respond([
'status' => true,
'message' => "CD Master Updated Successfully"
]);
} else {
$this->myLogger->logme('error', 'CD Master Update Failed.');
return $this->respond([
'status' => true,
'code' => 500,
'message' => "CD Master Updated Failed",
], 200);
} }
} }
@ -1598,7 +1749,6 @@ class MasterController extends AdminController
} }
} }
public function generateNewGmailAPIToken() public function generateNewGmailAPIToken()
{ {
$gmailapi = \Config\Services::gmailapi(); $gmailapi = \Config\Services::gmailapi();
@ -1636,14 +1786,11 @@ class MasterController extends AdminController
$res = MailHelper::send_email(['mail' => $to, 'subject' => $subject, 'common' => $common, 'message' => $mail_content]); $res = MailHelper::send_email(['mail' => $to, 'subject' => $subject, 'common' => $common, 'message' => $mail_content]);
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $res], 200); return $this->respond(['status' => 'success', 'code' => 200, 'data' => $res], 200);
/*****CALLING VIA MAIL HELPER******/ /*****CALLING VIA MAIL HELPER******/
} }
$this->loadLayout('mail_test'); $this->loadLayout('mail_test');
} }
//testing a sample mail from cli //testing a sample mail from cli
public function testGmailAPIViaCLI(string $email_id = 'velmurugan.s@venbainfotech.com') public function testGmailAPIViaCLI(string $email_id = 'velmurugan.s@venbainfotech.com')
{ {
@ -1670,10 +1817,10 @@ class MasterController extends AdminController
$res = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Mail Via CLI', 'message' => $message, 'attachments' => $attachments, 'common' => $common]); $res = MailHelper::send_email(['mail' => $email_id, 'subject' => 'Mail Via CLI', 'message' => $message, 'attachments' => $attachments, 'common' => $common]);
echo "Inside the master controller"; echo "Inside the master controller";
print_r($res); print_r($res);
} }
public function testZeptoSMTP() { public function testZeptoSMTP()
{
$message = '<style>body{font-family:Arial,sans-serif;color:#333;line-height:1.6;margin:0;padding:0}.email-container{width:100%;max-width:600px;margin:0 auto;padding:20px;border:1px solid #e0e0e0;background-color:#f9f9f9}.header{background-color:#4a90e2;color:#fff;padding:15px;text-align:center}.header h1{margin:0;font-size:24px}.content{padding:20px;background-color:#fff}.content h2{color:#4a90e2;font-size:20px;margin-top:0}.content p{margin:10px 0}.details-table{width:100%;border-collapse:collapse;margin-top:20px}.details-table td,.details-table th{border:1px solid #ddd;padding:10px;text-align:left}.details-table th{background-color:#f2f2f2}.footer{margin-top:20px;font-size:12px;color:#777;text-align:center}.attachment-note{margin-top:20px;padding:10px;background-color:#f7f7f7;border-left:4px solid #4a90e2;font-style:italic}</style><div class=email-container><div class=header><h1>Request for Quotation (RFQ)</h1></div><div class=content><h2>Dear {{RECIPIENT_NAME}},</h2><p>We are reaching out to request a quotation for the following insurance coverage. Please review the details below and provide your quote at your earliest convenience.<h2>RFQ Details</h2><table class=details-table><tr><th>Client name<td>{{CLIENT_NAME}}<tr><th>Coverage Type<td>{{POLICY_LONG_NAME}}<tr><th>Policy Start Date<td>{{POLICY_START_DATE}}<tr><th>Policy Duration<td>{{DURATION}}</table><div class=attachment-note>Please note: Additional terms and details are included in the attachment for your reference.</div><p>Please feel free to reach out if you require any further information to prepare the quote. We look forward to receiving your proposal.<p>Best regards,<p><strong>Nhance India Pvt Ltd</strong><br></div><div class=footer><p>© Nhance India Pvt Ltd. All rights reserved.</div></div>'; $message = '<style>body{font-family:Arial,sans-serif;color:#333;line-height:1.6;margin:0;padding:0}.email-container{width:100%;max-width:600px;margin:0 auto;padding:20px;border:1px solid #e0e0e0;background-color:#f9f9f9}.header{background-color:#4a90e2;color:#fff;padding:15px;text-align:center}.header h1{margin:0;font-size:24px}.content{padding:20px;background-color:#fff}.content h2{color:#4a90e2;font-size:20px;margin-top:0}.content p{margin:10px 0}.details-table{width:100%;border-collapse:collapse;margin-top:20px}.details-table td,.details-table th{border:1px solid #ddd;padding:10px;text-align:left}.details-table th{background-color:#f2f2f2}.footer{margin-top:20px;font-size:12px;color:#777;text-align:center}.attachment-note{margin-top:20px;padding:10px;background-color:#f7f7f7;border-left:4px solid #4a90e2;font-style:italic}</style><div class=email-container><div class=header><h1>Request for Quotation (RFQ)</h1></div><div class=content><h2>Dear {{RECIPIENT_NAME}},</h2><p>We are reaching out to request a quotation for the following insurance coverage. Please review the details below and provide your quote at your earliest convenience.<h2>RFQ Details</h2><table class=details-table><tr><th>Client name<td>{{CLIENT_NAME}}<tr><th>Coverage Type<td>{{POLICY_LONG_NAME}}<tr><th>Policy Start Date<td>{{POLICY_START_DATE}}<tr><th>Policy Duration<td>{{DURATION}}</table><div class=attachment-note>Please note: Additional terms and details are included in the attachment for your reference.</div><p>Please feel free to reach out if you require any further information to prepare the quote. We look forward to receiving your proposal.<p>Best regards,<p><strong>Nhance India Pvt Ltd</strong><br></div><div class=footer><p>© Nhance India Pvt Ltd. All rights reserved.</div></div>';
$attachments = [ $attachments = [
["filePath" => ROOTPATH . "public/sample_excel/sample_addition.xls", "fileName" => "sample_addition.xls"], ["filePath" => ROOTPATH . "public/sample_excel/sample_addition.xls", "fileName" => "sample_addition.xls"],
@ -1703,6 +1850,7 @@ class MasterController extends AdminController
// Return JSON response // Return JSON response
return $this->response->setJSON($result); return $this->response->setJSON($result);
} }
public function testCheckBounceMails() public function testCheckBounceMails()
{ {
$gmailapi = \Config\Services::gmailapi(); $gmailapi = \Config\Services::gmailapi();
@ -1721,7 +1869,6 @@ class MasterController extends AdminController
$this->checkGoogleOAuthCredentialsinDB(); $this->checkGoogleOAuthCredentialsinDB();
$this->getCronJobsList(); $this->getCronJobsList();
$this->checkGdriveRootFolderID(); $this->checkGdriveRootFolderID();
} }
public function checkAndCreateDirectories() public function checkAndCreateDirectories()
@ -1782,15 +1929,12 @@ class MasterController extends AdminController
echo "1. Update Gmail Oauth credentials in 'gmail_api_oauth_credentials' field in 'settings' table in JSON format.\n"; echo "1. Update Gmail Oauth credentials in 'gmail_api_oauth_credentials' field in 'settings' table in JSON format.\n";
echo "2. Call this cli route to generate new access token: 'php public/index.php cli/new_gmail_token' from root of the project.\n"; echo "2. Call this cli route to generate new access token: 'php public/index.php cli/new_gmail_token' from root of the project.\n";
echo "3. Call this cli route : 'php public/index.php cli/send_mail_cli --to someone@gmail.com' to send test mail to testGmailAPIViaCLI ( replace someone@gmail.com with real time mail).\n"; echo "3. Call this cli route : 'php public/index.php cli/send_mail_cli --to someone@gmail.com' to send test mail to testGmailAPIViaCLI ( replace someone@gmail.com with real time mail).\n";
} } else {
else
{
echo "Gmail OAuth for sending email is set in DB\n"; echo "Gmail OAuth for sending email is set in DB\n";
} }
echo "################################################################\n\n"; echo "################################################################\n\n";
} }
function getCronJobsList() function getCronJobsList()
{ {
// Execute the shell command to get cron jobs // Execute the shell command to get cron jobs
@ -1818,12 +1962,9 @@ class MasterController extends AdminController
{ {
echo "#################### CHECKING GDRIVE FOLDER ID IN ENV FILE ############################\n"; echo "#################### CHECKING GDRIVE FOLDER ID IN ENV FILE ############################\n";
$id = getenv('GDRIVE_ROOT_FOLDER_ID'); $id = getenv('GDRIVE_ROOT_FOLDER_ID');
if($id) if ($id) {
{
echo $this->cli_colors['green'] . "ID is :" . $id . $this->cli_colors['reset'] . "\n"; echo $this->cli_colors['green'] . "ID is :" . $id . $this->cli_colors['reset'] . "\n";
} } else {
else
{
echo $this->cli_colors['red'] . "Gdrive Folder id not set in env file. set it under 'GDRIVE_ROOT_FOLDER_ID' in env file." . $this->cli_colors['reset'] . "\n"; echo $this->cli_colors['red'] . "Gdrive Folder id not set in env file. set it under 'GDRIVE_ROOT_FOLDER_ID' in env file." . $this->cli_colors['reset'] . "\n";
} }
echo "################################################################\n\n"; echo "################################################################\n\n";

View File

@ -484,7 +484,7 @@ class RestAuthenticationController extends AdminController
$this->authHistoryModel->insert($data); $this->authHistoryModel->insert($data);
} }
$employeeData['token_type'] = "post";
$result = JWTToken::encode($employeeData); $result = JWTToken::encode($employeeData);
if(isset($this->request->getJSON()->otp)){ if(isset($this->request->getJSON()->otp)){
@ -1081,6 +1081,7 @@ class RestAuthenticationController extends AdminController
]); ]);
} }
$employeeData['token_type'] = "post";
$token = JWTToken::encode($employeeData); $token = JWTToken::encode($employeeData);
log_message('error', ' '); log_message('error', ' ');

View File

@ -41,6 +41,8 @@ class TicketController extends BaseController
public $placeHolders; public $placeHolders;
public $extraFields; public $extraFields;
public $nonIDReason; public $nonIDReason;
public $removeArrayKey;
protected $clientModel; protected $clientModel;
protected $ticketMasterModel; protected $ticketMasterModel;
@ -278,7 +280,6 @@ class TicketController extends BaseController
58 => ['cancel_remark' => 'Cancel Remark'] 58 => ['cancel_remark' => 'Cancel Remark']
]; ];
$this->nonIDReason = [ $this->nonIDReason = [
"Newborn Baby" => "Newborn Baby", "Newborn Baby" => "Newborn Baby",
"Newly Wedded Spouse" => "Newly Wedded Spouse", "Newly Wedded Spouse" => "Newly Wedded Spouse",
@ -287,6 +288,46 @@ class TicketController extends BaseController
"Exceptional Case" => "Exceptional Case" "Exceptional Case" => "Exceptional Case"
]; ];
$this->removeArrayKey = [
2 => [],
6 => [],
12 => [],
15 => [],
16 => [],
17 => [],
18 => [],
19 => [],
21 => [],
22 => [],
23 => [],
25 => [],
26 => [],
27 => [],
28 => [],
29 => [],
31 => [],
32 => [],
33 => [],
35 => [],
36 => [],
37 => [],
38 => [],
39 => [],
41 => [],
42 => [],
43 => [],
45 => [],
46 => [],
49 => [],
50 => [],
51 => [],
52 => [],
55 => [],
56 => [],
57 => [],
60 => []
];
$this->ticketMasterModel = new TicketMasterModel(); $this->ticketMasterModel = new TicketMasterModel();
$this->claimStatus = new TicketClaimStatusModel(); $this->claimStatus = new TicketClaimStatusModel();
$this->clientModel = new ClientModel(); $this->clientModel = new ClientModel();
@ -1705,9 +1746,22 @@ class TicketController extends BaseController
$lastMatchedStatus = $incoming_form_values['claim_status_id']; $lastMatchedStatus = $incoming_form_values['claim_status_id'];
// Use the provided `extra_fields_array_for_validate` from the incoming data // Use the provided `extra_fields_array_for_validate` from the incoming data
$statusMapping = json_decode($incoming_form_values['extra_fields_array_for_validate']); $statusMapping = json_decode($incoming_form_values['extra_fields_array_for_validate'], true);
// print_r($statusMapping);
// echo "-------------------------------";
//for remove the non used arrays
foreach ($statusMapping as $key1 => $value1) {
foreach ($this->removeArrayKey as $key2 => $value2) {
if($key1 === $key2){
unset($statusMapping[$key1]);
}
}
}
// print_r($statusMapping); die;
// if($incoming_form_values['claim_status_id'] != $old_ticket_data['claim_status_id']){
if($incoming_form_values['claim_status_id'] != $old_ticket_data['claim_status_id']){
foreach ($statusMapping as $status => $requiredFields) { foreach ($statusMapping as $status => $requiredFields) {
if(!empty($requiredFields) && $status != $old_ticket_data['claim_status_id']){ if(!empty($requiredFields) && $status != $old_ticket_data['claim_status_id']){
@ -1742,7 +1796,8 @@ class TicketController extends BaseController
$lastMatchedStatus = 2; $lastMatchedStatus = 2;
} }
} }
}
// }
return $lastMatchedStatus; return $lastMatchedStatus;
} }

View File

@ -17,6 +17,7 @@ class CDMasterModel extends Model
'id', 'id',
'client_id', 'client_id',
'insurer_id', 'insurer_id',
'insurer_branch_id',
'cd_ac_no', 'cd_ac_no',
'opening_bal', 'opening_bal',
'opening_date', 'opening_date',
@ -66,9 +67,10 @@ class CDMasterModel extends Model
$query = $this->db->table('cd_master') $query = $this->db->table('cd_master')
->select('cd_master.*, clients.client_name, clients.short_name, insurers.name AS insurer_name, user_profiles.first_name AS user_name, IFNULL(cd_ac_counts.cd_ac_no_count, 0) AS cd_ac_no_count, IFNULL(cd_ac_counts_for_cdt.cd_ac_no_count_cd_tranction, 0) AS cd_ac_no_count_cd_tranction') ->select('cd_master.*, clients.client_name, clients.short_name, insurers.name AS insurer_name, user_profiles.first_name AS user_name, IFNULL(cd_ac_counts.cd_ac_no_count, 0) AS cd_ac_no_count, IFNULL(cd_ac_counts_for_cdt.cd_ac_no_count_cd_tranction, 0) AS cd_ac_no_count_cd_tranction, insurer_branch.branch_name as insurer_branch_name')
->join('clients', 'clients.id = cd_master.client_id') ->join('clients', 'clients.id = cd_master.client_id')
->join('insurers', 'insurers.id = cd_master.insurer_id') ->join('insurers', 'insurers.id = cd_master.insurer_id')
->join('insurer_branch', 'cd_master.insurer_branch_id = insurer_branch.id', "left")
->join('user_profiles', 'user_profiles.id = cd_master.created_by') ->join('user_profiles', 'user_profiles.id = cd_master.created_by')
->join( ->join(
'(SELECT cd_master.cd_ac_no, cd_master.id, COUNT(client_policy.cd_ac_no) AS cd_ac_no_count '(SELECT cd_master.cd_ac_no, cd_master.id, COUNT(client_policy.cd_ac_no) AS cd_ac_no_count
@ -102,6 +104,7 @@ class CDMasterModel extends Model
->where('clients.is_active', 1) ->where('clients.is_active', 1)
->where('insurers.is_active', 1) ->where('insurers.is_active', 1)
->where('user_profiles.is_active', 1) ->where('user_profiles.is_active', 1)
->orderBy('cd_master.id', "desc")
->get(); ->get();
$result = $query->getResultArray(); $result = $query->getResultArray();

View File

@ -174,10 +174,11 @@ class ClientPolicyModel extends Model
$builder = $this->db->table('client_policy') $builder = $this->db->table('client_policy')
->select('client_policy.*, cd_master.cd_ac_no as cd_master_account_no') ->select('client_policy.*, cd_master.cd_ac_no as cd_master_account_no')
->select('insurers.name as insurer_name, insurers.short_name as insurer_short') ->select('insurers.name as insurer_name, insurers.short_name as insurer_short, insurer_branch.branch_name as insurer_branch_name')
->select('clients.client_name as client_name') ->select('clients.client_name as client_name')
->join('clients', 'clients.id = client_policy.client_id') ->join('clients', 'clients.id = client_policy.client_id')
->join('insurers', 'insurers.id = client_policy.insurer_id') ->join('insurers', 'insurers.id = client_policy.insurer_id')
->join('insurer_branch', 'client_policy.insurer_branch_id = insurer_branch.id', 'left')
->join('cd_master', 'cd_master.insurer_id = insurers.id AND cd_master.client_id = client_policy.client_id') ->join('cd_master', 'cd_master.insurer_id = insurers.id AND cd_master.client_id = client_policy.client_id')
->where('client_policy.client_id', $id) ->where('client_policy.client_id', $id)
->where('cd_master.id = client_policy.cd_ac_pk') ->where('cd_master.id = client_policy.cd_ac_pk')
@ -190,7 +191,9 @@ class ClientPolicyModel extends Model
$builder->whereIn('client_policy.id', $policyId); $builder->whereIn('client_policy.id', $policyId);
} }
return $builder->get()->getResult(); $data = $builder->get()->getResult();
// dd($this->db->getLastQuery());
return $data;

View File

@ -0,0 +1,306 @@
<!-- modal content -->
<div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog" <?= !isset($CD_Master_Data) ? 'style="max-width: 35% !important;"' : '' ?>>
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="title">Add Opening Amount</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="resetCdMasterFormModal()">×</button>
</div>
<div class="modal-body p-4">
<div class="">
<form role="form" class="parsley-examples" id="CDMasterForm" enctype="multipart/form-data">
<input type="hidden" name="PrimaryKey" id="CD_Master_ID" />
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-12">
<label for="emp_code">Client<span class="text-danger">*</span></label>
<select class="form-control <?= !isset($CD_Master_Data) ? 'readonly-select' : '' ?>" id="cd_client_id" name="client_id" required>
<option value="" >Select Client</option>
<?php foreach($clients as $value) {
if(isset($client['id']) && $value['id'] == $client['id']){
$client_select = "selected";
}else{
$client_select = "";
}
?>
<option value="<?= $value['id'] ?>" <?= $client_select ?>><?= $value['client_name'] ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="profile">Insurer<span class="text-danger">*</span></label>
<select class="form-control <?= !isset($CD_Master_Data) ? 'readonly-select' : '' ?>" id="insurer_id_for_cd" name="insurer_id" <?= isset($CD_Master_Data) ? 'onchange="filterInsurerBranch(this)"' : '' ?> required>
<option value="">Select Insurer</option>
<?php foreach($insurers as $value) { ?>
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="insurer_branch_id">Insurer Branch<span class="text-danger">*</span></label>
<select class="form-control <?= !isset($CD_Master_Data) ? 'readonly-select' : '' ?>" id="insurer_branch_id" name="insurer_branch_id" required>
<option value="">Select Insurer Branch</option>
<?php if(isset($insurer_branch) && !empty($insurer_branch))
{ foreach($insurer_branch as $branch) { ?>
<option data-insurer="<?= $branch['insurer_id'] ?>" value="<?= $branch['id'] ?>"><?= $branch['branch_name'] ?></option>
<?php } } ?>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="email">Opening Date<span class="text-danger">*</span></label>
<input type="text" class="form-control" name="opening_date" id="opening_date" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="mobile">CD Account Number<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="cd_ac_no_for_cd_master" name="cd_ac_no" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="mobile">Opening Amount<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="opening_bal" name="opening_bal" onkeypress="return onlyNumbers(event)" required>
</div>
</div>
</div>
<div id="cdButtonWrapper" class="form-group text-right m-b-0">
<button class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
<!-- <button type="button" class="btn btn-secondry waves-effect waves-light mr-1" data-dismiss="modal" aria-hidden="true">Close</button> -->
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- /.modal -->
<script>
//checking and setting this is CD master page or not
var isCdMasterPage = <?php echo isset($CD_Master_Data) ? 'true' : 'false'; ?>;
console.log("isCdMasterPage", isCdMasterPage);
$(document).ready(function(){
var openingDatePicker = flatpickr("#opening_date", {
dateFormat: "d-m-Y",
allowInput: false
});
if(isCdMasterPage == true){
$('#cd_client_id').select2();
$('#insurer_id_for_cd').select2();
$('#insurer_branch_id').select2();
}
})
$('#cd_ac_no_for_cd_master').keyup(function(){
console.log('key chnage detected');
var cd_ac_no = $(this).val();
console.log(cd_ac_no +'-'+cd_ac_no.length);
cd_ac_no = cd_ac_no.trim();
console.log(cd_ac_no +'-'+cd_ac_no.length);
$.ajax({
url: '<?php echo base_url('util/check_cd_ac_no/');?>'+cd_ac_no,
type: "GET",
dataType: 'json',
success: function (res) {
console.log(res)
if(res.status == true){
toastr.warning(res.message, 'warning');
// $('#cd_ac_no').val('');
$('#btnSubmit').prop('disabled',true);
return;
}
$('#btnSubmit').prop('disabled',false);
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
}
});
})
$('#CDMasterForm').submit(function(event) {
event.preventDefault();
console.log("submit CD Master Form Data function called");
var isValid = $('#CDMasterForm').parsley().validate();
if (!isValid) {
$('#CDMasterForm').find('input, select, textarea').each(function() {
if ($(this).parsley().isValid() === false && !$(this).val()) {
console.log('Empty field ID:', this.id);
}
});
console.log('Form is Empty', 'Warning');
return;
}
let formData = new FormData($('#CDMasterForm')[0]);
console.log("formData", formData);
let url = '<?= base_url('master/cash_deposite/create') ?>';
console.log("url", url);
$.ajax({
data: formData,
url: url,
type: "POST",
dataType: 'json',
processData: false,
contentType: false,
success: function(res) {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
console.log('CD Mater Form Submit Responce', res);
if (res.status == true) {
toastr.success(res.message, 'Success');
if(isCdMasterPage == false){
appendCDACNO(res.data, res.cd_master_data.id);
// appendCdAccNo(res.cd_master_data);
}
} else {
toastr.warning(res.message, 'WARNING');
}
//this function for reset the form values after submitting the form or closing the form
resetCdMasterFormModal()
$('.close').click();
//if this page is CD mater form page than the page reload other wise not to reload
if(isCdMasterPage == true){
window.location.href = '<?= base_url('master/cash_deposite/list') ?>';
}
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
toastr.error('An error occurred while adding the CD account number.', 'ERROR');
}
});
});
function onlyNumbers(event) {
var charcode;
charcode = event.which || event.keyCode;
if (charcode >= 48 && charcode <= 57 || charcode == 46) return true;
return false;
}
function resetCdMasterFormModal(){
console.log("resetCdMasterFormModal() function called");
$('#CD_Master_ID').val('');
$('#opening_date').val('');
$('#cd_ac_no_for_cd_master').val('');
$('#opening_bal').val('');
$('#CDMasterForm').parsley().reset();
$('#cd_ac_no_for_cd_master').prop("disabled", false);
$('#opening_bal').prop("disabled", false);
if(isCdMasterPage == true){
$('#client_id').val('').change();
$('#insurer_id_for_cd').val('').change();
$('#insurer_branch_id').val('').change();
$('#client_id').prop("disabled", false);
$('#insurer_id_for_cd').prop("disabled", false);
$('#insurer_branch_id').prop("disabled", false);
$('#CDMasterForm')[0].reset();
}
}
function filterInsurerBranch(input) {
console.log("filterInsurerBranch function called");
let insurer_id = $(input).val();
console.log("insurer_id", insurer_id);
let branch_data = <?= isset($insurer_branch) && !empty($insurer_branch) ? json_encode($insurer_branch) : '[]' ?>;
console.log("branch_data", branch_data);
let filteredBranches = branch_data.filter(branch => branch.insurer_id == insurer_id);
console.log("filteredBranches", filteredBranches);
let $branchSelect = $('#insurer_branch_id');
$branchSelect.empty().append('<option value="">Select Insurer Branch</option>');
filteredBranches.forEach(branch => {
$branchSelect.append(
$('<option>', {
value: branch.id,
text: branch.branch_name
})
);
});
$branchSelect.val('').trigger('change.select2');
}
function showCdMasterAddModal(){
if(isCdMasterPage == true){
$('#client_id').val('');
$('#insurer_id_for_cd').val('');
$('#insurer_branch_id').val('');
}
$('#opening_date').val('');
$('#cd_ac_no_for_cd_master').val('');
$('#opening_bal').val('');
// $('#CDMasterForm').attr('action', '<?php echo base_url('master/cash_deposite/create');?>');
$('#title').html('Add Opening Amount');
$('#btnSubmit').html('Submit');
var myModal = new bootstrap.Modal(document.getElementById('con-close-modal'));
myModal.show();
}
function appendCdAccNo(data) {
console.log("appendCdAccNo function called :", data);
const option = $('<option>', {
value: data.id,
text: data.cd_ac_no,
selected: true // directly set selected in the object
});
console.log("option", option);
$('#cd_ac_no_for_cd_master').append(option);
}
</script>

View File

@ -16,6 +16,7 @@ table.dataTable thead th {
max-width: 98% !important; max-width: 98% !important;
} }
.custom-dropdown-menu { .custom-dropdown-menu {
display: none; display: none;
position: absolute; position: absolute;
@ -42,6 +43,15 @@ table.dataTable thead th {
color: #16181b !important; color: #16181b !important;
cursor: pointer !important; cursor: pointer !important;
} }
.addbtnStyle{
margin-left: 20px !important;
}
.dataTables_filter {
position: absolute;
}
</style> </style>
<div class="row" id="client_list"> <div class="row" id="client_list">
@ -53,17 +63,18 @@ table.dataTable thead th {
<h4 style="position: relative;">CD Master List</h4> <h4 style="position: relative;">CD Master List</h4>
</div> </div>
<div class="col-6" style="text-align: right; position: relative;top: 56px;"> <div class="col-6" style="text-align: right; position: relative;top: 56px;">
<button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" <!-- <button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light"
data-toggle="modal" data-target="#con-close-modal" data-placement="top" title="Add" data-toggle="modal" data-target="#con-close-modal" data-placement="top" title="Add"
data-trigger="hover">ADD</button> data-trigger="hover">ADD</button> -->
</div> </div>
</div> </div>
<table class="table table-sm table-hover m-0 table-centered dt-responsive w-100" cellspacing="0" <table id="scroll-horizontal-datatable" class="table w-100 nowrap" >
id="tickets-table">
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">S.No.</th>
<th class="font-weight-medium">Client Name</th> <th class="font-weight-medium">Client Name</th>
<th class="font-weight-medium">Insurer 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">Opening Date</th>
<th class="font-weight-medium">CD Account No</th> <th class="font-weight-medium">CD Account No</th>
<th class="font-weight-medium">Opening Amount</th> <th class="font-weight-medium">Opening Amount</th>
@ -71,17 +82,17 @@ table.dataTable thead th {
<th class="font-weight-medium">Action</th> <th class="font-weight-medium">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach($CD_Master_Data as $row){ ?> <?php foreach($CD_Master_Data as $index => $row){ ?>
<tr> <tr>
<td><?= $index + 1; ?></td>
<td><?php echo $row['client_name']; ?>( <?= $row['short_name'] ?> )</td> <td><?php echo $row['client_name']; ?>( <?= $row['short_name'] ?> )</td>
<td><?php echo $row['insurer_name']; ?></td> <td><?php echo $row['insurer_name']; ?></td>
<td><?php echo $row['insurer_branch_name']; ?></td>
<td><?php echo date('d-m-Y', strtotime($row['opening_date'])); ?></td> <td><?php echo date('d-m-Y', strtotime($row['opening_date'])); ?></td>
<td><?php echo $row['cd_ac_no']; ?></td> <td><?php echo $row['cd_ac_no']; ?></td>
<td><?php echo $row['opening_bal']; ?></td> <td><?php echo $row['opening_bal']; ?></td>
<td><?php echo date('d-M-Y h:i A', strtotime($row['created_at'])) ?> by <td><?php echo date('d-M-Y h:i A', strtotime($row['created_at'])) ?> by <?php echo $row['user_name']; ?></td>
<?php echo $row['user_name']; ?></td>
<td> <td>
<div class="btn-group dropdown"> <div class="btn-group dropdown">
<a href="javascript: void(0);"class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a> <a href="javascript: void(0);"class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
@ -103,90 +114,12 @@ table.dataTable thead th {
</div> </div>
<!-- end row --> <!-- end row -->
<?php include("cd_master_add_modal.php"); ?>
<!-- modal content -->
<div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true" data-backdrop="static" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="title">Add Opening Amount</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body p-4">
<div class="">
<form role="form" class="parsley-examples" method="post" id="CDMasterForm" action=""
enctype="multipart/form-data">
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
<input type="hidden" name="PrimaryKey" id="CD_Master_ID" />
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-12">
<label for="emp_code">Client<span class="text-danger">*</span></label>
<select class="form-control" id="client_id" name="client_id" required>
<option value="">Select Client</option>
<?php foreach($clients as $value) { ?>
<option value="<?= $value['id'] ?>"><?= $value['client_name'] ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="profile">Insurer<span class="text-danger">*</span></label>
<select class="form-control" id="insurer_id" name="insurer_id" required>
<option value="">Select Insurer</option>
<?php foreach($insurers as $value) { ?>
<option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="email">Opening Date<span class="text-danger">*</span></label>
<input type="text" class="form-control" name="opening_date" id="opening_date" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="mobile">CD Account Number<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="cd_ac_no" name="cd_ac_no" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="mobile">Opening Amount<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="opening_bal" name="opening_bal" onkeypress="return onlyNumbers(event)" required>
</div>
</div>
</div>
<div class="form-group text-right m-b-0">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
id="btnSubmit">Submit</button>
<!-- <button type="button" class="btn btn-secondry waves-effect waves-light mr-1" data-dismiss="modal" aria-hidden="true">Close</button> -->
</div>
</form>
</div>
</div>
</div>
</div>
</div><!-- /.modal -->
<script> <script>
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
const table = document.getElementById("tickets-table"); const table = document.getElementById("scroll-horizontal-datatable");
// Create custom dropdown // Create custom dropdown
function createCustomDropdown(row) { function createCustomDropdown(row) {
@ -275,19 +208,19 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
}); });
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('#tickets-table').DataTable({ $('#scroll-horizontal-datatable').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" + scrollX: true,
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" +
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", "<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [{ buttons: [
{
extend: 'csv', extend: 'csv',
text: 'CSV', text: 'CSV',
title: 'CD-Master-List', title: 'CD-Master-List',
@ -295,7 +228,15 @@ document.addEventListener("DOMContentLoaded", function () {
exportOptions: { exportOptions: {
columns: ':not(:last-child)' columns: ':not(:last-child)'
}, },
}], },
{
text: 'Add',
className: 'buttons-html5 addbtnStyle',
action: function (e, dt, node, config) {
showCdMasterAddModal();
}
}
],
language: { language: {
search: "_INPUT_", search: "_INPUT_",
searchPlaceholder: "Search..." searchPlaceholder: "Search..."
@ -314,45 +255,6 @@ document.addEventListener("DOMContentLoaded", function () {
<?php if (session()->has('success')) : ?> <?php if (session()->has('success')) : ?>
toastr.success('<?= session()->getFlashdata('success') ?>', 'success'); toastr.success('<?= session()->getFlashdata('success') ?>', 'success');
<?php endif; ?> <?php endif; ?>
var endDatePicker = flatpickr("#opening_date", {
dateFormat: "d-m-Y",
// defaultDate: endDate,
allowInput: false
});
$('#client_id').select2();
$('#insurer_id').select2();
})
$('#btnAdd').click(function(){
$('#client_id').val('');
$('#insurer_id').val('');
$('#opening_date').val('');
$('#cd_ac_no').val('');
$('#opening_bal').val('');
$('#CDMasterForm').attr('action', '<?php echo base_url('master/cash_deposite/create');?>');
$('#title').html('Add Opening Amount');
$('#btnSubmit').html('Submit');
})
$('.close').click(function(){
$('#CD_Master_ID').val('');
$('#client_id').val('').change();
$('#insurer_id').val('').change();
$('#opening_date').val('');
$('#cd_ac_no').val('');
$('#opening_bal').val('');
$('#CDMasterForm')[0].reset();
$('#CDMasterForm').parsley().reset();
$('#client_id').prop("disabled", false);
$('#insurer_id').prop("disabled", false);
$('#cd_ac_no').prop("disabled", false);
$('#opening_bal').prop("disabled", false)
}) })
$('body').on('click', '.btnEdit', function () { $('body').on('click', '.btnEdit', function () {
@ -371,10 +273,12 @@ document.addEventListener("DOMContentLoaded", function () {
$('#updateModal').modal('show'); $('#updateModal').modal('show');
$('#CDMasterForm').attr('action', '<?php echo base_url('master/cash_deposite/edit');?>'); $('#CDMasterForm').attr('action', '<?php echo base_url('master/cash_deposite/edit');?>');
$('#CD_Master_ID').val(res.data.id); $('#CD_Master_ID').val(res.data.id);
$('#client_id').val(res.data.client_id).change(); $('#cd_client_id').val(res.data.client_id).change();
$('#client_id').prop("disabled", true); $('#cd_client_id').prop("disabled", true);
$('#insurer_id').val(res.data.insurer_id).change(); $('#insurer_id_for_cd').val(res.data.insurer_id).change();
$('#insurer_id').prop("disabled", true); $('#insurer_id_for_cd').prop("disabled", true);
$('#insurer_branch_id').val(res.data.insurer_id).change();
$('#insurer_branch_id').prop("disabled", true);
$('#opening_date').val(res.data.opening_date); $('#opening_date').val(res.data.opening_date);
$('#cd_ac_no').val(res.data.cd_ac_no); $('#cd_ac_no').val(res.data.cd_ac_no);
//$('#cd_ac_no').prop("disabled", true); //$('#cd_ac_no').prop("disabled", true);
@ -394,37 +298,6 @@ document.addEventListener("DOMContentLoaded", function () {
}); });
}); });
$('#cd_ac_no').keyup(function(){
console.log('key chnage detected');
var cd_ac_no = $(this).val();
console.log(cd_ac_no +'-'+cd_ac_no.length);
cd_ac_no = cd_ac_no.trim();
console.log(cd_ac_no +'-'+cd_ac_no.length);
$.ajax({
url: '<?php echo base_url('util/check_cd_ac_no/');?>'+cd_ac_no,
type: "GET",
dataType: 'json',
success: function (res) {
console.log(res)
if(res.status == true){
toastr.warning(res.message, 'warning');
// $('#cd_ac_no').val('');
$('#btnSubmit').prop('disabled',true);
return;
}
$('#btnSubmit').prop('disabled',false);
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
}
});
})
function removeCDMaster(element) { function removeCDMaster(element) {
Swal.fire({ Swal.fire({
@ -470,10 +343,4 @@ document.addEventListener("DOMContentLoaded", function () {
} }
function onlyNumbers(event) {
var charcode;
charcode = event.which || event.keyCode;
if (charcode >= 48 && charcode <= 57 || charcode == 46) return true;
return false;
}
</script> </script>

View File

@ -21,6 +21,7 @@
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">Insurer Name</th> <th class="font-weight-medium">Insurer Name</th>
<th class="font-weight-medium">Insurer Branch Name</th>
<th class="font-weight-medium">CD Account Number</th> <th class="font-weight-medium">CD Account Number</th>
<th class="font-weight-medium">Current Balance</th> <th class="font-weight-medium">Current Balance</th>
<th class="font-weight-medium">Action</th> <th class="font-weight-medium">Action</th>
@ -33,6 +34,7 @@
<?php foreach ($clientData as $value): ?> <?php foreach ($clientData as $value): ?>
<td><?php echo $value->insurer_name;?></td> <td><?php echo $value->insurer_name;?></td>
<td><?php echo $value->insurer_branch_name;?></td>
<td><?php echo $value->cd_master_account_no;?></td> <td><?php echo $value->cd_master_account_no;?></td>
<td> <td>

View File

@ -32,6 +32,13 @@ body {
margin: 0 5px 10px!important; margin: 0 5px 10px!important;
} }
.readonly-select {
pointer-events: none;
/* background-color: #f0f0f0; */
background-color: #e0e0e0;
color: #666;
}
</style> </style>
<style> <style>

View File

@ -56,7 +56,6 @@
</select> </select>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="policy_type"> Policy Type<span class="text-danger">*</span></label> <label for="policy_type"> Policy Type<span class="text-danger">*</span></label>
<select class="form-control" id="policy_type" name="policy_type_id" required> <select class="form-control" id="policy_type" name="policy_type_id" required>
@ -80,10 +79,10 @@
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="insurer">Insurer<span class="text-danger">*</span></label> <label for="insurer">Insurer<span class="text-danger">*</span></label>
<select class="form-control" id="insurer" name="insurer" required> <select class="form-control" id="insurer" name="insurer" onchange="setInsuerAndBranchValue(this)" required>
<option value="">Select Insurer</option> <option value="">Select Insurer</option>
<?php foreach ($insurer as $value) { ?> <?php foreach ($insurer as $value) { ?>
<option value="<?= $value['id'] . '-' . $value['insurer_id'] ?>"> <option data-id="<?= $value['insurer_id']?>" value="<?= $value['id'] . '-' . $value['insurer_id'] ?>">
<?= $value['insurer_name'] . '-' . $value['branch_code'] ?></option> <?= $value['insurer_name'] . '-' . $value['branch_code'] ?></option>
<?php } ?> <?php } ?>
</select> </select>
@ -206,6 +205,7 @@
<?php include('policy_gmc_terms.php'); ?> <?php include('policy_gmc_terms.php'); ?>
<?php include('policy_gpa_terms.php'); ?> <?php include('policy_gpa_terms.php'); ?>
<?php include('other_policy_terms.php'); ?> <?php include('other_policy_terms.php'); ?>
<?php include('cd_master_add_modal.php'); ?>
<!-- Center modal content --> <!-- Center modal content -->
<div class="modal fade" id="lead_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="false"> <div class="modal fade" id="lead_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="false">
@ -690,16 +690,25 @@
$('#insurer').change(function() { $('#insurer').change(function() {
var id = $(this).val(); var id = $(this).val();
var insurer_id = $(this).find('option:selected').data('id');
console.log('insurer_id', insurer_id)
console.log('insurer and branch ids', id)
var client_id = $('#client_id_policy').val() var client_id = $('#client_id_policy').val()
var parts = id.split('-'); var parts = id.split('-');
var firstPart = parts[0];
var secondPart = parts[1]; var secondPart = parts[1];
console.log('firstPart', firstPart);
console.log('secondPart', secondPart);
var url = "<?= base_url("util/police-by-insurer/") ?>" + secondPart; var url = "<?= base_url("util/police-by-insurer/") ?>" + secondPart;
var url_for_cd = "<?= base_url("util/get_cd_ac/") ?>" + client_id + '/' + secondPart; var url_for_cd = "<?= base_url("util/get_cd_ac/") ?>" + client_id + '/' + secondPart + '/' + firstPart;
var selectedOption = $('#base_policy').find(':selected'); var selectedOption = $('#base_policy').find(':selected');
var base_policy_data_id = selectedOption.data('id'); var base_policy_data_id = selectedOption.data('id');
if(secondPart && firstPart){
$.get(url_for_cd, function(response){ $.get(url_for_cd, function(response){
// console.log(response) // console.log(response)
@ -709,17 +718,15 @@
toastr.warning('The CD Account Number not found.', 'Warning'); toastr.warning('The CD Account Number not found.', 'Warning');
return; return;
} }
appendCDACNO(response.data) appendCDACNO(response.data)
}).fail(function(xhr, status, error) { }).fail(function(xhr, status, error) {
console.error(xhr.responseText); console.error(xhr.responseText);
console.error(status, error); console.error(status, error);
}); });
}
}); });
}); });
$(document).ready(function() { $(document).ready(function() {
@ -1204,7 +1211,6 @@
return word.trim(); return word.trim();
} }
function convertCommaNumberToWords(input) { function convertCommaNumberToWords(input) {
let number; let number;
@ -1683,19 +1689,28 @@
text: 'Select CD Account Number' text: 'Select CD Account Number'
})); }));
$('#cd_ac_no').append($('<option>', {
value: 'add_cd',
text: '+ Add New CD'
}));
$.each(data, function(index, item) { $.each(data, function(index, item) {
const option = $('<option>', { const option = $('<option>', {
value: item.id, value: item.id,
text: item.cd_ac_no text: item.cd_ac_no
}); });
if (select === item.id) { if (select == item.id) {
//console.log('selected'); //console.log('selected');
option.attr('selected', true); option.attr('selected', true);
} }
$('#cd_ac_no').append(option); $('#cd_ac_no').append(option);
}); });
if (select) {
$('#cd_ac_no').val(select).trigger('change');
}
} }
// append Base Policy to the dropdown for edit only // append Base Policy to the dropdown for edit only
@ -2095,4 +2110,33 @@
}); });
} }
$('#cd_ac_no').change(function(){
let cd_ac_no = $(this).val();
if(cd_ac_no == "add_cd"){
showCdMasterAddModal();
$(this).val("");
}
})
function setInsuerAndBranchValue(input){
var id = $(input).val();
console.log('id', id);
var parts = id.split('-');
console.log('parts', parts);
var firstPart = parts[0];
console.log('firstPart', firstPart);
var secondPart = parts[1];
console.log('secondPart', secondPart);
$('#insurer_branch_id').val(firstPart).trigger('change');
$('#insurer_id_for_cd').val(secondPart).trigger('change');
}
</script> </script>

View File

@ -170,7 +170,7 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3 freshFields"> <!-- <div class="form-group col-md-3 freshFields">
<label for="client_type">Client Type<span class="text-danger">*</span></label> <label for="client_type">Client Type<span class="text-danger">*</span></label>
<select class="form-control" id="client_type" name="client_type" required> <select class="form-control" id="client_type" name="client_type" required>
<option value="">Select Client type</option> <option value="">Select Client type</option>
@ -182,7 +182,7 @@
} }
?> ?>
</select> </select>
</div> </div> -->
<div class="form-group col-md-3 freshFields"> <div class="form-group col-md-3 freshFields">
<label for="entity_type_id">Entity Type<span class="text-danger">*</span></label> <label for="entity_type_id">Entity Type<span class="text-danger">*</span></label>
@ -210,7 +210,7 @@
placeholder="Enter Client Short Name" onkeyup="validateInput(this, 'clients', 'short_name')" required> placeholder="Enter Client Short Name" onkeyup="validateInput(this, 'clients', 'short_name')" required>
</div> </div>
<div class="form-group col-md-3 renewalFields" style="display: none;"> <!-- <div class="form-group col-md-3 renewalFields" style="display: none;">
<label for="source_policy_id"> Source Policy <span id="base_danger" <label for="source_policy_id"> Source Policy <span id="base_danger"
class="text-danger">*</span></label> class="text-danger">*</span></label>
<select class="form-control" id="source_policy_id" name="source_policy_id"> <select class="form-control" id="source_policy_id" name="source_policy_id">
@ -226,14 +226,14 @@
<div class="form-group col-md-3 renewalFields" style="display: none;"> <div class="form-group col-md-3 renewalFields" style="display: none;">
<label for="source_policy_end_date">Source Policy End Date<span class="text-danger"></span></label> <label for="source_policy_end_date">Source Policy End Date<span class="text-danger"></span></label>
<input type="text" class="form-control" id="source_policy_end_date" name="source_policy_end_date" readonly> <input type="text" class="form-control" id="source_policy_end_date" name="source_policy_end_date" readonly>
</div> </div> -->
<div class="form-group col-md-3"> <!-- <div class="form-group col-md-3">
<label for="pan">PAN<span class="text-danger"></span></label> <label for="pan">PAN<span class="text-danger"></span></label>
<input type="text" class="form-control" id="pan" placeholder="Enter PAN Number" <input type="text" class="form-control" id="pan" placeholder="Enter PAN Number"
data-parsley-error-message="Invalid PAN Number. Example: ABCDE1234F" name="pan" data-parsley-error-message="Invalid PAN Number. Example: ABCDE1234F" name="pan"
data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$"> data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$">
</div> </div> -->
</div> </div>
<!-- end client row --> <!-- end client row -->
@ -263,15 +263,14 @@
placeholder="Enter Branch Code" required> placeholder="Enter Branch Code" required>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3 renewalFields">
<label for="contact_person_summary">Contact Person's</label> <label for="contact_person_summary">Contact Person</label>
<select class="form-control" name="contact_person_summary" id="contact_person_summary"> <select class="form-control" name="contact_person_summary" id="contact_person_summary">
<option value="">Select a Person</option> <option value="">Select a Contact</option>
</select> </select>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3 freshFields">
<label for="client_branch">Contact Person Name<span class="text-danger">*</span></label> <label for="client_branch">Contact Person Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="contact_person_name" name="contact_person_name" <input type="text" class="form-control" id="contact_person_name" name="contact_person_name"
placeholder="Enter Contact Name" required> placeholder="Enter Contact Name" required>
@ -302,9 +301,9 @@
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="salse_person_id">Salse Person<span class="text-danger">*</span></label> <label for="salse_person_id">Sales Person<span class="text-danger">*</span></label>
<select class="form-control" id="salse_person_id" name="salse_person_id" multiple required> <select class="form-control" id="salse_person_id" name="salse_person_id" multiple required>
<option value="">Select Salse Person</option> <option value="">Select Sales Person</option>
<?php if (isset($salse_team)) { ?> <?php if (isset($salse_team)) { ?>
<?php foreach ($salse_team as $value) { ?> <?php foreach ($salse_team as $value) { ?>
<option value="<?= $value['id']; ?>"> <option value="<?= $value['id']; ?>">
@ -337,7 +336,7 @@
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="notes">Note</label> <label for="notes">Remarks</label>
<textarea class="form-control" id="notes" name="notes" rows="4"></textarea> <textarea class="form-control" id="notes" name="notes" rows="4"></textarea>
</div> </div>
</div> </div>
@ -771,7 +770,8 @@
if (value.name && value.email) { if (value.name && value.email) {
let display_value = `${value.name} - ${value.email} - ${value.mobile}`; // let display_value = `${value.name} - ${value.email} - ${value.mobile}`;
let display_value = value.name;
$('#contact_person_summary').append($('<option>', { $('#contact_person_summary').append($('<option>', {
value: key, // index or key in array/object value: key, // index or key in array/object
@ -1059,6 +1059,24 @@
// Main div // Main div
newRow.innerHTML += ` newRow.innerHTML += `
<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">
<option value="" selected>Select Source Policy</option>
</select>
</div>
<div class="form-group col-md-3 renewalFields" style="display: none;">
<label for="source_policy_start_date">Source Policy Start Date<span class="text-danger"></span></label>
<input type="text" class="form-control readonly-select" id="source_policy_start_date" name="source_policy_start_date" readonly>
</div>
<div class="form-group col-md-3 renewalFields" style="display: none;">
<label for="source_policy_end_date">Source Policy End Date<span class="text-danger"></span></label>
<input type="text" class="form-control" id="source_policy_end_date" name="source_policy_end_date" readonly>
</div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="policy_type_id">Policy Type <span class="text-danger">*</span></label> <label for="policy_type_id">Policy Type <span class="text-danger">*</span></label>
<select class="form-control" id="policy_type_id_${increment}" name="policy_type_id[]" onchange="getCustomFields(this, ${increment})" required> <select class="form-control" id="policy_type_id_${increment}" name="policy_type_id[]" onchange="getCustomFields(this, ${increment})" required>
@ -2054,8 +2072,10 @@
$("#client_branch_id").select2(); $("#client_branch_id").select2();
if ($(this).is(':checked')) { if ($(this).is(':checked')) {
$('#client_id').closest('.form-group').show(); $('#client_id').closest('.form-group').show();
$('#client_branch_id').closest('.form-group').show(); $('#client_branch_id').closest('.form-group').show();
$('#contact_person_summary').closest('.form-group').show();
$('#client_type').addClass('readonly-select'); $('#client_type').addClass('readonly-select');
$('#entity_type_id').addClass('readonly-select'); $('#entity_type_id').addClass('readonly-select');
@ -2066,9 +2086,20 @@
$("#client_id").prop("required", true); $("#client_id").prop("required", true);
$("#client_branch_id").prop("required", true); $("#client_branch_id").prop("required", true);
$("#contact_person_summary").prop("required", true);
$("#contact_person_name").prop("required", false);
$('#contact_person_name').closest('.form-group').hide();
$("#client_name").prop("required", false);
$('#client_name').closest('.form-group').hide();
} else { } else {
$('#client_id').closest('.form-group').hide(); $('#client_id').closest('.form-group').hide();
$('#client_branch_id').closest('.form-group').hide(); $('#client_branch_id').closest('.form-group').hide();
$('#contact_person_summary').closest('.form-group').hide();
$('#client_type').removeClass('readonly-select'); $('#client_type').removeClass('readonly-select');
$('#entity_type_id').removeClass('readonly-select'); $('#entity_type_id').removeClass('readonly-select');
@ -2078,6 +2109,14 @@
$("#client_id").prop("required", false); $("#client_id").prop("required", false);
$("#client_branch_id").prop("required", false); $("#client_branch_id").prop("required", false);
$("#contact_person_summary").prop("required", false);
$("#contact_person_name").prop("required", true);
$('#contact_person_name').closest('.form-group').show();
$("#client_name").prop("required", true);
$('#client_name').closest('.form-group').show();
} }
}); });

View File

@ -165,7 +165,7 @@ if (isset($selected_lead_type)) {
$('#client_id').select2(); $('#client_id').select2();
$('#client_branch_id').select2(); $('#client_branch_id').select2();
$('#salse_person_id').select2({ $('#salse_person_id').select2({
placeholder: "Select Salse Person", placeholder: "Select Sales Person",
}); });
$('#policy_type_id').select2(); $('#policy_type_id').select2();

View File

@ -64,6 +64,84 @@ table.dataTable tbody td {
color: #16181b !important; color: #16181b !important;
cursor: pointer !important; cursor: pointer !important;
} }
.addbtnStyle{
margin-left: 20px !important;
}
/* Modeal class */
.modal-content {
border-radius: 4px;
border: 1px solid #dee2e6;
}
.modal-header {
background: #f8f9fa;
border-bottom: 1px solid #dee2e6;
padding: 1rem 1.5rem;
}
.modal-title {
font-size: 1.1rem;
font-weight: 500;
color: #495057;
}
.modal-body {
padding: 1.5rem;
}
.policy-label {
font-weight: 500;
color: #495057;
margin-bottom: 1rem;
}
.radio-option {
border: 1px solid #dee2e6;
border-radius: 4px;
padding: 0.75rem 1rem;
margin-bottom: 0.5rem;
cursor: pointer;
background: #fff;
}
.radio-option:hover {
border-color: #007bff;
background: #f8f9fa;
}
.radio-option.selected {
border-color: #007bff;
background: #e7f3ff;
}
.form-check {
margin-bottom: 0;
}
.form-check-input {
margin-right: 0.5rem;
}
.form-check-label {
cursor: pointer;
font-weight: normal;
margin-bottom: 0;
}
.modal-footer {
border-top: 1px solid #dee2e6;
padding: 1rem 1.5rem;
}
.btn {
font-size: 0.9rem;
padding: 0.5rem 1rem;
}
/* Modeal class */
</style> </style>
@ -77,7 +155,7 @@ table.dataTable tbody td {
</div> </div>
<div class="col-3" id="status_change" style="text-align: right; position: relative;top: 56px; left: 291px;"> <div class="col-3" id="status_change" style="text-align: right; position: relative;top: 56px; left: 291px;">
<button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" onclick="openLeadTypeAskModal();">Add</button> <!-- <button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" onclick="openLeadTypeAskModal();">Add</button> -->
</div> </div>
</div> </div>
<div> <div>
@ -130,11 +208,11 @@ table.dataTable tbody td {
<a href="<?= base_url('/rfq/list/').$row['id'] . '/' . 1; ?>" class="dropdown-item btnEdit2" data-id="<?= $row['id']; ?>"> <a href="<?= base_url('/rfq/list/').$row['id'] . '/' . 1; ?>" class="dropdown-item btnEdit2" data-id="<?= $row['id']; ?>">
<i class="mdi mdi-note-text mr-2 text-muted font-18 vertical-middle"></i>RFQ <i class="mdi mdi-note-text mr-2 text-muted font-18 vertical-middle"></i>RFQ
</a> </a>
<!-- <?php if($row['qcr_count'] > 0) { ?> <?php if(!in_array($row['status'], ['queued', 'rfq_created', 'rfq_sent'])) { ?>
<a href="<?= base_url('/rfq/list/').$row['id'] . '/' . 2; ?>" class="dropdown-item btnEdit" data-id="<?= $row['id']; ?>"> <a href="<?= base_url('/rfq/list/').$row['id'] . '/' . 2; ?>" class="dropdown-item btnEdit3" data-id="<?= $row['id']; ?>">
<i class="mdi mdi-note-text mr-2 text-muted font-18 vertical-middle"></i>QCR <i class="mdi mdi-note-text mr-2 text-muted font-18 vertical-middle"></i>QCR
</a> </a>
<?php } ?> --> <?php } ?>
</div> </div>
</div> </div>
</td> </td>
@ -155,26 +233,31 @@ table.dataTable tbody td {
</div><!-- end col --> </div><!-- end col -->
</div> </div>
<div class="modal fade" id="New_Lead_modal" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal fade" id="New_Lead_modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered"> <div class="modal-dialog modal-dialog-centered">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title" id="myCenterModalLabel"></h4> <h4 class="modal-title" id="myCenterModalLabel">Select Leaad Type</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="form-row">
<div class="form-group col-md-12"> <div class="radio-option selected" onclick="selectOption(this, 'lead_eb')">
<label for="lead_form_type"> Policy Type <span class="text-danger"></span></label> <div class="form-check">
<select class="form-control" id="openLeadTypeAskModal"> <input class="form-check-input" type="radio" name="lead_form_type" id="lead_eb" value="1" checked>
<option value="1">Lead EB</option> <label class="form-check-label" for="lead_eb">Lead EB</label>
<option value="2">Lead Non-EB</option> </div>
</select> </div>
<div class="radio-option" onclick="selectOption(this, 'lead_non_eb')">
<div class="form-check">
<input class="form-check-input" type="radio" name="lead_form_type" id="lead_non_eb" value="2">
<label class="form-check-label" for="lead_non_eb">Lead Non-EB</label>
</div> </div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" onclick="submitToRedirectLeadNewUrl(this)">Submit</button> <button type="button" class="btn btn-primary" onclick="submitToRedirectLeadNewUrl(this)">Submit</button>
</div> </div>
</div> </div>
@ -293,18 +376,27 @@ document.addEventListener("DOMContentLoaded", function () {
if (ticketsTable.length) { if (ticketsTable.length) {
ticketsTable.DataTable({ ticketsTable.DataTable({
// scrollX: true, scrollX: true,
dom: "<'row'<'col-sm-6'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right dom: "<'row'<'col-sm-7'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
buttons: [{ buttons: [
{
extend: 'csv', extend: 'csv',
text: 'CSV', text: 'CSV',
title: 'Policy-Tranction-Inception-List', title: 'Policy-Tranction-Inception-List',
exportOptions: { exportOptions: {
columns: ':not(:last-child)' columns: ':not(:last-child)'
}, },
}, ], },
{
text: 'Add',
className: 'buttons-html5 addbtnStyle',
action: function (e, dt, node, config) {
openLeadTypeAskModal();
}
}
],
language: { language: {
search: "_INPUT_", search: "_INPUT_",
searchPlaceholder: "Search..." searchPlaceholder: "Search..."
@ -327,7 +419,8 @@ document.addEventListener("DOMContentLoaded", function () {
console.log('function called') console.log('function called')
let Lead_type = $('#openLeadTypeAskModal').val() // let Lead_type = $('#openLeadTypeAskModal').val()
let Lead_type = $('input[name="lead_form_type"]:checked').val();
console.log('Lead_type ', Lead_type) console.log('Lead_type ', Lead_type)
let url = '<?=base_url('/util/getLeadNonEB/')?>' + Lead_type let url = '<?=base_url('/util/getLeadNonEB/')?>' + Lead_type
console.log('url ', url) console.log('url ', url)
@ -346,3 +439,32 @@ document.addEventListener("DOMContentLoaded", function () {
} }
</script> </script>
<script>
function selectOption(element, radioId) {
// Remove selected class from all options
document.querySelectorAll('.radio-option').forEach(option => {
option.classList.remove('selected');
});
// Add selected class to clicked option
element.classList.add('selected');
// Check the corresponding radio button
document.getElementById(radioId).checked = true;
}
// Add click event to radio inputs directly
document.querySelectorAll('input[name="lead_form_type"]').forEach(radio => {
radio.addEventListener('change', function() {
// Remove selected class from all options
document.querySelectorAll('.radio-option').forEach(option => {
option.classList.remove('selected');
});
// Add selected class to parent of checked radio
this.closest('.radio-option').classList.add('selected');
});
});
</script>

View File

@ -363,7 +363,7 @@
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="notes">Note</label> <label for="notes">Remarks</label>
<textarea class="form-control" id="notes" name="notes" rows="4"></textarea> <textarea class="form-control" id="notes" name="notes" rows="4"></textarea>
</div> </div>
</div> </div>

View File

@ -22,6 +22,15 @@
id="bs-dark-stylesheet" /> id="bs-dark-stylesheet" />
<link href="<?= base_url() . "public"; ?>/assets/css/app-material-dark.min.css" rel="stylesheet" type="text/css" <link href="<?= base_url() . "public"; ?>/assets/css/app-material-dark.min.css" rel="stylesheet" type="text/css"
id="app-dark-stylesheet" /> id="app-dark-stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800;900&display=swap" rel="stylesheet">
<!-- For background image -->
<link rel="preload" as="image" href="<?= base_url('public/assets/images/background_theme.jpg') ?>" />
<!-- For logo -->
<link rel="preload" as="image" href="<?= base_url('public/assets/images/Nhance-Logo-Final.png') ?>" />
<!-- icons --> <!-- icons -->
<link href="<?= base_url() . "public"; ?>/assets/css/icons.min.css" rel="stylesheet" type="text/css" /> <link href="<?= base_url() . "public"; ?>/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
@ -32,58 +41,119 @@
} }
.auth-fluid { .background_theme {
position: relative; background: url("<?= base_url('public/assets/images/background_theme.jpg') ?>");
display: flex; background-size: contain;
min-height: 100vh; background-repeat: no-repeat;
flex-direction: row; background-size: 100% 100%;
background: url("<?= base_url('public/assets/images/login_bg.jpg') ?>") center center !important; padding: 0;
background-size: cover !important; margin: 0;
} }
.bg_image{
background : url("<?= base_url('public/assets/images/bg_image.png') ?>");
background-size : contain;
background-repeat : no-repeat;
background-size : 100% 100%;
padding : 0;
margin : 0;
}
.bg_login{
background-color: #024C4F;
}
.outer_card{
margin-top:7%;
margin-bottom:5%;
margin-left:10%;
margin-right:10%;
}
.inner-card {
min-height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
@media screen and (max-height: 780px) {
.outer_card{
margin-top:7%;
margin-bottom:0%;
margin-left:10%;
margin-right:10%;
}
}
</style> </style>
</head> </head>
<body class="loading auth-fluid-pages pb-0"> <body class="background_theme ">
<div class="outer_card" >
<div class="inner_card" style="border-radius: 25px; overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);">
<div class="row " > <div class="row " >
<div class="col-lg-8 auth-fluid"> <div class="col-lg-6 bg_image">
<!-- Auth fluid right content --> <img
<div class="auth-fluid-right bg-transparent"> style="margin-top:40px;margin-left:40px;"
<img src="<?= base_url()."public"; ?>/assets/images/Nhance-Logo-Final.png" width="200"> src="<?= base_url() . "public"; ?>/assets/images/Nhance-Logo-Final.png" width="150" >
</div> </div>
<!-- end Auth fluid right content --> <div class="col-lg-6 bg_login inner-card ">
</div> <div class="content-box text-center">
<div class="col-lg-4 align-items-center d-flex">
<!--Auth fluid left content --> <br><br><br><br>
<div class="auth-fluid-form-box" style="margin-left: 10%;"> <!-- nhance favicon -->
<div class="h-100"> <img src="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi.png" height="70" width="auto" >
<div class="card-body"> <br>
<div class="form-group mb-0 text-center">
<a href="<?= base_url('auth/google'); ?>"><img <!-- Text section -->
src="<?= base_url()."public"; ?>/assets/images/googleButton.svg" width="300"></a>
</div>
<h1 style="color:white; font-family: 'Poppins', sans-serif; font-weight: 600;">
Welcome To Nhance
</h1>
<h4 style="color:white; font-family: 'Poppins', sans-serif;">Sign in with your Google Account to continue</h4>
<br><br>
<!-- google button -->
<a href="<?= base_url('auth/google'); ?>" >
<img style="border-radius:50px;"
src="<?= base_url() . "public"; ?>/assets/images/googleButton.svg" width="200">
</a>
<?php if (session()->getFlashdata('error')) : ?> <?php if (session()->getFlashdata('error')) : ?>
<br>
<span class="widget-simple text-center"> <span class="widget-simple text-center">
<div class="media-body align-self-center font-24 avatar-title"> <div class="media-body align-self-center font-24 avatar-title">
<p style="color: #f1556c!important;" class="mt-0" style><?= session('error') ?></p> <p style="color:red; font-family: 'Poppins', sans-serif;" class="mt-0" style><?= session('error') ?></p>
</div> </div>
</span> </span>
<?php endif; ?> <?php endif; ?>
</div> <!-- end .card-body --> <!-- space -->
</div> <!-- end .align-items-center.d-flex.h-100--> <br><br><br><br><br><br>
</div>
<!-- end auth-fluid-form-box--> <!-- data privacy indication -->
<h6 style="color:white; font-family: 'Poppins', sans-serif;">We respect your privacy and your data is safe with us</h6>
<!-- bottom line -->
</div> </div>
</div> </div>
</div>
</div>
</div>
<!-- end auth-fluid--> <!-- end auth-fluid-->
<!-- Vendor js --> <!-- Vendor js -->
<script src="<?= base_url() . "public"; ?>/assets/js/vendor.min.js"></script> <script src="<?= base_url() . "public"; ?>/assets/js/vendor.min.js"></script>
<!-- App js --> <!-- App js -->

94
app/Views/login_old.php Normal file
View File

@ -0,0 +1,94 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>NHANCE</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="A fully featured CRM" name="description" />
<meta content="Venba info tech" name="author" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- App favicon -->
<link rel="shortcut icon" href="<?= base_url()."public"; ?>/assets/images/Nhance_Favi.svg">
<!-- App css -->
<link href="<?= base_url()."public"; ?>/assets/css/bootstrap-material.min.css" rel="stylesheet" type="text/css"
id="bs-default-stylesheet" />
<link href="<?= base_url()."public"; ?>/assets/css/app-material.min.css" rel="stylesheet" type="text/css"
id="app-default-stylesheet" />
<link href="<?= base_url()."public"; ?>/assets/css/bootstrap-material-dark.min.css" rel="stylesheet" type="text/css"
id="bs-dark-stylesheet" />
<link href="<?= base_url()."public"; ?>/assets/css/app-material-dark.min.css" rel="stylesheet" type="text/css"
id="app-dark-stylesheet" />
<!-- icons -->
<link href="<?= base_url()."public"; ?>/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
<style>
a:hover {
cursor: pointer;
}
.auth-fluid {
position: relative;
display: flex;
min-height: 100vh;
flex-direction: row;
background: url("<?= base_url('public/assets/images/login_bg.jpg') ?>") center center !important;
background-size: cover !important;
}
</style>
</head>
<body class="loading auth-fluid-pages pb-0">
<div class="row">
<div class="col-lg-8 auth-fluid">
<!-- Auth fluid right content -->
<div class="auth-fluid-right bg-transparent">
<img src="<?= base_url()."public"; ?>/assets/images/Nhance-Logo-Final.png" width="200">
</div>
<!-- end Auth fluid right content -->
</div>
<div class="col-lg-4 align-items-center d-flex">
<!--Auth fluid left content -->
<div class="auth-fluid-form-box" style="margin-left: 10%;">
<div class="h-100">
<div class="card-body">
<div class="form-group mb-0 text-center">
<a href="<?= base_url('auth/google'); ?>"><img
src="<?= base_url()."public"; ?>/assets/images/googleButton.svg" width="300"></a>
</div>
<?php if (session()->getFlashdata('error')) : ?>
<span class="widget-simple text-center">
<div class="media-body align-self-center font-24 avatar-title">
<p style="color: #f1556c!important;" class="mt-0" style><?= session('error') ?></p>
</div>
</span>
<?php endif; ?>
</div> <!-- end .card-body -->
</div> <!-- end .align-items-center.d-flex.h-100-->
</div>
<!-- end auth-fluid-form-box-->
</div>
</div>
<!-- end auth-fluid-->
<!-- Vendor js -->
<script src="<?= base_url()."public"; ?>/assets/js/vendor.min.js"></script>
<!-- App js -->
<script src="<?= base_url()."public"; ?>/assets/js/app.min.js"></script>
</body>
</html>

View File

@ -2983,16 +2983,18 @@ function getCDAccountNumber(input)
let client_id = $('#client_id').val(); let client_id = $('#client_id').val();
let client_type = $('#client_type').val(); let client_type = $('#client_type').val();
let insurer_id = $(input).find('option:selected').attr('data-id'); let insurer_id = $(input).find('option:selected').attr('data-id');
let insurer_branch_id = $(input).find('option:selected').attr('data-bid');
console.log('insurer', insurer); console.log('insurer', insurer);
console.log('follow_insurer_id client_id', client_id); console.log('follow_insurer_id client_id', client_id);
console.log('follow_insurer_id insurer_id', insurer_id); console.log('follow_insurer_id insurer_id', insurer_id);
console.log('follow_insurer_id insurer_branch_id', insurer_branch_id);
console.log('follow_insurer_id unique_id', unique_id); console.log('follow_insurer_id unique_id', unique_id);
if(client_id && insurer_id){ if(client_id && insurer_id){
if(client_type == 1){ if(client_type == 1){
$.ajax({ $.ajax({
url: '<?= base_url("/util/getCDAccNoByClientAndInsurer/") ?>' + client_id + '/' + insurer_id, url: '<?= base_url("/util/getCDAccNoByClientAndInsurer/") ?>' + client_id + '/' + insurer_id + '/' + insurer_branch_id,
type: "GET", type: "GET",
dataType: 'json', dataType: 'json',
success: function(res) { success: function(res) {

File diff suppressed because it is too large Load Diff

View File

@ -5,13 +5,12 @@
display: block; display: block;
} }
.btn-custom { .btn-custom {
background-color: #007bff; background-color: #007bff;
color: #fff; color: #fff;
margin-right: 10px; margin-right: 10px;
} }
.readonly-select { .readonly-select {
pointer-events: none; pointer-events: none;
background-color: #f0f0f0; background-color: #f0f0f0;
@ -35,12 +34,12 @@
background-color: #bfe0e2; background-color: #bfe0e2;
border: 1px solid #007bff; border: 1px solid #007bff;
} }
table thead tr:nth-child(2) th { table thead tr:nth-child(2) th {
background-color: #bfe0e2; background-color: #bfe0e2;
border: 1px solid #007bff; border: 1px solid #007bff;
} }
/* Apply styles to the first column, accounting for rowspan */ /* Apply styles to the first column, accounting for rowspan */
table th:nth-child(1), table th:nth-child(1),
table td:nth-child(1) { table td:nth-child(1) {
@ -48,8 +47,6 @@
background-color: #bfe0e2; background-color: #bfe0e2;
} }
/* Ensure rowspan cells in the first column inherit the same styles */ /* Ensure rowspan cells in the first column inherit the same styles */
table td[rowspan]:nth-child(1) { table td[rowspan]:nth-child(1) {
width: 110px; width: 110px;
@ -69,14 +66,13 @@
text-align: left; /* Optional: Aligns text inside cells */ text-align: left; /* Optional: Aligns text inside cells */
} }
th:nth-child(2), th:nth-child(2),
td:nth-child(2) { td:nth-child(2) {
width: 720px; width: 720px;
background-color: #bfe0e2; background-color: #bfe0e2;
/* Adjust first column width */ /* Adjust first column width */
} }
.bold { .bold {
font-weight: bold; font-weight: bold;
color: red; color: red;
@ -116,7 +112,6 @@
background-color: white !important; background-color: white !important;
} }
.dropdown-content button { .dropdown-content button {
display: block; display: block;
width: 100%; width: 100%;
@ -261,6 +256,22 @@
line-height: 33px !important; line-height: 33px !important;
} }
.save-indicator {
position: absolute;
top: 10px;
right: 10px;
background: #28a745;
color: white;
padding: 2px 8px;
border-radius: 10px;
font-size: 11px;
opacity: 0;
transition: opacity 0.3s;
}
.save-indicator.show {
opacity: 1;
}
</style> </style>
@ -297,6 +308,7 @@
<input type="hidden" id="lead_id" value="<?= htmlspecialchars($lead_data['id'] ?? "", ENT_QUOTES, 'UTF-8') ?>" /> <input type="hidden" id="lead_id" value="<?= htmlspecialchars($lead_data['id'] ?? "", ENT_QUOTES, 'UTF-8') ?>" />
<input type="hidden" id="rfq_primaryKey" name="rfq_primaryKey" value="<?= isset($rfq_data['id']) ? $rfq_data['id'] : '' ?>"> <input type="hidden" id="rfq_primaryKey" name="rfq_primaryKey" value="<?= isset($rfq_data['id']) ? $rfq_data['id'] : '' ?>">
<div class="save-indicator" id="saveIndicator">Saved</div>
<div id="allTableContainer"> <div id="allTableContainer">
<div id="tablesContainer"></div> <div id="tablesContainer"></div>
<?php include('policyRegisterModel.php'); ?> <?php include('policyRegisterModel.php'); ?>
@ -355,7 +367,7 @@
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="to">To </label> <label for="to">TO</label>
<select class="form-control" id="to" name="to" required> <select class="form-control" id="to" name="to" required>
<?php if (isset($userList)) { ?> <?php if (isset($userList)) { ?>
<?php foreach ($userList as $user) { ?> <?php foreach ($userList as $user) { ?>
@ -509,16 +521,16 @@
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="proposals"> Proposals/Insurer <span id="base_danger" class="text-danger">*</span></label> <label for="proposals"> Proposal(s) / Insurer(s) <span id="base_danger" class="text-danger">*</span></label>
<select class="form-control" id="proposals" name="proposals" onchange="getInsurerBranchContacts(this)" required> <select class="form-control" id="proposals" name="proposals" onchange="getInsurerBranchContacts(this)" required>
<option value="">Select Proposals</option> <option value="">Select Proposals</option>
</select> </select>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="placement_to"> To <span id="base_danger" class="text-danger">*</span></label> <label for="placement_to"> TO <span id="base_danger" class="text-danger">*</span></label>
<select class="form-control" id="placement_to" name="placement_to" required> <select class="form-control" id="placement_to" name="placement_to" required>
<option value="">Select To Mail</option> <option value="">Select TO Mail</option>
</select> </select>
</div> </div>
@ -2629,7 +2641,6 @@
$('.loader-mask').fadeIn(); $('.loader-mask').fadeIn();
} }
$.ajax({ $.ajax({
url: url, url: url,
data: formData, data: formData,
@ -2639,10 +2650,9 @@
console.log('RFQ NON EB FORM SUBMIT RESPONSE : ', response); console.log('RFQ NON EB FORM SUBMIT RESPONSE : ', response);
if (response.status == true) { if (response.status == true) {
toastr.success(response.message, "Success");
if (!isAutoSave) { if (!isAutoSave) {
toastr.success(response.message, "Success");
localStorage.removeItem('policyData'); localStorage.removeItem('policyData');
$('.actionBtns').show(); $('.actionBtns').show();
@ -2651,6 +2661,8 @@
} }
} else { } else {
$('#rfq_primaryKey').val(response.id); $('#rfq_primaryKey').val(response.id);
console.log(response.message, "Success");
showTinyToast()
} }
// window.location.reload(); // window.location.reload();
} else { } else {
@ -4435,15 +4447,15 @@
}); });
$('#proposals').select2({ $('#proposals').select2({
placeholder: 'Select To proposal', placeholder: 'Select proposal',
}); });
$('#placement_to').select2({ $('#placement_to').select2({
placeholder: 'Select To Mail', placeholder: 'Select TO Mail',
}); });
$('#to').select2({ $('#to').select2({
placeholder: 'Select To Mail', placeholder: 'Select TO Mail',
}); });
$("textarea.select2-search__field").attr('rows', '1'); $("textarea.select2-search__field").attr('rows', '1');
@ -5059,18 +5071,18 @@
}); });
$('#to').select2({ $('#to').select2({
placeholder: 'Select To Mail', placeholder: 'Select TO Mail',
}); });
$('#cc').val('').select2({ $('#cc').val('').select2({
placeholder: 'select CC Mail' placeholder: 'Select CC Mail'
}); });
// $('#subject').val(''); // $('#subject').val('');
$('#proposals').val(''); $('#proposals').val('');
$('#placement_to').val('').select2({ $('#placement_to').val('').select2({
placeholder: 'select To Mail' placeholder: 'Select TO Mail'
}); });
$('#placement_cc').val('').select2({ $('#placement_cc').val('').select2({
placeholder: 'select CC Mail' placeholder: 'Select CC Mail'
}); });
$('#placement_subject').val(''); $('#placement_subject').val('');
@ -5135,19 +5147,19 @@
$('.close').click(function() { $('.close').click(function() {
$('#to').select2({ $('#to').select2({
placeholder: 'Select To Mail', placeholder: 'Select TO Mail',
}); });
$('#cc').val('').select2({ $('#cc').val('').select2({
placeholder: 'select CC Mail' placeholder: 'Select CC Mail'
}); });
// $('#subject').val(''); // $('#subject').val('');
$('#proposals').val(''); $('#proposals').val('');
$('#placement_to').val('').select2({ $('#placement_to').val('').select2({
placeholder: 'select To Mail' placeholder: 'Select TO Mail'
}); });
$('#placement_cc').val('').select2({ $('#placement_cc').val('').select2({
placeholder: 'select CC Mail' placeholder: 'Select CC Mail'
}); });
$('#placement_subject').val(''); $('#placement_subject').val('');
@ -5804,6 +5816,14 @@
}); });
} }
function showTinyToast(){
const saveIndicator = document.getElementById('saveIndicator');
saveIndicator.classList.add('show');
setTimeout(() => {
saveIndicator.classList.remove('show');
}, 2000);
}
</script> </script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 MiB