Advertisement
didan_oz

index.blade.php

Jan 28th, 2020
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. @extends("layouts.global")
  2. @section("title")
  3. Users list
  4. @endsection
  5. @section("content")
  6.  
  7. <form action="{{route('users.index')}}">
  8. <div class="row">
  9. <div class="col-md-6">
  10. <input
  11. value="{{Request::get('keyword')}}"
  12. name="keyword"
  13. class="form-control col-md-10"
  14. type="text"
  15. placeholder="Masukkan Email untuk filter" />
  16. </div>
  17. <div class="col-md-6">
  18. <input {{Request::get('status') == 'ACTIVE' ? 'checked' : ''}}
  19. value="ACTIVE"
  20. name="status"
  21. type="radio"
  22. class="form-control"
  23. id="active">
  24. <label for="active">Active</label>
  25. <input {{Request::get('status') == 'INACTIVE' ? 'checked' : ''}}
  26. value="INACTIVE"
  27. name="status"
  28. type="radio"
  29. class="form-control"
  30. id="inactive">
  31. <label for="inactive">Inactive</label>
  32. <input
  33. type="submit"
  34. value="Filter"
  35. class="btn btn-primary">
  36. </div>
  37. </div>
  38. </form>
  39.  
  40. <br>
  41.  
  42. @if(session('status'))
  43. <div class="alert alert-success">
  44. {{session('status')}}
  45. </div>
  46. @endif
  47.  
  48. <div class="row">
  49. <div class="col-md-12 text-right">
  50. <a href="{{route('users.create')}}"
  51. class="btn btn-primary">Create User</a>
  52. </div>
  53. </div>
  54. <br>
  55.  
  56. <table class="table table-bordered">
  57. <thead>
  58. <tr>
  59. <th><b>Name</b></th>
  60. <th><b>Username</b></th>
  61. <th><b>Email</b></th>
  62. <th><b>Avatar</b></th>
  63. <th><b>Status</b></th>
  64. <th><b>Action</b></th>
  65. </tr>
  66. </thead>
  67. <tbody>
  68. @foreach ($users as $user)
  69. <tr>
  70. <td>{{$user->email}}</td>
  71. <td>{{$user->username}}</td>
  72. <td>{{$user->email}}</td>
  73. <td>
  74. @if($user->avatar)
  75. <img src="{{asset('storage/'.$user->avatar)}}" width="70px" />
  76. @else
  77. N/A
  78. @endif
  79. </td>
  80. <td>
  81. @if($user->status == "ACTIVE")
  82. <span class="badge badge-success">
  83. {{$user->status}}
  84. </span>
  85. @else
  86. <span class="badge badge-danger">
  87. {{$user->status}}
  88. </span>
  89. @endif
  90. </td>
  91. <td>
  92. <a class="btn btn-info text-white btn-sm" href="{{route('users.edit',[$user->id])}}">Edit</a>
  93. <a href="{{route('users.show',[$user->id])}}" class="btn btn-primary btn-sm">Detail</a>
  94. @if(session('status'))
  95. <div class="alert alert-success">{{session('status')}}</div>
  96. @endif
  97. <form onsubmit="return confirm('Delete User Permanently')" class="d-inline" action="{{route('users.destroy',[$user->id])}}" method="POST">
  98.  
  99. @csrf
  100. <input type="hidden" name="_method" value="DELETE">
  101. <input type="submit" value="Delete" class="btn btn-danger btn-sm">
  102. </form>
  103. </td>
  104. </tr>
  105. @endforeach
  106. </tbody>
  107. <tfoot>
  108. <tr>
  109. <td colspan="10">
  110. {{ $users->links() }}
  111. </td>
  112. </tr>
  113. </tfoot>
  114.  
  115. </table>
  116.  
  117. @endsection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement