01e433db5e5517b7a2c4587da42797aa.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?php /*a:3:{s:63:"D:\phpstudy_pro\WWW\cxy\bts\php\view\admin\auth\admin_list.html";i:1590638532;s:61:"D:\phpstudy_pro\WWW\cxy\bts\php\view\admin\common\header.html";i:1582014448;s:61:"D:\phpstudy_pro\WWW\cxy\bts\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('admin'); ?><?php echo lang('list'); ?></legend>
  31. <blockquote class="layui-elem-quote">
  32. <div class="LM-table">
  33. <div class="layui-inline">
  34. <input type="text" name="keys" id="keys" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
  35. </div>
  36. <button class="layui-btn data-add-btn layui-btn-sm" lay-submit="" lay-filter="add" id="search">搜索</button>
  37. <a href="<?php echo url('adminAdd'); ?>" class="layui-btn layui-btn-sm layui-btn-warm"><?php echo lang('add'); ?><?php echo lang('admin'); ?></a>
  38. </div>
  39. </blockquote>
  40. </fieldset>
  41. <table class="layui-table" id="list" lay-filter="list"></table>
  42. </div>
  43. </div>
  44. <script src="/static/plugins/layui/layui.js" charset="utf-8"></script>
  45. <!--<script src="/static/plugins/bootstrap-3.3.7/js/bootstrap.js" charset="utf-8"></script>-->
  46. <script type="text/html" id="action">
  47. <a href="<?php echo url('adminEdit'); ?>?id={{d.id}}" class="layui-btn layui-btn-xs"><?php echo lang('edit'); ?></a>
  48. {{# if(d.id==1){ }}
  49. <a href="#" class="layui-btn layui-btn-xs layui-btn-disabled"><?php echo lang('del'); ?></a>
  50. {{# }else{ }}
  51. <a href="#" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><?php echo lang('del'); ?></a>
  52. {{# } }}
  53. </script>
  54. <script type="text/html" id="status">
  55. {{# if(d.id==1){ }}
  56. <input type="checkbox" disabled name="status" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="status" checked>
  57. {{# }else{ }}
  58. <input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="status" {{ d.status == 1 ? 'checked' : '' }}>
  59. {{# } }}
  60. </script>
  61. <script>
  62. layui.use(['table','form','layer'], function() {
  63. var table = layui.table,form = layui.form,$ = layui.jquery;
  64. var tableIn = table.render({
  65. elem: '#list',
  66. url: '<?php echo url("adminList"); ?>',
  67. method:'post',
  68. title:'<?php echo lang("admin"); ?><?php echo lang("list"); ?>',
  69. cols: [[
  70. {field:'id', title: 'ID', width:100,fixed: true}
  71. ,{field:'username', title: '用户名', width:180}
  72. ,{field:'title', title: '<?php echo lang("adminGroup"); ?>', width:100}
  73. // ,{field:'email', title: '<?php echo lang("email"); ?>', width:200}
  74. ,{field:'mobile', title: '<?php echo lang("mobile"); ?>', width:150}
  75. ,{field:'ip', title: '<?php echo lang("ip"); ?>',width:150,hide:true}
  76. ,{field:'status', title: '<?php echo lang("status"); ?>',width:150,toolbar: '#status'}
  77. ,{title:'操作',width:150, toolbar: '#action',align:"center"}
  78. ]],
  79. limits: [10, 15, 20, 25, 50, 100],
  80. limit: 10,
  81. page: true
  82. });
  83. form.on('switch(status)', function(obj){
  84. loading =layer.load(1, {shade: [0.1,'#fff']});
  85. var id = this.value;
  86. var is_open = obj.elem.checked===true?1:0;
  87. $.post('<?php echo url("adminState"); ?>',{'id':id,'is_open':is_open},function (res) {
  88. layer.close(loading);
  89. if (res.code>0) {
  90. tableIn.reload();
  91. }else{
  92. layer.msg(res.msg,{time:1000,icon:2});
  93. return false;
  94. }
  95. })
  96. });
  97. table.on('tool(list)', function(obj){
  98. var data = obj.data;
  99. if(obj.event === 'del'){
  100. layer.confirm('<?php echo lang("Are you sure you want to delete it"); ?>', function(index){
  101. $.post("<?php echo url('adminDel'); ?>",{id:data.id},function(res){
  102. if (res.code>0) {
  103. layer.msg(res.msg,{time:1000,icon:1});
  104. obj.del();
  105. }else{
  106. layer.msg(res.msg,{time:1000,icon:2});
  107. }
  108. });
  109. layer.close(index);
  110. });
  111. }
  112. });
  113. $('#LM-add').click(function () {
  114. var index = layer.open({
  115. type: 2,
  116. content: '<?php echo url("adminAdd"); ?>',
  117. area: ['800px', '600px'],
  118. maxmin: true
  119. });
  120. layer.full(index);
  121. })
  122. $('#search').click(function () {
  123. var $keys = $('#keys').val();
  124. if(!$keys){
  125. return layer.msg('请输入关键词');
  126. }
  127. tableIn.reload({ page: {page: 1},where: {keys: $keys}});
  128. })
  129. });
  130. </script>