2019-01-11 20:26:10 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class ShopItem extends Item
|
|
|
|
{
|
2019-01-11 22:05:20 +00:00
|
|
|
private $cost;
|
|
|
|
private $count;
|
|
|
|
|
2019-01-11 22:07:06 +00:00
|
|
|
public function __construct($row)
|
2019-01-11 22:05:20 +00:00
|
|
|
{
|
|
|
|
parent::__construct($row);
|
|
|
|
$this->cost = $row['cost'];
|
|
|
|
$this->count = $row['count'];
|
|
|
|
}
|
|
|
|
|
2019-01-11 20:26:10 +00:00
|
|
|
public function printInfo()
|
|
|
|
{
|
|
|
|
parent::printBaseInfo();
|
|
|
|
echo "<br>Цена" . $this->wrap($this->cost) . " пымпочек";
|
2019-01-11 22:05:20 +00:00
|
|
|
if ($this->count > 0) echo "<br><small>(Осталось: {$this->count} штук)</small>";
|
2019-01-11 20:26:10 +00:00
|
|
|
parent::printRequirements();
|
|
|
|
parent::printBonuses();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Для кнопок управления под картинкой прелмета в зависимости от ситуации.
|
|
|
|
*/
|
|
|
|
public function printControls()
|
|
|
|
{
|
|
|
|
echo <<<BTN
|
2019-01-11 20:33:45 +00:00
|
|
|
<p><input type="button" style="background: darkgrey; border: 1px solid grey; border-radius: 2px;" value="Купить"
|
2019-01-11 21:48:21 +00:00
|
|
|
onclick="location='/admin.php'">
|
2019-01-11 20:26:10 +00:00
|
|
|
BTN;
|
|
|
|
}
|
|
|
|
}
|