<?php
ob_start();
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);
include "./header.php";
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);
//判断登录否
/*
if ($sql['pass']!=$pass){
header("Location:./index.php");
}
*/
//查询QQ个数
$qqnumsql="SELECT COUNT(id) FROM qqlist WHERE myqq='$user' ";
$qqnumqqlist = mysql_fetch_array( mysql_query($qqnumsql) );
$qqnum=$qqnumqqlist[0];
mysql_query("UPDATE user SET qqnum='$qqnum' WHERE user='$user'");
$agent = $_SERVER['HTTP_USER_AGENT'];
if(strpos($agent,"comFront") || strpos($agent,"iPhone") || strpos($agent,"MIDP-2.0") || strpos($agent,"Opera Mini") || strpos($agent,"UCWEB") || strpos($agent,"Android") || strpos($agent,"Windows CE") || strpos($agent,"SymbianOS"))
header("Location:/m/user.php");
?>
<head>
<link href="css/stylesheets.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./zDrag.js"></script>
<script type="text/javascript" src="./zDialog.js"></script>
</head>
<body> 
<form name="form" method="post" action="./delete.php">   
        <div class="body">
            
            <ul class="navigation">
                <li>
                    <a class="button" onclick="open13()">
                        <div class="icon">
                            <span class="ico-monitor"></span>
                        </div>                    
                        <div class="name">添加QQ记录</div>
                    </a>                
                </li>
                <li>
                    <a href="./batch.php" class="button yellow">
                        <div class="arrow"></div>
                        <div class="icon">
                            <span class="ico-cog-2"></span>
                        </div>                    
                        <div class="name">批量添加QQ</div>
                    </a>          
                </li>
                <li>
                    <a href="javascript:form.submit();" class="button dblue">
                        <div class="arrow"></div>
                        <div class="icon">
                            <span class="ico-layout-7"></span>
                        </div>                    
                        <div class="name">删除QQ号</div>
                    </a>                                        
                </li>                
                <li>
                    <a href="./center.php" class="button green">
                        <div class="arrow"></div>
                        <div class="icon">
                            <span class="ico-pen-2"></span>
                        </div>                    
                        <div class="name">扩充挂Q配额</div>
                    </a>                              
                </li>                        
                <li>
                    <a href="./pass.php" class="button red">
                        <div class="icon">
                            <span class="ico-chart-4"></span>
                        </div>                    
                        <div class="name">修改密码</div>
                    </a>                
                </li>                
                <li>
                    <a href="logout.php" class="button purple">
                        <div class="arrow"></div>
                        <div class="icon">
                            <span class="ico-box"></span>
                        </div>                    
                        <div class="name">安全退出</div>
                    </a>                                                     
                </li>               
               
            </ul>
            
            
            <div class="content">
                
                <div class="page-header">
                    <div class="icon">
                        <span class="ico-layout-7"></span>
                    </div>
                    <h1><?php echo $sitename; ?><small><?php echo $enname; ?></small></h1>
                </div>

                <div class="row-fluid">
                    <div class="span12">
                        <div class="block">
                            <div class="head blue">
                                <h2>账户:<font color=red><strong><?php echo $sql['user'];?></strong></font> | 注册日期:<?php echo $sql['regdate'];?><br />剩余挂Q配额：您共有<font color=red><strong><?php echo $qqnum; ?></strong></font>/<font color=red><strong><?php echo $chushi+$sql['peie'];?></strong></font>个！
								<MARQUEE><font color="#1D7431">网站公告：<?php echo $gonggao; ?></font></MARQUEE></h2>
                                <ul class="buttons">
                                    <li><a href="#" onClick="source('table_sort'); return false;"></a></li>
                                </ul>
                            </div>                
                                <div class="data-fluid">
                                    <table class="table dtable lcnp" cellpadding="0" cellspacing="0" width="100%">
                                        <thead>
                                            <tr>
                                                <th><input type="checkbox" class="checkall" name="checkName" onClick="funCheck(this)"></th>
                                                <th width="10%">挂Q服务器</th>
                                                <th width="10%">QQ头像</th>
                                                <th width="10%">QQ状态</div></th>
                                                <th width="10%">QQ号码</th>
                                                <th width="20%">SID码</th>
                                                <th width="13%">SID能否自动更新</th>
                                                <th width="15%">设置</th>
                                            </tr>
                                        </thead>
                                        <tbody>
 <?php
$qqlistsql=mysql_query("SELECT * FROM  qqlist WHERE  myqq='$user' ORDER BY  id ASC ");
while($qqlist = mysql_fetch_array($qqlistsql))
  {
  //服务器变量
  $fwq=$qqlist['fwq'];
  $fw['fw1']="<strong><font color=red>①号服务器</font></strong>";
  $fw['fw2']="<strong><font color=#FF00FF>②号服务器</font></strong>";
  $fw['fw3']="<strong><font color=#0000FF>③号服务器</font></strong>";
  $fw['fw4']="<strong><font color=#006400>④号服务器</font></strong>";
  $fw['fw5']="<strong><font color=#00BFFF>⑤号服务器</font></strong>";
  $fw['fw6']="<strong><font color=#8A2BE2>⑥号服务器</font></strong>";
  $fw['fw7']="<strong><font color=#CC0066>⑦号服务器</font></strong>";
  $fw['fw8']="<strong><font color=#FF9933>⑧号服务器</font></strong>";
  //服务器变量
  //SID更新变量
  $sidma=$qqlist['newsid'];
  $sid['yesno']="暂时未知";
  $sid['yes']="<font color=#0DC70D>自动更新</font>";
  $sid['no']="<font color=red>不能更新</font>";
  //SID更新变量
  echo '<tr>
         <td><input type="checkbox" name="qid[]" value="'.$qqlist['qid'].'"></td>
         <td>'.$fw["$fwq"].'</td>
         <td><img src="http://q4.qlogo.cn/headimg_dl?bs=qq&dst_uin='.$qqlist['qq'].'&src_uin='.$qqlist['qq'].'&fid='.$qqlist['qq'].'&spec=40&url_enc=0&referer=bu_interface&term_type=PC" whidth="35px" height="35px"></td>
         <td><img border="0" src="http://wpa.qq.com/pa?p=2:'.$qqlist['qq'].':46" title="这是您QQ状态"></td>
         <td>'.$qqlist['qq'].'</td>
		 <td><a href="./wap.php?sid='.$qqlist['sid'].'&qq='.$qqlist['qq'].'" >'.$qqlist['sid'].'</a></td>
		 <td align="center">'.$sid["$sidma"].'</td>
		 <td><a href="change.php?qid='.$qqlist['qid'].'">更换服务器</a></td>
      </tr>
';
  }
?>                    
											
                                        </tbody>
                                    </table>                    
                                <br/>
<br/>     
<!-- UY BEGIN -->
<div id="uyan_frame"></div>
<script type="text/javascript" src="http://v2.uyan.cc/code/uyan.js"></script>
<!-- UY END -->
								</div> 
                        </div>
                    </div>
                </div>  
            </div>
            
        </div>
        
    </div>
    <div class="dialog" id="source" style="display: none;" title="Source"></div>  
	</form>
<script type="text/javascript">
function open13()
{
	var diag = new Dialog();
	diag.Title = "添加QQ记录";
	diag.Width = 275;
	diag.Height = 155;
	diag.URL = "./qplus.php";
	diag.show();
}
function funCheck(){
var chk=document.getElementsByName('qid[]');
if(document.getElementsByName('checkName')[0].checked){
for(var i=0;i<chk.length;i++){
chk[i].checked=true;
}
}else{
for(var i=0;i<chk.length;i++){
chk[i].checked=false;
}
}
}
</script>    
</body>
</html>
<?php
//如果登录结束
			}
			else
			{
			//如果没登录就显示下面的
            header("refresh:0;url=tishi.php");
			}
?>