From 323f1723599ec41478882bdccf8ee9a6e842353c Mon Sep 17 00:00:00 2001 From: Sesostris Vieira Date: Tue, 10 Jun 2014 21:42:32 -0300 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20de=20bug=20na=20barra=20de?= =?UTF-8?q?=20p=C3=A1ginas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 7ebf779..8d26655 100644 --- a/index.php +++ b/index.php @@ -170,7 +170,9 @@ if ($sort == 'timecreated') { $sql .= " ORDER BY u.{$sort}"; } -$total = $DB->count_records_sql($sql, $params + $where_params); +$sql_count = ereg_replace('SELECT(.*)FROM', 'SELECT COUNT(DISTINCT u.id) FROM', $sql); +$sql_count = ereg_replace('ORDER BY(.*)','',$sql_count); +$total = $DB->count_records_sql($sql_count, $params + $where_params); $userlist = $DB->get_records_sql($sql, $params + $where_params, $start, ILBENROL_REPORT_PAGE); if ($csv && $userlist) { // Only show CSV if there are some users