<?php if (!defined('ROOT')) exit; ?>
<!DOCTYPE html>
<html>

	<head>
		<title>后台首页</title>
		<meta name="description" content="">
		<meta name="keywords" content="">
		<?php
			include 'Inc_files.php';
		?>
	</head>
	<style type="text/css">
		.theme-white .widget{height: auto !important;}
		#qq img{width:25px;height: 25px;margin: 0 7px;}
		#qqs img{width: 25px;height: 25px;margin: 0 7px;}
		#tixian{ z-index: 9999;}
		.list_gonggao{ line-height: 2em;}
	</style>
	<body data-type="index" class="theme-white">
		<div class="am-g tpl-g">
			<?php include 'Inc_head.php'?>
			<!-- 侧边导航栏 -->
			<?php include 'Inc_left.php';?>

			<!-- 内容区域 -->
			<div class="tpl-content-wrapper">

				<div class="row-content am-cf">
					<div class="row  am-cf">
						<div class="am-u-sm-12 am-u-md-12 am-u-lg-4">
							<div class="widget am-cf">
								<div class="widget-head am-cf">
									<div class="am-u-sm-4 widget-title">今日收入</div>
									<div class="am-u-sm-4 widget-title">账户余额</div>
									<div class="am-u-sm-4 widget-title">可提现金额/冻结</div>
								</div>
								<div class="widget-body">
									<div class="am-u-sm-4">
										<div class="widget-fluctuation-period-text">
											￥<?php echo sprintf("%.2f",$shouru_today);?>
											<a href="/v/lists/model_id/58/row/20/ctime/<?php echo mktime(0,0,0,date('m'),date('d'),date('Y'));?>/uid/<?php echo session('user_auth.id')?>" class="widget-fluctuation-tpl-btn">
											<i class="am-icon-calendar"></i>
											详情
											</a>
										</div>
									</div>
									<div class="am-u-sm-4">
										<div class="widget-fluctuation-period-text">
											￥<?php echo sprintf("%.2f",$shouru_yue);?>
											<a href="/v/lists/model_id/44/row/20/ctime/<?php echo strtotime(date('Y-m-d'));?>/uid/<?php echo session('user_auth.id');?>" class="widget-fluctuation-tpl-btn">
											<i class="am-icon-calendar"></i>
											详情
											</a>
										</div>
									</div>
									<div class="am-u-sm-4">
										<div class="widget-fluctuation-description-amount text-success" am-cf>
											￥<?php if($shouru_ktx>=C('CASH_MIN')){echo sprintf("%.2f",$shouru_ktx).'/'.sprintf("%.2f",abs($dongjiejine));}else{echo '0'.'/'.sprintf("%.2f",abs($dongjiejine));}?>

										</div>
											<button  <?php if($shouru_ktx<C('CASH_MIN')){echo 'disabled="disabled"';}?>  class="widget-fluctuation-tpl-btn btn_tixian">
												<i class="am-icon-calendar"></i>
												提现
											</button>
									</div>
								</div>
							</div>

						</div>
						<div class="am-u-sm-12 am-u-md-6 am-u-lg-4">
							<div class="widget widget-primary am-cf">
								<div class="widget-statistic-header">
									最近一个月收入
								</div>
								<div class="widget-statistic-body">
									<div class="widget-statistic-value">
										￥<?php echo sprintf("%.2f",$shouru_month);?>
									</div>
									<div class="widget-statistic-description">
									</div>
									<span class="widget-statistic-icon am-icon-credit-card-alt"></span>
								</div>
							</div>
						</div>
						<div class="am-u-sm-12 am-u-md-6 am-u-lg-4">
							<div class="widget widget-purple am-cf">
								<div class="widget-statistic-header">
									最近一季度收入
								</div>
								<div class="widget-statistic-body">
									<div class="widget-statistic-value">
										￥<?php echo sprintf("%.2f",$shouru_jidu);?>
									</div>
									<div class="widget-statistic-description">
									</div>
									<span class="widget-statistic-icon am-icon-support"></span>
								</div>
							</div>
						</div>
					</div>
					<div class="row  am-cf">
						<div class="am-u-sm-12 am-u-md-12 am-u-lg-4">
							<div class="widget am-cf">
								<div class="widget-head am-cf">
									<div class="widget-title am-fl">
										空间详情
									</div>
									<div class="widget-function am-fr">
								
									</div>
								</div>
								<div class="widget-body widget-body-md am-fr" style="height: auto;">
									<div class="am-progress-title">
										<?php if($userconfig['domain']){?>
											网盘地址 <span class="am-fr am-progress-title-more"><a href="http://<?php echo $userconfig['domain'].'.'.($userconfig['member_wangpan_type']>1?C('FUFEI_WANGPAN'):C('DOMAIN_WANGPAN'));?>" target="_blank">http://<?php echo $userconfig['domain'].'.'.($userconfig['member_wangpan_type']>1?C('FUFEI_WANGPAN'):C('DOMAIN_WANGPAN'));?></a></span>
										<?php }else{?>
											网盘地址 <span class="am-fr am-progress-title-more"><a href="/x/mod/model_id/87/pk1/<?php echo session('user_auth.id');?>">未设置（进入设置）</a></span>
										<?php }?>
									</div>
									<div class="am-progress-title">
										全部商品 <span class="am-fr am-progress-title-more"><a href="http://<?php echo C('DOMAIN_DOWNLOAD');?>/file/sale/uid/<?php echo $userconfig['member_id'];?>" target="_blank">http://<?php echo C('DOMAIN_DOWNLOAD');?>/file/sale/uid/<?php echo $userconfig['member_id'];?></a></span>
									</div>
									<div class="am-progress-title">
					推广连接： <span class="am-fr am-progress-title-more">  <a href="<?php echo C('DOMAIN_INDEX');?>?from=<?php echo session('user_auth.id');?>" target="_blank"><?php echo C('DOMAIN_INDEX');?>?from=<?php echo session('user_auth.id');?> </a>
									</div>
									<div class="am-progress-title">
										分类链接 <span class="am-fr am-progress-title-more"> <a href="http://<?php echo $userconfig['domain'].'.'.($userconfig['member_wangpan_type']>1?C('FUFEI_WANGPAN'):C('DOMAIN_WANGPAN'));?>/products/index/uid/<?php echo session('user_auth.id');?>" target="_blank">http://<?php echo $userconfig['domain'].'.'.($userconfig['member_wangpan_type']>1?C('FUFEI_WANGPAN'):C('DOMAIN_WANGPAN'));?>/products/index/uid/<?php echo session('user_auth.id');?></a></span>
									</div>

								</div>
							</div>

						</div>
						<div class="am-u-sm-12 am-u-md-12 am-u-lg-4">
							<div class="widget am-cf">
								<div class="widget-head am-cf">
									<div class="widget-title am-fl">
										安全详情
									</div>
									<!--<div class="widget-function am-fr"> 
										<a href="javascript:;" class="am-icon-cog"></a>
									</div>-->
								</div>
								
								<div class="widget-body widget-body-md am-fr" style="height: auto;">
									<div class="am-progress-title">
										手机号 <span class="am-fr am-progress-title-more"><?php echo preg_replace('/(\d{3})[0-9]{4}(\d{4})/i','$1****$2',$userconfig['member_mobile']);?></span>
									</div>
									<div class="am-progress-title">
										网盘类型 <span class="am-fr am-progress-title-more"><?php echo $userconfig['wangpan_name'];?></span>
									</a></div>
									<div class="am-progress-title">
										
										到期时间 <span class="am-fr am-progress-title-more"><?php echo ($userconfig['wangpan_etime']<2145888000)?wd_date('Y-m-d',$userconfig['wangpan_etime']):'永久';?></span>
										<!--<?php echo $userconfig['member_idcard']?preg_replace('/(\d{10})[0-9]{4}(\d{4})/i','$1****$2',$userconfig['member_idcard']):'未设置';?>--></span>									</div>
								
								<div class="am-progress-title">
										安全信息： <span class="am-fr am-progress-title-more"><?php echo $userconfig['member_truename']?substr_cut($userconfig['member_truename']):'未设置<a href="/member/safeinfo">（安全认证）</a>';?><!--<?php echo $userconfig['member_idcard']?preg_replace('/(\d{10})[0-9]{4}(\d{4})/i','$1****$2',$userconfig['member_idcard']):'未设置';?>--></span>									</div>
								</div>
							</div>

						</div>
						<div class="am-u-sm-12 am-u-md-12 am-u-lg-4">
							<div class="widget am-cf">
								<div class="widget-head am-cf">
									<div class="widget-title am-fl">
										客服中心
									</div>
									<div class="widget-function am-fr">
										<!--<a href="javascript:;" class="am-icon-cog"></a>-->
									</div>
								</div>
								<div class="widget-body widget-body-md am-fr" style="height: auto;margin:0;">
									<?php echo html_entity_decode(C('KEFU_MEMBER'));?>
								</div>
							</div>
						</div>				
					</div>
					<?php if($userconfig['wangpan_id']<2){?>
						<?php
						$ad_right=M('advert')->where(array('position'=>9,'stime'=>array('lt',time()),'etime'=>array('gt',time())))->order('sort')->getField('content',true);
			   			?>
						<div class="row am-cf">
							<div class="widget am-cf">
								<div class="widget-head am-cf">
									<div class="widget-title am-fl">
										站内提示（本信息权限免费用户可看到）
									</div>
								</div>
								<ul class="list_gonggao">
	           						<li> <?php echo html_entity_decode(C('WEB_MF_01'));?>   </li>
							   		<?php foreach($ad_right as $k=>$v){?>
					           		<?php }?>
					           	</ul>
							</div>
						</div>
					<?php }?>
					<div class="row am-cf">
						<div class="am-u-sm-12 am-u-md-8">
							<div class="widget am-cf">
								<div class="widget-head am-cf">
									<div class="widget-title am-fl">
										今日空间流量走势图
									</div>
								</div>
								<div class="widget-body-md widget-body tpl-amendment-echarts am-fr" id="tpl-echarts">

								</div>
							</div>
						</div>

						<div class="am-u-sm-12 am-u-md-4">
							<div class="widget am-cf">
								<div class="widget-head am-cf">
									<div class="widget-title am-fl">
										空间使用情况
									</div>
								</div>
								<div class="widget-body widget-body-md am-fr">

									<div class="am-progress-title">
										空间大小 <span class="am-fr am-progress-title-more"><?php echo floor($userconfig['usesize']/1048576);?>M / <?php echo $userconfig['wangpan_size'];?>M</span>
									</div>
									<div class="am-progress">
										<div class="am-progress-bar" style="width: <?php echo floor($userconfig['usesize']/1048576)/$userconfig['wangpan_size']*100;?>%"></div>
									</div>
									<div class="am-progress-title">
										顶级目录 <span class="am-fr am-progress-title-more"><?php echo floor($userconfig['wangpan_folder_top_num']);?>个 / <?php echo $userconfig['wangpan_top_menu'];?>个</span>
									</div>
									<div class="am-progress">
										<div class="am-progress-bar  am-progress-bar-warning" style="width: <?php echo $userconfig['wangpan_folder_top_num']/$userconfig['wangpan_top_menu']*100;?>%"></div>
									</div>
									<div class="am-progress-title">
										每小时下载量 <span class="am-fr am-progress-title-more"><?php echo $nowhour;?>M / <?php echo $userconfig['wangpan_two_hour']?>M</span>
									</div>
									<div class="am-progress">
										<div class="am-progress-bar am-progress-bar-danger" style="width: <?php echo $nowhour/$userconfig['wangpan_two_hour']*100;?>%"></div>
									</div>
								</div>
							</div>

						</div>
						
					</div>
					
					

					<div class="row am-cf">
						<div class="widget am-cf">
							<div class="widget-head am-cf">
								<div class="widget-title am-fl">
									新闻公告
								</div>
							</div>
							<ul class="list_gonggao">
								<?php
								$list_gonggao=M('gonggao')->order('id desc')->where(array('cate'=>1))->limit(0,10)->select();
								?>
								<?php foreach($list_gonggao as $k=>$v){?>
									<li class="am-u-sm-6">
										<a target="_blank" href="/v/show/model_id/39/id/<?php echo $v['id'];?>"><?php echo $v['title'];?></a>
										<span><?php echo wd_date('Y-m-d H:i:s',$v['ctime']);?></span>
									</li>
								<?php }?>
							</ul>	
						</div>
						
					</div>
					
				</div>
			</div>
		</div>
		
		
		<?php include 'Inc_files_boot.php';?>
		<div class="am-modal am-modal-prompt" tabindex="-1" id="tixian">
			<div class="am-modal-dialog">
		    	<div class="am-modal-hd">输入提现金额</div>
		   		<div class="am-modal-bd">
		   			最低<?php echo C('CASH_MIN');?>元起提
		    		<input type="number" id="case_amount" min="<?php echo C('CASH_MIN');?>" max="<?php echo $shouru_ktx;?>" value="<?php echo $shouru_ktx;?>" class="am-modal-prompt-input">
		    	</div>
		    	<div class="am-modal-footer">
			    	<span class="am-modal-btn" data-am-modal-cancel>取消</span>
			    	<span class="am-modal-btn" data-am-modal-confirm>提交</span>
		    	</div>
			</div>
		</div>
		<?php
