<?php
prompt ('Didn\'t find this page!');
exit;

@ob_start();
@set_time_limit(0);
@ignore_user_abort(true);
require_once './siteinfo.php';
require_once './tongji.php';
//连接数据库
$localhost = @mysql_connect($sqlhost,$sqluser,$sqlpass)or die("无法连接数据库，请联系网站管理员！");
mysql_select_db($sqldata,$localhost);
if (!empty($_COOKIE['AnYue_User']) && !empty($_COOKIE['AnYue_Pass'])){
$user = $_COOKIE['AnYue_User'];
$pass = $_COOKIE['AnYue_Pass'];
$sql = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `user`='$user'"));
if (!empty($_GET['qid'])){
$qid = $_GET['qid'];
}else{
$qid = "0";
}
$qqinfo = mysql_fetch_array(mysql_query("SELECT * FROM `qqlist` WHERE `qid`='$qid' and `myqq`='$user'"));
$qqhao = $qqinfo['qq'];
$qqmima = $qqinfo['pw'];
$fwq = $qqinfo['fwq'];
$sid = $qqinfo['sid'];
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>更换服务器 - <?=$configure['webname']?></title>
<style type="text/css">
<!--
.STYLE1 {
	font-size: xx-large;
	font-weight: bold;
}
-->
</style>
</head>

<body>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="328" height="243" border="3" align="center" bordercolor="#9900FF">
  <tr>
    <td height="56"><div align="center" class="STYLE1">更换服务器</div></td>
  </tr>
  <tr>
    <td height="57" align="center">
    <?php
    if ($pass != $sql['pass']){
    echo "您还没有登录账户";
    }elseif ($qqhao == ""){
    echo '您要更换服务器的QQ号不存在';
    }else{
    echo '需要更换服务器的QQ号码:'.$qqhao;
    }
    ?>
    </td>
  </tr>
  <tr>
<td height="50" align="center">
    <?php
    if ($pass != $sql['pass']){
    echo "您还没有登录账户";
    }elseif ($qqhao == ""){
    echo '您要更换服务器的QQ号不存在';
    }else{
    //开始更换服务器
    if (empty($_POST['submit'])){
    ?>
<form method="post" action="">
选择服务器:
<select name="changefwq" style="width:180px">
<option value="" selected="selected">请选择服务器</option>
<option value="fw1">①号服务器@<?php echo '挂Q数【'.$fw1.'】';?></option>
<option value="fw2">②号服务器@<?php echo '挂Q数【'.$fw2.'】';?></option>
<option value="fw3">③号服务器@<?php echo '挂Q数【'.$fw3.'】';?></option>
<option value="fw4">④号服务器@<?php echo '挂Q数【'.$fw4.'】';?></option>
<option value="fw5">⑤号服务器@<?php echo '挂Q数【'.$fw5.'】';?></option>
<option value="fw6">⑥号服务器@<?php echo '挂Q数【'.$fw6.'】';?></option>
<option value="fw7">⑦号服务器@<?php echo '挂Q数【'.$fw7.'】';?></option>
<option value="fw8">⑧号服务器@<?php echo '挂Q数【'.$fw8.'】';?></option>
</select>
<br />
<input type="submit" name="submit" value="立即更换服务器" style="width:300px;height:40px">
</form>
    <?php
    }else{
$changefuwu['fw1'] = "①号服务器";
$changefuwu['fw2'] = "②号服务器";
$changefuwu['fw3'] = "③号服务器";
$changefuwu['fw4'] = "④号服务器";
$changefuwu['fw5'] = "⑤号服务器";
$changefuwu['fw6'] = "⑥号服务器";
$changefuwu['fw7'] = "⑦号服务器";
$changefuwu['fw8'] = "⑧号服务器";
    $changefwq = $_POST['changefwq'];
    if ($changefwq == ""){
    echo "请选择服务器再操作";
    }else{
    mysql_query("INSERT INTO `$changefwq` (`qid`,`qq`,`pw`,`sid`) VALUES ('$qid','$qqhao','$qqmima','$sid')");
    mysql_query("DELETE FROM `$fwq` WHERE `qid`='$qid'");
    mysql_query("UPDATE `qqlist` SET `fwq`='$changefwq' WHERE `qid`='$qid'");
    echo "您成功改为:".$changefuwu[$changefwq];
    }
    }
    }
    ?>
</td>
  </tr>
  <tr>
    <td height="57"><div align="center"><a href="./index.php?act=myqq">返回挂Q首页>></a></div></td>
  </tr>
</table>
</body>
</html>
<?php
}else{
header("Location: ./index.php?act=olog");
}
?>