two type test
This commit is contained in:
parent
6181e30766
commit
6a791d528e
24
classes/InventoryItem.php
Normal file
24
classes/InventoryItem.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
class InventoryItem extends Item
|
||||
{
|
||||
public function printInfo()
|
||||
{
|
||||
parent::printBaseInfo();
|
||||
parent::printRequirements();
|
||||
parent::printBonuses();
|
||||
}
|
||||
|
||||
/**
|
||||
* Для кнопок управления под картинкой прелмета в зависимости от ситуации.
|
||||
*/
|
||||
public function printControls()
|
||||
{
|
||||
echo <<<BTN
|
||||
<p><input type="button" style="background: darkgrey; border: 1px solid grey; border-radius: 2px;" value="Надеть"
|
||||
onclick="location='/admin.php'">
|
||||
<input type="button" style="background: brown; border: 1px solid grey; color: white border-radius: 2px;" value="Выбросить"
|
||||
onclick="location='/admin.php'">
|
||||
BTN;
|
||||
}
|
||||
}
|
5
test.php
5
test.php
@ -15,11 +15,16 @@ require_once 'config.php';
|
||||
# $items = []; foreach(фетч того ебучего массива as $value) {$items[$value['id']] = $value}
|
||||
|
||||
$result = db::c()->query('SELECT * FROM `shop` WHERE count > 0');
|
||||
$result2 = db::c()->query('SELECT * FROM `inventory` WHERE owner = 11263');
|
||||
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$iteminfo[] = new ShopItem($row);
|
||||
}
|
||||
|
||||
while ($row = $result2->fetch_assoc()) {
|
||||
$iteminfo[] = new InventoryItem($row);
|
||||
}
|
||||
|
||||
echo "<table width='100%'><th colspan='2'>Товары магазина</th>";
|
||||
foreach ($iteminfo as $ii) {
|
||||
echo "<tr><td bgcolor='#d3d3d3'>";
|
||||
|
Loading…
Reference in New Issue
Block a user