include_once '../../sys/inc/start.php'; include_once '../../sys/inc/compress.php'; include_once '../../sys/inc/sess.php'; include_once '../../sys/inc/home.php'; include_once '../../sys/inc/settings.php'; include_once '../../sys/inc/db_connect.php'; include_once '../../sys/inc/ipua.php'; include_once '../../sys/inc/fnc.php'; include_once '../../sys/inc/user.php'; only_reg(); // Размер подарков при выводе в браузер $width = ($webbrowser == 'web' ? '250' : '250'); // Подарок $post = mysql_fetch_assoc(PDO("SELECT * FROM `gifts_user` WHERE `id` = '" . my_esc($_GET['id']) . "' LIMIT 1")); // Если записи нет кидаем на главную if (!$post) { $_SESSION['err'] = 'Такого подарка нет!'; header('location:/user/gift/index.php?id='.$post['id_user']);exit; } // Сам Подарок $gift = mysql_fetch_assoc(PDO("SELECT id,name FROM `gift_list` WHERE `id` = '" . $post['id_gift'] . "' LIMIT 1")); // Кому подарили $ank = get_user($post['id_user']); // Кто подарил $anketa = get_user($post['id_ank']); $black =mysql_fetch_assoc(mysql_query("SELECT * FROM `user_black` WHERE `id_user` = '".$ank['id']."' AND `id_black` = '".$user['id']."' AND (`time`='0' OR `time`>'$time' ) AND `razdel` LIKE '%info%' LIMIT 1")); if($black){header('location:/user/blacklist/?func=ban&id='.$ank['id']);exit;} // Удаление подарка if (isset($_GET['delete']) && ($ank['id'] == $user['id'] || user_access('delete_gifts'))) { $pizda = mysql_fetch_assoc(mysql_query("SELECT * FROM `gifts_user` WHERE `id` = '".$post['id']."' LIMIT 1")); if(!$pizda){ $_SESSION['err'] = 'Такого подарка нет!'; header('location:/user/gift/index.php?id='.$post['id_user']);exit; } mysql_query("DELETE FROM `gifts_user` WHERE `id` = '$post[id]' LIMIT 1"); mysql_query("OPTIMIZE TABLE `gifts_user` "); // Сообщение $_SESSION['message'] = 'Подарок успешно удалён'; header("Location: index.php"); exit; } // Заголовок страницы if($user['id'] == $ank['id']){ if($post['anonim'] ==0){ $set['title'] = 'Подарок от ' .$anketa['nick'].''; } if($post['anonim'] ==1){ $set['title'] = 'Подарок от ' .$anketa['nick'].''; } if($post['anonim'] =='2'){ $set['title'] = 'Подарок от Неизвестный '; } }else{ if($post['anonim'] ==0){ $set['title'] = 'Подарок от ' .$anketa['nick'].''; } if($post['anonim'] =='1'){ $set['title'] = 'Подарок от Неизвестный '; } if($post['anonim'] =='2'){ $set['title'] = 'Подарок от Неизвестный '; } } include_once '../../sys/inc/thead.php'; title(); aut(); // Подарок echo '
'; // Автор подарка echo ' '; if ($ank['id'] == $user['id']) { echo ' '; } echo ''; include_once '../../sys/inc/tfoot.php'; ?>