<?php
session_start();
require_once('common.php');
//************************执行代码开始*************************
$qid=is_numeric($_GET['qid'])?$_GET['qid']:'0';
if(!$qid || !$qqrow=$db->get_row("select * from ".C('DB_PREFIX')."qqs where qid='$qid' and uid='$userrow[uid]' limit 1")){
	exit("<script language='javascript'>alert('QQ不存在！');window.location.href='/control';</script>");
}
$json=file_get_contents("http://".$_SERVER['HTTP_HOST']."/mgmt/qqjc.php?qq={$qqrow[qq]}&sid={$qqrow['sid']}&skey={$qqrow[skey]}");
$arr=json_decode($json,true);
if($arr[code]!=0){
	exit('<script language=\'javascript\'>alert(\''.$arr[msg].'\');history.go(-1);</script>');
}


//**************************执行代码开始*******************************

C('webtitle','QQ'.$qqrow['qq'].'秒赞好友检测');
C('pageid','dxjc');
include_once 'common.head.php';
?>
<block name="head">
	<script src="/Style/bootstrap/js/jquery.min.js"></script>
	<script src="/Style/bootstrap/js/bootstrap.min.js"></script>
	<script src="/Style/js/default.js"></script>
  <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
  <style>
    span.right {
    float: right;
}
  </style>
</block>
<block name="page">
  <div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
      <h2>秒赞好友检测<h2>
      <ol class="breadcrumb">
        <li> 主页
        </li>
		<li>
                    QQ配置</a>
                </li>
        <li> <strong>好友检测</strong>
        </li>
      </ol>
    </div>
    <div class="col-lg-2"></div>
  </div>
  <div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
      <div class="col-md-4">
        <div class="panel panel-primary">
          <div class="panel-heading">
            <h3 class="panel-title" align="center">提示</h3>
          </div>
          <div class="panel-body" align="left">
            <p>本功能数据仅作参考，不代表和实际数据完全一致</p>
            <p>建议使用本功能前先发布几条说说，等待一段时间后再来检测可增加准确率</p>
          </div>
		  
          <div class="alert alert-info">结果：总共<?=count($arr['friend'])?>个好友，其中<?=$arr['mzcount']?>个可能是秒赞好友！</div>
		  
        </div>
      </div>
      <div class="panel-group col-md-8" id="gpnames">
        <volist name="$arr['gpnames']" id="row" key="k">
          <div class="ibox float-e-margins">
            <div class="ibox-title">
              <h5>所有好友[<?=count($arr['friend'])?>] 秒赞[<?=$arr['mzcount']?>] 不秒赞
			  <?php
			  echo count($arr['friend'])-$arr['mzcount'];
			  ?></h5>
              <div class="ibox-tools">
                <a class="collapse-link"> <i class="fa fa-chevron-down">展开/收起</i>
                </a>
              </div>
            </div>
            <div id="gpid">
              <div class="ibox-content" style="display;">
                <table class="table  table-bordered" style="table-layout: fixed;">
                  <tbody>
                    <tr>
                      <td align="center">
QQ
                      </td>
                      <td class="mzwidthtd" align="center">昵称</td><td class="mzwidthtd" align="center">备注</td><td align="center">可能性</td></tr>
			</volist>
			<volist name="$arr['friend']" id="row" key="k">
					<?php
				if($arr['friend']){
				foreach($arr['friend'] as $k=>$row){
					echo"<tr><td>{$row['uin']}</td><td>{$row['name']}</td><td>{$row['remark']}</td><td align='center' style='background: rgba(57, 110, 0,";
					echo $row['mz']/5;
					echo");'>";
					echo $row['mz']/5*100;
					echo"%</td></tr>";
				}	
				}	
				?>
				</volist>
					</tbody>
					</table>
				</div>
			</div>
		</div>

		</volist>
	</div>
	</div>
	</div>
	
<?php
include_once 'common.foot.php';
?>
</block>