382ad7281dbdf0a8955ce46e51354a20.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:84:"C:\phpStudy\PHPTutorial\WWW\aqm-web\public/../application/admin\view\db\restore.html";i:1557480234;s:75:"C:\phpStudy\PHPTutorial\WWW\aqm-web\application\admin\view\layout\home.html";i:1557480234;s:82:"C:\phpStudy\PHPTutorial\WWW\aqm-web\application\admin\view\layout\admin_items.html";i:1557480234;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <title>安全猫官网</title>
  8. <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  9. <!-- Bootstrap 3.3.7 -->
  10. <link rel="stylesheet" href="<?php echo PLUGINS_SITE_ROOT; ?>/layui/css/layui.css">
  11. <link rel="stylesheet" href="<?php echo ADMIN_SITE_ROOT; ?>/css/admin.css">
  12. <link rel="stylesheet" href="<?php echo ADMIN_SITE_ROOT; ?>/iconfont/iconfont.css">
  13. <script src="<?php echo PLUGINS_SITE_ROOT; ?>/jquery-2.1.4.min.js"></script>
  14. <script src="<?php echo ADMIN_SITE_ROOT; ?>/js/admin.js"></script>
  15. <script type="text/javascript" src="<?php echo PLUGINS_SITE_ROOT; ?>/layui/layui.js"></script>
  16. <script type="text/javascript">
  17. var BASESITEROOT = "<?php echo BASE_SITE_ROOT; ?>";
  18. var ADMINSITEROOT = "<?php echo ADMIN_SITE_ROOT; ?>";
  19. var BASESITEURL = "<?php echo BASE_SITE_URL; ?>";
  20. var HOMESITEURL = "<?php echo HOME_SITE_URL; ?>";
  21. var ADMINSITEURL = "<?php echo ADMIN_SITE_URL; ?>";
  22. layui.use('layer', function () {
  23. var layer = layui.layer;
  24. });
  25. </script>
  26. </head>
  27. <body>
  28. <div class="layui-tab layui-tab-card">
  29. <?php if($admin_item): ?>
  30. <ul class="layui-tab-title">
  31. <?php if(is_array($admin_item) || $admin_item instanceof \think\Collection || $admin_item instanceof \think\Paginator): if( count($admin_item)==0 ) : echo "" ;else: foreach($admin_item as $key=>$item): if(array_intersect(explode(" ",str_replace("/", ".",substr($item['url'],7,-5))),$allpower) || array_intersect(explode(" ",str_replace("/", ".",substr($item['url'],31,-16))),$allpower)): ?>
  32. <li <?php if($item['name'] == $curitem): ?>class="layui-this" <?php endif; ?>>
  33. <a href="<?php echo $item['url']; ?>"><?php echo $item['text']; ?></a>
  34. <?php endif; ?>
  35. </li>
  36. <?php endforeach; endif; else: echo "" ;endif; ?>
  37. <div class="tool-btns">
  38. <a href="javascript:location.reload();" title="刷新当前页面" class="iconfont icon-reload"></i></a>
  39. </div>
  40. </ul>
  41. <?php endif; ?>
  42. <!-- 操作说明 -->
  43. <div class="layui-tab-content page-tab-content" id="flexigrid">
  44. <div class="explanation" id="explanation">
  45. <div class="title" id="checkZoom">
  46. <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
  47. <span id="explanationZoom" title="收起提示" class="arrow"></span>
  48. </div>
  49. <ul>
  50. <li> 数据还原, 点击恢复选项进行数据库导入.</li>
  51. <li> 导入的SQL文件语句必须按照MYSQL的语法编写</li>
  52. </ul>
  53. </div>
  54. <div class="mDiv">
  55. <div class="ftitle">
  56. <div style="width: 100px;float: left;line-height: 56px;"><h3>sql文件列表</h3></div>
  57. <div style="width: 300px;float: left;line-height: 56px;"><h5>(备份文件数量:<?php echo $filenum; ?>,占空间大小:<?php echo format_bytes($total); ?>)</h5></div>
  58. </div>
  59. <div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
  60. </div>
  61. <table class="layui-table lay-even">
  62. <colgroup>
  63. <col width="150">
  64. <col width="200">
  65. <col width="200">
  66. <col>
  67. <col width="150">
  68. </colgroup>
  69. <thead>
  70. <tr>
  71. <th align="left" abbr="article_title" axis="col3" class="">
  72. <div style="text-align: left; width: 200px;" class="">文件名称</div>
  73. </th>
  74. <th align="center" abbr="ac_id" axis="col4" class="">
  75. <div style="text-align: center; width: 50px;" class="">卷号</div>
  76. </th>
  77. <th align="center" abbr="article_show" axis="col5" class="">
  78. <div style="text-align: center; width: 50px;" class="">压缩</div>
  79. </th>
  80. <th align="center" abbr="article_time" axis="col6" class="">
  81. <div style="text-align: center; width: 150px;" class="">数据大小</div>
  82. </th>
  83. <th align="center" abbr="article_show" axis="col7" class="">
  84. <div style="text-align: center; width: 150px;" class="">备份时间</div>
  85. </th>
  86. <th align="center" abbr="article_show" axis="col8" class="">
  87. <div style="text-align: center; width: 130px;" class="">状态</div>
  88. </th>
  89. <th align="center" axis="col1" class="handle">
  90. <div style="text-align: center; width: 250px;">操作</div>
  91. </th>
  92. </tr>
  93. </thead>
  94. <tbody>
  95. <?php if(!(empty($list) || (($list instanceof \think\Collection || $list instanceof \think\Paginator ) && $list->isEmpty()))): if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
  96. <tr>
  97. <td align="left" class="">
  98. <div style="text-align: left; width: 200px;"><?php echo $vo['basename']; ?></div>
  99. </td>
  100. <td align="center" class="">
  101. <div style="text-align: center; width: 50px;"><?php echo $vo['part']; ?></div>
  102. </td>
  103. <td align="center" class="">
  104. <div style="text-align: center; width: 50px;"><?php echo $vo['compress']; ?></div>
  105. </td>
  106. <td align="center" class="">
  107. <div style="text-align: center; width: 150px;"><?php echo format_bytes($vo['size']); ?></div>
  108. </td>
  109. <td align="center" class="">
  110. <div style="text-align: center; width: 150px;"><?php echo date("Y-m-d H:i:s",$vo['time']); ?></div>
  111. </td>
  112. <td align="center" class="">
  113. <div style="text-align: center; width: 130px;">-</div>
  114. </td>
  115. <td align="center" class="handle">
  116. <div style="text-align: center; width: 170px; max-width:170px;">
  117. <a value="<?php echo url('/Admin/Db/import',['time'=>$vo['time']]); ?>" href="javascript:void(0)" class="db-import"><i
  118. class="fa fa-repeat"></i>恢复</a> |
  119. <a href="<?php echo url('/Admin/Db/downFile',['time'=>$vo['time']]); ?>"><i class="fa fa-download"></i>下载</a> |
  120. <a href="<?php echo url('/Admin/Db/del',['time'=>$vo['time']]); ?>"><i class="fa fa-trash"></i>删除</a>
  121. </div>
  122. </td>
  123. </tr>
  124. <?php endforeach; endif; else: echo "" ;endif; else: ?>
  125. <tr class="no_data">
  126. <td colspan="11"><?php echo \think\Lang::get('ds_no_record'); ?></td>
  127. </tr>
  128. <?php endif; ?>
  129. </tbody>
  130. </table>
  131. </div>
  132. </div>
  133. <script>
  134. $(document).ready(function () {
  135. // 表格行点击选中切换
  136. $('#flexigrid > table>tbody >tr').click(function () {
  137. $(this).toggleClass('trSelected');
  138. });
  139. // 点击刷新数据
  140. $('.fa-refresh').click(function () {
  141. location.href = location.href;
  142. });
  143. });
  144. $(".db-import").click(function () {
  145. var self = this, status = ".";
  146. $.get($('.db-import').attr('value'), success, "json");
  147. window.onbeforeunload = function () {
  148. return "正在还原数据库,请不要关闭!"
  149. }
  150. function success(data) {
  151. if (data.code) {
  152. if (data.gz) {
  153. data.info += status;
  154. if (status.length === 5) {
  155. status = ".";
  156. } else {
  157. status += ".";
  158. }
  159. }
  160. $(self).parent().parent().prev().find('div').text(data.msg);
  161. if (data.data) {
  162. $.get($('.db-import').attr('value'), {"part": data.data.part, "start": data.data.start}, success, "json");
  163. } else {
  164. window.onbeforeunload = function () {
  165. return null;
  166. }
  167. }
  168. } else {
  169. layer.alert(data.msg, {icon: 2});
  170. }
  171. }
  172. });
  173. </script>
  174. </body>
  175. </html>