<?php
	session_start();
	require_once("db/db.php");	
	require_once("common/common.php");
	ini_set('session.gc_maxlifetime', 99999999); //设置时间 永不过期
	//判断是否登录系统		
	if($_SESSION['main_wx_userlogined']!="1" | $_SESSION['main_wx_userno']=="")
	{
		//没有登录开始启动登录
		header('location:..\loginwx.php?rset=0');
		exit;
	}
	
	$datday1=$_REQUEST["datday1"];
	$datday2=$_REQUEST["datday2"];
	
	//echo $datday1."**".$datday2;;
	
	if($datday1=="" | $datday2=="")
	{
		//设置默认日期
		$strtemp=getdate();
		$strtemp1=date("Y-m-d",strtotime("-20 day"));
		//$strtemp1=date('Y-m-d',$strtemp - 1*24*60*60);
		$datday1= $strtemp1;//[year]."-".sprintf("%02d",$strtemp1[mon])."-".sprintf("%02d",$strtemp1[mday]);
		$datday2= $strtemp[year]."-".sprintf("%02d",$strtemp[mon])."-".sprintf("%02d",$strtemp[mday]);
	}
	//echo $datday1."+++".$datday2."**".$strtemp1;
?>
<!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">
	
	<Meta http-equiv="Page-Enter" Content="blendTrans(Duration=0.5)"> 
	<Meta http-equiv="Page-Exit" Content="blendTrans(Duration=0.5)">
	
	<title><?php echo $_SESSION['ChainName']?></title>
	
	<link rel="stylesheet" href="jsp4/jquery.mobile-1.4.3.min.css">
	<script src="jsp4/jquery.js"></script>
	<script src="jsp4/jquery.mobile-1.4.3.min.js"></script>
	
	<link rel="stylesheet" href="css/mycss.css"> 
	<link rel="stylesheet" href="jsp4/jquery.mobile.datepicker.css">
	<script src="jsp4/jquery.ui.datepicker.js"></script>
	<script id="mobile-datepicker" src="jsp4/jquery.mobile.datepicker.js"></script>
	
</head>

<script>	
		//隐藏维信右上角菜单
		function onBridgeReady(){
			WeixinJSBridge.call('hideOptionMenu');
		}

		if (typeof WeixinJSBridge == "undefined")
		{
			if( document.addEventListener )
			{
				document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
			}
			else if (document.attachEvent)
			{
				document.attachEvent('WeixinJSBridgeReady', onBridgeReady); 
				document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
			}
		}
		else
		{
			onBridgeReady();
		}
	</script>
	
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">

