Файл: public_html/modules/forge/stones/delete.php
Строк: 51
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include_once ($root.'/core/base.php');
falseauth();
$header = "Удаление самоцветов";
include_once ($root.'/core/head.php');
$item = fl($_GET['item']);
$itemInfo = $db->query("SELECT * FROM `inventory` WHERE `id` = '".$item."'");
if($itemInfo->num_rows == 0) redirect('/forge/stones');
$itemInfo = $itemInfo->fetch_object();
if($itemInfo->user != $u['id']) redirect('/forge/stones');
$issetStones = $db->query("SELECT * FROM `stones_item` WHERE `item` = '".$item."'");
if($issetStones->num_rows == 0) redirect('/forge/stones/'.$item, 'Самоцветов не установлено!');
$stones_id = [null,1,2,3];
$stones_names = [null,'Камень 1','Камень 2','Камень 3'];
$stones_cost = [null,50,100,500];
$stones_buff = [null,25,50,250];
if(isset($_GET['del']))
{
$setType = fl($_GET['stone']);
if(isset($_GET['yes']))
{
$issetStone = $db->query("SELECT * FROM `stones_item` WHERE `id` = '".$setType."'");
if($issetStone->num_rows == 0) redirect('/forge/stones/'.$item.'/del');
$iS = $issetStone->fetch_object();
if($iS->item != $item) redirect('/forge/stones/'.$item.'/del');
$db->query("DELETE FROM `stones_item` WHERE `id` = '".$setType."'");
redirect('/forge/stones/'.$item.'/del', 'Самоцвет удалён!');
}
echo '<div class="b">
Вы действительно хотите удалить самоцвет?<br>
<a href="/forge/stones/'.$item.'/del/'.$setType.'/yes">Да</a> | <a href="/forge/stones/'.$item.'/del">Нет</a>
</div>';
}
while($i = $issetStones->fetch_object())
{
echo '<a class="link" href="/forge/stones/'.$item.'/del/'.$i->id.'">
<img src="/images/stones/'.$i->type.'.png" alt="k"><br>
'.$stones_names[$i->type].'<br>
Бонус: +'.$stones_buff[$i->type].' ко всем параметрам<br>
Удалить?
</a>';
}
include_once ($root.'/core/foot.php');