<?php
require_once 'include/contain.class.php';
$q_info = mysql_fetch_array(mysql_query("SELECT * from `".$table."online` WHERE `qq`='".$_REQUEST['qq']."'"));
    list($User_uid, $User_username) = explode("\t", uc_authcode($_COOKIE['login_auth'], 'DECODE'));
            if($_GET['edit']=='yes'){
                $mqq = new SET_MQQ($_REQUEST['qq'], $q_info['pass']);
            $rand = json_decode($mqq->Verifycode($_REQUEST['verifycode']) , true);
            if ($rand[status] != 'ok') {
                if ($rand[status] == 'vc') {
                    $filename = 'libs/Cache/'.md5($rand['res']) . '.png';
                    $fp = fopen($filename, 'w');
                    fwrite($fp, $mqq->HexToText($rand['res']));
                    fclose($fp);
                    $state = '<form method="post" action="in.php?action=verifyqq&edit=yes">';
                    $state.= $lang[system][addqq][form][sjpl_input_verifycode];
                    $state.= '<img src="' . $filename . '">';
                    $state.= $lang[system][addqq][form][sjinput_verifycode];
                    $state.= '<input type="hidden" name="qq" value="' . $_REQUEST['qq']. '">';
                    $state.= '<input type="hidden" name="sid" value="' . $_POST['sid'] . '">';
                    $state.= '<input type="hidden" name="login_status" value="' . $_REQUEST[login_status] . '">';
                    $state.= '<input type="hidden" name="reply" value="' . $_REQUEST[reply] . '">';
                    $state.= '<input type="hidden" name="noticeqq" value="' . $noticeqq . '">';
                    $state.= '<input type="hidden" name="runtime" value="' . $_REQUEST[runtime] . '">';
                    $state.= $lang[system][addqq][form][input_verifycode_submit];
                    $state.= '</form"> ';
                }
                            else {
                                $tem_url_return='index.php';
                                $state = $lang[system][addqq]['false'];
                            }
                $style->display('main/checkqq.html');
                exit();
            }
                else {
                    mysql_query("UPDATE ".IQQOL_SQLTABLE."online
 SET status='1' 
 WHERE qq = '{$_REQUEST['qq']}'");
                    $iqqol_search=mysql_query("SELECT * FROM ".IQQOL_SQLTABLE."members 
WHERE `uid`='{$User_uid}'",$con);
                    $_admincp_power[setcode] = mysql_fetch_array(mysql_query("SELECT * FROM ".$table."admincp_power
WHERE name='setcode'"));
                    $qinfo=mysql_fetch_array($iqqol_search,true);
                    $integral=$qinfo[integral]+$_admincp_power[setcode][power];
                    mysql_query("UPDATE ".IQQOL_SQLTABLE."members
 SET integral='$integral' 
 WHERE uid = '{$User_uid}'");
                    $tem_url_return='index.php';
                    $state = $lang[system][checkqq][checkok];
                    $style->display('main/checkqq.html');
                    exit();
                }
            }
            $mqq = new SET_MQQ($_REQUEST['qq'], $q_info['pass']);
            $rand = json_decode($mqq->Login() , true);
            if ($rand[status] != 'ok') {
                if ($rand[status] == 'vc') {
                    $filename = 'libs/Cache/'.md5($rand['res']) . '.png';
                    $fp = fopen($filename, 'w');
                    fwrite($fp, $mqq->HexToText($rand['res']));
                    fclose($fp);
                    $state = '<form method="post" action="in.php?action=verifyqq&edit=yes">';
                    $state.= $lang[system][addqq][form][sjpl_input_verifycode];
                    $state.= '<img src="' . $filename . '">';
                    $state.= $lang[system][addqq][form][sjinput_verifycode];
                    $state.= '<input type="hidden" name="qq" value="' . $_REQUEST['qq'] . '">';
                    $state.= '<input type="hidden" name="sid" value="' . $_POST['sid'] . '">';
                    $state.= '<input type="hidden" name="login_status" value="' . $_REQUEST[login_status] . '">';
                    $state.= '<input type="hidden" name="reply" value="' . $_REQUEST[reply] . '">';
                    $state.= '<input type="hidden" name="noticeqq" value="' . $noticeqq . '">';
                    $state.= '<input type="hidden" name="runtime" value="' . $_REQUEST[runtime] . '">';
                    $state.= $lang[system][addqq][form][input_verifycode_submit];
                    $state.= '</form"> ';
                    $style->display('main/checkqq.html');
                    exit();
                }
                            else {
                                $tem_url_return='index.php';
                                $state = $lang[system][addqq]['false'];
                                $style->display('main/checkqq.html');
                                exit();
                            }
                $style->display('main/checkqq.html');
                exit();
            }
                            else {
                    mysql_query("UPDATE ".IQQOL_SQLTABLE."online
 SET status='1' 
 WHERE qq = '{$_REQUEST['qq']}'");
                    $tem_url_return='index.php';
                    $state = $lang[system][checkqq][checkyes];
                    $style->display('main/checkqq.html');
                    exit();
                }
?>