diff --git a/web/app/controllers/groups.php b/web/app/controllers/groups.php index c674871..067e4dc 100644 --- a/web/app/controllers/groups.php +++ b/web/app/controllers/groups.php @@ -78,7 +78,8 @@ EOD; $new_group_form->printHTML(); } }, - 'head_pagination' => true + 'head_pagination' => true, + 'pagination_table' => "`groups`" ) ); ?> diff --git a/web/app/controllers/problem_lists.php b/web/app/controllers/problem_lists.php index e5140d2..3fef911 100644 --- a/web/app/controllers/problem_lists.php +++ b/web/app/controllers/problem_lists.php @@ -99,7 +99,8 @@ EOD; 'print_after_table' => function() { global $myUser; }, - 'head_pagination' => true + 'head_pagination' => true, + 'pagination_table' => 'lists' ) ); ?> diff --git a/web/app/models/Paginator.php b/web/app/models/Paginator.php index b3566cf..4578071 100644 --- a/web/app/models/Paginator.php +++ b/web/app/models/Paginator.php @@ -16,7 +16,10 @@ class Paginator { $this->cur_start = 0; $this->table = $config['data']; } elseif (!isset($config['echo_full'])) { - $this->n_rows = DB::selectCount("select count(*) from {$config['table_name']} where {$config['cond']}"); + if (!isset($config['pagination_table'])) { + $config['pagination_table'] = $config['table']; + } + $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;