selling items final
This commit is contained in:
parent
0bd9308d01
commit
02e218d0c4
35
shop.php
35
shop.php
@ -250,33 +250,18 @@ switch ($shopCategoryTypeNumber) {
|
|||||||
<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) {
|
||||||
// Выбираем всё потому что эту выборку потом использует showitem();
|
|
||||||
$data = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0 AND `cost` > 0 AND `present` = "?n" AND `tradesale` = 0 AND `podzem` = 0 AND `goden` = 0 ORDER BY `update` DESC', $user['id'], null);
|
|
||||||
while ($row = $data->fetch_assoc()) {
|
|
||||||
$price = $row['cost'] * 0.1;
|
|
||||||
if ($row['koll']) {
|
|
||||||
$price *= $row['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);
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
foreach ($iteminfo as $ii) {
|
||||||
<tr>
|
echo "<tr><td style='width: 150px; text-align: center;'>";
|
||||||
<td align=center style='width: 150px;'>
|
$ii->printImage();
|
||||||
<img src="i/sh/<?= $row['img'] ?>" border=0>
|
$ii->printControls(true);
|
||||||
<br><a href="shop.php?sell=<?= $row['id'] ?>&sid=&sale=1">продать
|
echo "</td>";
|
||||||
за <?= $allcost ?></a>
|
echo "<td style='vertical-align: top;'>";
|
||||||
</td>
|
$ii->printInfo();
|
||||||
<td valign=top class="row">
|
echo "</td></tr>";
|
||||||
<?php showitem($row); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} 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;'>";
|
||||||
|
Loading…
Reference in New Issue
Block a user