@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
# Date: 17.02.2022 (22:27)
|
||||
namespace Battles;
|
||||
|
||||
use Battles\Database\Db;
|
||||
|
||||
class UserPrivateInfo
|
||||
{
|
||||
/** Блок информации для модераторов. */
|
||||
public static function get(User $user)
|
||||
{
|
||||
$userLogs = GameLogs::getUserLogs($user->getId());
|
||||
$log = null;
|
||||
while ($userLogRow = $userLogs->fetchArray(SQLITE3_ASSOC)) {
|
||||
$log .= sprintf('<code>%s</code><br>', date('d.m.Y H:i ', strtotime($userLogRow['date'])) . $userLogRow['text']);
|
||||
}
|
||||
$data = [
|
||||
'%email' => $user->profile()->getEmail(),
|
||||
'%bday' => date('d.m.Y', strtotime($user->profile()->getBorndate())),
|
||||
'%regip' => $user->profile()->getIp(),
|
||||
'%uid' => $user->getId(),
|
||||
'%room' => $user->getRoom(),
|
||||
'%wallet' => $user->money()->get(),
|
||||
'%bank' => Db::getInstance()->fetchColumn('select money from bank where user_id = ?', $user->getId()),
|
||||
'%exp' => $user->getExperience(),
|
||||
'%fp' => Db::getInstance()->fetchColumn('select free_stat_points from users where id = ?', $user->getId()),
|
||||
'%log' => $log ?? 'Журнал пуст.',
|
||||
];
|
||||
$string = '<div class="secret-info">E-Mail: %email<br>ДР Игрока: %bday<br>IP Регистрации: %regip<br>
|
||||
⁑ ИД Игрока: %uid<br> ⁑ ИД Комнаты: %room<br> ⁑ Деньги: %wallet<br> ⁑ Деньги в банке: %bank<br>
|
||||
⁑ Опыт: %exp<br> ⁑ Нераспределённые очки: %fp<br><br>
|
||||
<div class="secret-info-user-log"><b>Личное дело</b><br>%log</div><!-- secret-info-user-log -->
|
||||
</div><!-- secret-info -->';
|
||||
return str_replace(array_keys($data), array_values($data), $string);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user