header.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <?php
  2. include_once("../untils/conn.php");
  3. $type = "web_config";
  4. $menu_name = '运营平台'; // 设置默认菜单名
  5. $sql = "SELECT * FROM foundation WHERE type='$type'";
  6. $data = mysqli_query($con, $sql);
  7. $result = mysqli_fetch_assoc($data);
  8. $site_name = $result['site_name'];
  9. $site_seo = $result['site_seo'];
  10. $site_key = $result['site_key'];
  11. $site_ms = $result['site_ms'];
  12. $light_logo = $result['light_logo'];
  13. ?>
  14. <!DOCTYPE html>
  15. <html lang="zh">
  16. <head>
  17. <meta charset="utf-8">
  18. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  19. <title><?php echo $menu_name . ' - ' . $site_name . '-' . $site_seo ?></title>
  20. <link rel="icon" href="../favicon.ico" type="image/ico">
  21. <meta name="keywords" content="<?php echo $site_key ?>">
  22. <meta name="description" content="<?php echo $site_ms ?>">
  23. <meta name="author" content="GZKING">
  24. <link href="css/bootstrap.min.css" rel="stylesheet">
  25. <link href="css/materialdesignicons.min.css" rel="stylesheet">
  26. <link href="css/style.min.css" rel="stylesheet">
  27. </head>
  28. <body>
  29. <div class="lyear-layout-web">
  30. <div class="lyear-layout-container">
  31. <!--左侧导航-->
  32. <?php require_once('aside.php'); ?>
  33. <!--End 左侧导航-->
  34. <!--头部信息-->
  35. <header class="lyear-layout-header">
  36. <nav class="navbar navbar-default">
  37. <div class="topbar">
  38. <div class="topbar-left">
  39. <div class="lyear-aside-toggler">
  40. <span class="lyear-toggler-bar"></span>
  41. <span class="lyear-toggler-bar"></span>
  42. <span class="lyear-toggler-bar"></span>
  43. </div>
  44. </div>
  45. <ul class="topbar-right">
  46. <li class="dropdown dropdown-profile">
  47. <a href="javascript:void(0)" data-toggle="dropdown">
  48. <img class="img-avatar img-avatar-48 m-r-10" src="images/users/avatar.jpg" alt="管理员" />
  49. <span>管理员 <span class="caret"></span></span>
  50. </a>
  51. <ul class="dropdown-menu dropdown-menu-right">
  52. <li> <a href="user.php"><i class="mdi mdi-account"></i> 个人信息</a> </li>
  53. <li> <a onclick="replaceDoc()"><i class=" mdi mdi-delete"></i> 清空缓存</a></li>
  54. <li class="divider"></li>
  55. <li> <a href="loginout.php"><i class="mdi mdi-logout-variant"></i> 退出登录</a> </li>
  56. </ul>
  57. </li>
  58. <!--切换主题配色-->
  59. <li class="dropdown dropdown-skin">
  60. <span data-toggle="dropdown" class="icon-palette"><i class="mdi mdi-palette"></i></span>
  61. <ul class="dropdown-menu dropdown-menu-right" data-stopPropagation="true">
  62. <li class="drop-title">
  63. <p>主题</p>
  64. </li>
  65. <li class="drop-skin-li clearfix">
  66. <span class="inverse">
  67. <input type="radio" name="site_theme" value="default" id="site_theme_1" checked>
  68. <label for="site_theme_1"></label>
  69. </span>
  70. <span>
  71. <input type="radio" name="site_theme" value="dark" id="site_theme_2">
  72. <label for="site_theme_2"></label>
  73. </span>
  74. <span>
  75. <input type="radio" name="site_theme" value="translucent" id="site_theme_3">
  76. <label for="site_theme_3"></label>
  77. </span>
  78. </li>
  79. <li class="drop-title">
  80. <p>LOGO</p>
  81. </li>
  82. <li class="drop-skin-li clearfix">
  83. <span class="inverse">
  84. <input type="radio" name="logo_bg" value="default" id="logo_bg_1" checked>
  85. <label for="logo_bg_1"></label>
  86. </span>
  87. <span>
  88. <input type="radio" name="logo_bg" value="color_2" id="logo_bg_2">
  89. <label for="logo_bg_2"></label>
  90. </span>
  91. <span>
  92. <input type="radio" name="logo_bg" value="color_3" id="logo_bg_3">
  93. <label for="logo_bg_3"></label>
  94. </span>
  95. <span>
  96. <input type="radio" name="logo_bg" value="color_4" id="logo_bg_4">
  97. <label for="logo_bg_4"></label>
  98. </span>
  99. <span>
  100. <input type="radio" name="logo_bg" value="color_5" id="logo_bg_5">
  101. <label for="logo_bg_5"></label>
  102. </span>
  103. <span>
  104. <input type="radio" name="logo_bg" value="color_6" id="logo_bg_6">
  105. <label for="logo_bg_6"></label>
  106. </span>
  107. <span>
  108. <input type="radio" name="logo_bg" value="color_7" id="logo_bg_7">
  109. <label for="logo_bg_7"></label>
  110. </span>
  111. <span>
  112. <input type="radio" name="logo_bg" value="color_8" id="logo_bg_8">
  113. <label for="logo_bg_8"></label>
  114. </span>
  115. </li>
  116. <li class="drop-title">
  117. <p>头部</p>
  118. </li>
  119. <li class="drop-skin-li clearfix">
  120. <span class="inverse">
  121. <input type="radio" name="header_bg" value="default" id="header_bg_1" checked>
  122. <label for="header_bg_1"></label>
  123. </span>
  124. <span>
  125. <input type="radio" name="header_bg" value="color_2" id="header_bg_2">
  126. <label for="header_bg_2"></label>
  127. </span>
  128. <span>
  129. <input type="radio" name="header_bg" value="color_3" id="header_bg_3">
  130. <label for="header_bg_3"></label>
  131. </span>
  132. <span>
  133. <input type="radio" name="header_bg" value="color_4" id="header_bg_4">
  134. <label for="header_bg_4"></label>
  135. </span>
  136. <span>
  137. <input type="radio" name="header_bg" value="color_5" id="header_bg_5">
  138. <label for="header_bg_5"></label>
  139. </span>
  140. <span>
  141. <input type="radio" name="header_bg" value="color_6" id="header_bg_6">
  142. <label for="header_bg_6"></label>
  143. </span>
  144. <span>
  145. <input type="radio" name="header_bg" value="color_7" id="header_bg_7">
  146. <label for="header_bg_7"></label>
  147. </span>
  148. <span>
  149. <input type="radio" name="header_bg" value="color_8" id="header_bg_8">
  150. <label for="header_bg_8"></label>
  151. </span>
  152. </li>
  153. <li class="drop-title">
  154. <p>侧边栏</p>
  155. </li>
  156. <li class="drop-skin-li clearfix">
  157. <span class="inverse">
  158. <input type="radio" name="sidebar_bg" value="default" id="sidebar_bg_1" checked>
  159. <label for="sidebar_bg_1"></label>
  160. </span>
  161. <span>
  162. <input type="radio" name="sidebar_bg" value="color_2" id="sidebar_bg_2">
  163. <label for="sidebar_bg_2"></label>
  164. </span>
  165. <span>
  166. <input type="radio" name="sidebar_bg" value="color_3" id="sidebar_bg_3">
  167. <label for="sidebar_bg_3"></label>
  168. </span>
  169. <span>
  170. <input type="radio" name="sidebar_bg" value="color_4" id="sidebar_bg_4">
  171. <label for="sidebar_bg_4"></label>
  172. </span>
  173. <span>
  174. <input type="radio" name="sidebar_bg" value="color_5" id="sidebar_bg_5">
  175. <label for="sidebar_bg_5"></label>
  176. </span>
  177. <span>
  178. <input type="radio" name="sidebar_bg" value="color_6" id="sidebar_bg_6">
  179. <label for="sidebar_bg_6"></label>
  180. </span>
  181. <span>
  182. <input type="radio" name="sidebar_bg" value="color_7" id="sidebar_bg_7">
  183. <label for="sidebar_bg_7"></label>
  184. </span>
  185. <span>
  186. <input type="radio" name="sidebar_bg" value="color_8" id="sidebar_bg_8">
  187. <label for="sidebar_bg_8"></label>
  188. </span>
  189. </li>
  190. </ul>
  191. </li>
  192. <!--切换主题配色-->
  193. </ul>
  194. </div>
  195. </nav>
  196. <!-- 在<head>标签中引入jQuery库 -->
  197. <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  198. <!-- 在<body>标签中放置你的HTML代码 -->
  199. <script>
  200. // 检查是否存储了主题设置
  201. var storedTheme = localStorage.getItem('site_theme');
  202. if (storedTheme) {
  203. // 如果有存储的主题,将其应用到页面
  204. $('body').attr('data-theme', storedTheme);
  205. }
  206. // 监听主题切换事件
  207. $('input[name="site_theme"]').change(function() {
  208. var selectedTheme = $(this).val();
  209. // 移除现有的主题类
  210. $('body').removeAttr('data-theme');
  211. // 存储选中的主题
  212. localStorage.setItem('site_theme', selectedTheme);
  213. // 将选中的主题应用到页面
  214. $('body').attr('data-theme', selectedTheme);
  215. });
  216. // 检查是否存储了上次切换主题的时间
  217. var lastThemeChangeTime = localStorage.getItem('theme_change_time');
  218. if (lastThemeChangeTime) {
  219. var currentTime = new Date().getTime();
  220. var twelveHours = 12 * 60 * 60 * 1000; // 12小时的毫秒数
  221. // 检查上次切换主题的时间是否超过12小时
  222. if (currentTime - lastThemeChangeTime > twelveHours) {
  223. // 清除存储的主题设置
  224. localStorage.removeItem('site_theme');
  225. localStorage.removeItem('theme_change_time');
  226. // 重置为默认主题
  227. $('input[name="site_theme"][value="default"]').prop('checked', true).trigger('change');
  228. }
  229. }
  230. // 存储当前切换主题的时间
  231. localStorage.setItem('theme_change_time', new Date().getTime());
  232. </script>
  233. </header>
  234. <!--End 头部信息-->