items mass from class

This commit is contained in:
Igor Barkov (iwork) 2020-07-20 17:48:09 +03:00
parent 7fbb2904e0
commit 62ba2f4c73
2 changed files with 13 additions and 9 deletions

View File

@ -46,7 +46,8 @@ SELECT SUM(add_strength) as sum_strength,
SUM(add_evasion) as sum_evasion, SUM(add_evasion) as sum_evasion,
SUM(add_criticals) as sum_criticals, SUM(add_criticals) as sum_criticals,
SUM(add_min_physical_damage) as sum_min_phys_damage, SUM(add_min_physical_damage) as sum_min_phys_damage,
SUM(add_max_physical_damage) as sum_max_phys_damage SUM(add_max_physical_damage) as sum_max_phys_damage,
SUM(weight) as sum_weight
FROM inventory WHERE owner_id = ?i AND dressed_slot > 0 FROM inventory WHERE owner_id = ?i AND dressed_slot > 0
SQL; SQL;
self::$DBSUM = db::c()->query($query, self::$USERID)->fetch_assoc(); self::$DBSUM = db::c()->query($query, self::$USERID)->fetch_assoc();
@ -112,6 +113,9 @@ SQL;
{ {
return $this->getBonuses()['sum_criticals']; return $this->getBonuses()['sum_criticals'];
} }
public function getItemsWeight()
{
return self::getBonuses()['sum_weight'];
}
} }

View File

@ -926,22 +926,22 @@ if (input::get('edit')) {
<td> <td>
<table class="allzeroes" style="background-color: #d4d2d2;"> <table class="allzeroes" style="background-color: #d4d2d2;">
<tr> <tr>
td style="text-align: center; <td style="text-align: center;
background-color: <?= ($_SESSION['razdel'] == null) ? '#A5A5A6' : '#C7C7C8' ?>"><a background-color: <?= ($_SESSION['razdel'] == null) ? '#A5A5A6' : '#C7C7C8' ?>"><a
href="?edit=1&razdel=0" ajax="mZeInventory">Амуниция</a></td> href="?edit=1&razdel=0" ajax="mZeInventory">Амуниция</a></td>
td style="text-align: center; <td style="text-align: center;
background-color: <?= ($_SESSION['razdel'] == 1) ? '#A5A5A6' : '#C7C7C8' ?>"><a background-color: <?= ($_SESSION['razdel'] == 1) ? '#A5A5A6' : '#C7C7C8' ?>"><a
href="?edit=1&razdel=1" ajax="mZeInventory">Заклинания</a></td> href="?edit=1&razdel=1" ajax="mZeInventory">Заклинания</a></td>
td style="text-align: center; <td style="text-align: center;
background-color: <?= ($_SESSION['razdel'] == 3) ? '#A5A5A6' : '#C7C7C8' ?>"><a background-color: <?= ($_SESSION['razdel'] == 3) ? '#A5A5A6' : '#C7C7C8' ?>"><a
href="?edit=1&razdel=3" ajax="mZeInventory">Ресурсы</a></td> href="?edit=1&razdel=3" ajax="mZeInventory">Ресурсы</a></td>
td style="text-align: center; <td style="text-align: center;
background-color: <?= ($_SESSION['razdel'] == 4) ? '#A5A5A6' : '#C7C7C8' ?>"><a background-color: <?= ($_SESSION['razdel'] == 4) ? '#A5A5A6' : '#C7C7C8' ?>"><a
href="?edit=1&razdel=4" ajax="mZeInventory">Подарки</a></td> href="?edit=1&razdel=4" ajax="mZeInventory">Подарки</a></td>
td style="text-align: center; <td style="text-align: center;
background-color: <?= ($_SESSION['razdel'] == 5) ? '#A5A5A6' : '#C7C7C8' ?>"><a background-color: <?= ($_SESSION['razdel'] == 5) ? '#A5A5A6' : '#C7C7C8' ?>"><a
href="?edit=1&razdel=5" ajax="mZeInventory">Квестовые вещи</a></td> href="?edit=1&razdel=5" ajax="mZeInventory">Квестовые вещи</a></td>
td style="text-align: center; <td style="text-align: center;
background-color: <?= ($_SESSION['razdel'] == 2) ? '#A5A5A6' : '#C7C7C8' ?>"><a background-color: <?= ($_SESSION['razdel'] == 2) ? '#A5A5A6' : '#C7C7C8' ?>"><a
href="?edit=1&razdel=2" ajax="mZeInventory">Прочее</a></td> href="?edit=1&razdel=2" ajax="mZeInventory">Прочее</a></td>
</tr> </tr>
@ -949,7 +949,7 @@ if (input::get('edit')) {
</td> </td>
</tr> </tr>
<tr> <tr>
<td align=center><B>Рюкзак (масса : <?= getItemsMassaInfo() ?>)</B> <td align=center><B>Рюкзак (масса : <?= $getItemsBonuses->getItemsWeight() .'/'. $showUser->strength * 4 ?>)</B>
</td> </td>
</tr> </tr>
<tr> <tr>