//			Vendor('Qiniu.autoload');
//			$auth = new \Qiniu\Auth(C('QINIU.accessKey'), C('QINIU.secretKey'));
//			$cdn=new \Qiniu\Cdn\CdnManager($auth);
//			$re=$cdn->getFluxData('',date('Y-m-d'),date('Y-m-d'),'hour');
//			$liuliang=$re[0]['data']['.523w.cn']['china'];
//			if(!$liuliang){
//			    $liuliang=array();
//				for($i=0;$i<24;$i++){
//					$liuliang[$i]=0;
//				}
//			}
//			foreach ($liuliang as $k => &$v) {
//				$v=sprintf("%.2f",$v/1024/1024);
//			}
//			$liuliang=json_encode($liuliang);
		?>
		<script type="text/javascript">
		var userconfig=<?php echo json_encode($userconfig);?>;
		jQuery(document).on('click','.btn_tixian',function () {
			var the=jQuery(this);
			if (userconfig.member_alipay=='') {
				wd_alert({
					msg:'请先绑定收款支付宝',
					background:'#f00'
				});
				return false;
			}
			$('#tixian').modal({
		    	relatedTarget: this,
		    	onconfirm: function(e) {
		    		jQuery.ajax({
		    			url:"/cash/add",
		    		    data:{
		    		    	amount:e.data,
		    		    },
		    		    dataType: "json",
		    		    type: "post",
		    		    timeout: 10000,
		    		    success: function(data) {
		    		    	if (data.status==1) {
		    		    		location.href='/v/lists/model_id/33/uid/<?php echo session('user_auth.id')?>';
		    		    	}else{
		    		    		wd_alert({
			    		    		msg:data.info,
			    		    		background:"#f00",
			    		    		timeout:3000
			    		    	});
		    		    	}
		    		    	
		    		    },
		    		    error: function() {
		    		        mui.toast("网络连接超时");
		    		    }
		    		});
		    	},
		    	onCancel: function(e) {
		    	}
		    });         
		})
		//空间流量
		var echartsA = echarts.init(document.getElementById('tpl-echarts'));
        option = {
            tooltip: {
                trigger: 'axis',
                formatter: function (e) {
                	if (e[0].data) {
                		return e[0].name+'点 '+e[0].data+'M';
                	}else{
                		return false;
                	}
                	
                }
            },
            grid: {
                top: '3%',
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: [{
                type: 'category',
                boundaryGap: false,
                data: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]
            }],
            yAxis: [{
                type: 'value'
            }],
            textStyle: {
                color: '#838FA1'
            },
            series: [{
                name: '空间流量',
                type: 'line',
                stack: '总量',
                areaStyle: { normal: {} },
                data: <?php echo $list_hour_data;?>,
                itemStyle: {
                    normal: {
                        color: '#1cabdb',
                        borderColor: '#1cabdb',
                        borderWidth: '2',
                        borderType: 'solid',
                        opacity: '1'
                    },
                    emphasis: {

                    }
                }
            }]
        };

        echartsA.setOption(option);
		</script>
	</body>

</html>