Перенос HTML в класс. Да говняно, но не нашёл способа проще.

This commit is contained in:
lopar
2020-07-05 10:12:48 +03:00
parent 27b73089e8
commit 3ec3d3956c
2 changed files with 37 additions and 27 deletions

View File

@@ -69,10 +69,15 @@ EMPTY_SLOT;
{
$dressed_item = [];
$dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->id);
while ($row = $dressed_items->fetch_assoc()) {
$dressed_item[$row['dressed_slot']] = $row;
}
echo '<div style="text-align: center">';
while ($row = $dressed_items->fetch_assoc()) {
$dressed_item[$row['dressed_slot']] = $row;
}
echo <<<USERINFO
<table width=100%>
<tr>
<td style="width: 250px; vertical-align: top;">
<div style="text-align: center">
USERINFO;
if ($this->align) {
echo sprintf('<img src="/i/align_%s.png" alt="Склонность">', $this->align);
}
@@ -84,7 +89,8 @@ EMPTY_SLOT;
if ($this->clan) {
echo sprintf('<img src="/i/clan/%s.png" alt="%s">', $this->clan, $this->clan);
}
echo '</div>
echo <<<USERINFO
</div>
<div style="width: 100%; height: 16px; background: #ffaaff; overflow: hidden; border-radius: 3px; font-size: 14px; text-align: center;">
добавить здоровье
</div>
@@ -93,7 +99,8 @@ EMPTY_SLOT;
<td width=62 valign=top>
<table width=100%>
<tr>
<td>';
<td>
USERINFO;
if (isset($dressed_item[1])) {
$this->showItem($dressed_item[1]);
} else {
@@ -173,9 +180,10 @@ USERINFO;
} else {
$this->showItem(11);
}
echo <<<USERINFO
echo <<<USERINFO
</div>
</td>
<td width="100%">
Имя {$this->login} <br>
Сила {$this->strength} <br>
Ловкость {$this->dexterity} <br>
@@ -184,7 +192,18 @@ USERINFO;
Интеллект {$this->intelligence} <br>
Мудрость {$this->wisdom} <br>
Находится в {$this->getRoomName($this->room)}<br>
</td>
<td style="vertical-align: top; width: 100px; text-align: center;">
<img src="i/zodiac/<?= star_sign($this->borndate); ?>.png" alt="Родовой знак">
</td>
</tr>
</table>
USERINFO;
if ($this->married) {
echo sprintf('<a href = "inf.php?%s" target = _blank ><img alt = "В браке с %s" src = "i/married.gif" title = "В браке с %s"></a >', $this->married, $this->married, $this->married);
}
// if (isset($dressed_item[1])) {
// $this->showItem($dressed_item[1]);