<?php
require_once('../classes/body.class.php');
require_once('../classes/db.class.php');
require_once('../classes/system.class.php');
$title= new Body;
$title->SetTitle(homeurl.' - Журналисты');
$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> :: Редакторы новостей</div></div></div>';

$sql = DB::$dbs->query("SELECT * FROM blogger WHERE jur > ? ORDER BY jur DESC", [0]);
if ($sql->rowCount() == 0) {
err('никого нет!');
}
while($a = $sql->fetch()) {
echo '<div class="list-group-item media">'.Nick($a['id']).' (<a href="?i=zapis&id='.$a['id'].'">Статей:</a> '. DB::$dbs->querySingle("SELECT COUNT(id) FROM gazeta_article WHERE user_id = ?", [$a['id']]).') </div>';
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
$id = abs((int)$_GET['id']);
if (empty($id) OR $id == 0) {
header('Location: /');
}
echo '<div class="catSides"><a href="/"><i class="md-format-list-bulleted"></i> Главная </a> - <a href="index.html">Информация</a> - Статьи '.Nick($id).'</div>';
$look = DB::$dbs->querySingle("SELECT COUNT(id) FROM gazeta_article WHERE user_id = ?", [$id]);
$num = 10;
$k_page = k_page($look, $num);
$page = page($k_page);
$start = $num*$page-$num;
$sql = DB::$dbs->query("SELECT * FROM gazeta_article WHERE user_id = ? ORDER BY id DESC LIMIT $start,$num", [$id]);
if ($sql->rowCount() == 0) {
err('Ничего нет!');
}
while($a = $sql->fetch()) {
echo '<div class="row text_box"><a href="/allnews/news.html?id='.$a['id'].'"><i class="md-forum"></i> '.$a['name'].'</a> ('.vr($a['time']).')</div>';
}
if ($k_page>1) {
str('?i=zapis&id='.$id.'&', $k_page,$page);
}
*/
$title->GetMenu();
$title->GetFooter();
?>
