<?php
if (!$user->isAuth()) {
redirect('/');
exit;
}
$all = $db->prepare('SELECT * FROM `history` WHERE `user` = ? ORDER BY `id` DESC');
$all -> execute([$user->get()->user_id]);
$all = $all -> fetchAll();
$peger = new ArrayPaginator('/bill', 10);
$items = $peger->getItems($all);
echo $template->render('user.bill',
['peger' => $peger,
'items' => $items,
'type' => ['Списание','Пополнение']
]
);