57 lines
1.6 KiB
PHP
57 lines
1.6 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_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>';
|
|
}
|
|
}
|