2022-08-09 19:57:43 +00:00
|
|
|
<?php
|
|
|
|
# Date: 17.02.2022 (22:27)
|
|
|
|
namespace Battles;
|
|
|
|
|
|
|
|
use Battles\Database\Db;
|
|
|
|
|
|
|
|
class UserPrivateInfo
|
|
|
|
{
|
|
|
|
/** Блок информации для модераторов. */
|
|
|
|
public static function get(User $user)
|
|
|
|
{
|
2022-12-16 23:20:43 +00:00
|
|
|
$log = '';
|
2022-08-09 19:57:43 +00:00
|
|
|
$userLogs = GameLogs::getUserLogs($user->getId());
|
2022-12-16 23:20:43 +00:00
|
|
|
foreach ($userLogs as $row) {
|
|
|
|
$log .= sprintf('<code>%s</code><br>', date('d.m.Y H:i ', strtotime($row['date'])) . $row['text']);
|
2022-08-09 19:57:43 +00:00
|
|
|
}
|
2022-12-16 23:20:43 +00:00
|
|
|
|
2022-08-09 19:57:43 +00:00
|
|
|
$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);
|
|
|
|
}
|
2022-12-16 23:20:43 +00:00
|
|
|
}
|