<?

include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';

only_reg();
$set['title']='Аудиоальбомы';

include_once '../sys/inc/thead.php';
title();
err();
//aut();
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `audio_album`"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
echo "<table class='post'>\n";
$q=mysql_query("SELECT * FROM `audio_album` ORDER BY id DESC LIMIT $start, $set[p_str]");
if (mysql_num_rows($q)==0) {
echo "   <tr>\n";
echo "  <td class='p_t'>\n";
echo "Нет Аудиоальбомов\n";
echo "  </td>\n";
echo "   </tr>\n";
}
while ($audio = mysql_fetch_assoc($q))
{
echo "   <tr>\n";
echo "  <td class='p_t'>\n";
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$audio[id_user]'"));
echo "<img src='name.gif' /> <a href='album.php?id=$audio[id]'>".output_text($audio['name'])."</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `audio_user` WHERE `id_album`='$audio[id]'"),0).")<br />";
echo "<img src='user.gif' /> ";
echo online($ank['id'])." <a href='/info.php?id=$ank[id]' title='Анкета \"$ank[nick]\"'><b>$ank[nick]</a><br/>\n";
if($audio['opis']!=0)echo "<img src='opis.gif' /> ".output_text($audio['opis'])."<br />";
echo "<img src='time.png' /> ".vremja($audio['time']);
echo "  </td>\n";
echo "  </tr>\n";
}
echo "</table>\n";
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
echo "<div class='foot'>\n";
echo "<img src='add.png' /> <a href='albumadd.php'>Добавить альбом</a><br />\n";
if($user['level']>0)echo "<img src='set.png' /> <a href='admin.php'>Админка</a><br />\n";
echo "</div>\n";
include_once '../sys/inc/tfoot.php';
?>