wip
This commit is contained in:
1 parent
ae6bb58972
commit
054654fb9c
18 files changed
+1325
-85
No files matched your search
@@ -8,7 +8,7 @@ use Filament\Forms\Components\RichEditor\RichContentRenderer;
|
||||
|
||||
class Deckblatt
|
||||
{
|
||||
public static function load($inhalt, $textblock)
|
||||
public static function load($inhalt, $textblock, $textblock2)
|
||||
{
|
||||
// GUTACHTER
|
||||
$html = '<div id="deckblatt-gutachter">';
|
||||
@@ -24,13 +24,12 @@ class Deckblatt
|
||||
// PROJEKT
|
||||
$html .= '<div id="deckblatt-projekt">';
|
||||
$html .= '<h1>'.trim($inhalt->name).'</h1>';
|
||||
$html .= '<p>'.trim(Pdf::$projekt->interner_name).'</p>';
|
||||
$html .= '<p>'.trim($textblock).'</p>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div id="deckblatt-festsetzung">';
|
||||
$html .= '<h3>ZUR FESTSETZUNG DER NUTZWERTE</h3>';
|
||||
$html .= '<p>'.trim(Pdf::$projekt->offizieller_name).'</p>';
|
||||
$html .= '<p>'.trim($textblock).'</p>';
|
||||
$html .= '<p>'.trim($textblock2).'</p>';
|
||||
$html .= '</div>';
|
||||
|
||||
// AUFTRAGGEBER
|
||||
|
||||
@@ -2,10 +2,28 @@
|
||||
|
||||
namespace App\Actions\Generate\Pdf;
|
||||
|
||||
use App\Actions\Generate\Pdf;
|
||||
use App\Models\ProjektPlatzhalter;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class Platzhalter
|
||||
{
|
||||
public static function replace($platzhalter, $standardtext)
|
||||
{
|
||||
return str_replace(array_keys($platzhalter), array_values($platzhalter), $standardtext);
|
||||
}
|
||||
|
||||
public static function load($projekte_id)
|
||||
{
|
||||
$platzhalter = ProjektPlatzhalter::where('projekte_id', $projekte_id)->pluck('platzhaltertext', 'platzhalter')->toArray();
|
||||
$platzhalter['###INTERNER_NAME###'] = Pdf::$projekt->interner_name;
|
||||
$platzhalter['###OFFIZIELLER_NAME###'] = Pdf::$projekt->offizieller_name;
|
||||
$platzhalter['###ORT###'] = Pdf::$projekt->ort;
|
||||
$platzhalter['###FIRMA###'] = Pdf::$gutachter->company;
|
||||
|
||||
$dt = Carbon::create(Pdf::$projekt->erstellung);
|
||||
$platzhalter['###DATUM###'] = $dt->isoFormat('D. MMMM YYYY');
|
||||
|
||||
return $platzhalter;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user