<?
include '../config.php';
include '../func.php';

head();
aut();
ban();
////////////////////////////////////////
mysql_query("UPDATE `profile` SET `online` = 'fo' WHERE `id` = '".$id_session."'");

if ( isset($_GET['addcerr']) ) echo link1 . 'Ошибка при создании каталога' . div;

echo head . "<b>Обменник файлов</b>" . div;   

echo link1;
echo "<a href=\"new.php\">Новые </a> | <a href=\"usfiles.php?user=".$id_session."\">Мои файлы</a> | <a href=\"search.php\">Поиск</a>";
if ( $level_session >= 3) echo ' | <a href="admin.php?mod=add_cat"> Создать каталог</a>';
echo div;

$result = mysql_query("SELECT * FROM fo_cat");
while($cat = mysql_fetch_assoc($result)){
    $all = mysql_result(mysql_query("SELECT count(*) FROM `fo_fil` WHERE `cat` = '".$cat['id']."'"), 0);

    echo link2 . "<img src=\"../images/dir.png\" alt=\".\" /> <a href=\"cat.php?cat=".$cat['id']."\">".$cat['name']."</a> [".$all."]</div>";

}


echo div;
/////////////////////////////////////////

navig();
foot();
?>