<?
$title = $l = "Удалить подарок";
$back = system :: back("{$thisLink}?id={$user['id']}", "Назад");
require (CORE."head.php");
$gift_id = (int)abs($_GET['dell_my_gift']);
$gift = DB :: $pdo -> queryFetch("SELECT * FROM `user_gifts` WHERE `id` = ? AND `id_ank` = ? LIMIT 1;", [$gift_id, $user['id']]);
if (!isset($gift) || $gift['id'] <= 0)
{
?>
<div class="list _gray _font-s _center">Подарок не найден!</div>
<?
} else {
if (isset($_POST['cfms']))
{
DB :: $pdo -> query("DELETE FROM `user_gifts` WHERE `id` = '".$gift['id']."' LIMIT 1");
system :: redirect("Подарок успешно удален.", "/gifts?id=".$user['id']."");
}
echo $back;
?>
<div class="list">
<form method="post" class="post-add" data-type="arbour" action="/gifts?id=<?echo $user['id'];?>&dell_my_gift=<?echo $gift['id'];?>">
<div class="_gray _font-s _center" style="padding: 7px;">Вы уверены, что хотите удалить этот подарок?</div>
<div class="_center" style="margin-top: 5px;">
<input type="submit" class="main-btn _w-100" name="cfms" value="Да, продолжить" />
</div>
</form>
</div>
<?
}
require (CORE."foot.php");