Файл: DARK WARS/dark_war/clans/artifacts/give.php
Строк: 22
<?php
include_once '../../start.php';
$doc = new document();
$doc->title('Отдать');
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
$doc->err('Ошибка, не выбран клан');
exit();
}
if (!isset($_GET['id_art']) || !is_numeric($_GET['id_art'])) {
$doc->err('Не выбран артефакт');
exit();
}
$id = (int)$_GET['id'];
$id_art = (int)$_GET['id_art'];
$ar = mysql_fetch_array(mysql_query("SELECT * FROM `dark_war_wshop_u` WHERE id = '$id_art' AND `id_player` = '{$player->id}' LIMIT 1"));
$us = mysql_fetch_assoc(mysql_query("SELECT * FROM `dark_war_clans_us` WHERE `id_clan`='$id' AND `id_player` = '{$player->id}' LIMIT 1"));
if (!$us && $player->admin < 2) {
$doc->err('Вы не участник клана');
exit();
}
if (!$ar['id']) {
$doc->err('Ошибка, нет такого оружия');
exit();
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `dark_war_wshop_u` WHERE `id_player` = '{$player->id}' AND `id` = '$id_art' AND `active` = '1'"),0)>0) {
$doc->err('У вас установлена вещь');
exit();
}
mysql_query("INSERT INTO `dark_war_clan_arti` (`id_clan`, `id_player`, `type`, `w`, `h`, `name`, `description`, `img`, `gold`,
`silver`, `level`, `dmg`, `armor`, `armorp`, `heal`, `mana`, `magicr`, `magicp`)
values('$id', '{$player->id}', '$ar[type]', '$ar[w]', '$ar[h]', '$ar[name]', '$ar[description]',
'$ar[img]','$ar[gold]', '$ar[silver]', '$ar[level]', '$ar[dmg]', '$ar[armor]',
'$ar[armorp]', '$ar[heal]', '$ar[mana]', '$ar[magicr]', $ar[magicp])");
mysql_query("DELETE FROM `dark_war_wshop_u` WHERE `id` = '$id_art' AND `id_player` = '{$player->id}' LIMIT 1");
$doc->msg('Вы отдали артефакт');
$doc->ret("/dark_war/clans/clan.php?id=$id", 'В клан');
$doc->ret("give_artifact.php?id=$id", 'Мои артефакты');
?>