File size: 1.58Kb
<?php
require_once(HOME .'/incfiles/header.php');
///Определяем название текущей директории
$rezcat = mysql_query("SELECT * FROM `loads_cat` WHERE `id` = '".($_GET['id'])."'");
$dname = mysql_fetch_assoc($rezcat);
$catcount = mysql_result(mysql_query("SELECT COUNT(*) FROM `loads` WHERE `cat_id` = '".$_GET['id']."' "), 0);
$loadsnames = mysql_query("SELECT * FROM `loads_cat` WHERE `id` = '".($_GET['id'])."'");
$namening = mysql_fetch_assoc($loadsnames);
$dname= $namening['name'];
///
echo '<div class="title">Загрузки | '.$dname.'</div>';
if ($catcount==0){echo '<div class="menu">Файлов ещё нет!</div>';}
if ($user['id']>=1){
$user_obj=$user['object'];
}
else {
$user_obj="6";
}
nav_start($postcount, $user_obj);
$catcount_result = mysql_query(" SELECT * FROM `loads` WHERE `cat_id` = '".($_GET['id'])."' ORDER BY `id` DESC LIMIT $start, $user_obj");
while($cat = mysql_fetch_assoc($catcount_result)){
$cat_name= $cat['name'];
$file_id = $cat['id'];
$cat_opis = $cat['opis'];
echo '<div class="menu">
<a href="/loads/view.php?id='.$file_id.'"><b>'.output($cat_name).'</b></a>
</div>';
}
view_nav('?id='. num($_GET['id']) .'&');
if ($user['id']<2){
echo '<div class="block">
<a href="/">На главную</a>
</div>';
}
if ($user['level']==2){
echo '<div class="block">
<a href="/loads/admin.php?act=add&id='.$_GET['id'].'">Добавить файл</a>
</div>';
echo '<div class="block">
<a href="/">На главную</a>
</div>';
}
require_once(HOME .'/incfiles/footer.php');
?>