<?
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';

if (!isset($user) && !isset($_GET['id'])){header("Location: /index.php?".SID);exit;}
if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$ank[id]' LIMIT 1"),0)==0){header("Location: /index.php?".SID);exit;}
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $ank[id] LIMIT 1"));




$set['title']='Отзывы об '.$ank['nick'].'';
include_once 'sys/inc/thead.php';
title();
aut();
echo "Вернуться к <a href='/info.php?id=$ank[id]'>$ank[nick]</a>\n";



$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user_voice2` WHERE `id_kont` = '$ank[id]'"),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";
if ($k_post==0)
{
echo "   <tr>\n";
echo "  <td class='p_t'>\n";
echo "Нет положительных отзывов\n";
echo "  </td>\n";
echo "   </tr>\n";

}

$q=mysql_query("SELECT * FROM `user_voice2` WHERE `id_kont` = '$ank[id]' LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q))
{
$ank=get_user($post['id_user']);
echo "   <tr>\n";
if ($set['set_show_icon']==2){
echo "  <td class='icon48' rowspan='2'>\n";
avatar($ank['id']);
echo "  </td>\n";
}
elseif ($set['set_show_icon']==1)
{
echo "  <td class='icon14'>\n";
echo "  </td>\n";
}


if($num==1){ 
echo "<div class='rowdown'>"; 
$num=0;
}else{ 
echo "<div class='rowup'>"; 
$num=1;}
echo "".online($ank['id'])."<a href='/info.php?id=$ank[id]'>$ank[nick]</a><br />";

if ($set['set_show_icon']==1)
echo "Отзыв:\n";
switch ($post['rating'])
{
case 2:echo "Замечательный<br />\n";	break;
case 1:echo "Положительный<br />\n";	break;
case 0:echo "Нейтральный<br />\n";	break;
case -1:echo "Не очень...<br />\n";	break;
case -2:echo "Негативный<br />\n";	break;
}


}
echo "</div>\n";






echo "</div>\n";




include_once 'sys/inc/tfoot.php';
?>