Файл: app/user/notification.php
Строк: 9
<?php
if (!$user->isAuth()) {
redirect('/');
exit;
}
$read = $db->prepare('UPDATE `users` SET `notif` = ? WHERE `user_id` = ?');
$read -> execute([0,$user->get()->user_id]);
$all = $db->prepare('SELECT * FROM `mail` WHERE `user` = ? ORDER BY `time` DESC');
$all -> execute([$user->get()->user_id]);
$all = $all -> fetchAll();
$peger = new ArrayPaginator('/notification', 10);
$items = $peger->getItems($all);
echo $template->render('user.notification',
['peger' => $peger,
'items' => $items
]
);