<?php
require_once 'include/contain.class.php';

if(isset($_COOKIE['login_auth'])) {
    list($User_uid, $User_username) = explode("\t", uc_authcode($_COOKIE['login_auth'], 'DECODE'));
    if($_GET['a']=='del'){
        if($_GET['edit']=='yes' and $_GET['qq']!=''){
            $qq=mysql_query("SELECT * FROM ".IQQOL_SQLTABLE."online 
WHERE `qq`='{$_GET['qq']}'",$con);
                $r=mysql_fetch_array($qq);
                if($r[username]==$User_username){
                    $i=mysql_query("DELETE FROM {$table}online
WHERE qq='{$_GET['qq']}'");
                    $mi=uc_get_user($User_username);
                    $msg = "[{$_GET['qq']}]相关记录已全部从数据库清空！#br##br#※以下为网站运行期间存储的聊天记录，已经全部为您导出#br#".urldecode($r[history]);
                    $head = "[{$_GET['qq']}]删除成功 - 已导出聊天记录";
                    mysql_query("INSERT INTO {$table}query (id,user,message,qq,email,noticeqq,head) VALUES (NULL,'$User_username','$msg','{$_GET['qq']}','{$mi['2']}','{$r[noticeqq]}','$head')");
                    if($i){
                        $state = $lang[system][delqq][delok];
                        $style->display('main/delqq.html');
                    }
                    else{
                        $state = $lang[system][delqq][delfalse];
                        $style->display('main/delqq.html');
                    }
                }
                else{
                    $state = $lang[system][delqq][qqfalse];
                    $style->display('main/delqq.html');
                }
        }
        else{
            $state = '<form method="post" action="in.php?action=delqq&a=del&qq='.$_GET['qq'].'&edit=yes">'.$lang[system][delqq][pl_input_isok].$lang[system][delqq][input_submit];
            $style->display('main/delqq.html');
        }
    }
}
else {
    $style->display('login.html');
}
?>