Skip to content
Snippets Groups Projects
Commit ce63ab82 authored by Bitha17's avatar Bitha17
Browse files

add history pagination

parent 50e38780
Branches feat/pagination
Tags
No related merge requests found
......@@ -30,5 +30,16 @@ class PembelianController {
public function getAllPembelian(){
return $this->pembelianModel->getAllPembelian();
}
public function paginateHistory($page=1,$pagesize=10,$pembelian) {
$maxpage = ceil(count($pembelian)/$pagesize);
if ($page > $maxpage) {
$page = $maxpage;
}
$offset = $pagesize * ($page-1);
$selectedHistory = array_slice($pembelian, $offset, $pagesize);
return $selectedHistory;
}
}
?>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment