<?

include '../../config.php';
include '../../func.php';
head();


$id = num($_SESSION['panel_user']);
$user = mysql_fetch_assoc(mysql_query("SELECT * FROM `profile` WHERE `id` = '".$id."'"));

if ( $_GET['yes'] != 1 ) {
    
    echo 'Вы уверене что хотите удалить '.$user['login'].'?<br/ > [<a href="del.php?yes=1">Да</a>] [<a href="index.php">Нет</a>]<br/ >';
    
} else {
    
    $result = mysql_query("DELETE FROM `profile` WHERE `id` = '".$id."'");
    mysql_query("DELETE FROM `chat_msg` WHERE `user_ot` = '".$id."'");
    mysql_query("DELETE FROM `chat_msg` WHERE `user_ot` = '".$id."'");
    mysql_query("DELETE FROM `mail` WHERE `user_ot` = '".$id."'");
    
    if ( $result != NULL ) echo 'Пользователь удален'; else echo 'Возникла ошибка';
    
}
    
    
    
    
    