You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

202 lines
6.8 KiB

<?php
include "fun_global.php";
if (isset($_REQUEST["function_name"])) {
$function_name = $_REQUEST["function_name"];
$function_flag = True;
}else{
$function_name = "";
$function_flag = False;
}
$_mem = unserialize($_COOKIE["_mem"]);
$user_str = $_mem["name"]."(".$_mem["id"].") ".$_mem["login"];
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<title>Masada後臺系統</title>
<link rel="stylesheet" href="/wms/css/styles.css" />
<link rel="stylesheet" href="/wms/css/bootstrap.min.css">
<style>
a svg {
display: inline-block;
vertical-align: text-top;
}
.nav .icon {
display: none;
}
@media screen and (max-width: 992px) {
.header-right{
float: left!important;
margin-top: -40px;
margin-left: -15px;
}
/*.nav.navbar-nav a:not(:last-child), .dropdown {*/
.nav.navbar-nav a, .dropdown {
display: none;
}
.nav.navbar-nav .icon {
color: #fff;
display: block;
position:fixed;
right:0;
top:0;
}
}
@media screen and (max-width: 992px) {
.nav.navbar-nav.responsive {position: relative;}
.nav.navbar-nav.responsive a.icon {
position: fixed;
right: 0;
top:0;
}
.nav.navbar-nav.responsive li {
float: none;
display: block;
text-align: left;
}
.nav.navbar-nav.responsive .dropdown {float: none;}
.nav.navbar-nav.responsive .dropdown li {
position: relative;
}
.nav.navbar-nav.responsive .dropdown a {
display: block;
width: 100%;
text-align: left;
top: -10px;
line-height: 10px;
}
.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{
color:#000;
}
.nav.navbar-nav.responsive .dropdown ul{
width: 200px;
background-color: #fff;
}
.navbar-nav .open .dropdown-menu{
position:absolute;
}
}
</style>
<script src="/wms/css/jquery.min.js"></script>
<script src="/wms/css/bootstrap.min.js"></script>
<script src="/wms/css/jquery.dataTables.min.js"></script>
<script src="/wms/css/dataTables.bootstrap4.min.js"></script>
<script src="/wms/css/function.js"></script>
<script>
$(document).ready(function() {
if ($('#table_index').length !== 0) $('#table_index').DataTable();
if(window.localStorage){
var tokendata=window.localStorage.getItem("token");
var menudata=window.localStorage.getItem("menu");
if(tokendata==null || menudata==null){
window.location.href="/wms/login.php";
}
}else{
var tokendata=$.cookie("token");
}
var url = "/wms/headerapi.php";
$.ajax({
method: 'post',
url: url,
data: {
token:tokendata
},
success: function (data) {
var res=eval('('+data+')');
if(res.code!='200'){
window.location.href='/wms/login.php?errno=3';
}
}
});
var mdata=JSON.parse(menudata);
var menuStr = '';
var checkAuth = 0;
var m = 1;
for(var i in mdata){
menuStr += '<li class="dropdown">';
menuStr += '<a class="dropdown-toggle" data-toggle="dropdown" href="#">'+i;
menuStr += '<span class="caret"></span></a>';
menuStr += '<ul class="dropdown-menu">';
for(var j in mdata[i]){
for(var k in mdata[i][j]){
menuStr += '<li';
if (k=='<?php echo $function_name; ?>') menuStr += " class='active'";
menuStr += '><a href="'+mdata[i][j][k]+'?function_name='+k+'"';
if (k == 'analysis' || k == 'map') menuStr += ' target="_blank"';
menuStr += '>'+j+'</a></li>';
if (mdata[i][j][k] == window.location.pathname) checkAuth = 1;
m++;
}
}
menuStr += '</ul>';
menuStr += '</li>';
}
menuStr += '<li><a href="javascript:void(0);" class="icon" onclick="myFunction()"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grid-3x3-gap-fill" viewBox="0 0 16 16"><path d="M1 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V2zM1 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V7zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V7zM1 12a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1v-2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-2zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2z"/></svg></a></li>';
/*
if (checkAuth == 0 && ('/wms/custom-create.php' != window.location.pathname)) {
window.location.href='login.php?errno=4';
}
*/
$('#menu_content').html(menuStr);
$('.dropdown a').on('click', function () {
$('.dropdown').removeClass('open');
});
});
function myFunction() {
var x = document.getElementById("menu_content");
if (x.className === "nav navbar-nav") {
x.className += " responsive";
} else {
x.className = "nav navbar-nav";
}
}
</script>
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="/wms/index.php">Masada</a>
</div>
<ul class="nav navbar-nav" id="menu_content">
</ul>
<!--
<div class="topnav" id="myTopnav">
<a href="#home" class="active">Home</a>
<a href="#news">News</a>
<a href="#contact">Contact</a>
<div class="dropdown">
<button class="dropbtn">Dropdown
<span class="caret"></span></a>
</button>
<div class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</div>
<a href="#about">About</a>
<a href="javascript:void(0);" style="font-size:15px;" class="icon" onclick="myFunction()">&#9776;</a>
</div>
-->
<div class="header-right">
<span class="navbar-brand"><h5><?php echo $user_str;?></h5></span>
<a href="/wms/logout.php" class="navbar-brand" style="font-size:14px;line-height:34px;"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z"/>
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"/>
</svg>
登出</a>
</div>
</nav>