 <?php  include("../template/usertop.php");?>
<body>
<?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'];
	$sqlsc = "select sum(amount) as deal from  {$db_prefix}member_deal where username = '".$username."' and status  = 0";
	$rssc = $db->get_one($sqlsc);

	//待确认充值
	$sqlpay = "select sum(amount) as pay from  {$db_prefix}member_companypay where username = '".$username."' and status  = 0";
	$rspay = $db->get_one($sqlpay);

	//优惠收入
	$sqlyouh = "select sum(amount) as yh from  {$db_prefix}member_order where username = '".$username."' and type  = '优惠活动' ";
	$rsyouh = $db->get_one($sqlyouh);
?> 
<div class="user_zx_right">
<div class="box">
<div class="tagMenu">
<ul class="menu">
<li class="current"><a href="/user/statistics.php">资金统计</a></li>
<li><a href="/user/recharge.php">马上充值</a></li>
<li><a href="/user/recharge_list.php">充值记录</a></li>
<li><a href="/user/withdraw.php">马上提现</a></li>
<li><a href="/user/withdraw_list.php">提现记录</a></li>
<li><a href="/user/offline_record.php">下线分成记录</a></li>
</ul>
<div class="hite"> <span id="account"></span> </div>
</div>
</div>
<div class="myinfo" style="padding: 20px; margin-bottom: 15px;background:#fff;">
<p style="margin:15px 0px;">尊敬的<?php echo configW('webname'); ?>用户，以下是您在<?php echo configW('webname'); ?>的资金情况，敬请仔细审阅</p>
<table border="0" width="725" id="table1" cellspacing="0" cellpadding="0" style="margin-top:10px;" height="314">
<tbody><tr>
<td bgcolor="#f5f5f5" height="34" style="padding-left:5px;font-size:13px; line-height:34px;border:#e6e6e6 solid 1px;"><span style="width: 5px;height: 20px;background-color: #ff6600;float: left;margin:7px;display: block;"></span>资金存量</td>
</tr>
<tr>
<td style="border-right:#e6e6e6 solid 1px;border-bottom:#e6e6e6 solid 1px;border-left:#e6e6e6 solid 1px; padding:15px;">
<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" height="171">
<tbody><tr height="50">
<td width="179" style="padding-left:30px; font-size:14px;" align="right">可用现金金额：</td>
<td width="142"><span style="color:#ff6600; font-size:14px;">￥<?php echo $userConfig["amount"]?$userConfig["amount"]:0; ?></span></td>
<td width="372">（可以用来直接提现或投标的金额）</td>
</tr>

<!-- <tr><td align="center" colspan="3"><div style="background:#e6e6e6; width:98%; height:1px;"></div></td></tr>
<tr height="50">
<td width="179" style="padding-left:30px; font-size:14px;" align="right">待收本息金额：</td>
<td width="142"><span style="color:#ff6600; font-size:14px;">￥0.00</span></td>
<td width="372">（已经投资，尚未回收的本金和利息总额，未扣除佣金）</td>
</tr>

<tr><td align="center" colspan="3"><div style="background:#e6e6e6; width:98%; height:1px;"></div></td></tr>
<tr height="50">
<td width="179" style="padding-left:30px; font-size:14px;" align="right">待收本金金额：</td>
<td width="142"><span style="color:#ff6600; font-size:14px;">￥0.00</span></td>
<td width="372">（已经投资，尚未回收的本金总额）</td>
</tr>

<tr><td align="center" colspan="3"><div style="background:#e6e6e6; width:98%; height:1px;"></div></td></tr>
<tr height="50">
<td width="179" style="padding-left:30px; font-size:14px;" align="right">待收利息金额：</td>
<td width="142"><span style="color:#ff6600; font-size:14px;">￥0.00</span></td>
<td width="372">（已经投资，尚未回收的利息总额）</td>
</tr> -->

<tr><td align="center" colspan="3"><div style="background:#e6e6e6; width:98%; height:1px;"></div></td></tr>
<tr height="50">
<td width="179" style="padding-left:30px; font-size:14px;" align="right">待确认提现：</td>
<td width="142"><span style="color:#ff6600; font-size:14px;">￥<?php echo $rssc["deal"]?$rssc["deal"]:0; ?></span></td>
<td width="372">（您申请提现中的金额）</td>
</tr>
<tr><td align="center" colspan="3"><div style="background:#e6e6e6; width:98%; height:1px;"></div></td></tr>
<tr height="50">
<td width="179" style="padding-left:30px; font-size:14px;" align="right">待确认充值：</td>
<td width="142"><span style="color:#ff6600; font-size:14px;">￥<?php echo $rspay["pay"]?$rspay["pay"]:0; ?></span></td>
<td width="372">（等待确认的线下充值金额）</td>
</tr>
<tr><td align="center" colspan="3"><div style="background:#e6e6e6; width:98%; height:1px;"></div></td></tr>
<tr height="50">
<td width="179" style="padding-left:30px; font-size:14px;" align="right">优惠收入总额：</td>
<td width="142"><span style="color:#ff6600; font-size:14px;">￥<?php echo $rsyouh["yh"]?$rsyouh["yh"]:0; ?></span></td>
<td width="372">（可以用来直接投标的金额）</td>
</tr>
<!-- <tr><td align="center" colspan="3"><div style="background:#e6e6e6; width:98%; height:1px;"></div></td></tr>
<tr height="50">
<td width="179" style="padding-left:30px; font-size:14px;" align="right">冻结资金：</td>
<td width="142"><span style="color:#ff6600; font-size:14px;">￥0.00</span></td>
<td width="372"></td>
</tr> -->
<tr><td align="center" colspan="3"><div style="background:#e6e6e6; width:98%; height:2px;"></div></td></tr>
<tr height="50">
<td width="179" style="padding-left:30px; font-size:14px;" align="right">账户资金总额：</td>
<td width="142"><span style="color:#ff6600; font-size:14px;">￥<?php echo $userConfig["amount"]?$userConfig["amount"]:0; ?></span></td>
<td width="372">（您在<?php echo configW('webname'); ?>平台上现有现金资产的总额）</td>
</tr>
<tr><td colspan="3"><p style="margin:15px;"> 账户资产总额 = 可用现金金额 + 待收本金金额 + 待确认提现 + 待确认充值 + 冻结资金</p></td></tr>
</tbody></table></td>
</tr>
</tbody></table>

<?php
	//累计充值金额
	$username =  $userConfig['username'];
	$sqlCz = "select sum(amount) as cz from  {$db_prefix}member_order where username = '".$username."' and type  = '在线充值' and status = 1";
	$rsCz = $db->get_one($sqlCz);

	//提现
	$sqlTx = "select sum(amount) as tx from  {$db_prefix}member_deal where username = '".$username."' and status  = 1";
	$rsTx = $db->get_one($sqlTx);

	//投资金额
	$sqltz = "select sum(amount) as tz from  {$db_prefix}project_buy where username = '".$username."'";
	$rstz = $db->get_one($sqltz);
?> 
<table border="0" width="725" id="table1" cellspacing="0" cellpadding="0" style="margin-top:10px;" height="254">
<tbody><tr>
<td bgcolor="#f5f5f5" height="34" style="padding-left:5px;font-size:13px; line-height:34px;border:#e6e6e6 solid 1px;"><span style="width: 5px;height: 20px;background-color: #ff6600;float: left;margin:7px;display: block;"></span>资金流量</td>
</tr>
<tr>
<td style="border-right:#e6e6e6 solid 1px;border-bottom:#e6e6e6 solid 1px;border-left:#e6e6e6 solid 1px; padding:15px;">
<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" height="171">
<tbody><tr height="50">
<td width="179" style="padding-left:30px; font-size:14px;" align="right">累计投资金额：</td>
<td width="142"><span style="color:#ff6600; font-size:14px;">￥<?php echo $rstz["tz"]?$rstz["tz"]:0; ?></span></td>
<td width="372">（注册至今，您账户投资资金总和）</td>
</tr>
<tr><td align="center" colspan="3"><div style="background:#e6e6e6; width:98%; height:1px;"></div></td></tr>
<tr height="50">
<td width="179" style="padding-left:30px; font-size:14px;" align="right">累计充值金额：</td>
<td width="142"><span style="color:#ff6600; font-size:14px;">￥<?php echo $rsCz["cz"]?$rsCz["cz"]:0; ?></span></td>
<td width="372">（注册至今，您账户累计充值总额）</td>
</tr>
<tr><td align="center" colspan="3"><div style="background:#e6e6e6; width:98%; height:1px;"></div></td></tr>
<tr height="50">
<td width="179" style="padding-left:30px; font-size:14px;" align="right">累计提现金额：</td>
<td width="142"><span style="color:#ff6600; font-size:14px;">￥<?php echo $rsTx["tx"]?$rsTx["tx"]:0; ?></span></td>
<td width="372">（注册至今，您账户累计提现总额）</td>
</tr>
<tr><td align="center" colspan="3"><div style="background:#e6e6e6; width:98%; height:1px;"></div></td></tr>
</tbody></table></td>
</tr>
</tbody></table>
</div>
</div>
</div>
</div>
<?php  include("../template/foot.php");?> 
</body></html>