<?php
ob_start();
ignore_user_abort(true);
if($_SERVER['HTTP_APPVERSION']){
include "./saesiteinfo.php";
}else{
 if(!file_exists("./install/install.lock")){
header('location:./install');
exit;
 }else{
include "./siteinfo.php";
 }
}
//连接数据库
$localhost=mysql_connect($sqlhost,$sqluser,$sqlpass)or die("无法连接服务器");
mysql_select_db($sqldata,$localhost);
if (isset($_COOKIE["SHANIUUSER"]) && isset($_COOKIE["SHANIUPASS"])){
$user=$_COOKIE["SHANIUUSER"];
$pass=$_COOKIE["SHANIUPASS"];
$mysql=mysql_query("SELECT * FROM user WHERE user='$user'");
$sql =mysql_fetch_array($mysql);
?>
<html>
<head>
<meta content="width=device-width,user-scalable=no" name="viewport">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>删除号码 - <?php echo $sitename; ?></title>
<script src="js/jquery-1.8.0.min.js" type="text/javascript" ></script>
<link rel="stylesheet" type="text/css" href="css/register.css"/>
</head>
<body>
<div class='signup_container'>
    <h1 class='signup_title'>删除号码</h1>
            <div id="signup_forms" class="signup_forms clearfix">
<?php
if ($pass!=$sql['pass']){
echo "您还没有登录账户";
}else{

if (isset($_POST['qid'])){
$qid=$_POST['qid'];
$qqs=count($qid);
for ($i=0; $i<$qqs; $i++){
//开始删除
$qqlistrow = mysql_query("SELECT * FROM qqlist WHERE qid='".$qid[$i]."' and myqq='$user'");
$qqlist=mysql_fetch_array($qqlistrow);
if ($qqlist['qid']==$qid[$i]){
$qqmysql = mysql_query("SELECT * FROM qqlist WHERE qid='".$qid[$i]."' and myqq='$user'");
$qqinfo = mysql_fetch_array($qqmysql);
$qqhao=$qqinfo['qq'];
$fwq=$qqinfo['fwq'];
mysql_query("DELETE FROM $fwq WHERE qid='".$qid[$i]."'");
mysql_query("DELETE FROM qqlist WHERE qid='".$qid[$i]."'");
echo '删除QQ号码:'.$qqhao.' ---- <font color="red"><strong>成功</strong></font><br />';
}else{
echo '删除QID:'.$qid[$i].' ---- <font color="red"><strong>失败</strong></font><br />';
}
//结束删除
}
}else{
echo "您还没有选择删除的号码";
}

}
?>
</div>
  <tr>
    <td height="30" align="center"><a href="./user.php">返回挂Q页面</a></td>
  </tr>
</body>
</html>
<?php
}else{
header("Location: ./tishi.php");
}
?>