Файл: modules/friends/delete.php
Строк: 23
<?php
if(!isset($user)) {
header('location: /');
exit;
}
if($db->query("SELECT * FROM `friends` WHERE `id` = '". abs(intval($_GET['id'])) ."'")->rowCount() != 0)
{
$friend = $db->query("SELECT * FROM `friends` WHERE `id` = '". abs(intval($_GET['id'])) ."'")->fetch();
$db->query("DELETE FROM `friends` WHERE `user_id` = '". $friend['friend_id'] ."' AND `friend_id` = '". $friend['user_id'] ."' LIMIT 1");
$db->query("DELETE FROM `friends` WHERE `id` = '". abs(intval($_GET['id'])) ."' LIMIT 1");
$db->query("INSERT INTO `notify` SET `user_id` = '". $friend['user_id'] ."', `from_id` ='". $user['id'] ."', `type` = 'notify_delete_friend', `read` = '0', `time` = '". time() ."'");
header('location: /friends/');
// print_r($db->errorInfo());
exit;
}
?>