Compare commits

..

No commits in common. "0ab54aac78154d4379a04b364aad6663d298ef1b" and "52dfec62cdd8ce22f3c7e5efa2e690f4c670b9e1" have entirely different histories.

2 changed files with 11 additions and 13 deletions

View File

@ -127,17 +127,16 @@
$ac_problems = DB::selectAll("select a.problem_id as problem_id, b.title as title from best_ac_submissions a inner join problems b on a.problem_id = b.id where submitter = '{$user['username']}';");
?>
<h4 class="list-group-item-heading"><?= UOJLocale::get('accepted problems').''.UOJLocale::get('n problems in total', count($ac_problems))?> </h4>
<ul class="list-group-item-text nav">
<div class="list-group-item-text">
<?php
foreach ($ac_problems as $problem) {
echo '<li><a href="/problem/', $problem['problem_id'], '" role="button" class="btn btn-light mr-1 mb-1" style="width: 12rem;">#', $problem['problem_id'], '. ', $problem['title'], '</a></li>';
}
if (empty($ac_problems)) {
echo UOJLocale::get('none');
}
foreach ($ac_problems as $problem) {
echo '<a href="/problem/', $problem['problem_id'], '" role="button" class="btn btn-light mr-1">#', $problem['problem_id'], '. ', $problem['title'], '</a>';
}
if (empty($ac_problems)) {
echo UOJLocale::get('none');
}
?>
</ul>
</div>
</div>
</div>
</div>

View File

@ -16,11 +16,10 @@ class Paginator {
$this->cur_start = 0;
$this->table = $config['data'];
} elseif (!isset($config['echo_full'])) {
$table = $config['table_name'];
if (isset($config['pagination_table'])) {
$table = $config['pagination_table'];
if (!isset($config['pagination_table'])) {
$config['pagination_table'] = $config['table'];
}
$this->n_rows = DB::selectCount("select count(*) from {$table} where {$config['cond']}");
$this->n_rows = DB::selectCount("select count(*) from {$config['pagination_table']} where {$config['cond']}");
$this->page_len = isset($config['page_len']) ? $config['page_len'] : 10;