Файл: html/equip.php
Строк: 722
<?php
require_once 'system/func.php';
require_once 'system/dbc.php';
require_once 'system/header.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/functions/bablo.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/functions/wesh_snyat.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/functions/wesh_odet.php';
auth(); // Закроем от неавторизированых
//одеть/снять
if (isset($_GET['dress'])) {
//если герой зарегистрирован на турниры то кинуть в нужный турнир
if ($mc->query("SELECT * FROM `huntb_list` WHERE `user_id`='" . $user['id'] . "'")->num_rows > 0) {
$mc->query("INSERT INTO `msg` (`id_user`,`message`,`date`,`type`) VALUES ('" . $user['id'] . "','Вам нужно отказаться от дуэлей для продолжения !','" . time() . "','msg')");
?><script>/*nextshowcontemt*/showContent("/huntb/index.php");</script><?php
exit(0);
}
$infoshop1 = $mc->query("SELECT * FROM `userbag` WHERE `id`='" . $_GET['ids'] . "'")->fetch_array(MYSQLI_ASSOC);
if ($infoshop1['id_punct'] != "10" && $_GET['ids']) {
if ($_GET['dress'] == '1') {
shop_snyat($_GET['ids']);
}
if ($_GET['dress'] == '2') {
wesh_odet($_GET['ids']);
}
}
}
function age_times($secs) {
$bit = array(
' year' => floor($secs / 31556926),
' day' => $secs / 86400 % 365,
' hour' => $secs / 3600 % 24,
' minute' => $secs / 60 % 60,
' second' => $secs % 60
);
$years = 0;
$days = 0;
$hours = 0;
foreach ($bit as $k => $v) {
$str = (string) $v;
$str = strlen($str) == 1 ? "0" . $str : $str;
//года
if ($v > 0 && $k == ' year') {
if ((int) $str{strlen($str) - 1} > 4 || (int) $str{strlen($str) - 1} == 0 || (int) $str{strlen($str) - 2} > 0 && (int) $str{strlen($str) - 2} < 2) {
$years = $v;
$ret[] = $v . ' лет ';
} elseif ((int) $str{strlen($str) - 1} > 1 && (int) $str{strlen($str) - 1} < 5) {
$years = $v;
$ret[] = $v . ' года ';
} elseif ((int) $str{strlen($str) - 1} == 1) {
$years = $v;
$ret[] = $v . ' год ';
}
}
//дни
if ($v > 0 && $k == ' day') {
if ((int) $str{strlen($str) - 1} > 4 || (int) $str{strlen($str) - 1} == 0 || (int) $str{strlen($str) - 2} > 0 && (int) $str{strlen($str) - 2} < 2) {
$days = $v;
$ret[] = $v . ' дней ';
} elseif ((int) $str{strlen($str) - 1} > 1 && (int) $str{strlen($str) - 1} < 5) {
$days = $v;
$ret[] = $v . ' дня ';
} elseif ((int) $str{strlen($str) - 1} == 1) {
$days = $v;
$ret[] = $v . ' день ';
}
}
if ($v > 0 && $k == ' hour' && $years == 0) {
if ($v > 4 && $v < 21) {
$hours = $v;
$ret[] = $v . ' часов ';
} elseif ($v > 1 && $v < 5 || $v > 21) {
$hours = $v;
$ret[] = $v . ' часа ';
} elseif ((int) $str{strlen($str) - 1} == 1) {
$hours = $v;
$ret[] = $v . ' час ';
}
}
if ($v > 0 && $k == ' minute' && $years == 0 && $days == 0) {
$ret[] = $v . ' мин ';
}
if ($v > 0 && $k == ' second' && $years == 0 && $days == 0 && $hours == 0) {
$ret[] = $v . ' сек ';
}
}
return join(' ', $ret);
}
////Всё снаряжение
if (!isset($_GET['id']) && !isset($_GET['equip'])) {
$idcolc = 0;
$idPOYA = 0;
$nameor = '<font color="#706671">Оружие</font>';
$namezah = '<font color="#706671">Защита</font>';
$nameshl = '<font color="#706671">Шлем</font>';
$nameper = '<font color="#706671">Перчатки</font>';
$namedos = '<font color="#706671">Доспехи</font>';
$nameobu = '<font color="#706671">Обувь</font>';
$nameamu = '<font color="#706671">Амулет</font>';
$namekolca = ['<font color="#706671">Кольца</font>'];
$namepoya = ['<font color="#706671">Пояс</font>'];
$kv = '<font color="#706671">Для заданий </font>';
//"", "Урон", "Уворот", "Броня", "Элита"
$arr = $mc->query("SELECT `stil` FROM `userbag` WHERE `id_user` = '" . $user['id'] . "' && `id_punct` < '10' && `dress` ='1' GROUP BY `stil` ASC")->fetch_all(MYSQLI_ASSOC);
if (count($arr) == 2) {
$stil = $arr[1]['stil'];
} elseif (count($arr) == 1 && $arr[0]['stil'] != 0) {
$stil = $arr[0]['stil'];
} elseif (count($arr) < 2) {
$stil = 0;
} else {
$stil = 5;
}
$colorStyle = ["black", "green", "blue", "red", "yellow"];
$textStyle = ["", "Урон", "Уворот", "Броня", "Элита"];
$numor = $mc->query("SELECT `id_user` FROM `userbag` WHERE `id_user` = '" . $user['id'] . "' && `id_punct` = '1'")->num_rows;
$numzah = $mc->query("SELECT `id_user` FROM `userbag` WHERE `id_user` = '" . $user['id'] . "' && `id_punct` = '2'")->num_rows;
$numshl = $mc->query("SELECT `id_user` FROM `userbag` WHERE `id_user` = '" . $user['id'] . "' && `id_punct` = '3'")->num_rows;
$numper = $mc->query("SELECT `id_user` FROM `userbag` WHERE `id_user` = '" . $user['id'] . "' && `id_punct` = '4'")->num_rows;
$numdos = $mc->query("SELECT `id_user` FROM `userbag` WHERE `id_user` = '" . $user['id'] . "' && `id_punct` = '5'")->num_rows;
$numobu = $mc->query("SELECT `id_user` FROM `userbag` WHERE `id_user` = '" . $user['id'] . "' && `id_punct` = '6'")->num_rows;
$numamu = $mc->query("SELECT `id_user` FROM `userbag` WHERE `id_user` = '" . $user['id'] . "' && `id_punct` = '7'")->num_rows;
$numkolc = $mc->query("SELECT `id_user` FROM `userbag` WHERE `id_user` = '" . $user['id'] . "' && `id_punct` = '8'")->num_rows;
$numpoya = $mc->query("SELECT `id_user` FROM `userbag` WHERE `id_user` = '" . $user['id'] . "' && `id_punct` = '9'")->num_rows;
$numkv = $mc->query("SELECT `id_user` FROM `userbag` WHERE `id_user` = '" . $user['id'] . "' && `id_punct` = '10'")->num_rows;
$numbon = $mc->query("SELECT `id_user` FROM `userbag` WHERE `id_user` = '" . $user['id'] . "' && `id_punct` = '11'")->num_rows;
$equip1 = $mc->query("SELECT * FROM `userbag` WHERE `id_user` = '" . $user['id'] . "' && `id_punct` < '11' && `dress`='1'");
while ($equip = $equip1->fetch_array(MYSQLI_ASSOC)) {
$namevesh = $mc->query("SELECT * FROM `shop` WHERE `id`='" . $equip['id_shop'] . "'")->fetch_array(MYSQLI_ASSOC);
if ($namevesh['stil'] > 0) {
$namevesh['name'] = '<font style="color:' . $colorStyle[$namevesh['stil']] . ';font-weight: bold;">' . $namevesh['name'] . '</font>';
}
if ($equip['id_punct'] == 1) {
$nameor = $namevesh['name'];
}
if ($equip['id_punct'] == 2) {
$namezah = $namevesh['name'];
}
if ($equip['id_punct'] == 3) {
$nameshl = $namevesh['name'];
}
if ($equip['id_punct'] == 4) {
$nameper = $namevesh['name'];
}
if ($equip['id_punct'] == 5) {
$namedos = $namevesh['name'];
}
if ($equip['id_punct'] == 6) {
$nameobu = $namevesh['name'];
}
if ($equip['id_punct'] == 7) {
$nameamu = $namevesh['name'];
}
if ($equip['id_punct'] == 8) {
$namekolca[$idcolc] = $namevesh['name'];
$idcolc++;
}
if ($equip['id_punct'] == 9) {
$namepoya[$idPOYA] = $namevesh['name'];
$idPOYA++;
}
}
$namekolca[0] = isset($namekolca[0]) ? $namekolca[0] : "";
$namekolca[1] = isset($namekolca[1]) ? " , " . $namekolca[1] : "";
$namepoya[0] = isset($namepoya[0]) ? $namepoya[0] : "";
$namepoya[1] = isset($namepoya[1]) ? " , " . $namepoya[1] : "";
$namepoya[2] = isset($namepoya[2]) ? " , " . $namepoya[2] : "";
$namepoya[3] = isset($namepoya[3]) ? " , " . $namepoya[3] : "";
$namepoya[4] = isset($namepoya[4]) ? " , " . $namepoya[4] : "";
$namepoya[5] = isset($namepoya[5]) ? " , " . $namepoya[5] : "";
$namepoya[6] = isset($namepoya[6]) ? " , " . $namepoya[6] : "";
if ($stil > 0 && $stil < 5) {
$style = '<font style="color:' . $colorStyle[$stil] . ';font-weight: bold;">' . $textStyle[$stil] . '</font>';
} else if ($stil == 0) {
$style = 'Нет';
} else {
$style = 'Нарушен!';
}
//получение количества всех шмоток не считая для заданий и бонусов
$eqcount = $mc->query("SELECT * FROM `userbag` WHERE `id_user`='" . $user['id'] . "' AND `id_punct`>'0' AND `id_punct`<'10' ")->num_rows;
?>
Снаряжение: <?= $eqcount; ?>/<?= $user['max_bag_count']; ?>
<p>
Стиль:
<b>
<?= $style; ?>
</b>
<br>
<div class="clanturblock" onclick='showContent("/equip.php?equip=1")'><?= ico('icons', 'met.png'); ?><b>[<?= $numor; ?>]</b> <?= $nameor; ?></div>
<div class="clanturblock" onclick='showContent("/equip.php?equip=2")'><?= ico('icons', 'shits.png'); ?><b>[<?= $numzah; ?>]</b> <?= $namezah; ?></div>
<div class="clanturblock" onclick='showContent("/equip.php?equip=3")'><?= ico('icons', 'shl.png'); ?><b>[<?= $numshl; ?>]</b> <?= $nameshl; ?></div>
<div class="clanturblock" onclick="showContent('/equip.php?equip=4')"><?= ico('icons', 'perch.png'); ?><b>[<?= $numper; ?>]</b> <?= $nameper; ?></div>
<div class="clanturblock" onclick="showContent('/equip.php?equip=5')"><?= ico('icons', 'bronya.png'); ?><b>[<?= $numdos; ?>]</b> <?= $namedos; ?></div>
<div class="clanturblock" onclick="showContent('/equip.php?equip=6')"><?= ico('icons', 'boti.png'); ?><b>[<?= $numobu; ?>]</b> <?= $nameobu; ?></div>
<div class="clanturblock" onclick="showContent('/equip.php?equip=7')"><?= ico('icons', 'amul.png'); ?><b>[<?= $numamu; ?>]</b> <?= $nameamu; ?></div>
<div class="clanturblock" onclick="showContent('/equip.php?equip=8')"><?= ico('icons', 'colc.png'); ?><b>[<?= $numkolc; ?>]</b> <?= $namekolca[0] . $namekolca[1]; ?></div>
<div class="clanturblock" onclick="showContent('/equip.php?equip=9')"><?= ico('icons', 'zel.png'); ?><b>[<?= $numpoya; ?>]</b>
<?php
for ($ipoya = 0; $ipoya < count($namepoya); $ipoya++) {
if (isset($namepoya[$ipoya])) {
echo $namepoya[$ipoya];
}
}
?>
</div>
<div class="clanturblock" onclick="showContent('/equip.php?equip=10')"><?= ico('icons', 'sunduk.png'); ?><b>[<?= $numkv; ?>]</b> Для заданий </div>
<?php if ($user['access'] > 3) { ?>
<div class="clanturblock" onclick="showContent('/equip.php?equip=11')"><?= ico('icons', 'sunduk.png'); ?><b>[<?= $numbon; ?>]</b> Бонусы</div>
<?php } ?>
<?php
$footval = "equip";
require_once ('system/foot/foot.php');
}
//все оружия в этой категории
if (!isset($_GET['id']) && isset($_GET['equip']) && $_GET['equip'] > 0) {
$colorStyle = ["black", "green", "blue", "red", "yellow"];
//$textStyle = ["", "Моща", "Прыг", "Танк", "Цари"];
$textStyle = ["", "Урон", "Уворот", "Броня", "Элита"];
//если ломится в раздел где бонусные шмотки то в снаряжение отправить
if ($_GET['equip'] > 10 && $user['access'] < 4) {
?><script>showContent("/equip.php");</script><?php
exit(0);
}
?>
<script>
MyLib.restore = 1;
</script>
<table style="font-size: 16px;padding-left: 2px;padding-right: 2px;width: 100%;margin: auto;text-align: center;">
<tr>
<td onclick="eqsort1(this);" class="shopminiblock sort1 allminia" style="width: 30%;">Все</td>
<td onclick="eqsort2(this);" class="shopminiblock sort2 allminia" style="width: 30%;">Доступн.</td>
<td onclick="eqsort3(this);" class="shopminiblock sort3 allminia" style="width: 30%;">Мой ур.</td>
</tr>
</table>
<table style="font-size: 16px;padding-left: 2px;padding-right: 2px;width: 100%;margin: auto;text-align: center;">
<tr>
<td onclick="eqsortStyle(this);" class="shopminiblock sortStyle" value="0" style="color: grey">Нет</td>
<td onclick="eqsortStyle(this);" class="shopminiblock sortStyle" value="1" style="color: green">Урон</td>
<td onclick="eqsortStyle(this);" class="shopminiblock sortStyle" value="2" style="color: blue">Уворот</td>
<td onclick="eqsortStyle(this);" class="shopminiblock sortStyle" value="3" style="color: red">Броня</td>
<td onclick="eqsortStyle(this);" class="shopminiblock sortStyle" value="4" style="color: yellow">Элита</td>
<td onclick="eqsortStyle(this);" class="shopminiblock sortStyle" value="5" style="color: grey">Все</td>
</tr>
</table>
<script>
MyLib.userLevel = <?= $user['level']; ?>;
MyLib.userMoney = <?= $user['money']; ?>;
MyLib.userPlatina = <?= $user['platinum']; ?>;
MyLib.setTimeid[400] = setTimeout(function () {
$(".allminia:eq(" + MyLib.ticks + ")").click();
$(".sortStyle:eq(" + MyLib.style + ")").click();
}, 200);
if (typeof (eqsort1) != "function") {
eqsort1 = function (elem) {
$(".shopminiblock").css({fontWeight: "normal", fontSize: "16px", textDecoration: "none"});
$(elem).css({fontWeight: "bold", fontSize: "14px", textDecoration: "underline"});
$(".shopblock0").each(function () {
$(this).show();
});
MyLib.ticks = 0;
};
}
if (typeof (eqsort2) != "function") {
eqsort2 = function (elem) {
$(".shopminiblock").css({fontWeight: "normal", fontSize: "16px", textDecoration: "none"});
$(elem).css({fontWeight: "bold", fontSize: "14px", textDecoration: "underline"});
$(".shopblock0").each(function () {
$(this).attr("money") <= MyLib.userMoney && $(this).attr("platina") <= MyLib.userPlatina && $(this).attr("level") <= MyLib.userLevel ? $(this).show() : $(this).hide();
});
MyLib.ticks = 1;
};
}
if (typeof (eqsort3) != "function") {
eqsort3 = function (elem) {
$(".shopminiblock").css({fontWeight: "normal", fontSize: "16px", textDecoration: "none"});
$(elem).css({fontWeight: "bold", fontSize: "14px", textDecoration: "underline"});
$(".shopblock0").each(function () {
$(this).attr("level") != MyLib.userLevel ? $(this).hide() : $(this).show();
});
MyLib.ticks = 2;
};
}
if (typeof (eqsortStyle) != "function") {
eqsortStyle = function (elem) {
$(".sortStyle").css({fontWeight: "normal", fontSize: "16px", textDecoration: "none"});
$(elem).css({fontWeight: "bold", fontSize: "14px", textDecoration: "underline"});
MyLib.style = $(elem).attr("value");
if (MyLib.ticks == 0) {
$(".shopblock0").each(function () {
$(this).attr("stail") == MyLib.style || MyLib.style == 5 ? $(this).show() : $(this).hide();
});
}
if (MyLib.ticks == 1) {
$(".shopblock0").each(function () {
$(this).attr("stail") == MyLib.style && $(this).attr("money") <= MyLib.userMoney && $(this).attr("platina") <= MyLib.userPlatina && $(this).attr("level") <= MyLib.userLevel ||
MyLib.style == 5 && $(this).attr("money") <= MyLib.userMoney && $(this).attr("platina") <= MyLib.userPlatina && $(this).attr("level") <= MyLib.userLevel ? $(this).show() : $(this).hide();
});
}
if (MyLib.ticks == 2) {
$(".shopblock0").each(function () {
$(this).attr("stail") == MyLib.style && $(this).attr("level") == MyLib.userLevel || MyLib.style == 5 && $(this).attr("level") == MyLib.userLevel ? $(this).show() : $(this).hide();
});
}
};
}
</script>
<?php
$allequip1 = $mc->query("SELECT * FROM `userbag` WHERE `id_user`='" . $user['id'] . "' AND `id_punct`='" . $_GET['equip'] . "' AND `dress` ='1' ORDER BY `userbag`.`dress` DESC,`userbag`.`id` DESC");
while ($allequip = $allequip1->fetch_array(MYSQLI_ASSOC)) {
$veshn = $mc->query("SELECT * FROM `shop` WHERE `id`='" . $allequip['id_shop'] . "'")->fetch_array(MYSQLI_ASSOC);
?>
<div class="shops equipblockodet" style="width: 96%;margin: auto;padding-top: 10px;padding-bottom: 10px;">
<a onclick="MyLib.save = 1;showContent('/equip.php?id=<?= $allequip['id']; ?>&equip=<?= $_GET['equip']; ?>')">
<table class="table_block2">
<tr>
<td style="width: 90px;">
<div class="shopicobg shopico<?= $veshn['id_image']; ?>">
</div>
</td>
<td>
<table class="table_block2">
<tr>
<td><?= $veshn['name']; ?></td>
</tr>
<tr>
<td>
<?php
if ($veshn['stil'] > 0) {
echo '<font style="color:' . $colorStyle[$veshn['stil']] . ';font-weight: bold;">' . $textStyle[$veshn['stil']] . '</font>';
}
?>
</td>
</tr>
<?php if ($veshn['koll'] > -1) { ?>
<tr>
<td>Количество: <?= $allequip['koll'] . '/' . $veshn['koll']; ?></td>
</tr>
<?php } if ($veshn['iznos'] > -1) { ?>
<tr>
<td>Износ: <?= $allequip['iznos'] . '/' . $veshn['iznos']; ?></td>
</tr>
<?php } ?>
<tr>
<td>
<b>одето</b>
</td>
</tr>
</table>
</td>
</tr>
</table>
</a>
</div>
<?php } ?>
<hr>
<?php
//не одетые
$allequip = $mc->query("SELECT COUNT(*),`id_shop`,`id`,`koll`,`iznos` FROM `userbag` WHERE `id_user`='" . $user['id'] . "' AND `id_punct`='" . $_GET['equip'] . "' AND `dress` ='0' GROUP BY `id_shop`,`iznos`,`koll`")->fetch_all(MYSQLI_ASSOC);
for ($i = 0; $i < count($allequip); $i++) {
$veshn = $mc->query("SELECT * FROM `shop` WHERE `id`='" . $allequip[$i]['id_shop'] . "'")->fetch_array(MYSQLI_ASSOC);
?>
<div class="shopblock0"
level="<?= $veshn['level']; ?>"
money="<?= $veshn['money']; ?>"
platina="<?= $veshn['platinum']; ?>"
stail="<?= $veshn['stil']; ?>">
<div class="shops" style="width: 96%;margin: auto;padding-top: 10px;padding-bottom: 10px;">
<a onclick="MyLib.save = 1;showContent('/equip.php?id=<?= $allequip[$i]['id']; ?>&equip=<?= $_GET['equip']; ?>')">
<table class="table_block2">
<tr>
<td style="width: 90px;">
<div class="shopicobg shopico<?= $veshn['id_image']; ?>">
</div>
</td>
<td>
<table class="table_block2">
<tr>
<td><?= $veshn['name'] . ($allequip[$i]['COUNT(*)'] > 1 ? " (" . $allequip[$i]['COUNT(*)'] . ")" : ""); ?></td>
</tr>
<tr>
<td>
<?php
if ($veshn['stil'] > 0) {
echo '<font style="color:' . $colorStyle[$veshn['stil']] . ';font-weight: bold;">' . $textStyle[$veshn['stil']] . '</font>';
}
?>
</td>
</tr>
<?php if ($veshn['koll'] > -1) { ?>
<tr>
<td>Количество: <?= $allequip[$i]['koll'] . '/' . $veshn['koll']; ?></td>
</tr>
<?php } if ($veshn['iznos'] > -1) { ?>
<tr>
<td>Износ: <?= $allequip[$i]['iznos'] . '/' . $veshn['iznos']; ?></td>
</tr>
<?php } ?>
</table>
</td>
</tr>
</table>
</a>
</div>
<hr>
</div>
<?php
}
$footval = "equip1";
require_once ('system/foot/foot.php');
}
///конкретная одежда
if (isset($_GET['id']) && isset($_GET['equip'])) {
//если ломится в раздел где бонусные шмотки то в снаряжение отправить
if ($_GET['equip'] == 11 && $user['access'] < 4) {
?><script>showContent("/equip.php");</script><?php
exit(0);
}
$allequip1 = $mc->query("SELECT * FROM `userbag` WHERE `id_user`=" . $user['id'] . " AND `id`=" . $_GET['id'] . "")->fetch_array(MYSQLI_ASSOC);
if ($allequip1['id_shop'] != '') {
//если все норм
$shopmagazin = $mc->query("SELECT * FROM `shop` WHERE `id`='" . $allequip1['id_shop'] . "'")->fetch_array(MYSQLI_ASSOC);
?>
<center style="padding-top: 3px;padding-bottom: 3px;text-align: center;">
<b>
<?php
if ($allequip1['id_punct']) {
echo $shopmagazin['name'];
}
?>
</b>
</center>
<center>
<?php if ($allequip1['dress'] == 1 && $allequip1['id_punct'] < '10' && $allequip1['iznos'] == 0) { ?>
<?php } else if ($allequip1['dress'] == 1 && $allequip1['id_punct'] < '10') { ?>
<div style="padding-top: 3px;padding-bottom: 3px;text-align: center;">
<a onclick="showContent('/equip.php?ids=<?= $_GET['id']; ?>&dress=1&equip=<?= $_GET['equip']; ?>')" style="text-decoration: underline;">
<b>снять</b>
</a>
</div>
<?php } else { ?>
<?php if ($shopmagazin['level'] <= $user['level'] && $allequip1['id_punct'] < '10' && $allequip1['iznos'] == 0) { ?>
<?php } else if ($shopmagazin['level'] <= $user['level'] && $allequip1['id_punct'] < '10') { ?>
<div style="padding-top: 3px;padding-bottom: 3px;text-align: center;">
<a onclick="showContent('/equip.php?ids=<?= $_GET['id']; ?>&dress=2&equip=<?= $_GET['equip']; ?>')" style="text-decoration: underline;">
<b>одеть</b>
</a>
</div>
<?php } ?>
<?php } ?>
</center>
<?php
$ipunct = 'shopicobg';
?>
<table class="table_block2" style="width: 98%;">
<tr>
<td style="width: 90px;">
<?php if ($allequip1['id_punct']) { ?>
<div class="<?= $ipunct . ' shopico' . $shopmagazin['id_image']; ?>"></div>
<?php } else { ?>
<div class="<?= $ipunct . ' shopico56'; ?>"></div>
<?php } ?>
</td>
<td style="display: unset;">
<?php
if ($allequip1['id_punct']) {
echo $shopmagazin['opisanie'];
}
?>
</td>
</tr>
</table>
<?php
if ($allequip1['id_punct']) {
if ($shopmagazin['health'] < 0) {
$maghealth = '';
} else {
$maghealth = '+';
}
if ($shopmagazin['strength'] < 0) {
$magstrength = '';
} else {
$magstrength = '+';
}
if ($shopmagazin['toch'] < 0) {
$magtoch = '';
} else {
$magtoch = '+';
}
if ($shopmagazin['lov'] < 0) {
$maglov = '';
} else {
$maglov = '+';
}
if ($shopmagazin['kd'] < 0) {
$magkd = '';
} else {
$magkd = '+';
}
if ($shopmagazin['block'] < 0) {
$magblock = '';
} else {
$magblock = '+';
}
if ($shopmagazin['bron'] < 0) {
$magbron = '';
} else {
$magbron = '+';
}
$nameeffects = "";
if (isset($shopmagazin['nameeffects'])) {
$effects = explode("|", $shopmagazin['nameeffects']);
for ($i = 0; count($effects) > $i; $i++) {
if ($effects[$i] != "")
$nameeffects .= "<b style='padding-top: 3px;padding-bottom: 3px;'>" . $effects[$i] . "</b><br>";
}
}
$neeww = "";
str_replace('red', $shopmagazin['name'], $neeww);
?>
<table class="table_block2" style="width: 96%;">
<tr>
<td style="padding-top: 3px;padding-bottom: 3px;">
<?php
if ($shopmagazin['stil'] > 0) {
$colorStyle = ["black", "green", "blue", "red", "yellow"];
//$textStyle = ["", "Моща", "Прыг", "Танк", "Цари"];
$textStyle = ["", "Урон", "Уворот", "Броня", "Элита"];
echo '<font style="color:' . $colorStyle[$shopmagazin['stil']] . ';font-weight: bold;">' . $textStyle[$shopmagazin['stil']] . '</font><br>';
}
?>
</td>
</tr>
</table>
<table class="table_block2" style="width: 96%;">
<tr>
<td style="width:100px;padding-top: 3px;padding-bottom: 3px;">
Уровень:
</td>
<td>
<img src="/img/img23.png" width="16px">
<?= $shopmagazin['level']; ?>
</td>
</tr>
<tr>
<td style="width:100px;padding-top: 3px;padding-bottom: 3px;">
Цена:
</td>
<td>
<?php
if ($allequip1['id_punct']) {
$zolo = money($shopmagazin['money'], "zoloto");
$med = money($shopmagazin['money'], "med");
$serebro = money($shopmagazin['money'], "serebro");
$platinum = $shopmagazin['platinum'];
if ($platinum > 0) {
?>
<img src="/images/icons/plata.png" width="16px">
<?= $platinum; ?>
<?php }if ($zolo > 0) { ?>
<img src="/images/icons/zoloto.png" width="16px">
<?= $zolo; ?>
<?php }if ($serebro > 0) { ?>
<img src="/images/icons/serebro.png" width="16px">
<?= $serebro; ?>
<?php }if ($med > 0) { ?>
<img src="/images/icons/med.png" width="16px">
<?= $med; ?>
<?php
}
}
?>
</td>
</tr>
<?php if ($shopmagazin['koll'] > -1) { ?>
<tr>
<td style="width:100px;padding-top: 3px;padding-bottom: 3px;">
Количество:
</td>
<td>
<?= $allequip1['koll'] . '/' . $shopmagazin['koll']; ?>
</td>
</tr>
<?php }if ($shopmagazin['iznos'] > -1) { ?>
<tr>
<td style="width:100px;padding-top: 3px;padding-bottom: 3px;">Износ:</td>
<td><?= $allequip1['iznos'] . '/' . $shopmagazin['iznos']; ?></td>
</tr>
<?php }if ($allequip1['time_end'] > 0) { ?>
<tr>
<td style="width:100px;padding-top: 3px;padding-bottom: 3px;">Годность время:</td>
<td><?= $allequip1['time_end'] - time() > 0 ? age_times($allequip1['time_end'] - time()) : "Закончилось"; ?></td>
</tr>
<?php } if ($shopmagazin['toch'] != 0) { ?>
<tr>
<td style="width:100px;padding-top: 3px;padding-bottom: 3px;">Точность:</td>
<td>
<?= ico('icons', 'toch.png') . " " . $magtoch . $shopmagazin['toch']; ?>
</td>
</tr>
<?php }if ($shopmagazin['strength'] != 0) { ?>
<tr>
<td style="width:100px;padding-top: 3px;padding-bottom: 3px;">Урон:</td>
<td>
<?= ico('icons', 'power.jpg') . " " . $magstrength . $shopmagazin['strength']; ?>
</td>
</tr>
<?php }if ($shopmagazin['block'] != 0) { ?>
<tr>
<td style="width:100px;padding-top: 3px;padding-bottom: 3px;">Блок:</td>
<td>
<?= ico('icons', 'shit.png') . " " . $magblock . $shopmagazin['block']; ?>
</td>
</tr>
<?php } if ($shopmagazin['kd'] != 0) { ?>
<tr>
<td style="width:100px;padding-top: 3px;padding-bottom: 3px;">Оглушение:</td>
<td>
<?= ico('icons', 'kd.png') . " " . $magkd . $shopmagazin['kd']; ?>
</td>
</tr>
<?php }if ($shopmagazin['lov'] != 0) { ?>
<tr>
<td style="width:100px;padding-top: 3px;padding-bottom: 3px;">Уворот:</td>
<td>
<?= ico('icons', 'img235.png') . " " . $maglov . $shopmagazin['lov']; ?>
</td>
</tr>
<?php }if ($shopmagazin['bron'] != 0) { ?>
<tr>
<td style="width:100px;padding-top: 3px;padding-bottom: 3px;">Броня:</td>
<td>
<?= ico('icons', 'bron.png') . " " . $magbron . $shopmagazin['bron']; ?>
</td>
</tr>
<?php }if ($shopmagazin['health'] != 0) { ?>
<tr>
<td style="width:100px;padding-top: 3px;padding-bottom: 3px;">Здоровье:</td>
<td>
<?= ico('icons', 'hp.png') . " " . $maghealth . $shopmagazin['health']; ?>
</td>
</tr>
<?php } ?>
</table>
<table class="table_block2" style="width: 96%;">
<tr>
<td style="width:100%;padding-top: 3px;padding-bottom: 3px;">
<?= $nameeffects; ?>
</td>
</tr>
</table>
<?php } ?>
<br>
<table class="table_block2" style="width: 96%;">
<tr>
<td style="width:20px;"></td>
<?php if ($allequip1['dress'] == 1 && $allequip1['id_punct'] < "10" && $allequip1['iznos'] == 0) { ?>
<?php } else if ($allequip1['dress'] == 1 && $allequip1['id_punct'] < "10") { ?>
<td>
<a onclick="showContent('/equip.php?ids=<?= $_GET['id']; ?>&dress=1&equip=<?= $_GET['equip']; ?>')" style="text-decoration: underline;">
<span style="color:#642F00"><b>снять</b></span>
</a>
</td>
<?php } else { ?>
<?php if ($shopmagazin['level'] <= $user['level'] && $allequip1['id_punct'] < "10" && $allequip1['iznos'] == 0) { ?>
<td>
<span style="color:#642F00"><b>Требуется ремонт</b></span>
</td>
<?php } else if ($shopmagazin['level'] <= $user['level'] && $allequip1['id_punct'] < "10") { ?>
<td>
<a onclick="showContent('/equip.php?ids=<?= $_GET['id']; ?>&dress=2&equip=<?= $_GET['equip']; ?>')" style="text-decoration: underline;">
<span style="color:#642F00"><b>одеть</b></span>
</a>
</td>
<?php } ?>
<?php } ?>
</tr>
</table>
<br>
<?php if ($user['access'] > 2) { ?>
<b>ID вещи: <?= $shopmagazin['id']; ?></b>
<div><a onclick="showContent('/admin/shop.php?shop=edit&id=<?= $shopmagazin['id']; ?>')">Изменить (Админ)</a></div>
<?php
}
} else {
?><script>showContent("/equip.php");</script><?php
}
$footval = "equip2";
require_once ('system/foot/foot.php');
}
?>