Старт переноса showinf_pers(); в класс

This commit is contained in:
lopar 2020-07-04 14:21:35 +03:00
parent d1ae47bae2
commit a2835046a4
2 changed files with 3 additions and 3 deletions

View File

@ -44,11 +44,11 @@ class User
}
public function showUserInfo() {
$dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i' AND dressed_slot > 0, $this->id);
$dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->id);
foreach ($dressed_items->fetch_assoc() as $item) {
echo 1;
}
echo <<<USERINFO
return <<<USERINFO
Имя {$this->login} <br>
Сила {$this->strength} <br>
Ловкость {$this->dexterity} <br>

View File

@ -54,7 +54,7 @@ if (empty($user->id)): ?>
<td style="width: 250px; vertical-align: top;">
<?php
try {echo showinf_pers($user->id);} catch (Exception $e) {echo "<div class='private'>Ошибка генератора персонажа showinf_pers(): {$e}</div>";}
try {$user->showUserInfo();} catch (Exception $e) {echo "<div class='private'>Ошибка генератора персонажа showinf_pers(): {$e}</div>";}
try {echo $user->showUserInfo();} catch (Exception $e) {echo "<div class='private'>Ошибка классового генератора персонажа showUserInfo(): {$e}</div>";}
if (!empty($user->married)): ?>
<a href="inf.php?<?= $user->married ?>" target=_blank>
<img alt="В браке с <?= $user->married ?>" src="i/married.gif"