CVE-2023-3852: Unrestricted Upload of File with Dangerous Type (CWE-434)
value: A vulnerability was found in OpenRapid RapidCMS up to 1.3.1. It has been declared as critical. This vulnerability affects unknown code of the file /admin/upload.php. The manipulation of the argument file leads to unrestricted upload. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used. The name of the patch is 4dff387283060961c362d50105ff8da8ea40bcbe. It is recommended to apply a patch to fix this issue. The identifier of this vulnerability is VDB-235204.
CWE description: The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.
CVSS v3 base score: 7.2
Published: 2023-07-23T22:15Z
Repository: https://github.com/OpenRapid/rapidcms
Language: PHP
Files changed: admin/admin_user/login.php, admin/admin_user/loginout.php, admin/admin_user/movepass.php, admin/admin_user/run-movepass.php, admin/admin_user/runlogin.php, admin/article/article-add-run.php, admin/article/article-add.php, admin/article/article-chat-delete.php, admin/article/article-chat.php, admin/article/article-del.php, admin/article/article-edit-run.php, admin/article/article-edit.php, admin/article/article.php, admin/article/run-tool.php, admin/article/tool.php, admin/article/upload.php, admin/category/cate-add-run.php, admin/category/cate-add.php, admin/category/cate-del.php, admin/category/cate-edit-run.php, admin/category/cate-edit.php, admin/category/category.php, admin/check.php, admin/config/mail.php, admin/config/rewrite.php, admin/config/run-close.php, admin/config/run-mail.php, admin/config/run-rewrite.php, admin/config/run-setting.php, admin/config/server.php, admin/config/setting.php, admin/config/uploadicon.php, admin/drawer.php, admin/function/download-plugin.php, admin/function/download-template.php, admin/function/plugin-del.php, admin/function/plugin-move.php, admin/function/plugin.php, admin/function/plus-back-run.php, admin/function/plus-back-upload-sql.php, admin/function/plus-back-upload.php, admin/function/plus-shark-run.php, admin/function/plus-shark.php, admin/function/plus.php, admin/function/temp-run.php, admin/function/temp.php, admin/header.php, admin/index.php, admin/system/about.php, admin/system/update-run.php, admin/system/update.php, admin/user/user-del.php, admin/user/user-move-run.php, admin/user/user-move.php, admin/user/user.php, install/install-config/install.json, resource/config/index.json, resource/config/tool.json, template/default/article.php, template/default/category.php, template/default/menu.php
Commit date: 2023-07-11 22:59:19 +0800
Commit message: 1.3.1.2

Diff: diff --git a/admin/about.php b/admin/about.php
deleted file mode 100644
index 434a130..0000000
--- a/admin/about.php
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-    <style>
-    * {
-        font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-    }
-</style>
-<div class="medium" style=" text-align:center;display: flex;gap: 47px;">
-    <img style="Border-radius:10px" width="200px" src="../../../upload/logo.png">
-    <div>
-        <div style="color:black;font-size: 20px;" class="mdui-typo">
-            <h1 style="font-weight: bold;">RapidCMS</h1>
-        </div>
-        <div style="color:black;font-size: 10px;" class="mdui-typo">
-            <h1>简单好用的官网CMS系统</h1>
-        </div>
-    </div>
-</div>
-
-<script src="../../../../../../resource/js/mtu.min.js"></script>
-<script src="../../../../../../resource/js/mdui.min.js"></script>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/admin/login.php b/admin/admin_user/login.php
similarity index 57%
rename from admin/login.php
rename to admin/admin_user/login.php
index 3756777..238eaf9 100644
--- a/admin/login.php
+++ b/admin/admin_user/login.php
@@ -1,31 +1,6 @@
 <?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-  
-}else{
-    Header("Location: index.php");
-}
 
 ?>
 
 <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
 <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
diff --git a/admin/admin_user/loginout.php b/admin/admin_user/loginout.php
new file mode 100644
index 0000000..b6ed222
--- /dev/null
+++ b/admin/admin_user/loginout.php
@@ -0,0 +1,11 @@
+<?php
+//Cookie消掉
+setcookie("admin", "", time()-3600,'/');
+
+//获取返回位置
+
+      $goto="login.php";
+
+//直接返回
+echo"<script type="."\""."text/javascript"."\"".">"."window.location="."\"".$goto."\""."</script>";
+?>
\ No newline at end of file
diff --git a/admin/admin_user/movepass.php b/admin/admin_user/movepass.php
new file mode 100644
index 0000000..e4dc149
--- /dev/null
+++ b/admin/admin_user/movepass.php
@@ -0,0 +1,41 @@
+<?php
+include("../header.php");
+
+?>
+    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
+
+        <div class="mdui-card">
+
+            <div class="mdui-card-primary">
+                <div class="mdui-card-primary-title" style="font-size:30px">修改管理员密码</div>
+            </div>
+            <form method="post" action="run-movepass.php">
+                <m-scrollbar style="height: 300px;width:900px">
+                    <div class="mdui-card-content" style="font-size:15px;text-align:left">
+                        <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
+                            <label class="mdui-textfield-label">输入密码</label>
+                            <input class="mdui-textfield-input" name="password" type="password"
+                              required="">
+                              <div class="mdui-textfield-error">密码不能为空</div>
+                        </div>
+                        <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
+                            <label class="mdui-textfield-label">重复密码</label>
+                            <input class="mdui-textfield-input" name="password2" type="password"
+                               required="">
+                               <div class="mdui-textfield-error">重复密码不能为空</div>
+                        </div>
+                      
+                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">提交</button>
+
+                    </div>
+                </m-scrollbar>
+            </form>
+        </div>
+       
+    </div>
+
+    <script src="../../../../../../resource/js/mtu.min.js"></script>
+    <script src="../../../../../../resource/js/mdui.min.js"></script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/admin/run-movepass.php b/admin/admin_user/run-movepass.php
similarity index 86%
rename from admin/run-movepass.php
rename to admin/admin_user/run-movepass.php
index 05ec34c..3c20a9a 100644
--- a/admin/run-movepass.php
+++ b/admin/admin_user/run-movepass.php
@@ -1,11 +1,11 @@
 
 <?php
-include("../resource/variable.php");
+include("../check.php");
 
 header("Content-type:text/html;charset=utf-8");
