This commit is contained in:
2023-11-02 15:57:39 +02:00
parent a14232a899
commit def933dca4
51 changed files with 8866 additions and 12429 deletions
+28 -9
View File
@@ -7,20 +7,39 @@ class Delo
{
/**
* Запись в личное дело персонажа.
* @param int $uid
* @param string $dop
* @param string $text
* @param string $from
* @param float $moneyOut
* @param int $type
* @param int $uid кому пишется
* @param string $text текст
* @param string $from отправитель записи
* @param float $moneyOut количество денег снятых с игрока
* @param int $type цифровой тип лога (??)
* @return void
*/
public static function add(int $type, string $from, int $uid, string $text, float $moneyOut = 0, string $dop = '')
public static function add(int $type, string $from, int $uid, string $text, float $moneyOut = 0): void
{
$sql = 'insert into users_delo (uid, dop, time, city, text, login, `delete`, no_right, ip, moneyOut, type) values (?,?,unix_timestamp(),?,?,?,0,?,?,?,?)';
$sql = 'insert into users_delo (uid, time, text, login, `delete`, no_right, ip, moneyOut, type) values (?,unix_timestamp(),?,?,0,?,?,?,?)';
Db::sql($sql, [
$uid, $dop, 'capitalcity', $text, $from, '', UserIp::get(), $moneyOut, $type,
$uid, $text, $from, '', UserIp::get(), $moneyOut, $type,
]);
}
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]);
}
}