Убран неиспользуемый код. Убраны deprecated элементы.

This commit is contained in:
lopar 2018-06-23 00:31:23 +03:00
parent a231f97691
commit ac5acc661d
2 changed files with 34 additions and 284 deletions

View File

@ -2890,6 +2890,7 @@ function show_shop_items($it, $from = 'shop')
*/ */
function showitem($row, $type = 0, $returned = false) function showitem($row, $type = 0, $returned = false)
{ {
// Type 10 - нашлось в улучшениях атефактов.
global $user, $runes_exp; global $user, $runes_exp;
$returnHTML = ''; $returnHTML = '';
if ((($row['maxdur'] <= ($row['duration'])) || ($row['dategoden'] && $row['dategoden'] <= time()))) { if ((($row['maxdur'] <= ($row['duration'])) || ($row['dategoden'] && $row['dategoden'] <= time()))) {

View File

@ -7,89 +7,32 @@ if ($user['room'] != 50) {
header("Location: main.php"); header("Location: main.php");
die(); die();
} }
$itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0', $user['id'])->fetch_assoc();
if ($user['battle'] != 0) { if ($user['battle'] != 0) {
header('location: fbattle.php'); header('location: fbattle.php');
die(); die();
} }
//$_GET['otdel'] = 1;
if (isset($_GET['up'])) { if (isset($_GET['up'])) {
$ids = $_GET['up']; $ids = $_GET['up'];
$cur = mysql_fetch_assoc(mysql_query("SELECT `id`,`name`,`nlevel` FROM `inventory` WHERE `owner`='" . $user['id'] . "' AND `id`='" . $ids . "' AND `artefact`='1'")); $cur = db::c()->query('SELECT `id`,`name`,`nlevel` FROM `inventory` WHERE `owner` = ?i AND `id`= ?i AND `artefact`=1', $user['id'], $ids)->fetch_assoc();
if ($cur['id']) { if ($cur['id']) {
$up_level = $cur['nlevel'] + 1; $up_level = $cur['nlevel'] + 1;
$cur_up = mysql_fetch_assoc(mysql_query("SELECT * FROM `ashop_up` WHERE `name`='" . $cur['name'] . "' AND `level_up`='" . $up_level . "'")); $cur_up = db::c()->query('SELECT * FROM `ashop_up` WHERE `name` = "?s" AND `level_up` = ?i', $cur['name'], $up_level)->fetch_assoc();
if ($cur_up['id']) { if ($cur_up['id']) {
mysql_query("UPDATE `inventory` SET `upgrade`='" . $cur_up['level_up'] . "',`nlevel`='" . $cur_up['level_up'] . "',`minu`='" . $cur_up['minu'] . "',`maxu`='" . $cur_up['maxu'] . "',`gsila`='" . $cur_up['gsila'] . "',`glovk`='" . $cur_up['glovk'] . "',`ginta`='" . $cur_up['ginta'] . "',`gintel`='" . $cur_up['gintel'] . "',`ghp`='" . $cur_up['ghp'] . "',`mfkrit`='" . $cur_up['mfkrit'] . "',`mfakrit`='" . $cur_up['mfakrit'] . "',`mfuvorot`='" . $cur_up['mfuvorot'] . "',`mfauvorot`='" . $cur_up['mfauvorot'] . "',`gnoj`='" . $cur_up['gnoj'] . "',`gtopor`='" . $cur_up['gtopor'] . "',`gdubina`='" . $cur_up['gdubina'] . "',`gmech`='" . $cur_up['gmech'] . "',`bron1`='" . $cur_up['bron1'] . "',`bron2`='" . $cur_up['bron2'] . "',`bron3`='" . $cur_up['bron3'] . "',`bron4`='" . $cur_up['bron4'] . "' WHERE `owner`='" . $user['id'] . "' AND `id`='" . $cur['id'] . "'"); //mysql_query("UPDATE `inventory` SET `upgrade`='" . $cur_up['level_up'] . "',`nlevel`='" . $cur_up['level_up'] . "',`minu`='" . $cur_up['minu'] . "',`maxu`='" . $cur_up['maxu'] . "',`gsila`='" . $cur_up['gsila'] . "',`glovk`='" . $cur_up['glovk'] . "',`ginta`='" . $cur_up['ginta'] . "',`gintel`='" . $cur_up['gintel'] . "',`ghp`='" . $cur_up['ghp'] . "',`mfkrit`='" . $cur_up['mfkrit'] . "',`mfakrit`='" . $cur_up['mfakrit'] . "',`mfuvorot`='" . $cur_up['mfuvorot'] . "',`mfauvorot`='" . $cur_up['mfauvorot'] . "',`gnoj`='" . $cur_up['gnoj'] . "',`gtopor`='" . $cur_up['gtopor'] . "',`gdubina`='" . $cur_up['gdubina'] . "',`gmech`='" . $cur_up['gmech'] . "',`bron1`='" . $cur_up['bron1'] . "',`bron2`='" . $cur_up['bron2'] . "',`bron3`='" . $cur_up['bron3'] . "',`bron4`='" . $cur_up['bron4'] . "' WHERE `owner`='" . $user['id'] . "' AND `id`='" . $cur['id'] . "'");
echo "<font color=green><b>Артефакт успешно улучшен!</b></font>"; err('Услуга недоступна!');
//echo "<font color=green><b>Артефакт успешно улучшен!</b></font>";
} else { } else {
echo "<font color=red><b>Эта вещь дальше не улучшается!</b></font>"; err('Артефакт достиг максимального уровня!');
} }
} }
} }
$itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0', $user['id'])->fetch_assoc();
$bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id`=?i', $_SESSION['uid'])->fetch_assoc(); $bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id`=?i', $_SESSION['uid'])->fetch_assoc();
$artefactsList = db::c()->query('SELECT * FROM `inventory` WHERE `owner`=?i AND `artefact`=1', $user['id']);
if (isset($_GET['set']) OR isset($_POST['set'])) {
$set = empty($_GET['set']) ?: $_GET['set'];
$set = empty($_POST['set']) ?: $_POST['set'];
$count = isset($_POST['count']) && is_numeric($_POST['count']) ? $_POST['count'] : 0;
if ($count < 1) {
$count = 0;
$count_ok = 0;
} else $count_ok = 1;
$dress = db::c()->query('SELECT * FROM `ashop` WHERE `id`=?i', $set)->fetch_assoc();
if ($count_ok == 0) {
err('Неправильно введено количество.');
} elseif (($dress['massa'] * $_POST['count'] + $itemWeight['m']) > (get_meshok())) {
err('Недостаточно места в рюкзаке.');
} elseif ($count_ok == 1 && ($bank['ekr'] >= ($dress['ecost'] * $_POST['count'])) && ($dress['count'] >= $_POST['count'])) {
for ($k = 1; $k <= $_POST['count']; $k++) {
if (mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`,
`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`,
`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`)
VALUES
('{$dress['id']}','{$_SESSION['uid']}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}',
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}');")) {
$good = 1;
} else {
$good = 0;
}
}
if ($good) {
mysql_query("UPDATE `ashop` SET `count`=`count`-" . $_POST['count'] . " WHERE `id`='" . $set . "' LIMIT 1;");
$limit = $_POST['count'];
$invdb = mysql_query("SELECT `id` FROM `inventory` WHERE `name` = '" . $dress['name'] . "' ORDER BY `id` DESC LIMIT " . $limit . ";");
if ($limit == 1) {
$dressinv = mysql_fetch_array($invdb);
$dressid = "cap" . $dressinv['id'];
$dresscount = " ";
} else {
$dressid = "";
while ($dressinv = mysql_fetch_array($invdb)) {
$dressid .= "cap" . $dressinv['id'] . ",";
}
$dresscount = "(x" . $_POST['count'] . ") ";
}
$allcost = $_POST['count'] * $dress['ecost'];
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','\"" . $user['login'] . "\" купил товар: \"" . $dress['name'] . "\" " . $dresscount . "id:(" . $dressid . ") [0/" . $dress['maxdur'] . "] за " . $allcost . " екр. ',1,'" . time() . "');");
echo "<font color=red><b>Вы купили {$_POST['count']} шт. \"{$dress['name']}\".</b></font>";
mysql_query("UPDATE `bank` SET `ekr`=`ekr`-'" . ($allcost) . "' WHERE `id`='" . $_SESSION['bankid'] . "';");
$bank['ekr'] -= $allcost;
}
} else {
echo "<font color=red><b>Недостаточно денег или нет вещей в наличии.</b></font>";
}
}
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@ -98,229 +41,35 @@ if (isset($_GET['set']) OR isset($_POST['set'])) {
<link href="css/main.css" rel="stylesheet"/> <link href="css/main.css" rel="stylesheet"/>
</head> </head>
<body> <body>
<h1>Магазин Берёзка</h1> Зал улучшения артефактов. <h1>Магазин Берёзка</h1>
<a href="ashop.php"> выйти на Центральную площадь</a> <div style="text-align: center">Зал улучшения артефактов.</div>
<table border=0 width=100% cellspacing="0" cellpadding="4"> <table border=0 width=100% cellspacing="0" cellpadding="4">
<tr> <tr>
<form method=POST action="ashop.php"> <td valign=top align=left>
<input type="hidden" name="sid" value=""> <table border=0 width=100% cellspacing="1" cellpadding="2" bgcolor="#A5A5A5">
<input type="hidden" name="id" value="1"> <?php
<td valign=top align=left> while ($row = $artefactsList->fetch_assoc()) {
<!--Магазин--> if ($i == 0) {
<table border=0 width=100% cellspacing="0" cellpadding="0" <? if (!$_REQUEST['present']) { $i = 1;
echo 'bgcolor="#A5A5A5"'; $color = '#C7C7C7';
} ?>> } else {
<tr> $i = 0;
<td align=center><b> $color = '#D5D5D5';
<? }
if ($_REQUEST['compare'] && !$_REQUEST['common'] && !$_REQUEST['present']) { showitem($row, 10);
echo "Составление подарочного букета"; }
} elseif ($_REQUEST['present']) { ?>
//echo "Составление подарочного букета"; </table>
} else { </td>
switch ($_GET['otdel']) { <td valign=top width=280>
case null: <b>Масса всех ваших вещей: <?=$itemWeight['m']?>/<?= get_meshok() ?>
echo "Оружие: кастеты,ножи"; <br>У вас в наличии: <span style="color: #339900;"><?= $bank['ekr'] ?></span> екр.</b>
$_GET['otdel'] = 1; <hr>
break; <a href=ashop.php>Магазин Берёзка</a>
case 1: <hr>
echo "Оружие: кастеты,ножи"; </td>
break;
case 11:
echo "Оружие: топоры";
break;
case 12:
echo "Оружие: дубины,булавы";
break;
case 13:
echo "Оружие: мечи";
break;
case 14:
echo "Оружие: луки и арбалеты";
break;
case 2:
echo "Одежда: сапоги";
break;
case 21:
echo "Одежда: перчатки";
break;
case 22:
echo "&Одежда: легкая броня";
break;
case 23:
echo "Одежда: тяжелая броня";
break;
case 24:
echo "Одежда: шлемы";
break;
case 3:
echo "Щиты";
break;
case 4:
echo "Ювелирные товары: серьги";
break;
case 41:
echo "Ювелирные товары: ожерелья";
break;
case 42:
echo "Ювелирные товары: кольца";
break;
case 5:
echo "Заклинания: нейтральные";
break;
case 51:
echo "Заклинания: боевые и защитные";
break;
case 6:
echo "Амуниция";
break;
case 7:
echo "Букеты";
break;
}
}
?>
</b></td>
</tr>
<tr>
<td><!--Рюкзак-->
<table border=0 width=100% cellspacing="1" cellpadding="2" bgcolor="#A5A5A5">
<?
if ($_REQUEST['present']) {
if ($_POST['to_login'] && $_POST['flower']) {
$to = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `login`='" . $_POST['to_login'] . "' LIMIT 1;"));
if ($_POST['to_login'] == $user['login']) {
echo "<b><font color=red>Очень щедро дарить что-то самому себе ;)</font></b>";
} elseif ($to['room'] > 500 && $to['room'] < 561) {
echo "<b><font color=red>Персонаж в данный момент участвует в турнире в Башне Смерти. Попробуйте позже.</font></b>";
} else {
if ($_POST['from'] == 1) {
$from = 'Аноним';
} elseif ($_POST['from'] == 2 && $user['klan']) {
$from = ' клана ' . $user['klan'];
} else {
$from = $user['login'];
}
if ($to) if (mysql_query("UPDATE `inventory` SET `owner`='" . $to['id'] . "', `present`='" . $from . "', `letter`='" . $_POST['podarok2'] . "' WHERE `present`='' AND `id`='" . $_POST['flower'] . "' AND `owner`='" . $_SESSION['uid'] . "' AND `dressed`=0 AND `setsale`=0;")) {
$res = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `id` = '" . $_POST['flower'] . "' LIMIT 1;"));
$buket_name = $res['name'];
mysql_query("INSERT INTO `delo`(`id`,`author`,`pers`,`text`,`type`,`date`) VALUES ('','0','" . $_SESSION['uid'] . "','Подарен предмет \"" . $res['name'] . "\" id:(cap" . $res['id'] . ") [" . $res['duration'] . "/" . $res['maxdur'] . "] от \"" . $from . "\" к \"" . $to['login'] . "\"','1','" . time() . "');");
mysql_query("INSERT INTO `delo`(`id`,`author`,`pers`,`text`,`type`,`date`) VALUES ('','0','{$to['id']}','Подарен предмет \"" . $res['name'] . "\" id:(cap" . $res['id'] . ") [" . $res['duration'] . "/" . $res['maxdur'] . "] от \"" . $from . "\" к \"" . $to['login'] . "\"','1','" . time() . "');");
if (($_POST['from'] == 1) || ($_POST['from'] == 2)) {
$action = "подарил";
mysql_query("INSERT INTO `delo`(`id`,`author`,`pers`,`text`,`type`,`date`) VALUES ('','0','" . $to['id'] . "','Подарен предмет \"" . $res['name'] . "\" id:(cap" . $res['id'] . ") [" . $res['duration'] . "/" . $res['maxdur'] . "] от \"" . $user['login'] . "\" к \"" . $to['login'] . "\"','5','" . time() . "');");
} else {
if ($user['sex'] == 0) {
$action = "подарила";
} else {
$action = "подарил";
}
}
$us = mysql_fetch_array(mysql_query("SELECT `id` FROM `online` WHERE `date`>=" . (time() - 60) . " AND `id` = '" . $to['id'] . "' LIMIT 1;"));
if ($us[0]) {
addchp('<font color=red>Внимание!</font> <span oncontextmenu=OpenMenu()>' . $from . '</span> ' . $action . ' вам <b>' . $buket_name . '</b>. ', '{[]}' . $_POST['to_login'] . '{[]}');
} else {
// если в офе
mysql_query("INSERT INTO `telegraph` (`owner`,`date`,`text`) VALUES ('" . $to['id'] . "','','" . '<font color=red>Внимание!</font> <span oncontextmenu=OpenMenu()>' . $from . '</span> ' . $action . ' вам <b>' . $buket_name . '</b>. ' . "');");
}
echo "<b><font color=red>Подарок удачно доставлен к \"", $_POST['to_login'], "\"</font></b>";
}
echo mysql_error();
}
}
?>
<!-- Подарить подарок -->
<form method="post">
<table cellspacing=0 cellpadding=0 width=100% bgcolor=#e0e0e2>
<td>
<input type=hidden name=present value=1>
Вы можете сделать подарок дорогому человеку. Ваш подарок будет
отображаться в информации о персонаже.
<ol>
<li>Укажите логин персонажа, которому хотите сделать подарок<br>
Login <input type=text name=to_login value="">
<li>Цель подарка. Будет отображаться в информации о персонаже (не
более 60 символов)<br>
<input type=text name=podarok2 value="" maxlength=60 size=50>
<li>Напишите текст сопроводительной записки (в информации о
персонаже не отображается)<br>
<textarea name=txt rows=6 cols=80></textarea>
<li>Выберите, от чьего имени подарок:<br>
<input type=radio name=from value=0
checked> <?= nick::id($user['id'])->full() ?><br>
<input type=radio name=from value=1> анонимно<br>
<input type=radio name=from value=2> от имени клана<br>
<li>Нажмите кнопку <b>Подарить</b> под предметом, который хотите
преподнести в подарок:<br>
</ol>
<input type="hidden" name="flower" id="flower" value="">
<table border=0 width=100% cellspacing="1" cellpadding="2"
bgcolor="#A5A5A5">
<?
//print_r($_POST);
$data = mysql_query("SELECT * FROM `inventory` WHERE `owner`='" . $_SESSION['uid'] . "' AND `dressed`=0 AND (`name` LIKE '%Букет%' OR `name` LIKE '%Сувенир%' OR `name` LIKE '%Подарок%' OR `name` LIKE '%Валентинка%' OR `name` LIKE '%Открытка%' OR `name` LIKE 'Ель%' OR `name` LIKE '%Медаль%' OR `name` LIKE '%Статуэтка%') AND `setsale`=0 AND `present` = '' ORDER BY `id` DESC;");
while ($row = mysql_fetch_array($data)) {
if (!in_array($row['id'], array_keys($_SESSION['flowers']))) {
$row['count'] = 1;
if ($i == 0) {
$i = 1;
$color = '#C7C7C7';
} else {
$i = 0;
$color = '#D5D5D5';
}
echo "<tr bgcolor={$color}><td align=center style='width:150px'><img src=\"i/sh/{$row['img']}\" border=0>";
?>
<br><input type=submit
onClick="document.all['flower'].value="<?= $row['id']; ?>"" value="Подарить">
</td>
<?
echo "<td valign=top>";
showitem($row);
echo "</td></tr>";
}
}
?>
</table>
</form>
<?
} else {
$data = mysql_query("SELECT * FROM `inventory` WHERE `owner`='" . $user['id'] . "' AND `artefact`='1'");
while ($row = mysql_fetch_array($data)) {
if ($i == 0) {
$i = 1;
$color = '#C7C7C7';
} else {
$i = 0;
$color = '#D5D5D5';
}
// echo "<tr bgcolor=".$color.">";
?>
<?
//echo "<td valign=top>";
showitem($row, 10);
//echo "</td></tr>";
}
}
?>
</table>
</td>
</tr>
</table>
</td>
<td valign=top width=280>
<b>Масса всех ваших вещей: <?=$itemWeight['m']?>/<?=get_meshok()?>
<br>У вас в наличии: <span style="color: #339900;"><?=$bank['ekr']?></span> екр.</b>
<hr>
<a href=ashop.php>Магазин Берёзка</a>
<hr>
<div id="hint3" class="ahint"></div>
</td>
</form>
</tr> </tr>
</table> </table>
</body> </body>
</html> </html>