<?php
	session_start();
			
	ini_set('session.gc_maxlifetime', 99999999); //设置时间 永不过期
		
	//微信号
	$strwxudid=$_REQUEST['wxudid'];
	if(strlen($strwxudid)>10)
	{
		$_SESSION["main_wx_userwxudid"]=$strwxudid;
	}
	
	if($_SESSION['main_wx_userlogined']!="1" |$_SESSION['main_wx_userno']=="")
	{
		//没有登录开始启动登录
		header('location:loginwx.php?rset=0');
		exit;
	}
		
	require_once("Wx.Config.php");
	
	$strHotelName=trim(WxMainConfig::strHeadTextHotelName);
	$strHotelName=iconv('utf-8','gb2312',$strHotelName);
	if(strlen($strHotelName)<2)
	{
		$strHotelName='云点通登录';
	}
	
	//1.判断当前登陆的用户是否有权限使用模块
	require_once("db/db.php");	
	require_once("common/common.php");
	
	$userno=trim($_SESSION['main_wx_userno']);
	//men_bar498 集团查询;men_bar410 清扫完成;men_bar413 房吧入账;men_bar1165 部门营业报表
	$intRoomFindFlag=0;
	$intRoomClearFlag=0;
	$intRoomBarFlag=0;
	$intDepartFindFlag=0;
	
	$intRowTemp=0;
	$intRowValue=0;
	
	$sql=sprintf("SELECT RoomFlag,Use_Flag FROM(
			Select 1 AS RoomFlag,a.Use_Flag,b.Use_Name From Sys_Group_Quanxian a,User_QuanXian b Where a.Group_No=b.Group_No And b.Use_No='%s' And a.Modul_Name='men_bar498'
			UNION Select 2 AS RoomFlag,a.Use_Flag,b.Use_Name From Sys_Group_Quanxian a,User_QuanXian b Where a.Group_No=b.Group_No And b.Use_No='%s' And a.Modul_Name='men_bar410'
			UNION Select 3 AS RoomFlag,a.Use_Flag,b.Use_Name From Sys_Group_Quanxian a,User_QuanXian b Where a.Group_No=b.Group_No And b.Use_No='%s' And a.Modul_Name='men_bar413'
			UNION Select 4 AS RoomFlag,a.Use_Flag,b.Use_Name From Sys_Group_Quanxian a,User_QuanXian b Where a.Group_No=b.Group_No And b.Use_No='%s' And a.Modul_Name='men_bar1165'
			) t Order By t.RoomFlag ASC",$userno,$userno,$userno,$userno);

	$result = querySql($sql);
	while($row = fetch_array($result))
	{
		$intRowTemp = $row['RoomFlag'];
		$intRowValue = $row['Use_Flag'];
		
		switch ($intRowTemp)
		{
			case 1:
				$intRoomFindFlag=$intRowValue;
				break;
			case 2:
				$intRoomClearFlag=$intRowValue;
				break;
			case 3:
				$intRoomBarFlag=$intRowValue;
				break;
			case 4:
				$intDepartFindFlag=$intRowValue;
				break;
		}
	}
		
	freeResult($result);
	closeDb();
	
