mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 05:00:49 +08:00
26 lines
723 B
PHP
26 lines
723 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Nexus\Core;
|
||
|
|
|
||
|
|
class Management
|
||
|
|
{
|
||
|
|
protected function buildTable(array $header, array $rows)
|
||
|
|
{
|
||
|
|
$table = '<table border="1" cellspacing="0" cellpadding="5" width="100%"><thead><tr>';
|
||
|
|
foreach ($header as $key => $value) {
|
||
|
|
$table .= sprintf('<td class="colhead">%s</td>', $value);
|
||
|
|
}
|
||
|
|
$table .= '</tr></thead><tbody>';
|
||
|
|
foreach ($rows as $row) {
|
||
|
|
$table .= '<tr>';
|
||
|
|
foreach ($header as $headerKey => $headerValue) {
|
||
|
|
$table .= sprintf('<td class="colfollow">%s</td>', $row[$headerKey] ?? '');
|
||
|
|
}
|
||
|
|
$table .= '</tr>';
|
||
|
|
}
|
||
|
|
$table .= '</tbody></table>';
|
||
|
|
return $table;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|