Вы продали \"{$dress['name']}\" $kols за " . $allcost . " кр."; } if (($_GET['set'] || $_POST['set'])) { if ($_GET['set']) { $set = $_GET['set']; } if ($_POST['set']) { $set = $_POST['set']; } if (!$_GET['count']) { $_GET['count'] = 1; } if (!is_numeric($_GET['count']) || $_GET['count'] != ((int)$_GET['count'])) { $_GET['count'] = 0; $count_ok = 0; } elseif ($_GET['count'] < 1) { $_GET['count'] = 0; $count_ok = 0; } else { $count_ok = 1; } $dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '" . (int)$set . "' LIMIT 1")); if ($count_ok == 0) { echo "Неправильно введено количество"; } elseif (($dress['massa'] * $_GET['count'] + $d[0]) > (get_meshok())) { echo "Недостаточно места в рюкзаке."; } elseif ($count_ok == 1 && ($user['money'] >= ($dress['cost'] * $_GET['count'])) && ($dress['count'] >= $_GET['count'])) { for ($k = 1; $k <= $_GET['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`,`gmp`,`gmeshok`,`encicl`,`artefact`,`koll`) VALUES ('{$dress['id']}','{$user['id']}','{$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['bron2']}','{$dress['bron3']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','{$dress[koll]}')")) { $good = 1; } else { $good = 0; } } if ($good) { mysql_query("UPDATE `shop` SET `count` = (`count`-'" . (int)$_GET['count'] . "') WHERE `id` = '{$set}' LIMIT 1"); echo "Вы купили {$_GET['count']} шт. \"{$dress['name']}\"."; $user['money'] -= (int)$_GET['count'] * $dress['cost']; mysql_query("UPDATE `users` set `money` = '" . $user['money'] . "' WHERE `id` = {$user['id']} LIMIT 1"); $limit = (int)$_GET['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" . $_GET['count'] . ") "; } $allcost = (int)$_GET['count'] * $dress['cost']; mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"" . $user['login'] . "\" купил товар : \"" . $dress['name'] . "\" " . $dresscount . " id:(" . $dressid . ") [0/" . $dress['maxdur'] . "] за " . $allcost . " кр.', '1', '" . time() . "')"); } } else { echo "Недостаточно денег или нет вещей в наличии."; } } $itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0', $user['id'])->fetch_assoc(); ?>

Государственный магазин

← выйти на Центральную площадь
Отдел ""
0 AND `present` = '' AND `tradesale` = 0 AND `podzem` = 0 ORDER BY `update` DESC"); while ($row = mysql_fetch_array($data)) { $row['count'] = 1; if ($i == 0) { $i = 1; $color = '#C7C7C7'; } else { $i = 0; $color = '#D5D5D5'; } echo ""; showitem($row); echo ""; } } else { if (!isset($_SESSION['type_sort'])) { $_SESSION['type_sort'] = 1; $where = ''; } elseif ($_SESSION['type_sort'] == 1) { $where = ''; } elseif ($_SESSION['type_sort'] == 2) { $where = ' AND `nlevel` = "' . $user['level'] . '"'; } $arr_sort = array(11, 13, 12); #$item $data = mysql_query("SELECT `id`, `img`, `name` FROM `shop` WHERE `count` > 0 AND `razdel` = '{$_GET['otdel']}' $where ORDER by `nlevel` ASC, `id` ASC"); while ($row = mysql_fetch_array($data)) { if ($i == 0) { $i = 1; $color = '#C7C7C7'; } else { $i = 0; $color = '#D5D5D5'; } echo ""; echo show_shop_items($row['id']); //showitem ($row); echo ""; } } ?>
"; $price = $row['cost'] * 1; if ($data['koll']) { $price *= $data['koll']; } if ($row['type'] == 12) { $allcost = round($price * (1 - $row['duration'] / $row['maxdur']), 2); } else { $allcost = round($price - $row['duration'] * ($row['cost'] / ($row['maxdur'] * 10)), 2); } if ($row['goden'] != 0) { $goden_max = $row['goden'] * 24 * 60; $goden_left = ($row['dategoden'] - time()) / 60; $per = $goden_left / $goden_max; $allcost = round(($allcost * $per), 2); } ?>
продать за
"; ?>
купить Купить несколько штук
Масса всех ваших вещей: /
У вас в наличии: кр.



Оружие:
кастеты,ножи
топоры
дубины,булавы
мечи
Одежда:
шлемы
тяжелая броня
легкая броня
щиты
перчатки
сапоги
Ювелирные товары:
серьги
ожерелья
кольца
Магия:
боевые
разные
Разное:
амуниция