?>
<!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="ydth6/jsp4/jquery.mobile-1.4.3.min.css">
	<script src="ydth6/jsp4/jquery.js"></script>
	<script src="ydth6/jsp4/jquery.mobile-1.4.3.min.js"></script>
	<script src="ydth6/jsp4/jquery.placeholder.min.js"></script>

	<script language="JavaScript"> 
		//不允许进行后退
		javascript:window.history.forward(1); 
	</script>
	
	<script>
		//禁止页面上下滑动,整个页面都不能滑动了
		document.addEventListener('touchmove', function(e) {
			e.preventDefault();
		});
	</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="55" border="0" cellpadding="0" cellspacing="0" >
		   	<tr bgcolor="#245fec">
				<td height="55" width="45" align="center" valign="middle"></td>
				<td height="55" align="center" valign="middle">
					<span style="color:#fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:19px;text-shadow:none;"><?php echo $strHotelName;?></span>
				</td>
				<td height="55" width="45" align="center" valign="middle">
					<div onClick="btmSetToLogin();" style="border-radius:8px;width:55px; height:36px; ">
						<img src="images\relogin.png" width="32" height="32" border="0" style="margin-top:2px;">
					</div>
				</td>
		  	</tr>
			
			<tr bgcolor="#245fec">
				<td colspan="3" height="20">
					<div style="background:#F9F9F9;width:100%;height:20px;padding-top:0px;margin-top:0px; border-radius: 18px 18px 0px 0px;">
						
					</div>
				</td>
		  	</tr>
		</table>
	</header>
		
	<article data-role="none">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" >		
			<tr><td height="20" colspan="3"></tr>
			
			<tr>
				<td height="50" width="10"></td>
				<td height="50" align="left" valign="top">
					<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td height="50" width="50"></td>
							<td height="50" >
								<?php if($intRoomFindFlag>0) {?>
								<div id="sub1x" style="width:87px;height:87px;border:0px;border-radius:44px; background-color:#E1E1E1;padding-top:3px;padding-left:3px;">
									<div id="sub1" onclick="SubClick(1)" style="width:84px;height:84px;border:0px;border-radius:42px; background-color:#1F74AD;">
										<table height="10" border="0" cellspacing="0" cellpadding="0" style="padding-top:24px;padding-left:10px;">
											<tr>
												<td align="center"><span style="color: #fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">客房查询</span></td>
										   </tr>
										   <tr>
												<td align="center"><span style="color: #fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;">云点通</span></td>
										   </tr>
										</table>
									</div>
								</div>
								<?php } else {?>
								<div id="sub1b" style="width:84px;height:84px;border:0px;border-radius:42px; background-color:#EEE5E6;">
									<table height="10" border="0" cellspacing="0" cellpadding="0" style="padding-top:24px;padding-left:10px;">
										<tr>
											<td align="center"><span style="color: #fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">客房查询</span></td>
									   </tr>
									   <tr>
											<td align="center"><span style="color: #fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;">云点通</span></td>
									   </tr>
									</table>
								</div>
								<?php } ?>
								
								<div style="width:100px;height:2px;border:0px;margin-top:-5px;padding-left:90px;">
									<div id="point1" style="width:15px;height:15px;border:0px;border-radius:10px; background-color:#EFEFEF;"></div>
								</div>
								<div style="width:100px;height:2px;border:0px;margin-top:20px;padding-left:115px;">
									<div id="point1" style="width:10px;height:10px;border:0px;border-radius:8px; background-color:#EFEFEF;"></div>
								</div>
								<div style="width:100px;height:2px;border:0px;margin-top:18px;padding-left:136px;">
									<div id="point1" style="width:6px;height:6px;border:0px;border-radius:5px; background-color:#EFEFEF;"></div>
								</div>
							</td>
							<td height="50" width="8"></td>
						</tr>
					</table>
				
				</td>
				<td height="50" width="30"></td>
			</tr>
			
			<tr><td height="1" colspan="3"></tr>
			
			<tr>
				<td height="50" width="10"></td>
				<td height="50" align="left" valign="top">
					<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td height="50" width="190"></td>
							<td height="50" >
								<?php if($intRoomClearFlag>0) {?>
								<div id="sub1x" style="width:87px;height:87px;border:0px;border-radius:44px; background-color:#E1E1E1;padding-top:3px;padding-left:3px;">
									<div id="sub2" onclick="SubClick(2)" style="width:84px;height:84px;border:0px;border-radius:42px; background-color:#3498DB;">
										<table height="10" border="0" cellspacing="0" cellpadding="0" style="padding-top:24px;padding-left:10px;">
											<tr>
												<td align="center"><span style="color: #fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">房务中心</span></td>
										   </tr>
										   <tr>
												<td align="center"><span style="color: #fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;">客房宝</span></td>
										   </tr>
										</table>
									</div>
								</div>
								<?php } else {?>
								<div id="sub2b" style="width:84px;height:84px;border:0px;border-radius:42px; background-color:#EEE5E6;">
									<table height="10" border="0" cellspacing="0" cellpadding="0" style="padding-top:24px;padding-left:10px;">
										<tr>
											<td align="center"><span style="color: #fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">房务中心</span></td>
									   </tr>
									   <tr>
											<td align="center"><span style="color: #fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;">客房宝</span></td>
									   </tr>
									</table>
								</div>
								<?php } ?>
								
							</td>
							<td height="50" width="8"></td>
						</tr>
					</table>
				
				</td>
				<td height="50" width="30"></td>
			</tr>
			
			<tr><td height="20" colspan="3"></tr>
			
			<tr>
				<td height="50" width="10"></td>
				<td height="50" align="left" valign="top">
					<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td height="20" colspan="3">
								<div style="width:100px;height:2px;border:0px;margin-top:-10px;padding-left:200px;">
									<div id="point1" style="width:15px;height:15px;border:0px;border-radius:10px; background-color:#EFEFEF;"></div>
								</div>
								<div style="width:100px;height:2px;border:0px;margin-top:24px;padding-left:190px;">
									<div id="point1" style="width:10px;height:10px;border:0px;border-radius:8px; background-color:#EFEFEF;"></div>
								</div>
								<div style="width:100px;height:10px;border:0px;margin-top:20px;padding-left:182px;">
									<div id="point1" style="width:6px;height:6px;border:0px;border-radius:5px; background-color:#EFEFEF;"></div>
								</div>
							</td>
						</tr>
						<tr>
							<td height="50" width="110"></td>
							<td height="50" >
								<?php if($intDepartFindFlag>0) {?>
								<div id="sub1x" style="width:87px;height:87px;border:0px;border-radius:43px; background-color:#E1E1E1;padding-top:3px;padding-left:3px;">
									<div id="sub3" onclick="SubClick(3)" style="width:84px;height:84px;border:0px;border-radius:42px; background-color:#69A35B;">
										<table height="10" border="0" cellspacing="0" cellpadding="0" style="padding-top:24px;padding-left:10px;">
											<tr>
												<td align="center"><span style="color: #fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">部门营业</span></td>
										   </tr>
										   <tr>
												<td align="center"><span style="color: #fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;">云点通</span></td>
										   </tr>
										</table>
									</div>
								</div>
								<?php } else {?>						
								<div id="sub3b" style="width:84px;height:84px;border:0px;border-radius:42px; background-color:#EEE5E6;">
									<table height="10" border="0" cellspacing="0" cellpadding="0" style="padding-top:24px;padding-left:10px;">
										<tr>
											<td align="center"><span style="color: #fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">部门营业</span></td>
									   </tr>
									   <tr>
											<td align="center"><span style="color: #fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:10px;text-shadow:none;">云点通</span></td>
									   </tr>
									</table>
								</div>
								<?php } ?>		
							</td>
							<td height="50" width="8"></td>
						</tr>
					</table>
				
				</td>
				<td height="50" width="30"></td>
			</tr>
			
			<tr><td height="100" colspan="3"></tr>
		
	</article>

	
	<script type="text/javascript">
		
		function SubClick(subid)
		{		
			//alert('TEST');
					
			var strurl;
			strurl="";
			
			if(subid==1)
			{
				strurl="ydth6/index.php?flpid=1";
			}
			else if(subid==2)
			{
				strurl="wxroom/index.php?flpid=1";
			}
			else if(subid==3)
			{
				strurl="ydtpos/index.php?flpid=1";
			}
			
			if(strurl.length>0)
			{
			 	//alert(strurl);
				window.location.href=strurl;
			}
		}
				
		function btmSetToLogin()
		{	
			parent.window.location.href="loginwx.php?rset=11";
		}
	</script>
	
</section>

</body>

</html>
