a43dd06f39d809c109c800ec9d9d065a.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?php /*a:3:{s:62:"D:\phpstudy_pro\WWW\my\fuye\php\view\admin\adminlog\index.html";i:1581911356;s:61:"D:\phpstudy_pro\WWW\my\fuye\php\view\admin\common\header.html";i:1582014448;s:61:"D:\phpstudy_pro\WWW\my\fuye\php\view\admin\common\footer.html";i:1581911356;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <title><?php echo config('admin.sys_name'); ?>后台管理</title>
  7. <meta name="renderer" content="webkit">
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  9. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  11. <meta name="apple-mobile-web-app-capable" content="yes">
  12. <meta name="format-detection" content="telephone=no">
  13. <link rel="stylesheet" href="/static/plugins/layui/css/layui.css" media="all" />
  14. <!--<link rel="stylesheet" href="/static/plugins/bootstrap-3.3.7/css/bootstrap.css" media="all" />-->
  15. <!--<link rel="stylesheet" href="/static/plugins/bootstrap-3.3.7/css/bootstrap-theme.css" media="all" />-->
  16. <link rel="stylesheet" href="/static/admin/css/main.css?v=<?php echo time(); ?>" media="all">
  17. <link rel="stylesheet" href="/static/plugins/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
  18. <!--<link rel="stylesheet" href="/static/plugins/bootstrap-select/less/bootstrap-select.less">-->
  19. <!--<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/css/bootstrap-select.min.css">-->
  20. <!--[if lt IE 9]>
  21. <!--<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>-->
  22. <!--<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>-->
  23. <!--<![endif]&ndash;&gt;-->
  24. <style id="LM-bg-color">
  25. </style>
  26. </head>
  27. <div class="LM-container">
  28. <div class="LM-main">
  29. <fieldset class="layui-elem-field layui-field-title">
  30. <legend>日志<?php echo lang('list'); ?></legend>
  31. <blockquote class="layui-elem-quote">
  32. <div class="tabletop">
  33. <div class="layui-inline">
  34. <!-- <label class="layui-form-label">搜索<?php echo lang('username'); ?></label>-->
  35. <div class="layui-input-inline">
  36. <input type="text" name="keys" id="keys" lay-verify="required" autocomplete="off"
  37. class="layui-input">
  38. </div>
  39. <button type="submit" class="layui-btn layui-btn-sm" lay-submit lay-filter="submit" id="search">
  40. <?php echo lang('search'); ?>
  41. </button>
  42. <a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-danger" id="delAll"><?php echo lang('delete checked'); ?></a>
  43. </div>
  44. </div>
  45. </blockquote>
  46. </fieldset>
  47. <table class="layui-tab" id="list" lay-filter="list"></table>
  48. </div>
  49. </div>
  50. <script type="text/html" id="action">
  51. <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><?php echo lang('del'); ?></a>
  52. </script>
  53. <script type="text/html" id="time">
  54. {{layui.util.toDateString(d.create_time*1000, 'yyyy-MM-dd HH:mm:ss')}}
  55. </script>
  56. <script src="/static/plugins/layui/layui.js" charset="utf-8"></script>
  57. <!--<script src="/static/plugins/bootstrap-3.3.7/js/bootstrap.js" charset="utf-8"></script>-->
  58. <script>
  59. layui.use(['form', 'table'], function () {
  60. var $ = layui.jquery,
  61. form = layui.form,
  62. table = layui.table;
  63. var tableIn = table.render({
  64. elem: '#list',
  65. url: '<?php echo url("index"); ?>',
  66. method: 'post',
  67. cols: [[
  68. {checkbox: true, fixed: 'left'},
  69. {field: 'id', title: 'ID', width: 80, sort: true},
  70. {field: 'admin_id', title: 'admin_id', width: 80, sort: true},
  71. {field: 'username', title: '账号', width: 150, sort: true},
  72. {field: 'log_url', title: '地址', width: 150, templet: '#size', sort: true,},
  73. {field: 'log_content', title: '内容', width: 150, sort: true,},
  74. {field: 'log_title', title: '标题', width: 150, sort: true,},
  75. {field: 'log_agent', title: '浏览器', width: 120, sort: true,},
  76. {field: 'log_ip', title: 'ip', width: 80},
  77. {field: 'create_time', title: '时间', width: 180,templet:'#time'},
  78. {title:'操作',width:100, toolbar: '#action',align:"center"}
  79. ]],
  80. limits: [10, 15, 20, 25, 50, 100],
  81. limit: 15,
  82. page: true,
  83. });
  84. table.on('tool(list)', function(obj) {
  85. var data = obj.data;
  86. if(obj.event === 'del'){
  87. layer.confirm('<?php echo lang("Are you sure you want to delete it"); ?>', function(index){
  88. var loading = layer.load(1, {shade: [0.1, '#fff']});
  89. $.post("<?php echo url('delete'); ?>",{id:data.id},function(res){
  90. layer.close(loading);
  91. if(res.code===1){
  92. layer.msg(res.msg,{time:1000,icon:1});
  93. tableIn.reload({where:{catid:'<?php echo input("catid"); ?>'}});
  94. }else{
  95. layer.msg(res.msg,{time:1000,icon:2});
  96. }
  97. });
  98. layer.close(index);
  99. });
  100. }
  101. });
  102. $('#search').click(function () {
  103. var $keys = $('#keys').val();
  104. if(!$keys){
  105. return layer.msg('请输入关键词');
  106. }
  107. tableIn.reload({ page: {page: 1},where: {keys: $keys}});
  108. });
  109. $('#delAll').click(function(){
  110. layer.confirm("<?php echo lang('Are you sure you want to delete it'); ?>", {icon: 3}, function(index) {
  111. layer.close(index);
  112. var checkStatus = table.checkStatus('list'); //test即为参数id设定的值
  113. var ids = [];
  114. console.log(checkStatus.data)
  115. $(checkStatus.data).each(function (index, item) {
  116. ids.push(item.id);
  117. });
  118. if(ids==''){
  119. layer.msg("<?php echo lang('please choose data'); ?>", {time: 1000, icon: 2});
  120. return false;
  121. }
  122. var loading = layer.load(1, {shade: [0.1, '#fff']});
  123. $.post("<?php echo url('delete'); ?>", {id: ids}, function (res) {
  124. layer.close(loading);
  125. if (res.code > 0) {
  126. layer.msg(res.msg, {time: 1000, icon: 1});
  127. tableIn.reload();
  128. } else {
  129. layer.msg(res.msg, {time: 1000, icon: 2});
  130. }
  131. });
  132. });
  133. })
  134. });
  135. </script>