index.blade.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. @extends('layouts.backend')
  2. @section('title', '用户列表')
  3. @section('header')
  4. <h1>
  5. 用户列表
  6. </h1>
  7. @endsection
  8. @section('content')
  9. <div class="row">
  10. <div class="col-xs-12">
  11. @include('backend.alert.success')
  12. <div class="box box-solid">
  13. <!-- /.box-header -->
  14. <div class="box-header">
  15. <div class="pull-right">
  16. <div class="btn-group">
  17. <a href="{{ route('backend.user.create') }}" class="btn btn-white tooltips"
  18. data-toggle="tooltip" data-original-title="新增"><i
  19. class="glyphicon glyphicon-plus"></i></a>
  20. </div>
  21. </div><!-- pull-right -->
  22. </div>
  23. <div class="box-body table-responsive no-padding ">
  24. <table class="table table-hover">
  25. <tr>
  26. <th>序号</th>
  27. <th>头像</th>
  28. <th>名字</th>
  29. <th>邮箱</th>
  30. <th>操作</th>
  31. </tr>
  32. @if ($users)
  33. <?php $line = 1 ?>
  34. @foreach($users as $u)
  35. <tr>
  36. <td>{{ $line }}</td>
  37. <td>
  38. <img src="{{ $u['user_pic'] }}" class="img-circle" style="width:30px;height:auto;">
  39. </td>
  40. <td>{{ $u['name'] }}</td>
  41. <td>{{ $u['email'] }}</td>
  42. <td>
  43. <a href='{{ route("backend.user.edit", ["id" => $u['id']]) }}' class='btn btn-info btn-xs'>
  44. <i class="fa fa-pencil"></i> 修改</a>
  45. <a data-href='{{ route("backend.user.destroy", ["id" => $u['id']]) }}'
  46. class='btn btn-danger btn-xs user-delete'><i class="fa fa-trash-o"></i> 删除</a>
  47. </td>
  48. </tr>
  49. <?php $line++ ?>
  50. @endforeach
  51. @endif
  52. </table>
  53. </div>
  54. <!-- /.box-body -->
  55. </div>
  56. <!-- /.box -->
  57. </div>
  58. </div>
  59. @endsection
  60. @section('javascript')
  61. <script>
  62. $(function() {
  63. $(".user-delete").click(function(){
  64. var url = $(this).attr('data-href');
  65. Moell.ajax.delete(url);
  66. });
  67. });
  68. </script>
  69. @endsection