-$json_string = file_get_contents('../install/sql-config/sql.json');
+$json_string = file_get_contents('../../install/sql-config/sql.json');
 $dataxxx = json_decode($json_string, true);
 $link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword']);
 
 if ($link) {
    $select = mysqli_select_db($link, $dataxxx['dbname']);
diff --git a/admin/runlogin.php b/admin/admin_user/runlogin.php
similarity index 89%
rename from admin/runlogin.php
rename to admin/admin_user/runlogin.php
index 837fa3b..ae27ef1 100644
--- a/admin/runlogin.php
+++ b/admin/admin_user/runlogin.php
@@ -1,10 +1,10 @@
 <?php
-include("../resource/variable.php");
+include("../../variable.php");
 
 header ( "Content-type:text/html;charset=utf-8" );
-$json_string = file_get_contents('../install/sql-config/sql.json');
+$json_string = file_get_contents('../../install/sql-config/sql.json');
 $dataxxx = json_decode($json_string, true);
 $link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
 
 if($link)
 {
@@ -28,11 +28,11 @@ if($link)
                 $key < $strCount && $strArr[$key] .= $value;
             return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
         }
 
 setcookie("admin", encode('admin',$password) ,time()+3600000,'/');
-Header("Location: index.php");
+Header("Location: ../index.php");
 
 
       }else{ 
         sendalert("登录失败");
         
diff --git a/admin/article-add-run.php b/admin/article-add-run.php
deleted file mode 100644
index f071b2f..0000000
--- a/admin/article-add-run.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-header ( "Content-type:text/html;charset=utf-8" );
-$json_string = file_get_contents('../install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
-
-if($link)
-{
-    $select=mysqli_select_db($link,$dataxxx['dbname']);
-  if($select)
-  {
-    $timenow = date('Y-m-d H:i:s');
-    $cont2=rawurlencode(htmlspecialchars($_POST["content"]));
-      $str='INSERT INTO `rapidcmspage`(`id`, `title`, `content`, `time`, `categoryid`) VALUES ("'.$_POST["id"].'","'.rawurlencode($_POST["title"]).'","'.$cont2.'","'.$timenow.'","'.$_POST["categoryid"].'")';
-
-	  $result=mysqli_query($link,$str);
-    sendalert("增加成功！");
-     
-  }
-}
-?>
\ No newline at end of file
diff --git a/admin/article-chat-delete.php b/admin/article-chat-delete.php
deleted file mode 100644
index 6a6db52..0000000
--- a/admin/article-chat-delete.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-header ( "Content-type:text/html;charset=utf-8" );
-$json_string = file_get_contents('../install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
-
-if($link)
-{
-    $select=mysqli_select_db($link,$dataxxx['dbname']);
-  if($select)
-  {
-
-      $str="DELETE FROM `rapidcmschat` WHERE id='".$_GET["id"]."'";
-	  $result=mysqli_query($link,$str);
-      echo "<script>window.opener=null;window.open('','_self');window.close();</script>";
-    
-  }
-}
-?>
\ No newline at end of file
diff --git a/admin/article-del.php b/admin/article-del.php
deleted file mode 100644
index 5116f7a..0000000
--- a/admin/article-del.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-header ( "Content-type:text/html;charset=utf-8" );
-$json_string = file_get_contents('../install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
-
-if($link)
-{
-    $select=mysqli_select_db($link,$dataxxx['dbname']);
-  if($select)
-  {
-
-      $str="DELETE FROM `rapidcmspage` WHERE id='".$_GET["id"]."'";
-	  $result=mysqli_query($link,$str);
-      sendalert("删除成功！请刷新");
-  }
-}
-?>
\ No newline at end of file
diff --git a/admin/article-edit-run.php b/admin/article-edit-run.php
deleted file mode 100644
index 23fb5dd..0000000
--- a/admin/article-edit-run.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-header ( "Content-type:text/html;charset=utf-8" );
-$json_string = file_get_contents('../install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
-
-if($link)
-{
-    $select=mysqli_select_db($link,$dataxxx['dbname']);
-  if($select)
-  {
-    $timenow = date('Y-m-d H:i:s');
-    $cont2=rawurlencode(htmlspecialchars($_POST["content"]));
-       
-    $str='  UPDATE `rapidcmspage` SET `title`="'.rawurlencode($_POST["title"]).'",`content`="'.$cont2.'",`time`="'.$timenow.'" WHERE `id`="'.$_POST["id"].'"';
-
-	  $result=mysqli_query($link,$str);
-      sendalert("修改成功！");
-  }
-}
-?>
\ No newline at end of file
diff --git a/admin/article/article-add-run.php b/admin/article/article-add-run.php
new file mode 100644
index 0000000..6dc0e2e
--- /dev/null
+++ b/admin/article/article-add-run.php
@@ -0,0 +1,22 @@
+<?php
+include("../check.php");
+
+header ( "Content-type:text/html;charset=utf-8" );
+$json_string = file_get_contents('../../install/sql-config/sql.json');
+$dataxxx = json_decode($json_string, true);
+$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
+
+if($link)
+{
+    $select=mysqli_select_db($link,$dataxxx['dbname']);
+  if($select)
+  {
+    $timenow = date('Y-m-d H:i:s');
+    $cont2=rawurlencode(htmlspecialchars($_POST["content"]));
+      $str='INSERT INTO `rapidcmspage`(`id`, `title`, `content`, `time`, `categoryid`) VALUES ("'.$_POST["id"].'","'.rawurlencode($_POST["title"]).'","'.$cont2.'","'.$timenow.'","'.$_POST["categoryid"].'")';
+	  $result=mysqli_query($link,$str);
+    sendalert("增加成功！");
+     
+  }
+}
+?>
\ No newline at end of file
diff --git a/admin/article-add.php b/admin/article/article-add.php
similarity index 83%
rename from admin/article-add.php
rename to admin/article/article-add.php
index 4f361ed..3e9edbf 100644
--- a/admin/article-add.php
+++ b/admin/article/article-add.php
@@ -1,29 +1,7 @@
 <?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
+include("../check.php");
 ?>
 
 <!DOCTYPE html>
 <html lang="zh-cn">
 
@@ -35,11 +13,11 @@ if ($_COOKIE["admin"] != encode('admin', $pa)) {
     <link rel="shortcut icon" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
     <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
     <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
     <link rel="stylesheet" href="../../../../resource/css/style.css">
     <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
+
 
     <style>
         .editor {
             width: 600px;
             height: 600px;
@@ -63,12 +41,20 @@ if ($_COOKIE["admin"] != encode('admin', $pa)) {
     <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
         <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
         <span class="mdui-typo-title">RapidCMS 管理后台</span>
     </div>
 
-    <? include("drawer.php"); ?>
-    <script>
+
+    <? include("../drawer.php"); ?>
+
+    <style>
+        * {
+            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
+        }
+    </style>
+   
+   <script>
         function randomString(length, ) {
             var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
             var result = '';
             for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
             return result;
@@ -79,15 +65,10 @@ if ($_COOKIE["admin"] != encode('admin', $pa)) {
         }
         window.onload = function() {
             resetnum()
         }
     </script>
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
     <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
 
         <div class="mdui-card">
 
             <div class="mdui-card-primary">
@@ -120,18 +101,18 @@ if ($_COOKIE["admin"] != encode('admin', $pa)) {
                             <?php
                             error_reporting(0);
                             header("Content-type:text/html;charset=utf-8");
                             $table_name = "rapidcmscategory";
 
-                            $json_string = file_get_contents('../install/sql-config/sql.json');
+                            $json_string = file_get_contents('../../install/sql-config/sql.json');
                             $data = json_decode($json_string, true);
                             $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
                             $sql = 'select * from `' . $table_name . '` ORDER BY num DESC';
                             $res = mysqli_query($conn, $sql);
                             $colums = mysqli_num_fields($res);
                             while ($row = mysqli_fetch_row($res)) {
-                                echo '<option value="' . $row[0] . '">' . $row[1] . '</option>';
+                                echo '<option value="' . $row[0] . '">' .  urldecode($row[1]) . '</option>';
                             }
                             ?>
                         </select>
 
                         <br> <br>  <br> 
@@ -155,20 +136,20 @@ if ($_COOKIE["admin"] != encode('admin', $pa)) {
             </m-scrollbar>
 
         </div>
 
     </div>
-    <script src="mdui-editor/js/editor.js"></script>
+    <script src="../src/mdui-editor/js/editor.js"></script>
     <script>
         function sub1(){
             document.getElementById("area").innerHTML= document.getElementById("content").innerHTML;
             document.getElementById("form").submit()
         }
         var editor = new Editor('#toolbar', '#content', {
             autoSave: true,
             imageUploadUrl: 'upload.php',
-            imageUploadSuffix: ['png'],
+            imageUploadSuffix: ['png','jpg','gif','jpeg'],
         });
     </script>
     <script src="../../../../../../resource/js/mtu.min.js"></script>
     <script src="../../../../../../resource/js/mdui.min.js"></script>
 </body>
diff --git a/admin/article/article-chat-delete.php b/admin/article/article-chat-delete.php
new file mode 100644
index 0000000..13b85d5
--- /dev/null
+++ b/admin/article/article-chat-delete.php
@@ -0,0 +1,20 @@
+<?php
+include("../check.php");
+header ( "Content-type:text/html;charset=utf-8" );
+$json_string = file_get_contents('../../install/sql-config/sql.json');
+$dataxxx = json_decode($json_string, true);
+$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
+
+if($link)
+{
+    $select=mysqli_select_db($link,$dataxxx['dbname']);
+  if($select)
+  {
+
+      $str="DELETE FROM `rapidcmschat` WHERE id='".$_GET["id"]."'";
+	  $result=mysqli_query($link,$str);
+      echo "<script>window.opener=null;window.open('','_self');window.close();</script>";
+    
+  }
+}
+?>
\ No newline at end of file
diff --git a/admin/article-chat.php b/admin/article/article-chat.php
similarity index 62%
rename from admin/article-chat.php
rename to admin/article/article-chat.php
index f415977..ab05b3c 100644
--- a/admin/article-chat.php
+++ b/admin/article/article-chat.php
@@ -1,32 +1,7 @@
      <?php
-
-use PhpMyAdmin\Charsets;
-
-        include("../resource/variable.php");
-        function encode($string = '', $skey = 'cxphp')
-        {
-            $strArr = str_split(base64_encode($string));
-            $strCount = count($strArr);
-            foreach (str_split($skey) as $key => $value)
-                $key < $strCount && $strArr[$key] .= $value;
-            return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-        }
-
-        define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-        define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-        $json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-        $dataxxx = json_decode($json_string, true);
-        $link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-        $sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-        $result = mysqli_query($link, $sql);
-        $pass = mysqli_fetch_row($result);
-        $pa = $pass[0];
-
-        if ($_COOKIE["admin"] != encode('admin', $pa)) {
-            Header("Location: login.php");
-        }
+        include("../check.php");
         ?>
 
      <!DOCTYPE html>
      <html lang="zh-cn">
 
@@ -38,15 +13,12 @@ use PhpMyAdmin\Charsets;
          <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
          <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
          <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
          <link rel="stylesheet" href="../../../../resource/css/style.css">
          <link rel="stylesheet" href="../../../../../template/default/theme.css">
-         
 
-         <link rel="stylesheet" href="http://kindeditor.net/ke4/themes/default/default.css" />
-         <script charset="utf-8" src="http://kindeditor.net/ke4/kindeditor-min.js"></script>
-         <script charset="utf-8" src="http://kindeditor.net/ke4/lang/zh-CN.js"></script>
+
          <script>
              var editor;
              KindEditor.ready(function(K) {
                  editor = K.create('textarea[name="content"]', {
                      allowFileManager: true
@@ -56,26 +28,24 @@ use PhpMyAdmin\Charsets;
              });
          </script>
      </head>
 
      <body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
+         <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
+             <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
+             <span class="mdui-typo-title">RapidCMS 管理后台</span>
+         </div>
 
-    <? include("drawer.php"); ?>
+         <? include("../drawer.php"); ?>
 
          <script>
              function randomString(length, ) {
                  var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
                  var result = '';
                  for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
                  return result;
              }
-
-
          </script>
          <script>
              function copyText(text) {
                  var textareaC = document.createElement('textarea');
                  textareaC.setAttribute('readonly', 'readonly');
@@ -105,11 +75,11 @@ use PhpMyAdmin\Charsets;
          <style>
              * {
                  font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
              }
          </style>
-         <div class="mdui-container"  id="page-question" style="margin:auto;">
+         <div class="mdui-container" id="page-question" style="margin:auto;">
 
 
 
 
 
@@ -117,38 +87,37 @@ use PhpMyAdmin\Charsets;
 
              <?php
                 error_reporting(0);
                 header("Content-type:text/html;charset=utf-8");
                 $table_name = "rapidcmschat";
-                define('BASE_PATH2', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-                define('BASE_PATH3', str_replace('\\', '/', realpath(dirname(BASE_PATH2) . '/')) . "/");
-                $json_string = file_get_contents(BASE_PATH3 . '/install/sql-config/sql.json');
+
+                $json_string = file_get_contents('../../install/sql-config/sql.json');
                 $data = json_decode($json_string, true);
                 $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
                 $sql = 'select * from `' . $table_name . '` WHERE articleid="' . $_GET["id"] . '" ORDER BY time DESC';
                 $res = mysqli_query($conn, $sql);
                 $colums = mysqli_num_fields($res);
                 $row = mysqli_num_rows($res);
-         
-                    echo '<div class="mdui-card answers">          <h1  style="text-align:center;">
+
+                echo '<div class="mdui-card answers">          <h1  style="text-align:center;">
                     此文章下所有评论</h1>  ';
-        
+
 
                 while ($row = mysqli_fetch_row($res)) {
-                    echo '<div class="item" id="chat_'.$row[0].'"><div class="mc-user-line"><div class="mc-user-popover"><a class="avatar user-popover-trigger"><i class="mdui-list-item-icon mdui-icon material-icons">people</i></a>    ';
+                    echo '<div class="item" id="chat_' . $row[0] . '"><div class="mc-user-line"><div class="mc-user-popover"><a class="avatar user-popover-trigger"><i class="mdui-list-item-icon mdui-icon material-icons">people</i></a>    ';
                     echo '<a class="username user-popover-trigger mdui-text-color-theme-text">' . $row[1] . '</a>    ';
                     echo '<div class="more"><span class="time mdui-text-color-theme-secondary" >' . $row[4] . '</span></div>';
-                    echo '</div></div><div class="content mdui-typo"><p>' . $row[2] . '</p>';
+                    echo '</div></div><div class="content mdui-typo"><p>' . urldecode($row[2]) . '<div class="mdui-typo-caption-opacity">点赞数：' . $row[3] . '</div></p>';
                     echo '</div><div class="actions"><div class="mc-vote">    ';
-                      echo '</div><div class="flex-grow"></div><div class="mc-options-button">    ';
+                    echo '</div><div class="flex-grow"></div><div class="mc-options-button">    ';
                     echo '<button mdui-menu="{target: \'#attr_' . $row[0] . '\',position:\'top\',align:\'right\',covered:false}" class="mdui-btn mdui-btn-icon mdui-text-color-theme-icon mdui-ripple"><i class="mdui-icon material-icons">more_vert</i></button>    ';
                     echo '<ul class="mdui-menu " id="attr_' . $row[0] . '" style="top: 7px; left: 597px; transform-origin: 100% 100%; position: absolute;">    ';
-                    echo '<li class="mdui-menu-item"><a onclick="copyText(\'' . $row[0] . '\')" class="mdui-ripple">复制评论ID</a></li><li class="mdui-menu-item"><a target="_blank" onclick="document.getElementById(\'chat_'.$row[0].'\').style.display=\'none\';" href="article-chat-delete.php?id='.$row[0].'" class="mdui-ripple">删除评论</a></li></ul></div></div></div>    ';
+                    echo '<li class="mdui-menu-item"><a onclick="copyText(\'' . $row[0] . '\')" class="mdui-ripple">复制评论ID</a></li><li class="mdui-menu-item"><a target="_blank" onclick="document.getElementById(\'chat_' . $row[0] . '\').style.display=\'none\';" href="article-chat-delete.php?id=' . $row[0] . '" class="mdui-ripple">删除评论</a></li></ul></div></div></div>    ';
                 }
 
-                    echo '</div>';
-             
+                echo '</div>';
+
 
                 ?>
 
 
 
diff --git a/admin/article/article-del.php b/admin/article/article-del.php
new file mode 100644
index 0000000..fdb49a5
--- /dev/null
+++ b/admin/article/article-del.php
@@ -0,0 +1,19 @@
+<?php
+include("../check.php");
+header ( "Content-type:text/html;charset=utf-8" );
+$json_string = file_get_contents('../../install/sql-config/sql.json');
+$dataxxx = json_decode($json_string, true);
+$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
+
+if($link)
+{
+    $select=mysqli_select_db($link,$dataxxx['dbname']);
+  if($select)
+  {
+
+      $str="DELETE FROM `rapidcmspage` WHERE id='".$_GET["id"]."'";
+	  $result=mysqli_query($link,$str);
+      sendalert("删除成功！请刷新");
+  }
+}
+?>
\ No newline at end of file
diff --git a/admin/article/article-edit-run.php b/admin/article/article-edit-run.php
new file mode 100644
index 0000000..aa9d529
--- /dev/null
+++ b/admin/article/article-edit-run.php
@@ -0,0 +1,22 @@
+<?php
+include("../check.php");
+header ( "Content-type:text/html;charset=utf-8" );
+$json_string = file_get_contents('../../install/sql-config/sql.json');
+$dataxxx = json_decode($json_string, true);
+$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
+
+if($link)
+{
+    $select=mysqli_select_db($link,$dataxxx['dbname']);
+  if($select)
+  {
+    $timenow = date('Y-m-d H:i:s');
+    $cont2=rawurlencode(htmlspecialchars($_POST["content"]));
+       
+    $str='  UPDATE `rapidcmspage` SET `title`="'.rawurlencode($_POST["title"]).'",`content`="'.$cont2.'",`time`="'.$timenow.'" WHERE `id`="'.$_POST["id"].'"';
+
+	  $result=mysqli_query($link,$str);
+      sendalert("修改成功！");
+  }
+}
+?>
\ No newline at end of file
diff --git a/admin/article-edit.php b/admin/article/article-edit.php
similarity index 82%
rename from admin/article-edit.php
rename to admin/article/article-edit.php
index cc814ec..0c9e834 100644
--- a/admin/article-edit.php
+++ b/admin/article/article-edit.php
@@ -1,29 +1,7 @@
 <?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
+include("../check.php");
 ?>
 
 <!DOCTYPE html>
 <html lang="zh-cn">
 
@@ -64,11 +42,11 @@ if ($_COOKIE["admin"] != encode('admin', $pa)) {
         <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
         <span class="mdui-typo-title">RapidCMS 管理后台</span>
     </div>
 
 
-    <? include("drawer.php"); ?>
+    <? include("../drawer.php"); ?>
 
     <style>
         * {
             font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
         }
@@ -99,19 +77,19 @@ if ($_COOKIE["admin"] != encode('admin', $pa)) {
                             <label class="mdui-textfield-label">标题</label>
                             <input class="mdui-textfield-input" value="<?php
                             error_reporting(0);
                             header("Content-type:text/html;charset=utf-8");
                             $table_name = "rapidcmspage";
-                            $json_string = file_get_contents('../install/sql-config/sql.json');
+                            $json_string = file_get_contents('../../install/sql-config/sql.json');
                             $data = json_decode($json_string, true);
                             $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
                             $sql = 'select * from `' . $table_name . '` WHERE `id`= \''.$_GET["id"].'\'';
                        
                             $res = mysqli_query($conn, $sql);
                             $colums = mysqli_num_fields($res);
                             while ($row = mysqli_fetch_row($res)) {
-                                echo $row[1];
+                                echo urldecode($row[1]);
                             }
 
                             ?>" type="text" name="title" required="">
                         </div>
                         <br>
@@ -123,21 +101,21 @@ if ($_COOKIE["admin"] != encode('admin', $pa)) {
 
                             <?php
                             error_reporting(0);
                             header("Content-type:text/html;charset=utf-8");
                             $table_name = "rapidcmscategory";
-                            $json_string = file_get_contents('../install/sql-config/sql.json');
+                            $json_string = file_get_contents('../../install/sql-config/sql.json');
                             $data = json_decode($json_string, true);
                             $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
                             $sql = 'select * from `' . $table_name . '` ORDER BY num DESC';
                             $res = mysqli_query($conn, $sql);
                             $colums = mysqli_num_fields($res);
                             while ($row = mysqli_fetch_row($res)) {
                                 if ($row[0] == $cat3) {
-                                    echo '<option selected="selected" value="' . $row[0] . '">' . $row[1] . '</option>';
+                                    echo '<option selected="selected" value="' . $row[0] . '">' . urldecode($row[1]) . '</option>';
                                 } else {
-                                    echo '<option value="' . $row[0] . '">' . $row[1] . '</option>';
+                                    echo '<option value="' . $row[0] . '">' .  urldecode($row[1]) . '</option>';
                                 }
                             }
                             ?>
                         </select>
 
@@ -164,20 +142,20 @@ if ($_COOKIE["admin"] != encode('admin', $pa)) {
             </m-scrollbar>
 
         </div>
 
     </div>
-    <script src="mdui-editor/js/editor.js"></script>
+    <script src="../src/mdui-editor/js/editor.js"></script>
     <script>
-        function sub1() {
-            document.getElementById("area").innerHTML = document.getElementById("content").innerHTML;
+        function sub1(){
+            document.getElementById("area").innerHTML= document.getElementById("content").innerHTML;
             document.getElementById("form").submit()
         }
         var editor = new Editor('#toolbar', '#content', {
             autoSave: true,
             imageUploadUrl: 'upload.php',
-            imageUploadSuffix: ['png'],
+            imageUploadSuffix: ['png','jpg','gif','jpeg'],
         });
     </script>
     <script src="../../../../../../resource/js/mtu.min.js"></script>
     <script src="../../../../../../resource/js/mdui.min.js"></script>
 </body>
diff --git a/admin/article.php b/admin/article/article.php
similarity index 54%
rename from admin/article.php
rename to admin/article/article.php
index 87d8bce..7113637 100644
--- a/admin/article.php
+++ b/admin/article/article.php
@@ -1,71 +1,19 @@
 <?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
+include("../header.php");
 
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-
-    <script type="text/javascript" language="javascript"> 
+?>  <script type="text/javascript" language="javascript"> 
 function confirmAct() 
 { 
   if(confirm('确定要删除吗?')) 
   { 
     return true; 
   } 
   return false; 
 } 
 
 </script> 
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
     <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
 
         <div class="mdui-card" style="overflow:scroll">
 
             <div class="mdui-card-primary">
@@ -88,21 +36,21 @@ function confirmAct()
                         <tbody>
 
                             <?php
                             $table_name = "rapidcmspage";
 
-                            $json_string = file_get_contents('../install/sql-config/sql.json');
+                            $json_string = file_get_contents('../../install/sql-config/sql.json');
                             $data = json_decode($json_string, true);
                             $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
                             $sql = 'select * from `' . $table_name . '`';
                             $res = mysqli_query($conn, $sql);
                             $colums = mysqli_num_fields($res);
                             while ($row = mysqli_fetch_row($res)) {
                                 echo "<tr>";
                                 echo "</tr>";
                                 echo "<td>$row[0]</td>";
-                                echo "<td>$row[1]</td>";
+                                echo "<td>".urldecode($row[1])."</td>";
                                 echo "<td>$row[3]</td>";
                                 echo "<td>$row[4]</td>";
                                 echo '<td><a href="article-edit.php?id='.$row[0].'&name='.urlencode($row[1]).'"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
                                 echo '<a  href="article-chat.php?id='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">chat</i></button></a>';
                         
diff --git a/admin/article/run-tool.php b/admin/article/run-tool.php
new file mode 100644
index 0000000..b11c5b0
--- /dev/null
+++ b/admin/article/run-tool.php
@@ -0,0 +1,30 @@
+<?php
+include("../check.php");
+$data1 = array();
+if ($_POST["tool"] == "on") {
+    $data1['tool'] = "true";
+} else {
+    $data1['tool'] = "false";
+}
+$data1['kind'] = $_POST["kind"];
+if ($_POST["kind"] == "one") {
+    $data1['content'] = '<center><p id="hitokoto"><a style="color:#000000" href="#" id="hitokoto_text">获取中...</a></p></center><script>fetch(\'https://v1.hitokoto.cn\').then(response => response.json()).then(data => {const hitokoto = document.querySelector(\'#hitokoto_text\');hitokoto.href = \'https://hitokoto.cn/?uuid=\' + data.uuid;
+        if (data.from_who == null) {
+        hitokoto.innerHTML = "「 " + data.hitokoto + " 」<br>——" + data.from;
+        }else {
+        hitokoto.innerHTML = "「 " + data.hitokoto + " 」<br>——" + data.from_who + "「" + data.from + "」"
+        }}).catch(console.error)
+        </script>';
+} else if ($_POST["kind"] == "time") {
+    $data1['content'] = '<center><a  id="time_is_link" rel="nofollow" style="display:none"></a><span id="China_z43d" style="font-size:25px;"></span><script src="https://widget.time.is/t.js"></script><script>time_is_widget.init({China_z43d:{}});</script></center>';
+} else {
+    $data1['content'] = $_POST["content"];
+}
+
+
+$json_string1 = json_encode($data1);
+$filename1 = '../../resource/config/tool.json';
+$fp1 = fopen($filename1, "w");
+$len1 = fwrite($fp1, $json_string1);
+fclose($fp1);
+echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"tool.php\"</script>";
diff --git a/admin/article/tool.php b/admin/article/tool.php
new file mode 100644
index 0000000..73f7424
--- /dev/null
+++ b/admin/article/tool.php
@@ -0,0 +1,78 @@
+<?php
+include("../header.php");
+
+?>
+
+<div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
+
+    <div class="mdui-card">
+
+        <div class="mdui-card-primary">
+            <div class="mdui-card-primary-title" style="font-size:30px">小组件设置</div>
+        </div>
+        <form method="post" action="run-tool.php">
+            <m-scrollbar style="height: 620px;width:900px">
+                <div class="mdui-card-content" style="font-size:15px;text-align:left">
+
+                    <label class="mdui-switch">
+                        开启小组件&nbsp;&nbsp;&nbsp;
+                        <input <?
+                                if ($data_tool["tool"]  == "true") {
+                                    echo " checked='true'";
+                                }
+                                ?> name="tool" type="checkbox" />
+                        <i class="mdui-switch-icon"></i>
+                    </label> <br>
+                    <label class="mdui-textfield-label">选择小组件</label>
+                    <select class="mdui-select" name="kind" id="kind" onchange="kindmove()" mdui-select>
+                        <?
+
+                        if ($data_tool["kind"] == "one") {
+                            echo ' <option value="one" selected>一言</option>';
+                            echo '   <option value="time" >时间</option>';
+                            echo '   <option value="write" >自定义</option>';
+                        } else if ($data_tool["kind"] == "time") {
+                            echo ' <option value="one" >一言</option>';
+                            echo '   <option value="time" selected>时间</option>';
+                            echo '   <option value="write" >自定义</option>';
+                        } else {
+                            echo ' <option value="one" >一言</option>';
+                            echo '   <option value="time" >时间</option>';
+                            echo '   <option value="write" selected>自定义</option>';
+                        }
+                        ?>
+
+
+                    </select> <br> <br>
+                    <div id="con" style="display:none" class="mdui-textfield  mdui-textfield-has-bottom ">
+                        <label class="mdui-textfield-label">输入内容</label>
+
+
+                        <textarea rows="7" class="mdui-textfield-input" name="content" type="text" required=""><? echo $data_tool["content"]; ?></textarea>
+                    </div>
+                    <br>
+                    <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">提交</button>
+
+                </div>
+            </m-scrollbar>
+        </form>
+    </div>
+
+</div>
+<script>
+    function kindmove() {
+        if (document.getElementById("kind").value == "write") {
+            document.getElementById("con").style.display = "inline";
+        } else {
+            document.getElementById("con").style.display = "none";
+        }
+    }
+    window.onload = () => {
+        kindmove()
+    }
+</script>
+<script src="../../../../../../resource/js/mtu.min.js"></script>
+<script src="../../../../../../resource/js/mdui.min.js"></script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/admin/article/upload.php b/admin/article/upload.php
new file mode 100644
index 0000000..130f196
--- /dev/null
+++ b/admin/article/upload.php
@@ -0,0 +1,28 @@
+<?php
+function isImage($imgPath){
+if($imgPath=="jpg"||$imgPath=="png"||$imgPath=="gif"||$imgPath=="jpeg"){
+return true;
+}else{
+  return false;
+}
+}
+
+$fileInfo = $_FILES['file'];
+$name = $fileInfo['name'];
+$pathname = pathinfo($name)["extension"];
+$filename =  pathinfo($name, PATHINFO_FILENAME);
+$filePath = $fileInfo['tmp_name'];
+if(isImage($pathname)==false){
+  exit;
+}
+ //$name = iconv('utf-8', 'gb2312', $filename);
+  $str = rand();
+  $path = "../../upload/upload_" . md5($str) . "." . $pathname;
+  move_uploaded_file($filePath, $path);
+  echo json_encode([
+    "code" => 0,
+    "data" => [
+      "url" => $path,
+      "name" => $name
+    ]
+  ]);
\ No newline at end of file
diff --git a/admin/backzip/backup.zip b/admin/backzip/backup.zip
deleted file mode 100644
index 4fe267f..0000000
Binary files a/admin/backzip/backup.zip and /dev/null differ
diff --git a/admin/cate-add-run.php b/admin/cate-add-run.php
deleted file mode 100644
index 13d5511..0000000
--- a/admin/cate-add-run.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-header ( "Content-type:text/html;charset=utf-8" );
-$json_string = file_get_contents('../install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
-
-if($link)
-{
-    $select=mysqli_select_db($link,$dataxxx['dbname']);
-  if($select)
-  {
-
-      $str='INSERT INTO `rapidcmscategory`(`id`, `name`, `pic`, `num`) VALUES ("'.$_POST["id"].'","'.rawurlencode($_POST["name"]).'","'.$_POST["pic"].'",'.$_POST["num"].')';
-
-	  $result=mysqli_query($link,$str);
-      sendalert("增加成功！");
-  }
-}
-?>
\ No newline at end of file
diff --git a/admin/cate-add.php b/admin/cate-add.php
deleted file mode 100644
index 1255ecb..0000000
--- a/admin/cate-add.php
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-<script>
-    function randomString(length,) {
-        var chars='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
-    var result = '';
-    for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
-    return result;
-}
-function resetnum(){
-    document.getElementById("ranid").value=randomString(10);
-}
-window.onload = function () {
-    resetnum()
-}
-
-
-    </script>
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
-    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
-
-        <div class="mdui-card">
-
-            <div class="mdui-card-primary">
-                <div class="mdui-card-primary-title" style="font-size:30px">分类设置</div>
-            </div>
-           
-                <m-scrollbar style="height: 800px;width:900px;text-align:left ">
-                <div id="login" class="mc-account mc-login mdui-dialog mdui-dialog-open " style="overflow: hidden;z-index:999;display: block; top: 150.104px; height: 700px;">
-                <button class="mdui-btn mdui-btn-icon close" onclick="window.location.href='category.php'"><i class="mdui-icon material-icons">close</i></button>
- 
-<div class="mdui-dialog-title">新增</div>
-<form method="post" action="cate-add-run.php">
-
-    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
-        <label class="mdui-textfield-label">唯一ID（10位字符）</label>
-    <input class="mdui-textfield-input" style="width:90%" type="text" name="id" id="ranid" value="onload" required="">
-  <i   style="cursor:pointer;position: absolute;left: 92%" onclick="resetnum(10)" class="mdui-icon material-icons">&#xe5d5;</i>
-</div>
-    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
-        <label class="mdui-textfield-label">名称</label>
-    <input class="mdui-textfield-input" type="text" name="name" required=""></div>
-    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
-        <label class="mdui-textfield-label">图标ID（在MDUI中获取&#XXXX;）</label>
-    <input class="mdui-textfield-input" style="width:90%" type="text" name="pic" required="">
-    <i   style="cursor:pointer;position: absolute;left: 92%" onclick="window.open('https://www.mdui.org/docs/material_icon')" class="mdui-icon material-icons">&#xe250;</i>
-    </div>
-    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
-        <label class="mdui-textfield-label">权重（大的在前面）</label>
-    <input class="mdui-textfield-input" type="number" name="num" required=""></div>
-
-    <div class="actions mdui-clearfix">
-       <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button>
-    </div>
-</form>
-</div>
-                </m-scrollbar>
-  
-        </div>
-
-    </div>
-
-    <script src="../../../../../../resource/js/mtu.min.js"></script>
-    <script src="../../../../../../resource/js/mdui.min.js"></script>
-</body>
-
-</html>
-
-
-
diff --git a/admin/cate-del.php b/admin/cate-del.php
deleted file mode 100644
index 2c2441e..0000000
--- a/admin/cate-del.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-header ( "Content-type:text/html;charset=utf-8" );
-$json_string = file_get_contents('../install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
-
-if($link)
-{
-    $select=mysqli_select_db($link,$dataxxx['dbname']);
-  if($select)
-  {
-
-      $str="DELETE FROM `rapidcmscategory` WHERE id='".$_GET["id"]."'";
-	  $result=mysqli_query($link,$str);
-      sendalert("删除成功！请刷新");
-  }
-}
-?>
\ No newline at end of file
diff --git a/admin/cate-edit-run.php b/admin/cate-edit-run.php
deleted file mode 100644
index cc6f921..0000000
--- a/admin/cate-edit-run.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-header ( "Content-type:text/html;charset=utf-8" );
-$json_string = file_get_contents('../install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
-
-if($link)
-{
-    $select=mysqli_select_db($link,$dataxxx['dbname']);
-  if($select)
-  {
-  
-      $str='  UPDATE `rapidcmscategory` SET `name`="'.rawurlencode($_POST["name"]).'",`pic`="'.$_POST["pic"].'",`num`='.$_POST["num"].' WHERE `id`="'.$_POST["id"].'"';
-        echo $str;
-	  $result=mysqli_query($link,$str);
-      sendalert("修改成功！");
-  }
-}
-?>
\ No newline at end of file
diff --git a/admin/category/cate-add-run.php b/admin/category/cate-add-run.php
new file mode 100644
index 0000000..a3e6220
--- /dev/null
+++ b/admin/category/cate-add-run.php
@@ -0,0 +1,21 @@
+<?php
+include("../check.php");
+
+header ( "Content-type:text/html;charset=utf-8" );
+$json_string = file_get_contents('../../install/sql-config/sql.json');
+$dataxxx = json_decode($json_string, true);
+$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
+
+if($link)
+{
+    $select=mysqli_select_db($link,$dataxxx['dbname']);
+  if($select)
+  {
+
+      $str='INSERT INTO `rapidcmscategory`(`id`, `name`, `pic`, `num`) VALUES ("'.$_POST["id"].'","'.rawurlencode($_POST["name"]).'","'.$_POST["pic"].'",'.$_POST["num"].')';
+
+	  $result=mysqli_query($link,$str);
+      sendalert("增加成功！");
+  }
+}
+?>
\ No newline at end of file
diff --git a/admin/category/cate-add.php b/admin/category/cate-add.php
new file mode 100644
index 0000000..7251e66
--- /dev/null
+++ b/admin/category/cate-add.php
@@ -0,0 +1,71 @@
+<?php
+include("../header.php");
+
+?>
+
+
+<script>
+    function randomString(length, ) {
+        var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
+        var result = '';
+        for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
+        return result;
+    }
+
+    function resetnum() {
+        document.getElementById("ranid").value = randomString(10);
+    }
+    window.onload = function() {
+        resetnum()
+    }
+</script>
+<div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
+
+    <div class="mdui-card">
+
+        <div class="mdui-card-primary">
+            <div class="mdui-card-primary-title" style="font-size:30px">分类设置</div>
+        </div>
+
+        <m-scrollbar style="height: 800px;width:900px;text-align:left ">
+            <div id="login" class="mc-account mc-login mdui-dialog mdui-dialog-open " style="overflow: hidden;z-index:999;display: block; top: 150.104px; height: 700px;">
+                <button class="mdui-btn mdui-btn-icon close" onclick="window.location.href='category.php'"><i class="mdui-icon material-icons">close</i></button>
+
+                <div class="mdui-dialog-title">新增</div>
+                <form method="post" action="cate-add-run.php">
+
+                    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
+                        <label class="mdui-textfield-label">唯一ID（10位字符）</label>
+                        <input class="mdui-textfield-input" style="width:90%" type="text" name="id" id="ranid" value="onload" required="">
+                        <i style="cursor:pointer;position: absolute;left: 92%" onclick="resetnum(10)" class="mdui-icon material-icons">&#xe5d5;</i>
+                    </div>
+                    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
+                        <label class="mdui-textfield-label">名称</label>
+                        <input class="mdui-textfield-input" type="text" name="name" required="">
+                    </div>
+                    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
+                        <label class="mdui-textfield-label">图标ID（在MDUI中获取&#XXXX;）</label>
+                        <input class="mdui-textfield-input" style="width:90%" type="text" name="pic" required="">
+                        <i style="cursor:pointer;position: absolute;left: 92%" onclick="window.open('https://www.mdui.org/docs/material_icon')" class="mdui-icon material-icons">&#xe250;</i>
+                    </div>
+                    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
+                        <label class="mdui-textfield-label">权重（大的在前面）</label>
+                        <input class="mdui-textfield-input" type="number" name="num" required="">
+                    </div>
+
+                    <div class="actions mdui-clearfix">
+                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button>
+                    </div>
+                </form>
+            </div>
+        </m-scrollbar>
+
+    </div>
+
+</div>
+
+<script src="../../../../../../resource/js/mtu.min.js"></script>
+<script src="../../../../../../resource/js/mdui.min.js"></script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/admin/category/cate-del.php b/admin/category/cate-del.php
new file mode 100644
index 0000000..fa4970b
--- /dev/null
+++ b/admin/category/cate-del.php
@@ -0,0 +1,20 @@
+<?php
+include("../check.php");
+
+header ( "Content-type:text/html;charset=utf-8" );
+$json_string = file_get_contents('../../install/sql-config/sql.json');
+$dataxxx = json_decode($json_string, true);
+$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
+
+if($link)
+{
+    $select=mysqli_select_db($link,$dataxxx['dbname']);
+  if($select)
+  {
+
+      $str="DELETE FROM `rapidcmscategory` WHERE id='".$_GET["id"]."'";
+	  $result=mysqli_query($link,$str);
+      sendalert("删除成功！请刷新");
+  }
+}
+?>
\ No newline at end of file
diff --git a/admin/category/cate-edit-run.php b/admin/category/cate-edit-run.php
new file mode 100644
index 0000000..f4ac5de
--- /dev/null
+++ b/admin/category/cate-edit-run.php
@@ -0,0 +1,21 @@
+<?php
+include("../check.php");
+
+header ( "Content-type:text/html;charset=utf-8" );
+$json_string = file_get_contents('../../install/sql-config/sql.json');
+$dataxxx = json_decode($json_string, true);
+$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
+
+if($link)
+{
+    $select=mysqli_select_db($link,$dataxxx['dbname']);
+  if($select)
+  {
+  
+      $str='  UPDATE `rapidcmscategory` SET `name`="'.rawurlencode($_POST["name"]).'",`pic`="'.$_POST["pic"].'",`num`='.$_POST["num"].' WHERE `id`="'.$_POST["id"].'"';
+      
+	  $result=mysqli_query($link,$str);
+      sendalert("修改成功！");
+  }
+}
+?>
\ No newline at end of file
diff --git a/admin/cate-edit.php b/admin/category/cate-edit.php
similarity index 55%
rename from admin/cate-edit.php
rename to admin/category/cate-edit.php
index 5d08063..4f547b4 100644
--- a/admin/cate-edit.php
+++ b/admin/category/cate-edit.php
@@ -1,37 +1,16 @@
 <?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH2',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH3',str_replace('\\','/',realpath(dirname(BASE_PATH2).'/'))."/");
-$json_string = file_get_contents(BASE_PATH3.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
+include("../header.php");
 
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
 ?>
+
         <?php
 error_reporting(0);
 header("Content-type:text/html;charset=utf-8");
 $table_name = "rapidcmscategory";
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
+
+$json_string = file_get_contents('../../install/sql-config/sql.json');
 $data = json_decode($json_string, true);
 $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
 $sql = 'select * from `'.$table_name .'` WHERE id="'.$_GET["id"].'"';
 $res = mysqli_query($conn, $sql);
 $colums = mysqli_num_fields($res);
@@ -40,39 +19,11 @@ while ($row = mysqli_fetch_row($res)) {
         $cat2= $row[2];
         $cat3= $row[3];
 }
 
 ?>
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
 
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
     <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
 
         <div class="mdui-card">
 
             <div class="mdui-card-primary">
diff --git a/admin/category.php b/admin/category/category.php
similarity index 52%
rename from admin/category.php
rename to admin/category/category.php
index 9a7426e..33076b6 100644
--- a/admin/category.php
+++ b/admin/category/category.php
@@ -1,70 +1,22 @@
 <?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
+include("../header.php");
 
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
 ?>
 
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
 
-    <? include("drawer.php"); ?>
-    <script type="text/javascript" language="javascript"> 
+<script type="text/javascript" language="javascript"> 
 function confirmAct() 
 { 
   if(confirm('确定要删除吗?')) 
   { 
     return true; 
   } 
   return false; 
 } 
 
 </script> 
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
     <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
 
         <div class="mdui-card" style="overflow:scroll">
 
             <div class="mdui-card-primary">
@@ -86,21 +38,21 @@ function confirmAct()
                             </thead>
                             <tbody>
 
                     <?php
                     $table_name = "rapidcmscategory";
-                    $json_string = file_get_contents('../install/sql-config/sql.json');
+                    $json_string = file_get_contents('../../install/sql-config/sql.json');
                     $data = json_decode($json_string, true);
                     $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
                     $sql = 'select * from `' . $table_name . '`';
                     $res = mysqli_query($conn, $sql);
                     $colums = mysqli_num_fields($res);
                     while ($row = mysqli_fetch_row($res)) {
                        echo "<tr>";
                         echo "</tr>";
                         echo "<td>$row[0]</td>";
-                        echo "<td>$row[1]</td>";
+                        echo "<td>".urldecode($row[1])."</td>";
                         echo "<td><i class='mdui-list-item-icon mdui-icon material-icons'>$row[2]</i></td>";
                         echo "<td>$row[3]</td>";
                         echo '<td><a href="cate-edit.php?id='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
                   
                         echo '<a onclick="return confirmAct();" href="cate-del.php?id='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe872;</i></button></a>&nbsp;&nbsp;&nbsp;&nbsp;';
diff --git a/admin/check.php b/admin/check.php
new file mode 100644
index 0000000..6dc96fd
--- /dev/null
+++ b/admin/check.php
@@ -0,0 +1,24 @@
+<?php
+include("../../resource/variable.php");
+function encode($string = '', $skey = 'cxphp')
+{
+    $strArr = str_split(base64_encode($string));
+    $strCount = count($strArr);
+    foreach (str_split($skey) as $key => $value)
+        $key < $strCount && $strArr[$key] .= $value;
+    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
+}
+
+$json_string = file_get_contents('../../install/sql-config/sql.json');
+$dataxxx = json_decode($json_string, true);
+$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
+$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
+$result = mysqli_query($link, $sql);
+$pass = mysqli_fetch_row($result);
+$pa = $pass[0];
+
+if ($_COOKIE["admin"] != encode('admin', $pa)) {
+    Header("Location: ../admin_user/login.php");
+}
+
+?>
\ No newline at end of file
diff --git a/admin/mail.php b/admin/config/mail.php
similarity index 56%
rename from admin/mail.php
rename to admin/config/mail.php
index 289e750..449672d 100644
--- a/admin/mail.php
+++ b/admin/config/mail.php
@@ -1,60 +1,6 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple  mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
+<? include("../header.php"); ?>
     <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
 
         <div class="mdui-card">
 
             <div class="mdui-card-primary">
diff --git a/admin/rewrite.php b/admin/config/rewrite.php
similarity index 54%
rename from admin/rewrite.php
rename to admin/config/rewrite.php
index 8080840..83d9c21 100644
--- a/admin/rewrite.php
+++ b/admin/config/rewrite.php
@@ -1,59 +1,6 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
+<? include("../header.php"); ?>
     <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
 
         <div class="mdui-card">
 
             <div class="mdui-card-primary">
diff --git a/admin/config/run-close.php b/admin/config/run-close.php
new file mode 100644
index 0000000..0f1741d
--- /dev/null
+++ b/admin/config/run-close.php
@@ -0,0 +1,19 @@
+<?php
+include("../check.php");
+
+$data1 = array();
+if($_POST["close"]=="on"){
+    $data1['close'] = "true";
+}else{
+    $data1['close'] = "false";
+}
+$data1['template'] = $data_index["template"];
+$data1['version'] = $data_index["version"];
+$data1['rewrite'] = $data_index["rewrite"];
+
+$json_string1 = json_encode($data1);
+$filename1 = '../../resource/config/index.json';
+$fp1 = fopen($filename1, "w");
+$len1 = fwrite($fp1, $json_string1);
+fclose($fp1);
+echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"server.php\"</script>";
\ No newline at end of file
diff --git a/admin/config/run-mail.php b/admin/config/run-mail.php
new file mode 100644
index 0000000..a81c5f3
--- /dev/null
+++ b/admin/config/run-mail.php
@@ -0,0 +1,20 @@
+<?php
+include("../check.php");
+
+$data1 = array();
+if($_POST["logonwithmail"]=="on"){
+    $data1['logonwithmail'] = "true";
+}else{
+    $data1['logonwithmail'] = "false";
+}
+$data1['smtp'] = $_POST["smtp"];
+$data1['secure'] = $_POST["secure"];
+$data1['port'] = $_POST["port"];
+$data1['username'] = $_POST["username"];
+$data1['password'] = $_POST["password"];
+$json_string1 = json_encode($data1);
+$filename1 = '../../resource/config/mail.json';
+$fp1 = fopen($filename1, "w");
+$len1 = fwrite($fp1, $json_string1);
+fclose($fp1);
+echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"mail.php\"</script>";
\ No newline at end of file
diff --git a/admin/config/run-rewrite.php b/admin/config/run-rewrite.php
new file mode 100644
index 0000000..275264c
--- /dev/null
+++ b/admin/config/run-rewrite.php
@@ -0,0 +1,19 @@
+<?php
+include("../check.php");
+
+$data1 = array();
+if($_POST["rewrite"]=="on"){
+    $data1['rewrite'] = "true";
+}else{
+    $data1['rewrite'] = "false";
+}
+$data1['template'] = $data_index["template"];
+$data1['version'] = $data_index["version"];
+$data1['close'] = $data_index["close"];
+
+$json_string1 = json_encode($data1);
+$filename1 = '../../resource/config/index.json';
+$fp1 = fopen($filename1, "w");
+$len1 = fwrite($fp1, $json_string1);
+fclose($fp1);
+echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"rewrite.php\"</script>";
diff --git a/admin/config/run-setting.php b/admin/config/run-setting.php
new file mode 100644
index 0000000..d5c8b40
--- /dev/null
+++ b/admin/config/run-setting.php
@@ -0,0 +1,16 @@
+<?php
+include("../check.php");
+$data1 = array();
+$data1['headname'] = $_POST["headname"];
+$data1['title'] = $_POST["title"];
+$data1['icon'] =  $data_header["icon"];
+$data1['description'] = $_POST["description"];
+$data1['keywords'] = $_POST["keywords"];
+$data1['introduce'] = $_POST["introduce"];
+$data1['con'] = $_POST["con"];
+$json_string1 = json_encode($data1);
+$filename1 = '../../resource/config/header.json';
+$fp1 = fopen($filename1, "w");
+$len1 = fwrite($fp1, $json_string1);
+fclose($fp1);
+echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"setting.php\"</script>";
\ No newline at end of file
diff --git a/admin/config/server.php b/admin/config/server.php
new file mode 100644
index 0000000..934935a
--- /dev/null
+++ b/admin/config/server.php
@@ -0,0 +1,34 @@
+<? include("../header.php"); ?>
+    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
+
+
+        <div class="mdui-card" style="width:900px">
+
+            <div class="mdui-card-primary">
+                <div class="mdui-card-primary-title" style="font-size:30px">网站服务设置</div>
+            </div>
+            <form method="post" action="run-close.php">
+            <div class="mdui-card-content" style="font-size:15px;text-align:left">
+            <label class="mdui-switch">
+                            启用网页维护&nbsp;&nbsp;&nbsp;
+                            <input <?
+                                    if ($data_index["close"]  == "true") {
+                                        echo " checked='true'";
+                                    }
+                                    ?> name="close" type="checkbox" />
+                            <i class="mdui-switch-icon"></i>
+                        </label> 
+                        <br> <br>
+                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">确认</button>
+                  
+            </div>
+            </form>
+        </div>
+        <br>
+    </div>
+
+    <script src="../../../../../../resource/js/mtu.min.js"></script>
+    <script src="../../../../../../resource/js/mdui.min.js"></script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/admin/setting.php b/admin/config/setting.php
similarity index 63%
rename from admin/setting.php
rename to admin/config/setting.php
index f2f3b08..899b8f2 100644
--- a/admin/setting.php
+++ b/admin/config/setting.php
@@ -1,59 +1,7 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
+<? include("../header.php"); ?>
 
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
     <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
 
         <div class="mdui-card">
 
             <div class="mdui-card-primary">
diff --git a/admin/uploadicon.php b/admin/config/uploadicon.php
similarity index 86%
rename from admin/uploadicon.php
rename to admin/config/uploadicon.php
index e278f96..ddf7b75 100644
--- a/admin/uploadicon.php
+++ b/admin/config/uploadicon.php
@@ -1,7 +1,7 @@
 <?php
-include("../resource/variable.php");
+include("../check.php");
 
 $fileInfo = $_FILES['file'];
 $name = $fileInfo['name'];
 function isImg($fileName)
 
@@ -41,11 +41,11 @@ if (isImg($fileInfo['tmp_name']))
   $filename =  pathinfo($name, PATHINFO_FILENAME);
   $filePath = $fileInfo['tmp_name'];
   //$name = iconv('utf-8', 'gb2312', $filename);
   $str = rand();
   $path1 = "upload/upload_" . md5($str) . "." . $pathname;
-  $path = "../" . $path1;
+  $path = "../../" . $path1;
   move_uploaded_file($filePath, $path);
 
 
   $data1 = array();
   $data1['headname'] = $data_header["headname"];
@@ -54,16 +54,16 @@ if (isImg($fileInfo['tmp_name']))
   $data1['description'] = $data_header["description"];
   $data1['keywords'] = $data_header["keywords"];
   $data1['introduce'] = $data_header["introduce"];
   $data1['con'] = $data_header["con"];
   $json_string1 = json_encode($data1);
-  $filename1 = '../resource/config/header.json';
+  $filename1 = '../../resource/config/header.json';
   $fp1 = fopen($filename1, "w");
   $len1 = fwrite($fp1, $json_string1);
   fclose($fp1);
 
-  sendalert("上传成功");
+  echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"setting.php\"</script>";
 
 }
 
 else
 
diff --git a/admin/download-plugin.php b/admin/download-plugin.php
deleted file mode 100644
index dc9b00a..0000000
--- a/admin/download-plugin.php
+++ /dev/null
@@ -1,100 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../plugin/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-
-
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
-    <div class="medium" style=" text-align:center;display: flex">
-
-        <div>
-            <div style="color:black;font-size: 20px;" class="mdui-typo">
-                <h1 style="font-weight: bold;">插件获取</h1>
-                <h5>插件名称：<?php echo $_GET["name"]; ?> </h5>
-                
-                <br>
-
-
-                <?php
-
-$arrContextOptions=array(
-    "ssl"=>array(
-        "verify_peer"=>false,
-        "verify_peer_name"=>false,
-    ),
-);  
-file_put_contents("../plugin/".$_GET["name"].".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/plugin/".$_GET["name"].".zip", false, stream_context_create($arrContextOptions)));
-            
-                require_once('pclzip.lib.php');
-
-                $zip = new PclZip("../plugin/".$_GET["name"].".zip");
-                $result = $zip->extract(PCLZIP_OPT_PATH, "../plugin/");
-                if ($result == 0) {
-                    echo '<br>输入错误';
-                    unlink("../plugin/" . $_GET["name"] . ".zip");
-                } else {
-                    echo '<br>导入成功';
-                    unlink("../plugin/" . $_GET["name"] . ".zip");
-                }
-
-                ?>
-            </div>
-
-        </div>
-    </div>
-
-    <script src="../../../../../../resource/js/mtu.min.js"></script>
-    <script src="../../../../../../resource/js/mdui.min.js"></script>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/admin/download-template.php b/admin/download-template.php
deleted file mode 100644
index f637f9c..0000000
--- a/admin/download-template.php
+++ /dev/null
@@ -1,100 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-
-
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
-    <div class="medium" style=" text-align:center;display: flex">
-
-        <div>
-            <div style="color:black;font-size: 20px;" class="mdui-typo">
-                <h1 style="font-weight: bold;">模板获取</h1>
-                <h5>模板名称：<?php echo $_GET["name"]; ?> </h5>
-                
-                <br>
-
-
-                <?php
-
-$arrContextOptions=array(
-    "ssl"=>array(
-        "verify_peer"=>false,
-        "verify_peer_name"=>false,
-    ),
-);  
-file_put_contents("../template/".$_GET["name"].".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/".$_GET["name"].".zip", false, stream_context_create($arrContextOptions)));
-            
-                require_once('pclzip.lib.php');
-
-                $zip = new PclZip("../template/" .$_GET["name"].".zip");
-                $result = $zip->extract(PCLZIP_OPT_PATH, "../template/");
-                if ($result == 0) {
-                    echo '<br>输入错误';
-                    unlink("../template/" . $_GET["name"] . ".zip");
-                } else {
-                    echo '<br>导入成功';
-                    unlink("../template/" . $_GET["name"] . ".zip");
-                }
-
-                ?>
-            </div>
-
-        </div>
-    </div>
-
-    <script src="../../../../../../resource/js/mtu.min.js"></script>
-    <script src="../../../../../../resource/js/mdui.min.js"></script>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/admin/drawer.php b/admin/drawer.php
index 879139e..cfffa95 100644
--- a/admin/drawer.php
+++ b/admin/drawer.php
@@ -1,9 +1,9 @@
 
 <div style="color:black;" class="mdui-drawer mdui-drawer-open mc-drawer" id="drawer">
     <ul class="mdui-list">
-        <a href="index.php">
+        <a href="../../admin/index.php">
             <li class="mdui-list-item mdui-ripple" style="font-size:15px!important">
                 <i class="mdui-list-item-icon mdui-icon material-icons">&#xe88a;</i>
                 <div class="mdui-list-item-content" style="font-size:15px!important">首页</div>
             </li>
         </a>
@@ -17,21 +17,21 @@
                             <i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
                         </div>
                     </li>
                 </div>
                 <div class="mdui-collapse-item-body mdui-list">
-                <a href="setting.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">基本设置</a>
-                <a href="server.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">服务设置</a>
-                <a href="mail.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">邮件设置</a>
-                <a href="rewrite.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">伪静态设置</a>
+                <a href="../../admin/config/setting.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">基本设置</a>
+                <a href="../../admin/config/server.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">服务设置</a>
+                <a href="../../admin/config/mail.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">邮件设置</a>
+                <a href="../../admin/config/rewrite.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">伪静态设置</a>
                 </div>
             </div>
         </div>
 
         <div class="mdui-divider"></div>
 
-        <a href="user.php">
+        <a href="../../admin/user/user.php">
             <li class="mdui-list-item mdui-ripple" style="font-size:15px!important">
             <i class="mdui-list-item-icon mdui-icon material-icons">&#xe853;</i>
                 <div class="mdui-list-item-content" style="font-size:15px!important">用户</div>
             </li>
         </a>
@@ -45,12 +45,12 @@
                             <i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
                         </div>
                     </li>
                 </div>
                 <div class="mdui-collapse-item-body mdui-list">
-                <a href="category.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">查看分类</a>
-                <a href="cate-add.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">新增分类</a>
+                <a href="../../admin/category/category.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">查看分类</a>
+                <a href="../../admin/category/cate-add.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">新增分类</a>
                 </div>
             </div>
         </div>
 
         <div class="mdui-collapse" mdui-collapse>
@@ -63,38 +63,50 @@
                             <i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
                         </div>
                     </li>
                 </div>
                 <div class="mdui-collapse-item-body mdui-list">
-                <a href="article.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">查看文章</a>
-                <a href="article-add.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">新增文章</a>
-                <a href="tool.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">小组件</a>
+                <a href="../../admin/article/article.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">查看文章</a>
+                <a href="../../admin/article/article-add.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">新增文章</a>
+                <a href="../../admin/article/tool.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">小组件</a>
                 </div>
             </div>
         </div>
 
-        <a href="temp.php">
+        <a href="../../admin/function/temp.php">
             <li class="mdui-list-item mdui-ripple" style="font-size:15px!important">
                 <i class="mdui-list-item-icon mdui-icon material-icons">&#xeb3f;</i>
                 <div class="mdui-list-item-content" style="font-size:15px!important">模板</div>
             </li>
         </a>
         
-        <a href="plugin.php">
+        <a href="../../admin/function/plugin.php">
             <li class="mdui-list-item mdui-ripple" style="font-size:15px!important">
                 <i class="mdui-list-item-icon mdui-icon material-icons">&#xe8b0;</i>
                 <div class="mdui-list-item-content" style="font-size:15px!important">插件</div>
             </li>
         </a>
 
         <div class="mdui-divider"></div>
-        <a href="movepass.php">
-            <li class="mdui-list-item mdui-ripple" style="font-size:15px!important">
-                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe22b;</i>
-                <div class="mdui-list-item-content" style="font-size:15px!important">修改密码</div>
-            </li>
-        </a>
+        <div class="mdui-collapse" mdui-collapse>
+            <div class="mdui-collapse-item">
+                <div class="mdui-collapse-item-header">
+                    <li class="mdui-collapse-item-header mdui-list-item mdui-ripple" style="font-size:15px!important">
+                    <i class="mdui-list-item-icon mdui-icon material-icons">assignment_ind</i>
+                        <div class="mdui-list-item-content" style="font-size:15px!important">账户</div>
+                        <div class="mdui-collapse-item-arrow">
+                            <i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
+                        </div>
+                    </li>
+                </div>
+                <div class="mdui-collapse-item-body mdui-list">
+                <a href="../../admin/admin_user/movepass.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">修改密码</a>
+                <a href="../../admin/admin_user/loginout.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">退出登录</a>
+                </div>
+            </div>
+        </div>
+
         <div class="mdui-collapse" mdui-collapse>
             <div class="mdui-collapse-item">
                 <div class="mdui-collapse-item-header">
                     <li class="mdui-collapse-item-header mdui-list-item mdui-ripple" style="font-size:15px!important">
                     <i class="mdui-list-item-icon mdui-icon material-icons">&#xe8b8;</i>
@@ -103,19 +115,19 @@
                             <i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
                         </div>
                     </li>
                 </div>
                 <div class="mdui-collapse-item-body mdui-list">
-                <a href="update.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">检查更新</a>
-                <a href="plus.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">高级功能</a>
-                <a href="about.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">关于</a>
+                <a href="../../admin/system/update.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">检查更新</a>
+                <a href="../../admin/function/plus.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">高级功能</a>
+                <a href="../../admin/system/about.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">关于</a>
                 </div>
             </div>
         </div>
-
+      
     </ul>
     <div class="mdui-typo" style="   padding: 20px 16px;">
         <h4> <small>© 2023 RapidTeam</small><br> <small>Powered by RapidTeam
             </small></h4>
 
     </div>
-</div>
\ No newline at end of file
+</div>
diff --git a/admin/function/backzip/backup.zip b/admin/function/backzip/backup.zip
new file mode 100644
index 0000000..1f811e0
Binary files /dev/null and b/admin/function/backzip/backup.zip differ
diff --git a/admin/function/download-plugin.php b/admin/function/download-plugin.php
new file mode 100644
index 0000000..5986f99
--- /dev/null
+++ b/admin/function/download-plugin.php
@@ -0,0 +1,48 @@
+<?php
+include("../header.php");
+
+?>
+    <div class="medium" style=" text-align:center;display: flex">
+
+        <div>
+            <div style="color:black;font-size: 20px;" class="mdui-typo">
+                <h1 style="font-weight: bold;">插件获取</h1>
+                <h5>插件名称：<?php echo $_GET["name"]; ?> </h5>
+                
+                <br>
+
+
+                <?php
+
+$arrContextOptions=array(
+    "ssl"=>array(
+        "verify_peer"=>false,
+        "verify_peer_name"=>false,
+    ),
+);  
+file_put_contents("../../plugin/".$_GET["name"].".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/plugin/".$_GET["name"].".zip", false, stream_context_create($arrContextOptions)));
+            
+require_once('../src/pclzip.lib.php');
+
+                $zip = new PclZip("../plugin/".$_GET["name"].".zip");
+                $result = $zip->extract(PCLZIP_OPT_PATH, "../plugin/");
+                if ($result == 0) {
+                    echo '<br>输入错误';
+                    unlink("../../plugin/" . $_GET["name"] . ".zip");
+                } else {
+                    echo '<br>导入成功';
+                    unlink("../../plugin/" . $_GET["name"] . ".zip");
+                }
+
+                ?>
+            </div>
+
+        </div>
+    </div>
+
+    <script src="../../../../../../resource/js/mtu.min.js"></script>
+    <script src="../../../../../../resource/js/mdui.min.js"></script>
+
+</body>
+
+</html>
\ No newline at end of file
diff --git a/admin/function/download-template.php b/admin/function/download-template.php
new file mode 100644
index 0000000..df48c73
--- /dev/null
+++ b/admin/function/download-template.php
@@ -0,0 +1,48 @@
+<?php
+include("../header.php");
+
+?>
+    <div class="medium" style=" text-align:center;display: flex">
+
+        <div>
+            <div style="color:black;font-size: 20px;" class="mdui-typo">
+                <h1 style="font-weight: bold;">模板获取</h1>
+                <h5>模板名称：<?php echo $_GET["name"]; ?> </h5>
+                
+                <br>
+
+
+                <?php
+
+$arrContextOptions=array(
+    "ssl"=>array(
+        "verify_peer"=>false,
+        "verify_peer_name"=>false,
+    ),
+);  
+file_put_contents("../../template/".$_GET["name"].".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/".$_GET["name"].".zip", false, stream_context_create($arrContextOptions)));
+            
+                require_once('../src/pclzip.lib.php');
+
+                $zip = new PclZip("../../template/" .$_GET["name"].".zip");
+                $result = $zip->extract(PCLZIP_OPT_PATH, "../template/");
+                if ($result == 0) {
+                    echo '<br>输入错误';
+                    unlink("../../template/" . $_GET["name"] . ".zip");
+                } else {
+                    echo '<br>导入成功';
+                    unlink("../../template/" . $_GET["name"] . ".zip");
+                }
+
+                ?>
+            </div>
+
+        </div>
+    </div>
+
+    <script src="../../../../../../resource/js/mtu.min.js"></script>
+    <script src="../../../../../../resource/js/mdui.min.js"></script>
+
+</body>
+
+</html>
\ No newline at end of file
diff --git a/admin/function/plugin-del.php b/admin/function/plugin-del.php
new file mode 100644
index 0000000..99c483a
--- /dev/null
+++ b/admin/function/plugin-del.php
@@ -0,0 +1,19 @@
+<?php
+include("../check.php");
+function removeDir($dirName)
+{
+    if (!is_dir($dirName)) {
+        return false;
+    }
+    $handle = @opendir($dirName);
+    while (($file = @readdir($handle)) !== false) {
+        if ($file != '.' && $file != '..') {
+            $dir = $dirName . '/' . $file;
+            is_dir($dir) ? removeDir($dir) : @unlink($dir);
+        }
+    }
+    closedir($handle);
+    @rmdir($dirName);
+}
+removeDir('../../plugin/' . $_GET["id"]);
+echo "<script type='text/javascript'>window.location.href='plugin.php'</script>";
\ No newline at end of file
diff --git a/admin/function/plugin-move.php b/admin/function/plugin-move.php
new file mode 100644
index 0000000..de0e3ce
--- /dev/null
+++ b/admin/function/plugin-move.php
@@ -0,0 +1,28 @@
+<?php
+include("../check.php");
+$json_string=file_get_contents('../../plugin/'. $_GET["id"]."/version.json");
+$row = json_decode($json_string, true);
+if($row["use"]==true){
+    $data = array();
+    $data['key'] =$row["key"];
+    $data['name'] = $row["name"];
+    $data['version'] = $row["version"];
+    $data['author'] = $row["author"];
+    $data['use'] = false;
+    $json_string = json_encode($data);
+    
+    file_put_contents('../../plugin/'. $_GET["id"]."/version.json", $json_string);
+
+   }else{
+    $data = array();
+    $data['key'] =$row["key"];
+    $data['name'] = $row["name"];
+    $data['version'] = $row["version"];
+    $data['author'] = $row["author"];
+    $data['use'] = true;
+    $json_string = json_encode($data);
+    
+    file_put_contents('../../plugin/'. $_GET["id"]."/version.json", $json_string);
+   }
+   echo "<script type='text/javascript'>window.location.href='plugin.php'</script>"
+?>
\ No newline at end of file
diff --git a/admin/function/plugin.php b/admin/function/plugin.php
new file mode 100644
index 0000000..3603bd8
--- /dev/null
+++ b/admin/function/plugin.php
@@ -0,0 +1,120 @@
+<?php
+include("../header.php");
+
+?>
+<script type="text/javascript" language="javascript">
+    function confirmAct() {
+        if (confirm('确定要删除插件吗?')) {
+            return true;
+        }
+        return false;
+    }
+
+    function confirmAct1() {
+        if (confirm('确定要禁用插件吗?')) {
+            return true;
+        }
+        return false;
+    }
+
+    function confirmAct2() {
+        if (confirm('确定要启用插件吗?')) {
+            return true;
+        }
+        return false;
+    }
+</script>
+<div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
+
+    <div class="mdui-card" style="overflow:scroll">
+
+        <div class="mdui-card-primary">
+            <div class="mdui-card-primary-title" style="font-size:30px;">插件设置</div>
+
+        </div>
+        <div class="mdui-divider"></div> <br>
+        <m-scrollbar style="height: 650px;width:900px;">
+
+            <form method="get" action="download-plugin.php" style="text-align:left;padding:0 0 0 250px">
+                <div style="  display: flex;gap: 47px;">
+
+                    <div>输入Key加载插件：<input style="width:300px" class="mdui-textfield-input" name="name" type="text" value="" required=""> </div>
+                    <div><button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
+                    </div>
+
+
+
+
+                </div>
+            </form>
+            <br>
+            <div class="mdui-divider"></div> <br>
+            <div style="width:90%;position: absolute;left: 50%;    transform: translateX(-50%  );" class="mdui-table-fluid">
+
+                <table class="mdui-table">
+                    <thead>
+                        <tr>
+                            <th>ID-Key</th>
+                            <th>名称</th>
+                            <th>版本</th>
+                            <th>作者</th>
+                            <th>状态</th>
+                            <th class="mdui-table-col-numeric"> </th>
+                        </tr>
+                    </thead>
+                    <tbody>
+
+                        <?php
+
+
+
+
+                        $file = scandir("../../plugin");
+
+                        for ($i = 2; $i < count($file); $i++) {
+                            if ($file[$i] == ".gitkeep") {
+                            } else {
+                                $json_string = file_get_contents('../../plugin/' . $file[$i] . "/version.json");
+                                $row = json_decode($json_string, true);
+                                echo "<tr>";
+                                echo "</tr>";
+                                echo "<td>" . $row["key"] . "</td>";
+                                echo "<td>" . $row["name"] . "</td>";
+                                echo "<td>" . $row["version"] . "</td>";
+                                echo "<td>" . $row["author"] . "</td>";
+                                if ($row["use"] == true) {
+                                    echo "<td style='color:green'><strong>启用</strong></td>";
+                                    echo '<td><a target="_blank" href="' . '../../plugin/' . $file[$i] . "/setting.php" . '"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
+                                    echo '<a onclick="return confirmAct1();" href="plugin-move.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe644;</i></button></a>';
+                                } else {
+                                    echo "<td style='color:red'><strong>禁用</strong></td>";
+                                    echo '<td><a target="_blank" href="' . '../../plugin/' . $file[$i] . "/setting.php" . '"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
+                                    echo '<a onclick="return confirmAct2();" href="plugin-move.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe86c;</i></button></a>';
+                                }
+
+
+                                echo '<a onclick="return confirmAct();" href="plugin-del.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe872;</i></button></a>&nbsp;';
+
+                                echo "</td>";
+                            }
+                        }
+
+
+
+                        ?>
+
+
+                    </tbody>
+                </table>
+            </div>
+        </m-scrollbar>
+
+    </div>
+
+</div>
+
+<script src="../../../../../../resource/js/mtu.min.js"></script>
+<script src="../../../../../../resource/js/mdui.min.js"></script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/admin/plus-back-run.php b/admin/function/plus-back-run.php
similarity index 77%
rename from admin/plus-back-run.php
rename to admin/function/plus-back-run.php
index 9db8d07..057858c 100644
--- a/admin/plus-back-run.php
+++ b/admin/function/plus-back-run.php
@@ -1,42 +1,20 @@
 <?php
 deldir('./backzip/');
 rmdir('./backzip/');
 
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
+include("../check.php");
 $ran12 = rand() * 10;
 $dir = './backup/';
 mkdir($dir);
 chmod($dir, 0755);
 
 
 header("Content-type:text/html;charset=utf-8");
 
 
-$json_string = file_get_contents(BASE_PATH1 . 'install/sql-config/sql.json');
+$json_string = file_get_contents('../../install/sql-config/sql.json');
 $data = json_decode($json_string, true);
 $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
 $sql = 'select * from `rapidcmschat` ORDER BY time DESC';
 $res = mysqli_query($conn, $sql);
 $row = mysqli_num_rows($res);
@@ -117,11 +95,11 @@ function deldir($path)
 deldir('./backzip/');
 rmdir('./backzip/');
 $dir1 = 'backzip';
 mkdir($dir1);
 chmod($dir1, 0755);
-copydir("../resource/config", $dir . "config");
+copydir("../../resource/config", $dir . "config");
 
 
 
     
 /**
diff --git a/admin/plus-back-upload-sql.php b/admin/function/plus-back-upload-sql.php
similarity index 88%
rename from admin/plus-back-upload-sql.php
rename to admin/function/plus-back-upload-sql.php
index d7ad05d..e9124da 100644
--- a/admin/plus-back-upload-sql.php
+++ b/admin/function/plus-back-upload-sql.php
@@ -1,8 +1,9 @@
 <?php
-include("../resource/variable.php");
-require_once('pclzip.lib.php');
+
+include("../check.php");
+require_once('../src/pclzip.lib.php');
 
 
 $json_string = file_get_contents('../install/sql-config/sql.json');
 $dataxxx = json_decode($json_string, true);
 $link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword'],$dataxxx['dbname']);
diff --git a/admin/plus-back-upload.php b/admin/function/plus-back-upload.php
similarity index 88%
rename from admin/plus-back-upload.php
rename to admin/function/plus-back-upload.php
index 9474a8f..e3b7ca3 100644
--- a/admin/plus-back-upload.php
+++ b/admin/function/plus-back-upload.php
@@ -1,7 +1,7 @@
 <?php
-require_once('pclzip.lib.php');
+require_once('../src/pclzip.lib.php');
 $fileInfo = $_FILES['file'];
 $name = $fileInfo['name'];
 $pathname = pathinfo($name)["extension"];
 $filename =  pathinfo($name, PATHINFO_FILENAME);
 $filePath = $fileInfo['tmp_name'];
diff --git a/admin/plus-shark-run.php b/admin/function/plus-shark-run.php
similarity index 85%
rename from admin/plus-shark-run.php
rename to admin/function/plus-shark-run.php
index 0650d4d..6617816 100644
--- a/admin/plus-shark-run.php
+++ b/admin/function/plus-shark-run.php
@@ -1,11 +1,12 @@
 <?php
-include("../resource/variable.php");
+
+include("../check.php");
 error_reporting(0);
 header("Content-type:text/html;charset=utf-8");
 $table_name = "sk_content";
-$json_string = file_get_contents('../install/sql-config/sql.json');
+$json_string = file_get_contents('../../install/sql-config/sql.json');
 $data = json_decode($json_string, true);
 $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
 $sql = 'select * from `' . $table_name . '`';
 $res = mysqli_query($conn, $sql);
 $colums = mysqli_num_fields($res);
diff --git a/admin/function/plus-shark.php b/admin/function/plus-shark.php
new file mode 100644
index 0000000..c657bce
--- /dev/null
+++ b/admin/function/plus-shark.php
@@ -0,0 +1,37 @@
+<?php
+include("../header.php");
+
+?>
+    <br><br>
+    <div style=" position:  relative;left:15%">
+        <div class="mdui-card" style="width:70%;height:300px; ">
+            <div class="mdui-card-primary" style="text-align:center;">
+                <div class="mdui-card-primary-title" style="font-size:30px">从SharkCMS迁移数据</div>
+            </div>
+            <br>
+            <label class="mdui-textfield-label">&nbsp;&nbsp;&nbsp;选择导入方式</label>
+            &nbsp;&nbsp;&nbsp;
+            <label class="mdui-radio">
+                <input type="radio" name="group1" checked />
+                <i class="mdui-radio-icon"></i>
+                从本程序所在数据库导入
+            </label>
+
+            <label class="mdui-radio">
+                <input type="radio" name="group1" disabled />
+                <i class="mdui-radio-icon"></i>
+                从其他数据库导入（暂不支持）
+            </label>
+            <br>  <br>
+            &nbsp;&nbsp;&nbsp;<a href="plus-shark-run.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-text-color-black action-btn">一键导入文章</button></a>
+       
+        </div>
+    </div>
+    <br>
+
+    <script src="../../../../../../resource/js/mtu.min.js"></script>
+    <script src="../../../../../../resource/js/mdui.min.js"></script>
+
+</body>
+
+</html>
\ No newline at end of file
diff --git a/admin/function/plus.php b/admin/function/plus.php
new file mode 100644
index 0000000..bfdbff3
--- /dev/null
+++ b/admin/function/plus.php
@@ -0,0 +1,40 @@
+<?php
+include("../header.php");
+
+?>
+    <br><br>
+    <div style=" position:  relative;left:15%">
+        <div class="mdui-card" style="width:70%;height:300px; ">
+            <div class="mdui-card-primary" style="text-align:center;">
+                <div class="mdui-card-primary-title" style="font-size:30px">数据设置</div>
+            </div>
+            <div class="mdui-tab" mdui-tab>
+                <a href="#move1" class="mdui-ripple">备份数据</a>
+                <a href="#move2" class="mdui-ripple">导入备份</a>
+           <a href="#move3" class="mdui-ripple">迁移数据</a> 
+            </div>
+            <div id="move1" class="mdui-p-a-2">
+            <label class="mdui-textfield-label">备份系统数据，树立安全意识</label>
+               
+                <a href="plus-back-run.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">备份数据</button></a>
+           </div>
+            <div id="move2" class="mdui-p-a-2">
+            <label class="mdui-textfield-label">配置文件暂不支持，请解压后手动复制粘贴</label>
+            
+           <!--    <form enctype="multipart/form-data" id="fileupdateform" method="post" action="plus-back-upload-sql.php"><button for="file" onclick="document.getElementById('file').click()" type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">导入.sql文件</button><br>                    <input style="display: none;" onchange="document.getElementById('fileupdateform').submit()"   name="file"  id="file" type="file" required=""></form>
+    --></div>
+           <div id="move3" class="mdui-p-a-2">
+            <label class="mdui-textfield-label">迁移其他数据，便捷导入内容</label>
+                   <a href="plus-shark.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-text-color-black action-btn">从SharkCMS迁移数据</button></a>
+       
+            </div>
+         </div>
+    </div>
+    <br>
+
+    <script src="../../../../../../resource/js/mtu.min.js"></script>
+    <script src="../../../../../../resource/js/mdui.min.js"></script>
+
+</body>
+
+</html>
\ No newline at end of file
diff --git a/admin/function/temp-run.php b/admin/function/temp-run.php
new file mode 100644
index 0000000..90ab05d
--- /dev/null
+++ b/admin/function/temp-run.php
@@ -0,0 +1,13 @@
+<?php
+include("../check.php");
+$data1 = array();
+$data1['template'] = $_POST["template"];
+$data1['version'] = $data_index["version"];
+$data1['rewrite'] = $data_index["rewrite"];
+$data1['close'] = $data_index["close"];
+$json_string1 = json_encode($data1);
+$filename1 = '../../resource/config/index.json';
+$fp1 = fopen($filename1, "w");
+$len1 = fwrite($fp1, $json_string1);
+fclose($fp1);
+sendalert("修改成功！");
\ No newline at end of file
diff --git a/admin/function/temp.php b/admin/function/temp.php
new file mode 100644
index 0000000..9ed13c8
--- /dev/null
+++ b/admin/function/temp.php
@@ -0,0 +1,55 @@
+<?php
+include("../header.php");
+
+?>
+    <div style=" position:  relative;left:25%;top:10%">
+
+
+        <div class="mdui-card" style="width:600px">
+
+            <div class="mdui-card-primary">
+                <div class="mdui-card-primary-title" style="font-size:30px">设置模板</div>
+            </div>
+            <m-scrollbar style="font-size:15px;height: 400px">
+                <div class="mdui-card-content" style="font-size:18px;text-align:left">
+                    当前模板：<? echo $data_index["template"] ?>
+                    &nbsp;&nbsp;&nbsp;          &nbsp;&nbsp;&nbsp;          &nbsp;&nbsp;     <a  target="_blank" href="../../../../template/<? echo $data_index["template"] ?>/setting.php"><button type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">模板单独设置</button></a><br><br>
+                    <form method="post" action="temp-run.php"> 切换模板：
+                        <select class="mdui-select" name="template" mdui-select>
+
+
+
+                            <?php
+
+                            $file = scandir("../../template");
+
+                            for ($i = 2; $i < count($file); $i++) {
+                                echo '  <option value="' . $file[$i] . '">' . $file[$i] . '</option>';
+                            }
+                            ?></select>
+                        &nbsp;&nbsp;&nbsp;
+                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
+                    </form>
+                    <form method="get" action="download-template.php"> 输入Key加载模板：
+                      <div style="display: inline;">  
+                    <input style="width:300px" class="mdui-textfield-input" name="name" type="text"
+                                value="" required="">
+                                <br>
+                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
+                        </div>
+                    </form>
+                    <a  target="_blank" href="https://www.yuque.com/rapid/cms/yo0y1er0vg6rl86g"><button type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">进入文档获取模板</button><br><br></a>
+                     
+
+                </div>
+            </m-scrollbar>
+
+        </div>
+    </div>
+
+    <script src="../../../../../../resource/js/mtu.min.js"></script>
+    <script src="../../../../../../resource/js/mdui.min.js"></script>
+
+</body>
+
+</html>
\ No newline at end of file
diff --git a/admin/header.php b/admin/header.php
new file mode 100644
index 0000000..cb9de9a
--- /dev/null
+++ b/admin/header.php
@@ -0,0 +1,30 @@
+<? include("check.php"); ?>
+
+<!DOCTYPE html>
+<html lang="zh-cn">
+
+<head>
+    <meta charset="utf-8">
+    <title>RapidCMS管理后台</title>
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width,initial-scale=1">
+    <link rel="shortcut icon"" href=" ../../../resource/img/icon.png" type="image/x-icon" />
+    <link rel="stylesheet" href="../../../../resource/css/mdui.min.css" />
+    <link rel="stylesheet" href="../../../resource/css/mtu.min.css">
+    <link rel="stylesheet" href="../../../resource/css/style.css">
+    <link rel="stylesheet" href="../../../template/default/theme.css">
+    
+</head>
+
+<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
+    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
+        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
+        <span class="mdui-typo-title">RapidCMS 管理后台</span>
+    </div>
+
+    <? include("../drawer.php"); ?>
+    <style>
+        * {
+            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
+        }
+    </style>
\ No newline at end of file
diff --git a/admin/index.php b/admin/index.php
index 5901d8f..5f6ca86 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -7,22 +7,20 @@ function encode($string = '', $skey = 'cxphp')
     foreach (str_split($skey) as $key => $value)
         $key < $strCount && $strArr[$key] .= $value;
     return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
 }
 
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
+$json_string = file_get_contents('../install/sql-config/sql.json');
 $dataxxx = json_decode($json_string, true);
 $link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
 $sql = "select password from `rapidcmsadmin` where username=\"admin\"";
 $result = mysqli_query($link, $sql);
 $pass = mysqli_fetch_row($result);
 $pa = $pass[0];
 
 if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: ./login.php");
+    Header("Location: admin_user/login.php");
 }
 
 ?>
 
 <!DOCTYPE html>
diff --git a/admin/movepass.php b/admin/movepass.php
deleted file mode 100644
index eb5cd79..0000000
--- a/admin/movepass.php
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
-    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
-
-        <div class="mdui-card">
-
-            <div class="mdui-card-primary">
-                <div class="mdui-card-primary-title" style="font-size:30px">修改管理员密码</div>
-            </div>
-            <form method="post" action="run-movepass.php">
-                <m-scrollbar style="height: 300px;width:900px">
-                    <div class="mdui-card-content" style="font-size:15px;text-align:left">
-                        <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
-                            <label class="mdui-textfield-label">输入密码</label>
-                            <input class="mdui-textfield-input" name="password" type="password"
-                              required="">
-                              <div class="mdui-textfield-error">密码不能为空</div>
-                        </div>
-                        <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
-                            <label class="mdui-textfield-label">重复密码</label>
-                            <input class="mdui-textfield-input" name="password2" type="password"
-                               required="">
-                               <div class="mdui-textfield-error">重复密码不能为空</div>
-                        </div>
-                      
-                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">提交</button>
-
-                    </div>
-                </m-scrollbar>
-            </form>
-        </div>
-       
-    </div>
-
-    <script src="../../../../../../resource/js/mtu.min.js"></script>
-    <script src="../../../../../../resource/js/mdui.min.js"></script>
-</body>
-
-</html>
\ No newline at end of file
diff --git a/admin/plugin-del.php b/admin/plugin-del.php
deleted file mode 100644
index e4c0933..0000000
--- a/admin/plugin-del.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-
-function removeDir($dirName)
-{
-    if (!is_dir($dirName)) {
-        return false;
-    }
-    $handle = @opendir($dirName);
-    while (($file = @readdir($handle)) !== false) {
-        if ($file != '.' && $file != '..') {
-            $dir = $dirName . '/' . $file;
-            is_dir($dir) ? removeDir($dir) : @unlink($dir);
-        }
-    }
-    closedir($handle);
-    @rmdir($dirName);
-}
-removeDir('../plugin/' . $_GET["id"]);
-echo "<script type='text/javascript'>window.location.href='plugin.php'</script>";
\ No newline at end of file
diff --git a/admin/plugin-move.php b/admin/plugin-move.php
deleted file mode 100644
index 4241ff5..0000000
--- a/admin/plugin-move.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-$json_string=file_get_contents('../plugin/'. $_GET["id"]."/version.json");
-$row = json_decode($json_string, true);
-if($row["use"]==true){
-    $data = array();
-    $data['key'] =$row["key"];
-    $data['name'] = $row["name"];
-    $data['version'] = $row["version"];
-    $data['author'] = $row["author"];
-    $data['use'] = false;
-    $json_string = json_encode($data);
-    
-    file_put_contents('../plugin/'. $_GET["id"]."/version.json", $json_string);
-
-   }else{
-    $data = array();
-    $data['key'] =$row["key"];
-    $data['name'] = $row["name"];
-    $data['version'] = $row["version"];
-    $data['author'] = $row["author"];
-    $data['use'] = true;
-    $json_string = json_encode($data);
-    
-    file_put_contents('../plugin/'. $_GET["id"]."/version.json", $json_string);
-   }
-   echo "<script type='text/javascript'>window.location.href='plugin.php'</script>"
-?>
\ No newline at end of file
diff --git a/admin/plugin.php b/admin/plugin.php
deleted file mode 100644
index 5ae2b49..0000000
--- a/admin/plugin.php
+++ /dev/null
@@ -1,174 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-
-    <script type="text/javascript" language="javascript">
-        function confirmAct() {
-            if (confirm('确定要删除插件吗?')) {
-                return true;
-            }
-            return false;
-        }
-
-        function confirmAct1() {
-            if (confirm('确定要禁用插件吗?')) {
-                return true;
-            }
-            return false;
-        }
-
-        function confirmAct2() {
-            if (confirm('确定要启用插件吗?')) {
-                return true;
-            }
-            return false;
-        }
-    </script>
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
-    
-    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
-
-        <div class="mdui-card" style="overflow:scroll">
-
-            <div class="mdui-card-primary">
-                <div class="mdui-card-primary-title" style="font-size:30px;">插件设置</div>
-
-            </div> 
-            <div class="mdui-divider"></div> <br>
-            <m-scrollbar style="height: 650px;width:900px;">
-          
-            <form method="get" action="download-plugin.php" style="text-align:left;padding:0 0 0 250px">
-                    <div style="  display: flex;gap: 47px;">
-
-                        <div>输入Key加载插件：<input style="width:300px" class="mdui-textfield-input" name="name" type="text" value="" required=""> </div>
-                        <div><button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
-                        </div>
-
-
-
-
-                    </div>
-                </form>
-                <br>
-                <div class="mdui-divider"></div>  <br>
-                <div style="width:90%;position: absolute;left: 50%;    transform: translateX(-50%  );" class="mdui-table-fluid">
-
-                    <table class="mdui-table">
-                        <thead>
-                            <tr>
-                                <th>ID-Key</th>
-                                <th>名称</th>
-                                <th>版本</th>
-                                <th>作者</th>
-                                <th>状态</th>
-                                <th class="mdui-table-col-numeric"> </th>
-                            </tr>
-                        </thead>
-                        <tbody>
-
-                            <?php
-
-
-
-
-                            $file = scandir("../plugin");
-
-                            for ($i = 2; $i < count($file); $i++) {
-                                if($file[$i]==".gitkeep"){
-                                    
-                                }else{
-                                    $json_string = file_get_contents('../plugin/' . $file[$i] . "/version.json");
-                                    $row = json_decode($json_string, true);
-                                    echo "<tr>";
-                                    echo "</tr>";
-                                    echo "<td>" . $row["key"] . "</td>";
-                                    echo "<td>" . $row["name"] . "</td>";
-                                    echo "<td>" . $row["version"] . "</td>";
-                                    echo "<td>" . $row["author"] . "</td>";
-                                    if ($row["use"] == true) {
-                                        echo "<td style='color:green'><strong>启用</strong></td>";
-                                        echo '<td><a target="_blank" href="' . '../plugin/' . $file[$i] . "/setting.php" . '"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
-                                        echo '<a onclick="return confirmAct1();" href="plugin-move.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe644;</i></button></a>';
-                                    } else {
-                                        echo "<td style='color:red'><strong>禁用</strong></td>";
-                                        echo '<td><a target="_blank" href="' . '../plugin/' . $file[$i] . "/setting.php" . '"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
-                                        echo '<a onclick="return confirmAct2();" href="plugin-move.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe86c;</i></button></a>';
-                                    }
-    
-    
-                                    echo '<a onclick="return confirmAct();" href="plugin-del.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe872;</i></button></a>&nbsp;';
-    
-                                    echo "</td>";
-                                }
-                         
-                            }
-
-
-
-                            ?>
-
-
-                        </tbody>
-                    </table>
-                </div>
-            </m-scrollbar>
-
-        </div>
-
-    </div>
-
-    <script src="../../../../../../resource/js/mtu.min.js"></script>
-    <script src="../../../../../../resource/js/mdui.min.js"></script>
-</body>
-
-</html>
\ No newline at end of file
diff --git a/admin/plus-shark.php b/admin/plus-shark.php
deleted file mode 100644
index 7885f8c..0000000
--- a/admin/plus-shark.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
-    <br><br>
-    <div style=" position:  relative;left:15%">
-        <div class="mdui-card" style="width:70%;height:300px; ">
-            <div class="mdui-card-primary" style="text-align:center;">
-                <div class="mdui-card-primary-title" style="font-size:30px">从SharkCMS迁移数据</div>
-            </div>
-            <br>
-            <label class="mdui-textfield-label">&nbsp;&nbsp;&nbsp;选择导入方式</label>
-            &nbsp;&nbsp;&nbsp;
-            <label class="mdui-radio">
-                <input type="radio" name="group1" checked />
-                <i class="mdui-radio-icon"></i>
-                从本程序所在数据库导入
-            </label>
-
-            <label class="mdui-radio">
-                <input type="radio" name="group1" disabled />
-                <i class="mdui-radio-icon"></i>
-                从其他数据库导入（暂不支持）
-            </label>
-            <br>  <br>
-            &nbsp;&nbsp;&nbsp;<a href="plus-shark-run.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-text-color-black action-btn">一键导入文章</button></a>
-       
-        </div>
-    </div>
-    <br>
-
-    <script src="../../../../../../resource/js/mtu.min.js"></script>
-    <script src="../../../../../../resource/js/mdui.min.js"></script>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/admin/plus.php b/admin/plus.php
deleted file mode 100644
index ec7ff85..0000000
--- a/admin/plus.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
-    <br><br>
-    <div style=" position:  relative;left:15%">
-        <div class="mdui-card" style="width:70%;height:300px; ">
-            <div class="mdui-card-primary" style="text-align:center;">
-                <div class="mdui-card-primary-title" style="font-size:30px">数据设置</div>
-            </div>
-            <div class="mdui-tab" mdui-tab>
-                <a href="#move1" class="mdui-ripple">备份数据</a>
-                <a href="#move2" class="mdui-ripple">导入备份</a>
-           <a href="#move3" class="mdui-ripple">迁移数据</a> 
-            </div>
-            <div id="move1" class="mdui-p-a-2">
-            <label class="mdui-textfield-label">备份系统数据，树立安全意识</label>
-               
-                <a href="plus-back-run.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">备份数据</button></a>
-           </div>
-            <div id="move2" class="mdui-p-a-2">
-            <label class="mdui-textfield-label">配置文件暂不支持，请解压后手动复制粘贴</label>
-            
-           <!--    <form enctype="multipart/form-data" id="fileupdateform" method="post" action="plus-back-upload-sql.php"><button for="file" onclick="document.getElementById('file').click()" type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">导入.sql文件</button><br>                    <input style="display: none;" onchange="document.getElementById('fileupdateform').submit()"   name="file"  id="file" type="file" required=""></form>
-    --></div>
-           <div id="move3" class="mdui-p-a-2">
-            <label class="mdui-textfield-label">迁移其他数据，便捷导入内容</label>
-                   <a href="plus-shark.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-text-color-black action-btn">从SharkCMS迁移数据</button></a>
-       
-            </div>
-         </div>
-    </div>
-    <br>
-
-    <script src="../../../../../../resource/js/mtu.min.js"></script>
-    <script src="../../../../../../resource/js/mdui.min.js"></script>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/admin/run-close.php b/admin/run-close.php
deleted file mode 100644
index 91bd506..0000000
--- a/admin/run-close.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-$data1 = array();
-if($_POST["close"]=="on"){
-    $data1['close'] = "true";
-}else{
-    $data1['close'] = "false";
-}
-$data1['template'] = $data_index["template"];
-$data1['version'] = $data_index["version"];
-$data1['rewrite'] = $data_index["rewrite"];
-
-$json_string1 = json_encode($data1);
-$filename1 = '../resource/config/index.json';
-$fp1 = fopen($filename1, "w");
-$len1 = fwrite($fp1, $json_string1);
-fclose($fp1);
-sendalert("修改成功！");
\ No newline at end of file
diff --git a/admin/run-mail.php b/admin/run-mail.php
deleted file mode 100644
index 40ba428..0000000
--- a/admin/run-mail.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-$data1 = array();
-if($_POST["logonwithmail"]=="on"){
-    $data1['logonwithmail'] = "true";
-}else{
-    $data1['logonwithmail'] = "false";
-}
-$data1['smtp'] = $_POST["smtp"];
-$data1['secure'] = $_POST["secure"];
-$data1['port'] = $_POST["port"];
-$data1['username'] = $_POST["username"];
-$data1['password'] = $_POST["password"];
-$json_string1 = json_encode($data1);
-$filename1 = '../resource/config/mail.json';
-$fp1 = fopen($filename1, "w");
-$len1 = fwrite($fp1, $json_string1);
-fclose($fp1);
-sendalert("修改成功！");
\ No newline at end of file
diff --git a/admin/run-rewrite.php b/admin/run-rewrite.php
deleted file mode 100644
index 729cd5e..0000000
--- a/admin/run-rewrite.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-$data1 = array();
-if($_POST["rewrite"]=="on"){
-    $data1['rewrite'] = "true";
-}else{
-    $data1['rewrite'] = "false";
-}
-$data1['template'] = $data_index["template"];
-$data1['version'] = $data_index["version"];
-$data1['close'] = $data_index["close"];
-
-$json_string1 = json_encode($data1);
-$filename1 = '../resource/config/index.json';
-$fp1 = fopen($filename1, "w");
-$len1 = fwrite($fp1, $json_string1);
-fclose($fp1);
-sendalert("修改成功！");
\ No newline at end of file
diff --git a/admin/run-setting.php b/admin/run-setting.php
deleted file mode 100644
index b74dd5a..0000000
--- a/admin/run-setting.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-$data1 = array();
-$data1['headname'] = $_POST["headname"];
-$data1['title'] = $_POST["title"];
-$data1['icon'] =  $data_header["icon"];
-$data1['description'] = $_POST["description"];
-$data1['keywords'] = $_POST["keywords"];
-$data1['introduce'] = $_POST["introduce"];
-$data1['con'] = $_POST["con"];
-$json_string1 = json_encode($data1);
-$filename1 = '../resource/config/header.json';
-$fp1 = fopen($filename1, "w");
-$len1 = fwrite($fp1, $json_string1);
-fclose($fp1);
-sendalert("修改成功");
diff --git a/admin/run-tool.php b/admin/run-tool.php
deleted file mode 100644
index 4a0f4c0..0000000
--- a/admin/run-tool.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-$data1 = array();
-if($_POST["tool"]=="on"){
-    $data1['tool'] = "true";
-}else{
-    $data1['tool'] = "false";
-}
-$data1['kind'] = $_POST["kind"];
-if ($_POST["kind"] == "one") {
-    $data1['content'] = '<center><p id="hitokoto"><a style="color:#000000" href="#" id="hitokoto_text">获取中...</a></p></center><script>fetch(\'https://v1.hitokoto.cn\').then(response => response.json()).then(data => {const hitokoto = document.querySelector(\'#hitokoto_text\');hitokoto.href = \'https://hitokoto.cn/?uuid=\' + data.uuid;
-        if (data.from_who == null) {
-        hitokoto.innerHTML = "「 " + data.hitokoto + " 」<br>——" + data.from;
-        }else {
-        hitokoto.innerHTML = "「 " + data.hitokoto + " 」<br>——" + data.from_who + "「" + data.from + "」"
-        }}).catch(console.error)
-        </script>';
-} else {
-    $data1['content'] = $_POST["content"];
-}
-
-
-$json_string1 = json_encode($data1);
-$filename1 = '../resource/config/tool.json';
-$fp1 = fopen($filename1, "w");
-$len1 = fwrite($fp1, $json_string1);
-fclose($fp1);
-echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"tool.php\"</script>";
diff --git a/admin/server.php b/admin/server.php
deleted file mode 100644
index 01ebd64..0000000
--- a/admin/server.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
-    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
-
-
-        <div class="mdui-card" style="width:900px">
-
-            <div class="mdui-card-primary">
-                <div class="mdui-card-primary-title" style="font-size:30px">网站服务设置</div>
-            </div>
-            <form method="post" action="run-close.php">
-            <div class="mdui-card-content" style="font-size:15px;text-align:left">
-            <label class="mdui-switch">
-                            启用网页维护&nbsp;&nbsp;&nbsp;
-                            <input <?
-                                    if ($data_index["close"]  == "true") {
-                                        echo " checked='true'";
-                                    }
-                                    ?> name="close" type="checkbox" />
-                            <i class="mdui-switch-icon"></i>
-                        </label> 
-                        <br> <br>
-                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">确认</button>
-                  
-            </div>
-            </form>
-        </div>
-        <br>
-    </div>
-
-    <script src="../../../../../../resource/js/mtu.min.js"></script>
-    <script src="../../../../../../resource/js/mdui.min.js"></script>
-</body>
-
-</html>
\ No newline at end of file
diff --git a/admin/mdui-editor/js/editor.js b/admin/src/mdui-editor/js/editor.js
similarity index 100%
rename from admin/mdui-editor/js/editor.js
rename to admin/src/mdui-editor/js/editor.js
diff --git a/admin/pclzip.lib.php b/admin/src/pclzip.lib.php
similarity index 100%
rename from admin/pclzip.lib.php
rename to admin/src/pclzip.lib.php
diff --git a/admin/system/about.php b/admin/system/about.php
new file mode 100644
index 0000000..02af325
--- /dev/null
+++ b/admin/system/about.php
@@ -0,0 +1,21 @@
+<?php
+include("../header.php");
+
+?>
+<div class="medium" style=" text-align:center;display: flex;gap: 47px;">
+    <img style="Border-radius:10px" width="200px" src="../../../upload/logo.png">
+    <div>
+        <div style="color:black;font-size: 20px;" class="mdui-typo">
+            <h1 style="font-weight: bold;">RapidCMS</h1>
+        </div>
+        <div style="color:black;font-size: 10px;" class="mdui-typo">
+            <h1>简单好用的官网CMS系统</h1>
+        </div>
+    </div>
+</div>
+
+<script src="../../../../../../resource/js/mtu.min.js"></script>
+<script src="../../../../../../resource/js/mdui.min.js"></script>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/admin/system/update-run.php b/admin/system/update-run.php
new file mode 100644
index 0000000..ad39b5f
--- /dev/null
+++ b/admin/system/update-run.php
@@ -0,0 +1,48 @@
+<?php
+include("../header.php");
+
+?>
+    <div class="medium" style=" text-align:center;display: flex">
+
+        <div>
+            <div style="color:black;font-size: 20px;" class="mdui-typo">
+                <h1 style="font-weight: bold;">版本更新</h1>
+                <h5>正在更新中，版本：<?php echo $_GET["version"]; ?> </h5>
+
+                <br>
+
+
+                <?php
+
+                $arrContextOptions = array(
+                    "ssl" => array(
+                        "verify_peer" => false,
+                        "verify_peer_name" => false,
+                    ),
+                );
+                file_put_contents("../../upload/" . $_GET["version"] . ".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/version/" . $_GET["version"] . ".zip", false, stream_context_create($arrContextOptions)));
+
+                require_once('../src/pclzip.lib.php');
+
+                $zip = new PclZip("../../upload/" . $_GET["version"] . ".zip");
+                $result = $zip->extract(PCLZIP_OPT_PATH, "../");
+                if ($result == 0) {
+                    echo '<br>更新失败';
+                    unlink("../../upload/" . $_GET["version"] . ".zip");
+                } else {
+                    echo '<br>更新成功';
+                    unlink("../../upload/" . $_GET["version"] . ".zip");
+                }
+
+                ?>
+            </div>
+
+        </div>
+    </div>
+
+    <script src="../../../../../../resource/js/mtu.min.js"></script>
+    <script src="../../../../../../resource/js/mdui.min.js"></script>
+
+</body>
+
+</html>
\ No newline at end of file
diff --git a/admin/update.php b/admin/system/update.php
similarity index 51%
rename from admin/update.php
rename to admin/system/update.php
index fe1ce8b..34c49bb 100644
--- a/admin/update.php
+++ b/admin/system/update.php
@@ -1,60 +1,9 @@
 <?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
+include("../header.php");
 
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
 ?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
     <div style=" position:  relative;left:15%">
     <br><br>
         <div class="mdui-card" style="width:70%;height:300px; ">
             <div class="mdui-card-primary" style="text-align:center;">
                 <div class="mdui-card-primary-title" style="font-size:30px">版本更新</div>
diff --git a/admin/temp-run.php b/admin/temp-run.php
deleted file mode 100644
index 783807a..0000000
--- a/admin/temp-run.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-$data1 = array();
-$data1['template'] = $_POST["template"];
-$data1['version'] = $data_index["version"];
-$data1['rewrite'] = $data_index["rewrite"];
-$data1['close'] = $data_index["close"];
-$json_string1 = json_encode($data1);
-$filename1 = '../resource/config/index.json';
-$fp1 = fopen($filename1, "w");
-$len1 = fwrite($fp1, $json_string1);
-fclose($fp1);
-sendalert("修改成功！");
\ No newline at end of file
diff --git a/admin/temp.php b/admin/temp.php
deleted file mode 100644
index f823525..0000000
--- a/admin/temp.php
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
-    <div style=" position:  relative;left:25%;top:10%">
-
-
-        <div class="mdui-card" style="width:600px">
-
-            <div class="mdui-card-primary">
-                <div class="mdui-card-primary-title" style="font-size:30px">设置模板</div>
-            </div>
-            <m-scrollbar style="font-size:15px;height: 400px">
-                <div class="mdui-card-content" style="font-size:18px;text-align:left">
-                    当前模板：<? echo $data_index["template"] ?>
-                    &nbsp;&nbsp;&nbsp;          &nbsp;&nbsp;&nbsp;          &nbsp;&nbsp;     <a  target="_blank" href="../../../../template/<? echo $data_index["template"] ?>/setting.php"><button type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">模板单独设置</button></a><br><br>
-                    <form method="post" action="temp-run.php"> 切换模板：
-                        <select class="mdui-select" name="template" mdui-select>
-
-
-
-                            <?php
-
-                            $file = scandir("../template");
-
-                            for ($i = 2; $i < count($file); $i++) {
-                                echo '  <option value="' . $file[$i] . '">' . $file[$i] . '</option>';
-                            }
-                            ?></select>
-                        &nbsp;&nbsp;&nbsp;
-                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
-                    </form>
-                    <form method="get" action="download-template.php"> 输入Key加载模板：
-                      <div style="display: inline;">  
-                    <input style="width:300px" class="mdui-textfield-input" name="name" type="text"
-                                value="" required="">
-                                <br>
-                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
-                        </div>
-                    </form>
-                    <a  target="_blank" href="https://www.yuque.com/rapid/cms/yo0y1er0vg6rl86g"><button type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">进入文档获取模板</button><br><br></a>
-                     
-
-                </div>
-            </m-scrollbar>
-
-        </div>
-    </div>
-
-    <script src="../../../../../../resource/js/mtu.min.js"></script>
-    <script src="../../../../../../resource/js/mdui.min.js"></script>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/admin/tool.php b/admin/tool.php
deleted file mode 100644
index d876c5c..0000000
--- a/admin/tool.php
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
-    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
-
-        <div class="mdui-card">
-
-            <div class="mdui-card-primary">
-                <div class="mdui-card-primary-title" style="font-size:30px">小组件设置</div>
-            </div>
-            <form method="post" action="run-tool.php">
-                <m-scrollbar style="height: 620px;width:900px">
-                    <div class="mdui-card-content" style="font-size:15px;text-align:left">
-
-                        <label class="mdui-switch">
-                            开启小组件&nbsp;&nbsp;&nbsp;
-                            <input <?
-                                    if ($data_tool["tool"]  == "true") {
-                                        echo " checked='true'";
-                                    }
-                                    ?> name="tool" type="checkbox" />
-                            <i class="mdui-switch-icon"></i>
-                        </label> <br>
-                        <label class="mdui-textfield-label">选择小组件</label>
-                        <select class="mdui-select" name="kind" id="kind" onchange="kindmove()" mdui-select>
-                            <?
-
-                            if ($data_tool["kind"] == "one") {
-                                echo ' <option value="one" selected>一言</option>';
-                                echo '   <option value="write" >自定义</option>';
-                            } else {
-                                echo ' <option value="one" >一言</option>';
-                                echo '   <option value="write" selected>自定义</option>';
-                            }
-                            ?>
-
-
-                        </select> <br> <br>
-                        <div id="con" style="display:none" class="mdui-textfield  mdui-textfield-has-bottom ">
-                            <label class="mdui-textfield-label">输入内容</label>
-
-
-                            <textarea rows="7" class="mdui-textfield-input" name="content" type="text" required=""><? echo $data_tool["content"]; ?></textarea>
-                        </div>
-                        <br>
-                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">提交</button>
-
-                    </div>
-                </m-scrollbar>
-            </form>
-        </div>
-
-    </div>
-    <script>
-        function kindmove(){
-if(document.getElementById("kind").value=="write"){
-    document.getElementById("con").style.display="inline";
-}else{
-    document.getElementById("con").style.display="none";
-}
-        }
-        window.onload=()=>{
-            kindmove()
-        }
-    </script>
-    <script src="../../../../../../resource/js/mtu.min.js"></script>
-    <script src="../../../../../../resource/js/mdui.min.js"></script>
-</body>
-
-</html>
\ No newline at end of file
diff --git a/admin/update-run.php b/admin/update-run.php
deleted file mode 100644
index 4cb06cd..0000000
--- a/admin/update-run.php
+++ /dev/null
@@ -1,100 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-
-
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
-    <div class="medium" style=" text-align:center;display: flex">
-
-        <div>
-            <div style="color:black;font-size: 20px;" class="mdui-typo">
-                <h1 style="font-weight: bold;">版本更新</h1>
-                <h5>正在更新中，版本：<?php echo $_GET["version"]; ?> </h5>
-
-                <br>
-
-
-                <?php
-
-                $arrContextOptions = array(
-                    "ssl" => array(
-                        "verify_peer" => false,
-                        "verify_peer_name" => false,
-                    ),
-                );
-                file_put_contents("../upload/" . $_GET["version"] . ".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/version/" . $_GET["version"] . ".zip", false, stream_context_create($arrContextOptions)));
-
-                require_once('pclzip.lib.php');
-
-                $zip = new PclZip("../upload/" . $_GET["version"] . ".zip");
-                $result = $zip->extract(PCLZIP_OPT_PATH, "../");
-                if ($result == 0) {
-                    echo '<br>更新失败';
-                    unlink("../upload/" . $_GET["version"] . ".zip");
-                } else {
-                    echo '<br>更新成功';
-                    unlink("../upload/" . $_GET["version"] . ".zip");
-                }
-
-                ?>
-            </div>
-
-        </div>
-    </div>
-
-    <script src="../../../../../../resource/js/mtu.min.js"></script>
-    <script src="../../../../../../resource/js/mdui.min.js"></script>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/admin/upload.php b/admin/upload.php
deleted file mode 100644
index cff3b52..0000000
--- a/admin/upload.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-$fileInfo=$_FILES['file'];
-$name=$fileInfo['name'];
-$pathname = pathinfo($name)["extension"];
-$filename =  pathinfo($name, PATHINFO_FILENAME); 
-$filePath=$fileInfo['tmp_name'];
-//$name = iconv('utf-8', 'gb2312', $filename);
-$str=rand(); 
-
-$path="../upload/upload_".md5($str).".".$pathname;
-move_uploaded_file($filePath,$path);
-echo json_encode([
-  "code" => 0,
-  "data" => [
-    "url" => $path,
-    "name" => $name
-  ]
- ]);
diff --git a/admin/user-del.php b/admin/user-del.php
deleted file mode 100644
index 3ec39c5..0000000
--- a/admin/user-del.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-//测试
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-header ( "Content-type:text/html;charset=utf-8" );
-$json_string = file_get_contents('../install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
-
-if($link)
-{
-    $select=mysqli_select_db($link,$dataxxx['dbname']);
-  if($select)
-  {
-
-      $str="DELETE FROM `rapidcmsuser` WHERE username='".$_GET["username"]."'";
-	  $result=mysqli_query($link,$str);
-      sendalert("删除成功！");
-  }
-}
-?>
\ No newline at end of file
diff --git a/admin/user-move-run.php b/admin/user-move-run.php
deleted file mode 100644
index 38ebaf0..0000000
--- a/admin/user-move-run.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-header ( "Content-type:text/html;charset=utf-8" );
-$json_string = file_get_contents('../install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
-
-if($link)
-{
-    $select=mysqli_select_db($link,$dataxxx['dbname']);
-  if($select)
-  {
-    $password1=md5(sha1(md5($_POST["password"])));
-      $str="UPDATE `rapidcmsuser` SET `password`= '".$password1."' WHERE username='".$_POST["username"]."'";
-
-	  $result=mysqli_query($link,$str);
-    sendalert("修改成功！");
-  }
-}
-?>
\ No newline at end of file
diff --git a/admin/user-move.php b/admin/user-move.php
deleted file mode 100644
index e761d36..0000000
--- a/admin/user-move.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
-define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
-$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin',$pa)) {
-    Header("Location: login.php"); 
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
-    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
-
-        <div class="mdui-card">
-
-            <div class="mdui-card-primary">
-                <div class="mdui-card-primary-title" style="font-size:30px">用户设置</div>
-            </div>
-           
-                <m-scrollbar style="height: 650px;width:900px;text-align:left ">
-                <div id="login" class="mc-account mc-login mdui-dialog mdui-dialog-open " style="overflow: hidden;z-index:999;display: block; top: 150.104px; height: 540.792px;">
-                <button class="mdui-btn mdui-btn-icon close" onclick="window.location.href='user.php'"><i class="mdui-icon material-icons">close</i></button>
- 
-<div class="mdui-dialog-title">修改用户密码</div>
-<form method="post" action="user-move-run.php">
-<div style="display:none" class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom "><label class="mdui-textfield-label">用户名</label><input class="mdui-textfield-input" value="<?echo $_GET["username"]?>"  name="username" type="text" >
-        <div class="mdui-textfield-error">账号不能为空</div>
-    </div>
-    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom "><label class="mdui-textfield-label">用户名</label><input class="mdui-textfield-input" value="<?echo $_GET["username"]?>" type="text" disabled="true">
-        <div class="mdui-textfield-error">账号不能为空</div>
-    </div>
-    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom"><label class="mdui-textfield-label">新密码</label><input class="mdui-textfield-input" name="password" type="password" required="">
-        <div class="mdui-textfield-error">密码不能为空</div>
-    </div>
-    <div class="actions mdui-clearfix">
-       <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">修改</button>
-    </div>
-</form>
-</div>
-                </m-scrollbar>
-  
-        </div>
-
-    </div>
-
-    <script src="../../../../../../resource/js/mtu.min.js"></script>
-    <script src="../../../../../../resource/js/mdui.min.js"></script>
-</body>
-
-</html>
-
-
-
diff --git a/admin/user.php b/admin/user.php
deleted file mode 100644
index 81b3871..0000000
--- a/admin/user.php
+++ /dev/null
@@ -1,108 +0,0 @@
-<?php
-include("../resource/variable.php");
-function encode($string = '', $skey = 'cxphp')
-{
-    $strArr = str_split(base64_encode($string));
-    $strCount = count($strArr);
-    foreach (str_split($skey) as $key => $value)
-        $key < $strCount && $strArr[$key] .= $value;
-    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
-}
-
-define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
-define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
-$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
-$dataxxx = json_decode($json_string, true);
-$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
-$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
-$result = mysqli_query($link, $sql);
-$pass = mysqli_fetch_row($result);
-$pa = $pass[0];
-
-if ($_COOKIE["admin"] != encode('admin', $pa)) {
-    Header("Location: login.php");
-}
-?>
-
-<!DOCTYPE html>
-<html lang="zh-cn">
-
-<head>
-    <meta charset="utf-8">
-    <title>RapidCMS管理后台</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1">
-    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
-    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
-    <link rel="stylesheet" href="../../../../resource/css/style.css">
-    <link rel="stylesheet" href="../../../../../template/default/theme.css">
-    
-</head>
-
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
-        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
-        <span class="mdui-typo-title">RapidCMS 管理后台</span>
-    </div>
-
-    <? include("drawer.php"); ?>
-
-    <style>
-        * {
-            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-        }
-    </style>
-    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
-
-        <div class="mdui-card" style="overflow:scroll">
-
-            <div class="mdui-card-primary">
-                <div class="mdui-card-primary-title" style="font-size:30px;">用户设置</div>
-            </div>
-           
-                <m-scrollbar style="height: 650px;width:900px;">
-                    <div style="width:80%;position: absolute;left: 50%;    transform: translateX(-50%  );"  class="mdui-table-fluid">
-                        <table class="mdui-table">
-                            <thead>
-                                <tr>
-                                    <th>用户名</th>
-                                    <th>用户状态</th>
-                                    <th  class="mdui-table-col-numeric"> </th>
-                                </tr>
-                            </thead>
-                            <tbody>
-
-                    <?php
-                    $table_name = "rapidcmsuser";
-                    $json_string = file_get_contents('../install/sql-config/sql.json');
-                    $data = json_decode($json_string, true);
-                    $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
-                    $sql = 'select * from `' . $table_name . '`';
-                    $res = mysqli_query($conn, $sql);
-                    $colums = mysqli_num_fields($res);
-                    while ($row = mysqli_fetch_row($res)) {
-                       echo "<tr>";
-                        echo "</tr>";
-                        echo "<td>$row[0]</td>";
-                        echo "<td>$row[2]</td>";
-                        echo '<td ><a href="user-del.php?username='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe872;</i></button></a>&nbsp;&nbsp;&nbsp;&nbsp;';
-                        echo '<a href="user-move.php?username='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a></td>';
-                    }
-                    ?>
-                                  
-                               
-                            </tbody>
-                        </table>
-                    </div>
-                </m-scrollbar>
-  
-        </div>
-
-    </div>
-
-    <script src="../../../../../../resource/js/mtu.min.js"></script>
-    <script src="../../../../../../resource/js/mdui.min.js"></script>
-</body>
-
-</html>
\ No newline at end of file
diff --git a/admin/user/user-del.php b/admin/user/user-del.php
new file mode 100644
index 0000000..411cb37
--- /dev/null
+++ b/admin/user/user-del.php
@@ -0,0 +1,20 @@
+<?php
+include("../check.php");
+
+header ( "Content-type:text/html;charset=utf-8" );
+$json_string = file_get_contents('../../install/sql-config/sql.json');
+$dataxxx = json_decode($json_string, true);
+$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
+
+if($link)
+{
+    $select=mysqli_select_db($link,$dataxxx['dbname']);
+  if($select)
+  {
+
+      $str="DELETE FROM `rapidcmsuser` WHERE username='".$_GET["username"]."'";
+	  $result=mysqli_query($link,$str);
+      sendalert("删除成功！");
+  }
+}
+?>
\ No newline at end of file
diff --git a/admin/user/user-move-run.php b/admin/user/user-move-run.php
new file mode 100644
index 0000000..84335ae
--- /dev/null
+++ b/admin/user/user-move-run.php
@@ -0,0 +1,21 @@
+<?php
+include("../check.php");
+
+header ( "Content-type:text/html;charset=utf-8" );
+$json_string = file_get_contents('../../install/sql-config/sql.json');
+$dataxxx = json_decode($json_string, true);
+$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);
+
+if($link)
+{
+    $select=mysqli_select_db($link,$dataxxx['dbname']);
+  if($select)
+  {
+    $password1=md5(sha1(md5($_POST["password"])));
+      $str="UPDATE `rapidcmsuser` SET `password`= '".$password1."' WHERE username='".$_POST["username"]."'";
+
+	  $result=mysqli_query($link,$str);
+    sendalert("修改成功！");
+  }
+}
+?>
\ No newline at end of file
diff --git a/admin/user/user-move.php b/admin/user/user-move.php
new file mode 100644
index 0000000..4e5b319
--- /dev/null
+++ b/admin/user/user-move.php
@@ -0,0 +1,47 @@
+<?php
+include("../header.php");
+
+?>
+
+    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
+
+        <div class="mdui-card">
+
+            <div class="mdui-card-primary">
+                <div class="mdui-card-primary-title" style="font-size:30px">用户设置</div>
+            </div>
+           
+                <m-scrollbar style="height: 650px;width:900px;text-align:left ">
+                <div id="login" class="mc-account mc-login mdui-dialog mdui-dialog-open " style="overflow: hidden;z-index:999;display: block; top: 150.104px; height: 540.792px;">
+                <button class="mdui-btn mdui-btn-icon close" onclick="window.location.href='user.php'"><i class="mdui-icon material-icons">close</i></button>
+ 
+<div class="mdui-dialog-title">修改用户密码</div>
+<form method="post" action="user-move-run.php">
+<div style="display:none" class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom "><label class="mdui-textfield-label">用户名</label><input class="mdui-textfield-input" value="<?echo $_GET["username"]?>"  name="username" type="text" >
+        <div class="mdui-textfield-error">账号不能为空</div>
+    </div>
+    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom "><label class="mdui-textfield-label">用户名</label><input class="mdui-textfield-input" value="<?echo $_GET["username"]?>" type="text" disabled="true">
+        <div class="mdui-textfield-error">账号不能为空</div>
+    </div>
+    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom"><label class="mdui-textfield-label">新密码</label><input class="mdui-textfield-input" name="password" type="password" required="">
+        <div class="mdui-textfield-error">密码不能为空</div>
+    </div>
+    <div class="actions mdui-clearfix">
+       <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">修改</button>
+    </div>
+</form>
+</div>
+                </m-scrollbar>
+  
+        </div>
+
+    </div>
+
+    <script src="../../../../../../resource/js/mtu.min.js"></script>
+    <script src="../../../../../../resource/js/mdui.min.js"></script>
+</body>
+
+</html>
+
+
+
diff --git a/admin/user/user.php b/admin/user/user.php
new file mode 100644
index 0000000..fdecf60
--- /dev/null
+++ b/admin/user/user.php
@@ -0,0 +1,58 @@
+<?php
+include("../header.php");
+
+?>
+
+    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">
+
+        <div class="mdui-card" style="overflow:scroll">
+
+            <div class="mdui-card-primary">
+                <div class="mdui-card-primary-title" style="font-size:30px;">用户设置</div>
+            </div>
+           
+                <m-scrollbar style="height: 650px;width:900px;">
+                    <div style="width:80%;position: absolute;left: 50%;    transform: translateX(-50%  );"  class="mdui-table-fluid">
+                        <table class="mdui-table">
+                            <thead>
+                                <tr>
+                                    <th>用户名</th>
+                                    <th>用户状态</th>
+                                    <th  class="mdui-table-col-numeric"> </th>
+                                </tr>
+                            </thead>
+                            <tbody>
+
+                    <?php
+                    $table_name = "rapidcmsuser";
+                    $json_string = file_get_contents('../../install/sql-config/sql.json');
+                    $data = json_decode($json_string, true);
+                    $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
+                    $sql = 'select * from `' . $table_name . '`';
+                    $res = mysqli_query($conn, $sql);
+                    $colums = mysqli_num_fields($res);
+                    while ($row = mysqli_fetch_row($res)) {
+                       echo "<tr>";
+                        echo "</tr>";
+                        echo "<td>$row[0]</td>";
+                        echo "<td>$row[2]</td>";
+                        echo '<td ><a href="user-del.php?username='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe872;</i></button></a>&nbsp;&nbsp;&nbsp;&nbsp;';
+                        echo '<a href="user-move.php?username='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a></td>';
+                    }
+                    ?>
+                                  
+                               
+                            </tbody>
+                        </table>
+                    </div>
+                </m-scrollbar>
+  
+        </div>
+
+    </div>
+
+    <script src="../../../../../../resource/js/mtu.min.js"></script>
+    <script src="../../../../../../resource/js/mdui.min.js"></script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/install/install-config/install.json b/install/install-config/install.json
index e69de29..2e665b5 100644
--- a/install/install-config/install.json
+++ b/install/install-config/install.json
@@ -0,0 +1 @@
+{"lock":"install"}
\ No newline at end of file
diff --git a/resource/config/index.json b/resource/config/index.json
index 442ed2d..de80945 100644
--- a/resource/config/index.json
+++ b/resource/config/index.json
@@ -1 +1 @@
-{"close":"false","template":"default","version":"1.3.1","rewrite":"false"}
\ No newline at end of file
+{"template":"default","version":"1.3.1","rewrite":"false","close":"false"}
\ No newline at end of file
diff --git a/resource/config/tool.json b/resource/config/tool.json
index f7059fb..64a1c4e 100644
--- a/resource/config/tool.json
+++ b/resource/config/tool.json
@@ -1 +1 @@
-{"tool":"true","kind":"one","content":"<center><p id=\"hitokoto\"><a style=\"color:#000000\" href=\"#\" id=\"hitokoto_text\">\u83b7\u53d6\u4e2d...<\/a><\/p><\/center><script>fetch('https:\/\/v1.hitokoto.cn').then(response => response.json()).then(data => {const hitokoto = document.querySelector('#hitokoto_text');hitokoto.href = 'https:\/\/hitokoto.cn\/?uuid=' + data.uuid;\r\n        if (data.from_who == null) {\r\n        hitokoto.innerHTML = \"\u300c \" + data.hitokoto + \" \u300d<br>\u2014\u2014\" + data.from;\r\n        }else {\r\n        hitokoto.innerHTML = \"\u300c \" + data.hitokoto + \" \u300d<br>\u2014\u2014\" + data.from_who + \"\u300c\" + data.from + \"\u300d\"\r\n        }}).catch(console.error)\r\n        <\/script>"}
\ No newline at end of file
+{"tool":"true","kind":"time","content":"<center><a  id=\"time_is_link\" rel=\"nofollow\" style=\"display:none\"><\/a><span id=\"China_z43d\" style=\"font-size:25px;\"><\/span><script src=\"https:\/\/widget.time.is\/t.js\"><\/script><script>time_is_widget.init({China_z43d:{}});<\/script><\/center>"}
\ No newline at end of file
diff --git a/template/default/article.php b/template/default/article.php
index 637792a..d3838e1 100644
--- a/template/default/article.php
+++ b/template/default/article.php
@@ -1,6 +1,11 @@
 <?php include("menu.php") ?>
+<style>
+    * {
+        font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
+    }
+</style>
 <div class="mdui-container" style="margin:auto;">
 
 
     <div class="mdui-text-color-black  ">
         <br>
@@ -25,11 +30,11 @@
             ?>
             <br>
             <?php
             if ($data_tool["tool"] == "true") {
                 echo '<div class="mdui-card mdui-card-shadow question"> <br>';
-                echo ' <div class="mdui-typo" style="padding: 10px;">'.$data_tool["content"].'</div><br></div><br>';
+                echo ' <div class="mdui-typo" style="padding: 10px;">' . $data_tool["content"] . '</div><br></div><br>';
             }
             ?>
             <script>
                 function copyText(text) {
                     var textareaC = document.createElement('textarea');
diff --git a/template/default/category.php b/template/default/category.php
index 81534a7..ed66d0a 100644
--- a/template/default/category.php
+++ b/template/default/category.php
@@ -1,6 +1,11 @@
 <?php include("menu.php") ?>
+<style>
+    * {
+        font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
+    }
+</style>
 <div class="mdui-container" style="margin:auto;overflow:auto;">
 
 
     <div class="mdui-text-color-black  ">
         <br>
diff --git a/template/default/menu.php b/template/default/menu.php
index e0addeb..4063ca6 100644
--- a/template/default/menu.php
+++ b/template/default/menu.php
@@ -1,7 +1,7 @@
-<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-indigo mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
-    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
+<body class=" mdui-appbar-with-toolbar mdui-theme-accent-white  mdui-theme-primary-white mdui-text-color-black mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
+    <div class="mdui-toolbar mdui-color-white mdui-text-color-black mdui-appbar mdui-appbar-fixed mdui-headroom">
         <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
         <span class="mdui-typo-title"><? echo $data_header["title"]; ?></span>
         <div class="mdui-toolbar-spacer"></div>
         <?php
         function curPageURL()
diff --git a/upload/upload_018b76064b09f369c0b05a7683438816.jpg b/upload/upload_018b76064b09f369c0b05a7683438816.jpg
new file mode 100644
index 0000000..5ad87eb
Binary files /dev/null and b/upload/upload_018b76064b09f369c0b05a7683438816.jpg differ
diff --git a/upload/upload_0c90f20de4713ce68725eacc71be4844.png b/upload/upload_0c90f20de4713ce68725eacc71be4844.png
new file mode 100644
index 0000000..1a73cbf
Binary files /dev/null and b/upload/upload_0c90f20de4713ce68725eacc71be4844.png differ
diff --git a/upload/upload_87b28485bd8bf527f6d1348691e3fa51.png b/upload/upload_87b28485bd8bf527f6d1348691e3fa51.png
new file mode 100644
index 0000000..1a73cbf
Binary files /dev/null and b/upload/upload_87b28485bd8bf527f6d1348691e3fa51.png differ

Vulnerable code: <?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
    * {
        font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    }
</style>
<div class="medium" style=" text-align:center;display: flex;gap: 47px;">
    <img style="Border-radius:10px" width="200px" src="../../../upload/logo.png">
    <div>
        <div style="color:black;font-size: 20px;" class="mdui-typo">
            <h1 style="font-weight: bold;">RapidCMS</h1>
        </div>
        <div style="color:black;font-size: 10px;" class="mdui-typo">
            <h1>简单好用的官网CMS系统</h1>
        </div>
    </div>
</div>

<script src="../../../../../../resource/js/mtu.min.js"></script>
<script src="../../../../../../resource/js/mdui.min.js"></script>

</body>
</html>
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
  
}else{
    Header("Location: index.php");
}
include("../resource/variable.php");
$json_string = file_get_contents('../install/sql-config/sql.json');
include("../resource/variable.php");
$json_string = file_get_contents('../install/sql-config/sql.json');
Header("Location: index.php");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
    $timenow = date('Y-m-d H:i:s');
    $cont2=rawurlencode(htmlspecialchars($_POST["content"]));
      $str='INSERT INTO `rapidcmspage`(`id`, `title`, `content`, `time`, `categoryid`) VALUES ("'.$_POST["id"].'","'.rawurlencode($_POST["title"]).'","'.$cont2.'","'.$timenow.'","'.$_POST["categoryid"].'")';

	  $result=mysqli_query($link,$str);
    sendalert("增加成功！");
     
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmschat` WHERE id='".$_GET["id"]."'";
	  $result=mysqli_query($link,$str);
      echo "<script>window.opener=null;window.open('','_self');window.close();</script>";
    
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmspage` WHERE id='".$_GET["id"]."'";
	  $result=mysqli_query($link,$str);
      sendalert("删除成功！请刷新");
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
    $timenow = date('Y-m-d H:i:s');
    $cont2=rawurlencode(htmlspecialchars($_POST["content"]));
       
    $str='  UPDATE `rapidcmspage` SET `title`="'.rawurlencode($_POST["title"]).'",`content`="'.$cont2.'",`time`="'.$timenow.'" WHERE `id`="'.$_POST["id"].'"';

	  $result=mysqli_query($link,$str);
      sendalert("修改成功！");
  }
}
?>
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
    
    <? include("drawer.php"); ?>
    <script>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
                            $json_string = file_get_contents('../install/sql-config/sql.json');
                                echo '<option value="' . $row[0] . '">' . $row[1] . '</option>';
    <script src="mdui-editor/js/editor.js"></script>
            imageUploadSuffix: ['png'],

use PhpMyAdmin\Charsets;

        include("../resource/variable.php");
        function encode($string = '', $skey = 'cxphp')
        {
            $strArr = str_split(base64_encode($string));
            $strCount = count($strArr);
            foreach (str_split($skey) as $key => $value)
                $key < $strCount && $strArr[$key] .= $value;
            return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
        }

        define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
        define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
        $json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
        $dataxxx = json_decode($json_string, true);
        $link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
        $sql = "select password from `rapidcmsadmin` where username=\"admin\"";
        $result = mysqli_query($link, $sql);
        $pass = mysqli_fetch_row($result);
        $pa = $pass[0];

        if ($_COOKIE["admin"] != encode('admin', $pa)) {
            Header("Location: login.php");
        }
         
         <link rel="stylesheet" href="http://kindeditor.net/ke4/themes/default/default.css" />
         <script charset="utf-8" src="http://kindeditor.net/ke4/kindeditor-min.js"></script>
         <script charset="utf-8" src="http://kindeditor.net/ke4/lang/zh-CN.js"></script>
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>
    <? include("drawer.php"); ?>


         <div class="mdui-container"  id="page-question" style="margin:auto;">
                define('BASE_PATH2', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
                define('BASE_PATH3', str_replace('\\', '/', realpath(dirname(BASE_PATH2) . '/')) . "/");
                $json_string = file_get_contents(BASE_PATH3 . '/install/sql-config/sql.json');
         
                    echo '<div class="mdui-card answers">          <h1  style="text-align:center;">
        
                    echo '<div class="item" id="chat_'.$row[0].'"><div class="mc-user-line"><div class="mc-user-popover"><a class="avatar user-popover-trigger"><i class="mdui-list-item-icon mdui-icon material-icons">people</i></a>    ';
                    echo '</div></div><div class="content mdui-typo"><p>' . $row[2] . '</p>';
                      echo '</div><div class="flex-grow"></div><div class="mc-options-button">    ';
                    echo '<li class="mdui-menu-item"><a onclick="copyText(\'' . $row[0] . '\')" class="mdui-ripple">复制评论ID</a></li><li class="mdui-menu-item"><a target="_blank" onclick="document.getElementById(\'chat_'.$row[0].'\').style.display=\'none\';" href="article-chat-delete.php?id='.$row[0].'" class="mdui-ripple">删除评论</a></li></ul></div></div></div>    ';
                    echo '</div>';
             
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
    <? include("drawer.php"); ?>
                            $json_string = file_get_contents('../install/sql-config/sql.json');
                                echo $row[1];
                            $json_string = file_get_contents('../install/sql-config/sql.json');
                                    echo '<option selected="selected" value="' . $row[0] . '">' . $row[1] . '</option>';
                                    echo '<option value="' . $row[0] . '">' . $row[1] . '</option>';
    <script src="mdui-editor/js/editor.js"></script>
        function sub1() {
            document.getElementById("area").innerHTML = document.getElementById("content").innerHTML;
            imageUploadSuffix: ['png'],
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}
define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <script type="text/javascript" language="javascript"> 
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
                            $json_string = file_get_contents('../install/sql-config/sql.json');
                                echo "<td>$row[1]</td>";
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str='INSERT INTO `rapidcmscategory`(`id`, `name`, `pic`, `num`) VALUES ("'.$_POST["id"].'","'.rawurlencode($_POST["name"]).'","'.$_POST["pic"].'",'.$_POST["num"].')';

	  $result=mysqli_query($link,$str);
      sendalert("增加成功！");
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
<script>
    function randomString(length,) {
        var chars='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    var result = '';
    for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
    return result;
}
function resetnum(){
    document.getElementById("ranid").value=randomString(10);
}
window.onload = function () {
    resetnum()
}


    </script>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">分类设置</div>
            </div>
           
                <m-scrollbar style="height: 800px;width:900px;text-align:left ">
                <div id="login" class="mc-account mc-login mdui-dialog mdui-dialog-open " style="overflow: hidden;z-index:999;display: block; top: 150.104px; height: 700px;">
                <button class="mdui-btn mdui-btn-icon close" onclick="window.location.href='category.php'"><i class="mdui-icon material-icons">close</i></button>
 
<div class="mdui-dialog-title">新增</div>
<form method="post" action="cate-add-run.php">

    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
        <label class="mdui-textfield-label">唯一ID（10位字符）</label>
    <input class="mdui-textfield-input" style="width:90%" type="text" name="id" id="ranid" value="onload" required="">
  <i   style="cursor:pointer;position: absolute;left: 92%" onclick="resetnum(10)" class="mdui-icon material-icons">&#xe5d5;</i>
</div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
        <label class="mdui-textfield-label">名称</label>
    <input class="mdui-textfield-input" type="text" name="name" required=""></div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
        <label class="mdui-textfield-label">图标ID（在MDUI中获取&#XXXX;）</label>
    <input class="mdui-textfield-input" style="width:90%" type="text" name="pic" required="">
    <i   style="cursor:pointer;position: absolute;left: 92%" onclick="window.open('https://www.mdui.org/docs/material_icon')" class="mdui-icon material-icons">&#xe250;</i>
    </div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
        <label class="mdui-textfield-label">权重（大的在前面）</label>
    <input class="mdui-textfield-input" type="number" name="num" required=""></div>

    <div class="actions mdui-clearfix">
       <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button>
    </div>
</form>
</div>
                </m-scrollbar>
  
        </div>

    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>



<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmscategory` WHERE id='".$_GET["id"]."'";
	  $result=mysqli_query($link,$str);
      sendalert("删除成功！请刷新");
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
  
      $str='  UPDATE `rapidcmscategory` SET `name`="'.rawurlencode($_POST["name"]).'",`pic`="'.$_POST["pic"].'",`num`='.$_POST["num"].' WHERE `id`="'.$_POST["id"].'"';
        echo $str;
	  $result=mysqli_query($link,$str);
      sendalert("修改成功！");
  }
}
?>
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH2',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH3',str_replace('\\','/',realpath(dirname(BASE_PATH2).'/'))."/");
$json_string = file_get_contents(BASE_PATH3.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];
if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}
define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>
    <? include("drawer.php"); ?>
    <script type="text/javascript" language="javascript"> 
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
                    $json_string = file_get_contents('../install/sql-config/sql.json');
                        echo "<td>$row[1]</td>";
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple  mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">

</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}
define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
include("../resource/variable.php");
  $path = "../" . $path1;
  $filename1 = '../resource/config/header.json';
  sendalert("上传成功");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../plugin/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>


    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div class="medium" style=" text-align:center;display: flex">

        <div>
            <div style="color:black;font-size: 20px;" class="mdui-typo">
                <h1 style="font-weight: bold;">插件获取</h1>
                <h5>插件名称：<?php echo $_GET["name"]; ?> </h5>
                
                <br>


                <?php

$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  
file_put_contents("../plugin/".$_GET["name"].".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/plugin/".$_GET["name"].".zip", false, stream_context_create($arrContextOptions)));
            
                require_once('pclzip.lib.php');

                $zip = new PclZip("../plugin/".$_GET["name"].".zip");
                $result = $zip->extract(PCLZIP_OPT_PATH, "../plugin/");
                if ($result == 0) {
                    echo '<br>输入错误';
                    unlink("../plugin/" . $_GET["name"] . ".zip");
                } else {
                    echo '<br>导入成功';
                    unlink("../plugin/" . $_GET["name"] . ".zip");
                }

                ?>
            </div>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>


    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div class="medium" style=" text-align:center;display: flex">

        <div>
            <div style="color:black;font-size: 20px;" class="mdui-typo">
                <h1 style="font-weight: bold;">模板获取</h1>
                <h5>模板名称：<?php echo $_GET["name"]; ?> </h5>
                
                <br>


                <?php

$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  
file_put_contents("../template/".$_GET["name"].".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/".$_GET["name"].".zip", false, stream_context_create($arrContextOptions)));
            
                require_once('pclzip.lib.php');

                $zip = new PclZip("../template/" .$_GET["name"].".zip");
                $result = $zip->extract(PCLZIP_OPT_PATH, "../template/");
                if ($result == 0) {
                    echo '<br>输入错误';
                    unlink("../template/" . $_GET["name"] . ".zip");
                } else {
                    echo '<br>导入成功';
                    unlink("../template/" . $_GET["name"] . ".zip");
                }

                ?>
            </div>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
        <a href="index.php">
                <a href="setting.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">基本设置</a>
                <a href="server.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">服务设置</a>
                <a href="mail.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">邮件设置</a>
                <a href="rewrite.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">伪静态设置</a>
        <a href="user.php">
                <a href="category.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">查看分类</a>
                <a href="cate-add.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">新增分类</a>
                <a href="article.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">查看文章</a>
                <a href="article-add.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">新增文章</a>
                <a href="tool.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">小组件</a>
        <a href="temp.php">
        <a href="plugin.php">
        <a href="movepass.php">
            <li class="mdui-list-item mdui-ripple" style="font-size:15px!important">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe22b;</i>
                <div class="mdui-list-item-content" style="font-size:15px!important">修改密码</div>
            </li>
        </a>
                <a href="update.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">检查更新</a>
                <a href="plus.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">高级功能</a>
                <a href="about.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">关于</a>

</div>
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
$json_string = file_get_contents(BASE_PATH1 . 'install/sql-config/sql.json');
copydir("../resource/config", $dir . "config");
include("../resource/variable.php");
require_once('pclzip.lib.php');
require_once('pclzip.lib.php');
include("../resource/variable.php");
$json_string = file_get_contents('../install/sql-config/sql.json');
define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
    Header("Location: ./login.php");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">修改管理员密码</div>
            </div>
            <form method="post" action="run-movepass.php">
                <m-scrollbar style="height: 300px;width:900px">
                    <div class="mdui-card-content" style="font-size:15px;text-align:left">
                        <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                            <label class="mdui-textfield-label">输入密码</label>
                            <input class="mdui-textfield-input" name="password" type="password"
                              required="">
                              <div class="mdui-textfield-error">密码不能为空</div>
                        </div>
                        <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                            <label class="mdui-textfield-label">重复密码</label>
                            <input class="mdui-textfield-input" name="password2" type="password"
                               required="">
                               <div class="mdui-textfield-error">重复密码不能为空</div>
                        </div>
                      
                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">提交</button>

                    </div>
                </m-scrollbar>
            </form>
        </div>
       
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}

function removeDir($dirName)
{
    if (!is_dir($dirName)) {
        return false;
    }
    $handle = @opendir($dirName);
    while (($file = @readdir($handle)) !== false) {
        if ($file != '.' && $file != '..') {
            $dir = $dirName . '/' . $file;
            is_dir($dir) ? removeDir($dir) : @unlink($dir);
        }
    }
    closedir($handle);
    @rmdir($dirName);
}
removeDir('../plugin/' . $_GET["id"]);
echo "<script type='text/javascript'>window.location.href='plugin.php'</script>";
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
$json_string=file_get_contents('../plugin/'. $_GET["id"]."/version.json");
$row = json_decode($json_string, true);
if($row["use"]==true){
    $data = array();
    $data['key'] =$row["key"];
    $data['name'] = $row["name"];
    $data['version'] = $row["version"];
    $data['author'] = $row["author"];
    $data['use'] = false;
    $json_string = json_encode($data);
    
    file_put_contents('../plugin/'. $_GET["id"]."/version.json", $json_string);

   }else{
    $data = array();
    $data['key'] =$row["key"];
    $data['name'] = $row["name"];
    $data['version'] = $row["version"];
    $data['author'] = $row["author"];
    $data['use'] = true;
    $json_string = json_encode($data);
    
    file_put_contents('../plugin/'. $_GET["id"]."/version.json", $json_string);
   }
   echo "<script type='text/javascript'>window.location.href='plugin.php'</script>"
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <script type="text/javascript" language="javascript">
        function confirmAct() {
            if (confirm('确定要删除插件吗?')) {
                return true;
            }
            return false;
        }

        function confirmAct1() {
            if (confirm('确定要禁用插件吗?')) {
                return true;
            }
            return false;
        }

        function confirmAct2() {
            if (confirm('确定要启用插件吗?')) {
                return true;
            }
            return false;
        }
    </script>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card" style="overflow:scroll">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px;">插件设置</div>

            </div> 
            <div class="mdui-divider"></div> <br>
            <m-scrollbar style="height: 650px;width:900px;">
          
            <form method="get" action="download-plugin.php" style="text-align:left;padding:0 0 0 250px">
                    <div style="  display: flex;gap: 47px;">

                        <div>输入Key加载插件：<input style="width:300px" class="mdui-textfield-input" name="name" type="text" value="" required=""> </div>
                        <div><button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
                        </div>




                    </div>
                </form>
                <br>
                <div class="mdui-divider"></div>  <br>
                <div style="width:90%;position: absolute;left: 50%;    transform: translateX(-50%  );" class="mdui-table-fluid">

                    <table class="mdui-table">
                        <thead>
                            <tr>
                                <th>ID-Key</th>
                                <th>名称</th>
                                <th>版本</th>
                                <th>作者</th>
                                <th>状态</th>
                                <th class="mdui-table-col-numeric"> </th>
                            </tr>
                        </thead>
                        <tbody>

                            <?php




                            $file = scandir("../plugin");

                            for ($i = 2; $i < count($file); $i++) {
                                if($file[$i]==".gitkeep"){
                                    
                                }else{
                                    $json_string = file_get_contents('../plugin/' . $file[$i] . "/version.json");
                                    $row = json_decode($json_string, true);
                                    echo "<tr>";
                                    echo "</tr>";
                                    echo "<td>" . $row["key"] . "</td>";
                                    echo "<td>" . $row["name"] . "</td>";
                                    echo "<td>" . $row["version"] . "</td>";
                                    echo "<td>" . $row["author"] . "</td>";
                                    if ($row["use"] == true) {
                                        echo "<td style='color:green'><strong>启用</strong></td>";
                                        echo '<td><a target="_blank" href="' . '../plugin/' . $file[$i] . "/setting.php" . '"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
                                        echo '<a onclick="return confirmAct1();" href="plugin-move.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe644;</i></button></a>';
                                    } else {
                                        echo "<td style='color:red'><strong>禁用</strong></td>";
                                        echo '<td><a target="_blank" href="' . '../plugin/' . $file[$i] . "/setting.php" . '"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
                                        echo '<a onclick="return confirmAct2();" href="plugin-move.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe86c;</i></button></a>';
                                    }
    
    
                                    echo '<a onclick="return confirmAct();" href="plugin-del.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe872;</i></button></a>&nbsp;';
    
                                    echo "</td>";
                                }
                         
                            }



                            ?>


                        </tbody>
                    </table>
                </div>
            </m-scrollbar>

        </div>

    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">

</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <br><br>
    <div style=" position:  relative;left:15%">
        <div class="mdui-card" style="width:70%;height:300px; ">
            <div class="mdui-card-primary" style="text-align:center;">
                <div class="mdui-card-primary-title" style="font-size:30px">从SharkCMS迁移数据</div>
            </div>
            <br>
            <label class="mdui-textfield-label">&nbsp;&nbsp;&nbsp;选择导入方式</label>
            &nbsp;&nbsp;&nbsp;
            <label class="mdui-radio">
                <input type="radio" name="group1" checked />
                <i class="mdui-radio-icon"></i>
                从本程序所在数据库导入
            </label>

            <label class="mdui-radio">
                <input type="radio" name="group1" disabled />
                <i class="mdui-radio-icon"></i>
                从其他数据库导入（暂不支持）
            </label>
            <br>  <br>
            &nbsp;&nbsp;&nbsp;<a href="plus-shark-run.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-text-color-black action-btn">一键导入文章</button></a>
       
        </div>
    </div>
    <br>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">

</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <br><br>
    <div style=" position:  relative;left:15%">
        <div class="mdui-card" style="width:70%;height:300px; ">
            <div class="mdui-card-primary" style="text-align:center;">
                <div class="mdui-card-primary-title" style="font-size:30px">数据设置</div>
            </div>
            <div class="mdui-tab" mdui-tab>
                <a href="#move1" class="mdui-ripple">备份数据</a>
                <a href="#move2" class="mdui-ripple">导入备份</a>
           <a href="#move3" class="mdui-ripple">迁移数据</a> 
            </div>
            <div id="move1" class="mdui-p-a-2">
            <label class="mdui-textfield-label">备份系统数据，树立安全意识</label>
               
                <a href="plus-back-run.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">备份数据</button></a>
           </div>
            <div id="move2" class="mdui-p-a-2">
            <label class="mdui-textfield-label">配置文件暂不支持，请解压后手动复制粘贴</label>
            
           <!--    <form enctype="multipart/form-data" id="fileupdateform" method="post" action="plus-back-upload-sql.php"><button for="file" onclick="document.getElementById('file').click()" type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">导入.sql文件</button><br>                    <input style="display: none;" onchange="document.getElementById('fileupdateform').submit()"   name="file"  id="file" type="file" required=""></form>
    --></div>
           <div id="move3" class="mdui-p-a-2">
            <label class="mdui-textfield-label">迁移其他数据，便捷导入内容</label>
                   <a href="plus-shark.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-text-color-black action-btn">从SharkCMS迁移数据</button></a>
       
            </div>
         </div>
    </div>
    <br>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
$data1 = array();
if($_POST["close"]=="on"){
    $data1['close'] = "true";
}else{
    $data1['close'] = "false";
}
$data1['template'] = $data_index["template"];
$data1['version'] = $data_index["version"];
$data1['rewrite'] = $data_index["rewrite"];

$json_string1 = json_encode($data1);
$filename1 = '../resource/config/index.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
sendalert("修改成功！");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
$data1 = array();
if($_POST["logonwithmail"]=="on"){
    $data1['logonwithmail'] = "true";
}else{
    $data1['logonwithmail'] = "false";
}
$data1['smtp'] = $_POST["smtp"];
$data1['secure'] = $_POST["secure"];
$data1['port'] = $_POST["port"];
$data1['username'] = $_POST["username"];
$data1['password'] = $_POST["password"];
$json_string1 = json_encode($data1);
$filename1 = '../resource/config/mail.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
sendalert("修改成功！");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
$data1 = array();
if($_POST["rewrite"]=="on"){
    $data1['rewrite'] = "true";
}else{
    $data1['rewrite'] = "false";
}
$data1['template'] = $data_index["template"];
$data1['version'] = $data_index["version"];
$data1['close'] = $data_index["close"];

$json_string1 = json_encode($data1);
$filename1 = '../resource/config/index.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
sendalert("修改成功！");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
$data1 = array();
$data1['headname'] = $_POST["headname"];
$data1['title'] = $_POST["title"];
$data1['icon'] =  $data_header["icon"];
$data1['description'] = $_POST["description"];
$data1['keywords'] = $_POST["keywords"];
$data1['introduce'] = $_POST["introduce"];
$data1['con'] = $_POST["con"];
$json_string1 = json_encode($data1);
$filename1 = '../resource/config/header.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
sendalert("修改成功");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
$data1 = array();
if($_POST["tool"]=="on"){
    $data1['tool'] = "true";
}else{
    $data1['tool'] = "false";
}
$data1['kind'] = $_POST["kind"];
if ($_POST["kind"] == "one") {
    $data1['content'] = '<center><p id="hitokoto"><a style="color:#000000" href="#" id="hitokoto_text">获取中...</a></p></center><script>fetch(\'https://v1.hitokoto.cn\').then(response => response.json()).then(data => {const hitokoto = document.querySelector(\'#hitokoto_text\');hitokoto.href = \'https://hitokoto.cn/?uuid=\' + data.uuid;
        if (data.from_who == null) {
        hitokoto.innerHTML = "「 " + data.hitokoto + " 」<br>——" + data.from;
        }else {
        hitokoto.innerHTML = "「 " + data.hitokoto + " 」<br>——" + data.from_who + "「" + data.from + "」"
        }}).catch(console.error)
        </script>';
} else {
    $data1['content'] = $_POST["content"];
}


$json_string1 = json_encode($data1);
$filename1 = '../resource/config/tool.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"tool.php\"</script>";
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">


        <div class="mdui-card" style="width:900px">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">网站服务设置</div>
            </div>
            <form method="post" action="run-close.php">
            <div class="mdui-card-content" style="font-size:15px;text-align:left">
            <label class="mdui-switch">
                            启用网页维护&nbsp;&nbsp;&nbsp;
                            <input <?
                                    if ($data_index["close"]  == "true") {
                                        echo " checked='true'";
                                    }
                                    ?> name="close" type="checkbox" />
                            <i class="mdui-switch-icon"></i>
                        </label> 
                        <br> <br>
                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">确认</button>
                  
            </div>
            </form>
        </div>
        <br>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}
define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">

</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
$data1 = array();
$data1['template'] = $_POST["template"];
$data1['version'] = $data_index["version"];
$data1['rewrite'] = $data_index["rewrite"];
$data1['close'] = $data_index["close"];
$json_string1 = json_encode($data1);
$filename1 = '../resource/config/index.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
sendalert("修改成功！");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style=" position:  relative;left:25%;top:10%">


        <div class="mdui-card" style="width:600px">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">设置模板</div>
            </div>
            <m-scrollbar style="font-size:15px;height: 400px">
                <div class="mdui-card-content" style="font-size:18px;text-align:left">
                    当前模板：<? echo $data_index["template"] ?>
                    &nbsp;&nbsp;&nbsp;          &nbsp;&nbsp;&nbsp;          &nbsp;&nbsp;     <a  target="_blank" href="../../../../template/<? echo $data_index["template"] ?>/setting.php"><button type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">模板单独设置</button></a><br><br>
                    <form method="post" action="temp-run.php"> 切换模板：
                        <select class="mdui-select" name="template" mdui-select>



                            <?php

                            $file = scandir("../template");

                            for ($i = 2; $i < count($file); $i++) {
                                echo '  <option value="' . $file[$i] . '">' . $file[$i] . '</option>';
                            }
                            ?></select>
                        &nbsp;&nbsp;&nbsp;
                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
                    </form>
                    <form method="get" action="download-template.php"> 输入Key加载模板：
                      <div style="display: inline;">  
                    <input style="width:300px" class="mdui-textfield-input" name="name" type="text"
                                value="" required="">
                                <br>
                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
                        </div>
                    </form>
                    <a  target="_blank" href="https://www.yuque.com/rapid/cms/yo0y1er0vg6rl86g"><button type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">进入文档获取模板</button><br><br></a>
                     

                </div>
            </m-scrollbar>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">

</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">小组件设置</div>
            </div>
            <form method="post" action="run-tool.php">
                <m-scrollbar style="height: 620px;width:900px">
                    <div class="mdui-card-content" style="font-size:15px;text-align:left">

                        <label class="mdui-switch">
                            开启小组件&nbsp;&nbsp;&nbsp;
                            <input <?
                                    if ($data_tool["tool"]  == "true") {
                                        echo " checked='true'";
                                    }
                                    ?> name="tool" type="checkbox" />
                            <i class="mdui-switch-icon"></i>
                        </label> <br>
                        <label class="mdui-textfield-label">选择小组件</label>
                        <select class="mdui-select" name="kind" id="kind" onchange="kindmove()" mdui-select>
                            <?

                            if ($data_tool["kind"] == "one") {
                                echo ' <option value="one" selected>一言</option>';
                                echo '   <option value="write" >自定义</option>';
                            } else {
                                echo ' <option value="one" >一言</option>';
                                echo '   <option value="write" selected>自定义</option>';
                            }
                            ?>


                        </select> <br> <br>
                        <div id="con" style="display:none" class="mdui-textfield  mdui-textfield-has-bottom ">
                            <label class="mdui-textfield-label">输入内容</label>


                            <textarea rows="7" class="mdui-textfield-input" name="content" type="text" required=""><? echo $data_tool["content"]; ?></textarea>
                        </div>
                        <br>
                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">提交</button>

                    </div>
                </m-scrollbar>
            </form>
        </div>

    </div>
    <script>
        function kindmove(){
if(document.getElementById("kind").value=="write"){
    document.getElementById("con").style.display="inline";
}else{
    document.getElementById("con").style.display="none";
}
        }
        window.onload=()=>{
            kindmove()
        }
    </script>
    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">

</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>


    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div class="medium" style=" text-align:center;display: flex">

        <div>
            <div style="color:black;font-size: 20px;" class="mdui-typo">
                <h1 style="font-weight: bold;">版本更新</h1>
                <h5>正在更新中，版本：<?php echo $_GET["version"]; ?> </h5>

                <br>


                <?php

                $arrContextOptions = array(
                    "ssl" => array(
                        "verify_peer" => false,
                        "verify_peer_name" => false,
                    ),
                );
                file_put_contents("../upload/" . $_GET["version"] . ".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/version/" . $_GET["version"] . ".zip", false, stream_context_create($arrContextOptions)));

                require_once('pclzip.lib.php');

                $zip = new PclZip("../upload/" . $_GET["version"] . ".zip");
                $result = $zip->extract(PCLZIP_OPT_PATH, "../");
                if ($result == 0) {
                    echo '<br>更新失败';
                    unlink("../upload/" . $_GET["version"] . ".zip");
                } else {
                    echo '<br>更新成功';
                    unlink("../upload/" . $_GET["version"] . ".zip");
                }

                ?>
            </div>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
$fileInfo=$_FILES['file'];
$name=$fileInfo['name'];
$pathname = pathinfo($name)["extension"];
$filename =  pathinfo($name, PATHINFO_FILENAME); 
$filePath=$fileInfo['tmp_name'];
//$name = iconv('utf-8', 'gb2312', $filename);
$str=rand(); 

$path="../upload/upload_".md5($str).".".$pathname;
move_uploaded_file($filePath,$path);
echo json_encode([
  "code" => 0,
  "data" => [
    "url" => $path,
    "name" => $name
  ]
 ]);
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];
//测试

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmsuser` WHERE username='".$_GET["username"]."'";
	  $result=mysqli_query($link,$str);
      sendalert("删除成功！");
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
    $password1=md5(sha1(md5($_POST["password"])));
      $str="UPDATE `rapidcmsuser` SET `password`= '".$password1."' WHERE username='".$_POST["username"]."'";

	  $result=mysqli_query($link,$str);
    sendalert("修改成功！");
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">用户设置</div>
            </div>
           
                <m-scrollbar style="height: 650px;width:900px;text-align:left ">
                <div id="login" class="mc-account mc-login mdui-dialog mdui-dialog-open " style="overflow: hidden;z-index:999;display: block; top: 150.104px; height: 540.792px;">
                <button class="mdui-btn mdui-btn-icon close" onclick="window.location.href='user.php'"><i class="mdui-icon material-icons">close</i></button>
 
<div class="mdui-dialog-title">修改用户密码</div>
<form method="post" action="user-move-run.php">
<div style="display:none" class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom "><label class="mdui-textfield-label">用户名</label><input class="mdui-textfield-input" value="<?echo $_GET["username"]?>"  name="username" type="text" >
        <div class="mdui-textfield-error">账号不能为空</div>
    </div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom "><label class="mdui-textfield-label">用户名</label><input class="mdui-textfield-input" value="<?echo $_GET["username"]?>" type="text" disabled="true">
        <div class="mdui-textfield-error">账号不能为空</div>
    </div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom"><label class="mdui-textfield-label">新密码</label><input class="mdui-textfield-input" name="password" type="password" required="">
        <div class="mdui-textfield-error">密码不能为空</div>
    </div>
    <div class="actions mdui-clearfix">
       <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">修改</button>
    </div>
</form>
</div>
                </m-scrollbar>
  
        </div>

    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>



<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card" style="overflow:scroll">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px;">用户设置</div>
            </div>
           
                <m-scrollbar style="height: 650px;width:900px;">
                    <div style="width:80%;position: absolute;left: 50%;    transform: translateX(-50%  );"  class="mdui-table-fluid">
                        <table class="mdui-table">
                            <thead>
                                <tr>
                                    <th>用户名</th>
                                    <th>用户状态</th>
                                    <th  class="mdui-table-col-numeric"> </th>
                                </tr>
                            </thead>
                            <tbody>

                    <?php
                    $table_name = "rapidcmsuser";
                    $json_string = file_get_contents('../install/sql-config/sql.json');
                    $data = json_decode($json_string, true);
                    $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
                    $sql = 'select * from `' . $table_name . '`';
                    $res = mysqli_query($conn, $sql);
                    $colums = mysqli_num_fields($res);
                    while ($row = mysqli_fetch_row($res)) {
                       echo "<tr>";
                        echo "</tr>";
                        echo "<td>$row[0]</td>";
                        echo "<td>$row[2]</td>";
                        echo '<td ><a href="user-del.php?username='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe872;</i></button></a>&nbsp;&nbsp;&nbsp;&nbsp;';
                        echo '<a href="user-move.php?username='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a></td>';
                    }
                    ?>
                                  
                               
                            </tbody>
                        </table>
                    </div>
                </m-scrollbar>
  
        </div>

    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
{"close":"false","template":"default","version":"1.3.1","rewrite":"false"}
{"tool":"true","kind":"one","content":"<center><p id=\"hitokoto\"><a style=\"color:#000000\" href=\"#\" id=\"hitokoto_text\">\u83b7\u53d6\u4e2d...<\/a><\/p><\/center><script>fetch('https:\/\/v1.hitokoto.cn').then(response => response.json()).then(data => {const hitokoto = document.querySelector('#hitokoto_text');hitokoto.href = 'https:\/\/hitokoto.cn\/?uuid=' + data.uuid;\r\n        if (data.from_who == null) {\r\n        hitokoto.innerHTML = \"\u300c \" + data.hitokoto + \" \u300d<br>\u2014\u2014\" + data.from;\r\n        }else {\r\n        hitokoto.innerHTML = \"\u300c \" + data.hitokoto + \" \u300d<br>\u2014\u2014\" + data.from_who + \"\u300c\" + data.from + \"\u300d\"\r\n        }}).catch(console.error)\r\n        <\/script>"}
                echo ' <div class="mdui-typo" style="padding: 10px;">'.$data_tool["content"].'</div><br></div><br>';
<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-indigo mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
Fixed code: <?php
//Cookie消掉
setcookie("admin", "", time()-3600,'/');

//获取返回位置

      $goto="login.php";

//直接返回
echo"<script type="."\""."text/javascript"."\"".">"."window.location="."\"".$goto."\""."</script>";
?>
<?php
include("../header.php");

?>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">修改管理员密码</div>
            </div>
            <form method="post" action="run-movepass.php">
                <m-scrollbar style="height: 300px;width:900px">
                    <div class="mdui-card-content" style="font-size:15px;text-align:left">
                        <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                            <label class="mdui-textfield-label">输入密码</label>
                            <input class="mdui-textfield-input" name="password" type="password"
                              required="">
                              <div class="mdui-textfield-error">密码不能为空</div>
                        </div>
                        <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                            <label class="mdui-textfield-label">重复密码</label>
                            <input class="mdui-textfield-input" name="password2" type="password"
                               required="">
                               <div class="mdui-textfield-error">重复密码不能为空</div>
                        </div>
                      
                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">提交</button>

                    </div>
                </m-scrollbar>
            </form>
        </div>
       
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
include("../check.php");
$json_string = file_get_contents('../../install/sql-config/sql.json');
include("../../variable.php");
$json_string = file_get_contents('../../install/sql-config/sql.json');
Header("Location: ../index.php");
<?php
include("../check.php");

header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
    $timenow = date('Y-m-d H:i:s');
    $cont2=rawurlencode(htmlspecialchars($_POST["content"]));
      $str='INSERT INTO `rapidcmspage`(`id`, `title`, `content`, `time`, `categoryid`) VALUES ("'.$_POST["id"].'","'.rawurlencode($_POST["title"]).'","'.$cont2.'","'.$timenow.'","'.$_POST["categoryid"].'")';
	  $result=mysqli_query($link,$str);
    sendalert("增加成功！");
     
  }
}
?>
include("../check.php");


    <? include("../drawer.php"); ?>

    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
   
   <script>
                            $json_string = file_get_contents('../../install/sql-config/sql.json');
                                echo '<option value="' . $row[0] . '">' .  urldecode($row[1]) . '</option>';
    <script src="../src/mdui-editor/js/editor.js"></script>
            imageUploadSuffix: ['png','jpg','gif','jpeg'],
<?php
include("../check.php");
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmschat` WHERE id='".$_GET["id"]."'";
	  $result=mysqli_query($link,$str);
      echo "<script>window.opener=null;window.open('','_self');window.close();</script>";
    
  }
}
?>
        include("../check.php");

         <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
             <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
             <span class="mdui-typo-title">RapidCMS 管理后台</span>
         </div>
         <? include("../drawer.php"); ?>
         <div class="mdui-container" id="page-question" style="margin:auto;">

                $json_string = file_get_contents('../../install/sql-config/sql.json');

                echo '<div class="mdui-card answers">          <h1  style="text-align:center;">

                    echo '<div class="item" id="chat_' . $row[0] . '"><div class="mc-user-line"><div class="mc-user-popover"><a class="avatar user-popover-trigger"><i class="mdui-list-item-icon mdui-icon material-icons">people</i></a>    ';
                    echo '</div></div><div class="content mdui-typo"><p>' . urldecode($row[2]) . '<div class="mdui-typo-caption-opacity">点赞数：' . $row[3] . '</div></p>';
                    echo '</div><div class="flex-grow"></div><div class="mc-options-button">    ';
                    echo '<li class="mdui-menu-item"><a onclick="copyText(\'' . $row[0] . '\')" class="mdui-ripple">复制评论ID</a></li><li class="mdui-menu-item"><a target="_blank" onclick="document.getElementById(\'chat_' . $row[0] . '\').style.display=\'none\';" href="article-chat-delete.php?id=' . $row[0] . '" class="mdui-ripple">删除评论</a></li></ul></div></div></div>    ';
                echo '</div>';

<?php
include("../check.php");
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmspage` WHERE id='".$_GET["id"]."'";
	  $result=mysqli_query($link,$str);
      sendalert("删除成功！请刷新");
  }
}
?>
<?php
include("../check.php");
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
    $timenow = date('Y-m-d H:i:s');
    $cont2=rawurlencode(htmlspecialchars($_POST["content"]));
       
    $str='  UPDATE `rapidcmspage` SET `title`="'.rawurlencode($_POST["title"]).'",`content`="'.$cont2.'",`time`="'.$timenow.'" WHERE `id`="'.$_POST["id"].'"';

	  $result=mysqli_query($link,$str);
      sendalert("修改成功！");
  }
}
?>
include("../check.php");
    <? include("../drawer.php"); ?>
                            $json_string = file_get_contents('../../install/sql-config/sql.json');
                                echo urldecode($row[1]);
                            $json_string = file_get_contents('../../install/sql-config/sql.json');
                                    echo '<option selected="selected" value="' . $row[0] . '">' . urldecode($row[1]) . '</option>';
                                    echo '<option value="' . $row[0] . '">' .  urldecode($row[1]) . '</option>';
    <script src="../src/mdui-editor/js/editor.js"></script>
        function sub1(){
            document.getElementById("area").innerHTML= document.getElementById("content").innerHTML;
            imageUploadSuffix: ['png','jpg','gif','jpeg'],
include("../header.php");
?>  <script type="text/javascript" language="javascript"> 
                            $json_string = file_get_contents('../../install/sql-config/sql.json');
                                echo "<td>".urldecode($row[1])."</td>";
<?php
include("../check.php");
$data1 = array();
if ($_POST["tool"] == "on") {
    $data1['tool'] = "true";
} else {
    $data1['tool'] = "false";
}
$data1['kind'] = $_POST["kind"];
if ($_POST["kind"] == "one") {
    $data1['content'] = '<center><p id="hitokoto"><a style="color:#000000" href="#" id="hitokoto_text">获取中...</a></p></center><script>fetch(\'https://v1.hitokoto.cn\').then(response => response.json()).then(data => {const hitokoto = document.querySelector(\'#hitokoto_text\');hitokoto.href = \'https://hitokoto.cn/?uuid=\' + data.uuid;
        if (data.from_who == null) {
        hitokoto.innerHTML = "「 " + data.hitokoto + " 」<br>——" + data.from;
        }else {
        hitokoto.innerHTML = "「 " + data.hitokoto + " 」<br>——" + data.from_who + "「" + data.from + "」"
        }}).catch(console.error)
        </script>';
} else if ($_POST["kind"] == "time") {
    $data1['content'] = '<center><a  id="time_is_link" rel="nofollow" style="display:none"></a><span id="China_z43d" style="font-size:25px;"></span><script src="https://widget.time.is/t.js"></script><script>time_is_widget.init({China_z43d:{}});</script></center>';
} else {
    $data1['content'] = $_POST["content"];
}


$json_string1 = json_encode($data1);
$filename1 = '../../resource/config/tool.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"tool.php\"</script>";
<?php
include("../header.php");

?>

<div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

    <div class="mdui-card">

        <div class="mdui-card-primary">
            <div class="mdui-card-primary-title" style="font-size:30px">小组件设置</div>
        </div>
        <form method="post" action="run-tool.php">
            <m-scrollbar style="height: 620px;width:900px">
                <div class="mdui-card-content" style="font-size:15px;text-align:left">

                    <label class="mdui-switch">
                        开启小组件&nbsp;&nbsp;&nbsp;
                        <input <?
                                if ($data_tool["tool"]  == "true") {
                                    echo " checked='true'";
                                }
                                ?> name="tool" type="checkbox" />
                        <i class="mdui-switch-icon"></i>
                    </label> <br>
                    <label class="mdui-textfield-label">选择小组件</label>
                    <select class="mdui-select" name="kind" id="kind" onchange="kindmove()" mdui-select>
                        <?

                        if ($data_tool["kind"] == "one") {
                            echo ' <option value="one" selected>一言</option>';
                            echo '   <option value="time" >时间</option>';
                            echo '   <option value="write" >自定义</option>';
                        } else if ($data_tool["kind"] == "time") {
                            echo ' <option value="one" >一言</option>';
                            echo '   <option value="time" selected>时间</option>';
                            echo '   <option value="write" >自定义</option>';
                        } else {
                            echo ' <option value="one" >一言</option>';
                            echo '   <option value="time" >时间</option>';
                            echo '   <option value="write" selected>自定义</option>';
                        }
                        ?>


                    </select> <br> <br>
                    <div id="con" style="display:none" class="mdui-textfield  mdui-textfield-has-bottom ">
                        <label class="mdui-textfield-label">输入内容</label>


                        <textarea rows="7" class="mdui-textfield-input" name="content" type="text" required=""><? echo $data_tool["content"]; ?></textarea>
                    </div>
                    <br>
                    <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">提交</button>

                </div>
            </m-scrollbar>
        </form>
    </div>

</div>
<script>
    function kindmove() {
        if (document.getElementById("kind").value == "write") {
            document.getElementById("con").style.display = "inline";
        } else {
            document.getElementById("con").style.display = "none";
        }
    }
    window.onload = () => {
        kindmove()
    }
</script>
<script src="../../../../../../resource/js/mtu.min.js"></script>
<script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
<?php
function isImage($imgPath){
if($imgPath=="jpg"||$imgPath=="png"||$imgPath=="gif"||$imgPath=="jpeg"){
return true;
}else{
  return false;
}
}

$fileInfo = $_FILES['file'];
$name = $fileInfo['name'];
$pathname = pathinfo($name)["extension"];
$filename =  pathinfo($name, PATHINFO_FILENAME);
$filePath = $fileInfo['tmp_name'];
if(isImage($pathname)==false){
  exit;
}
 //$name = iconv('utf-8', 'gb2312', $filename);
  $str = rand();
  $path = "../../upload/upload_" . md5($str) . "." . $pathname;
  move_uploaded_file($filePath, $path);
  echo json_encode([
    "code" => 0,
    "data" => [
      "url" => $path,
      "name" => $name
    ]
  ]);
<?php
include("../check.php");

header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str='INSERT INTO `rapidcmscategory`(`id`, `name`, `pic`, `num`) VALUES ("'.$_POST["id"].'","'.rawurlencode($_POST["name"]).'","'.$_POST["pic"].'",'.$_POST["num"].')';

	  $result=mysqli_query($link,$str);
      sendalert("增加成功！");
  }
}
?>
<?php
include("../header.php");

?>


<script>
    function randomString(length, ) {
        var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
        var result = '';
        for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
        return result;
    }

    function resetnum() {
        document.getElementById("ranid").value = randomString(10);
    }
    window.onload = function() {
        resetnum()
    }
</script>
<div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

    <div class="mdui-card">

        <div class="mdui-card-primary">
            <div class="mdui-card-primary-title" style="font-size:30px">分类设置</div>
        </div>

        <m-scrollbar style="height: 800px;width:900px;text-align:left ">
            <div id="login" class="mc-account mc-login mdui-dialog mdui-dialog-open " style="overflow: hidden;z-index:999;display: block; top: 150.104px; height: 700px;">
                <button class="mdui-btn mdui-btn-icon close" onclick="window.location.href='category.php'"><i class="mdui-icon material-icons">close</i></button>

                <div class="mdui-dialog-title">新增</div>
                <form method="post" action="cate-add-run.php">

                    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                        <label class="mdui-textfield-label">唯一ID（10位字符）</label>
                        <input class="mdui-textfield-input" style="width:90%" type="text" name="id" id="ranid" value="onload" required="">
                        <i style="cursor:pointer;position: absolute;left: 92%" onclick="resetnum(10)" class="mdui-icon material-icons">&#xe5d5;</i>
                    </div>
                    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                        <label class="mdui-textfield-label">名称</label>
                        <input class="mdui-textfield-input" type="text" name="name" required="">
                    </div>
                    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                        <label class="mdui-textfield-label">图标ID（在MDUI中获取&#XXXX;）</label>
                        <input class="mdui-textfield-input" style="width:90%" type="text" name="pic" required="">
                        <i style="cursor:pointer;position: absolute;left: 92%" onclick="window.open('https://www.mdui.org/docs/material_icon')" class="mdui-icon material-icons">&#xe250;</i>
                    </div>
                    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                        <label class="mdui-textfield-label">权重（大的在前面）</label>
                        <input class="mdui-textfield-input" type="number" name="num" required="">
                    </div>

                    <div class="actions mdui-clearfix">
                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button>
                    </div>
                </form>
            </div>
        </m-scrollbar>

    </div>

</div>

<script src="../../../../../../resource/js/mtu.min.js"></script>
<script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
<?php
include("../check.php");

header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmscategory` WHERE id='".$_GET["id"]."'";
	  $result=mysqli_query($link,$str);
      sendalert("删除成功！请刷新");
  }
}
?>
<?php
include("../check.php");

header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
  
      $str='  UPDATE `rapidcmscategory` SET `name`="'.rawurlencode($_POST["name"]).'",`pic`="'.$_POST["pic"].'",`num`='.$_POST["num"].' WHERE `id`="'.$_POST["id"].'"';
      
	  $result=mysqli_query($link,$str);
      sendalert("修改成功！");
  }
}
?>
include("../header.php");


$json_string = file_get_contents('../../install/sql-config/sql.json');
include("../header.php");
<script type="text/javascript" language="javascript"> 
                    $json_string = file_get_contents('../../install/sql-config/sql.json');
                        echo "<td>".urldecode($row[1])."</td>";
<?php
include("../../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: ../admin_user/login.php");
}

?>
<? include("../header.php"); ?>
<? include("../header.php"); ?>
<?php
include("../check.php");

$data1 = array();
if($_POST["close"]=="on"){
    $data1['close'] = "true";
}else{
    $data1['close'] = "false";
}
$data1['template'] = $data_index["template"];
$data1['version'] = $data_index["version"];
$data1['rewrite'] = $data_index["rewrite"];

$json_string1 = json_encode($data1);
$filename1 = '../../resource/config/index.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"server.php\"</script>";
<?php
include("../check.php");

$data1 = array();
if($_POST["logonwithmail"]=="on"){
    $data1['logonwithmail'] = "true";
}else{
    $data1['logonwithmail'] = "false";
}
$data1['smtp'] = $_POST["smtp"];
$data1['secure'] = $_POST["secure"];
$data1['port'] = $_POST["port"];
$data1['username'] = $_POST["username"];
$data1['password'] = $_POST["password"];
$json_string1 = json_encode($data1);
$filename1 = '../../resource/config/mail.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"mail.php\"</script>";
<?php
include("../check.php");

$data1 = array();
if($_POST["rewrite"]=="on"){
    $data1['rewrite'] = "true";
}else{
    $data1['rewrite'] = "false";
}
$data1['template'] = $data_index["template"];
$data1['version'] = $data_index["version"];
$data1['close'] = $data_index["close"];

$json_string1 = json_encode($data1);
$filename1 = '../../resource/config/index.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"rewrite.php\"</script>";
<?php
include("../check.php");
$data1 = array();
$data1['headname'] = $_POST["headname"];
$data1['title'] = $_POST["title"];
$data1['icon'] =  $data_header["icon"];
$data1['description'] = $_POST["description"];
$data1['keywords'] = $_POST["keywords"];
$data1['introduce'] = $_POST["introduce"];
$data1['con'] = $_POST["con"];
$json_string1 = json_encode($data1);
$filename1 = '../../resource/config/header.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"setting.php\"</script>";
<? include("../header.php"); ?>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">


        <div class="mdui-card" style="width:900px">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">网站服务设置</div>
            </div>
            <form method="post" action="run-close.php">
            <div class="mdui-card-content" style="font-size:15px;text-align:left">
            <label class="mdui-switch">
                            启用网页维护&nbsp;&nbsp;&nbsp;
                            <input <?
                                    if ($data_index["close"]  == "true") {
                                        echo " checked='true'";
                                    }
                                    ?> name="close" type="checkbox" />
                            <i class="mdui-switch-icon"></i>
                        </label> 
                        <br> <br>
                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">确认</button>
                  
            </div>
            </form>
        </div>
        <br>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
<? include("../header.php"); ?>
include("../check.php");
  $path = "../../" . $path1;
  $filename1 = '../../resource/config/header.json';
  echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"setting.php\"</script>";
        <a href="../../admin/index.php">
                <a href="../../admin/config/setting.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">基本设置</a>
                <a href="../../admin/config/server.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">服务设置</a>
                <a href="../../admin/config/mail.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">邮件设置</a>
                <a href="../../admin/config/rewrite.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">伪静态设置</a>
        <a href="../../admin/user/user.php">
                <a href="../../admin/category/category.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">查看分类</a>
                <a href="../../admin/category/cate-add.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">新增分类</a>
                <a href="../../admin/article/article.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">查看文章</a>
                <a href="../../admin/article/article-add.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">新增文章</a>
                <a href="../../admin/article/tool.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">小组件</a>
        <a href="../../admin/function/temp.php">
        <a href="../../admin/function/plugin.php">
        <div class="mdui-collapse" mdui-collapse>
            <div class="mdui-collapse-item">
                <div class="mdui-collapse-item-header">
                    <li class="mdui-collapse-item-header mdui-list-item mdui-ripple" style="font-size:15px!important">
                    <i class="mdui-list-item-icon mdui-icon material-icons">assignment_ind</i>
                        <div class="mdui-list-item-content" style="font-size:15px!important">账户</div>
                        <div class="mdui-collapse-item-arrow">
                            <i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
                        </div>
                    </li>
                </div>
                <div class="mdui-collapse-item-body mdui-list">
                <a href="../../admin/admin_user/movepass.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">修改密码</a>
                <a href="../../admin/admin_user/loginout.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">退出登录</a>
                </div>
            </div>
        </div>

                <a href="../../admin/system/update.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">检查更新</a>
                <a href="../../admin/function/plus.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">高级功能</a>
                <a href="../../admin/system/about.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">关于</a>
      
</div>
<?php
include("../header.php");

?>
    <div class="medium" style=" text-align:center;display: flex">

        <div>
            <div style="color:black;font-size: 20px;" class="mdui-typo">
                <h1 style="font-weight: bold;">插件获取</h1>
                <h5>插件名称：<?php echo $_GET["name"]; ?> </h5>
                
                <br>


                <?php

$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  
file_put_contents("../../plugin/".$_GET["name"].".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/plugin/".$_GET["name"].".zip", false, stream_context_create($arrContextOptions)));
            
require_once('../src/pclzip.lib.php');

                $zip = new PclZip("../plugin/".$_GET["name"].".zip");
                $result = $zip->extract(PCLZIP_OPT_PATH, "../plugin/");
                if ($result == 0) {
                    echo '<br>输入错误';
                    unlink("../../plugin/" . $_GET["name"] . ".zip");
                } else {
                    echo '<br>导入成功';
                    unlink("../../plugin/" . $_GET["name"] . ".zip");
                }

                ?>
            </div>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../header.php");

?>
    <div class="medium" style=" text-align:center;display: flex">

        <div>
            <div style="color:black;font-size: 20px;" class="mdui-typo">
                <h1 style="font-weight: bold;">模板获取</h1>
                <h5>模板名称：<?php echo $_GET["name"]; ?> </h5>
                
                <br>


                <?php

$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  
file_put_contents("../../template/".$_GET["name"].".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/".$_GET["name"].".zip", false, stream_context_create($arrContextOptions)));
            
                require_once('../src/pclzip.lib.php');

                $zip = new PclZip("../../template/" .$_GET["name"].".zip");
                $result = $zip->extract(PCLZIP_OPT_PATH, "../template/");
                if ($result == 0) {
                    echo '<br>输入错误';
                    unlink("../../template/" . $_GET["name"] . ".zip");
                } else {
                    echo '<br>导入成功';
                    unlink("../../template/" . $_GET["name"] . ".zip");
                }

                ?>
            </div>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../check.php");
function removeDir($dirName)
{
    if (!is_dir($dirName)) {
        return false;
    }
    $handle = @opendir($dirName);
    while (($file = @readdir($handle)) !== false) {
        if ($file != '.' && $file != '..') {
            $dir = $dirName . '/' . $file;
            is_dir($dir) ? removeDir($dir) : @unlink($dir);
        }
    }
    closedir($handle);
    @rmdir($dirName);
}
removeDir('../../plugin/' . $_GET["id"]);
echo "<script type='text/javascript'>window.location.href='plugin.php'</script>";
<?php
include("../check.php");
$json_string=file_get_contents('../../plugin/'. $_GET["id"]."/version.json");
$row = json_decode($json_string, true);
if($row["use"]==true){
    $data = array();
    $data['key'] =$row["key"];
    $data['name'] = $row["name"];
    $data['version'] = $row["version"];
    $data['author'] = $row["author"];
    $data['use'] = false;
    $json_string = json_encode($data);
    
    file_put_contents('../../plugin/'. $_GET["id"]."/version.json", $json_string);

   }else{
    $data = array();
    $data['key'] =$row["key"];
    $data['name'] = $row["name"];
    $data['version'] = $row["version"];
    $data['author'] = $row["author"];
    $data['use'] = true;
    $json_string = json_encode($data);
    
    file_put_contents('../../plugin/'. $_GET["id"]."/version.json", $json_string);
   }
   echo "<script type='text/javascript'>window.location.href='plugin.php'</script>"
?>
<?php
include("../header.php");

?>
<script type="text/javascript" language="javascript">
    function confirmAct() {
        if (confirm('确定要删除插件吗?')) {
            return true;
        }
        return false;
    }

    function confirmAct1() {
        if (confirm('确定要禁用插件吗?')) {
            return true;
        }
        return false;
    }

    function confirmAct2() {
        if (confirm('确定要启用插件吗?')) {
            return true;
        }
        return false;
    }
</script>
<div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

    <div class="mdui-card" style="overflow:scroll">

        <div class="mdui-card-primary">
            <div class="mdui-card-primary-title" style="font-size:30px;">插件设置</div>

        </div>
        <div class="mdui-divider"></div> <br>
        <m-scrollbar style="height: 650px;width:900px;">

            <form method="get" action="download-plugin.php" style="text-align:left;padding:0 0 0 250px">
                <div style="  display: flex;gap: 47px;">

                    <div>输入Key加载插件：<input style="width:300px" class="mdui-textfield-input" name="name" type="text" value="" required=""> </div>
                    <div><button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
                    </div>




                </div>
            </form>
            <br>
            <div class="mdui-divider"></div> <br>
            <div style="width:90%;position: absolute;left: 50%;    transform: translateX(-50%  );" class="mdui-table-fluid">

                <table class="mdui-table">
                    <thead>
                        <tr>
                            <th>ID-Key</th>
                            <th>名称</th>
                            <th>版本</th>
                            <th>作者</th>
                            <th>状态</th>
                            <th class="mdui-table-col-numeric"> </th>
                        </tr>
                    </thead>
                    <tbody>

                        <?php




                        $file = scandir("../../plugin");

                        for ($i = 2; $i < count($file); $i++) {
                            if ($file[$i] == ".gitkeep") {
                            } else {
                                $json_string = file_get_contents('../../plugin/' . $file[$i] . "/version.json");
                                $row = json_decode($json_string, true);
                                echo "<tr>";
                                echo "</tr>";
                                echo "<td>" . $row["key"] . "</td>";
                                echo "<td>" . $row["name"] . "</td>";
                                echo "<td>" . $row["version"] . "</td>";
                                echo "<td>" . $row["author"] . "</td>";
                                if ($row["use"] == true) {
                                    echo "<td style='color:green'><strong>启用</strong></td>";
                                    echo '<td><a target="_blank" href="' . '../../plugin/' . $file[$i] . "/setting.php" . '"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
                                    echo '<a onclick="return confirmAct1();" href="plugin-move.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe644;</i></button></a>';
                                } else {
                                    echo "<td style='color:red'><strong>禁用</strong></td>";
                                    echo '<td><a target="_blank" href="' . '../../plugin/' . $file[$i] . "/setting.php" . '"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
                                    echo '<a onclick="return confirmAct2();" href="plugin-move.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe86c;</i></button></a>';
                                }


                                echo '<a onclick="return confirmAct();" href="plugin-del.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe872;</i></button></a>&nbsp;';

                                echo "</td>";
                            }
                        }



                        ?>


                    </tbody>
                </table>
            </div>
        </m-scrollbar>

    </div>

</div>

<script src="../../../../../../resource/js/mtu.min.js"></script>
<script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
include("../check.php");
$json_string = file_get_contents('../../install/sql-config/sql.json');
copydir("../../resource/config", $dir . "config");

include("../check.php");
require_once('../src/pclzip.lib.php');
require_once('../src/pclzip.lib.php');

include("../check.php");
$json_string = file_get_contents('../../install/sql-config/sql.json');
<?php
include("../header.php");

?>
    <br><br>
    <div style=" position:  relative;left:15%">
        <div class="mdui-card" style="width:70%;height:300px; ">
            <div class="mdui-card-primary" style="text-align:center;">
                <div class="mdui-card-primary-title" style="font-size:30px">从SharkCMS迁移数据</div>
            </div>
            <br>
            <label class="mdui-textfield-label">&nbsp;&nbsp;&nbsp;选择导入方式</label>
            &nbsp;&nbsp;&nbsp;
            <label class="mdui-radio">
                <input type="radio" name="group1" checked />
                <i class="mdui-radio-icon"></i>
                从本程序所在数据库导入
            </label>

            <label class="mdui-radio">
                <input type="radio" name="group1" disabled />
                <i class="mdui-radio-icon"></i>
                从其他数据库导入（暂不支持）
            </label>
            <br>  <br>
            &nbsp;&nbsp;&nbsp;<a href="plus-shark-run.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-text-color-black action-btn">一键导入文章</button></a>
       
        </div>
    </div>
    <br>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../header.php");

?>
    <br><br>
    <div style=" position:  relative;left:15%">
        <div class="mdui-card" style="width:70%;height:300px; ">
            <div class="mdui-card-primary" style="text-align:center;">
                <div class="mdui-card-primary-title" style="font-size:30px">数据设置</div>
            </div>
            <div class="mdui-tab" mdui-tab>
                <a href="#move1" class="mdui-ripple">备份数据</a>
                <a href="#move2" class="mdui-ripple">导入备份</a>
           <a href="#move3" class="mdui-ripple">迁移数据</a> 
            </div>
            <div id="move1" class="mdui-p-a-2">
            <label class="mdui-textfield-label">备份系统数据，树立安全意识</label>
               
                <a href="plus-back-run.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">备份数据</button></a>
           </div>
            <div id="move2" class="mdui-p-a-2">
            <label class="mdui-textfield-label">配置文件暂不支持，请解压后手动复制粘贴</label>
            
           <!--    <form enctype="multipart/form-data" id="fileupdateform" method="post" action="plus-back-upload-sql.php"><button for="file" onclick="document.getElementById('file').click()" type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">导入.sql文件</button><br>                    <input style="display: none;" onchange="document.getElementById('fileupdateform').submit()"   name="file"  id="file" type="file" required=""></form>
    --></div>
           <div id="move3" class="mdui-p-a-2">
            <label class="mdui-textfield-label">迁移其他数据，便捷导入内容</label>
                   <a href="plus-shark.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-text-color-black action-btn">从SharkCMS迁移数据</button></a>
       
            </div>
         </div>
    </div>
    <br>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../check.php");
$data1 = array();
$data1['template'] = $_POST["template"];
$data1['version'] = $data_index["version"];
$data1['rewrite'] = $data_index["rewrite"];
$data1['close'] = $data_index["close"];
$json_string1 = json_encode($data1);
$filename1 = '../../resource/config/index.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
sendalert("修改成功！");
<?php
include("../header.php");

?>
    <div style=" position:  relative;left:25%;top:10%">


        <div class="mdui-card" style="width:600px">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">设置模板</div>
            </div>
            <m-scrollbar style="font-size:15px;height: 400px">
                <div class="mdui-card-content" style="font-size:18px;text-align:left">
                    当前模板：<? echo $data_index["template"] ?>
                    &nbsp;&nbsp;&nbsp;          &nbsp;&nbsp;&nbsp;          &nbsp;&nbsp;     <a  target="_blank" href="../../../../template/<? echo $data_index["template"] ?>/setting.php"><button type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">模板单独设置</button></a><br><br>
                    <form method="post" action="temp-run.php"> 切换模板：
                        <select class="mdui-select" name="template" mdui-select>



                            <?php

                            $file = scandir("../../template");

                            for ($i = 2; $i < count($file); $i++) {
                                echo '  <option value="' . $file[$i] . '">' . $file[$i] . '</option>';
                            }
                            ?></select>
                        &nbsp;&nbsp;&nbsp;
                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
                    </form>
                    <form method="get" action="download-template.php"> 输入Key加载模板：
                      <div style="display: inline;">  
                    <input style="width:300px" class="mdui-textfield-input" name="name" type="text"
                                value="" required="">
                                <br>
                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
                        </div>
                    </form>
                    <a  target="_blank" href="https://www.yuque.com/rapid/cms/yo0y1er0vg6rl86g"><button type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">进入文档获取模板</button><br><br></a>
                     

                </div>
            </m-scrollbar>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<? include("check.php"); ?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("../drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
$json_string = file_get_contents('../install/sql-config/sql.json');
    Header("Location: admin_user/login.php");
<?php
include("../header.php");

?>
<div class="medium" style=" text-align:center;display: flex;gap: 47px;">
    <img style="Border-radius:10px" width="200px" src="../../../upload/logo.png">
    <div>
        <div style="color:black;font-size: 20px;" class="mdui-typo">
            <h1 style="font-weight: bold;">RapidCMS</h1>
        </div>
        <div style="color:black;font-size: 10px;" class="mdui-typo">
            <h1>简单好用的官网CMS系统</h1>
        </div>
    </div>
</div>

<script src="../../../../../../resource/js/mtu.min.js"></script>
<script src="../../../../../../resource/js/mdui.min.js"></script>

</body>
</html>
<?php
include("../header.php");

?>
    <div class="medium" style=" text-align:center;display: flex">

        <div>
            <div style="color:black;font-size: 20px;" class="mdui-typo">
                <h1 style="font-weight: bold;">版本更新</h1>
                <h5>正在更新中，版本：<?php echo $_GET["version"]; ?> </h5>

                <br>


                <?php

                $arrContextOptions = array(
                    "ssl" => array(
                        "verify_peer" => false,
                        "verify_peer_name" => false,
                    ),
                );
                file_put_contents("../../upload/" . $_GET["version"] . ".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/version/" . $_GET["version"] . ".zip", false, stream_context_create($arrContextOptions)));

                require_once('../src/pclzip.lib.php');

                $zip = new PclZip("../../upload/" . $_GET["version"] . ".zip");
                $result = $zip->extract(PCLZIP_OPT_PATH, "../");
                if ($result == 0) {
                    echo '<br>更新失败';
                    unlink("../../upload/" . $_GET["version"] . ".zip");
                } else {
                    echo '<br>更新成功';
                    unlink("../../upload/" . $_GET["version"] . ".zip");
                }

                ?>
            </div>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
include("../header.php");
<?php
include("../check.php");

header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmsuser` WHERE username='".$_GET["username"]."'";
	  $result=mysqli_query($link,$str);
      sendalert("删除成功！");
  }
}
?>
<?php
include("../check.php");

header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
    $password1=md5(sha1(md5($_POST["password"])));
      $str="UPDATE `rapidcmsuser` SET `password`= '".$password1."' WHERE username='".$_POST["username"]."'";

	  $result=mysqli_query($link,$str);
    sendalert("修改成功！");
  }
}
?>
<?php
include("../header.php");

?>

    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">用户设置</div>
            </div>
           
                <m-scrollbar style="height: 650px;width:900px;text-align:left ">
                <div id="login" class="mc-account mc-login mdui-dialog mdui-dialog-open " style="overflow: hidden;z-index:999;display: block; top: 150.104px; height: 540.792px;">
                <button class="mdui-btn mdui-btn-icon close" onclick="window.location.href='user.php'"><i class="mdui-icon material-icons">close</i></button>
 
<div class="mdui-dialog-title">修改用户密码</div>
<form method="post" action="user-move-run.php">
<div style="display:none" class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom "><label class="mdui-textfield-label">用户名</label><input class="mdui-textfield-input" value="<?echo $_GET["username"]?>"  name="username" type="text" >
        <div class="mdui-textfield-error">账号不能为空</div>
    </div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom "><label class="mdui-textfield-label">用户名</label><input class="mdui-textfield-input" value="<?echo $_GET["username"]?>" type="text" disabled="true">
        <div class="mdui-textfield-error">账号不能为空</div>
    </div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom"><label class="mdui-textfield-label">新密码</label><input class="mdui-textfield-input" name="password" type="password" required="">
        <div class="mdui-textfield-error">密码不能为空</div>
    </div>
    <div class="actions mdui-clearfix">
       <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">修改</button>
    </div>
</form>
</div>
                </m-scrollbar>
  
        </div>

    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>



<?php
include("../header.php");

?>

    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card" style="overflow:scroll">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px;">用户设置</div>
            </div>
           
                <m-scrollbar style="height: 650px;width:900px;">
                    <div style="width:80%;position: absolute;left: 50%;    transform: translateX(-50%  );"  class="mdui-table-fluid">
                        <table class="mdui-table">
                            <thead>
                                <tr>
                                    <th>用户名</th>
                                    <th>用户状态</th>
                                    <th  class="mdui-table-col-numeric"> </th>
                                </tr>
                            </thead>
                            <tbody>

                    <?php
                    $table_name = "rapidcmsuser";
                    $json_string = file_get_contents('../../install/sql-config/sql.json');
                    $data = json_decode($json_string, true);
                    $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
                    $sql = 'select * from `' . $table_name . '`';
                    $res = mysqli_query($conn, $sql);
                    $colums = mysqli_num_fields($res);
                    while ($row = mysqli_fetch_row($res)) {
                       echo "<tr>";
                        echo "</tr>";
                        echo "<td>$row[0]</td>";
                        echo "<td>$row[2]</td>";
                        echo '<td ><a href="user-del.php?username='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe872;</i></button></a>&nbsp;&nbsp;&nbsp;&nbsp;';
                        echo '<a href="user-move.php?username='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a></td>';
                    }
                    ?>
                                  
                               
                            </tbody>
                        </table>
                    </div>
                </m-scrollbar>
  
        </div>

    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
{"lock":"install"}
{"template":"default","version":"1.3.1","rewrite":"false","close":"false"}
{"tool":"true","kind":"time","content":"<center><a  id=\"time_is_link\" rel=\"nofollow\" style=\"display:none\"><\/a><span id=\"China_z43d\" style=\"font-size:25px;\"><\/span><script src=\"https:\/\/widget.time.is\/t.js\"><\/script><script>time_is_widget.init({China_z43d:{}});<\/script><\/center>"}
<style>
    * {
        font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    }
</style>
                echo ' <div class="mdui-typo" style="padding: 10px;">' . $data_tool["content"] . '</div><br></div><br>';
<style>
    * {
        font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    }
</style>
<body class=" mdui-appbar-with-toolbar mdui-theme-accent-white  mdui-theme-primary-white mdui-text-color-black mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-white mdui-text-color-black mdui-appbar mdui-appbar-fixed mdui-headroom">