<?

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

    $id = $_SESSION['panel_user'];
    $user = mysql_fetch_assoc(mysql_query("SELECT * FROM `profile` WHERE `id` = '".$id."'"));
    
    #########Проверка на доступ##########
    $ban_info = mysql_fetch_assoc(mysql_query("SELECT * FROM `banip` WHERE `ban_id` = '".$id."'"));
    $user_mod = mysql_fetch_assoc(mysql_query("SELECT * FROM `profile` WHERE `id` = '".$ban_info['ban_mod']."'"));
    if ( $user_mod['level'] > $level_session ) {
        echo link2 . 'Ошибка доступа' . div;
        navig();
        foot();
        exit();
    }
    
    
    
$result = mysql_query("DELETE FROM `banip` WHERE `ban_id` = '".$user['id']."'");
    
    if ( $result != NULL ) {
        
        echo rew('list.php');
        
    } else {
        
        echo link1 . 'Возникла ошибка' . div;
        
    }