battles/classes/ShopItem.php
2019-01-12 00:05:20 +02:00

34 lines
981 B
PHP

<?php
class ShopItem extends Item
{
private $cost;
private $count;
private function __construct($row)
{
parent::__construct($row);
$this->cost = $row['cost'];
$this->count = $row['count'];
}
public function printInfo()
{
parent::printBaseInfo();
echo "<br>Цена" . $this->wrap($this->cost) . " пымпочек";
if ($this->count > 0) echo "<br><small>(Осталось: {$this->count} штук)</small>";
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'">
BTN;
}
}