<section data-role="page" id="pagepayfor1">		
	
	<header data-role="header" data-position="fixed" data-tap-toggle="false">
		<table width="100%" height="35" border="0" cellpadding="0" cellspacing="0">	   
			<tr>
				<td height="35" width="45" align="right">
					<a href="../indexm.php?rset=0" data-role="button" data-icon="home" data-iconpos="notext" rel="external"></a>
				</td>
				<td height="35" width="6" align="right"></td>
				<td height="35" align="left" colspan="2">
					<table width="100%" height="10" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width="10" align="left"></td>
							<td width="90" align="left"  class="STYLEM2">
								<span style="color:#000 ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">
								<input type="text" id="dtp1" name="dtp1" readonly= "true" value="<?php echo $datday1;?>" data-role="date">
								</span>
							</td>
							
							<td width="20" align="center" ><span style="color:#000 ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">至</span></td>
							
							<td width="90" align="left"  class="STYLEM2">
								<span style="color:#000 ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">
								<input type="text" id="dtp2" name="dtp2" readonly= "true" value="<?php echo $datday2;?>" data-role="date">
								</span>
							</td>
							<td width="5" align="center"></td>
							<td width="80" align="left"  class="STYLEM2">
								<div id="bmtSendOk" onClick="OnSendFindClick()" style="border-radius:3px; width:70px; height:28px; background-color:#D7AA28;opacity:0.9;">
									<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr><td width="100%" height="100%" align="center">
											<span style="color:#fff ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">查 询</span>
										</td></tr>
									</table>
								</div>
							</td>
							<td align="left">&nbsp;</td>
						</tr>
					</table>
					
					
				</td>
			</tr>		  
			
		</table>
	</header>
	
	
	<article data-role="none" style="background-color:#fff" >
		<table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFF">
			
			<tr>
				<td height="1" width="6" ></td>
				<td height="1">
					<?php				
						$chainno=$_SESSION["ChainNo"];
						
						$intRowID=0;
						
						$fltBefScoreVal=0;
						$fltBefPayVal=0;
						$fltBefSumVal=0;
						
						$fltNowScoreVal=0;
						$fltNowPayVal=0;
						$fltNowSumVal=0;

						$sql=sprintf("SELECT SUM(SumValue1)AS SumValue1,SUM(SumPayVal1)AS SumPayVal1,SUM(SumValue2)AS SumValue2,SUM(SumPayVal2)AS SumPayVal2 FROM (
									SELECT SUM(a.Item_Value)AS SumValue1,SUM(a.PayFor_Value)AS SumPayVal1,0 AS SumValue2,0 AS SumPayVal2 FROM TR_Consume_List a,TR_Order_Inform b
									WHERE a.Order_No=b.Order_No AND b.Chain_No='%s' AND a.TradeTime<'%s'
									UNION SELECT 0 AS SumValue1,0 AS SumPayVal1,SUM(a.Item_Value)AS SumValue2,SUM(a.PayFor_Value)AS SumPayVal2 FROM TR_Consume_List a,TR_Order_Inform b
									WHERE a.Order_No=b.Order_No AND b.Chain_No='%s'
											AND a.TradeTime>='%s' AND a.TradeTime<'%s 23:59:59')t",$chainno,$datday1,$chainno,$datday1,$datday2);

						$result = querySql($sql);
						if($row = fetch_array($result))
						{
							$fltBefScoreVal=$row['SumValue1'];
							$fltBefPayVal=$row['SumPayVal1'];
							
							$fltNowScoreVal=$row['SumValue2'];
							$fltNowPayVal=$row['SumPayVal2'];
						}
						freeResult($result);
						
						//得到期初余额
						//$fltBefSumVal=$fltBefPayVal - $fltBefScoreVal;
						$fltBefSumVal=$fltBefScoreVal - $fltBefPayVal ;
						
						//得到本期余
						//$fltNowSumVal=$fltNowPayVal - $fltNowScoreVal;
						$fltNowSumVal=$fltNowScoreVal - $fltNowPayVal;
						
						//期末余额
						$fltNewSumVal=$fltBefSumVal + $fltNowSumVal;

					?>
					
					<div data-role="none" class="STYLEM2">
						<table width="100%" height="30" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
							<tr bgcolor="#F6F2F2">
								<td height="30" width="6"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">A.期初余额</span>
								</td>
																
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo number_format($fltBefSumVal,2);?></span>
								</td>
								<td height="30" width="6"></td>
							</tr>
														
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
						</table>
						
						<table width="100%" height="8" border="0"  cellpadding="0" cellspacing="0">
							<tr><td height="8"></td></tr>
						</table>
					</div>
					
					
					<div data-role="none" class="STYLEM2">
						<table width="100%" height="30" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
							<tr bgcolor="#F6F2F2">
								<td height="30" width="6"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">B.本期收入</span>
								</td>
																
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo number_format($fltNowScoreVal,2);?></span>
								</td>
								<td height="30" width="6"></td>
							</tr>
														
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
						</table>
					</div>
					
					
					<div data-role="none" class="STYLEM2">
						<table width="100%" height="20" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
					<?php
					
						$strItemName='';
						$fltItemValue=0;
						
						$sql=sprintf("SELECT a.Item_Name,SUM(a.Item_Value)AS SumValue FROM TR_Consume_List a,TR_Order_Inform b
									WHERE a.Order_No=b.Order_No AND a.Item_Value<>0 AND b.Chain_No='%s'
									AND a.TradeTime>='%s' AND a.TradeTime<'%s 23:59:59'
									GROUP BY a.Item_Name ORDER BY a.Item_Name ASC",$chainno,$datday1,$datday2);

						$result = querySql($sql);
						
						while($row = fetch_array($result))
						{
							$intRowID = $intRowID + 1;
							//得到每一条的记录信息
							$strItemName=$row['Item_Name'];
							$fltItemValue=$row['SumValue'];
							
					?>
							<tr>
								<td height="30" width="19"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;"><?php echo $strItemName;?></span>
								</td>
								
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;"><?php echo number_format($fltItemValue,2);?></span>
								</td>
								<td height="30" width="6"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>

					<?php
						}
						//释放数据库 $fltSumVal1
						freeResult($result);
					?>
						</table>
						
						<table width="100%" height="10" border="0"  cellpadding="0" cellspacing="0">
							<tr><td height="10"></td></tr>
						</table>
					</div>
					


					<div data-role="none" class="STYLEM2">
						<table width="100%" height="30" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
							<tr bgcolor="#F6F2F2">
								<td height="30" width="6"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">C.本期收款</span>
								</td>
																
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo number_format($fltNowPayVal,2);?></span>
								</td>
								<td height="30" width="6"></td>
							</tr>
														
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
						</table>
					</div>
					
					
					<div data-role="none" class="STYLEM2">
						<table width="100%" height="20" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
					<?php
					
						$strPayType='';
						$fltItemPayA=0;
						$fltItemPayB=0;
						
						$sql=sprintf("SELECT PayFor_Type,SUM(SumPayA)AS SumPayA,SUM(SumPayB)AS SumPayB FROM (
								SELECT a.PayFor_Type,SUM(a.PayFor_Value)AS SumPayA,0 AS SumPayB FROM TR_Consume_List a,TR_Order_Inform b
								WHERE a.Order_No=b.Order_No AND a.PayFor_Value>0 AND b.Chain_No='%s'
								AND a.TradeTime>='%s' AND a.TradeTime<'%s 23:59:59'
								GROUP BY a.PayFor_Type
								UNION SELECT a.PayFor_Type,0 AS SumPayA,SUM(a.PayFor_Value) AS SumPayB FROM TR_Consume_List a,TR_Order_Inform b 
								WHERE a.Order_No=b.Order_No AND a.PayFor_Value<0 AND b.Chain_No='%s'
								AND a.TradeTime>='%s' AND a.TradeTime<'%s 23:59:59'
								GROUP BY a.PayFor_Type)t GROUP BY PayFor_Type ORDER BY PayFor_Type ASC",$chainno,$datday1,$datday2,$chainno,$datday1,$datday2);
								
						$result = querySql($sql);
						
						while($row = fetch_array($result))
						{
							$intRowID = $intRowID + 1;
							//得到每一条的记录信息
							$strPayType=$row['PayFor_Type'];
							$fltItemPayA=$row['SumPayA'];
							$fltItemPayB=$row['SumPayB'];
							
							if($fltItemPayB<0)
							{
								$strItemText=number_format($fltItemPayA,2).'(收)'.number_format($fltItemPayB,2).'(退) =';
							}
							else
							{
								$strItemText=number_format($fltItemPayA,2).'(收)'.'-0(退) =';
							}
							
					?>
							<tr>
								<td height="30" width="19"></td>
								<td height="30" width="80" align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;"><?php echo $strPayType;?></span>
								</td>
								
								<td height="30"  align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:11px;text-shadow:none;"><?php echo $strItemText;?></span>
								</td>
								
								<td height="30" width="80" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;"><?php echo number_format(($fltItemPayA+$fltItemPayB),2);?></span>
								</td>
								<td height="30" width="6"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>

					<?php
						}
						//释放数据库 $fltSumVal1
						freeResult($result);
					?>
						</table>
						
						<table width="100%" height="10" border="0"  cellpadding="0" cellspacing="0">
							<tr><td height="10"></td></tr>
						</table>
					</div>
					


					<div data-role="none" class="STYLEM2">
						<table width="100%" height="30" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
							<tr bgcolor="#F6F2F2">
								<td height="30" width="6"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">D.本期余额</span>
								</td>
																
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo number_format($fltNowSumVal,2);?></span>
								</td>
								<td height="30" width="6"></td>
							</tr>
														
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
						</table>
						
						<table width="100%" height="1" border="0"  cellpadding="0" cellspacing="0">
							<tr><td height="1"></td></tr>
						</table>
					</div>


					<div data-role="none" class="STYLEM2">
						<table width="100%" height="30" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
							<tr bgcolor="#F6F2F2">
								<td height="30" width="6"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">E.期末余额</span>
								</td>
																
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo number_format($fltNewSumVal,2);?></span>
								</td>
								<td height="30" width="6"></td>
							</tr>
														
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
						</table>
						
						<table width="100%" height="12" border="0"  cellpadding="0" cellspacing="0">
							<tr><td height="12"></td></tr>
						</table>
					</div>

					
					<?php 
						//F.应收账款   G.会员余额
						$fltTemp1=0;
						$fltTemp2=0;
						$fltTemp3=0;
						
						$sql=sprintf("SELECT SUM(SumValue)AS SumValue,SUM(SumScore)AS SumScore,SUM(SumPayVal)AS SumPayVal FROM (
								SELECT SUM(a.ScoreValue-a.PayForValue)AS SumValue,0 AS SumScore,0 AS SumPayVal
								FROM TR_Custom_Dubt_List a,TR_Custom_Inform b WHERE a.CustomListNo=b.ListNo AND b.Chain_No='%s' AND a.TradeTime<'%s'
								UNION SELECT 0 AS SumValue,SUM(a.ScoreValue)AS SumScore,SUM(a.PayForValue)AS SumPayVal FROM TR_Custom_Dubt_List a,TR_Custom_Inform b
								WHERE a.CustomListNo=b.ListNo AND b.Chain_No='%s'
								AND a.TradeTime>='%s' AND a.TradeTime<'%s 23:59:59')t",$chainno,$datday1,$chainno,$datday1,$datday2);

						$result = querySql($sql);
						if($row = fetch_array($result))
						{
							$fltTemp1=$row['SumValue'];
							$fltTemp2=$row['SumScore'];
							$fltTemp3=$row['SumPayVal'];
						}
						freeResult($result);
						
					?>


					<div data-role="none" class="STYLEM2">
						<table width="100%" height="30" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
							<tr bgcolor="#F6F2F2">
								<td height="30" width="6"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">F.应收账款</span>
								</td>
																
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo number_format(($fltTemp1 + $fltTemp2 - $fltTemp3),2);?></span>
								</td>
								<td height="30" width="6"></td>
							</tr>
														
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
						</table>
						
					</div>

					<div data-role="none" class="STYLEM2">
						<table width="100%" height="20" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
					
							<tr>
								<td height="30" width="19"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;">期初余额</span>
								</td>
								
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;"><?php echo number_format($fltTemp1,2);?></span>
								</td>
								
								<td height="30" width="6"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
							<tr>
								<td height="30" width="19"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;">本期发生</span>
								</td>
								
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;"><?php echo number_format($fltTemp2,2);?></span>
								</td>
								
								<td height="30" width="6"></td>
							</tr>
							
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
							<tr>
								<td height="30" width="19"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;">本期收回</span>
								</td>
								
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;"><?php echo number_format($fltTemp3,2);?></span>
								</td>
								
								<td height="30" width="6"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>

					
						</table>
						
						<table width="100%" height="10" border="0"  cellpadding="0" cellspacing="0">
							<tr><td height="10"></td></tr>
						</table>
					</div>



					<?php 
						//F.应收账款   G.会员余额
						$fltTemp1=0;
						$fltTemp2=0;
						$fltTemp3=0;
						
						$sql=sprintf("SELECT SUM(SumVal)AS SumValue,SUM(SumScore)AS SumScore,SUM(SumPay)AS SumPayVal FROM( 
								SELECT SUM(a.PayFor_Val+a.PayFree_Val-a.Score_Val)AS SumVal,0 AS SumScore,0 AS SumPay
								FROM VIP_Consume_List a,VIP_Main b WHERE a.VIP_No=b.VIP_No AND a.Chain_No='%s' AND a.Trade_Date<'%s'
								UNION SELECT 0 AS SumVal,SUM(a.Score_Val)AS SumScore,SUM(a.PayFor_Val+a.PayFree_Val)AS SumPay 
								FROM VIP_Consume_List a,VIP_Main b WHERE a.VIP_No=b.VIP_No AND a.Chain_No='%s'
								AND a.Trade_Date>='%s' AND a.Trade_Date<'%s 23:59:59')t",$chainno,$datday1,$chainno,$datday1,$datday2);
						
						$result = querySql($sql);
						if($row = fetch_array($result))
						{
							$fltTemp1=$row['SumValue'];
							$fltTemp2=$row['SumScore'];
							$fltTemp3=$row['SumPayVal'];
						}
						freeResult($result);
						
					?>
					
					<div data-role="none" class="STYLEM2">
						<table width="100%" height="30" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
							<tr bgcolor="#F6F2F2">
								<td height="30" width="6"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;">G.会员余额</span>
								</td>
																
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-shadow:none;"><?php echo number_format(($fltTemp1 - $fltTemp2 + $fltTemp3),2);?></span>
								</td>
								<td height="30" width="6"></td>
							</tr>
														
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
						</table>
						
					</div>

					<div data-role="none" class="STYLEM2">
						<table width="100%" height="20" cellpadding="0" cellspacing="0" style="border-left: 1px solid #F6F2F2;border-right: 1px solid #F6F2F2;">
					
							<tr>
								<td height="30" width="19"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;">期初余额</span>
								</td>
								
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;"><?php echo number_format($fltTemp1,2);?></span>
								</td>
								
								<td height="30" width="6"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
							<tr>
								<td height="30" width="19"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;">本期消费</span>
								</td>
								
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;"><?php echo number_format($fltTemp2,2);?></span>
								</td>
								
								<td height="30" width="6"></td>
							</tr>
							
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>
							
							<tr>
								<td height="30" width="19"></td>
								<td height="30"  align="left">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;">本期充值</span>
								</td>
								
								<td height="30" width="120" align="right">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;"><?php echo number_format($fltTemp3,2);?></span>
								</td>
								
								<td height="30" width="6"></td>
							</tr>
							
							<tr bgcolor="#F6F2F2"><td height="1" colspan="4" align="center"></tr>

					
						</table>
						
						<table width="100%" height="10" border="0"  cellpadding="0" cellspacing="0">
							<tr><td height="10"></td></tr>
						</table>
					</div>














					
				</td>
				<td height="1" width="6" ></td>
			</tr>
			
		</table>
		
		
	</article>
	
	
	
	<script type="text/javascript">
		//相应查询按钮的事件
		function OnSendFindClick()
		{
			var strday1 = $("#dtp1").val();
			var strday2 = $("#dtp2").val();
			if(strday1=="")
			{	
				$("#dtp1").focus();
				return;
			}
			if(strday2=="")
			{	
				$("#dtp2").focus();
				return;
			}
			parent.window.location.href='rephotelph.php?datday1=' + strday1 + '&datday2=' + strday2;
		};
		 	
	</script>
		
		
</section>

</body>
</html>
