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

108 lines
3.7KB

  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/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. </head>
  11. <body>
  12. <table align="center" class="table maintable my-3">
  13. <tr>
  14. <td>
  15. <a href="sys_data.php" class="btn btn-success btn-sm">数据备份</a>
  16. <a href="sys_sql_query.php" class="btn btn-success btn-sm">SQL命令工具</a>
  17. </td>
  18. </tr>
  19. </table>
  20. <form name="form1" onSubmit="checkSubmit();" action="sys_data_done.php" method="post" target="stafrm">
  21. <input type="hidden" name="dopost" value="redat">
  22. <input type="hidden" name="bakfiles">
  23. <table align="center" class="table maintable my-3">
  24. <tr>
  25. <td bgcolor="#f8fafb" colspan="4">数据还原</td>
  26. </tr>
  27. <tr>
  28. <td colspan="4">发现的备份文件:<?php if (count($filelists)==0) echo " 没找到任何备份文件 ";?></td>
  29. </tr>
  30. <?php
  31. for ($i=0;$i<count($filelists);$i++)
  32. {
  33. echo "<tr align='center'>";
  34. $mtd = "<td width='10%'><input name='bakfile' id='bakfile' type='checkbox' value='".$filelists[$i]."' checked></td><td width='40%'>{$filelists[$i]}</td>";
  35. echo $mtd;
  36. if (isset($filelists[$i+1])) {
  37. $i++;
  38. $mtd = "<td width='10%'><input name='bakfile' id='bakfile' type='checkbox' value='".$filelists[$i]."' checked></td><td width='40%'>{$filelists[$i]}</td>";
  39. echo $mtd;
  40. } else {
  41. echo "<td></td><td></td>";
  42. }
  43. echo "</tr>";
  44. }
  45. ?>
  46. <tr>
  47. <td colspan="4">
  48. <label><input name="structfile" type="checkbox" id="structfile" value="<?php echo $structfile?>" checked> 还原表结构信息(<?php echo $structfile?>)</label>
  49. <label><input name="delfile" type="checkbox" id="delfile" value="1"> 还原后删除备份文件</label>
  50. <button name="b1" type="button" id="b1" onclick="SelAll();" class="btn btn-success btn-sm">全选</button>
  51. <button name="b2" type="button" id="b2" onclick="ReSel();" class="btn btn-success btn-sm">反选</button>
  52. <button name="b3" type="button" id="b3" onclick="NoneSel();" class="btn btn-success btn-sm">取消</button>
  53. <button type="submit" name="submit" class="btn btn-success btn-sm">还原</button>
  54. </td>
  55. </tr>
  56. <tr>
  57. <td colspan="4">
  58. <div class="admin-win-iframe"><iframe name="stafrm" frameborder="0" id="stafrm" width="100%" height="100%"></iframe></div>
  59. </td>
  60. </tr>
  61. </table>
  62. </form>
  63. <script>
  64. //获得选中文件的数据表
  65. function getCheckboxItem() {
  66. var myform = document.form1;
  67. var allSel = '';
  68. if (myform.bakfile.value) return myform.bakfile.value;
  69. for (i = 0; i < myform.bakfile.length; i++) {
  70. if (myform.bakfile[i].checked) {
  71. if (allSel == "")
  72. allSel = myform.bakfile[i].value;
  73. else
  74. allSel = allSel + "," + myform.bakfile[i].value;
  75. }
  76. }
  77. return allSel;
  78. }
  79. //反选
  80. function ReSel() {
  81. var myform = document.form1;
  82. for (i = 0; i < myform.bakfile.length; i++) {
  83. if (myform.bakfile[i].checked) myform.bakfile[i].checked = false;
  84. else myform.bakfile[i].checked = true;
  85. }
  86. }
  87. //全选
  88. function SelAll() {
  89. var myform = document.form1;
  90. for (i = 0; i < myform.bakfile.length; i++) {
  91. myform.bakfile[i].checked = true;
  92. }
  93. }
  94. //取消
  95. function NoneSel() {
  96. var myform = document.form1;
  97. for (i = 0; i < myform.bakfile.length; i++) {
  98. myform.bakfile[i].checked = false;
  99. }
  100. }
  101. function checkSubmit() {
  102. var myform = document.form1;
  103. myform.bakfiles.value = getCheckboxItem();
  104. return true;
  105. }
  106. </script>
  107. </body>
  108. </html>