Transfer bank details to the footer

Hello
I use Dolibarr 17.0.2 - Ubuntu 22 - MariaDB

I have adapted my PDF to my wishes.
I swapped out the footer so I don’t always have to adapt pdf.lib.php after an upgrade.

unfortunately I don’t get the bank details.

I’ll try that - the designation will be transferred, the bank details unfortunately not
this is my code

			//Bank name footer			
				$pdf->SetFont('', '', 7);
				$posy -= 3;
				$pdf->SetXY(110, 282);
				$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").':              '.$outputlangs->convToOutputCharset($account->bank), 0, 'L', 0);
				$cury += 3;	
			//Bank IBAN footer
				$pdf->SetFont('', '', 7);
				$posy -= 3;
				$pdf->SetXY(110, 285);
				$pdf->MultiCell(100, 3, $outputlangs->transnoentities("IBAN").':              '.$outputlangs->convToOutputCharset($account->iban), 0, 'L', 0);
				$cury += 3;
			//Bank BIC footer
				$pdf->SetFont('', '', 7);
				$posy -= 3;
				$pdf->SetXY(110, 288);
				$pdf->MultiCell(100, 3, $outputlangs->transnoentities("BIC").':    '.$outputlangs->convToOutputCharset($account->bic), 0, 'L', 0);
				$cury += 3;	
			//Bank account owner footer
				$pdf->SetFont('', '', 7);
				$posy -= 3;
				$pdf->SetXY(110, 291);
				$pdf->MultiCell(100, 3, $outputlangs->transnoentities("BankAccountOwner").': '.$outputlangs->convToOutputCharset($account->proprio), 0, 'L', 0);
				$cury += 3;
}

can someone give me a tip on how to transfer the bank details?

Thanks very much
Aba

I found a way to transfer the bank details to my footer.

However, this is anything but a sensible solution.

I prefer not to write the access data to my database in my footer.php.

Can someone please tell me how to do this correctly with Dolibarr

here my code

		$host_name = 'localhost';
		$user_name = 'username';
		$password = 'passwort';
		$database = 'dolibarr';
		$connect = mysqli_connect($host_name, $user_name, $password, $database);

		$sqlorder = 'select bank, bic, proprio, iban_prefix from llx_bank_account';
		$result = mysqli_query($connect, $sqlorder);

		while ($bankaccount = mysqli_fetch_assoc($result)) {
		
	
			$line9 = ""; $line10 = ""; $line11 = ""; $line12 = "";
						
			// Bank name
			if (empty($bankaccount->bank))
			{
				$line9 .= ($line9).$outputlangs->transnoentities("Bank").':              '.$bankaccount['bank'];
			}

			//Bank IBAN
			if (empty($bankaccount->iban_prefix))
			{
			$line10 .= ($line10).$outputlangs->transnoentities("IBAN").':              '.$bankaccount['iban_prefix'];
			}
			
			//Bank BIC
			if (empty($bankaccount->bic))
			{			
			$line11 .= ($line11).$outputlangs->transnoentities("BIC").':    '.$bankaccount['bic'];
			}

			//Bank account owner
			if (empty($bankaccount->proprio))
			{
				$line12 .= ($line12).$outputlangs->transnoentities("BankAccountOwner").': '.$bankaccount['proprio'];
			}
		}
		mysqli_free_result($result);
	}

thank you for your help

Hi Aba

try that

		$sql = 'SELECT bank, bic, proprio, iban_prefix';
		$sql .= ' FROM '.MAIN_DB_PREFIX.'bank_account';
		$resql = $db->query($sql);
		while ($bankaccount = mysqli_fetch_assoc($resql)) {
							
				// Bank name
				if (empty($bankaccount->bank))
				{
					$line9 .= ($line9).$outputlangs->transnoentities("Bank").':              '.$bankaccount['bank'];
				}

				//Bank IBAN
				if (empty($bankaccount->iban_prefix))
				{
				$line10 .= ($line10).$outputlangs->transnoentities("IBAN").':              '.$bankaccount['iban_prefix'];
				}
				
				//Bank BIC
				if (empty($bankaccount->bic))
				{			
				$line11 .= ($line11).$outputlangs->transnoentities("BIC").':    '.$bankaccount['bic'];
				}

				//Bank account owner
				if (empty($bankaccount->proprio))
				{
					$line12 .= ($line12).$outputlangs->transnoentities("BankAccountOwner").': '.$bankaccount['proprio'];
				}
			}
		mysqli_free_result($resql);

reg. Scalar

hi Scalar
thx for your reply
unfortunately it doesn’t work - i get a blank monitor

Well the code is correct

Did you retrieve your global variables?

global $conf, $user, $db.................;   # and so on

This it is

Thx Scalar