2023-12-05 01:01:04 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Moderation;
|
|
|
|
|
|
|
|
use Core\Db;
|
|
|
|
use User;
|
|
|
|
|
|
|
|
class UserRegistrationList
|
|
|
|
{
|
2023-12-19 01:58:37 +00:00
|
|
|
/** Регистрации персонажей: только для администраторов.
|
2023-12-08 15:55:27 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public static function get(): void
|
2023-12-05 01:01:04 +00:00
|
|
|
{
|
2023-12-08 15:55:27 +00:00
|
|
|
$query = "select users.id, host_reg, banned, battle, online, molch1
|
|
|
|
from users left join stats on users.id = stats.id
|
|
|
|
where bithday != '01.01.1800' and bot = 0 and timereg between ? and ? order by users.id";
|
|
|
|
$pld520 = date('d.m.Y');
|
|
|
|
if (isset($_POST['loginLD520'])) {
|
|
|
|
$pld520 = $_POST['loginLD520'];
|
|
|
|
}
|
|
|
|
$pld520TS = strtotime(str_replace(".", "-", $pld520));
|
|
|
|
$pld520 = date('d.m.Y', $pld520TS);
|
|
|
|
?>
|
|
|
|
<script>
|
|
|
|
const regx = document.getElementById('loginLD520')
|
2023-12-05 01:01:04 +00:00
|
|
|
|
2023-12-08 15:55:27 +00:00
|
|
|
function regprev() {
|
|
|
|
regx.value = '<?= date('d.m.Y', ($pld520TS - 86400)) ?>';
|
2023-12-05 01:01:04 +00:00
|
|
|
}
|
|
|
|
|
2023-12-08 15:55:27 +00:00
|
|
|
function regnext() {
|
|
|
|
regx.value = '<?= date('d.m.Y', ($pld520TS + 86400)) ?>';
|
2023-12-05 01:01:04 +00:00
|
|
|
}
|
2023-12-08 15:55:27 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div style="padding:0 10px 5px 10px; margin:5px; border-bottom:1px solid #cac9c7;">
|
2023-12-19 01:58:37 +00:00
|
|
|
<h4>Регистрации персонажей</h4>
|
|
|
|
<label for="loginLD520">Дата регистрации</label>
|
2023-12-08 15:55:27 +00:00
|
|
|
<input name="pometka520" class="btn btn-success" onclick="regprev()" type="submit" value="«"/>
|
|
|
|
<input value="<?= $pld520 ?>" name="loginLD520" type="text" id="loginLD520" size="20" maxlength="10"/>
|
|
|
|
<input name="pometka520" class="btn btn-success" onclick="regnext()" type="submit" value="»"/>
|
2023-12-19 01:58:37 +00:00
|
|
|
<input type="submit" name="pometka520" id="pometka520" class="btn" value="Показать"/>
|
2023-12-08 15:55:27 +00:00
|
|
|
<?php if (isset($_POST['pometka520'])): ?>
|
2023-12-19 01:58:37 +00:00
|
|
|
<br><b style="color: red;">Персонажи зарегистрированные <?= $pld520 ?></b>
|
2023-12-08 15:55:27 +00:00
|
|
|
<ol>
|
|
|
|
<?php foreach (Db::getRows($query, [$pld520TS, $pld520TS + 86400]) as $pl):
|
|
|
|
$logincolor = match (true) {
|
|
|
|
$pl['banned'] > 0 => 'red',
|
|
|
|
$pl['online'] > time() - 520 => 'green',
|
|
|
|
default => 'black',
|
|
|
|
};
|
|
|
|
?>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
<span style="color: <?= $logincolor ?>"> <?= User::getLogin($pl['id']) ?> </span>
|
|
|
|
<?php if ($pl['molch1'] > time()): ?>
|
2023-12-19 01:58:37 +00:00
|
|
|
<i>(молчит)</i>
|
2023-12-08 15:55:27 +00:00
|
|
|
<?php endif; ?>
|
|
|
|
<?php if ($pl['battle'] > 0): ?>
|
2023-12-19 01:58:37 +00:00
|
|
|
<a href="/logs.php?log=<?= $pl['battle'] ?>" target="_blank">(в бою)</a>
|
2023-12-08 15:55:27 +00:00
|
|
|
<?php endif; ?>
|
|
|
|
<?php if ($pl['host_reg'] > 0): ?>
|
2023-12-19 01:58:37 +00:00
|
|
|
<small>(реферал персонажа <?= User::getLogin($pl['host_reg']) ?>)</small>
|
2023-12-08 15:55:27 +00:00
|
|
|
<?php endif; ?>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ol>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
<?php
|
2023-12-05 01:01:04 +00:00
|
|
|
}
|
2023-12-08 15:55:27 +00:00
|
|
|
}
|