refactor(problem/manage/permissions): use echoLongTable

This commit is contained in:
Baoshuo Ren 2023-02-04 16:12:32 +08:00
parent cfcced0984
commit 999453e0bf
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -193,30 +193,29 @@ $solution_view_type_form->runAtServer();
<div class="card"> <div class="card">
<div class="card-header fw-bold">管理者</div> <div class="card-header fw-bold">管理者</div>
<div class="card-body"> <div class="card-body">
<table class="table"> <?php
<thead> echoLongTable(
['username'],
"problems_permissions",
["problem_id" => UOJProblem::info('id')],
"",
<<<EOD
<tr> <tr>
<th>#</th>
<th>用户名</th> <th>用户名</th>
</tr> </tr>
</thead> EOD,
<tbody> function ($row) {
<?php echo HTML::tag_begin('tr');
$row_id = 0; echo HTML::tag('td', [], UOJUser::getLink($row['username']));
$res = DB::selectAll([ echo HTML::tag_end('tr');
"select username from problems_permissions", },
"where", ["problem_id" => UOJProblem::info('id')] [
]); 'echo_full' => true,
foreach ($res as $row) { 'div_classes' => ['table-responsive'],
$row_id++; 'table_classes' => ['table', 'align-middle'],
echo '<tr>', '<td>', $row_id, '</td>', '<td>', UOJUser::getLink($row['username']), '</td>', '</tr>'; ]
} );
?> ?>
</tbody>
</table>
<p class="text-center">
命令格式:命令一行一个,<code>+mike</code> 表示把 <code>mike</code> 加入管理者,<code>-mike</code> 表示把 <code>mike</code> 从管理者中移除。
</p>
<?php $managers_form->printHTML() ?> <?php $managers_form->printHTML() ?>
</div> </div>