<?php

error_reporting(0); 
session_start();

include("../conn.php");
include("../common.php");


if(!isset($_SESSION['username'])){
	echo "<script>alert('管理身份已失效请重新登录!')</script><script>top.location.href='index.php'</script>";
	exit;
	}

$username=ubo($_SESSION['username']);
$username=ubo($_SESSION['username']);
$sql1 = mysql_query("SELECT * FROM zhucema WHERE  user='$username'");
$row=mysql_fetch_array($sql1);
if($row[zdsl]!=""){echo "<script>location.href='index.php'</script>";}
$type="WHERE name='$username'";
$duqu=queryall(admin,$type);
$day=date("Y-m-d");
$zuori=date("Y-m-d",strtotime("$day-1 day"));
$date=date("Y-m-d",strtotime("$day-2 day"));
$date2=date("Y-m-d",strtotime("$day-3 day"));
$date3=date("Y-m-d",strtotime("$day-4 day"));
$date4=date("Y-m-d",strtotime("$day-5 day"));
$date5=date("Y-m-d",strtotime("$day-6 day"));
$shijianday="'".$date5."'".","."'".$date4."'".","."'".$date3."'".","."'".$date2."'".","."'".$date."'".","."'".$zuori."'".","."'".$day."'";
$arr = array("1"=>$day,"2"=>$zuori,"3"=>$date,"4"=>$date2,"5"=>$date3,"6"=>$date4,"7"=>$date5);
foreach($jj as $i=>$value){
$sj = 'sj';
$sj .= $i;
$$sj = "0";
$sql = "WHERE 1=1";
$sql .="   and bindtime  like '%".$jj[$i]."%'";
$sqlc="select sum(cs) from user   ".$sql." ";
if ($resh=mysql_query($sqlc)){
list($$sj)=mysql_fetch_row($resh);
$$sj = empty($$sj) ? "0" : $$sj;
mysql_free_result($resh);
} 
}
if($_POST[ubosubmit]){
$username="ccc='ok'  where id='1'";
upalldt(ubobq,$username);
$nn=base64_decode('5Y+R6KqT5oiQ5Yqf77yM5q2k6KqT6KiA5LiA57uP5Y+R6KqT77yM56uL5Y2z55Sf5pWI77yB');
$nn2=iconv("UTF-8","GB2312",$nn);
echo "<script>alert('".$nn2."')</script>";
}
$username="where id='1'";
$ubobq=queryall(ubobq,$username);
$dashang="'".$sj7."'".","."'".$sj6."'".","."'".$sj5."'".","."'".$sj4."'".","."'".$sj3."'".","."'".$sj2."'".","."'".$sj1."'";
$jj = array("1"=>$day,"2"=>$zuori,"3"=>$date,"4"=>$date2,"5"=>$date3,"6"=>$date4,"7"=>$date5);
foreach($jj as $i=>$value){
$sj = 'sj';
$sj .= $i;
$$sj = "0";
$sql = "WHERE 1=1";
$sql .="   and bindtime  like '%".$jj[$i]."%'";
$sqlc = mysql_query("SELECT * FROM user ".$sql." ");
$$sj = mysql_num_rows($sqlc);
$$sj = empty($$sj) ? "0" : $$sj;
}
$shipinday="'".$sj7."'".","."'".$sj6."'".","."'".$sj5."'".","."'".$sj4."'".","."'".$sj3."'".","."'".$sj2."'".","."'".$sj1."'";
$jj = array("1"=>$day,"2"=>$zuori,"3"=>$date,"4"=>$date2,"5"=>$date3,"6"=>$date4,"7"=>$date5);
foreach($jj as $i=>$value){
$sj = 'sj';
$sj .= $i;
$$sj = "0";
$sql = "WHERE 1=1";
$sql .="   and ordeid  like '%".$jj[$i]."%'";
$sqlc = mysql_query("SELECT * FROM chongzhi ".$sql." ");
$$sj = mysql_num_rows($sqlc);
$$sj = empty($$sj) ? "0" : $$sj;
}
$userday="'".$sj7."'".","."'".$sj6."'".","."'".$sj5."'".","."'".$sj4."'".","."'".$sj3."'".","."'".$sj2."'".","."'".$sj1."'";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>控制面板</title>
<link rel="stylesheet" type="text/css" href="newui/layui.css" />
<script type="text/javascript" src="newui/layui/layui.js"></script>
</head>
<body class="layui-anim layui-anim-upbit" style="background-color: #F2F2F2;">
<div style="border-bottom: 1px solid #009688; padding: 2px 0px 0px 1px;margin-bottom: 10px;">
<p class="layui-btn"><i class="layui-icon">&#xF015;</i> 后台首页</p>
</div>
<blockquote ></blockquote>
<div class="layui-fluid">
<div class="layui-row layui-col-space10">
<div class="layui-col-md6">
<script type="text/javascript" src="newui/js/echarts.common.min.js"></script>
<div style=" background-color: #FFF;">
<div id="main" style="width: 100%;height:264px;"></div>
</div>
<script lang="javascript" type="text/javascript">
var myChart = echarts.init(document.getElementById('main'));
option = {
title: {
text: '动态数据'
},
tooltip : {
trigger: 'axis',
axisPointer : {
type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
}
},
legend: {
data:['注册量']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis : [
{			
type : 'category',
data : [<?php echo $shijianday?>]
}
],
yAxis : [
{
type : 'value'
}
],
series : [

{
name:'注册量',
color: ['#1ABC9C'],
type:'bar',
data:[<?php echo $shipinday?>],
},

]
};
myChart.setOption(option);
</script>         
</div>
<div class="layui-col-md6">	
<div class="layui-row layui-col-space10">
<div class="layui-col-md6" style="text-align: center;">
<div style="background-color: #FFF; height: 80px;border-radius:5px;padding: 1px 1px;">
<div class="layui-col-md5 layui-bg-green"><i class="layui-icon" style="font-size: 40px;line-height: 80px; color: #FFF;">&#xF007;</i></div>
<div class="layui-col-md7"> 
<?php
$sql = mysql_query("SELECT count(1) FROM user");
$bs = mysql_fetch_array($sql)[0];
?>
<h1 style="font-size: 24px; margin-top: 16px;"> <?php if($bs==null){?>0<?php }else{?><?php echo $bs?><?php }?> 个</h1>玩家数量</div>
</div>
</div>
<div class="layui-col-md6" style="text-align: center;">
<div style="background-color: #FFF; height: 80px;border-radius:5px;padding: 1px 1px;">
<div class="layui-col-md5 layui-bg-green"><i class="layui-icon" style="font-size: 40px;line-height: 80px; color: #FFF;">&#xF007;</i></div>
<div class="layui-col-md7"> 
<?php
$sql = mysql_query("SELECT count(1) FROM chongzhi");
$bs1 = mysql_fetch_array($sql)[0];
?>
<h1 style="font-size: 24px; margin-top: 16px;"> <?php if($bs1==null){?>0<?php }else{?><?php echo $bs1?><?php }?> 单</h1>订单数量</div>
</div>
</div>
<div class=" layui-col-md6" style="text-align: center;">
<div style="background-color: #FFF; height: 80px;border-radius:5px;padding: 1px 1px;">
<div class="layui-col-md5 layui-bg-green"><i class="layui-icon" style="font-size: 40px;line-height: 80px; color: #FFF;">&#xF007;</i></div>
<div class="layui-col-md7">
<?php
$sql = mysql_query("SELECT count(1) FROM zhucema");
$bs2 = mysql_fetch_array($sql)[0];
?> 
<h1 style="font-size: 24px; margin-top: 16px;"><?php if($bs2==null){?>0<?php }else{?><?php echo $bs2?><?php }?> 个</h1>代理列表</div>
</div>
</div>
<div class=" layui-col-md6" style="text-align: center;">
<div style="background-color: #FFF; height: 80px;border-radius:5px;padding: 1px 1px;">
<div class="layui-col-md5 " style="background-color:#E066FF;"><i class="layui-icon" style="font-size: 40px;line-height: 80px; color: #FFF;">&#xF157;</i> </div>
<div class="layui-col-md7"> 
<?php
$sql = mysql_query("SELECT count(1) FROM chongzhi where  status='发放成功'");
$cgdd =mysql_fetch_array($sql)[0];
?> 
<h1 style="font-size: 24px; margin-top: 16px;"><?php if($cgdd==null){?>0<?php }else{?><?php echo $cgdd?><?php }?> 单</h1>成功订单</div>
</div>
</div>
<div class=" layui-col-md6" style="text-align: center;">
<div style="background-color: #FFF; height: 80px;border-radius:5px;padding: 1px 1px;">
<div class="layui-col-md5 " style="background-color:#E066FF;"><i class="layui-icon" style="font-size: 40px;line-height: 80px; color: #FFF;">&#xF157;</i> </div>
<div class="layui-col-md7"> 
<h1 style="font-size: 24px; margin-top: 16px;"> QQ：</h1></div>
</div>
</div>
<div class="layui-row layui-col-space10">
<div class="layui-col-md6">
<div style="background-color: #FFF; border-radius:5px; line-height: 40px; text-indent: 20px;">
<div class="layui-col-md12" style="border-top: 1px solid #009688; height:40px;text-align: left;font-size: 18px;">&nbsp;网 站 信 息</div>
<div class="layui-clear" style="border-bottom: 1px solid #f2f2f2; height: 40px;line-height: 40px;">
<div class="layui-col-md6">PHP 版本：<?php echo phpversion();?></div>
<div class="layui-col-md6">MySQL 版本：<?php  echo mysql_get_server_info();?></div>
</div>  
<div class="layui-clear" style="border-bottom: 1px solid #f2f2f2; height: 40px;line-height: 40px;">
<div class="layui-col-md6">操作系统：<?PHP echo PHP_OS; ?></div>
<div class="layui-col-md6">文件上传限制：<?PHP echo  ini_get("file_uploads") ? ini_get("upload_max_filesize") : "Disabled";?></div>    
</div> 
<div class="layui-clear" style="border-bottom: 1px solid #f2f2f2; height: 40px;line-height: 40px;">
<div class="layui-col-md6">ZEND版本：<?PHP echo zend_version(); ?></div>
<div class="layui-col-md6">Web 服务器：<?PHP echo  php_uname('s') ; ?></div>    
</div>   
<div class="layui-clear layui-elip" style="border-bottom: 1px solid #f2f2f2; height: 40px;line-height: 40px;">
<div class="layui-col-md6 layui-elip">系统版本号：<?PHP echo php_uname('r'); ?></div>
<div class="layui-col-md6">执行时间限制：<?PHP echo  ini_get("max_execution_time")."秒";?></div>    
</div> 
<div class="layui-clear" style="border-bottom: 1px solid #f2f2f2; height: 40px;line-height: 40px;">
<div class="layui-col-md6">PHP运行方式：<?PHP echo  php_sapi_name(); ?></div>
<div class="layui-col-md6">客户端IP：<?PHP echo  $_SERVER['REMOTE_ADDR']; ?></div>    
</div> 
<div class="layui-clear" style="border-bottom: 1px solid #f2f2f2; height: 40px;line-height: 40px;">
<div class="layui-col-md6">服务器Web端口：<?PHP echo $_SERVER['SERVER_PORT']; ?></div>    
</div>  
<div class="layui-clear" style="border-bottom: 1px solid #f2f2f2; height: 40px;line-height: 40px;">
<div class="layui-col-md6">作者： QQ</div>   
</div>  
</div>
</div>
</div>        
</div> 
</div>  
</div>  
</body>
</html>
<?php include_once('footer.php');?>