Файл: app/shop/wighet.php
Строк: 6
<?php
if (!$user->isAuth()) {
redirect('/');
exit;
}
$method = $db->prepare('SELECT * FROM `method` WHERE `id` = ?');
$method -> execute([1]);
$method = $method -> fetch(PDO :: FETCH_OBJ);
$id = Clean:: int($_GET['id']);
$shop = $db->prepare('SELECT * FROM `shop` WHERE `id` = ? and `user` = ?');
$shop -> execute([$id,$user->get()->user_id]);
$shop = $shop -> fetch(PDO :: FETCH_ASSOC);
if(!isset($shop['id'])){
header('Location: /');
exit;
}
echo $template->render('shop.wighet', ['shop' => $shop]);