<?php
include_once('core/base.php');
include_once('core/func.php');
$header = 'Журнал действий';
include_once('core/head.php');
falseauth();
DB::getInstance()->query("UPDATE `user_notification` SET `read` = ? AND `id_user`=? ", ['yes', $u['id']]);
$set['p_str'] = 15;
$k_post = $base->querySingle("SELECT COUNT(*) FROM `user_notification` WHERE `id_user`='" . $u['id'] . "' ");
$k_page = $Navigator->k_page($k_post, $set['p_str']);
$page = $Navigator->page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
$q = $base->query("SELECT * FROM `user_notification` WHERE `id_user`='" . $u['id'] . "' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
if ($k_post == 0)
echo Func::div('error center') . 'Пусто';
echo "<div class='info '>";
$i = 0;
$out = DB::getInstance()->query("SELECT * FROM `user_notification` WHERE `id_user`='" . $u['id'] . "' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
foreach ($out as $key => $user_notification) {
$i++;
echo Func::span('quality_5') . ($i + $start) . '. ' . SPAN_CLOSE . $user_notification['text'] . Func::div('center') . Func::span('grey') . tl(time() - $user_notification['time']) . ' назад' . DIV_CLOSE . SPAN_CLOSE;
echo div('razriv1 marg_s_5') . DIV_CLOSE;
}
if ($k_post > 15) {
str('?', $k_page, $page); // Вывод страниц
}
echo DIV_CLOSE;//close div chat
include_once('core/foot.php');