<?php 
$showMenu= "";
include_once 'init-lite.php';
$adminpw=getSQLresult("SELECT kevalue FROM configWeb where keyname='AdminPW'");
if (strlen($adminpw)==0) $adminpw='3333';
if (isset($_POST['showMenu'])) $showMenu=$_POST['showMenu'];
try
{
	if (isset($_REQUEST['logoff']) && $_REQUEST['logoff']==1 ){
		 
		// 把失效日期设置为一小时前
		@setcookie ("useraut2079", "", time() - 3600);
 		 die ("
	<form name='form1' method='post' action=''>
	  <label>clave
	  <input name='useraut2079' type='password' id='useraut2079' value=''>
	  </label>
	  <label>
	  <input type='submit' name='Submit' value='Login'>
	  </label>
	</form>");

	//GUID没设置就die
	}elseif (isset($_COOKIE["useraut2079"])){
		$user=$_COOKIE['useraut2079'];		
		//echo 'isset _COOKIE useraut2079 ：'.$user;
	}elseif (isset($_REQUEST['useraut2079'])){
		$user=$_REQUEST['useraut2079'];
		//echo 'isset _REQUEST useraut2079 '.$user;
	}elseif (isset($_REQUEST['user1'])){
		$user=$_REQUEST['user1'];
		//echo 'isset _REQUEST user1 '.$user;
	}
	if ($user==$adminpw){
		@setcookie("useraut2079", $user, time()+3600);
	
	}else{

			 die ("
		<form name='form1' method='post' action=''>
		  <label>clave
		  <input name='useraut2079' type='password' id='useraut2079' value=''>
		  </label>
		  <label>
		  <input type='submit' name='Submit' value='Login'>
		  </label>
		</form>");
	}

}catch(Exception $e) {
//echo 'Message: ' .$e->getMessage();
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="apple-mobile-web-app-capable" content="yes">
 <meta name="apple-mobile-web-app-status-bar-style" content="black">
 <meta name="format-detection" content="telephone=no">
 <meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1.0, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-title" content="京都在线">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- meta使用viewport以确保页面可自由缩放 -->
 
<!-- 引入 jQuery Mobile 样式 -->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">

<!-- 引入 jQuery 库 -->
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>

<!-- 引入 jQuery Mobile 库 -->
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script>
$(document).on("pagecreate","#pageone",function(){
});
</script>
<script type="text/javascript">
function reloaddoc(var1){
	$("#showMenu").val(var1);
	document.getElementById('formMenuIndex').submit();
}

</script>
<title>管理</title>
</head>
<body>
<div data-role="page" id="pageone">
 <form id="formMenuIndex" method="post" action=""><input type="hidden" id="showMenu" name="showMenu" value="index"/></form>

 <div data-role="panel" id="myPanelMenu" data-display="overlay"  data-swipe-close="false" > 
    <h2>选择菜单</h2>
<a href="tel:916423330" class="ui-btn ui-corner-all ui-shadow ">技术支持 916423330</a>
  	 <a href="#" onclick="reloaddoc('config')" data-inline="true" class="ui-btn ui-corner-all ui-shadow">设置项目</a> 
  	 <a href="#" onclick="reloaddoc('menu2')" data-inline="true" class="ui-btn ui-corner-all ui-shadow">编辑菜单</a> 
  	 <a href="#" onclick="reloaddoc('menu')" data-inline="true" class="ui-btn ui-corner-all ui-shadow">菜单(小界面)</a> 
  	 <a href="#" onclick="reloaddoc('Categories')" data-inline="true" class="ui-btn ui-corner-all ui-shadow">编辑类别</a> 
  	 <a href="#" onclick="reloaddoc('dayreport')" data-inline="true" class="ui-btn ui-corner-all ui-shadow">日报表</a> 
 	 <a href="#" onclick="reloaddoc('mounthreport')" data-inline="true" class="ui-btn ui-corner-all ui-shadow">月报表</a> 
 	 <a href="#" onclick="reloaddoc('photo')" data-inline="true" class="ui-btn ui-corner-all ui-shadow">图片</a> 
 	 <a href="./"  data-inline="true" class="ui-btn ui-corner-all ui-shadow">返回主界面</a> 

  <a href="#pageone" data-rel="close" class="ui-btn ui-corner-all ui-shadow ">关闭</a>
   </div>
 
   <div data-role="header" data-position="fixed" data-tap-toggle="false">
    <a href="#myPanelMenu"  class="ui-btn ui-corner-all ui-shadow ui-icon-bars ui-btn-icon-left ">菜单</a> 
    <h1>管理</h1>
 <a href="#" onclick="reloaddoc('<?php echo $showMenu;?>')"  class="ui-btn ui-corner-all ui-shadow ui-icon-refresh ui-btn-icon-left">刷新</a>
  </div>

    <div data-role="main" class="ui-content">
<!--    <script type="text/javascript">
if (navigator.userAgent.match(/(iPad)/gi))
    
</script>-->
<a href="#" onclick="reloaddoc('<?php echo $showMenu;?>')"  class="ui-btn ui-corner-all ui-shadow ui-icon-refresh ui-btn-icon-left" data-inline="true" >刷新</a>
<?php 
if ($showMenu=='menu')
	include_once  'admin-menu.php';
if ($showMenu=='menu2')
	include_once  'admin-menu2.php';
else if ($showMenu=='Categories') 
	include_once  'admin-Categories.php';
else if ($showMenu=='dayreport') 
	include_once  'admin-dayreport.php';
else if ($showMenu=='daydet') 
	include_once  'admin-daydet.php';
else if ($showMenu=='orders') 
	include_once  'admin-orders.php';
else if ($showMenu=='mounthreport') 
	include_once  'admin-mounthreport.php';
else if ($showMenu=='photo') 
	include_once  'admin-photo.php';
else
	include_once  'admin-config.php';
?>
      </div>
</div>