query('SELECT * FROM users WHERE id = "?s" OR login = "?s"', $user, $user)->fetch_assoc(); $watchingUser_query = db::c()->query('SELECT `align`,`admin` FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc(); foreach ($this as $key => $value) { if (isset($user_query[$key])) { $this->$key = $user_query[$key]; } } if ($watchingUser_query['admin']) { $this->watcherIsAdmin = 1; } if ($watchingUser_query['align'] == 1) { $this->watcherIsModerator = 1; } } protected function showItem($item = 0) { $itemSlot = $item['dressed_slot'] ?? 0; $itemName = $item['name'] ?? ''; $itemImage = $item['image'] ?? ''; if ($itemSlot) { echo << {$itemName} SLOT; } else { echo << EMPTY_SLOT; } } public function showUserInfo() { $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 ''; echo '
'; echo ''; if ($this->watcherIsAdmin || $this->watcherIsModerator) { echo '
'; $infoString = 'Личное дело
ИД Игрока: %s
ДР Игрока: %s
IP Регистрации: %s'; echo sprintf($infoString, $this->id, date('d.m.Y', strtotime($this->borndate)), $this->ip); if ($this->watcherIsAdmin) { $this->Bank = new Bank($this->id); $infoString = '
ИД Комнаты: %s
Деньги: %s
Деньги в банке: %s
Опыт: %s
Нераспределённые очки: %s
E-Mail: %s
Текущая сессия: %s
'; echo sprintf($infoString, $this->room, $this->money, $this->Bank->money, $this->experience, $this->stat_points, $this->email, $this->session_id); } $this->UserLogs = new UserLogModel($this->id); echo '
'; while ($userLogRow = $this->UserLogs->getUserLog()->fetch_object()) { echo sprintf('%s
', date("d.m.Y H:i ", strtotime($userLogRow->date)) . $userLogRow->text); } echo '
'; echo '
'; } } public function showStarSign() { /* * 1 aries * 2 taurus * 3 gemini * 4 cancer * 5 leo * 6 virgo * 7 libra * 8 scorpio * 9 sagittarios * 10 capricorn * 11 aquarius * 12 pisches */ $zodiac[356] = "10"; $zodiac[326] = "09"; $zodiac[296] = "08"; $zodiac[266] = "07"; $zodiac[235] = "06"; $zodiac[203] = "05"; $zodiac[172] = "04"; $zodiac[140] = "03"; $zodiac[111] = "02"; $zodiac[78] = "01"; $zodiac[51] = "12"; $zodiac[20] = "11"; $zodiac[0] = "10"; $dayOfYear = date("z", strtotime($this->borndate)); $isLeapYear = date("L", strtotime($this->borndate)); //Высокосный? if ($isLeapYear && $dayOfYear >59) { --$dayOfYear; } foreach ($zodiac as $day => $sign) { if ($dayOfYear > $day) { break; } } return $sign ?? null; } public function showPrivateUserInfo() { $this->watchingUser; function privateAccessCheck() { $own = db::c()->query('SELECT `align`,`admin` FROM `users` WHERE `id` = ?i', $uid)->fetch_assoc(); if ($own['admin'] == 1) { return ADMINISTRATOR_ACCESS; } elseif ($own['align'] == 1) { return MODERATOR_ACCESS; } return false; } } }