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

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