国内流行的内容管理系统(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.

208 lines
7.4KB

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