Файл: public_html/plea_msg.php
Строк: 18
<?php
include ('./system/system.php');
$title = 'Жалобы';
include ('./system/head.php');
if(!$user) {
header('location: /index.php');
exit();
}
if($user['access'] == 0) {
header('location: /game.php');
exit();
}
if(isset($_GET['read'])) {
$r = _string(_num($_GET['id']));
mysql_query('update `plea` set `read` = "1", `id_read` = "'.$user['id'].'" where `id` = "'.$r.'"');
header('location: ?');
exit();
}
$max = 10;
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `plea` WHERE `read` = '0'"),0);
$k_page = k_page($k_post,$max);
$page = page($k_page);
$start = $max*$page-$max;
$q = mysql_query("SELECT * FROM `plea` WHERE `read` = '0' ORDER BY `time` DESC LIMIT $start, $max");
while($p = mysql_fetch_assoc($q)) {
echo '<div class="block"><a href="/profile.php?id='.$p['id_user_plea'].'" class="none">Профиль отправителя</a><br><a href="/profile.php?id='.$p['id_user'].'" class="none">Профиль нарушителя</a> <br>Причина жалобы: '.$p['plea'].' <br> Отправлена: '.vremja(time() - $p['time']).' назад</div>';
echo '<a href="?read&id='.$p['id'].'" class="link"><img src="/images/icons/forward.png"> Закрыть</a>';
}
if($k_post<1) {
echo '<div class="block small red center">Новых жалоб нет!</div>';
}
if($k_page>1) echo str('?',$k_page,$page);
include ('./system/foot.php');
?>