forked from pplulee/appleid_auto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
54 lines (53 loc) · 2.29 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
include("include/common.php");
if (!isset($_SESSION['isLogin'])) {
$_SESSION['isLogin'] = false;
}
if ((!$_SESSION['isLogin']) and (!in_array(php_self(), array("index.php", "login.php", "register.php")))) {
echo "<script>window.location.href='index.php#login';</script>"; // Redirect to login page
exit;
}
?>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="userindex.php">AppleID 自动化管理</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<?php
if ($_SESSION['isLogin']) {
echo "<li class='nav-item'>
<a class='nav-link' href='userindex.php'>用户中心</a>
</li>
<li class='nav-item'>
<a class='nav-link' href='account.php'>账号管理</a>
</li>
<li class='nav-item'>
<a class='nav-link' href='share_list.php'>分享页管理</a>
</li>
<li class='nav-item'>
<a class='nav-link' href='user_info.php'>个人信息</a>
</li>";
} else {
echo "<li class='nav-item'>
<a class='nav-link' href='index.php'>网站首页</a>
</li>";
} ?>
<?php if ((isset($_SESSION['user_id'])) and (isadmin($_SESSION['user_id']))) {
echo "
<li class='nav-item'>
<a class='nav-link' href='/admin'>管理面板</a>
</li>";
} ?>
</ul>
<?php if ($_SESSION['isLogin']) {
echo '<a href="userindex.php?logout" class="btn btn-danger">登出</a>';
} else {
echo '<a href="index.php#login" class="btn btn-success">登录</a>';
} ?>
</div>
</div>
</nav>