battles/classes/ShopItem.php

32 lines
925 B
PHP
Raw Normal View History

2019-01-11 22:26:10 +02:00
<?php
class ShopItem extends Item
{
2019-01-14 17:49:31 +02:00
public $count;
public $razdel;
public $ecost;
public $zeton;
public $onlyone;
public $shshop;
2019-01-12 00:05:20 +02:00
2019-01-11 22:26:10 +02:00
public function printInfo()
{
parent::printBaseInfo();
parent::printRequirements();
parent::printBonuses();
2019-01-14 16:12:53 +02:00
parent::printMagic();
2019-01-11 22:26:10 +02:00
}
/**
* Для кнопок управления под картинкой прелмета в зависимости от ситуации.
*/
public function printControls()
{
2019-01-14 18:19:56 +02:00
$btnPrice = 'Купить за ' . intval($this->cost) . ' кр.';
2019-01-11 22:26:10 +02:00
echo <<<BTN
2019-01-14 18:19:25 +02:00
<p><input type="button" style="background: darkgrey; border: 1px solid grey; border-radius: 2px;" value="{$btnPrice}"
onclick="location='/admin.php'">
2019-01-11 22:26:10 +02:00
BTN;
2019-01-14 18:22:36 +02:00
if ($this->count > 0) echo "<br><small>(Осталось: {$this->count} штук)</small>";
2019-01-11 22:26:10 +02:00
}
}