damned selling items

This commit is contained in:
lopar 2019-01-14 23:08:02 +02:00
parent 0437d6c4a1
commit 0393614719

View File

@ -120,15 +120,13 @@ if ($sellItemId) {
} }
$allcost = mt_rand(0,$dress['cost']/2); $allcost = mt_rand(0,$dress['cost']/2);
#destructitem($dress['id']);
db::c()->query('DELETE FROM `inventory` WHERE `id` = ?i', $dress['id']); db::c()->query('DELETE FROM `inventory` WHERE `id` = ?i', $dress['id']);
db::c()->query('UPDATE `users` SET `money` = ?i WHERE `id` = ?i', $allcost, $_SESSION['uid']); db::c()->query('UPDATE `users` SET `money` = ?i WHERE `id` = ?i', $allcost, $_SESSION['uid']);
$status = "Вы продали «{$dress['name']}» $kols за " . $allcost . " кр."; $status = "Вы продали «{$dress['name']}» $kols за " . $allcost . " кр.";
$deloText = "{$user['login']} продал товар «{$dress['name']}»{$kols}id:({$dress['id']}) в магазине за {$allcost} кр."; $deloText = "{$user['login']} продал товар «{$dress['name']}»{$kols}id:({$dress['id']}) в магазине за {$allcost} кр.";
addToDelo($deloText); addToDelo($deloText);
// Для обновления данных о деньгах на странице
$user['money'] -= $allcost;
} }
if (!empty($_GET['buy'])) { if (!empty($_GET['buy'])) {
@ -214,12 +212,6 @@ if (!empty($_GET['buy'])) {
<script src="js/mi.js"></script> <script src="js/mi.js"></script>
<link rel="stylesheet" href="css/bkstyle.css?101"/> <link rel="stylesheet" href="css/bkstyle.css?101"/>
<link rel="stylesheet" href="css/mi.css"/> <link rel="stylesheet" href="css/mi.css"/>
<style>
.row {
font-family: Tahoma, sans-serif;
font-size: 13px;
}
</style>
<script> <script>
function leave() { function leave() {
top.frames['main'].location = 'city.php?cp' top.frames['main'].location = 'city.php?cp'
@ -248,7 +240,6 @@ if (!empty($_GET['buy'])) {
<TABLE class="zebra" WIDTH=100% CELLSPACING="1" CELLPADDING="2" BGCOLOR="#A5A5A5"> <TABLE class="zebra" WIDTH=100% CELLSPACING="1" CELLPADDING="2" BGCOLOR="#A5A5A5">
<?php <?php
if ($saleItems == true) { if ($saleItems == true) {
foreach ($iteminfo as $ii) { foreach ($iteminfo as $ii) {
echo "<tr><td style='width: 150px; text-align: center;'>"; echo "<tr><td style='width: 150px; text-align: center;'>";
$ii->printImage(); $ii->printImage();
@ -258,8 +249,6 @@ if (!empty($_GET['buy'])) {
$ii->printInfo(); $ii->printInfo();
echo "</td></tr>"; echo "</td></tr>";
} }
} else { } else {
foreach ($iteminfo as $ii) { foreach ($iteminfo as $ii) {
echo "<tr><td style='width: 150px; text-align: center;'>"; echo "<tr><td style='width: 150px; text-align: center;'>";