<?

############ HTTP://WWW.INDWAP.TK ##########################
############ HTTP://WWW.INDWAP.TK ##########################
############ HTTP://WWW.INDWAP.TK ##########################


if(isset($user)){
$bq = mysql_query("SELECT * FROM `user` ORDER BY rand() LIMIT 1;");
echo '<div class="penanda">People you may know</div>';
echo "<table class='post'>\n";
while ($ank = mysql_fetch_array($bq))
{
echo "<tr><td class='icon14' rowspan='2'><a href='/info.php?id=$ank[id]'>";
avatar($ank['id']);

############ HTTP://WWW.INDWAP.TK ##########################

echo "</a></td></tr>";
echo "<tr><td valign='top'><a href=\"/info.php?id=$ank[id]\">$ank[nick]</a><br /><a href=\"/mail.php?id=$ank[id]\">Sent message</a><br />\n";

$d1sql = mysql_query("SELECT COUNT(*) FROM `frends_new` WHERE (`user` = '$user[id]' AND `to` = '$ank[id]') OR (`user` = '$ank[id]' AND `to` = '$user[id]') LIMIT 1");
$d2sql = mysql_query("SELECT COUNT(*) FROM `frends` WHERE (`user` = '$ank[id]' AND `frend` = '$user[id]') OR (`user` = '$user[id]' AND `frend` = '$ank[id]') LIMIT 1");
if (isset($user) && $user['id']!=$ank['id'] && mysql_result($d1sql, 0)==0 && mysql_result($d2sql, 0)==0)
{
echo '<a href="/frend_add.php?id='.$ank['id'].'">Add as friends</a><br />';
}
else{
echo '<a href="frend.php?id='.$ank['id'].'">View friends</a><br/>';
}
}
############ HTTP://WWW.INDWAP.TK ##########################

echo '</td></tr></table>';
echo '<div class="status"><a href="users.php">See more suggestions</a> </div>';
}
?>
