<?php
	session_start();
			
	ini_set('session.gc_maxlifetime', 99999999); //设置时间 永不过期
	
	//微信号
	$strwxudid=$_REQUEST['wxudid'];
		
?>
<!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="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>
	<script src="jsp4/jquery.placeholder.min.js"></script>
		
</head>
	
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">
	
<section data-role="page" id="page1">
	<header data-role="header" data-position="fixed" data-tap-toggle="false" style="border-top-width:0px;border-bottom-width:0px;bkc">
        <table width="100%" height="45" border="0" cellpadding="0" cellspacing="0" >
		   	<tr bgcolor="#245fec">
				<td height="45" align="center" valign="middle">
	                <span id="MsgTxt" style="color:#fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:19px;text-shadow:none;">客户资料</span>
               	</td>
		  	</tr>
			
		</table>
	</header>
		
	<article data-role="none">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">		
			<tr><td height="6" colspan="3"></tr>
			
			<tr>
				<td width="5" height="30"></td>
				<td height="30">
					
						<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#D7C4C4" style="border-collapse:collapse;">
							<tr bgcolor="#99FFFF">
								<td height="38" width="70" align="center" valign="middle">
									<span style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">识别号</span>
								</td>
								<td height="38" align="left" valign="middle">
									<span style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;&nbsp;客户名称</span>
								</td>
								<td height="38" width="65" align="center" valign="middle">
									<span style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">客户链接</span>
								</td>
								<td height="38" width="70" align="center" valign="middle">
									<span style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">日期</span>
								</td>
							</tr>
							<?php 
								require_once("db/db.php");	
								require_once("common/common.php");
							
								$CustomName='';
								$CustomUrl='';
								$TradeTime='';
								
								$sql = sprintf("SELECT CustomID,HotelName,HotelURL,CONVERT(varchar(10), TradeTime, 23)AS TradeDay FROM WX_Hotel_List WHERE WXEnabled>0 Order By CustomID ASC");
								$result = querySql($sql);
			
								while($row = fetch_array($result))
								{
									$CustomName=$row['HotelName'];
									$CustomUrl=$row['HotelURL'];
									$TradeTime=$row['TradeDay'];
									
									$intRMID = $row['CustomID'];
							?>
							
							<tr>
								<td height="38" width="70" align="center" valign="middle">
									<span style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;text-shadow:none;"><?php echo $intRMID;?></span>
								</td>
								<td height="38" align="left" valign="middle">
									<span style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">&nbsp;&nbsp;<?php echo $CustomName;?></span>
								</td>
								<td height="38" width="65" align="center" valign="middle">
									<div onClick="bmtStartToWeb('<?php echo $intRMID;?>');" style="border-radius:6px;width:55px; height:24px; padding-top:2px; background-color:#1D96D5;">
										<span style="color:#fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;">进入页面</span>
									</div>
								</td>
								<td height="38" width="70" align="center" valign="middle">
									<span style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;text-shadow:none;"><?php echo $TradeTime;?></span>
								</td>
							</tr>
							
							<?php
								}
								freeResult($result);	//释放数据库
								closeDb();				//关闭数据库
							?>
							
						</table>		
					
				</td>
				<td width="5" height="<?php echo $intSubHeight;?>"></td>
			</tr>
			
			<tr><td height="10" colspan="3"></tr>
		
	</article>

	
	<script type="text/javascript">
	
		function bmtToAppWeb(strUrl)
		{	
			window.location=strUrl;
		};
		
		function bmtStartToWeb(strSoftID)
		{				
			if(strSoftID.length>3)
			{
				//1.获取客户档案ID号
				var strurl="cmpid/getcmpid.php?softid=" + strSoftID + "&wxudid=<?php echo $strwxudid;?>";
				var strret="";
				//用ajax的“同步方式”调用一般处理程序
				$.ajax({
					url: strurl ,
					async: false,//改为同步方式
					type: "POST",
					//data: {doid:1, rmid: "strRoomNo" },
					success: function (RetData) 
					{
						strret = RetData;
					}
				});

				//alert(strret);
				//return;
				if(strret.substr(0,1)=='0')
				{
					alert("客户识别号不正确!");
					return;
				}
				
				//alert(strret);
				
				if(strret.length >0)
				{
					if(strret.length<80)
					{
						//自动记录上次的客户识别号
						var strRet=strret.substr(0,1);
						if(strRet=='1')
						{
							var strCmpUrl=strret.substr(1);
							if(strCmpUrl.length>10)
							{
								window.location=strCmpUrl + "?wxudid=<?php echo $strwxudid;?>";
							}
						}
					}
				}
			}
			else
			{
				alert("请正确输入客户识别号！");
			}
		};
		
	</script>
	
</section>

</body>

</html>
