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

205 lines
7.3KB

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