<?php  include("../template/usertop.php");?>
<body style="padding:0px;    background: #f5f5f5;">
<?php  include("../template/menu.php");?>
<div class="head-wrap">
<div class="main_top_1">
<div class="mt" style="position:relative;">
<?php  include("../template/user_left.php");?> 
<?php
	$username =  $userConfig['username'];
	//可用余额
	$amount = $userConfig["amount"];
	
	//是否冻结
	$is_dongjie = $userConfig["is_dongjie"];

	//投资金额
	$sqltz = "select sum(amount) as tz from  {$db_prefix}project_buy where username = '".$username."'";
	$rstz = $db->get_one($sqltz);

	//账户余额(提现)
	$sqlye = "select sum(amount) as tx from  {$db_prefix}member_deal where username = '".$username."' and status  = 0";
	$sqlyec = $db->get_one($sqlye);
	$countAmount = $sqlyec['tx'] + $amount;

	//在线充值总
	$sqlCz = "select sum(amount) as cz from  {$db_prefix}member_order where username = '".$username."' and status = 1 and  type  = '在线充值'";
	$rsCz = $db->get_one($sqlCz);

	//优惠充值总额
	$sqlyouh = "select sum(amount) as yh from  {$db_prefix}member_order where username = '".$username."' and type  = '优惠活动' and status = 1 ";
	$rsyouh = $db->get_one($sqlyouh);
?>
<div class="user_zx_right">
<div class="box">
<div class="tagMenu">
<ul class="menu">
<li class="current"><a href="/mobile/user/index.php">我的首页</a></li>
<li><a href="/mobile/user/recycling.php">收益明细</a></li>
<li><a href="/mobile/user/statistics.php">资金明细</a></li>
<li style="display:none"><a href="/mobile/user/promotion_record.php">推广记录</a></li>
</ul>
<div class="hite"> <span id="account"></span> </div>
</div>
</div>
<div class="myinfo" style="padding: 0px 5px; margin-bottom: 15px;background:#fff;">
<table border="0" style="background:#fff;height: 180px;" width="100%" id="table2" cellspacing="0" cellpadding="0" height="125">
<tbody><tr>

<td height="160" colspan="2" width="100%" style="float: left;padding: 10px;">
<p>昵称：<?php echo $userConfig["username"]; ?></p>
<p>手机：<?php  echo half_replace($userConfig['mobile']);?></p>
<p><?php echo $userConfig['realname']; ?>欢迎您！<?php echo checkLevel($userConfig['level']); ?></p>
<p>账户余额：<span style="color:#2a5fa3;font-size:14px; font-weight--:bold;"><?php echo $countAmount; ?></span> 元
	<?php if($sqlyec['tx']>0){  echo '(在提资金：'.$sqlyec['tx'].')';  }?> </p>

	<p>投资金额：<span style="color:#2a5fa3;font-size:14px; font-weight--:bold;"><?php echo $rstz["tz"]?$rstz["tz"]:0; ?></span> 元</p>
<p>注册时间：<?php echo date('Y-m-d H:i:s',$userConfig["posttime"]); ?> </p>
<p>最后登录时间：<?php echo date('Y-m-d H:i:s',$userConfig["logintime"]); ?></p></td>
</tr>
<div class="blank"></div>
<tr>
<td width="250" colspan="2" align="center" style="float: left;margin:0px  10px;"><a href="/mobile/user/recharge.php">
<div class="picbtn pic_chongzhi"></div></a>
<?php if($is_dongjie!=0){ ?>
<a href="/mobile/user/withdraw.php"><div class="picbtn pic_tixianv"></div></a>
<?php } ?>
</td>

</tr>
</tbody></table>

<table border="0" width="725" id="table1" cellspacing="0" cellpadding="0">
<tbody><tr>
<td height="34"><span class="pic pic_3"></span>账户概况</td>
</tr>
<td bgcolor="#dddddd" height="4" width="100%"></td>
</tbody></table>
<table border="1" width="100%" class="zhgk">
<tr>
<td style="25%">账户余额：<?php echo $countAmount?$countAmount:0; ?></td>
<td style="25%">可用余额：<?php echo $amount?$amount:0; ?></td>
<td style="25%">充值总额：<?php echo $rsCz["cz"]?$rsCz["cz"]:0; ?></td>
<td style="25%">优惠余额：<?php echo $rsyouh["yh"]?$rsyouh["yh"]:0; ?></td>
</tr>

