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

This commit is contained in:
lopar 2020-07-04 20:28:22 +03:00
parent fc2238a92a
commit 93da7c0177

View File

@ -46,12 +46,6 @@ class User
public function showUserInfo() {
$dressed_item = [];
$dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->id);
// foreach ($dressed_items as $key=>$value) {
// //$dressed_items_array[$dressed_items['dressed_slot']][$key] = $value;
// //$dressed_items_object[$dressed_items['dressed_slot']]->$key = $value;
// //$dressed_items_array[$dressed_items->dressed_slot][$key] = $dressed_items->$value;
// $dressed_items_array[$dressed_items['dressed_slot']][$key] = $dressed_items[$key];
// }
while ($row = $dressed_items->fetch_assoc()) {
$dressed_item[$row['dressed_slot']] = $row;
}
@ -68,13 +62,14 @@ class User
Предметы на тушке: <br>
USERINFO;
if (isset($dressed_item[1])) {
echo "В руке — " .$dressed_item[1]['name'].PHP_EOL;
echo "В руке — " .$dressed_item[1]['name']."<br>";
}
if (isset($dressed_item[2])) {
echo "В другой руке — " .$dressed_item[2]['name']."<br>";
}
if (isset($dressed_item[4])) {
echo "На пузе — " .$dressed_item[4]['name'].PHP_EOL;
echo "На пузе — " .$dressed_item[4]['name']."<br>";
}
echo "<p>";
var_dump($dressed_item).PHP_EOL;
}
}