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

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