This commit is contained in:
lopar 2020-07-05 02:25:14 +03:00
parent fc0f9ed606
commit 9419924bfa
1 changed files with 77 additions and 54 deletions

View File

@ -32,6 +32,10 @@ class User
public $stats;
public $shadow;
const EMPTY_SLOT = <<<EMPTY_SLOT
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот" alt="Пустой слот>
EMPTY_SLOT;
use Rooms;
public function __construct($user)
@ -56,7 +60,7 @@ class User
SLOT;
} else {
echo <<<EMPTY_SLOT
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [{$itemSlot}]" alt="Пустой слот [{$itemSlot}]>
<img src="/i/sh/noitem.png" class="item-wrap-normal" title="Пустой слот [{$item}]" alt="Пустой слот [{$item}]>
EMPTY_SLOT;
}
}
@ -65,13 +69,9 @@ EMPTY_SLOT;
{
$dressed_item = [];
$dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->id);
$dressed_items_row = $dressed_items->fetch_assoc();
for ($i = 1; $i <= 11; $i++) {
$dressed_item[$i] = $dressed_items_row[$i] ?? null;
}
// while ($row = $dressed_items->fetch_assoc()) {
// $dressed_item[$row['dressed_slot']] = $row;
// }
while ($row = $dressed_items->fetch_assoc()) {
$dressed_item[$row['dressed_slot']] = $row;
}
echo '<div style="text-align: center">';
if ($this->align) {
echo sprintf('<img src="/i/align_%s.png" alt="Склонность">', $this->align);
@ -94,28 +94,31 @@ EMPTY_SLOT;
<table width=100%>
<tr>
<td>';
if (isset($dressed_item[1])) {
$this->showItem($dressed_item[1]);
} else {
$this->showItem(1);
}
echo '</td></tr><tr><td>';
if (isset($dressed_item[2])) {
$this->showItem($dressed_item[2]);
} else {
$this->showItem(2);
}
echo '</td></tr><tr><td>';
if (isset($dressed_item[3])) {
$this->showItem($dressed_item[3]);
} else {
$this->showItem(3);
}
echo '</td></tr><tr><td>';
if (isset($dressed_item[4])) {
$this->showItem($dressed_item[4]);
} else {
$this->showItem(4);
}
echo '</td></tr>';
echo <<<USERINFO
{$this->showItem($dressed_item[1])}
</td>
</tr>
<tr>
<td>
{$this->showItem($dressed_item[2])}
</td>
</tr>
<tr>
<td>
{$this->showItem($dressed_item[3])}
</td>
</tr>
<tr>
<td>
{$this->showItem($dressed_item[4])}
</td>
</tr>
</table>
</td>
<td valign=top>
@ -125,32 +128,52 @@ EMPTY_SLOT;
<table width=100%>
<tr>
<td>
{$this->showItem($dressed_item[5])}
</td>
</tr>
<tr>
<td>
{$this->showItem($dressed_item[6])}
</td>
</tr>
<tr>
<td>
{$this->showItem($dressed_item[7])}
</td>
</tr>
<tr>
<td>
{$this->showItem($dressed_item[8])}
</td>
</tr>
USERINFO;
if (isset($dressed_item[5])) {
$this->showItem($dressed_item[5]);
} else {
$this->showItem(5);
}
echo '</td></tr><tr><td>';
if (isset($dressed_item[6])) {
$this->showItem($dressed_item[6]);
} else {
$this->showItem(6);
}
echo '</td></tr><tr><td>';
if (isset($dressed_item[7])) {
$this->showItem($dressed_item[7]);
} else {
$this->showItem(7);
}
echo '</td></tr><tr><td>';
if (isset($dressed_item[8])) {
$this->showItem($dressed_item[8]);
} else {
$this->showItem(8);
}
echo '</td></tr>
</table>
</td>
</tr>
</table>
<div style="text-align: center">
{$this->showItem($dressed_item[9])}
{$this->showItem($dressed_item[10])}
{$this->showItem($dressed_item[11])}
<div style="text-align: center">';
if (isset($dressed_item[9])) {
$this->showItem($dressed_item[9]);
} else {
$this->showItem(9);
}
if (isset($dressed_item[10])) {
$this->showItem($dressed_item[10]);
} else {
$this->showItem(10);
}
if (isset($dressed_item[11])) {
$this->showItem($dressed_item[11]);
} else {
$this->showItem(11);
}
echo <<<USERINFO
</div>
Имя {$this->login} <br>
@ -163,9 +186,9 @@ EMPTY_SLOT;
Находится в {$this->getRoomName($this->room)}<br>
USERINFO;
if (isset($dressed_item[1])) {
$this->showItem($dressed_item[1]);
}
// if (isset($dressed_item[1])) {
// $this->showItem($dressed_item[1]);
// }
// if (isset($dressed_item[2])) {
// $this->showItem($dressed_item[2]);
// }