国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

221 lines
7.9KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
  6. <title>数据备份</title>
  7. <link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
  8. <link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="/static/web/css/admin.css">
  10. <script src="/static/web/js/jquery.min.js"></script>
  11. <script src="/static/web/js/bootstrap.min.js"></script>
  12. <script src="/static/web/js/webajax.js"></script>
  13. <script src="/static/web/js/admin.main.js"></script>
  14. </head>
  15. <body>
  16. <div class="container-fluid">
  17. <ol class="breadcrumb">
  18. <li class="breadcrumb-item"><a href="index_body.php">后台面板</a></li>
  19. <li class="breadcrumb-item active">数据备份</li>
  20. </ol>
  21. <div class="card shadow-sm mb-3">
  22. <div class="card-body">
  23. <a href="sys_data_revert.php" class="btn btn-success btn-sm">数据还原</a>
  24. <a href="sys_sql_query.php" class="btn btn-success btn-sm">SQL命令工具</a>
  25. </div>
  26. </div>
  27. <div class="card shadow-sm">
  28. <div class="card-header">数据备份</div>
  29. <div class="card-body">
  30. <form name="form1" action="sys_data_done.php?dopost=bak" method="post" target="stafrm" onSubmit="checkSubmit();">
  31. <input type="hidden" name="tablearr">
  32. <div class="table-responsive">
  33. <table class="table table-borderless">
  34. <thead>
  35. <tr>
  36. <td colspan="8">系统默认表</td>
  37. </tr>
  38. <tr>
  39. <td scope="col">选择</td>
  40. <td scope="col">表名</td>
  41. <td scope="col">记录数</td>
  42. <td scope="col">操作</td>
  43. <td scope="col">选择</td>
  44. <td scope="col">表名</td>
  45. <td scope="col">记录数</td>
  46. <td scope="col">操作</td>
  47. </tr>
  48. </thead>
  49. <tbody>
  50. <?php
  51. for ($i=0; isset($dedeSysTables[$i]); $i++)
  52. {
  53. $t = $dedeSysTables[$i];
  54. echo "<tr>";
  55. ?>
  56. <td><input type="checkbox" name="tables" value="<?php echo $t;?>" checked></td>
  57. <td><?php echo $t;?></td>
  58. <td><?php echo TjCount($t,$dsql);?></td>
  59. <td>
  60. <a href="javascript:LoadUrl('dopost=opimize&tablename=<?php echo $t;?>');" class="btn btn-light btn-sm">优化</a>
  61. <a href="javascript:LoadUrl('dopost=repair&tablename=<?php echo $t;?>');" class="btn btn-light btn-sm">修复</a>
  62. <a href="javascript:LoadUrl('dopost=viewinfo&tablename=<?php echo $t;?>');" class="btn btn-light btn-sm">结构</a>
  63. </td>
  64. <?php
  65. $i++;
  66. if (isset($dedeSysTables[$i])) {
  67. $t = $dedeSysTables[$i];
  68. ?>
  69. <td><input type="checkbox" name="tables" value="<?php echo $t;?>" checked></td>
  70. <td><?php echo $t;?></td>
  71. <td><?php echo TjCount($t,$dsql);?></td>
  72. <td>
  73. <a href="javascript:LoadUrl('dopost=opimize&tablename=<?php echo $t;?>');" class="btn btn-light btn-sm">优化</a>
  74. <a href="javascript:LoadUrl('dopost=repair&tablename=<?php echo $t;?>');" class="btn btn-light btn-sm">修复</a>
  75. <a href="javascript:LoadUrl('dopost=viewinfo&tablename=<?php echo $t;?>');" class="btn btn-light btn-sm">结构</a>
  76. </td>
  77. <?php
  78. } else {
  79. echo "<td></td><td></td><td></td><td></td>";
  80. }
  81. echo "</tr>";
  82. }
  83. ?>
  84. </tbody>
  85. <thead>
  86. <tr>
  87. <td colspan="8">其他数据表</td>
  88. </tr>
  89. <tr>
  90. <td scope="col">选择</td>
  91. <td scope="col">表名</td>
  92. <td scope="col">记录数</td>
  93. <td scope="col">操作</td>
  94. <td scope="col">选择</td>
  95. <td scope="col">表名</td>
  96. <td scope="col">记录数</td>
  97. <td scope="col">操作</td>
  98. </tr>
  99. </thead>
  100. <tbody>
  101. <?php
  102. for ($i=0; isset($otherTables[$i]); $i++)
  103. {
  104. $t = $otherTables[$i];
  105. echo "<tr>";
  106. ?>
  107. <td><input type="checkbox" name="tables" value="<?php echo $t;?>"></td>
  108. <td><?php echo $t;?></td>
  109. <td><?php echo TjCount($t,$dsql);?></td>
  110. <td>
  111. <a href="javascript:LoadUrl('dopost=opimize&tablename=<?php echo $t;?>');" class="btn btn-light btn-sm">优化</a>
  112. <a href="javascript:LoadUrl('dopost=repair&tablename=<?php echo $t;?>');" class="btn btn-light btn-sm">修复</a>
  113. <a href="javascript:LoadUrl('dopost=viewinfo&tablename=<?php echo $t;?>');" class="btn btn-light btn-sm">结构</a>
  114. </td>
  115. <?php
  116. $i++;
  117. if (isset($otherTables[$i])) {
  118. $t = $otherTables[$i];
  119. ?>
  120. <td><input type="checkbox" name="tables" value="<?php echo $t;?>"></td>
  121. <td><?php echo $t;?></td>
  122. <td><?php echo TjCount($t,$dsql);?></td>
  123. <td>
  124. <a href="javascript:LoadUrl('dopost=opimize&tablename=<?php echo $t;?>');" class="btn btn-light btn-sm">优化</a>
  125. <a href="javascript:LoadUrl('dopost=repair&tablename=<?php echo $t;?>');" class="btn btn-light btn-sm">修复</a>
  126. <a href="javascript:LoadUrl('dopost=viewinfo&tablename=<?php echo $t;?>');" class="btn btn-light btn-sm">结构</a>
  127. </td>
  128. <?php
  129. } else {
  130. echo "<td></td><td></td><td></td><td></td>";
  131. }
  132. echo "</tr>";
  133. }
  134. ?>
  135. <tr>
  136. <td colspan="8">
  137. <label>分卷大小:<input name="fsize" type="text" id="fsize" value="2048" class="admin-input-sm"> K</label>
  138. <label><input type="checkbox" name="isstruct" id="isstruct" value="1" checked> 备份结构</label>
  139. <?php if (@function_exists('gzcompress') && false) {?>
  140. <label><input type="checkbox" name="iszip" id="iszip" value="1" checked> 完成后压缩成ZIP</label>
  141. <?php }?>
  142. <a href="javascript:SelAll();" class="btn btn-success btn-sm">全选</a>
  143. <a href="javascript:ReSel();" class="btn btn-success btn-sm">反选</a>
  144. <a href="javascript:NoneSel();" class="btn btn-success btn-sm">取消</a>
  145. <button type="submit" class="btn btn-success btn-sm">备份</button>
  146. </td>
  147. </tr>
  148. <tr>
  149. <td colspan="8">
  150. <div class="admin-win-iframe"><iframe name="stafrm" frameborder="0" id="stafrm" width="100%" height="100%"></iframe></div>
  151. </td>
  152. </tr>
  153. </tbody>
  154. </table>
  155. </div>
  156. </form>
  157. </div>
  158. </div>
  159. </div>
  160. <script>
  161. var posLeft = 200;
  162. var posTop = 150;
  163. function LoadUrl(surl) {
  164. fetch("sys_data.php?" + surl).then(resp => {
  165. if (resp.ok) {
  166. return resp.text()
  167. }
  168. throw new Error('x');
  169. }).then((d) => {
  170. ShowMsg(d, {
  171. size: "modal-lg"
  172. });
  173. }).catch((error) => {
  174. ShowMsg("操作失败");
  175. });
  176. }
  177. //获得选中文件的数据表
  178. function getCheckboxItem() {
  179. var myform = document.form1;
  180. var allSel = '';
  181. if (myform.tables.value) return myform.tables.value;
  182. for (i = 0; i < myform.tables.length; i++) {
  183. if (myform.tables[i].checked) {
  184. if (allSel == "")
  185. allSel = myform.tables[i].value;
  186. else
  187. allSel = allSel + "," + myform.tables[i].value;
  188. }
  189. }
  190. return allSel;
  191. }
  192. //反选
  193. function ReSel() {
  194. var myform = document.form1;
  195. for (i = 0; i < myform.tables.length; i++) {
  196. if (myform.tables[i].checked) myform.tables[i].checked = false;
  197. else myform.tables[i].checked = true;
  198. }
  199. }
  200. //全选
  201. function SelAll() {
  202. var myform = document.form1;
  203. for (i = 0; i < myform.tables.length; i++) {
  204. myform.tables[i].checked = true;
  205. }
  206. }
  207. //取消
  208. function NoneSel() {
  209. var myform = document.form1;
  210. for (i = 0; i < myform.tables.length; i++) {
  211. myform.tables[i].checked = false;
  212. }
  213. }
  214. function checkSubmit() {
  215. var myform = document.form1;
  216. myform.tablearr.value = getCheckboxItem();
  217. return true;
  218. }
  219. </script>
  220. </body>
  221. </html>