dae63a44ecaea5059b5e61748e483375.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?php /*a:3:{s:59:"/data/web/mall.valimart.net/app/admin/view/database/db.html";i:1657785096;s:61:"/data/web/mall.valimart.net/app/admin/view/public/header.html";i:1657785098;s:66:"/data/web/mall.valimart.net/app/admin/view/public/admin_items.html";i:1657785098;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <title><?php echo htmlentities((isset($html_title) && ($html_title !== '')?$html_title:config('ds_config.site_name'))); ?><?php echo htmlentities(lang('system_backend')); ?></title>
  8. <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  9. <link rel="stylesheet" href="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/css/admin.css">
  10. <link rel="stylesheet" href="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.css">
  11. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery-2.1.4.min.js"></script>
  12. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.validate.min.js"></script>
  13. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.cookie.js"></script>
  14. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/common.js"></script>
  15. <script src="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/js/admin.js"></script>
  16. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.js"></script>
  17. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery.ui.datepicker-zh-CN.js"></script>
  18. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/perfect-scrollbar.min.js"></script>
  19. <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/layer/layer.js"></script>
  20. <script type="text/javascript">
  21. var BASESITEROOT = "<?php echo htmlentities(BASE_SITE_ROOT); ?>";
  22. var ADMINSITEROOT = "<?php echo htmlentities(ADMIN_SITE_ROOT); ?>";
  23. var BASESITEURL = "<?php echo htmlentities(BASE_SITE_URL); ?>";
  24. var HOMESITEURL = "<?php echo htmlentities(HOME_SITE_URL); ?>";
  25. var ADMINSITEURL = "<?php echo htmlentities(ADMIN_SITE_URL); ?>";
  26. </script>
  27. </head>
  28. <body>
  29. <div id="append_parent"></div>
  30. <div id="ajaxwaitid"></div>
  31. <div class="page">
  32. <div class="fixed-bar">
  33. <div class="item-title">
  34. <div class="subject">
  35. <h3><?php echo htmlentities(lang('ds_db')); ?></h3>
  36. <h5></h5>
  37. </div>
  38. <?php if($admin_item): ?>
  39. <ul class="tab-base ds-row">
  40. <?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): ?>
  41. <li><a href="<?php echo htmlentities($item['url']); ?>" <?php if($item['name'] == $curitem): ?>class="current"<?php endif; ?>><span><?php echo htmlentities($item['text']); ?></span></a></li>
  42. <?php endforeach; endif; else: echo "" ;endif; ?>
  43. </ul>
  44. <?php endif; ?>
  45. </div>
  46. </div>
  47. <!-- 操作说明 -->
  48. <div class="explanation" id="explanation">
  49. <div class="title" id="checkZoom">
  50. <h4 title="<?php echo htmlentities(lang('ds_explanation_tip')); ?>"><?php echo htmlentities(lang('ds_explanation')); ?></h4>
  51. <span id="explanationZoom" title="<?php echo htmlentities(lang('ds_explanation_close')); ?>" class="arrow"></span>
  52. </div>
  53. <ul>
  54. <li><?php echo htmlentities(lang('db_data_backup_help1')); ?></li>
  55. <li><?php echo htmlentities(lang('db_data_backup_help2')); ?></li>
  56. </ul>
  57. </div>
  58. <div class="ds-search-form">
  59. <dl>
  60. <dt style="font-size:14px;color: #09C;"><?php echo htmlentities(lang('db_database_table_list')); ?>(<?php echo htmlentities(lang('db_total_num')); ?><?php echo htmlentities($tableNum); ?><?php echo htmlentities(lang('db_tablenum_record')); ?>,<?php echo htmlentities(lang('db_total_size')); ?><?php echo htmlentities($total); ?>)</dt>
  61. </dl>
  62. <div class="btn_group">
  63. <a id="export" class="btn"><?php echo htmlentities(lang('ds_db')); ?></a>
  64. </div>
  65. </div>
  66. <table class="ds-default-table">
  67. <thead>
  68. <tr>
  69. <th><input type="checkbox" onclick="javascript:$('input[name*=tables]').prop('checked', this.checked);"></th>
  70. <th><?php echo htmlentities(lang('db_database_table')); ?></th>
  71. <th><?php echo htmlentities(lang('db_data_length')); ?></th>
  72. <th><?php echo htmlentities(lang('db_occupy_space')); ?></th>
  73. <th><?php echo htmlentities(lang('db_code')); ?></th>
  74. <th><?php echo htmlentities(lang('db_createtime')); ?></th>
  75. <th><?php echo htmlentities(lang('db_backup_state')); ?></th>
  76. <th><?php echo htmlentities(lang('db_handle')); ?></th>
  77. </tr>
  78. </thead>
  79. <form method="post" id="export-form" action="<?php echo url('Database/export'); ?>">
  80. <tbody>
  81. <?php if(is_array($dbtable_list) || $dbtable_list instanceof \think\Collection || $dbtable_list instanceof \think\Paginator): if( count($dbtable_list)==0 ) : echo "" ;else: foreach($dbtable_list as $k=>$db): ?>
  82. <tr data-id="<?php echo htmlentities($db['Name']); ?>">
  83. <td class="sign">
  84. <div style="width: 24px;"><input type="checkbox" name="tables[]" value="<?php echo htmlentities($db['Name']); ?>"></div>
  85. </td>
  86. <td><?php echo htmlentities($db['Name']); ?></td>
  87. <td><?php echo htmlentities($db['Rows']); ?></td>
  88. <td><?php echo htmlentities(format_bytes($db['Data_length'])); ?></td>
  89. <td><?php echo htmlentities($db['Collation']); ?></td>
  90. <td><?php echo htmlentities($db['Create_time']); ?></td>
  91. <td class="info"><?php echo htmlentities(lang('db_unbackup')); ?></td>
  92. <td class="handle">
  93. <div style="text-align: center; width: 170px; max-width:170px;">
  94. <a href="<?php echo url('Database/optimize',array('tablename'=>$db['Name'])); ?>"><i class="iconfont">&#xe6e0;</i><?php echo htmlentities(lang('db_magic')); ?></a> |
  95. <a href="<?php echo url('Database/repair',array('tablename'=>$db['Name'])); ?>"><i class="iconfont">&#xe6e0;</i><?php echo htmlentities(lang('db_repair')); ?></a>
  96. </div>
  97. </td>
  98. </tr>
  99. <?php endforeach; endif; else: echo "" ;endif; ?>
  100. </tbody>
  101. </form>
  102. </table>
  103. </div>
  104. <script>
  105. (function($) {
  106. var $form = $("#export-form"), $export = $("#export"), tables;
  107. $export.click(function() {
  108. if ($("input[name^='tables']:checked").length == 0) {
  109. layer.alert('<?php echo htmlentities(lang('db_backup_error')); ?>');
  110. return false;
  111. }
  112. $export.addClass("disabled");
  113. $export.html("<?php echo htmlentities(lang('db_backup_requer')); ?>");
  114. $.post(
  115. $form.attr("action"),
  116. $form.serialize(),
  117. function(data) {
  118. if (data.status) {
  119. tables = data.tables;
  120. $export.html(data.info + "<?php echo htmlentities(lang('db_backup_strat')); ?>");
  121. backup(data.tab);
  122. window.onbeforeunload = function() {
  123. return "<?php echo htmlentities(lang('db_backup_conduct')); ?>"
  124. }
  125. } else {
  126. layer.alert(data.info);
  127. $export.removeClass("disabled");
  128. $export.html("<?php echo htmlentities(lang('db_backup')); ?>");
  129. }
  130. },
  131. "json"
  132. );
  133. return false;
  134. });
  135. function backup(tab, status) {
  136. status && showmsg(tab.id, "<?php echo htmlentities(lang('db_backup_state_strat')); ?>");
  137. $.get($form.attr("action"), tab, function(data) {
  138. if (data.status) {
  139. showmsg(tab.id, data.info);
  140. if (!$.isPlainObject(data.tab)) {
  141. $export.removeClass("disabled");
  142. $export.html("<?php echo htmlentities(lang('db_backup_restart')); ?>");
  143. window.onbeforeunload = function() {
  144. return null
  145. }
  146. return;
  147. }
  148. backup(data.tab, tab.id != data.tab.id);
  149. } else {
  150. $export.removeClass("disabled");
  151. $export.html("<?php echo htmlentities(lang('db_backup')); ?>");
  152. }
  153. }, "json");
  154. }
  155. function showmsg(id, msg) {
  156. $("input[value=" + tables[id] + "]").closest("tr").find(".info").html(msg);
  157. // $("input[value=" + tables[id] + "]").closest("tr").hide(3000);
  158. }
  159. })(jQuery);
  160. </script>
  161. </body>
  162. </html>