<?php
	session_start();
	require_once("../Wx.Config.php");	//只加载一次
	
	//获取客户的微信ID号
	$strwxid=trim($_REQUEST['wxudid']);
	if(strlen($strwxid)>10)
	{
		$_SESSION["main_wxudid"]=$strwxid;
	}
	
	$wxtoken=trim($_REQUEST['wxtoken']);
	if(strlen($wxtoken)>10)
	{
		$_SESSION["main_access_token"]=$wxtoken;
	}
	
	
	include 'loginauto.php';
	
	//判断是否登录系统		
	if($_SESSION["main_viplogined"]!="1" |$_SESSION["main_vipno"]=="")
	{
		//没有登录开始启动登录
		header('location:login.php?stext=&pgid=9');
		exit;
	}
	$strIndexPage = trim($_SESSION["main_defPageIndex"]);
	if(strlen($strIndexPage)<1)
	{
		$strIndexPage = "index.php";
	}
?>

<!DOCTYPE html>
<html>
<head>
	<meta charset="gb2312">	
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	<meta name="apple-mobile-web-app-capable" content="1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=0">
	<meta name="apple-touch-fullscreen" content="1">

	<title>微信点单</title>
	
	<link rel="stylesheet" href="css/mycss.css"> 
	<script src="jsp4/jquery.js"></script>
	<!--<link rel="stylesheet" href="jsp5/jquery.mobile-1.4.5.min.css">-->
	<!--<script src="jsp4/jquery.mobile-1.4.3.min.js"></script>-->
	<script src="jsp5/jquery.mobile-1.4.5.min.js"></script>
	<link rel="stylesheet" href="jsp5/jquery.mobile-1.4.5.min.css">
		
	<script language="JavaScript"> 
		//不允许进行后退
		javascript:window.history.forward(0); 
	</script>
</head>


<?php
		require_once("db/db.php");	
		require_once("common/common.php");
		
		$_SESSION["main_defvipnoflag"]="0";		
		
		//得到当前会员的消费金额信息
		$strselvipno=$_SESSION["main_vipno"];
		$selvipusedsum=0;
		$selvipliftsum=0;
		$selvipintegval=0;
		$selvippswd="";
		$selvipaddress = '';

		$sql = sprintf("Select a.Sub_State,b.VIP_UsedSum,b.VIP_LiftSum,b.VIP_IntegVal,b.VIP_State,a.sub_pswd,a.Sub_Addres,a.Sub_Name,a.Sub_TelNo From VIP_Item a,VIP_Main b Where a.VIP_No=b.VIP_No And a.Sub_No='%s'",$strselvipno);
	
		$result = querySql($sql);
		if($row = fetch_array($result))
		{
			//如果有会员号
			$selvipusedsum=$row['VIP_UsedSum'];
			$selvipliftsum=$row['VIP_LiftSum'];
			$selvipintegval=$row['VIP_IntegVal'];	
			
			$selvippswd=trim($row['sub_pswd']);
			
			$selvipaddress=trim($row['Sub_Addres']);
			
			$_SESSION["main_vipname"]=$row['Sub_Name'];
			$_SESSION["main_viptelno"]=$row['Sub_TelNo'];
			
			$_SESSION["main_vipstate"]=$row['Sub_State'];
			$_SESSION["main_vipVIPState"]=$row['VIP_State'];
		}
		freeResult($result);
		closeDb();
		
				
		if(strlen($selvipaddress)>18)
		{
			$selvipaddress = mb_substr($selvipaddress,0,18,'gb2312').'..';
		}
?>

