<?php
	session_start();
	ini_set('session.gc_maxlifetime', 99999999); //设置时间 永不过期
		
	//判断是否登录系统
	if($_SESSION['main_wx_userlogined']!="1" | $_SESSION['main_wx_userno']=="")
	{
		//没有登录开始启动登录
		header('location:..\loginwx.php?rset=0');
		exit;
	}
	
	require_once("db/db.php");	
	require_once("common/common.php");
		
	$userno=trim($_SESSION['main_wx_userno']);
	
	$strSelChainName=trim($_SESSION['ChainNamefw']);
		
	header("Content-type: text/html; charset=gb2312"); 
?>
<!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>
	<link rel="stylesheet" href="css/mycss.css"> 
		
</head>

<!--选择分店的部分代码---------------------------->
<section data-role="page" id="pagechain">
	<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="42" width="50" align="right"><a href="index.php" data-role="button" data-icon="carat-l" data-iconpos="notext"></td>
				<td height="42" align="center">
					<span style="color:#000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:18px;text-shadow:none;"><?php echo $strSelChainName;?></span>
				</td>
				<td height="42" width="40" align="left"></td>
			</tr>
		</table>
	</header>
	<article data-role="content">
		<ul data-role="listview">    
		 <?php
		 
			$selchainno="";
			$selchainname="";
		 
			$userno=$_SESSION['usernofw'];
			$sql=sprintf("SELECT a.Chain_No,a.Chain_Name FROM dbo.TRF_AppGetChainFromUser('%s') a,Chain_Infor b WHERE a.Chain_No=b.Chain_No And b.Web_Enabled=1 and b.wxfwflag=1;",$userno);
			$result = querySql($sql);
										
			while($row = fetch_array($result))
			{
				$selchainno = $row['Chain_No'];  
				$selchainname = $row['Chain_Name'];
				
		?>
			<li>
				<a class="ui-btn ui-corner-all ui-shadow ui-btn-inline" href="index.php?mchid=<?php echo $selchainno;?>" target="_blank">
				<?php echo $selchainname;?><span class="ui-li-count">
				<?php echo $selchainno;?></span></a>
			</li> 
		<?php
			}
			//释放数据库
			freeResult($result);
			closeDb();
		 ?>
		  
		</ul> 
	</article>
	
</section>

</body>
	
</html>