<div class="top" id="top">
    <div class="kf">
      	<p><a class="sb-back" href="javascript:history.back(-1)" title="返回" style=" display: block; width: 40px;    height: 40px;
    margin: auto; background: url(images/arrow_left.png) no-repeat 15px center;float: left;  
    background-size: auto 16px;"></a><img style="    width: 120px;height:32px;    padding-top: 5px;" src="/public/style/images/logo.png"></p>
      	<?php if(!empty($_SESSION["glo_username"])){ ?> 
        <div class="pull-right">
	        <ul>
			 <li style="padding:0px 5px;float: right;"><a href="/mobile/action/login.php?action=loginout" class="bSi">退出</a></li>
	          <li style="padding:0px 5px;float: right;text-align:center"><a class="bSi orange" href="/mobile/user/index.php"><?php  echo $userConfig['username'];?></a></li>
	        
	         
	       	</ul>
  		</div>
  		<?php }else{ ?>
  		<p><a href="/mobile/login.php">登录</a><a href="/mobile/register.php">注册</a></p>
  		<?php } ?>
  	</div>
</div>
<style>
.header {
    min-height--: 115px;
    max-width: 450px;
    min-width: 320px;
    margin: auto;
    padding-top: 0px;
    border-left: 0px solid #f3f3f3;
    border-right: 0px solid #f3f3f3;
    background: #D6382D;
}

.header .nav li a {
    display: inline-block;
    padding: 3px 8.1px;
    color: #fff;
    font-size: 15px;
}

.header .nav li a.on, .header .nav li a:hover {
    color: #FE943C;
    background--: #2a5fa3;
}
.header .nav li+li {
    border-left: 0px solid #f3f3f3;
}
.navdowna{height:97px;      text-align: center;
    padding: 20px 10px;text-align:center;    width: 99%!important;
    margin-bottom: 0px!important;
    background: #fff;
    margin: 10px auto; margin-top: 0px; 
    border: 1px #ddd solid;
    clear: both;}
.navdowna li{height:22px;line-height:22px;font-size:18px;color:#333;margin:0px auto;float:left;width:100%;}
.navdowna .zong{color:#999;font-size:13px;}
.navdowna .jine{color: #E24E4C;
    font-size: 30px;
    line-height: 30px;}

.navdownb{    text-align: center;    height: 120px;
    padding: 20px 10px;background:#F5F5F5;    }
.navdownb .jineadd{    float: left;
    width: 50%;
    text-align: center;
    padding-bottom: 10px;
    font-size: 13px;}
.navdownb .jineadd  .zong{color:#999;font-size:13px;}
.navdownb .jineadd  .jine{    color: #E24E4C;
    font-size: 16px;}
.navdownb .jineadd li{height:25px;line-height:25px;font-size:16px;color:#333;margin:0 auto;width:100%;padding--:10px;float:left;text-align:center}

.btn_orange {
    background: #f60;
    color: #fff;
    float: left;
	height: 30px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    border-radius: .8rem;
    width: 45%;
    text-align: center;
    line-height: 30px;
    margin-bottom: 10px;
	padding:0px;
}
.btn_hui {
    background: #fff;
    color: #0697da;
    border: .1rem solid #e1e1e1;
    float: right;
	height: 30px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    border-radius: .8rem;
    width: 45%;
    text-align: center;
    line-height: 30px;
    margin-bottom: 10px;
	padding:0px;
}
</style>
<div class="topadd" style="background: #D6382D;padding-top: 41px;">
<div class="logoadd" style="background:#fff;width:50px;border-radius:50%;height:50px;margin:10px auto;"><img style="width:50px;height:50px;" src="/mobile/images/touxiang.png"></div>
<div class="header">
 
  <ul class="nav clearfix">
      <?php $thisM =  $_SERVER['PHP_SELF'];?>
      <li><a   href="/mobile/">首页</a></li>
      <li><a <?php if(checkstrMenu('aboutus',$thisM)){ echo ' class="on"';} ?> href="/mobile/aboutus/jianjie.php">关于我们</a></li>
      <li><a  <?php if(checkstrMenu('project',$thisM)){ echo ' class="on"';} ?> href="/mobile/projectlist.php?type=rt">理财产品</a></li>
      <li><a  <?php if(checkstrMenu('safety',$thisM)){ echo ' class="on"';} ?> href="/mobile/safety.php">安全保障</a></li>
      <li><a  <?php if(checkstrMenu('service',$thisM)){ echo ' class="on"';} ?> href="/mobile/service/jr.php?type=about">帮助中心</a></li>
      <li><a  <?php if(checkstrMenu('user',$thisM)){ echo ' class="on"';} ?> href="/mobile/user/index.php">会员中心</a></li>
  </ul>
</div>
</div>
<?php
	$username =  $userConfig['username'];
	//可用余额
	$amount = $userConfig["amount"];

	//投资金额
	$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);
	$username = $_SESSION["glo_username"];
	$sqlct="select sum(moneylog_money) as count from {$db_prefix}moneylog where moneylog_user ='".$username."' and moneylog_notice like '%项目分红%'";
	$rsc = $db->get_one($sqlct);//总收益
?>

<div class="navdowna">
<li class="zong">总资产(元)</li><li class="jine">￥<?php echo $countAmount; ?></li>
</div>
<div class="navdownb">
<div class="jineadd"><li class="jine">￥<?php echo $rsc['count']?$rsc['count']:0; ?></li><li class="zong">累计收益(元)</li></div><div class="jineadd"><li class="jine">￥<?php echo $countAmount; ?></li><li class="zong">可用金额(元)</li>
</div>
<div class="clear" style="height:10px;"></div>
<div class="btn btn_orange" style="background:#FFF">
	<a href="/mobile/user/msg.php"> 收件箱(<font id="top_msg"></font>)<font id="top_playSound"></font></a>
</div>
<div class="btn btn_hui">
<a href="/mobile/user/msg.php">系统消息</a>
</div>
</div>

<script type="text/javascript">
//播放提示音
function playSound(name,str){  
$("#"+name+"").html('<embed width="0" height="0"  src="/public/Front/sound/'+str+'" autostart="true" loop="false">');
}

function total() {
$.get("/action/user.php?action=msg_Unread",function(data){
  top_msg = parseInt($("#top_msg").text()); //统计未读短信
  
  //赋值到模板
  $("#top_msg").html(data); //统计未读短信
  
  //未读站内短信提示
  if (data > 0) {
    playSound('top_playSound','msg.mp3');
  }
});
}
total();
setInterval("total()",3000000);
</script>