Файл: app/shop/index.php
Строк: 10
<?php
if (!$user->isAuth()) {
redirect('/');
exit;
}
$all = $db->prepare('SELECT * FROM `shop` WHERE `user` = ?');
$all -> execute([$user->get()->user_id]);
$all = $all -> fetchAll();
function allPay($id){
global $db;
$allPay = $db->prepare('SELECT * FROM `payments` WHERE `shop` =?');
$allPay -> execute([$id]);
$allPay = $allPay -> rowCount();
return $allPay;
}
$peger = new ArrayPaginator('/shop', 10);
$items = $peger->getItems($all);
echo $template->render('shop.index',
['peger' => $peger,
'items' => $items,
'status' => ['На мoдерации','Активна','Заблокирована']
]
);