<?
if ($ank['garem_set3']==0){
if ($user['garem_set3']==0){
echo "<div class='p_m'>";
echo "<img src='/style/icons/garem.png' alt=''/> <a href='/garem/u_garem.php?id=$ank[id]'>Гарем $ank[nick]</a> ($ank[aa2])<br />";

if(intval($ank['aa1']) != 0)
{
$cena = ((($ank['aa3']-1)*100)+250);
if(isset($_GET['garemout']))
{
if($user['balls'] < $cena)
echo "<font color='red'><b>Недостаточно балов</b></font><br/>";
else
{
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `msg`, `time`) values('0', '".$ank['aa1']."', '".$msgno."', '".$time."')");
mysql_query("UPDATE `user` SET `balls` = `balls`-$cena, `aa1` = '' WHERE `id` = '".$user['id']."';");
}
}
if(!$etr)
{
$anker = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '".$ank['aa1']."' LIMIT 1"));
echo "<img src='/garem/img/user.png' alt=''/> В гареме у <a href='info.php?id=".$ank['aa1']."'><span style=\"color:$anker[ncolor]\">".$anker['nick']."</span></a><br />";
if($ank['id'] == $user['id'])
{
if ($ank['garem_set2']==0)
echo "<img src='/style/icons/wmr.png' alt=''/> <a href='/info.php?id=$user[id]&garemout'>Выкупить себя</a> [$cena баллов]<br/>";
}
}
}
if ($ank['garem_set']==0){
if (isset($user) && $user['id']!=$ank['id']){
if($ank['aa1'] != $user['id'] && $ank['pol'] != $user['pol']) echo "<img src='/garem/img/jurnal.png' alt=''/> <a href=\"/garem/krazh.php?id=$ank[id]\"> Украсть к себе в гарем</a><br />\n";
}
}
echo "</a></div>";
}
}
?>
