index.blade.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. @extends('admin.layouts.app')
  2. @section('content')
  3. <div class="wrapper wrapper-content animated fadeInRight">
  4. <div class="row">
  5. <div class="col-sm-12">
  6. <div class="ibox float-e-margins">
  7. <div class="ibox-title">
  8. <h5>用户列表</h5>
  9. <div class="ibox-tools">
  10. <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
  11. </a>
  12. </div>
  13. </div>
  14. <div class="ibox-content">
  15. <div class="form-group">
  16. <div class="row">
  17. <div class="col-sm-4">
  18. <form method="GET" action="" accept-charset="UTF-8">
  19. <div class="input-group">
  20. <input type="text" class="form-control" value="{{Request::get('keyword')}}"
  21. placeholder="请输入关键词"
  22. name="keyword">
  23. <span class="input-group-append">
  24. <button type="submit" class="btn btn-primary"
  25. style="height: 100%">搜索</button>
  26. </span>
  27. </div>
  28. </form>
  29. </div>
  30. @if(role('Foundation/User/create'))
  31. <div class="col-sm-8 pull-right">
  32. <a href="{{ U('Base/User/create')}}"
  33. class="btn btn-primary pull-right">添加</a>
  34. </div>
  35. @endif
  36. </div>
  37. </div>
  38. <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
  39. <thead>
  40. <tr>
  41. <th class="sorting" data-sort="name">账号</th>
  42. <th class="sorting" data-sort="real_name">姓名</th>
  43. <th class="sorting" data-sort="email">邮箱</th>
  44. <th class="sorting" data-sort="mobile">电话</th>
  45. <th class="sorting" data-sort="admin_role_id">角色</th>
  46. <th>相关操作</th>
  47. </tr>
  48. </thead>
  49. <tbody>
  50. @if(isset($list))
  51. @foreach($list as $item)
  52. <tr>
  53. <td>{{ $item->username or '' }}</td>
  54. <td>{{ $item->real_name or '' }}</td>
  55. <td>{{ $item->email or '' }}</td>
  56. <td>{{ $item->mobile or '' }}</td>
  57. <td>
  58. <?php
  59. if ($item->admin_role_id) {
  60. $role_arr = explode(',', $item->admin_role_id);
  61. foreach ($role_arr AS $key => $role) {
  62. if (isset($roles[$role])) {
  63. echo $key == 0 ? $roles[$role] : ',' . $roles[$role];
  64. }
  65. }
  66. }
  67. ?>
  68. </td>
  69. <td>
  70. <div class="btn-group">
  71. @if(role('Foundation/User/update'))
  72. <button class="btn btn-sm btn-success"
  73. onclick="window.location.href='{{ U('Base/User/update')}}?id={{ $item->id }}' ">
  74. 修改
  75. </button>
  76. @endif
  77. </div>
  78. </td>
  79. </tr>
  80. @endforeach
  81. @endif
  82. </tbody>
  83. </table>
  84. @if(isset($list))
  85. <div class="row">
  86. <div class="col-sm-6">
  87. <div class="dataTables_info" id="DataTables_Table_0_info"
  88. role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}
  89. 条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。
  90. </div>
  91. </div>
  92. <div class="col-sm-6">
  93. <div class="dataTables_paginate paging_simple_numbers"
  94. id="DataTables_Table_0_paginate">
  95. {!! $list->setPath('')->appends(Request::all())->render() !!}
  96. </div>
  97. </div>
  98. </div>
  99. @endif
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. @endsection