<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">		
<!--第一个页面的内容实现---------------------------->
<section data-role="page" id="page3">
	<header data-role="header" data-position="fixed" data-tap-toggle="false" style="border-top-width:0px;border-bottom-width:0px;">
        <table width="100%" height="52" border="0" cellpadding="0" cellspacing="0" bgcolor="<?php echo WxMainConfig::colHeadBkColor;?>">
		   	<tr>
				<td height="52" width="20"></td>
				<td height="52" align="center" valign="middle">
	                <span style="color:<?php echo WxMainConfig::colHeadTextColor;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:19px;text-shadow:none;">账户信息</span>
               	</td>
				<td height="52" width="20"></td>
		  	</tr>
		</table>
	</header>
	
	<article data-role="none">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#66FFFF">
			<tr><td height="4" colspan="3"></td></tr>
			
			<tr>
				<td width="8"></td>
				<td align="left" bgcolor="#ffffff">
					<div style="width:100%;height:157px;border-radius:4px;border-top:1px solid #ddd;border-bottom:1px solid #ddd;border-left:1px solid #ddd;border-right:1px solid #ddd;">
						<table width="100%" border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td height="2" width="16"></td>
								<td height="2" width="100">
								<td height="2" align="left"></td>
								<td height="2" width="16"></td>
							</tr>
							
							<tr>
								<td height="30" width="16"></td>
								<td height="30" width="100" valign="middle">
									<span style="color: #666666;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;">会员号：</span>
								</td>
								<td height="30" align="right" valign="middle">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;"><?php echo $_SESSION["main_vipno"]; ?></span>
								</td>
								<td height="30" width="16"></td>
							</tr>
							
							<tr>
								<td height="1" width="16"></td>
								<td height="1" width="100" bgcolor="#F3F3F3"></td>
								<td height="1" align="left" bgcolor="#F3F3F3"></td>
								<td height="1" width="16"></td>
							</tr>
			
							<tr>
								<td height="30" width="16"></td>
								<td height="30" width="100" valign="middle">
									<span style="color: #666666;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;">会员名：</span>
								</td>
								<td height="30" align="right" valign="middle">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;"><?php echo $_SESSION["main_vipname"]; ?></span>
								</td>
								<td height="30" width="16"></td>
							</tr>
														
							<tr>
								<td height="1" width="16"></td>
								<td height="1" width="100" bgcolor="#F3F3F3"></td>
								<td height="1" align="left" bgcolor="#F3F3F3"></td>
								<td height="1" width="16"></td>
							</tr>
			
							<tr>
								<td height="30" width="16"></td>
								<td height="30" width="100" valign="middle">
									<span style="color: #666666;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;">账户余额：</span>
								</td>
								<td height="30" align="right" valign="middle">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;"><?php echo "￥".number_format($selvipliftsum,1); ?></span>
								</td>
								<td height="30" width="16"></td>
							</tr>
		
							<tr>
								<td height="1" width="16"></td>
								<td height="1" width="100" bgcolor="#F3F3F3"></td>
								<td height="1" align="left" bgcolor="#F3F3F3"></td>
								<td height="1" width="16"></td>
							</tr>
			
							<tr>
								<td height="30" width="16"></td>
								<td height="30" width="100" valign="middle">
									<span style="color: #666666;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;">当前积分：</span>
								</td>
								<td height="30" align="right" valign="middle">
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td height="10" align="right">
												<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;"><?php echo number_format($selvipintegval,0); ?></span>	
											</td>
											<td height="10" width="16" align="right">
												<img src="images\jfimg.png" width="12" height="15" border="0" style="margin-top:3px;">
											</td>
										</tr>
									</table>
								</td>
								<td height="30" width="16"></td>
							</tr>
							
							<tr>
								<td height="1" width="16"></td>
								<td height="1" width="100" bgcolor="#F3F3F3"></td>
								<td height="1" align="left" bgcolor="#F3F3F3"></td>
								<td height="1" width="16"></td>
							</tr>
			
							<tr>
								<td height="30" width="16"></td>
								<td height="30" width="100" valign="middle">
									<span style="color: #666666;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;">累计消费：</span>
								</td>
								<td height="30" align="right" valign="middle">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;"><?php echo number_format($selvipusedsum,1); ?></span>
								</td>
								<td height="30" width="16"></td>
							</tr>
							
						</table>
					</div>
				</td>
				<td width="8"></td>
			</tr>
			<!---------------------------------------------------------------------->
			<tr><td height="8" colspan="3"></td></tr>

			<tr>
				<td width="8"></td>
				<td align="left" bgcolor="#ffffff">
					<div style="width:100%;height:92px;border-radius:2px;border-left:1px solid #ddd;border-right:1px solid #ddd;">
						<ul data-role="listview"> 
							<li>
								<div onClick="window.location = 'vipnewpay.php';">
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td height="10" align="left"><span style="color: #666666;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;">在线充值（会员帐户充值）</span></td>
											<td height="10" width="16"><IMG src="images/arrow.png" border=0></td>
										</tr>
									</table>
								</div>
							</li> 
							
							<li>
								<a class="ui-btn" href="myvoucher1.php" data-transition="slide" style="background-color:#FFFFFF;">
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td height="10" align="left"><span style="color: #666666;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;">电子优惠券</span></td>
											<td height="10" width="16"><IMG src="images/arrow.png" border=0></td>
										</tr>
									</table>
								</a>
							</li> 
							
						</ul> 
					</div>
				</td>
				<td width="8"></td>
			</tr>
			<!---------------------------------------------------------------------->
			<!---------------------------------------------------------------------->
			<tr><td height="8" colspan="3"></td></tr>

			<tr>
				<td width="8"></td>
				<td align="left" bgcolor="#ffffff">
					<div style="width:100%;height:183px;border-radius:2px;border-left:1px solid #ddd;border-right:1px solid #ddd;">
						<ul data-role="listview" background-color="#ffffff">    
							<li>
								<a class="ui-btn" href="vipmodify.php?selid=1" data-transition="slide" style="background-color:#FFFFFF;">
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td height="10" align="left"><span style="color: #666666;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;">手机：<?php echo $_SESSION["main_viptelno"]; ?></span></td>
											<td height="10" width="16"><IMG src="images/arrow.png" border=0></td>
										</tr>
									</table>
								</a>
							</li> 

							<li>
                                <a class="ui-btn"  target="_blank" href="vipmodifyaddr.php" data-transition="slide" style="background-color:#FFFFFF;">
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td height="10" align="left">
                                            	<table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                	<tr>
                                                    	<td height="10" width="40" align="left">
                                                        	<span style="color: #666666;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;">地址：</span>
                                                        </td>
                                                        <td height="10" align="left" valign="middle">
                                                        	<span style="color: #666666;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;"><?php echo $selvipaddress; ?></span>
                                                        </td>
                                                    </tr>
                                                </table>	
                                             </td>
											<td height="10" width="16"><IMG src="images/arrow.png" border=0></td>
										</tr>
									</table>
								</a>
							</li> 
                            					
							<li>
								<a class="ui-btn" href="vipnewpswd.php" data-transition="slide" style="background-color:#FFFFFF;">
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td height="10" align="left">
                                            	<span style="color:#666666;font:12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif;font-size:15px;">密码：<?php if(strlen($selvippswd)>0) { echo '********'; } else { echo '未设密码';} ?></span>
                                            </td>
											<td height="10" width="16"><IMG src="images/arrow.png" border=0></td>
										</tr>
									</table>
								</a>
							</li> 
							
							<li>
								<a class="ui-btn" href="vipmodify.php?selid=4" data-transition="slide" style="background-color:#FFFFFF;">
									<table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td height="10" align="left">
												<?php if(strlen($_SESSION["main_vipwxudid"])>0) { ?>
													<span style="color: #666666;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;">微信：已绑定</span>
												<?php } else { ?>
													<span style="color: #666666;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;">微信：未绑定</span>
												<?php } ?>
											</td>
											<td height="10" width="16"><IMG src="images/arrow.png" border=0></td>
										</tr>
									</table>
								</a>
							</li> 
						</ul> 
					</div>
				</td>
				<td width="8"></td>
			</tr>
			<!---------------------------------------------------------------------->
									
			<tr><td height="8" colspan="3"></td></tr>
			<!---------------------------------------------------------------------->
						
		</table>
						
	</article>
		
	<footer data-role="footer" data-position="fixed" data-tap-toggle="false" style="border-top:0px solid #F3EDED;border-bottom:0px solid #F6F5F2;border-left:0px solid #F6F5F2;border-right:0px solid #F6F5F2;">
		<table width="100%" height="45" border="0" cellpadding="0" cellspacing="0" bgcolor="#F6F6F6">
			<tr height="100%" valign="middle" align="center">
				<td width="25%" style="border-top:1px solid #F3EDED;">
					<div onClick="window.location='<?php echo $strIndexPage;?>';" style="width:100%;height:100%;padding-top:5px;">
						<div style="width:24px;height:20px;">
							<img src="images\p1_a.png" width="20" height="20" border="0">
						</div>
						<span style="color:#747474;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;">首页</span>
					</div>
				</td>
				<td width="25%" style="border-top:1px solid #F3EDED;border-left:0px solid #F6F5F2;">
					<div onClick="window.location='cartlist.php';" style="width:100%;height:100%;padding-top:5px;">
						<div style="width:24px;height:20px;">
							<img src="images\p3_a.png" width="20" height="20" border="0">
						</div>
						<span style="color:#747474;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;padding-left:4px;">已点单</span>
					</div>
				</td>
				<td width="25%" style="border-top:1px solid #F3EDED;border-left:0px solid #F6F5F2;">
					<div onClick="window.location='orderlist.php?bstat=0';"style="width:100%;height:100%;padding-top:5px;">
						<div style="width:24px;height:20px;">
							<img src="images\p2_a.png" width="20" height="20" border="0">
						</div>
						<span style="color:#747474;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;">订单</span>
					</div>
				</td>
				<td width="25%" style="border-top:1px solid #F3EDED;border-left:0px solid #F6F5F2;">
					<div style="width:100%;height:100%;padding-top:5px;">
						<div style="width:24px;height:20px;">
							<img src="images\p4_b.png" width="20" height="20" border="0">
						</div>
						<span style="color:#747474;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;">我的</span>
					</div>
				</td>
			</tr>
		</table>						
	</footer>
	
</section>
</body>
	
</html>