index.blade.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. @extends('admin.layout')
  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="row">
  16. <div class="col-sm-4">
  17. <form method="GET" action="" accept-charset="UTF-8">
  18. <div class="input-group">
  19. <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入关键词 (用户名,邮箱,电话)" name="keyword" class="input-sm form-control">
  20. <span class="input-group-btn">
  21. <button type="submit" class="btn btn-sm btn-primary">搜索</button>
  22. </span>
  23. </div>
  24. </form>
  25. </div>
  26. @if(role('Foundation/User/create'))
  27. <div class="col-sm-3 pull-right">
  28. <a href="{{ U('Base/User/create')}}" class="btn btn-sm btn-primary pull-right">添加</a>
  29. </div>
  30. @endif
  31. </div>
  32. <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
  33. <thead>
  34. <tr>
  35. <th class="sorting" data-sort="name">用户名</th>
  36. <th class="sorting" data-sort="email">邮箱</th>
  37. <th class="sorting" data-sort="mobile">电话</th>
  38. <th class="sorting" data-sort="admin_role_id">角色</th>
  39. <th>相关操作</th>
  40. </tr>
  41. </thead>
  42. <tbody>
  43. @if(isset($list))
  44. @foreach($list as $item)
  45. <tr>
  46. <td>{{ $item->name or '' }}</td>
  47. <td>{{ $item->email or '' }}</td>
  48. <td>{{ $item->mobile or '' }}</td>
  49. <td>
  50. <?php
  51. if($item->admin_role_id) {
  52. $role_arr = explode(',', $item->admin_role_id);
  53. foreach ($role_arr AS $key => $role){
  54. if(isset($roles[$role])){
  55. echo $key==0 ? $roles[$role] : ','.$roles[$role];
  56. }
  57. }
  58. }
  59. ?>
  60. </td>
  61. <td>
  62. <div class="btn-group">
  63. <button data-toggle="dropdown" class="btn btn-warning btn-sm dropdown-toggle" aria-expanded="false">
  64. 操作 <span class="caret"></span>
  65. </button>
  66. <ul class="dropdown-menu">
  67. @if(role('Foundation/User/update'))
  68. <li><a href="{{ U('Base/User/update')}}?id={{ $item->id }}" class="font-bold">修改</a></li>
  69. @endif
  70. </ul>
  71. </div>
  72. </td>
  73. </tr>
  74. @endforeach
  75. @endif
  76. </tbody>
  77. </table>
  78. @if(isset($list))
  79. <div class="row">
  80. <div class="col-sm-6">
  81. <div class="dataTables_info" id="DataTables_Table_0_info"
  82. role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。</div>
  83. </div>
  84. <div class="col-sm-6">
  85. <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
  86. {!! $list->setPath('')->appends(Request::all())->render() !!}
  87. </div>
  88. </div>
  89. </div>
  90. @endif
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. @endsection