<?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']=='set'){
                $qq=mysql_query("SELECT * FROM ".IQQOL_SQLTABLE."online 
WHERE `qq`='{$_GET['qq']}'",$con);
                $r=mysql_fetch_array($qq);
        if($_GET['edit']=='yes' and $_GET['qq']!=''){
                if($r[username]==$User_username){
                if($_POST['time1'] < $_POST['time2']){
                    $i=mysql_query("UPDATE ".IQQOL_SQLTABLE."online
 SET `sid`='{$_POST['sid']}' 
 WHERE qq = '{$_GET['qq']}'");
                    $i.=mysql_query("UPDATE ".IQQOL_SQLTABLE."online
 SET noticeqq='{$_POST['noticeqq']}' 
 WHERE qq = '{$_GET['qq']}'");
                    $i.=mysql_query("UPDATE ".IQQOL_SQLTABLE."online
 SET login_status='{$_POST['ifonline']}' 
 WHERE qq = '{$_GET['qq']}'");
                    $i.=mysql_query("UPDATE ".IQQOL_SQLTABLE."online
 SET runtime='{$_POST['time1']}-{$_POST['time2']}' 
 WHERE qq = '{$_GET['qq']}'");
                    $i.=mysql_query("UPDATE ".IQQOL_SQLTABLE."online
 SET reply='{$_POST['reply']}' 
 WHERE qq = '{$_GET['qq']}'");
                    if($i){
                        $state = $lang[system][setqq][setok];
                        $style->display('main/delqq.html');
                        $head = "[{$_GET['qq']}]资料修改";
                        $mi=uc_get_user($User_username);
                        $msg="[{$_GET['qq']}]的资料已保存！";
                        mysql_query("INSERT INTO {$table}query (id,user,message,qq,email,noticeqq,head) VALUES (NULL,'$User_username','$msg','{$r['qq']}','{$mi['2']}','{$r[noticeqq]}','$head ')");
                    }
                    else{
                        $state = $lang[system][setqq][setfalse];
                        $style->display('main/delqq.html');
                    }
                    }
                    else{
                        $state = $lang[system][setqq][timefalse];
                        $style->display('main/delqq.html');
                    }
                }
                else{
                    $state = $lang[system][setqq][qqfalse];
                    $style->display('main/delqq.html');
                }
        }
        else{
            if($r[username]==$User_username){
                $style->display('main/setqq.html');
                }
             else {
                  $state=$lang[system][setqq][offline];
                 $style->display('main/setqq.html');
             }
        }
    }
}
else {
    $style->display('login.html');
}
?>