index.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <div class="row">
  2. <div class="col-md-12 col-sm-12 col-xs-12">
  3. <div class="x_panel">
  4. <div class="x_title">
  5. <h2>后台操作人员管理 </h2>
  6. <div class="clearfix"></div>
  7. </div>
  8. <div class="x_content">
  9. <div class="row">
  10. <div class="col-sm-6">
  11. </div>
  12. <div class="col-sm-6">
  13. <div id="datatable_filter" class="dataTables_filter fr">
  14. <label>
  15. <button type="button" onclick="location.href='<?php echo $this->createUrl('assistHome/add');?>'">添加人员
  16. </button>
  17. </label>
  18. </div>
  19. </div>
  20. </div>
  21. <table id="datatable" class="table table-striped table-bordered" style="margin-bottom: 0px;">
  22. <thead>
  23. <tr>
  24. <th>序号</th>
  25. <th>姓名</th>
  26. <th>账号</th>
  27. <th>性别</th>
  28. <th>最后编辑时间</th>
  29. <th>类别</th>
  30. <th>用户权限</th>
  31. <th>状态</th>
  32. <th>操作</th>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. <?php $i = 1; if ($dataList):foreach ($dataList as $loop): ?>
  37. <tr>
  38. <td><?php echo $i ?></td>
  39. <td><?php echo $loop['real_name'] ?></td>
  40. <td><?php echo $loop['user_name'] ?></td>
  41. <td><?php
  42. if($loop['sex']==1){
  43. echo '男';
  44. }else{
  45. echo '女';
  46. }
  47. ?></td>
  48. <td><?php echo date('Y-m-d H:i:s',$loop['update_time']) ?></td>
  49. <td><?php
  50. if($loop['user_origin']==1){
  51. echo '后台专员';
  52. }else{
  53. echo '学管';
  54. }
  55. ?>
  56. </td>
  57. <td><?php
  58. $userLimit=array();
  59. if($loop['cutting_limit']==1){
  60. $userLimit[]= '素材切割';
  61. }
  62. if($loop['scan_limit']==1){
  63. $userLimit[]= '扫描处理';
  64. }
  65. echo implode(',',$userLimit);
  66. ?>
  67. </td>
  68. <td><?php if($loop['status'] == 1 ){echo '启用';}else{echo '<font color="red">停用</font>';} ?></td>
  69. <td>
  70. <a style="color:#337ab7" href="<?php echo $this->createUrl('assistHome/edit');?>?lid=<?php echo $loop['user_id']?>">编辑</a>&nbsp;&nbsp;
  71. <a style="color:#337ab7" href="javascript:void(0);" onclick="removeLessee(<?php echo $loop['user_id'] ?>, '<?php echo $loop['user_name'] ?>')">删除
  72. </td>
  73. </tr>
  74. <?php ++$i;endforeach;endif; ?>
  75. </tbody>
  76. </table>
  77. <div class="dataTables_paginate paging_simple_numbers" id="datatable-checkbox_paginate">
  78. <div class="row" style="padding-top:10px;">
  79. <div class="col-xs-7">
  80. &nbsp;
  81. </div>
  82. <div class="col-xs-5" style="font-size: 16px">
  83. <div class="dataTables_paginate paging_simple_numbers" style="vertical-align:sub;">
  84. <ul id="yw0" class="yiiPager">
  85. <?php
  86. if($page>1){
  87. echo '<li class="previous"><a href="'.$this->createUrl('assistHome/index').'?page='.($page-1).'">上一页</a></li>';
  88. }
  89. for($i=1;$i<=$pages['totalPage'];$i++){
  90. $url=$this->createUrl('assistHome/index')."?page=".$i;
  91. if($page==$i){
  92. echo '<li class="page selected"><a href="#">'.$i.'</a></li>';
  93. }else{
  94. echo '<li class="page"><a href="'.$url.'">'.$i.'</a></li>';
  95. }
  96. }
  97. if($page<$pages['totalPage']){
  98. echo '<li class="next"><a href="'.$this->createUrl('assistHome/index').'?page='.($page+1).'">下一页</a></li>';
  99. }
  100. ?>
  101. </ul>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <script type="text/javascript">
  110. function removeLessee(lesseeId, lesseeName) {
  111. if (!lesseeId) return;
  112. layer.confirm('对'+lesseeName+'执行删除操作请确认!',{
  113. btn:['确定', '取消'],
  114. }, function(){
  115. $.post('<?php echo $this->createUrl('assistHome/remove');?>', {lesseeId:lesseeId}, function(response){
  116. if (response.status) {
  117. location.reload();
  118. } else {
  119. console.log(response)
  120. if(response.msg!=undefined){
  121. layer.msg(response.msg)
  122. }else{
  123. layer.msg('删除失败');
  124. }
  125. }
  126. },'json');
  127. });
  128. }
  129. </script>