Файл: anibiliwar.ru/new_year_get_last.php
Строк: 31
<?php
include_once __DIR__ . '/system/common.php';
$config = include_once __DIR__ . '/system/new_year_config.php';
$result = [];
$data = mysql_query("
select n.id,n.secret_name,n.time,u.login,u.r from new_year as n
left join users as u on u.id = n.user_id
order by n.id desc limit 10
");
if (mysql_num_rows($data) == 0) {
echo 'Еще подарков никто не получил!';
} else {
while ($row = mysql_fetch_assoc($data)) {
$text = 'Игрок %s %s получил награду %s ';
$vars = [
"<img src ='/images/icon/race/{$row['r']}.png' alt = ''> ",
$row['login'],
$config['rewards'][$row['secret_name']]['html']
];
$text = sprintf($text,
$vars[0],
$vars[1],
$vars[2]
);
$text .= '| <font color = "#2d2d2d"> '.date('H:i',$row['time']).'</font> <br>';
$result[] = $text;
}
foreach ($result as $one_result) {
echo $one_result;
}
}