Размер файла: 818B
<?php
include 'inc/db.php';
include 'inc/1.php';
if (!$user)
{
header('Location: /aut.php');
exit();
}
$q=mysql_query("SELECT * FROM `friends` WHERE (`user1` = '$user[id]' OR `user2` = '$user[id]') AND `ok` = '0' AND `who` <> '$user[id]'");
if (mysql_num_rows($q)==0)
{
echo '<div class="msg">Новых заявок нет.</div>';
include 'inc/foot.php';
exit();
}
while ($f=mysql_fetch_assoc($q))
{
if ($f['user2']==$user['id'])$aid=$f['user1'];
else
$aid=$f['user2'];
$ank=mysql_fetch_assoc(mysql_query("SELECT `id`, `name` FROM `user` WHERE `id` = '$aid'"));
echo "<div class='p0'>
".im($aid)." $ank[name] (".vremja($f['timesend']).")
<br />
[<a href='/frok.php?id=$f[id]'>Принять</a>] [<a href='/frno.php?id=$f[id]'>Отклонить</a>]
</div>";
}
include 'inc/foot.php';
?>