userCanView(Auth::user(), ['ensure' => true]); function getProblemTR($info) { $problem = new UOJProblem($info); $html = HTML::tag_begin('tr', ['class' => 'text-center']); $html .= HTML::tag('td', ['class' => $info['submission_id'] ? 'table-success' : ''], "#{$info['id']}"); $html .= HTML::tag_begin('td', ['class' => 'text-start']); $html .= $problem->getLink(['with' => 'none']); if ($problem->isUserOwnProblem(Auth::user())) { $html .= ' ' . UOJLocale::get('problems::my problem') . ' '; } if ($info['type'] == 'remote') { HTML::tag('a', ['class' => 'badge text-bg-success', 'href' => '/problems/remote'], '远端评测题'); } if ($info['is_hidden']) { $html .= ' ' . UOJLocale::get('hidden') . ' '; } if (isset($_COOKIE['show_tags_mode'])) { foreach ($problem->queryTags() as $tag) { $html .= ' ' . '' . HTML::escape($tag) . '' . ' '; } } $html .= HTML::tag_end('td'); if (isset($_COOKIE['show_submit_mode'])) { $perc = $info['submit_num'] > 0 ? round(100 * $info['ac_num'] / $info['submit_num']) : 0; $html .= HTML::tag( 'td', [], HTML::tag( 'div', [ 'class' => 'progress', 'data-bs-toggle' => 'tooltip', 'data-bs-title' => "{$info['ac_num']} / {$info['submit_num']}", 'data-bs-placement' => 'bottom', ], HTML::tag('div', [ 'class' => 'progress-bar bg-success', 'role' => 'progressbar', 'aria-valuenow' => $perc, 'aria-valuemin' => 0, 'aria-valuemax' => 100, 'style' => "width: {$perc}%; min-width: 20px;", ], "{$perc}%") ) ); } $html .= HTML::tag('td', [], $problem->getDifficultyHTML()); $html .= HTML::tag('td', [], ClickZans::getCntBlock($problem->info['zan'])); $html .= HTML::tag_end('tr'); return $html; } $header = ''; $header .= 'ID'; $header .= '' . UOJLocale::get('problems::problem') . ''; if (isset($_COOKIE['show_submit_mode'])) { $header .= '' . UOJLocale::get('problems::ac ratio') . ''; } $header .= '' . UOJLocale::get('problems::difficulty') . ''; $header .= '' . UOJLocale::get('appraisal') . ''; $header .= ''; $pag_config = [ 'page_len' => 20, 'col_names' => [ 'best_ac_submissions.submission_id as submission_id', 'problems.*', ], 'table_name' => [ "problems", "left join best_ac_submissions", "on", [ "best_ac_submissions.submitter" => Auth::id(), "problems.id" => DB::raw("best_ac_submissions.problem_id") ], "inner join lists_problems", "on", [ "lists_problems.list_id" => UOJList::info('id'), "lists_problems.problem_id" => DB::raw("problems.id"), ], ], 'cond' => '1', 'tail' => "order by id asc", 'page_len' => 50, 'post_filter' => function ($problem) { return (new UOJProblem($problem))->userCanView(Auth::user()); } ]; $pag = new Paginator($pag_config); ?>

(ID: #)

userCanManage(Auth::user())) : ?>

题单简介

queryContent()['content'] ?>
/>
/>
pagination() ?>
get(), [ 'table_attr' => [ 'class' => ['table', 'uoj-table', 'mb-0'], ], 'tr' => function ($row, $idx) { return getProblemTR($row); } ]); ?>
pagination() ?>