Файл: public_html/modules/notifications.php
Строк: 35
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include_once ($root.'/core/base.php');
falseauth();
$header = "Уведомления";
include_once ($root.'/core/head.php');
$notReadNot = $db->query("SELECT * FROM `notifications` WHERE `user` = '".$u['id']."' AND `read` = '0'")->num_rows;
if($notReadNot > 0)
{
$db->query("UPDATE `notifications` SET `read` = '1' WHERE `user` = '".$u['id']."'");
redirect('/notifications');
}
$count = $db -> query("SELECT * FROM `notifications` WHERE `user` = '".$u['id']."' ORDER BY `time` DESC") -> num_rows;
$k_page = k_page($count,10);
$page = page($k_page);
$start = 10*$page-10;
$sql = $db -> query("SELECT * FROM `notifications` WHERE `user` = '".$u['id']."' ORDER BY `time` DESC LIMIT $start, 10");
if($count == 0) echo '<div class = "notice_container"><div class="gborder notice_alert alert-success">Уведомлений нет!</div></div>';
while($q = $sql->fetch_object())
{
echo '<div class = "notice_container"><div class="gborder notice_alert alert-success">'.$q->text.'</div></div>';
}
if($count >= 10) echo str('/notifications/?', $k_page, $page);
include_once ($root.'/core/foot.php');