</table>

<?php
	$username =  $userConfig['username'];
	
	//总投资额
	$sqltz = "select sum(amount) as zetz from  {$db_prefix}project_buy where username = '".$username."'";
	$rstz = $db->get_one($sqltz);

	//已投项目
	$sqlytxm = "select count(amount) as ytxm from  {$db_prefix}project_buy where username = '".$username."'";
	$rsytxm = $db->get_one($sqlytxm);

	//投资收益
	$sqltzsy = "select sum(moneylog_money) as tzsy from  {$db_prefix}moneylog where moneylog_user = '".$username."' and moneylog_notice like '%项目分红%'";
	$rstzsy = $db->get_one($sqltzsy);

	//结束项目
	$sqljsxm = "select count(id) as jsxm from  {$db_prefix}project_buy where username = '".$username."' and status = 0";
	$rsjsxm = $db->get_one($sqljsxm);

	//本金回收
	$sqlbjhs = "select sum(amount) as bjhs from  {$db_prefix}project_buy where username = '".$username."' and status = 0";
	$rsbjhs = $db->get_one($sqlbjhs);
?>
<table border="0" width="725" id="table1" cellspacing="0" cellpadding="0">
<tbody><tr>
<td height="34"><span class="pic pic_9"></span>收益详情</td>
</tr>
<td bgcolor="#dddddd" height="4" width="100%"></td>
</tbody></table>
<table border="1" width="100%" class="zhgk">
<tr>
<td style="25%">总投资额：<?php  echo $rstz['zetz']?$rstz['zetz']:0;?>元</td>
<td style="25%">已投项目：<?php  echo $rsytxm['ytxm']?$rsytxm['ytxm']:0;?>个</td>
<td style="25%">结束项目：<?php  echo $rsjsxm['jsxm']?$rsjsxm['jsxm']:0;?>个</td>
<td style="25%">投资收益：<?php  echo $rstzsy['tzsy']?$rstzsy['tzsy']:0;?>元</td>
<td style="25%">本金回收：<?php  echo $rsbjhs['bjhs']?$rsbjhs['bjhs']:0;?>元</td>
</tr>

</table>

<table border="0" width="725" id="table1" cellspacing="0" cellpadding="0">
<tbody><tr>
<td height="34"><span class="pic pic_22"></span>安全中心</td>
</tr>
<td bgcolor="#dddddd" height="4" width="100%"></td>
</tbody></table>
<table border="1" width="100%" class="aqzx">
<tr>
<td style="25%">真实姓名:<?php  if($userConfig['realname']){ echo $userConfig['realname']; }else{	echo '未填写';} ?></td>
<td style="25%">交易密码:****** <span style="color:#ff9600;font-size:13px;">[<a href="/mobile/user/password_zflogin.php">马上修改</a>]</span> 默认与登录密码相同</td>
</tr>


<tr>
<td style="25%">密保问题：<?php  if($userConfig['isquestion']){ echo "已设置"; }else{	echo '未设置';} ?><span style="color:#ff9600;font-size:13px;">[<a href="/mobile/user/certification_security.php">马上修改</a>]</span></td>
<td width="250">银行账号：
<?php  if($userConfig['isbank']){ echo "已绑定"; }else{	echo '未绑定<span style="color:#ff9600;font-size:13px;">[<a href="/user/certification_security.php">马上修改</a>]</span>';} ?></td>
</tr>

<tr>
<td style="25%">手机号码：<?php  echo half_replace($userConfig['mobile']);?> <span style="color:#ff9600;font-size:13px;">[<a href="/mobile/user/certification_tel.php">修改并验证</a>]</span></td>
</tr>
<tr>
<td style="25%">手机认证：<img src="/mobile/public/Front/user/sj_<?php  if($userConfig['ismobile']){ echo 1; }else{	echo 0;} ?>.gif"></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<?php  include("../template/foot.php");?> 
</body></html>