diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-06-19 12:40:56 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-06-19 12:40:56 +0100 |
| commit | d7c498ec1a05cbc435af8b88ce31049ea9b5516b (patch) | |
| tree | 11f7c27fa133950813f32cdcfd206acfcdd07cc4 /list_kitlocker.php | |
| parent | 343c10aeb88a84924a5fb4602dc1b20400d19d56 (diff) | |
| download | stock-d7c498ec1a05cbc435af8b88ce31049ea9b5516b.tar.gz stock-d7c498ec1a05cbc435af8b88ce31049ea9b5516b.tar.bz2 stock-d7c498ec1a05cbc435af8b88ce31049ea9b5516b.zip | |
Use BitBase::prepGetList for max_records (reads DB config, default 10)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'list_kitlocker.php')
| -rw-r--r-- | list_kitlocker.php | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/list_kitlocker.php b/list_kitlocker.php index 05313ba..b1e7a79 100644 --- a/list_kitlocker.php +++ b/list_kitlocker.php @@ -36,9 +36,10 @@ if( $stgrp ) { $groupTitle = null; } -$maxRecords = max( 1, (int)( $_REQUEST['max_records'] ?? 20 ) ); -$page = max( 1, (int)( $_REQUEST['page'] ?? 1 ) ); -$offset = ( $page - 1 ) * $maxRecords; +$listHash = $_REQUEST; +BitBase::prepGetList( $listHash ); +$maxRecords = $listHash['max_records']; +$offset = $listHash['offset']; $totalCount = (int)$gBitDb->getOne( "SELECT COUNT(*) FROM `{$X}liberty_content` lc WHERE 1=1 $whereSql", @@ -64,13 +65,8 @@ while( $row = $rs->fetchRow() ) { $items[] = $row; } -$listHash = [ - 'cant' => $totalCount, - 'max_records' => $maxRecords, - 'offset' => $offset, - 'page' => $page, - 'page_records' => count( $items ), -]; +$listHash['cant'] = $totalCount; +$listHash['page_records'] = count( $items ); if( $stgrp ) { $listHash['listInfo']['parameters']['stgrp'] = $stgrp; } |
