dress inventory item ckicking on it

This commit is contained in:
lopar 2019-01-12 12:28:46 +02:00
parent 7ef3f4ac84
commit 15a3dae559

View File

@ -4,15 +4,17 @@ class InventoryItem extends Item
{
private $present;
private $artefact;
private $item_id;
public function __construct($row)
{
parent::__construct($row);
$this->present = $row['present'];
$this->artefact = $row['artefact'];
$this->item_id = $row['id'];
if ($this->artefact) $this->name = <<<NAME
<b style='color: darkorange;'>{$this->name}</b><img src="//{$_SERVER['SERVER_NAME']}/i/artefact1.gif">
<b style='color: crimson;'>{$this->name}</b> <img src="//{$_SERVER['SERVER_NAME']}/i/artefact1.gif">
NAME;
}
@ -27,7 +29,7 @@ NAME;
public function printImage()
{
if (!in_array($this->type,[12,50,200])) {
echo "<a href=//{$_SERVER['SERVER_NAME']}/admin/admin.php>";
echo "<a href=//{$_SERVER['SERVER_NAME']}/main.php?edit=1&dress={$this->item_id} title='Надеть'>";
parent::printImage();
echo "</a>";
}
@ -40,9 +42,7 @@ NAME;
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="Выбросить"
<p><input type="button" style="background: brown; border: 1px solid grey; color: white; border-radius: 2px;" value="Выбросить"
onclick="location='/admin.php'">
BTN;
}