Размер файла: 1.44Kb
<?php
require '../inc/func.php';
bk_head('Eject Friend Requests');
require '../inc/head.php';
if (!$user)
{
header('location: index.php') ;
}
$fid = (isset($_GET['fid'])) ? num($_GET['fid']) : NULL;
if(empty($fid)){
header('location: /index.php');
}
$ch_fid = mysql_query("SELECT `id` FROM `users` WHERE `id` = '".$fid."' ");
if(!mysql_num_rows($ch_fid)){
header('location: /index.php');
}
echo '<div class="list1"><div class="tt"> '.$lng_friends['rm'].'</div>';
$q_reqs = mysql_query("SELECT id FROM friend_reqs WHERE (uid = $userid AND fid = $fid) OR (uid = $fid AND fid = $userid)");
$q_f = mysql_query("SELECT id FROM friends WHERE (uid = $userid AND fid = $fid) OR (uid = $fid AND fid = $userid)");
if (!mysql_num_rows($q_reqs))
{
err ('ko thể từ chối '. user_info($fid, 'username') .'');
}else{
$req = mysql_query("DELETE FROM friend_reqs WHERE (uid='$userid' AND fid='$fid') OR (uid='$fid' AND fid='$userid') ");
if ($req)
{
err (''.$lng_friends['dnsuccess'].' '. user_info($fid, 'username') .'');
mysql_query("OPTIMIZE TABLE `friend_reqs`");
}
else
{
err (''.$lng_friends['cdn'].' '. user_info($fid, 'username') .'!');
}
}
echo '» <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();
?>