Files
nutzwerte_fi4/app/Actions/Generate/Utilities/Html.php
T
2025-11-13 12:01:02 +01:00

67 lines
2.0 KiB
PHP

<?php
namespace App\Actions\Generate\Utilities;
class Html
{
public static function table_header($header_row)
{
$html = '<table class="table-striped">';
$html .= '<thead><tr>';
foreach ($header_row as $value) {
$html .= '<th class="bl bt br bb center bg-sky">'.$value.'</th>';
}
$html .= '</tr></thead>';
return $html;
}
public static function table_footer($nutzwert_summe)
{
$html = '<tfooter><tr>';
$html .= '<th colspan="10" class="bl bt bb right bg-sky">Nutzwert gerundet</th>';
$html .= '<th class="bl bt br bb center bg-sky">'.$nutzwert_summe.'</th>';
$html .= '</tr></tfooter>';
return $html;
}
public static function table_header_90($header_row)
{
$html = '<table class="table-striped">';
$html .= '<thead><tr text-rotate="90">';
$mm = 190 / \count($header_row);
foreach ($header_row as $value) {
$html .= '<th class="bl bt br bb center bg-sky" style="vertical-align: bottom; width: '.$mm.'mm;">'.$value.'</th>';
}
$html .= '</tr></thead>';
return $html;
}
public static function table_2_columns($header_row)
{
$html = '<table class="table-striped"><thead><tr>';
foreach ($header_row as $value) {
$html .= '<th class="bl bt br bb bg-sky">'.$value.'</th>';
}
$html .= '<th style="background:white"></th>';
foreach ($header_row as $value) {
$html .= '<th class="bl bt br bb bg-sky">'.$value.'</th>';
}
$html .= '</thead></tr>';
return $html;
}
public static function td($value = '', $classname = '', $colspan = 0, $style = '')
{
$cls = $classname != '' ? ' class="'.$classname.'"' : '';
$spn = $colspan != '' ? ' colspan="'.$colspan.'"' : '';
$style = $style != '' ? ' style="'.$style.'"' : '';
return "<td $cls $spn $style>".$value.'</td>';
}
}