Файл: public_html/modules/friends/delete.php
Строк: 27
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.net *
* ------------------------------- *
* @package: PerfCMS Ultra *
* @year: 2013 *
* @author: wanya26ua & Tesla *
* @link: http://perfclub.ru *
**********************************/
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;
}
?>