Просмотр файла friends/requests.php

Размер файла: 1.96Kb
<?php 

require '../inc/func.php';
bk_head('Friends Request');
require '../inc/head.php'; 

if (!$user)
{
header('location: /index.php') ;
}





echo '<div class="list1"><div class="tt">'.$lng_friends['trq'].'</div>';


$total = mysql_result(mysql_query("SELECT COUNT(*) FROM friend_reqs WHERE fid = '$userid'"),0);

$display = 3;
$count_pages = ceil($total/$display);
$page = (isset($_GET['page']) and is_numeric($_GET['page']) and $_GET['page']>1 and $_GET['page']<=$count_pages) ? $_GET['page'] : 1;
$start = $page*$display-$display;

$q = mysql_query("SELECT * FROM friend_reqs WHERE fid='$userid' ORDER BY time DESC LIMIT $start, $display ");

if($total > 0){
while ($req = mysql_fetch_assoc($q))
{
$u = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '$req[uid]' "));		
echo '<div class="list1">
 <table>
 <tr>';
 if($u['avatar']){
 echo'
 <td><img src="/gallery/photos/'.$u['id'].'/micro/'.$u['avatar'].'" width="35" heigth="50" /></td>';
 }else{
 echo '<td><img src="/images/'.$u['gender'].'.png" width="35" heigth="50" /></td>';
 }
echo ' <td> &nbsp;<a href="/users/profile.php?id='. $req['uid'] .'">'. user_info($req['uid'], 'username') .'</a> ';
echo '<br />&nbsp;<span>
<a href="accept.php?fid='. $req['uid'] .'"><b><input type="button" value="'.$lng_friends['ac'].'" class="green"></b></a>&nbsp;<a href="deny.php?fid='. $req['uid'] .'"><b><input type="button" value="'.$lng_friends['dn'].'" class="blue"></b></a></span>';
echo '</td></tr>
</table>';
echo '</div>';		

}

}
else 
{
    err (''.$lng_friends['norq'].'');
}
echo '<br />';

if($total > 3 && $page < $count_pages)
{
echo '<div class="shadow">';
pages($page,$count_pages,'?page=');
echo '</div>';
}

echo '&raquo; <a href="index.php">'.$lng_friends['back'].'</a><hr><div class="shadow"><a href="/users/my.php"><b>My Menu</b></a> | <a href="/u/'.$userid.'"><b>Profile</b></a> | <a href="/exit.php"><b>LogOut</b></a></div></div>';

bk_foot();
?>