Guest User

Untitled

a guest
Jun 23rd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. @foreach ($array as $row)
  2. <tr>
  3. <td>
  4. <img src="{{ asset('uploads/users/'.$row->login.'/image.png') }}" style="max-width:30px;">
  5. {{ $row->firstName.' '.$row->lastName }}
  6. </td>
  7. <td>
  8. {{ $row->email }}
  9. </td>
  10. <td>
  11. {{ $row->login }}
  12. </td>
  13. <td>
  14.  
  15. <!-- Action buttons -->
  16. <div>
  17. {!! Form::open(array('route' => array($options['route'].'.destroy', $row->id), 'method' => 'DELETE', 'id' => 'myform')) !!}
  18.  
  19.  
  20. <a href="{{ route($options['route'].'.show', $row->id) }}" class="btn btn-warning btn-sm">
  21. <i class="la la-small la-edit"></i>
  22. </a>
  23.  
  24. <button type="button" id="delete" class="btn btn-danger btn-sm"><i class="la la-small la-trash"></i></button>
  25.  
  26. {!! Form::close() !!}
  27. </div>
  28. </td>
  29. </tr>
  30. @endforeach
  31.  
  32. $('button#delete').on('click', function() {
  33.  
  34. swal({
  35. title: "¿Desea eliminar el usuario?",
  36. text: "",
  37. type: "warning",
  38. showCancelButton: true,
  39. confirmButtonClass: "btn-danger",
  40. confirmButtonText: "Si!!",
  41. cancelButtonText: "No!!",
  42. closeOnConfirm: false,
  43. closeOnCancel: false
  44. },
  45. function(isConfirm) {
  46. if (isConfirm) {
  47.  
  48. swal({
  49. title:'¡El usuario será eliminado!',
  50. text: '',
  51. type: 'success'
  52. },
  53. function() {
  54. $("#myform").submit();
  55. });
  56.  
  57. } else {
  58.  
  59. swal("Cancelled", "El usuario no será eliminado!!", "error");
  60.  
  61. }
  62. });
  63.  
  64. })
Add Comment
Please, Sign In to add comment