Файл: modules/friends/delete.php
Строк: 39
<?php
/**
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) 2013, Taras Chornyi, Sergiy Mazurenko, Ivan Kotliar
* @link http://perf-engine.net
* @package PerfEngine
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
if(!User::logged())
{
header('location: /');
exit;
}
if($db->query("SELECT * FROM `friends` WHERE `id` = '". abs(intval($_GET['id'])) ."'")->rowCount() != 0)
{
$db->query("INSERT INTO `notify` SET `user_id` = '". abs(intval($_GET['id'])) ."', `from_id` = '". $user['id'] ."', `type` = 'notify_delete_friend', `read` = '0', `time` = '". time() ."'");
$db->query("DELETE FROM `friends` WHERE `id` = '". abs(intval($_GET['id'])) ."' LIMIT 1");
header('location: /friends/');
// print_r($db->errorInfo());
exit;
}
?>