Files
nutzwerte_fi4/app/Actions/Generate/Pdf/Inhalt.php
T
2025-10-31 15:25:16 +01:00

29 lines
859 B
PHP

<?php
namespace App\Actions\Generate\Pdf;
use App\Actions\Generate\Utilities\Format;
use App\Actions\Generate\Utilities\Html;
use App\Models\ProjektInhaltsverzeichnis;
class Inhalt
{
public static function create($projekte_id)
{
$html = '<table class="inhalt">';
$inhalte = ProjektInhaltsverzeichnis::where('projekte_id', $projekte_id)->orderBy('sort')->get();
foreach ($inhalte as $inhalt) {
if ($inhalt->name != 'INHALTSVERZEICHNIS' && $inhalt->ueberschrift_anzeigen) {
$html .= '<tr>';
$html .= Html::td(Format::index($inhalt->ordnungszahl));
$html .= Html::td($inhalt->name);
$html .= Html::td(Format::seite($inhalt->seite));
$html .= '</tr>';
}
}
$html .= '</table>';
return $html;
}
}