Перенос разрозненных файлов в фабрику. Утилизация неиспользуемых функций. #49

This commit is contained in:
2023-12-05 03:01:04 +02:00
parent 98f4cbcef3
commit 7a5fd62f1e
79 changed files with 12178 additions and 12956 deletions
@@ -0,0 +1,36 @@
<?php
namespace Moderation;
use Core\Db;
use DateTime;
use DateTimeImmutable;
use User;
class UserRegistrationList
{
public function get(DateTime $date)
{
$from = $date->getTimestamp();
$to = $date->modify('+ 1 day')->getTimestamp();
$list = Db::getRows("select id, banned, molch1, battle, host_reg, online from users where timereg between ? and ? and bot_id = 0 and bithday != '01.01.1800' order by id", [$from, $to]);
$str = '';
foreach ($list as $user) {
$time = new DateTime();
$loginColor = 'black';
if ($user['banned']) {
$loginColor = 'red';
}
if ($user['online'] > $time->modify('- 10 minutes')->getTimestamp()) {
$loginColor = 'green';
}
if ($user['molch1'] > 0) {
$molch1Duration = new DateTimeImmutable($user['molch1']);
}
$str .= "<li><span style='color: $loginColor'>" . User::getLogin($user['id'] . "</span>");
}
}
}