Файл: admins/moderation.php
Строк: 26
<?
include_once $_SERVER['DOCUMENT_ROOT'].'/core/system.php';
$title='Управление Новостями';
include_once $_SERVER['DOCUMENT_ROOT'].'/design/heads.php';
title($title);
nav();
access(1);
if (isset($_GET['edit_save']))
{
mysql_query("update `files_file` set `moder` = '1' where `id` = '".intval($_GET['edit_save'])."'");
$_SESSION['msg'] = 'ok';
header('Location: ?');
}
if (isset($_GET['del']))
{
mysql_query("DELETE FROM `files_file` WHERE `id` = '".intval($_GET['del'])."' LIMIT 1");
$_SESSION['msg'] = 'Удаленo';
header('Location: ?');
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `files_file` where moder = '0'"), 0);
$k_page=k_page($k_post,$count_page);
$page=page($k_page);
$pages=$count_page*$page-$count_page;
$q = mysql_query("SELECT * FROM `files_file` where moder = '0' ORDER BY id DESC LIMIT $pages, $count_page");
if ($k_post==0)
{
echo '<div class="row">Пусто</div>';
}
while ($post = mysql_fetch_assoc($q))
{
echo '<div class="lines">
</div><div class="block"><div class="row">';
$url = '/files/icons/';
echo "<a class='gsilka' href='/files/file.php?id=$post[id]'><img src='/path/icons/$post[type].png' width='16'> $post[name] [".size_file($post['size'])."] $k_ns</a>";
echo '<a href="moderation.php?page=$page&del='.$post['id'].'">Удалить</a> /
<a href="moderation.php?page=$page&edit_save='.$post['id'].'">Принять</a>';
echo '</div></div> ';
}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
include_once $_SERVER['DOCUMENT_ROOT'].'/design/footer.php';
?>