Превращение таблиц в css grid.

This commit is contained in:
lopar
2020-07-05 18:09:55 +03:00
parent 3ec3d3956c
commit cb17a5ba8b
3 changed files with 171 additions and 15 deletions

View File

@@ -67,6 +67,7 @@ EMPTY_SLOT;
public function showUserInfo()
{
$starSign = star_sign($this->borndate);
$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()) {
@@ -184,7 +185,7 @@ USERINFO;
</div>
</td>
<td width="100%">
Имя {$this->login} <br>
Уровень {$this->level} <br>
Сила {$this->strength} <br>
Ловкость {$this->dexterity} <br>
Интуиция {$this->intuition} <br>
@@ -194,26 +195,118 @@ USERINFO;
Находится в {$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="Родовой знак">
<img src="i/zodiac/{$starSign}.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]);
// }
// if (isset($dressed_item[2])) {
// $this->showItem($dressed_item[2]);
// }
// if (isset($dressed_item[4])) {
// $this->showItem($dressed_item[4]);
// }
public function showUserInfo2()
{
$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 class="user-info-container">';
echo '<div class="slot-1">';
if (isset($dressed_item[1])) {
$this->showItem($dressed_item[1]);
} else {
$this->showItem(1);
}
echo '</div>';
echo '<div class="slot-2">';
if (isset($dressed_item[2])) {
$this->showItem($dressed_item[2]);
} else {
$this->showItem(2);
}
echo '</div>';
echo '<div class="slot-3">';
if (isset($dressed_item[3])) {
$this->showItem($dressed_item[3]);
} else {
$this->showItem(3);
}
echo '</div>';
echo '<div class="slot-4">';
if (isset($dressed_item[4])) {
$this->showItem($dressed_item[4]);
} else {
$this->showItem(4);
}
echo '</div>';
echo '<div class="slot-5">';
if (isset($dressed_item[5])) {
$this->showItem($dressed_item[5]);
} else {
$this->showItem(5);
}
echo '</div>';
echo '<div class="slot-6">';
if (isset($dressed_item[6])) {
$this->showItem($dressed_item[6]);
} else {
$this->showItem(6);
}
echo '</div>';
echo '<div class="slot-7">';
if (isset($dressed_item[7])) {
$this->showItem($dressed_item[7]);
} else {
$this->showItem(7;
}
echo '</div>';
echo '<div class="slot-8">';
if (isset($dressed_item[8])) {
$this->showItem($dressed_item[8]);
} else {
$this->showItem(8);
}
echo '</div>';
echo '<div class="slot-lower">';
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 '</div>';
echo '<div class="slot-image">';
echo sprintf('<img src="/i/shadow/%s" width="200" height="430" alt="%s">', $this->shadow, $this->login);
echo '</div>';
echo '<div class="user-signs">';
echo sprintf('<img src="i/zodiac/%s.png" alt="Родовой знак">', star_sign($this->borndate));
echo '</div>';
echo '<div class="user-info">';
echo <<<USERINFO
Уровень {$this->level} <br>
Сила {$this->strength} <br>
Ловкость {$this->dexterity} <br>
Интуиция {$this->intuition} <br>
Выносливость {$this->endurance} <br>
Интеллект {$this->intelligence} <br>
Мудрость {$this->wisdom} <br>
Находится в {$this->getRoomName($this->room)}
USERINFO;
echo '</div>';
echo '</div>';
}
}