20-02-2026
This commit is contained in:
parent
a8b395e20d
commit
a00c42e770
252 changed files with 28785 additions and 8907 deletions
|
|
@ -1,29 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace App\Libraries;
|
||||
|
||||
|
||||
|
||||
use setasign\Fpdi\Fpdi;
|
||||
|
||||
class ContractPDF extends Fpdi
|
||||
{
|
||||
protected $_tplIdx;
|
||||
|
||||
protected $_site = 1;
|
||||
|
||||
protected $_locale = 'de';
|
||||
|
||||
/**
|
||||
* Setzt die Sprache für das Contract-Template
|
||||
*/
|
||||
public function setLocale(string $locale): void
|
||||
{
|
||||
$this->_locale = $locale;
|
||||
}
|
||||
|
||||
public function Header()
|
||||
{
|
||||
if (null === $this->_tplIdx) {
|
||||
$this->setSourceFile('./pdf/mivita_template_contract_de.pdf');
|
||||
if ($this->_tplIdx === null) {
|
||||
// Template basierend auf Locale wählen
|
||||
$availableTemplates = config('localization.availableTemplates', ['de']);
|
||||
$locale = in_array($this->_locale, $availableTemplates) ? $this->_locale : 'de';
|
||||
|
||||
$this->setSourceFile('./pdf/mivita_template_contract_'.$locale.'.pdf');
|
||||
}
|
||||
$this->_tplIdx = $this->importPage($this->_site++);
|
||||
$this->useTemplate($this->_tplIdx);
|
||||
|
||||
}
|
||||
|
||||
function Footer() {
|
||||
|
||||
} // end of footer
|
||||
|
||||
|
||||
|
||||
public function Footer() {} // end of footer
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue