<?php if( !defined( 'ONGPHP')) exit( 'Error ONGSOFT');
	$D = db('');
	$user = $D -> setbiao('user') -> where( 
		array( 
			"uid" => $_SESSION['uid'], 
		) 
	) -> find();


/*获取回传的openid*/
$openid = isset($_GET['openid']) ? $_GET['openid'] :'';
if ($openid!='') {
	/*查询会员*/
	if ($user['weixin']=='') {
		$fan = $D ->setbiao('user')->where( array("uid"=>$_SESSION['uid']))-> update(array(
			'weixin' => $openid,
			));
	}
}

?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title><?php echo $shezhi['title'] ?></title>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.2, user-scalable=0">
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="yes" name="apple-touch-fullscreen" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta content="telephone=no,email=no" name="format-detection">
	<link rel="stylesheet" href="/wabao/reset.css"/>
	<link rel="stylesheet" href="/wabao/style.css?3223"/>
	<script type="text/javascript" src="/wabao/jquery.min.js"></script>
	<script type="text/javascript" src="/wabao/layer.js"></script>
	<style type="text/css">
		.bibb{
			width: 100%;
		}

		.bibb tr td input{width: 100%;height: 40px;border: 1px solid #eee; }
		.jjj{
			width: 100%;height: 30px;
		}
	</style>

</head>

<header class="header-member1">
	<div class="top">
		<div class="big"><div><span>


		<?php 
			
		if ($user['touxiang']) {
			?>
			<img src="<?php echo $user['touxiang'] ?>">

			<?php
		}else{
			?>

			<img src="/wabao/tou.png">

			<?php
		}

		?>

		</span> <?php echo $user['name'] ?> </div></div>

		<?php 



			if ($shezhi['zidongtixian']=='1') {
				if (  (float)$user['jine'] > (float)$shezhi['zuidati']  ) {
					?>

					<?php 




						
					if ($user['weixin']!='') {





											

					?>
		<?php 
			
		if ($user['touxiang']) {

		?>
		<a href="javascript:void(0);" onclick="cash2('<?php echo $user['touxiang'] ?>');" class="right_a">余额兑换</a>
		<?php 
			}else{
		?>
		<a href="javascript:void(0);" onclick="cash2('/wabao/');" class="right_a">余额兑换</a>
		<?php 
			}
		?>
			
		<?php 
			}else{
				$lingurl = $shezhi['lingurl'].'openid.php?mid='.$shezhi['linguid'];

		?>

	<a href="<?php echo $lingurl ?>"  class="right_a">余额兑换</a>


<?php 
	}
?>



					<?php
				}else{


					if ($openid!='') {
						
					

				?>

			<?php 
			
		if ($user['touxiang']) {

		?>
		<a href="javascript:void(0);" onclick="cash2('<?php echo $user['touxiang'] ?>');" class="right_a">余额兑换</a>
		<?php 
			}else{
		?>

		<a href="javascript:void(0);" onclick="cash2('/wabao/');" class="right_a">余额兑换</a>


		<?php 
			}
		?>

			<?php
				
		}else{
		$lingurl = $shezhi['lingurl'].'openid.php?mid='.$shezhi['linguid'];
				?>

<a href="<?php echo $lingurl ?>"  class="right_a">余额兑换</a>



				<?php



		}

			}


			}else{


		?>
		<?php 
			
		if ($user['touxiang']) {

		?>
		<a href="javascript:void(0);" onclick="cash1('<?php echo $user['touxiang'] ?>');" class="right_a">余额兑换</a>
		<?php 
			}else{
		?>

		<a href="javascript:void(0);" onclick="cash1('/wabao/');" class="right_a">余额兑换</a>


		<?php 
			}
		?>


		<?php 
			}
		?>

	</div>
    
<div class="rule-box2 service" onClick="show_tixian();">
	<span class="rule-btn">提现规则</span>
</div>
	<div class="ucont">
		<div class="cont_list">
			<span class="ttprice" id="amount"><?php echo $user['jine'] ?><em>元</em></span>
			<!-- <span class="tttext">您每天可以提现100次到微信零钱.</span> -->
		</div>
	</div>
	<div class="butt">
		<ul class="butt_list">
		<?php 
			
		/*计算佣金*/
		$order = '  ';
		$tiaojian = array(
			'type' => 8,
			'uid' => $_SESSION['uid']
			);
		$yongs = $D -> setbiao('jinelog') -> order(  )->where( $tiaojian )-> select();

		if (  $yongs ) {
			$hh = array();
			foreach($yongs as  $k => $v){
				$hh[] = $v['jine'];
			}
			$hhz = array_sum($hh);
		}else{
			$hhz = 0;
		}

		/*查询好友*/
		$order = '  ';
		$tiaojian = array(
			'tuid' =>$_SESSION['uid'],

			);
		$haoyou1 = $D -> setbiao('user') -> order(  )->where( $tiaojian )-> select();
	

		if ($haoyou1) {
			$num1 = count($haoyou1);
		}else{
			$num1 = 0;
		}
	
		$tiaojian = array(
			'tuid1' => $_SESSION['uid'],
			);

		$haoyou2 = $D -> setbiao('user') -> order(  )->where( $tiaojian )-> select();
		if ($haoyou2) {
			$num2 = count($haoyou2);
		}else{
			$num2 = 0;
		}

		$renshu = $num1  + $num2;

		?>
		  <a href="javascript:void(0);" onclick="record_caiwu(2);"><li> <span class="ttprice"><?php echo $hhz ?></span><span class="tttext">邀请好友佣金（累计）</span> </li></a>
		  <a href="javascript:void(0);" onclick="record_haoyou();"><li> <span class="ttprice"> <?php echo $renshu ?></span><span class="tttext">好友数（人）</span> </li></a>
		</ul>

	</div>
</header>
<div class="dldl">
<a href="javascript:void(0);" onclick="record_caiwu(1);">
	<div class="vipnav">
		<img src="http://www.tianlirun.net/themes/2018/res/img/member-cw.png" width="6%" style="vertical-align: middle;"> 财务明细
		<span class="gspan"><img src="http://www.tianlirun.net/themes/2018/res/img/member-jian.png"></span>
	</div>
</a>
<a href="javascript:void(0);" onclick="record_caiwu(4);">
	<div class="vipnav">
		<img src="http://www.tianlirun.net/themes/2018/res/img/member-red.png" width="6%" style="vertical-align: middle;"> 挖包记录
		<span class="gspan"><img src="http://www.tianlirun.net/themes/2018/res/img/member-jian.png"></span>
	</div>
</a>
</div>
<a href="?action=yaoqing" >
	<div class="vipnav">
		<img src="http://www.tianlirun.net/themes/2018/res/img/member-qr.png" width="6%" style="vertical-align: middle;"> 我的二维码，拉好友赚钱
		<span class="gspan"><img src="http://www.tianlirun.net/themes/2018/res/img/member-jian.png"></span>
	</div>
</a>
<a href="javascript:void(0);" onclick="record_caiwu(2);">
	<div class="vipnav bt">
		<img src="http://www.tianlirun.net/themes/2018/res/img/member-order.png" width="6%" style="vertical-align: middle;"> 邀请好友佣金明细
		<span class="gspan"><img src="http://www.tianlirun.net/themes/2018/res/img/member-jian.png"></span>
	</div>
</a>
<div class="dldl">
<a href="javascript:void(0);" onclick="lxkf2();" style="display:none;">
	<div class="vipnav">
		<img src="http://www.tianlirun.net/themes/2018/res/img/member-msg.png" width="6%" style="vertical-align: middle;"> 联系客服
		<span class="gspan"><img src="http://www.tianlirun.net/themes/2018/res/img/member-jian.png"></span>
	</div>
</a>

<a href="javascript:void(0);" onclick="lxkf();">
	<div class="vipnav">
		<img src="http://www.tianlirun.net/themes/2018/res/img/member-gy.png" width="6%" style="vertical-align: middle;"> 平台永久入口
		<span class="gspan"><img src="http://www.tianlirun.net/themes/2018/res/img/member-jian.png"></span>
	</div>
</a>
</div>
<div style="padding-top: 1rem;padding-bottom: 2.632rem;font-size: 0.768rem;text-align: center;color: #666;"></div>
<script type="text/javascript">
var st = '1';
</script>
<script type="text/javascript">
		
		var boommsg = '&#128557; ';//全局变量
		var domain = 'http://www.tianlirun.net/themes/2018';
	</script>
<script type="text/javascript" src="/wabao/apps.js"></script>

	<script type="text/javascript">

	



	<?php 
		
		if (is_array($shezhi['tixian'])) {
			$html = '';
			foreach($shezhi['tixian'] as  $k => $v){
				$html.="<p>".$v."</p>";
			}

		}


	?>
	var hh = "<?php echo $html ?>";
		//规则提现规则
	function show_tixian() {
		var html = '<div>';
			html += '<a href="javascript:void(0);" class="colse" onclick="layer.closeAll();"><img src="' + domain + '/res/img/rule-colse.png"></a>';
			//html += '<div class="title"><img src="' + domain + '/res/img/rule-title.png"></div>';
			html += '<div class="title">提现规则</div>';
			html += '<div class="content">';
			html+=hh;
			html += '</div></div>';
			layer.open({
				type: 1,
				className: 'layui-m-rule',
				content: html,
				anim: 'bt',
				shadeClose: false,
				style: 'border-radius: 0.32rem;box-shadow: none;'
			});
	}

	</script>


<?php 
	$lan = 'me';
include QTPL.'foot.php';?>
<?php 
	
	$huiyuan = $D -> setbiao('user') -> where( 
		array( 
			"uid" => $_SESSION['uid'], 
		) 
	) -> find();
	


?>



<input type="hidden" name="" value="<?php echo $huiyuan['jine'] ?>" id="user_amount">
<input type="hidden" name="" value="<?php echo $shezhi['zuidi'] ?>" id="tixian_min_money">


<script type="text/javascript">
	


	<?php

	if ($openid!='') {
		?>
		cash2("<?php  echo $user['touxiang'] ?>");

		<?php

	}

	
	?>


	<?php 
		$ewmurl = 'ewm.php?data='.WZHOST;

	?>

	var ewmurl = "<?php echo $ewmurl ?>";

// 永久入口
function lxkf() {
    layer.open({
      type: 1,
	  className: 'layui-m-lxkf',
	  content: '<h1>长按二维码->保存或收藏平台永久入口</h1><div class="ewm"><img src="'+ewmurl+'"></div>',
	  anim: 'up',
	  btn: ['关闭'],
	  style: 'position:fixed; bottom:0; left:0;padding:0.64rem 0; border:none;'
    });
}
</script>

</html>