2023-07-28 21:18:04 +00:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Core\Db;
|
|
|
|
|
use User\UserIp;
|
|
|
|
|
|
|
|
|
|
class Delo
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Запись в личное дело персонажа.
|
2023-12-01 21:05:11 +00:00
|
|
|
|
* @param int $type цифровой тип лога (??)
|
|
|
|
|
* @param string $from отправитель записи
|
|
|
|
|
* @param int $uid кому пишется
|
|
|
|
|
* @param string $text текст
|
|
|
|
|
* @param float $moneyOut количество денег снятых с игрока
|
|
|
|
|
* @param float $moneyIn количество денег полученных игроком
|
2023-07-28 21:18:04 +00:00
|
|
|
|
* @return void
|
|
|
|
|
*/
|
2023-12-01 21:05:11 +00:00
|
|
|
|
public static function add(int $type, string $from, int $uid, string $text, float $moneyOut = 0, float $moneyIn = 0): void
|
2023-07-28 21:18:04 +00:00
|
|
|
|
{
|
2023-12-01 21:05:11 +00:00
|
|
|
|
$sql = 'insert into users_delo (uid, time, text, login, `delete`, no_right, ip, moneyOut, moneyIn, type) values (?,unix_timestamp(),?,?,0,?,?,?,?,?)';
|
2023-07-28 21:18:04 +00:00
|
|
|
|
Db::sql($sql, [
|
2023-12-01 21:05:11 +00:00
|
|
|
|
$uid, $text, $from, '', UserIp::get(), $moneyOut, $moneyIn, $type,
|
2023-07-28 21:18:04 +00:00
|
|
|
|
]);
|
|
|
|
|
}
|
2023-11-02 13:57:39 +00:00
|
|
|
|
|
|
|
|
|
public static function printPublicModerationStatus(int $userid): void
|
|
|
|
|
{
|
|
|
|
|
$status = Db::getValue('select text from users_delo where uid = ? and hb != 0 order by id desc limit 1', [$userid]);
|
|
|
|
|
if (!$status) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo <<<HTML
|
|
|
|
|
<div style="padding-left: 5px; margin: 5px 0;">
|
|
|
|
|
Сообщение от модераторов:<br>
|
|
|
|
|
<span style="color: red; background-color: bisque; font-weight: bold;">$status</span>
|
|
|
|
|
</div>
|
|
|
|
|
HTML;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function getAllByUserId(int $userid): array
|
|
|
|
|
{
|
|
|
|
|
return Db::getRows('select time, text from users_delo where uid = ? and type = 0 order by id desc', [$userid]);
|
|
|
|
|
}
|
2023-07-28 21:18:04 +00:00
|
|
|
|
}
|
|
|
|
|
|