Файл: app/admin/shop.php
Строк: 8
<?php
if (!$user->isAuth() or $user->get()->role < 1) {
redirect('/');
exit;
}
$all = $db->prepare('SELECT * FROM `shop` ORDER BY `id` DESC');
$all -> execute([$user->get()->user_id]);
$all = $all -> fetchAll();
if(isset($_GET['del'])){
$sql = $db->prepare('delete from shop where id = ?');
$sql -> execute([Clean :: int($_GET['del'])]);
Notif :: message('Касса успешно удалена');
exit;
}
$peger = new ArrayPaginator('/admin/shop', 10);
$items = $peger->getItems($all);
echo $template->render('admin.shop',
['peger' => $peger,
'items' => $items,
'status' => ['На мoдерации','Активна','Заблокирована']
]
);