<?php
$title->SetTitle('Маркет - Новые комментария');
$title->GetHeader();
echo'<div class="tile"><div class="t-header th-alt bg-teal"><div class="th-title"><i class="zmdi zmdi-widgets"></i><a href="/"style="text-decoration:none; color:white;"> Главная</a> :: <a href="/market"style="text-decoration:none; color:white;"> Маркет</a> :: Новые комментария</div></div></div>';
$count = DB::$dbs->querySingle("SELECT COUNT(id) FROM magazin_komm WHERE time > ?", [time()-86400]);
if ($count == 0) {
echo '<div class="alert alert-danger"role="alert">Новых комментариев  нет!</div>';
} else {
$sql = DB::$dbs->query("SELECT * FROM magazin_komm WHERE time > ? ORDER BY time DESC", [time()-86400]);
while($a = $sql -> fetch()) {
$file = DB::$dbs->queryFetch("SELECT * FROM magazin_file WHERE id = ? LIMIT 1", [$a['file']]);
echo '<div class="list-group-item media">'.Nick($a['user_id']).' ('.vr($a['time']).')<br/>'.text(nl2br($a['text'])).'<br/> <i class="zmdi zmdi-shuffle"></i> К файлу: [<a href="file/'.$file['id'].'">'.$file['name'].'</a>]</div>';
}
}
?>